From patchwork Tue Apr 23 23:20:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162741 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp4354554jan; Tue, 23 Apr 2019 16:21:06 -0700 (PDT) X-Received: by 2002:a17:902:6bc8:: with SMTP id m8mr19611827plt.21.1556061666886; Tue, 23 Apr 2019 16:21:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556061666; cv=none; d=google.com; s=arc-20160816; b=Ib2Dg5PT5vtKnBxXl02GJ/MPS0L7icmn45+J4wViROd0upUVAUqoH73Pe9ZKKdD2CI sR8E22x+eX8kJ1UsZfzv9lUVY75eePYyPC32Y9YrDPa3WPKv3THIiEYcu+fK9RUlEClC qpZAyOdRI0KI8X/b4qMUGXRP3PVss4c/DkMQC8QUQ4SokXGD09PzLRO5JutHE1vtwCcA Y/0shyzodUPn0JcVwrMjJu8WNlD4iI6TI/+2x1WemsBMfCRVsD4pNTQ/bB1mCt+Tjycq 4hRmGIBN5E8+Fr441GuQcRmTeyKZa4OlB9AVw4hICUHIncxs+/W0YDOM5qS2aRSkJUVz w5EQ== 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=vuhHNfWnMx8uWZhY+QeUk1qBtGP4f5NldA6jQRHm+6s=; b=IsRNhbWp5vok5Meqv9MwjHtxAAhO7Uh2u97Yf1uYhtFZlSWImOYX2QUs9X1YAeSkRb jkqzY+4wUhvrYluCpCkn91tfGnvjgezkNAqcNLWsZYWpgux6y/EHEB7dYL/u+NxRRnqP nd9pHVu+Bcg6ZpFZxMJP8e4fcJNUKYT66N9u9HJfkcmUSweAqKOwLX+6R7jNW3GrOPZA B6tuM6fDmrr2WpuXUGGHn+CAYH5/h8M96H8GQVEErOPtzPDSnhR3iL9d/snKXXpLEuJw 4EVHvoPcfb0a6hBrAD0VvRuQpXkUWOzU9Y5qv9T0dIR1Z08oGIQpVdzW6LeXDHMs4Eu4 Xz1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NQairEvL; 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 p66sor19581917pfp.35.2019.04.23.16.21.06 for (Google Transport Security); Tue, 23 Apr 2019 16:21:06 -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=NQairEvL; 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=vuhHNfWnMx8uWZhY+QeUk1qBtGP4f5NldA6jQRHm+6s=; b=NQairEvLvSGh1SguVJ2rpCemcsun3HCniG1nJhW94XLuu7Ucb+iUdicNtGfflaMyUt MkrpWYirbCzWneqOb6R778tc9wbpCvxtcsrXfukpO27qUFuVsgTpP46Y5lrOKq9SR+zY ggMFp7R1m+u3dwTHZ2tIJW17pfMqlvGUsrZChyaGacT8cyxLEUyN9Qfc6jSMCBMGOZLl tHl5Phh9o8xC65tjxfg+VOplgFnhiaYcsGeR9QqyVVZJdXv+hRopVBIckebvJOQpVQNj FbpPMtEnmslUKSHEwPR1cmD/JV6yo9G1WlwxkY7QWyb2LCkNk64yJ7ARC+xgLv0rkL9c YD/Q== 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=vuhHNfWnMx8uWZhY+QeUk1qBtGP4f5NldA6jQRHm+6s=; b=gWXHlR6tOQx27Y5ucyTPL+BITHjHB3m2c35j3pljuJHe6WFg+cRCM0qVjXcJlZVyUu XXMRlQwMxgJ5gYpMeF/bMZWw7MjmRwUbQ6cBIHvGRsIH9nHIFo3mm8ioTVPazJrx8uRE Y5+r5IdswKD3Nlf3d8A8Vfp7UwoFnuHiZ4fJT9MPbodOWveBxz/5J/II2YZQWrbZiPsl bkVqTr23h+NWUOaAsuiLsaSYEeQK1zJk+VXxXKuuh+rbRFJbwqOxMVFQ2dRdDlhcwUyU PdlzwSA9ZSd0hRzJZ1BYza5vRb7DAKCr6+Dub7cT0Dlavu4wF1vuc+Q7bwN3JswgrWqD sMTA== X-Gm-Message-State: APjAAAU8gOAJw6PJQ2enRlkFNJ3Fo1iRqOn5fkj687fycghFS5wfcx8k ik0eZ5qBL6+YWH8rzQBf24TtpEDy X-Google-Smtp-Source: APXvYqyU5nndpzr0QoWum+fQJyhtInddKfe6IAExSW1yiBxCfRbTNkbhkh/AY20A0+K5tMxuOD6cUA== X-Received: by 2002:a62:1c87:: with SMTP id c129mr4927145pfc.113.1556061666498; Tue, 23 Apr 2019 16:21:06 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id c28sm6984235pgm.42.2019.04.23.16.21.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Apr 2019 16:21:05 -0700 (PDT) From: John Stultz To: lkml Cc: Xu YiPing , Xinliang Liu , Rongrong Zou , Xinwei Kong , Chen Feng , David Airlie , Daniel Vetter , dri-devel , John Stultz Subject: [PATCH 04/25] drm: kirin: Remove uncessary parameter indirection Date: Tue, 23 Apr 2019 16:20:35 -0700 Message-Id: <1556061656-1733-5-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556061656-1733-1-git-send-email-john.stultz@linaro.org> References: <1556061656-1733-1-git-send-email-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: Xinliang Liu Cc: Rongrong Zou Cc: Xinwei Kong Cc: Chen Feng Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel 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.7.4 diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index beb2a3c..56a55d9 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,