[RFC 5/7] drm/omap: Do dss_device (display) ordering in omap_drv.c

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Sep 4 09:46:26 UTC 2017


Hi Peter,

On Monday, 4 September 2017 12:26:08 EEST Peter Ujfalusi wrote:
> On 2017-09-01 14:32, Laurent Pinchart wrote:
> >> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c
> >> b/drivers/gpu/drm/omapdrm/omap_drv.c index 32dc0e88220f..0e100a359d26
> >> 100644
> >> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> >> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> >> @@ -18,6 +18,8 @@
> >> 
> >>   */
> >>  
> >>  #include <linux/sys_soc.h>
> >> 
> >> +#include <linux/sort.h>
> >> +#include <linux/of.h>
> > 
> > Please keep this list alphabetically sorted.
> 
> OK.
> 
> >>  #include <drm/drm_atomic.h>
> >>  #include <drm/drm_atomic_helper.h>
> >> 
> >> @@ -162,6 +164,22 @@ static void omap_disconnect_dssdevs(struct
> >> drm_device
> >> *ddev) priv->num_dssdevs = 0;
> >> 
> >>  }
> >> 
> >> +static int omap_compare_dssdevs(const void *a, const void *b)
> >> +{
> >> +	const struct omap_dss_device *dssdev1 = *(struct omap_dss_device **)a;
> >> +	const struct omap_dss_device *dssdev2 = *(struct omap_dss_device **)b;
> >> +	int  id1, id2;
> >> +
> >> +	id1 = of_alias_get_id(dssdev1->dev->of_node, "display");
> >> +	id2 = of_alias_get_id(dssdev2->dev->of_node, "display");
> > 
> > Getting the alias id is a bit costly, how about caching them ?
> 
> This is going to be done once and the ID will be never used after this.
> We could add the ID to 'struct omap_dss_device' and initialize it in
> omapdss_register_display, if that's what you are referring to.

Yes, that's what I meant.

-- 
Regards,

Laurent Pinchart



More information about the dri-devel mailing list