Re: [PATCH v3] drm: Store the plane's index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
> Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
> Cc: Matt Roper <matthew.d.roper@xxxxxxxxx>
> Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> ---
...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"

Otherwise,

Reviewed-by: Matt Roper <matthew.d.roper@xxxxxxxxx>



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
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux