From patchwork Tue Aug 20 23:06:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11104809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B69F1398 for ; Tue, 20 Aug 2019 23:06:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3364C233A0 for ; Tue, 20 Aug 2019 23:06:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3364C233A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 553CF6E8B2; Tue, 20 Aug 2019 23:06:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by gabe.freedesktop.org (Postfix) with ESMTPS id 15DE36E8B2 for ; Tue, 20 Aug 2019 23:06:36 +0000 (UTC) Received: by mail-pl1-x641.google.com with SMTP id bj8so227299plb.4 for ; Tue, 20 Aug 2019 16:06:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sMMNrNPEyr5ojRnGMae00OuNvWMz/twMj42dMKt7nWI=; b=KVdBPo+bMpLIaW9Lyoj/fky5kPFMD9GLlEnmmf+0iKSDvJlbOe2JhH33AwScHvADFj XSBSD4JvsCK5FNE1WwnjAF9202ppWoKEL1NWgPz2hnbXRSWg8TqXZdf2GXl8wTNAnweX Q2C8SjiRhp5TT68BwUdMH+fq84Vug6PhCirC6MLwUM/pT0Zt4CWbn1QN1Wfy6BR+xO4r AVygh1AdjG3knsbnkMs2mfDD8Y9knLpiC7WS+MUr29KLzUTS/miCn1uCMQ7D589JUS69 E2NQ06RBJPpZmsVKIahxvd1hFKEDolPXu8HXokjpUN8p079Mt6TEfCUNweuC77OplUR1 0G6Q== X-Gm-Message-State: APjAAAWxGG25B4t/c8TxtptRwdNTnwSfQ8jEj0q2xDd4NSB/zs67XQ3i riW9CXnhOtNXRQwl2I56E8sQFg== X-Google-Smtp-Source: APXvYqxvBHkagafXH1CnZDG8/J2NJtGYyNSNZb9XstBXBy84ZynIq7jqLkNKO8FL/LW4w2k+JTFkdA== X-Received: by 2002:a17:902:1105:: with SMTP id d5mr31408400pla.197.1566342395612; Tue, 20 Aug 2019 16:06:35 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id q4sm27564747pff.183.2019.08.20.16.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 16:06:34 -0700 (PDT) From: John Stultz To: lkml Subject: [PATCH v5 04/25] drm: kirin: Remove uncessary parameter indirection Date: Tue, 20 Aug 2019 23:06:05 +0000 Message-Id: <20190820230626.23253-5-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190820230626.23253-1-john.stultz@linaro.org> References: <20190820230626.23253-1-john.stultz@linaro.org> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sMMNrNPEyr5ojRnGMae00OuNvWMz/twMj42dMKt7nWI=; b=IB7XgmYvkwQEJtHZlzt4hH6T5NopJkfBoayNv/GodStcZXxTvSt35M0eDDE9K3LV2X t34RV1DW6QSCYi7l5B5gjU/nC/lzfgqYLQUgPK/FHUm7Q90eU6Xs99OSlhMpSBUAFZu/ Yimi+ol1E2NCdt3K/+oziOzE6uaD+OHWte422JmbCriql6H9kOHQKD/tsCDvM56LPSqq xcAGaApq98JTw0Q04lqdwrHP703sVt3Vds/7vEiDMpD3keehlJIiDsFeg+/lMwH4ucqu 0nxmOsfgPHJW/SjDgWdvnebrKFcXAhGduTdxDSkzdCzBM1GIttYl8RXIDDS2rgs60whC iuUg== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xu YiPing , David Airlie , dri-devel , Xinliang Liu , Rongrong Zou , Sam Ravnborg MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Xu YiPing In a few functions, we pass in a struct ade_crtc, which we only use to get to the underlying struct ade_hw_ctx. Thus this patch refactors the functions to just take the struct ade_hw_ctx directly. Cc: Rongrong Zou Cc: Xinliang Liu Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel Cc: Sam Ravnborg Acked-by: Xinliang Liu Reviewed-by: Sam Ravnborg Signed-off-by: Xu YiPing [jstultz: reworded commit message] Signed-off-by: John Stultz --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index d972342527b8..45351934d919 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -210,11 +210,10 @@ static void ade_set_pix_clk(struct ade_hw_ctx *ctx, adj_mode->clock = clk_get_rate(ctx->ade_pix_clk) / 1000; } -static void ade_ldi_set_mode(struct ade_crtc *acrtc, +static void ade_ldi_set_mode(struct ade_hw_ctx *ctx, struct drm_display_mode *mode, struct drm_display_mode *adj_mode) { - struct ade_hw_ctx *ctx = acrtc->ctx; void __iomem *base = ctx->base; u32 width = mode->hdisplay; u32 height = mode->vdisplay; @@ -301,9 +300,8 @@ static void ade_power_down(struct ade_hw_ctx *ctx) ctx->power_on = false; } -static void ade_set_medianoc_qos(struct ade_crtc *acrtc) +static void ade_set_medianoc_qos(struct ade_hw_ctx *ctx) { - struct ade_hw_ctx *ctx = acrtc->ctx; struct regmap *map = ctx->noc_regmap; regmap_update_bits(map, ADE0_QOSGENERATOR_MODE, @@ -515,7 +513,7 @@ static void ade_crtc_atomic_enable(struct drm_crtc *crtc, return; } - ade_set_medianoc_qos(acrtc); + ade_set_medianoc_qos(ctx); ade_display_enable(acrtc); ade_dump_regs(ctx->base); drm_crtc_vblank_on(crtc); @@ -545,7 +543,7 @@ static void ade_crtc_mode_set_nofb(struct drm_crtc *crtc) if (!ctx->power_on) (void)ade_power_up(ctx); - ade_ldi_set_mode(acrtc, mode, adj_mode); + ade_ldi_set_mode(ctx, mode, adj_mode); } static void ade_crtc_atomic_begin(struct drm_crtc *crtc, @@ -558,7 +556,7 @@ static void ade_crtc_atomic_begin(struct drm_crtc *crtc, if (!ctx->power_on) (void)ade_power_up(ctx); - ade_ldi_set_mode(acrtc, mode, adj_mode); + ade_ldi_set_mode(ctx, mode, adj_mode); } static void ade_crtc_atomic_flush(struct drm_crtc *crtc,