[Intel-gfx] [PATCH v3] drm: Store the plane's index

Daniel Vetter daniel at ffwll.ch
Thu Jun 2 22:02:56 UTC 2016


On Fri, May 27, 2016 at 01:43:19PM -0700, Matt Roper wrote:
> On Fri, May 27, 2016 at 08:05:00PM +0100, Chris Wilson wrote:
> > Currently the plane's index is determined by walking the list of all
> > planes in the mode and finding the position of that plane in the list. A
> > linear walk, especially a linear walk within a linear walk as frequently
> > conceived by i915.ko [O(N^2)] quickly comes to dominate profiles.
> > 
> > The plane's index is constant for as long as no earlier planes are
> > removed from the list. For all drivers, planes are static, determined
> > at boot and then untouched until shutdown. In fact, there is no locking
> > provided to allow for dynamic removal of planes/encoders/crtcs.
> > 
> > v2: Convert drm_crtc_index() and drm_encoder_index() as well.
> > v3: Stop adjusting the indices upon removal; consider the list
> > construct-only.
> > 
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> > Cc: Matt Roper <matthew.d.roper at intel.com>
> > Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> ...snip...
> > @@ -2337,7 +2369,18 @@ extern int drm_plane_init(struct drm_device *dev,
> >  			  const uint32_t *formats, unsigned int format_count,
> >  			  bool is_primary);
> >  extern void drm_plane_cleanup(struct drm_plane *plane);
> > -extern unsigned int drm_plane_index(struct drm_plane *plane);
> > +
> > +/**
> > + * drm_plane_index - find the index of a registered plane
> > + * @plane: plane to find index for
> > + *
> > + * Given a registered plane, return the index of that CRTC within a DRM
> 
> "index of that plane"

Fixed ..
> 
> Otherwise,
> 
> Reviewed-by: Matt Roper <matthew.d.roper at intel.com>

... and applied to drm-misc.
-Daniel

> 
> 
> 
> Matt
> 
> > + * device's list of planes.
> > + */
> > +static inline unsigned int drm_plane_index(struct drm_plane *plane)
> > +{
> > +	return plane->index;
> > +}
> >  extern struct drm_plane * drm_plane_from_index(struct drm_device *dev, int idx);
> >  extern void drm_plane_force_disable(struct drm_plane *plane);
> >  extern int drm_plane_check_pixel_format(const struct drm_plane *plane,
> > -- 
> > 2.8.1
> > 
> 
> -- 
> Matt Roper
> Graphics Software Engineer
> IoTG Platform Enabling & Development
> Intel Corporation
> (916) 356-2795

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list