diff mbox

[3/4] drm: omap: Enable DT support for DMM

Message ID 1379063679-4869-4-git-send-email-archit@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

archit taneja Sept. 13, 2013, 9:14 a.m. UTC
Enable use of DT for DMM/Tiler.

Originally worked on by Andy Gross.

Cc: Andy Gross <andygro@gmail.com>
Cc: DRI Development <dri-devel@lists.freedesktop.org>
Signed-off-by: Archit Taneja <archit@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Rob Clark Sept. 13, 2013, 2:14 p.m. UTC | #1
On Fri, Sep 13, 2013 at 5:14 AM, Archit Taneja <archit@ti.com> wrote:
> Enable use of DT for DMM/Tiler.
>
> Originally worked on by Andy Gross.

looks good.. but do we want to get information about # of LUT's, etc,
from DT?  Or did we decide that we can reliably get this from the hw?
I lost track of that discussion (I guess Andy would remember)..

BR,
-R

> Cc: Andy Gross <andygro@gmail.com>
> Cc: DRI Development <dri-devel@lists.freedesktop.org>
> Signed-off-by: Archit Taneja <archit@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> index acf6678..59f17de 100644
> --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> @@ -968,12 +968,23 @@ static const struct dev_pm_ops omap_dmm_pm_ops = {
>  };
>  #endif
>
> +#if defined(CONFIG_OF)
> +static const struct of_device_id dmm_of_match[] = {
> +       { .compatible = "ti,omap4-dmm", },
> +       { .compatible = "ti,omap5-dmm", },
> +       {},
> +};
> +#else
> +#define dmm_of_match NULL
> +#endif
> +
>  struct platform_driver omap_dmm_driver = {
>         .probe = omap_dmm_probe,
>         .remove = omap_dmm_remove,
>         .driver = {
>                 .owner = THIS_MODULE,
>                 .name = DMM_DRIVER_NAME,
> +               .of_match_table = dmm_of_match,
>  #ifdef CONFIG_PM
>                 .pm = &omap_dmm_pm_ops,
>  #endif
> --
> 1.8.1.2
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
archit taneja Sept. 16, 2013, 6:28 a.m. UTC | #2
On Friday 13 September 2013 07:44 PM, Rob Clark wrote:
> On Fri, Sep 13, 2013 at 5:14 AM, Archit Taneja <archit@ti.com> wrote:
>> Enable use of DT for DMM/Tiler.
>>
>> Originally worked on by Andy Gross.
>
> looks good.. but do we want to get information about # of LUT's, etc,
> from DT?  Or did we decide that we can reliably get this from the hw?
> I lost track of that discussion (I guess Andy would remember)..

I am not aware of the discussion either. But looks like we get the LUT 
info from the HW registers in omap_dmm_probe:

         hwinfo = readl(omap_dmm->base + DMM_PAT_HWINFO);
         omap_dmm->num_engines = (hwinfo >> 24) & 0x1F;
         omap_dmm->num_lut = (hwinfo >> 16) & 0x1F;
         omap_dmm->container_width = 256;
         omap_dmm->container_height = 128;

         atomic_set(&omap_dmm->engine_counter, omap_dmm->num_engines);

         /* read out actual LUT width and height */
         pat_geom = readl(omap_dmm->base + DMM_PAT_GEOMETRY);
         omap_dmm->lut_width = ((pat_geom >> 16) & 0xF) << 5;
         omap_dmm->lut_height = ((pat_geom >> 24) & 0xF) << 5;

         /* increment LUT by one if on OMAP5 */
         /* LUT has twice the height, and is split into a separate 
container */
         if (omap_dmm->lut_height != omap_dmm->container_height)
                 omap_dmm->num_lut++;


Archit
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Clark Sept. 16, 2013, 11:56 a.m. UTC | #3
On Mon, Sep 16, 2013 at 2:28 AM, Archit Taneja <archit@ti.com> wrote:
> On Friday 13 September 2013 07:44 PM, Rob Clark wrote:
>>
>> On Fri, Sep 13, 2013 at 5:14 AM, Archit Taneja <archit@ti.com> wrote:
>>>
>>> Enable use of DT for DMM/Tiler.
>>>
>>> Originally worked on by Andy Gross.
>>
>>
>> looks good.. but do we want to get information about # of LUT's, etc,
>> from DT?  Or did we decide that we can reliably get this from the hw?
>> I lost track of that discussion (I guess Andy would remember)..
>
>
> I am not aware of the discussion either. But looks like we get the LUT info
> from the HW registers in omap_dmm_probe:

right.. I'm possibly mis-remembering, but I thought I remember Andy
worried that this was not reliable for some reason or another, but I
can't really remember the details.  The issue may have only been
related to a pre-Si simulation environment, so it could be nothing.

I suppose if it becomes an issue in the future we could always add DT
bindings to override what we would read from the hw, so I guess if
this works on all the current devices, maybe it isn't worth worrying
about right now.

BR,
-R

>         hwinfo = readl(omap_dmm->base + DMM_PAT_HWINFO);
>         omap_dmm->num_engines = (hwinfo >> 24) & 0x1F;
>         omap_dmm->num_lut = (hwinfo >> 16) & 0x1F;
>         omap_dmm->container_width = 256;
>         omap_dmm->container_height = 128;
>
>         atomic_set(&omap_dmm->engine_counter, omap_dmm->num_engines);
>
>         /* read out actual LUT width and height */
>         pat_geom = readl(omap_dmm->base + DMM_PAT_GEOMETRY);
>         omap_dmm->lut_width = ((pat_geom >> 16) & 0xF) << 5;
>         omap_dmm->lut_height = ((pat_geom >> 24) & 0xF) << 5;
>
>         /* increment LUT by one if on OMAP5 */
>         /* LUT has twice the height, and is split into a separate container
> */
>         if (omap_dmm->lut_height != omap_dmm->container_height)
>                 omap_dmm->num_lut++;
>
>
> Archit
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
index acf6678..59f17de 100644
--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
@@ -968,12 +968,23 @@  static const struct dev_pm_ops omap_dmm_pm_ops = {
 };
 #endif
 
+#if defined(CONFIG_OF)
+static const struct of_device_id dmm_of_match[] = {
+	{ .compatible = "ti,omap4-dmm", },
+	{ .compatible = "ti,omap5-dmm", },
+	{},
+};
+#else
+#define dmm_of_match NULL
+#endif
+
 struct platform_driver omap_dmm_driver = {
 	.probe = omap_dmm_probe,
 	.remove = omap_dmm_remove,
 	.driver = {
 		.owner = THIS_MODULE,
 		.name = DMM_DRIVER_NAME,
+		.of_match_table = dmm_of_match,
 #ifdef CONFIG_PM
 		.pm = &omap_dmm_pm_ops,
 #endif