[v2,2/2] drm/exynos: Add device tree based discovery support for G2D

Message ID 1360128584-23167-2-git-send-email-sachin.kamat@linaro.org (mailing list archive)
State RFC, archived
Headers

Commit Message

Sachin Kamat Feb. 6, 2013, 5:29 a.m. UTC
  From: Ajay Kumar <ajaykumar.rs@samsung.com>

This patch adds device tree match table for Exynos G2D controller.

Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
Patch based on exynos-drm-fixes branch of Inki Dae's tree:
git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git

Changes since v1:
Modified the compatible string as per the discussions at [1].
[1] https://patchwork1.kernel.org/patch/2045821/
---
 drivers/gpu/drm/exynos/exynos_drm_g2d.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
  

Comments

Inki Dae Feb. 6, 2013, 7:32 a.m. UTC | #1
> -----Original Message-----
> From: Sachin Kamat [mailto:sachin.kamat@linaro.org]
> Sent: Wednesday, February 06, 2013 2:30 PM
> To: linux-media@vger.kernel.org; dri-devel@lists.freedesktop.org;
> devicetree-discuss@lists.ozlabs.org
> Cc: k.debski@samsung.com; sachin.kamat@linaro.org; inki.dae@samsung.com;
> s.nawrocki@samsung.com; kgene.kim@samsung.com; patches@linaro.org; Ajay
> Kumar
> Subject: [PATCH v2 2/2] drm/exynos: Add device tree based discovery
> support for G2D
> 
> From: Ajay Kumar <ajaykumar.rs@samsung.com>
> 
> This patch adds device tree match table for Exynos G2D controller.
> 
> Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> Patch based on exynos-drm-fixes branch of Inki Dae's tree:
> git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git
> 
> Changes since v1:
> Modified the compatible string as per the discussions at [1].
> [1] https://patchwork1.kernel.org/patch/2045821/
> ---
>  drivers/gpu/drm/exynos/exynos_drm_g2d.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
> b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
> index ddcfb5d..0fcfbe4 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
> @@ -19,6 +19,7 @@
>  #include <linux/workqueue.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/dma-attrs.h>
> +#include <linux/of.h>
> 
>  #include <drm/drmP.h>
>  #include <drm/exynos_drm.h>
> @@ -1240,6 +1241,14 @@ static int g2d_resume(struct device *dev)
> 
>  static SIMPLE_DEV_PM_OPS(g2d_pm_ops, g2d_suspend, g2d_resume);
> 
> +#ifdef CONFIG_OF
> +static const struct of_device_id exynos_g2d_match[] = {
> +	{ .compatible = "samsung,exynos5250-g2d" },

Looks good to me but please add document for it.

To other guys,
And is there anyone who know where this document should be added to?
I'm not sure that the g2d document should be placed in
Documentation/devicetree/bindings/gpu, media, drm/exynos or arm/exynos. At
least, this document should be shared with the g2d hw relevant drivers such
as v4l2 and drm. So is ".../bindings/gpu" proper place?

Thanks,
Inki Dae

> +	{},
> +};
> +MODULE_DEVICE_TABLE(of, exynos_g2d_match);
> +#endif
> +
>  struct platform_driver g2d_driver = {
>  	.probe		= g2d_probe,
>  	.remove		= g2d_remove,
> @@ -1247,5 +1256,6 @@ struct platform_driver g2d_driver = {
>  		.name	= "s5p-g2d",
>  		.owner	= THIS_MODULE,
>  		.pm	= &g2d_pm_ops,
> +		.of_match_table = of_match_ptr(exynos_g2d_match),
>  	},
>  };
> --
> 1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Sachin Kamat Feb. 6, 2013, 8:02 a.m. UTC | #2
On 6 February 2013 13:02, Inki Dae <inki.dae@samsung.com> wrote:
>
> Looks good to me but please add document for it.

Yes. I will. I was planning to send the bindings document patch along
with the dt patches (adding node entries to dts files).
Sylwester had suggested adding this to
Documentation/devicetree/bindings/media/ which contains other media
IPs.

>
> To other guys,
> And is there anyone who know where this document should be added to?
> I'm not sure that the g2d document should be placed in
> Documentation/devicetree/bindings/gpu, media, drm/exynos or arm/exynos. At
> least, this document should be shared with the g2d hw relevant drivers such
> as v4l2 and drm. So is ".../bindings/gpu" proper place?
>
  
Inki Dae Feb. 6, 2013, 8:51 a.m. UTC | #3
> -----Original Message-----
> From: Sachin Kamat [mailto:sachin.kamat@linaro.org]
> Sent: Wednesday, February 06, 2013 5:03 PM
> To: Inki Dae
> Cc: linux-media@vger.kernel.org; dri-devel@lists.freedesktop.org;
> devicetree-discuss@lists.ozlabs.org; k.debski@samsung.com;
> s.nawrocki@samsung.com; kgene.kim@samsung.com; patches@linaro.org; Ajay
> Kumar
> Subject: Re: [PATCH v2 2/2] drm/exynos: Add device tree based discovery
> support for G2D
> 
> On 6 February 2013 13:02, Inki Dae <inki.dae@samsung.com> wrote:
> >
> > Looks good to me but please add document for it.
> 
> Yes. I will. I was planning to send the bindings document patch along
> with the dt patches (adding node entries to dts files).
> Sylwester had suggested adding this to
> Documentation/devicetree/bindings/media/ which contains other media
> IPs.

I think that it's better to go to gpu than media and we can divide Exynos
IPs into the bellow categories,

Media : mfc
GPU : g2d, g3d, fimc, gsc
Video : fimd, hdmi, eDP, MIPI-DSI

And I think that the device-tree describes hardware so possibly, all
documents in .../bindings/drm/exynos/* should be moved to proper place also.
Please give  me any opinions.

Thanks,
Inki Dae

> 
> >
> > To other guys,
> > And is there anyone who know where this document should be added to?
> > I'm not sure that the g2d document should be placed in
> > Documentation/devicetree/bindings/gpu, media, drm/exynos or arm/exynos.
> At
> > least, this document should be shared with the g2d hw relevant drivers
> such
> > as v4l2 and drm. So is ".../bindings/gpu" proper place?
> >
> 
> 
> --
> With warm regards,
> Sachin

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Seung-Woo Kim Feb. 6, 2013, 11:21 a.m. UTC | #4
On 2013? 02? 06? 17:51, Inki Dae wrote:
> 
> 
>> -----Original Message-----
>> From: Sachin Kamat [mailto:sachin.kamat@linaro.org]
>> Sent: Wednesday, February 06, 2013 5:03 PM
>> To: Inki Dae
>> Cc: linux-media@vger.kernel.org; dri-devel@lists.freedesktop.org;
>> devicetree-discuss@lists.ozlabs.org; k.debski@samsung.com;
>> s.nawrocki@samsung.com; kgene.kim@samsung.com; patches@linaro.org; Ajay
>> Kumar
>> Subject: Re: [PATCH v2 2/2] drm/exynos: Add device tree based discovery
>> support for G2D
>>
>> On 6 February 2013 13:02, Inki Dae <inki.dae@samsung.com> wrote:
>>>
>>> Looks good to me but please add document for it.
>>
>> Yes. I will. I was planning to send the bindings document patch along
>> with the dt patches (adding node entries to dts files).
>> Sylwester had suggested adding this to
>> Documentation/devicetree/bindings/media/ which contains other media
>> IPs.
> 
> I think that it's better to go to gpu than media and we can divide Exynos
> IPs into the bellow categories,
> 
> Media : mfc
> GPU : g2d, g3d, fimc, gsc
> Video : fimd, hdmi, eDP, MIPI-DSI

Hm, here is another considering point. Some device can be used as one of
two sub-system. For example g2d can be used as V4L2 driver or DRM
driver. And more specific case, multiple fimc/gsc deivces can be
separately used as both drivers: two fimc devices are used as V4L2
driver and other devices are used as DRM driver.
Current discussion, without change of build configuration, device can be
only used as one driver.

So I want to discuss about how we can bind device and driver just with
dts configuration.

IMO, there are two options.

First, driver usage is set on configurable node.
	g2d: g2d {
		compatible = "samsung,exynos4212-g2d";
                ...
                *subsystem = "v4l2"* or *subsystem = "drm"*
	};
Node name and type is just an example to describe.
With this option, driver which is not matched with subsystem node should
return with fail during its probing.

Second, using dual compatible strings.
	g2d: g2d {
		*compatible = "samsung,exynos4212-v4l2-g2d"; or
                compatible = "samsung,exynos4212-v4l2-g2d";*
                ...
	};
String is just an example so don't mind if it is ugly. Actually, with
this option, compatible string has non HW information. But this option
does not need fail in probing.

I'm not sure these options are fit to DT concept. Please let me know if
anyone has idea.

Best Regards,
- Seung-Woo Kim

> 
> And I think that the device-tree describes hardware so possibly, all
> documents in .../bindings/drm/exynos/* should be moved to proper place also.
> Please give  me any opinions.
> 
> Thanks,
> Inki Dae
> 
>>
>>>
>>> To other guys,
>>> And is there anyone who know where this document should be added to?
>>> I'm not sure that the g2d document should be placed in
>>> Documentation/devicetree/bindings/gpu, media, drm/exynos or arm/exynos.
>> At
>>> least, this document should be shared with the g2d hw relevant drivers
>> such
>>> as v4l2 and drm. So is ".../bindings/gpu" proper place?
>>>
>>
>>
>> --
>> With warm regards,
>> Sachin
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Sylwester Nawrocki Feb. 6, 2013, 11:23 a.m. UTC | #5
On 02/06/2013 09:51 AM, Inki Dae wrote:
[...]
> I think that it's better to go to gpu than media and we can divide Exynos
> IPs into the bellow categories,
> 
> Media : mfc
> GPU : g2d, g3d, fimc, gsc

Heh, nice try! :) GPU and FIMC ? FIMC is a camera subsystem (hence 'C' 
in the acronym), so what it has really to do with GPU ? All right, this IP 
has really two functions: camera capture and video post-processing 
(colorspace conversion, scaling), but the main feature is camera capture 
(fimc-lite is a camera capture interface IP only).

Also, Exynos5 GScaler is used as a DMA engine for camera capture data
pipelines, so it will be used by a camera capture driver as well. It
really belongs to "Media" and "GPU", as this is a multifunctional 
device (similarly to FIMC).

So I propose following classification, which seems less inaccurate:

GPU:   g2d, g3d
Media: mfc, fimc, fimc-lite, fimc-is, mipi-csis, gsc
Video: fimd, hdmi, eDP, mipi-dsim

I have already a DT bindings description prepared for fimc [1].
(probably it needs to be rephrased a bit not to refer to the linux
device model). I put it in Documentation/devicetree/bindings/media/soc, 
but likely there is no need for the 'soc' subdirectory...

> Video : fimd, hdmi, eDP, MIPI-DSI
> 
> And I think that the device-tree describes hardware so possibly, all
> documents in .../bindings/drm/exynos/* should be moved to proper place also.
> Please give  me any opinions.

Yes, I agree. If possible, it would be nice to have some Linux API
agnostic locations.

[1] goo.gl/eTGOl

--

Thanks,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Sachin Kamat Feb. 6, 2013, 11:41 a.m. UTC | #6
On 6 February 2013 16:53, Sylwester Nawrocki <s.nawrocki@samsung.com> wrote:
> On 02/06/2013 09:51 AM, Inki Dae wrote:
> [...]

> So I propose following classification, which seems less inaccurate:
>
> GPU:   g2d, g3d
> Media: mfc, fimc, fimc-lite, fimc-is, mipi-csis, gsc
> Video: fimd, hdmi, eDP, mipi-dsim

Thanks Inki and Sylwester for your inputs.
We need to figure out some sensible location for these drivers'
documentation though I liked what you have proposed for now.
I will add g2d document to gpu directory as both of you suggest the same.
If there are better opinions will move it later.
  
Inki Dae Feb. 6, 2013, 11:47 a.m. UTC | #7
> -----Original Message-----
> From: linux-media-owner@vger.kernel.org [mailto:linux-media-
> owner@vger.kernel.org] On Behalf Of Sylwester Nawrocki
> Sent: Wednesday, February 06, 2013 8:24 PM
> To: Inki Dae
> Cc: 'Sachin Kamat'; linux-media@vger.kernel.org; dri-
> devel@lists.freedesktop.org; devicetree-discuss@lists.ozlabs.org;
> k.debski@samsung.com; kgene.kim@samsung.com; patches@linaro.org; 'Ajay
> Kumar'; kyungmin.park@samsung.com; sw0312.kim@samsung.com;
> jy0922.shim@samsung.com
> Subject: Re: [PATCH v2 2/2] drm/exynos: Add device tree based discovery
> support for G2D
> 
> On 02/06/2013 09:51 AM, Inki Dae wrote:
> [...]
> > I think that it's better to go to gpu than media and we can divide
> Exynos
> > IPs into the bellow categories,
> >
> > Media : mfc
> > GPU : g2d, g3d, fimc, gsc
> 
> Heh, nice try! :) GPU and FIMC ? FIMC is a camera subsystem (hence 'C'
> in the acronym), so what it has really to do with GPU ? All right, this IP
> has really two functions: camera capture and video post-processing
> (colorspace conversion, scaling), but the main feature is camera capture
> (fimc-lite is a camera capture interface IP only).
> 
> Also, Exynos5 GScaler is used as a DMA engine for camera capture data
> pipelines, so it will be used by a camera capture driver as well. It
> really belongs to "Media" and "GPU", as this is a multifunctional
> device (similarly to FIMC).
> 
> So I propose following classification, which seems less inaccurate:
> 
> GPU:   g2d, g3d
> Media: mfc, fimc, fimc-lite, fimc-is, mipi-csis, gsc
> Video: fimd, hdmi, eDP, mipi-dsim
> 

Ok, it seems that your propose is better. :)

To Sachin,
Please add g2d document to .../bindings/gpu

To Rahul,
Could you please move .../drm/exynos/* to .../bindings/video? Probably you
need to rename the files there to exynos*.txt

If there are no other opinions, let's start  :)

Thanks,
Inki Dae

> I have already a DT bindings description prepared for fimc [1].
> (probably it needs to be rephrased a bit not to refer to the linux
> device model). I put it in Documentation/devicetree/bindings/media/soc,
> but likely there is no need for the 'soc' subdirectory...
> 
> > Video : fimd, hdmi, eDP, MIPI-DSI
> >
> > And I think that the device-tree describes hardware so possibly, all
> > documents in .../bindings/drm/exynos/* should be moved to proper place
> also.
> > Please give  me any opinions.
> 
> Yes, I agree. If possible, it would be nice to have some Linux API
> agnostic locations.
> 
> [1] goo.gl/eTGOl
> 
> --
> 
> Thanks,
> Sylwester
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Inki Dae Feb. 12, 2013, 1:17 p.m. UTC | #8
Applied and will go to -next.
And please post the document(in
Documentation/devicetree/bindings/gpu/) for it later.

Thanks,
Inki Dae

2013/2/6 Sachin Kamat <sachin.kamat@linaro.org>:
> From: Ajay Kumar <ajaykumar.rs@samsung.com>
>
> This patch adds device tree match table for Exynos G2D controller.
>
> Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> Patch based on exynos-drm-fixes branch of Inki Dae's tree:
> git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git
>
> Changes since v1:
> Modified the compatible string as per the discussions at [1].
> [1] https://patchwork1.kernel.org/patch/2045821/
> ---
>  drivers/gpu/drm/exynos/exynos_drm_g2d.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
> index ddcfb5d..0fcfbe4 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
> @@ -19,6 +19,7 @@
>  #include <linux/workqueue.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/dma-attrs.h>
> +#include <linux/of.h>
>
>  #include <drm/drmP.h>
>  #include <drm/exynos_drm.h>
> @@ -1240,6 +1241,14 @@ static int g2d_resume(struct device *dev)
>
>  static SIMPLE_DEV_PM_OPS(g2d_pm_ops, g2d_suspend, g2d_resume);
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id exynos_g2d_match[] = {
> +       { .compatible = "samsung,exynos5250-g2d" },
> +       {},
> +};
> +MODULE_DEVICE_TABLE(of, exynos_g2d_match);
> +#endif
> +
>  struct platform_driver g2d_driver = {
>         .probe          = g2d_probe,
>         .remove         = g2d_remove,
> @@ -1247,5 +1256,6 @@ struct platform_driver g2d_driver = {
>                 .name   = "s5p-g2d",
>                 .owner  = THIS_MODULE,
>                 .pm     = &g2d_pm_ops,
> +               .of_match_table = of_match_ptr(exynos_g2d_match),
>         },
>  };
> --
> 1.7.4.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Sylwester Nawrocki Feb. 12, 2013, 1:31 p.m. UTC | #9
On 02/12/2013 02:17 PM, Inki Dae wrote:
> Applied and will go to -next.
> And please post the document(in
> Documentation/devicetree/bindings/gpu/) for it later.

There is already some old patch applied in the devicetree/next tree:

http://git.secretlab.ca/?p=linux.git;a=commitdiff;h=09495dda6a62c74b13412a63528093910ef80edd

I guess there is now an incremental patch needed for this.


Regards,
Sylwester

























--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Inki Dae Feb. 12, 2013, 1:57 p.m. UTC | #10
2013/2/12 Sylwester Nawrocki <s.nawrocki@samsung.com>:
> On 02/12/2013 02:17 PM, Inki Dae wrote:
>> Applied and will go to -next.
>> And please post the document(in
>> Documentation/devicetree/bindings/gpu/) for it later.
>
> There is already some old patch applied in the devicetree/next tree:
>
> http://git.secretlab.ca/?p=linux.git;a=commitdiff;h=09495dda6a62c74b13412a63528093910ef80edd
>
> I guess there is now an incremental patch needed for this.
>

I think that this patch should be reverted because the compatible
string of this document isn't generic and also the document file
should be moved into proper place(.../bindings/gpu/).

So Mr. Grant, could you please revert the below patch?
        "of/exynos_g2d: Add Bindings for exynos G2D driver"
        commit: 09495dda6a62c74b13412a63528093910ef80edd

This document should be modifed correctly and re-posted. For this, we
have already reached an arrangement with other Exynos maintainters.

Thanks,
Inki Dae

>
> Regards,
> Sylwester
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index ddcfb5d..0fcfbe4 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -19,6 +19,7 @@ 
 #include <linux/workqueue.h>
 #include <linux/dma-mapping.h>
 #include <linux/dma-attrs.h>
+#include <linux/of.h>
 
 #include <drm/drmP.h>
 #include <drm/exynos_drm.h>
@@ -1240,6 +1241,14 @@  static int g2d_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(g2d_pm_ops, g2d_suspend, g2d_resume);
 
+#ifdef CONFIG_OF
+static const struct of_device_id exynos_g2d_match[] = {
+	{ .compatible = "samsung,exynos5250-g2d" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, exynos_g2d_match);
+#endif
+
 struct platform_driver g2d_driver = {
 	.probe		= g2d_probe,
 	.remove		= g2d_remove,
@@ -1247,5 +1256,6 @@  struct platform_driver g2d_driver = {
 		.name	= "s5p-g2d",
 		.owner	= THIS_MODULE,
 		.pm	= &g2d_pm_ops,
+		.of_match_table = of_match_ptr(exynos_g2d_match),
 	},
 };