From patchwork Thu Aug 1 03:44:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11070109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB8FB13B1 for ; Thu, 1 Aug 2019 03:45:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC5E3283C5 for ; Thu, 1 Aug 2019 03:45:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0214283C9; Thu, 1 Aug 2019 03:45:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 680FC283C5 for ; Thu, 1 Aug 2019 03:45:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E8A416E33D; Thu, 1 Aug 2019 03:44:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id 005976E33D for ; Thu, 1 Aug 2019 03:44:53 +0000 (UTC) Received: by mail-pl1-x643.google.com with SMTP id b7so31544494pls.6 for ; Wed, 31 Jul 2019 20:44:53 -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=uEC63dbARYEuBlfRwpeBf8DWjhjcKGFjgUkUYEDal2c=; b=W2QsAB5NR3Y5BWuKCv5b7e2vyU9ANFY0RtFyFUz0Rx3j2pvVrFmuB8fPSFQcikI4NF sY1ApA53kTnAGtS1MQxSFlj7xD3kkI/nV3HphrsfL1PYkBaaPvoNfp+N8B8vuXc0olDH iaxgXA+CWKSVmCshWjONYp6b5FW14++Liim8G03+DNx+5fogzKGPbohMeBtPfg/jfroz 6ZfUfCnDpuO6jggt1xheodKyweTR8A5cGElUkjPBpgytAkVAKSqvlf1Li771EM2GeqzI Suu7MXnSftYKRKniEz47q9m7KwgT/ySfhOFB2s03JPHYOnyInixTikK9lV4ofPtxlxg2 3ufA== X-Gm-Message-State: APjAAAXMYlH6+ofD+fLmJWSKbSAhtKGWA7LJcJk94Er+6dOkCRUB6o+f Lj8eJ/BbwWyLZGdeTurlYCweoQ== X-Google-Smtp-Source: APXvYqyFPrpF1ZkyRxvqbslTyH9glBjcshx+BTBA0o+bExSUREc6tM4oDj8esscrMOpDE+uS5xwn+A== X-Received: by 2002:a17:902:be03:: with SMTP id r3mr125030318pls.156.1564631093229; Wed, 31 Jul 2019 20:44:53 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id h70sm64775674pgc.36.2019.07.31.20.44.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 20:44:52 -0700 (PDT) From: John Stultz To: lkml Subject: [PATCH v3 05/26] drm: kirin: Remove uncessary parameter indirection Date: Thu, 1 Aug 2019 03:44:18 +0000 Message-Id: <20190801034439.98227-6-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190801034439.98227-1-john.stultz@linaro.org> References: <20190801034439.98227-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=uEC63dbARYEuBlfRwpeBf8DWjhjcKGFjgUkUYEDal2c=; b=vRnBOW0k+1Eg+RO86kU/byWqXZO9hXCUEe93OtnP7i+y4PXdVg5McCbFb1f5MRy2RS RohLpJZEfhAUCcVrDUb4vJTMC3q6GO8q2UR1COosrAVvIlhSW7420qSKLOgAD4WBBBw6 KuDaSl70QaywqUqFDR7ZWXlBwZRZtWIYue/PlUeHjPRHs5SgYp22jsIE4M4HeQocfLi6 1ozKxtqdd6b7RIv+ldjSbyUdFo7DrXj3juTCByOncD0xGM2b/a1fU27HmmShG6Lme4kN fkaXleAJopS0b084QGZsCIxoo+gSizQEvdoo7ELcJsG2EyyfGtisIYjfZ26JGy0R6rYM ZekQ== 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 , Rongrong Zou , Sam Ravnborg MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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: 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,