From patchwork Mon Aug 19 23:03:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 171736 Delivered-To: patches@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3595845ily; Mon, 19 Aug 2019 16:03:37 -0700 (PDT) X-Received: by 2002:aa7:8007:: with SMTP id j7mr26610780pfi.154.1566255817676; Mon, 19 Aug 2019 16:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566255817; cv=none; d=google.com; s=arc-20160816; b=j9siepKr2zabmsCvLQVWNDd/OzZHaonP4bZd55pXQr8e5afK3tIXfWDgGssyS6hhDq PDyfFR7MsaqmauWBU8Rh5L43+Qpe+QOXt/uW7YycRlzx1wjKdYmNle4B3+zYWGJ7mYjG 9h4OzT9r0eb0/falsR54QR0LATfiJL+5a+gA6H9hlCd0O24b68RtjiOCNJRy+sqn3zy0 /Zi7rFUmDpS7WGdFduIrmwlJ8cuopPckIraLS7quYHEXGRljlsXm7+zKVzMJkX6MLASX SuZtWb/Tq9aUD9T4y+C+5pPvVhkLFlsy5n9rIrKILgugyYtou3cP44LjnThKMz3hhaG9 FQEA== 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=/TlFFqIFbnuilFAvaZfscTqwSZVj/Gq+GQdJwcM1CA0=; b=hO9qfbuzXiDp/+7dHBRO1cjLcIuRMP3e6mRVRPf06PP+JJlp1RQz45z0uw1CP0ff5q B8Mb485fT9GRpnr+gCH2eKc+UZg/49iYZ7H5rwWimtFLRZJUMUPtJ1g6R/BvHZ9QWqQJ 5objONk8T4aBDb+eSjlcBLRSxwXbu03szdxsR+7iTr2THwiR5COu7SRGhZukTSY7c4pk SkpbGLyN2y93zdVGAvexQy496OzKgrrtJRgbOgvsOKDhgjOGV9BHCAytqp5hxvbXhcYC LiXvWKPDGuNl0Xl/BuMy32DzkVsikjs4RepGCID80+TQTquCd/UeOkuvFVV3u1GQ4Ini XVcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hgcwVUUF; 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 c13sor2090577pfn.38.2019.08.19.16.03.37 for (Google Transport Security); Mon, 19 Aug 2019 16:03:37 -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=hgcwVUUF; 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=/TlFFqIFbnuilFAvaZfscTqwSZVj/Gq+GQdJwcM1CA0=; b=hgcwVUUFRgX2aXe6K9MjaC4D+BanRss2Q2jrB1rrfCaADjTGn5sDv45eNjCcFyKLIe PIvYw89RcFgIn81zquWXrnuIUpzGxzJtQUtvEyNosp9u+9O3t3gIEgbk1aZihbQcZTwh 4fgPQ3madaFPBa+0VTrK2bKZd6MXpkDQ07NcXmikunyUGTBw6GBZ/edjVUT3iRiGrlZR JmRZ4jC8OrPe4WC6cHNXI18P9S66KgwPlv5+OmKp/4tmvLqnY09VpNDvcyxgyn/A7jpB DJcPeA+nnEyZ7p4oGU1SQ4sc80J9YwV8BTIoHgux3TWBzOPHNpdmiqxLEmKO10DQelVM HdDQ== 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=/TlFFqIFbnuilFAvaZfscTqwSZVj/Gq+GQdJwcM1CA0=; b=k7UrcfEuxzVj8M7E6NU9HazBm0P8iHAsKEpMW0MPAccB+Xz4DwG/L8uW8FnkMzOkVy y1pCkIIQTRa8Rc0xQOWkfer5ctK7JY5lk/uL89NyBHPj1MJtJCUzanBHwoeKxq/VfFe8 61Efwq+3aRUkN5Y7HMoEnGCKGv9P6WzGPZQbExmM1CSRLBNv+7h0P4KHGBUynmDCpL1M 6sc1ley+KwsN2zmEVKWvMh4NDjlg8zsyrIxYSRGwxRy3twbXJ/pRiZgyKq/BUQTtGX7y +3Ax8HBAjABvoHuOU4NJNEfoyfAL06kjcrDKUllvyKFXEKCgr8C6/MEZjiP7iTUgeaCY fc0w== X-Gm-Message-State: APjAAAXyxTqBYpx1Gjy/5xzWLm17fb8RGX5TT3G6C1DReJHa7dqjO7xu m0V5ZMRwSKJDsN4LZQmilwiHljbIeeKWAg== X-Google-Smtp-Source: APXvYqyWqYQNrDuG8LREU+B0avmfYSvzuL9p3zVo2uDjdgihR2paZfBlw3v2n8AwccWd68HPPn+P0w== X-Received: by 2002:a62:1a45:: with SMTP id a66mr27430092pfa.142.1566255815916; Mon, 19 Aug 2019 16:03:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 16:03:35 -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 07/25] drm: kirin: Rename ade_crtc to kirin_crtc Date: Mon, 19 Aug 2019 23:03:03 +0000 Message-Id: <20190819230321.56480-8-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 As part of refactoring the kirin driver to better support different hardware revisions, this patch renames the struct ade_crtc to kirin_crtc. The struct kirin_crtc will later used by both kirin620 and future kirin960 driver, and will be moved to a common kirin_drm_drv.h in a future patch 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 --- .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 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 19d279167694..fce374ec69e8 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -38,8 +38,8 @@ #define OUT_OVLY ADE_OVLY2 /* output overlay compositor */ #define ADE_DEBUG 1 -#define to_ade_crtc(crtc) \ - container_of(crtc, struct ade_crtc, base) +#define to_kirin_crtc(crtc) \ + container_of(crtc, struct kirin_crtc, base) #define to_kirin_plane(plane) \ container_of(plane, struct kirin_plane, base) @@ -56,9 +56,9 @@ struct ade_hw_ctx { int irq; }; -struct ade_crtc { +struct kirin_crtc { struct drm_crtc base; - struct ade_hw_ctx *ctx; + void *hw_ctx; struct work_struct display_reset_wq; bool enable; }; @@ -70,7 +70,7 @@ struct kirin_plane { }; struct ade_data { - struct ade_crtc acrtc; + struct kirin_crtc crtc; struct kirin_plane planes[ADE_CH_NUM]; struct ade_hw_ctx ctx; }; @@ -184,8 +184,8 @@ static bool ade_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - struct ade_crtc *acrtc = to_ade_crtc(crtc); - struct ade_hw_ctx *ctx = acrtc->ctx; + struct kirin_crtc *kcrtc = to_kirin_crtc(crtc); + struct ade_hw_ctx *ctx = kcrtc->hw_ctx; adjusted_mode->clock = clk_round_rate(ctx->ade_pix_clk, mode->clock * 1000) / 1000; @@ -317,8 +317,8 @@ static void ade_set_medianoc_qos(struct ade_hw_ctx *ctx) static int ade_crtc_enable_vblank(struct drm_crtc *crtc) { - struct ade_crtc *acrtc = to_ade_crtc(crtc); - struct ade_hw_ctx *ctx = acrtc->ctx; + struct kirin_crtc *kcrtc = to_kirin_crtc(crtc); + struct ade_hw_ctx *ctx = kcrtc->hw_ctx; void __iomem *base = ctx->base; if (!ctx->power_on) @@ -332,8 +332,8 @@ static int ade_crtc_enable_vblank(struct drm_crtc *crtc) static void ade_crtc_disable_vblank(struct drm_crtc *crtc) { - struct ade_crtc *acrtc = to_ade_crtc(crtc); - struct ade_hw_ctx *ctx = acrtc->ctx; + struct kirin_crtc *kcrtc = to_kirin_crtc(crtc); + struct ade_hw_ctx *ctx = kcrtc->hw_ctx; void __iomem *base = ctx->base; if (!ctx->power_on) { @@ -347,7 +347,7 @@ static void ade_crtc_disable_vblank(struct drm_crtc *crtc) static void drm_underflow_wq(struct work_struct *work) { - struct ade_crtc *acrtc = container_of(work, struct ade_crtc, + struct kirin_crtc *acrtc = container_of(work, struct kirin_crtc, display_reset_wq); struct drm_device *drm_dev = (&acrtc->base)->dev; struct drm_atomic_state *state; @@ -358,9 +358,9 @@ static void drm_underflow_wq(struct work_struct *work) static irqreturn_t ade_irq_handler(int irq, void *data) { - struct ade_crtc *acrtc = data; - struct ade_hw_ctx *ctx = acrtc->ctx; - struct drm_crtc *crtc = &acrtc->base; + struct kirin_crtc *kcrtc = data; + struct ade_hw_ctx *ctx = kcrtc->hw_ctx; + struct drm_crtc *crtc = &kcrtc->base; void __iomem *base = ctx->base; u32 status; @@ -377,7 +377,7 @@ static irqreturn_t ade_irq_handler(int irq, void *data) ade_update_bits(base + LDI_INT_CLR, UNDERFLOW_INT_EN_OFST, MASK(1), 1); DRM_ERROR("LDI underflow!"); - schedule_work(&acrtc->display_reset_wq); + schedule_work(&kcrtc->display_reset_wq); } return IRQ_HANDLED; @@ -499,11 +499,11 @@ static void ade_dump_regs(void __iomem *base) { } static void ade_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state) { - struct ade_crtc *acrtc = to_ade_crtc(crtc); - struct ade_hw_ctx *ctx = acrtc->ctx; + struct kirin_crtc *kcrtc = to_kirin_crtc(crtc); + struct ade_hw_ctx *ctx = kcrtc->hw_ctx; int ret; - if (acrtc->enable) + if (kcrtc->enable) return; if (!ctx->power_on) { @@ -516,27 +516,27 @@ static void ade_crtc_atomic_enable(struct drm_crtc *crtc, ade_display_enable(ctx); ade_dump_regs(ctx->base); drm_crtc_vblank_on(crtc); - acrtc->enable = true; + kcrtc->enable = true; } static void ade_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state) { - struct ade_crtc *acrtc = to_ade_crtc(crtc); - struct ade_hw_ctx *ctx = acrtc->ctx; + struct kirin_crtc *kcrtc = to_kirin_crtc(crtc); + struct ade_hw_ctx *ctx = kcrtc->hw_ctx; - if (!acrtc->enable) + if (!kcrtc->enable) return; drm_crtc_vblank_off(crtc); ade_power_down(ctx); - acrtc->enable = false; + kcrtc->enable = false; } static void ade_crtc_mode_set_nofb(struct drm_crtc *crtc) { - struct ade_crtc *acrtc = to_ade_crtc(crtc); - struct ade_hw_ctx *ctx = acrtc->ctx; + struct kirin_crtc *kcrtc = to_kirin_crtc(crtc); + struct ade_hw_ctx *ctx = kcrtc->hw_ctx; struct drm_display_mode *mode = &crtc->state->mode; struct drm_display_mode *adj_mode = &crtc->state->adjusted_mode; @@ -548,8 +548,8 @@ static void ade_crtc_mode_set_nofb(struct drm_crtc *crtc) static void ade_crtc_atomic_begin(struct drm_crtc *crtc, struct drm_crtc_state *old_state) { - struct ade_crtc *acrtc = to_ade_crtc(crtc); - struct ade_hw_ctx *ctx = acrtc->ctx; + struct kirin_crtc *kcrtc = to_kirin_crtc(crtc); + struct ade_hw_ctx *ctx = kcrtc->hw_ctx; struct drm_display_mode *mode = &crtc->state->mode; struct drm_display_mode *adj_mode = &crtc->state->adjusted_mode; @@ -562,13 +562,13 @@ static void ade_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_crtc_state *old_state) { - struct ade_crtc *acrtc = to_ade_crtc(crtc); - struct ade_hw_ctx *ctx = acrtc->ctx; + struct kirin_crtc *kcrtc = to_kirin_crtc(crtc); + struct ade_hw_ctx *ctx = kcrtc->hw_ctx; struct drm_pending_vblank_event *event = crtc->state->event; void __iomem *base = ctx->base; /* only crtc is enabled regs take effect */ - if (acrtc->enable) { + if (kcrtc->enable) { ade_dump_regs(base); /* flush ade registers */ writel(ADE_ENABLE, base + ADE_EN); @@ -1007,7 +1007,7 @@ static int ade_drm_init(struct platform_device *pdev) struct drm_device *dev = platform_get_drvdata(pdev); struct ade_data *ade; struct ade_hw_ctx *ctx; - struct ade_crtc *acrtc; + struct kirin_crtc *kcrtc; struct kirin_plane *kplane; enum drm_plane_type type; int ret; @@ -1021,8 +1021,8 @@ static int ade_drm_init(struct platform_device *pdev) platform_set_drvdata(pdev, ade); ctx = &ade->ctx; - acrtc = &ade->acrtc; - acrtc->ctx = ctx; + kcrtc = &ade->crtc; + kcrtc->hw_ctx = ctx; ret = ade_dts_parse(pdev, ctx); if (ret) @@ -1046,15 +1046,15 @@ static int ade_drm_init(struct platform_device *pdev) } /* crtc init */ - ret = ade_crtc_init(dev, &acrtc->base, &ade->planes[PRIMARY_CH].base); + ret = ade_crtc_init(dev, &kcrtc->base, &ade->planes[PRIMARY_CH].base); if (ret) return ret; /* vblank irq init */ ret = devm_request_irq(dev->dev, ctx->irq, ade_irq_handler, - IRQF_SHARED, dev->driver->name, acrtc); + IRQF_SHARED, dev->driver->name, kcrtc); - INIT_WORK(&acrtc->display_reset_wq, drm_underflow_wq); + INIT_WORK(&kcrtc->display_reset_wq, drm_underflow_wq); if (ret) return ret;