All of lore.kernel.org
 help / color / mirror / Atom feed
From: CK Hu <ck.hu@mediatek.com>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: <robh+dt@kernel.org>, <mark.rutland@arm.com>,
	<p.zabel@pengutronix.de>, <airlied@linux.ie>,
	<mturquette@baylibre.com>, <sboyd@kernel.org>,
	<ulrich.hecht+renesas@gmail.com>,
	<laurent.pinchart@ideasonboard.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	<rdunlap@infradead.org>, <dri-devel@lists.freedesktop.org>,
	Weiyi Lu <weiyi.lu@mediatek.com>,
	"Seiya Wang" <seiya.wang@mediatek.com>,
	<linux-clk@vger.kernel.org>,
	"Collabora Kernel ML" <kernel@collabora.com>,
	mtk01761 <wendell.lin@mediatek.com>,
	Allison Randal <allison@lohutok.net>,
	Thomas Gleixner <tglx@linutronix.de>, <wens@csie.org>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	Houlong Wei <houlong.wei@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	<linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<sean.wang@mediatek.com>, <frank-w@public-files.de>,
	Minghsiu Tsai <minghsiu.tsai@mediatek.com>,
	Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
	<linux-mediatek@lists.infradead.org>, <hsinyi@chromium.org>,
	Matthias Brugger <mbrugger@suse.com>,
	<linux-arm-kernel@lists.infradead.org>,
	Richard Fontana <rfontana@redhat.com>,
	<linux-kernel@vger.kernel.org>, <matthias.bgg@kernel.org>,
	Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH v10 4/5] soc / drm: mediatek: Move routing control to mmsys device
Date: Fri, 28 Feb 2020 17:37:44 +0800	[thread overview]
Message-ID: <1582882664.22475.6.camel@mtksdaap41> (raw)
In-Reply-To: <20200227180858.1514157-5-enric.balletbo@collabora.com>

Hi, Enric:

On Thu, 2020-02-27 at 19:08 +0100, Enric Balletbo i Serra wrote:
> Provide a mtk_mmsys_ddp_connect() and mtk_mmsys_disconnect() functions to
> replace mtk_ddp_add_comp_to_path() and mtk_ddp_remove_comp_from_path().
> Those functions will allow DRM driver and others to control the data
> path routing.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> 
> Changes in v10:
> - Introduced a new patch to move routing control into mmsys driver.
> - Removed the patch to use regmap as is not needed anymore.
> 
> Changes in v9: None
> Changes in v8: None
> Changes in v7: None
> 
>  drivers/gpu/drm/mediatek/mtk_drm_crtc.c |  13 +-
>  drivers/gpu/drm/mediatek/mtk_drm_ddp.c  | 256 ----------------------
>  drivers/gpu/drm/mediatek/mtk_drm_ddp.h  |   7 -
>  drivers/gpu/drm/mediatek/mtk_drm_drv.c  |  13 +-
>  drivers/soc/mediatek/mtk-mmsys.c        | 275 ++++++++++++++++++++++++
>  include/linux/soc/mediatek/mtk-mmsys.h  |  19 ++
>  6 files changed, 306 insertions(+), 277 deletions(-)
>  create mode 100644 include/linux/soc/mediatek/mtk-mmsys.h
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index fd4042de12f2..3c89449bea6e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -6,6 +6,7 @@
>  #include <linux/clk.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
> +#include <linux/soc/mediatek/mtk-mmsys.h>
>  
>  #include <asm/barrier.h>
>  #include <soc/mediatek/smi.h>
> @@ -296,9 +297,9 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)
>  	}
>  
>  	for (i = 0; i < mtk_crtc->ddp_comp_nr - 1; i++) {
> -		mtk_ddp_add_comp_to_path(mtk_crtc->config_regs,
> -					 mtk_crtc->ddp_comp[i]->id,
> -					 mtk_crtc->ddp_comp[i + 1]->id);
> +		mtk_mmsys_ddp_connect(mtk_crtc->config_regs,
> +				      mtk_crtc->ddp_comp[i]->id,
> +				      mtk_crtc->ddp_comp[i + 1]->id);

When CONFIG_MTK_MMSYS is not enable, this would built fail. So make some
modification in Kconfig.

>  		mtk_disp_mutex_add_comp(mtk_crtc->mutex,
>  					mtk_crtc->ddp_comp[i]->id);
>  	}
> @@ -355,9 +356,9 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc)
>  					   mtk_crtc->ddp_comp[i]->id);
>  	mtk_disp_mutex_disable(mtk_crtc->mutex);
>  	for (i = 0; i < mtk_crtc->ddp_comp_nr - 1; i++) {
> -		mtk_ddp_remove_comp_from_path(mtk_crtc->config_regs,
> -					      mtk_crtc->ddp_comp[i]->id,
> -					      mtk_crtc->ddp_comp[i + 1]->id);
> +		mtk_mmsys_ddp_disconnect(mtk_crtc->config_regs,
> +					 mtk_crtc->ddp_comp[i]->id,
> +					 mtk_crtc->ddp_comp[i + 1]->id);
>  		mtk_disp_mutex_remove_comp(mtk_crtc->mutex,
>  					   mtk_crtc->ddp_comp[i]->id);
>  	}
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c
> index b885f60f474c..014c1bbe1df2 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c
> @@ -13,26 +13,6 @@
>  #include "mtk_drm_ddp.h"
>  #include "mtk_drm_ddp_comp.h"
>  

[snip]

> diff --git a/include/linux/soc/mediatek/mtk-mmsys.h b/include/linux/soc/mediatek/mtk-mmsys.h
> new file mode 100644
> index 000000000000..02fd86e62a8d
> --- /dev/null
> +++ b/include/linux/soc/mediatek/mtk-mmsys.h
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) 2015 MediaTek Inc.
> + */
> +
> +#ifndef __MTK_MMSYS_H
> +#define __MTK_MMSYS_H
> +
> +enum mtk_ddp_comp_id;
> +
> +void mtk_mmsys_ddp_connect(void __iomem *config_regs,

I prefer the first parameter to be 'struct device *dev' which is the
device pointer of mmsys device. and mmsys driver could use this pointer
to get its register address.

Regards,
CK

> +			   enum mtk_ddp_comp_id cur,
> +			   enum mtk_ddp_comp_id next);
> +
> +void mtk_mmsys_ddp_disconnect(void __iomem *config_regs,
> +			      enum mtk_ddp_comp_id cur,
> +			      enum mtk_ddp_comp_id next);
> +
> +#endif /* __MTK_MMSYS_H */


WARNING: multiple messages have this Message-ID (diff)
From: CK Hu <ck.hu@mediatek.com>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: mark.rutland@arm.com, Kate Stewart <kstewart@linuxfoundation.org>,
	Minghsiu Tsai <minghsiu.tsai@mediatek.com>,
	Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
	airlied@linux.ie, mturquette@baylibre.com,
	dri-devel@lists.freedesktop.org,
	Richard Fontana <rfontana@redhat.com>,
	laurent.pinchart@ideasonboard.com,
	ulrich.hecht+renesas@gmail.com,
	Collabora Kernel ML <kernel@collabora.com>,
	linux-clk@vger.kernel.org, Weiyi Lu <weiyi.lu@mediatek.com>,
	wens@csie.org, linux-arm-kernel@lists.infradead.org,
	mtk01761 <wendell.lin@mediatek.com>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	Daniel Vetter <daniel@ffwll.ch>,
	frank-w@public-files.de, Seiya Wang <seiya.wang@mediatek.com>,
	sean.wang@mediatek.com, Houlong Wei <houlong.wei@mediatek.com>,
	robh+dt@kernel.org, linux-mediatek@lists.infradead.org,
	hsinyi@chromium.org, Matthias Brugger <matthias.bgg@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Allison Randal <allison@lohutok.net>,
	Matthias Brugger <mbrugger@suse.com>,
	sboyd@kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	rdunlap@infradead.org, linux-kernel@vger.kernel.org,
	p.zabel@pengutronix.de, matthias.bgg@kernel.org
Subject: Re: [PATCH v10 4/5] soc / drm: mediatek: Move routing control to mmsys device
Date: Fri, 28 Feb 2020 17:37:44 +0800	[thread overview]
Message-ID: <1582882664.22475.6.camel@mtksdaap41> (raw)
In-Reply-To: <20200227180858.1514157-5-enric.balletbo@collabora.com>

Hi, Enric:

On Thu, 2020-02-27 at 19:08 +0100, Enric Balletbo i Serra wrote:
> Provide a mtk_mmsys_ddp_connect() and mtk_mmsys_disconnect() functions to
> replace mtk_ddp_add_comp_to_path() and mtk_ddp_remove_comp_from_path().
> Those functions will allow DRM driver and others to control the data
> path routing.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> 
> Changes in v10:
> - Introduced a new patch to move routing control into mmsys driver.
> - Removed the patch to use regmap as is not needed anymore.
> 
> Changes in v9: None
> Changes in v8: None
> Changes in v7: None
> 
>  drivers/gpu/drm/mediatek/mtk_drm_crtc.c |  13 +-
>  drivers/gpu/drm/mediatek/mtk_drm_ddp.c  | 256 ----------------------
>  drivers/gpu/drm/mediatek/mtk_drm_ddp.h  |   7 -
>  drivers/gpu/drm/mediatek/mtk_drm_drv.c  |  13 +-
>  drivers/soc/mediatek/mtk-mmsys.c        | 275 ++++++++++++++++++++++++
>  include/linux/soc/mediatek/mtk-mmsys.h  |  19 ++
>  6 files changed, 306 insertions(+), 277 deletions(-)
>  create mode 100644 include/linux/soc/mediatek/mtk-mmsys.h
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index fd4042de12f2..3c89449bea6e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -6,6 +6,7 @@
>  #include <linux/clk.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
> +#include <linux/soc/mediatek/mtk-mmsys.h>
>  
>  #include <asm/barrier.h>
>  #include <soc/mediatek/smi.h>
> @@ -296,9 +297,9 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)
>  	}
>  
>  	for (i = 0; i < mtk_crtc->ddp_comp_nr - 1; i++) {
> -		mtk_ddp_add_comp_to_path(mtk_crtc->config_regs,
> -					 mtk_crtc->ddp_comp[i]->id,
> -					 mtk_crtc->ddp_comp[i + 1]->id);
> +		mtk_mmsys_ddp_connect(mtk_crtc->config_regs,
> +				      mtk_crtc->ddp_comp[i]->id,
> +				      mtk_crtc->ddp_comp[i + 1]->id);

When CONFIG_MTK_MMSYS is not enable, this would built fail. So make some
modification in Kconfig.

>  		mtk_disp_mutex_add_comp(mtk_crtc->mutex,
>  					mtk_crtc->ddp_comp[i]->id);
>  	}
> @@ -355,9 +356,9 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc)
>  					   mtk_crtc->ddp_comp[i]->id);
>  	mtk_disp_mutex_disable(mtk_crtc->mutex);
>  	for (i = 0; i < mtk_crtc->ddp_comp_nr - 1; i++) {
> -		mtk_ddp_remove_comp_from_path(mtk_crtc->config_regs,
> -					      mtk_crtc->ddp_comp[i]->id,
> -					      mtk_crtc->ddp_comp[i + 1]->id);
> +		mtk_mmsys_ddp_disconnect(mtk_crtc->config_regs,
> +					 mtk_crtc->ddp_comp[i]->id,
> +					 mtk_crtc->ddp_comp[i + 1]->id);
>  		mtk_disp_mutex_remove_comp(mtk_crtc->mutex,
>  					   mtk_crtc->ddp_comp[i]->id);
>  	}
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c
> index b885f60f474c..014c1bbe1df2 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c
> @@ -13,26 +13,6 @@
>  #include "mtk_drm_ddp.h"
>  #include "mtk_drm_ddp_comp.h"
>  

[snip]

> diff --git a/include/linux/soc/mediatek/mtk-mmsys.h b/include/linux/soc/mediatek/mtk-mmsys.h
> new file mode 100644
> index 000000000000..02fd86e62a8d
> --- /dev/null
> +++ b/include/linux/soc/mediatek/mtk-mmsys.h
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) 2015 MediaTek Inc.
> + */
> +
> +#ifndef __MTK_MMSYS_H
> +#define __MTK_MMSYS_H
> +
> +enum mtk_ddp_comp_id;
> +
> +void mtk_mmsys_ddp_connect(void __iomem *config_regs,

I prefer the first parameter to be 'struct device *dev' which is the
device pointer of mmsys device. and mmsys driver could use this pointer
to get its register address.

Regards,
CK

> +			   enum mtk_ddp_comp_id cur,
> +			   enum mtk_ddp_comp_id next);
> +
> +void mtk_mmsys_ddp_disconnect(void __iomem *config_regs,
> +			      enum mtk_ddp_comp_id cur,
> +			      enum mtk_ddp_comp_id next);
> +
> +#endif /* __MTK_MMSYS_H */

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: CK Hu <ck.hu@mediatek.com>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: mark.rutland@arm.com, Kate Stewart <kstewart@linuxfoundation.org>,
	Minghsiu Tsai <minghsiu.tsai@mediatek.com>,
	Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
	airlied@linux.ie, mturquette@baylibre.com,
	dri-devel@lists.freedesktop.org,
	Richard Fontana <rfontana@redhat.com>,
	laurent.pinchart@ideasonboard.com,
	ulrich.hecht+renesas@gmail.com,
	Collabora Kernel ML <kernel@collabora.com>,
	linux-clk@vger.kernel.org, Weiyi Lu <weiyi.lu@mediatek.com>,
	wens@csie.org, linux-arm-kernel@lists.infradead.org,
	mtk01761 <wendell.lin@mediatek.com>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	Daniel Vetter <daniel@ffwll.ch>,
	frank-w@public-files.de, Seiya Wang <seiya.wang@mediatek.com>,
	sean.wang@mediatek.com, Houlong Wei <houlong.wei@mediatek.com>,
	robh+dt@kernel.org, linux-mediatek@lists.infradead.org,
	hsinyi@chromium.org, Matthias Brugger <matthias.bgg@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Allison Randal <allison@lohutok.net>,
	Matthias Brugger <mbrugger@suse.com>,
	sboyd@kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	rdunlap@infradead.org, linux-kernel@vger.kernel.org,
	p.zabel@pengutronix.de, matthias.bgg@kernel.org
Subject: Re: [PATCH v10 4/5] soc / drm: mediatek: Move routing control to mmsys device
Date: Fri, 28 Feb 2020 17:37:44 +0800	[thread overview]
Message-ID: <1582882664.22475.6.camel@mtksdaap41> (raw)
In-Reply-To: <20200227180858.1514157-5-enric.balletbo@collabora.com>

Hi, Enric:

On Thu, 2020-02-27 at 19:08 +0100, Enric Balletbo i Serra wrote:
> Provide a mtk_mmsys_ddp_connect() and mtk_mmsys_disconnect() functions to
> replace mtk_ddp_add_comp_to_path() and mtk_ddp_remove_comp_from_path().
> Those functions will allow DRM driver and others to control the data
> path routing.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> 
> Changes in v10:
> - Introduced a new patch to move routing control into mmsys driver.
> - Removed the patch to use regmap as is not needed anymore.
> 
> Changes in v9: None
> Changes in v8: None
> Changes in v7: None
> 
>  drivers/gpu/drm/mediatek/mtk_drm_crtc.c |  13 +-
>  drivers/gpu/drm/mediatek/mtk_drm_ddp.c  | 256 ----------------------
>  drivers/gpu/drm/mediatek/mtk_drm_ddp.h  |   7 -
>  drivers/gpu/drm/mediatek/mtk_drm_drv.c  |  13 +-
>  drivers/soc/mediatek/mtk-mmsys.c        | 275 ++++++++++++++++++++++++
>  include/linux/soc/mediatek/mtk-mmsys.h  |  19 ++
>  6 files changed, 306 insertions(+), 277 deletions(-)
>  create mode 100644 include/linux/soc/mediatek/mtk-mmsys.h
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index fd4042de12f2..3c89449bea6e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -6,6 +6,7 @@
>  #include <linux/clk.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
> +#include <linux/soc/mediatek/mtk-mmsys.h>
>  
>  #include <asm/barrier.h>
>  #include <soc/mediatek/smi.h>
> @@ -296,9 +297,9 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)
>  	}
>  
>  	for (i = 0; i < mtk_crtc->ddp_comp_nr - 1; i++) {
> -		mtk_ddp_add_comp_to_path(mtk_crtc->config_regs,
> -					 mtk_crtc->ddp_comp[i]->id,
> -					 mtk_crtc->ddp_comp[i + 1]->id);
> +		mtk_mmsys_ddp_connect(mtk_crtc->config_regs,
> +				      mtk_crtc->ddp_comp[i]->id,
> +				      mtk_crtc->ddp_comp[i + 1]->id);

When CONFIG_MTK_MMSYS is not enable, this would built fail. So make some
modification in Kconfig.

>  		mtk_disp_mutex_add_comp(mtk_crtc->mutex,
>  					mtk_crtc->ddp_comp[i]->id);
>  	}
> @@ -355,9 +356,9 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc)
>  					   mtk_crtc->ddp_comp[i]->id);
>  	mtk_disp_mutex_disable(mtk_crtc->mutex);
>  	for (i = 0; i < mtk_crtc->ddp_comp_nr - 1; i++) {
> -		mtk_ddp_remove_comp_from_path(mtk_crtc->config_regs,
> -					      mtk_crtc->ddp_comp[i]->id,
> -					      mtk_crtc->ddp_comp[i + 1]->id);
> +		mtk_mmsys_ddp_disconnect(mtk_crtc->config_regs,
> +					 mtk_crtc->ddp_comp[i]->id,
> +					 mtk_crtc->ddp_comp[i + 1]->id);
>  		mtk_disp_mutex_remove_comp(mtk_crtc->mutex,
>  					   mtk_crtc->ddp_comp[i]->id);
>  	}
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c
> index b885f60f474c..014c1bbe1df2 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c
> @@ -13,26 +13,6 @@
>  #include "mtk_drm_ddp.h"
>  #include "mtk_drm_ddp_comp.h"
>  

[snip]

> diff --git a/include/linux/soc/mediatek/mtk-mmsys.h b/include/linux/soc/mediatek/mtk-mmsys.h
> new file mode 100644
> index 000000000000..02fd86e62a8d
> --- /dev/null
> +++ b/include/linux/soc/mediatek/mtk-mmsys.h
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) 2015 MediaTek Inc.
> + */
> +
> +#ifndef __MTK_MMSYS_H
> +#define __MTK_MMSYS_H
> +
> +enum mtk_ddp_comp_id;
> +
> +void mtk_mmsys_ddp_connect(void __iomem *config_regs,

I prefer the first parameter to be 'struct device *dev' which is the
device pointer of mmsys device. and mmsys driver could use this pointer
to get its register address.

Regards,
CK

> +			   enum mtk_ddp_comp_id cur,
> +			   enum mtk_ddp_comp_id next);
> +
> +void mtk_mmsys_ddp_disconnect(void __iomem *config_regs,
> +			      enum mtk_ddp_comp_id cur,
> +			      enum mtk_ddp_comp_id next);
> +
> +#endif /* __MTK_MMSYS_H */

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: CK Hu <ck.hu@mediatek.com>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: mark.rutland@arm.com, Kate Stewart <kstewart@linuxfoundation.org>,
	Minghsiu Tsai <minghsiu.tsai@mediatek.com>,
	Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
	airlied@linux.ie, mturquette@baylibre.com,
	dri-devel@lists.freedesktop.org,
	Richard Fontana <rfontana@redhat.com>,
	laurent.pinchart@ideasonboard.com,
	ulrich.hecht+renesas@gmail.com,
	Collabora Kernel ML <kernel@collabora.com>,
	linux-clk@vger.kernel.org, Weiyi Lu <weiyi.lu@mediatek.com>,
	wens@csie.org, linux-arm-kernel@lists.infradead.org,
	mtk01761 <wendell.lin@mediatek.com>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	frank-w@public-files.de, Seiya Wang <seiya.wang@mediatek.com>,
	sean.wang@mediatek.com, Houlong Wei <houlong.wei@mediatek.com>,
	robh+dt@kernel.org, linux-mediatek@lists.infradead.org,
	hsinyi@chromium.org, Matthias Brugger <matthias.bgg@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Allison Randal <allison@lohutok.net>,
	Matthias Brugger <mbrugger@suse.com>,
	sboyd@kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	rdunlap@infradead.org, linux-kernel@vger.kernel.org,
	matthias.bgg@kernel.org
Subject: Re: [PATCH v10 4/5] soc / drm: mediatek: Move routing control to mmsys device
Date: Fri, 28 Feb 2020 17:37:44 +0800	[thread overview]
Message-ID: <1582882664.22475.6.camel@mtksdaap41> (raw)
In-Reply-To: <20200227180858.1514157-5-enric.balletbo@collabora.com>

Hi, Enric:

On Thu, 2020-02-27 at 19:08 +0100, Enric Balletbo i Serra wrote:
> Provide a mtk_mmsys_ddp_connect() and mtk_mmsys_disconnect() functions to
> replace mtk_ddp_add_comp_to_path() and mtk_ddp_remove_comp_from_path().
> Those functions will allow DRM driver and others to control the data
> path routing.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> 
> Changes in v10:
> - Introduced a new patch to move routing control into mmsys driver.
> - Removed the patch to use regmap as is not needed anymore.
> 
> Changes in v9: None
> Changes in v8: None
> Changes in v7: None
> 
>  drivers/gpu/drm/mediatek/mtk_drm_crtc.c |  13 +-
>  drivers/gpu/drm/mediatek/mtk_drm_ddp.c  | 256 ----------------------
>  drivers/gpu/drm/mediatek/mtk_drm_ddp.h  |   7 -
>  drivers/gpu/drm/mediatek/mtk_drm_drv.c  |  13 +-
>  drivers/soc/mediatek/mtk-mmsys.c        | 275 ++++++++++++++++++++++++
>  include/linux/soc/mediatek/mtk-mmsys.h  |  19 ++
>  6 files changed, 306 insertions(+), 277 deletions(-)
>  create mode 100644 include/linux/soc/mediatek/mtk-mmsys.h
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index fd4042de12f2..3c89449bea6e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -6,6 +6,7 @@
>  #include <linux/clk.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
> +#include <linux/soc/mediatek/mtk-mmsys.h>
>  
>  #include <asm/barrier.h>
>  #include <soc/mediatek/smi.h>
> @@ -296,9 +297,9 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)
>  	}
>  
>  	for (i = 0; i < mtk_crtc->ddp_comp_nr - 1; i++) {
> -		mtk_ddp_add_comp_to_path(mtk_crtc->config_regs,
> -					 mtk_crtc->ddp_comp[i]->id,
> -					 mtk_crtc->ddp_comp[i + 1]->id);
> +		mtk_mmsys_ddp_connect(mtk_crtc->config_regs,
> +				      mtk_crtc->ddp_comp[i]->id,
> +				      mtk_crtc->ddp_comp[i + 1]->id);

When CONFIG_MTK_MMSYS is not enable, this would built fail. So make some
modification in Kconfig.

>  		mtk_disp_mutex_add_comp(mtk_crtc->mutex,
>  					mtk_crtc->ddp_comp[i]->id);
>  	}
> @@ -355,9 +356,9 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc)
>  					   mtk_crtc->ddp_comp[i]->id);
>  	mtk_disp_mutex_disable(mtk_crtc->mutex);
>  	for (i = 0; i < mtk_crtc->ddp_comp_nr - 1; i++) {
> -		mtk_ddp_remove_comp_from_path(mtk_crtc->config_regs,
> -					      mtk_crtc->ddp_comp[i]->id,
> -					      mtk_crtc->ddp_comp[i + 1]->id);
> +		mtk_mmsys_ddp_disconnect(mtk_crtc->config_regs,
> +					 mtk_crtc->ddp_comp[i]->id,
> +					 mtk_crtc->ddp_comp[i + 1]->id);
>  		mtk_disp_mutex_remove_comp(mtk_crtc->mutex,
>  					   mtk_crtc->ddp_comp[i]->id);
>  	}
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c
> index b885f60f474c..014c1bbe1df2 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c
> @@ -13,26 +13,6 @@
>  #include "mtk_drm_ddp.h"
>  #include "mtk_drm_ddp_comp.h"
>  

[snip]

> diff --git a/include/linux/soc/mediatek/mtk-mmsys.h b/include/linux/soc/mediatek/mtk-mmsys.h
> new file mode 100644
> index 000000000000..02fd86e62a8d
> --- /dev/null
> +++ b/include/linux/soc/mediatek/mtk-mmsys.h
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) 2015 MediaTek Inc.
> + */
> +
> +#ifndef __MTK_MMSYS_H
> +#define __MTK_MMSYS_H
> +
> +enum mtk_ddp_comp_id;
> +
> +void mtk_mmsys_ddp_connect(void __iomem *config_regs,

I prefer the first parameter to be 'struct device *dev' which is the
device pointer of mmsys device. and mmsys driver could use this pointer
to get its register address.

Regards,
CK

> +			   enum mtk_ddp_comp_id cur,
> +			   enum mtk_ddp_comp_id next);
> +
> +void mtk_mmsys_ddp_disconnect(void __iomem *config_regs,
> +			      enum mtk_ddp_comp_id cur,
> +			      enum mtk_ddp_comp_id next);
> +
> +#endif /* __MTK_MMSYS_H */

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-02-28  9:37 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 18:08 [PATCH v10 0/5] arm/arm64: mediatek: Fix mt8173 mmsys device probing Enric Balletbo i Serra
2020-02-27 18:08 ` Enric Balletbo i Serra
2020-02-27 18:08 ` Enric Balletbo i Serra
2020-02-27 18:08 ` Enric Balletbo i Serra
2020-02-27 18:08 ` [PATCH v10 1/5] drm/mediatek: Omit warning on probe defers Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:08 ` [PATCH v10 2/5] dt-bindings: mediatek: Update mmsys binding to reflect it is a system controller Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:18   ` Matthias Brugger
2020-02-27 18:18     ` Matthias Brugger
2020-02-27 18:18     ` Matthias Brugger
2020-02-27 18:18     ` Matthias Brugger
2020-02-28  9:19   ` CK Hu
2020-02-28  9:19     ` CK Hu
2020-02-28  9:19     ` CK Hu
2020-02-28  9:19     ` CK Hu
2020-02-27 18:08 ` [PATCH v10 3/5] soc: mediatek: Move mt8173 MMSYS to platform driver Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:21   ` Matthias Brugger
2020-02-27 18:21     ` Matthias Brugger
2020-02-27 18:21     ` Matthias Brugger
2020-02-27 18:21     ` Matthias Brugger
2020-02-27 18:22     ` Matthias Brugger
2020-02-27 18:22       ` Matthias Brugger
2020-02-27 18:22       ` Matthias Brugger
2020-02-27 18:22       ` Matthias Brugger
2020-03-03  3:18       ` CK Hu
2020-03-03  3:18         ` CK Hu
2020-03-03  3:18         ` CK Hu
2020-03-03  3:18         ` CK Hu
2020-03-03  9:09         ` Matthias Brugger
2020-03-03  9:09           ` Matthias Brugger
2020-03-03  9:09           ` Matthias Brugger
2020-03-03  9:09           ` Matthias Brugger
2020-02-28  9:23   ` CK Hu
2020-02-28  9:23     ` CK Hu
2020-02-28  9:23     ` CK Hu
2020-02-28  9:23     ` CK Hu
2020-02-27 18:08 ` [PATCH v10 4/5] soc / drm: mediatek: Move routing control to mmsys device Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:29   ` Matthias Brugger
2020-02-27 18:29     ` Matthias Brugger
2020-02-27 18:29     ` Matthias Brugger
2020-02-27 18:29     ` Matthias Brugger
2020-02-28  9:37   ` CK Hu [this message]
2020-02-28  9:37     ` CK Hu
2020-02-28  9:37     ` CK Hu
2020-02-28  9:37     ` CK Hu
2020-02-27 18:08 ` [PATCH v10 5/5] soc / drm: mediatek: Fix mediatek-drm device probing Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-27 18:08   ` Enric Balletbo i Serra
2020-02-28 10:07   ` CK Hu
2020-02-28 10:07     ` CK Hu
2020-02-28 10:07     ` CK Hu
2020-02-28 10:07     ` CK Hu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1582882664.22475.6.camel@mtksdaap41 \
    --to=ck.hu@mediatek.com \
    --cc=airlied@linux.ie \
    --cc=allison@lohutok.net \
    --cc=andrew-ct.chen@mediatek.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=enric.balletbo@collabora.com \
    --cc=frank-w@public-files.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=houlong.wei@mediatek.com \
    --cc=hsinyi@chromium.org \
    --cc=kernel@collabora.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=matthias.bgg@kernel.org \
    --cc=mbrugger@suse.com \
    --cc=mchehab@kernel.org \
    --cc=minghsiu.tsai@mediatek.com \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=rdunlap@infradead.org \
    --cc=rfontana@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sean.wang@mediatek.com \
    --cc=seiya.wang@mediatek.com \
    --cc=tglx@linutronix.de \
    --cc=ulrich.hecht+renesas@gmail.com \
    --cc=weiyi.lu@mediatek.com \
    --cc=wendell.lin@mediatek.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.