Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2740841pxb; Mon, 31 Jan 2022 03:21:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3p33RvXvr4RRh4ADcFrMqqKON5L2OwTm+xNwwxLfB3BkM8MYJB+Tgl8s372HkeBXgi3Sd X-Received: by 2002:a17:907:1c0c:: with SMTP id nc12mr16505475ejc.653.1643628065062; Mon, 31 Jan 2022 03:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643628065; cv=none; d=google.com; s=arc-20160816; b=R2SaW674BgS9CoehtLIFOWwWRcVV/+3mFHrjY0yXQWaBBWmJfpeEnaV3bbpH7cgSHX 80Z2QqaDj4juKB7/5ejgEDOSDh6ImexhOsydQgKZbQ32DMskZ5fVhwZpEzoglAq3COar PcjGo0WCPqkc6rhM62uG9hZqzy219GshftNoWxkUCLEovcAFuhGLQcK8LAhM9CW2Pu2z AuSSSjxEauwYzyl40DCi4l7NQtkJ9njeiSfL2swgLUUqDz31hA5cU6KR8a02LBTB6pKs HBgItON+vAQ+xlbpX8Bw4s+6gadjmpdFfEnVvb4h2khZp5nc0DrGmnO8ArOSzdwkDKR2 Z1jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=D7QuqMGEl3BqQKCGx02N9gSOWu/ufTnpcHOP9Ntgtic=; b=C6Y8/9zJuXpd83G0+3lWE+IT6gKRMb4gDPystP2cb9MtXTMDMeMaqStLGMVpiV3/Wc bq+G+OSpfpSosNkjzCCkjVqDPJbBrPhD5tKrkK/kXW5yc1lSz+EH8rllHHianUJ/9XbK +hizrttbQ0Bdvt9vU/pNLcu1oA7qLlj2TDCs2uNxPDtvLSu0NuPA8ORSliqQ9xQMks8a aKgN7u2AxrNWuEKBQ3oH6XdzwBDep9JRY4E0AzIlM4BvyY6H0eL8bQTUnSrdOvFKMmmX 9kpLZjy9CAxhV6164W1/j698/zBmCv4NsAkNEtunYbOwdxLQvs8QUwdLdJ1xhNvoMi44 Eitg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cHj+EtmH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb41si8846956ejc.425.2022.01.31.03.20.38; Mon, 31 Jan 2022 03:21:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cHj+EtmH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349960AbiA1Qef (ORCPT + 99 others); Fri, 28 Jan 2022 11:34:35 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:39610 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231221AbiA1Qed (ORCPT ); Fri, 28 Jan 2022 11:34:33 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A5941B80D74; Fri, 28 Jan 2022 16:34:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73E4EC340E0; Fri, 28 Jan 2022 16:34:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643387671; bh=vKBJqy3HgSyoQ3Szu6K6a4NfdLf+ztljFywvbKYyDgg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=cHj+EtmHQvt0dtQaFbWX4vq+C5Cv4L/AEIDvGjyxEz/pqmD2NVhCupOcsjEfXG8MA frmRpaigGKUUH6R7rntbgCkw3T7XQDp3zNK4vmFTDaeXHxchjicsMf5O3Et7Sk3ibv cInHQ3wlpVK2wrLxekxevlPickRXlJUmNkasKjFE3ZO3JqPkeQN4V5buTTnek7Yd8q j5poeCM9aClvFIqp20DqDa8GMLtddf9xwth/I939TS/cnAVuZYsLXkYU4tLwejvFSV RdNBNlECk+BZMW+VWoRIUB5IDd/IaJLqDj5GHWPk5zSyHNAHBzLqq5zTNGgvX/LOif U0YnKEKfh8fZA== Received: by mail-ed1-f41.google.com with SMTP id m11so10859007edi.13; Fri, 28 Jan 2022 08:34:31 -0800 (PST) X-Gm-Message-State: AOAM531v/62fgYSXMkDdNcFrDoNSG8f3UaduGhfdfS0lvJaNrIr8ZX2w rL+3crlIJtpyL5ISqPizg5wtSGxmrP6o3mUGSQ== X-Received: by 2002:a05:6402:4401:: with SMTP id y1mr8955863eda.215.1643387669820; Fri, 28 Jan 2022 08:34:29 -0800 (PST) MIME-Version: 1.0 References: <20220128120718.30545-1-yongqiang.niu@mediatek.com> <20220128120718.30545-4-yongqiang.niu@mediatek.com> In-Reply-To: <20220128120718.30545-4-yongqiang.niu@mediatek.com> From: Chun-Kuang Hu Date: Sat, 29 Jan 2022 00:34:18 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1, 3/4] drm/mediatek: split postmask component To: Yongqiang Niu Cc: Chun-Kuang Hu , Rob Herring , Matthias Brugger , Philipp Zabel , David Airlie , Daniel Vetter , Jassi Brar , Fabien Parent , Dennis YC Hsieh , DTML , Linux ARM , "moderated list:ARM/Mediatek SoC support" , linux-kernel , DRI Development , Project_Global_Chrome_Upstream_Group@mediatek.com, Hsin-Yi Wang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Yongqiang: Yongqiang Niu =E6=96=BC 2022=E5=B9=B41=E6=9C= =8828=E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=888:07=E5=AF=AB=E9=81=93= =EF=BC=9A > > add postmask private data for differnt soc support > > Signed-off-by: Yongqiang Niu > --- > drivers/gpu/drm/mediatek/Makefile | 1 + > drivers/gpu/drm/mediatek/mtk_disp_drv.h | 8 + > drivers/gpu/drm/mediatek/mtk_disp_postmask.c | 155 +++++++++++++++++++ > drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 30 +--- > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 + > drivers/gpu/drm/mediatek/mtk_drm_drv.h | 1 + > 6 files changed, 170 insertions(+), 27 deletions(-) > create mode 100644 drivers/gpu/drm/mediatek/mtk_disp_postmask.c > > diff --git a/drivers/gpu/drm/mediatek/Makefile b/drivers/gpu/drm/mediatek= /Makefile > index 29098d7c8307..f26fe646ee2a 100644 > --- a/drivers/gpu/drm/mediatek/Makefile > +++ b/drivers/gpu/drm/mediatek/Makefile > @@ -5,6 +5,7 @@ mediatek-drm-y :=3D mtk_disp_aal.o \ > mtk_disp_color.o \ > mtk_disp_gamma.o \ > mtk_disp_ovl.o \ > + mtk_disp_postmask.o \ > mtk_disp_rdma.o \ > mtk_drm_crtc.o \ > mtk_drm_ddp_comp.o \ > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_drv.h b/drivers/gpu/drm/me= diatek/mtk_disp_drv.h > index 86c3068894b1..f4c21195c3ea 100644 > --- a/drivers/gpu/drm/mediatek/mtk_disp_drv.h > +++ b/drivers/gpu/drm/mediatek/mtk_disp_drv.h > @@ -81,6 +81,14 @@ void mtk_ovl_enable_vblank(struct device *dev, > void *vblank_cb_data); > void mtk_ovl_disable_vblank(struct device *dev); > > +int mtk_postmask_clk_enable(struct device *dev); > +void mtk_postmask_clk_disable(struct device *dev); > +void mtk_postmask_config(struct device *dev, unsigned int w, > + unsigned int h, unsigned int vrefresh, > + unsigned int bpc, struct cmdq_pkt *cmdq_p= kt); > +void mtk_postmask_start(struct device *dev); > +void mtk_postmask_stop(struct device *dev); > + > void mtk_rdma_bypass_shadow(struct device *dev); > int mtk_rdma_clk_enable(struct device *dev); > void mtk_rdma_clk_disable(struct device *dev); > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_postmask.c b/drivers/gpu/d= rm/mediatek/mtk_disp_postmask.c > new file mode 100644 > index 000000000000..fc04b445c2ed > --- /dev/null > +++ b/drivers/gpu/drm/mediatek/mtk_disp_postmask.c > @@ -0,0 +1,155 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright (c) 2021 MediaTek Inc. 2022 > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "mtk_disp_drv.h" > +#include "mtk_drm_crtc.h" > +#include "mtk_drm_ddp_comp.h" > + > +#define DISP_POSTMASK_EN 0x0000 > +#define POSTMASK_EN BIT(0) > +#define DISP_POSTMASK_CFG 0x0020 > +#define POSTMASK_RELAY_MODE BIT(0) > +#define DISP_POSTMASK_SIZE 0x0030 I think you should 'move' these definition not 'copy' them, so remember to remove them in mtk_drm_ddp_comp.c Regards, Chun-Kuang. > + > +struct mtk_disp_postmask_data { > + u32 reserved; > +}; > + > +/* > + * struct mtk_disp_postmask - DISP_POSTMASK driver structure > + */ > +struct mtk_disp_postmask { > + struct clk *clk; > + void __iomem *regs; > + struct cmdq_client_reg cmdq_reg; > + const struct mtk_disp_postmask_data *data; > +}; > +