From patchwork Mon Aug 19 23:03:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 171733 Delivered-To: patches@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3595744ily; Mon, 19 Aug 2019 16:03:32 -0700 (PDT) X-Received: by 2002:a65:62c4:: with SMTP id m4mr21668933pgv.243.1566255811891; Mon, 19 Aug 2019 16:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566255811; cv=none; d=google.com; s=arc-20160816; b=LPS9siiVEM8Cz3iqsaENrwpORTKRxjMxcLJ8pkovy7+O/2cq376auNPiJMf9CeHfkL ojMJG1+pGlhFd+NssL5Cq8GqJGgU/hc5RGq8JjhbywG9262lWpnGqHPe3DVQVbdPjdne xcOLQzV6koxxh6rq2GIlKmBdqPoqVXz6MYN9tk6KSiXZjTMv0krZgECONQ+m3lZrEsxH 4ZfOt7SWvn4VZR+Clenl9WH8i2JO2u47VgJk3moku0hIL2/cUKH84hETrGwQtvUA7cGb Iob3fksDcQDf8lBaY/fnDvA+Eb79FJgiU1Rkkol1dSLU3fy6gE6lbHTyjEp/hVtw1VSx Uu2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sMMNrNPEyr5ojRnGMae00OuNvWMz/twMj42dMKt7nWI=; b=LtjLyuscPZG1qGehNfrEFeyXXdDMOjLoQQLR+QwrAzUPwMYReRsYEMgGaMjy0f21GY 5W48Aa4PUR1oAbWXysGhpO5oKy7B+eP5oAFccgfqKCrNGBUXsHUMpxCl8fMVZLtC61pn aGw2pI5zm4GJFdrBeXOtQohr6ZikdOdY7xgOkYPUJS1vqmewzCsk1x2d/C8G5sCboWtv 7lQggAAyoH0hBknXLWAiBGC4NPUEGE3Oqj4ieAw7wRhdBU0CwlINGr3qR1Sf5o/wbu8F nBYPgm5HQ3N0sDFC56we0a4eh/bXeq8srCHskZaLRHWGPcklB/pq0d3c1a7KpiJTp6du wutA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v1pVzeLV; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m133sor1860766pga.10.2019.08.19.16.03.31 for (Google Transport Security); Mon, 19 Aug 2019 16:03:31 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v1pVzeLV; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=v1pVzeLVL4i2QM63LjdIG16cVunIA1wDrcWnGZLbSWTLQuViS6sU6eb1I4/agTCUDc t+ZtZed/2TMX58/fHKD78fEnRgbm335xveJAkCf4IuL/CxHn5fjilap0t8YkgZxLj0qe 0bUhKZ5dwWZ0IdOmoETmqGDVV+rLoDNfdFgfidefk3MkiePU1eBGttWbh1PujCbR+A1u dR+mi7XMVr3BzexefjBdeM4Q3RhFtJT5LpJZWYnvW/OimWUTcNTYpKGLdLnhwwHTQjKH 8Rw5PJSi5pDJnKmKfkR7Vsm7n+MME4k4sIfpwYhJi5DVvKW126bvgv0PgVOxqlviKzFT /Sdg== 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=gzEj6zr2w1lHISWXubNYdxXHeieRau/HF1Q6lSBHYlyw4dv8FgUb22bbZdqyOq6+Aw /06tfEnHH5yqRbLy36JKgp95QBI6FGLqKlF8boZgraeG+z0lHvXxvn1MohQ9V7/t89iP Qoo0+FKXm9XeoWKFYYCJn6hTKrkiNmpaqBvYQc4quoceDFQy0YXPEb85FHFByfEECEem 8nISgNUp2qQ1d8xJv+QiYNX8sr5t9u9XJiEtCcEFO+hxZIZxASQQ/RachNrXyEOChePp BkaCYgAHDpnJbE0bMPhlCaohPVlbSQye7Fm48vEMk5rroCI2KXPycoy5Cjs/QYYD5pL2 E8Qw== X-Gm-Message-State: APjAAAXbEpLR+MuZD+J/bkbTOJqcpSwE/3j0HpI2nuc788L9Qj514bwR +J7+jmy0/lxl5SG7O8ZvzdywRb+s X-Google-Smtp-Source: APXvYqwb1NlOHGixTVWfKWtPeGyyczgYsv1+r1jQRk7O0IlMpAWvAHx5RA2P2qeq/kAH+R2FQKrW1Q== X-Received: by 2002:a65:6458:: with SMTP id s24mr21839142pgv.158.1566255811461; Mon, 19 Aug 2019 16:03:31 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id j15sm17256509pfr.146.2019.08.19.16.03.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 16:03:30 -0700 (PDT) From: John Stultz To: lkml Cc: Xu YiPing , Rongrong Zou , Xinliang Liu , David Airlie , Daniel Vetter , dri-devel , Sam Ravnborg , John Stultz Subject: [PATCH v4 04/25] drm: kirin: Remove uncessary parameter indirection Date: Mon, 19 Aug 2019 23:03:00 +0000 Message-Id: <20190819230321.56480-5-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190819230321.56480-1-john.stultz@linaro.org> References: <20190819230321.56480-1-john.stultz@linaro.org> 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(-) -- 2.17.1 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,