[Intel-gfx] [PATCH 03/13] drm/i915: Consolidate plane handler vtables

Ander Conselvan de Oliveira conselvan2 at gmail.com
Wed Jan 21 02:09:59 PST 2015


Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>

On 01/20/2015 05:57 AM, Matt Roper wrote:
> All of the previous refactoring/consolidation of plane code has resulted
> in intel_primary_plane_funcs, intel_cursor_plane_funcs, and
> intel_sprite_plane_funcs being identical.  Replace all of these with a
> single 'intel_plane_funcs' vtable for simplicity.
> 
> Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
> ---
>   drivers/gpu/drm/i915/intel_display.c | 15 +++------------
>   drivers/gpu/drm/i915/intel_drv.h     |  1 +
>   drivers/gpu/drm/i915/intel_sprite.c  | 11 +----------
>   3 files changed, 5 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 7863414..9bf5221 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11968,7 +11968,7 @@ void intel_plane_destroy(struct drm_plane *plane)
>   	kfree(intel_plane);
>   }
>   
> -static const struct drm_plane_funcs intel_primary_plane_funcs = {
> +const struct drm_plane_funcs intel_plane_funcs = {
>   	.update_plane = drm_plane_helper_update,
>   	.disable_plane = drm_plane_helper_disable,
>   	.destroy = intel_plane_destroy,
> @@ -12016,7 +12016,7 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,
>   	}
>   
>   	drm_universal_plane_init(dev, &primary->base, 0,
> -				 &intel_primary_plane_funcs,
> +				 &intel_plane_funcs,
>   				 intel_primary_formats, num_formats,
>   				 DRM_PLANE_TYPE_PRIMARY);
>   
> @@ -12144,15 +12144,6 @@ update:
>   		intel_crtc_update_cursor(crtc, state->visible);
>   }
>   
> -static const struct drm_plane_funcs intel_cursor_plane_funcs = {
> -	.update_plane = drm_plane_helper_update,
> -	.disable_plane = drm_plane_helper_disable,
> -	.destroy = intel_plane_destroy,
> -	.set_property = intel_plane_set_property,
> -	.atomic_duplicate_state = intel_plane_duplicate_state,
> -	.atomic_destroy_state = intel_plane_destroy_state,
> -};
> -
>   static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,
>   						   int pipe)
>   {
> @@ -12179,7 +12170,7 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,
>   	cursor->commit_plane = intel_commit_cursor_plane;
>   
>   	drm_universal_plane_init(dev, &cursor->base, 0,
> -				 &intel_cursor_plane_funcs,
> +				 &intel_plane_funcs,
>   				 intel_cursor_formats,
>   				 ARRAY_SIZE(intel_cursor_formats),
>   				 DRM_PLANE_TYPE_CURSOR);
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 918cce2..2133fd1 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -908,6 +908,7 @@ void i915_audio_component_init(struct drm_i915_private *dev_priv);
>   void i915_audio_component_cleanup(struct drm_i915_private *dev_priv);
>   
>   /* intel_display.c */
> +extern const struct drm_plane_funcs intel_plane_funcs;
>   bool intel_has_pending_fb_unpin(struct drm_device *dev);
>   int intel_pch_rawclk(struct drm_device *dev);
>   void intel_mark_busy(struct drm_device *dev);
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 140c5b7..8af4c69 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -1406,15 +1406,6 @@ int intel_plane_restore(struct drm_plane *plane)
>   				  plane->state->src_w, plane->state->src_h);
>   }
>   
> -static const struct drm_plane_funcs intel_sprite_plane_funcs = {
> -	.update_plane = drm_plane_helper_update,
> -	.disable_plane = drm_plane_helper_disable,
> -	.destroy = intel_plane_destroy,
> -	.set_property = intel_plane_set_property,
> -	.atomic_duplicate_state = intel_plane_duplicate_state,
> -	.atomic_destroy_state = intel_plane_destroy_state,
> -};
> -
>   static uint32_t ilk_plane_formats[] = {
>   	DRM_FORMAT_XRGB8888,
>   	DRM_FORMAT_YUYV,
> @@ -1557,7 +1548,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
>   	intel_plane->commit_plane = intel_commit_sprite_plane;
>   	possible_crtcs = (1 << pipe);
>   	ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs,
> -				       &intel_sprite_plane_funcs,
> +				       &intel_plane_funcs,
>   				       plane_formats, num_plane_formats,
>   				       DRM_PLANE_TYPE_OVERLAY);
>   	if (ret) {
> 



More information about the Intel-gfx mailing list