Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1098917ybg; Mon, 27 Jul 2020 07:54:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2icuIHwCnnj2S1PfJDSIaYnsRat3jjed8JRAB9CjUl28CiPjxlkW8imzrdTteJzKIguoX X-Received: by 2002:aa7:d283:: with SMTP id w3mr21727255edq.76.1595861683877; Mon, 27 Jul 2020 07:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595861683; cv=none; d=google.com; s=arc-20160816; b=gA0Dxj+2KkYn38B+PG0xtu8QvNAXqB80orsnIg8+4gyCVm11ADz/71mJx5KZP0A4r5 rsIvaQj2Zgu8JYjdRsGLft4FlRWTtKliodFY1PCNhWu9eHx3kFX1t6D5QxwOP/W6R7jg UEUXv1BVIKijPv5Q5aNnUWlEzctv6VCL7r7DjSdOGb4qMwAmvITt33w4YKw8/VDwCemG 1LgcvrRMcr+91apU9sCvV6o5hPubj6R7MPygz24YdjXQ+znaCeyFrlx4Rz7r6vcX9gnM rp75RlEk8TUUlqpklsaiuZyevqXglcSnEzJg+zQpmurensEEjBGzo79lQwotmF8pWSfD G+yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=XxIAVex272adoH15KUcQQlZkZ0RWg5OPZPnoQ+SiGm0=; b=mXGaKfoc/muPgJ1epm+nlyu9Cm2rKQEfJpJa3ncWpj36M21TagEcDOd7cGZXBiuESN lY4awkcjN6he1OYVpCA83IuTpsyiyZ+DUU+sZv/1JdqSs0pUFOt+hLpwf4y9GGJRf/6f FdJR5FFA53RjCvJA0oZcZVRhZPKPS6fGkCpBvEiMz5CBHpqvgKnfUmaF37RfIRRULkE+ axOxvRJTPHdiry+pspVMXlyWOe1mlgOjFV3aevNJSdfzZKGqhDA6n20NVKSFarG13E8v nSPEIVsBTouP7ZLQG9lz5LA+62DvLbVr/MrkLebsgjM4RAUcAuO0dUPTbBHQ4ra6ZCdl uKOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N6L+nvbc; 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 v23si2051908edw.343.2020.07.27.07.54.21; Mon, 27 Jul 2020 07:54:43 -0700 (PDT) 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=default header.b=N6L+nvbc; 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 S1729521AbgG0Ouz (ORCPT + 99 others); Mon, 27 Jul 2020 10:50:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:43988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727032AbgG0Ouy (ORCPT ); Mon, 27 Jul 2020 10:50:54 -0400 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 02C572173E; Mon, 27 Jul 2020 14:50:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595861454; bh=X2JcmQLapGD/be7xhyIu8ppnMrgOK1IeDnlemxXWS2Y=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=N6L+nvbc31b6FNedS/fMRDlLAFurRdNk0HPcMYqo8EJri5oUeiRPOYRB508Jy3JdK qE9xLArrdgnBVRCMx34XuleagS7K+pMQ1wgAe+hiBFZpA5NEWXYNenqTsIbA4gX2AC jMJGGg2sEkka/fltzwYZUeAvibAeF95uUnj7zBTA= Received: by mail-ej1-f41.google.com with SMTP id w9so17341239ejc.8; Mon, 27 Jul 2020 07:50:53 -0700 (PDT) X-Gm-Message-State: AOAM531Ane3xAsfziXj5Y26UDjT8fnjb2eVvwDy61bDe53lQDpIlEIFg OH8aZpFhO68/Yv0LXMcVbXy5QWyGtaPfYbcENQ== X-Received: by 2002:a17:906:b6d0:: with SMTP id ec16mr1858571ejb.94.1595861452516; Mon, 27 Jul 2020 07:50:52 -0700 (PDT) MIME-Version: 1.0 References: <1595469798-3824-1-git-send-email-yongqiang.niu@mediatek.com> <1595469798-3824-8-git-send-email-yongqiang.niu@mediatek.com> <1595836355.13250.24.camel@mhfsdcap03> In-Reply-To: <1595836355.13250.24.camel@mhfsdcap03> From: Chun-Kuang Hu Date: Mon, 27 Jul 2020 22:50:39 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [v7, PATCH 7/7] drm/mediatek: add support for mediatek SOC MT8183 To: Yongqiang Niu Cc: Chun-Kuang Hu , CK Hu , Philipp Zabel , Rob Herring , Matthias Brugger , Mark Rutland , devicetree@vger.kernel.org, David Airlie , linux-kernel , DRI Development , "moderated list:ARM/Mediatek SoC support" , Daniel Vetter , Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Yongqiang: Yongqiang Niu =E6=96=BC 2020=E5=B9=B47=E6=9C= =8827=E6=97=A5 =E9=80=B1=E4=B8=80 =E4=B8=8B=E5=8D=883:54=E5=AF=AB=E9=81=93= =EF=BC=9A > > On Sat, 2020-07-25 at 07:24 +0800, Chun-Kuang Hu wrote: > > Hi Yongqiang: > > > > Yongqiang Niu =E6=96=BC 2020=E5=B9=B47=E6= =9C=8823=E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8A=E5=8D=8810:15=E5=AF=AB=E9=81= =93=EF=BC=9A > > > > > > This patch add support for mediatek SOC MT8183 > > > 1.ovl_2l share driver with ovl > > > > I think this is done in [1], [2], [3], this patch just add the support > > of mt8183-ovl and mt8183-ovl-2l. > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/= commit/drivers/gpu/drm/mediatek?h=3Dv5.8-rc6&id=3D132c6e250ed745443973cada8= db17cdbaebdf551 > > [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/= commit/drivers/gpu/drm/mediatek?h=3Dv5.8-rc6&id=3D318462d1a568634ba09263cc7= 30cb0fb1d56c2b3 > > [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/= commit/drivers/gpu/drm/mediatek?h=3Dv5.8-rc6&id=3D57148baac8b78461e394953cf= d5317bde8f795ab > > > > > 2.rdma1 share drive with rdma0, but fifo size is different > > > > I think this is done in [4], this patch just add the support of mt8183-= rdma. > > > > [4] https://patchwork.kernel.org/patch/11679549/ > > > > > 3.add mt8183 mutex private data, and mmsys private data > > > 4.add mt8183 main and external path module for crtc create > > > > The fourth item is the mmsys private data in third item, so you need > > not to repeat it. > > > > > > > > Signed-off-by: Yongqiang Niu > > > --- > > > drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 18 ++++++++++++ > > > drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 6 ++++ > > > drivers/gpu/drm/mediatek/mtk_drm_ddp.c | 47 ++++++++++++++++++++++= ++++++++++ > > > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 43 ++++++++++++++++++++++= +++++++ > > > 4 files changed, 114 insertions(+) > > > > > > > [snip] > > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c b/drivers/gpu/drm= /mediatek/mtk_drm_ddp.c > > > index 014c1bb..60788c1 100644 > > > --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c > > > +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c > > > @@ -15,6 +15,8 @@ > > > > > > #define MT2701_DISP_MUTEX0_MOD0 0x2c > > > #define MT2701_DISP_MUTEX0_SOF0 0x30 > > > +#define MT8183_DISP_MUTEX0_MOD0 0x30 > > > +#define MT8183_DISP_MUTEX0_SOF0 0x2c > > > > > > #define DISP_REG_MUTEX_EN(n) (0x20 + 0x20 * (n)) > > > #define DISP_REG_MUTEX(n) (0x24 + 0x20 * (n)) > > > @@ -25,6 +27,18 @@ > > > > > > #define INT_MUTEX BIT(1) > > > > > > +#define MT8183_MUTEX_MOD_DISP_RDMA0 0 > > > +#define MT8183_MUTEX_MOD_DISP_RDMA1 1 > > > +#define MT8183_MUTEX_MOD_DISP_OVL0 9 > > > +#define MT8183_MUTEX_MOD_DISP_OVL0_2L 10 > > > +#define MT8183_MUTEX_MOD_DISP_OVL1_2L 11 > > > +#define MT8183_MUTEX_MOD_DISP_WDMA0 12 > > > +#define MT8183_MUTEX_MOD_DISP_COLOR0 13 > > > +#define MT8183_MUTEX_MOD_DISP_CCORR0 14 > > > +#define MT8183_MUTEX_MOD_DISP_AAL0 15 > > > +#define MT8183_MUTEX_MOD_DISP_GAMMA0 16 > > > +#define MT8183_MUTEX_MOD_DISP_DITHER0 17 > > > + > > > #define MT8173_MUTEX_MOD_DISP_OVL0 11 > > > #define MT8173_MUTEX_MOD_DISP_OVL1 12 > > > #define MT8173_MUTEX_MOD_DISP_RDMA0 13 > > > @@ -74,6 +88,10 @@ > > > #define MUTEX_SOF_DSI2 5 > > > #define MUTEX_SOF_DSI3 6 > > > > > > +#define MT8183_MUTEX_SOF_DPI0 2 > > > +#define MT8183_MUTEX_EOF_DSI0 (MUTEX_SOF_DSI0 << 6) > > > +#define MT8183_MUTEX_EOF_DPI0 (MT8183_MUTEX_SOF_DPI= 0 << 6) > > > + > > > > > > struct mtk_disp_mutex { > > > int id; > > > @@ -153,6 +171,20 @@ struct mtk_ddp { > > > [DDP_COMPONENT_WDMA1] =3D MT8173_MUTEX_MOD_DISP_WDMA1, > > > }; > > > > > > +static const unsigned int mt8183_mutex_mod[DDP_COMPONENT_ID_MAX] =3D= { > > > + [DDP_COMPONENT_AAL0] =3D MT8183_MUTEX_MOD_DISP_AAL0, > > > + [DDP_COMPONENT_CCORR] =3D MT8183_MUTEX_MOD_DISP_CCORR0, > > > + [DDP_COMPONENT_COLOR0] =3D MT8183_MUTEX_MOD_DISP_COLOR0, > > > + [DDP_COMPONENT_DITHER] =3D MT8183_MUTEX_MOD_DISP_DITHER0, > > > + [DDP_COMPONENT_GAMMA] =3D MT8183_MUTEX_MOD_DISP_GAMMA0, > > > + [DDP_COMPONENT_OVL0] =3D MT8183_MUTEX_MOD_DISP_OVL0, > > > + [DDP_COMPONENT_OVL_2L0] =3D MT8183_MUTEX_MOD_DISP_OVL0_2L, > > > + [DDP_COMPONENT_OVL_2L1] =3D MT8183_MUTEX_MOD_DISP_OVL1_2L, > > > + [DDP_COMPONENT_RDMA0] =3D MT8183_MUTEX_MOD_DISP_RDMA0, > > > + [DDP_COMPONENT_RDMA1] =3D MT8183_MUTEX_MOD_DISP_RDMA1, > > > + [DDP_COMPONENT_WDMA0] =3D MT8183_MUTEX_MOD_DISP_WDMA0, > > > +}; > > > + > > > static const unsigned int mt2712_mutex_sof[DDP_MUTEX_SOF_DSI3 + 1] = =3D { > > > [DDP_MUTEX_SOF_SINGLE_MODE] =3D MUTEX_SOF_SINGLE_MODE, > > > [DDP_MUTEX_SOF_DSI0] =3D MUTEX_SOF_DSI0, > > > @@ -163,6 +195,12 @@ struct mtk_ddp { > > > [DDP_MUTEX_SOF_DSI3] =3D MUTEX_SOF_DSI3, > > > }; > > > > > > +static const unsigned int mt8183_mutex_sof[DDP_MUTEX_SOF_DSI3 + 1] = =3D { > > > + [DDP_MUTEX_SOF_SINGLE_MODE] =3D MUTEX_SOF_SINGLE_MODE, > > > + [DDP_MUTEX_SOF_DSI0] =3D MUTEX_SOF_DSI0 | MT8183_MUTEX_EOF_DS= I0, > > > > I think this array is for 'sof', so you should drop MT8183_MUTEX_EOF_DS= I0. > > > > > + [DDP_MUTEX_SOF_DPI0] =3D MT8183_MUTEX_SOF_DPI0 | MT8183_MUTEX= _EOF_DPI0, > > > > Ditto. > > > > Regards, > > Chun-Kuang. > > MT8183 mutex setting is different with before SoC. > if we do not set EOF, Overlay hardware will not receive frame done irq, > and will display error. Please add comment for this because this is not a trivial thing. Regards, Chun-Kuang. > > > > > +}; > > > + > > > static const struct mtk_ddp_data mt2701_ddp_driver_data =3D { > > > .mutex_mod =3D mt2701_mutex_mod, > > > .mutex_sof =3D mt2712_mutex_sof, > > > @@ -184,6 +222,13 @@ struct mtk_ddp { > > > .mutex_sof_reg =3D MT2701_DISP_MUTEX0_SOF0, > > > }; > > > >