From patchwork Wed Aug 14 18:46:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 171338 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1203093ily; Wed, 14 Aug 2019 11:47:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxZlRhu8mRKhokPRS1pqLptOAYDpbMtWVUF+Lj3z2o5YNAbPebGO0J5y98R1vnL2duz6Z7 X-Received: by 2002:aa7:9abc:: with SMTP id x28mr1434440pfi.234.1565808442524; Wed, 14 Aug 2019 11:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565808442; cv=none; d=google.com; s=arc-20160816; b=H2sU3JELjhnX2XVDbfNufm+W7+JZsqlsEAntEa5EcmBo1CkPFFR0S8PqyvqV8SOkIo mSc64tH8Cgr3G1XWlMNJh6MUF6j9iDL5jYhFjWOCAL4WWoSqxb/xIn1Bhud6zlVNVNWj 8Yvy5FbGZ5Z3BehwqgDNYsTLbJFSBayckkILtqtrA5ubzydR3bDwr57lAJYm9ghUgb5y OOZZbw3Y9SQs3nUMN3dQQedtKfz9vB/LuCMOnoHh8yQUYaqTTycQU8TTuCm/+t2jBY4A KtxMsA7+8+Xk2SGEahIMZLzB5GOzc5+bqNPnoPsmY86K+FzNNvmaEG3he7GFYG2iUmn9 aBkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:delivered-to; bh=dXdGyD47DqRrQGekIwrkop42bOLoEGJHjA44hlg3sL8=; b=A1AKB484el2ihak8ZvADYAhStrj95rQFgvkOrCbj+XE3nYhTwlhCve8KkduA1bs1Mo Cy2DMKSutjSrt0Nw6o2nZRoO6YyiXImpGp1XqOmVvBNsACtNlbkKlwS5augx6A74Hh/m ppafM4uBIkaiX6SR8KfqwtvK9aMxTT2bYqJVYoi6sgqHWwPpl47nw+udbptrnESiO1Da 7KJcn73MN2NyifQ+4qosX/mgWx+5HlHsEGpJQIGIeVU6oqBIutaRw8scd/9buT9LviHK 7A6QQiINV5LMtFpT2lvprmiAZLHlSX69D+nJBU+mtyYP2Dof8nGG73bJpMn3tiocgXlq hibQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id u191si318157pgd.281.2019.08.14.11.47.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Aug 2019 11:47:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 174AC6E7D7; Wed, 14 Aug 2019 18:47:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id A94D26E7D5 for ; Wed, 14 Aug 2019 18:47:15 +0000 (UTC) Received: by mail-pf1-x444.google.com with SMTP id 196so6932723pfz.8 for ; Wed, 14 Aug 2019 11:47:15 -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=lvs2sCjFBJ8XOKE0DuOatJnI8ohKITzd4uZXKHqLHj4=; b=CqugBCtSH3ImjLWwjTa7e03/NKTvMdbpWP7a+h1w5hw5Op3T1gHSMSkwB7xjN8E1rI rih0PAAE0bs5CUgCwDnC029k31LS9fkUfammoCsEXwz9LJWHcf80dpNpaCMmLTdl58Oj 3m5kDaB+1HRqnxCFq7nA2q/GBjrkbDeu6mkapJgsJNNSAIPsxKso3IgX4AzSeLS1goAv Y5qWh0tpB2PLLE29/RbEnriBIdo7JHoxrfYQAOGQLcQ8HuU5gR1ULmuu8VYza8TNCXgk Q7GsX+ED5X8dy79VM3vzrvDu//J93Yg+0MrpEnvIGdpVJ0H+f+fboHhjTO5GsbKQzRWg ZFgA== X-Gm-Message-State: APjAAAVMe1FQFm1G48Cul4m7nOOLEDDoEZQX7IAjZi78gGjvSm87U1N6 JUjYnE40p4RJwVc4JXkv7xx6jQ== X-Received: by 2002:a62:2f06:: with SMTP id v6mr1377305pfv.195.1565808434877; Wed, 14 Aug 2019 11:47:14 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id y16sm610855pfc.36.2019.08.14.11.47.13 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 14 Aug 2019 11:47:14 -0700 (PDT) From: John Stultz To: lkml Subject: [RESEND][PATCH v3 05/26] drm: kirin: Remove uncessary parameter indirection Date: Wed, 14 Aug 2019 18:46:41 +0000 Message-Id: <20190814184702.54275-6-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190814184702.54275-1-john.stultz@linaro.org> References: <20190814184702.54275-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=lvs2sCjFBJ8XOKE0DuOatJnI8ohKITzd4uZXKHqLHj4=; b=Qy1YElo0lJ4Mf6kN0jaRh2yIv0ViKyJtzsyZBUhZluecH4U150hrQ83VWkx8QzXBK3 AV5sKvB1a7h+tqmBY3lJgKcd+lbjRio/sK3GvLSgX15cDSD8R7yBqKKpvu2iBeuGwEXq AqWDp/GasCV/C4aRRFVUSA2m2SN8HqAxne8QcM0ZjFLZCKgGK86eMw5Bm2KkHZ3e07nu MzWUDDIBuqrtQAdb5uhOjYFDhO0i2hT3t31UiihjKQ9fyd+yuDxvQK9D474U6YU3kDtS aWPmCZOZLa1ZNBh++OUx3a0AOC+nR3ofGKP1c7oGwbuha8y8tJN1h+UGHcvjrNw4TKHC P2Nw== 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 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 9a9e3b688ba3..756aefd5bcff 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,