diff mbox

[05/15] drm/atmel-hlcdc: Use per-plane rotation property

Message ID 1469194996-1899-6-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä July 22, 2016, 1:43 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The global mode_config.rotation_property is going away, switch over to
per-plane rotation_property.

Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

Comments

Boris BREZILLON July 22, 2016, 1:58 p.m. UTC | #1
Hi Ville,

On Fri, 22 Jul 2016 16:43:06 +0300
ville.syrjala@linux.intel.com wrote:

> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The global mode_config.rotation_property is going away, switch over to
> per-plane rotation_property.
> 
> Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> index f3350c80704d..be3d4310ea97 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> @@ -903,9 +903,12 @@ static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,
>  	}
>  
>  	if (desc->layout.xstride && desc->layout.pstride)
> -		drm_object_attach_property(&plane->base.base,
> -				plane->base.dev->mode_config.rotation_property,
> -				BIT(DRM_ROTATE_0));
> +		drm_plane_create_rotation_property(&plane->base,
> +						   BIT(DRM_ROTATE_0),
> +						   BIT(DRM_ROTATE_0) |
> +						   BIT(DRM_ROTATE_90) |
> +						   BIT(DRM_ROTATE_180) |
> +						   BIT(DRM_ROTATE_270));

Can you update the atmel_hlcdc_plane_init_properties() prototype to
return an int so that we can catch errors returned by
drm_plane_create_rotation_property().

Thanks,

Boris

>  
>  	if (desc->layout.csc) {
>  		/*
> @@ -1054,15 +1057,6 @@ atmel_hlcdc_plane_create_properties(struct drm_device *dev)
>  	if (!props->alpha)
>  		return ERR_PTR(-ENOMEM);
>  
> -	dev->mode_config.rotation_property =
> -			drm_mode_create_rotation_property(dev,
> -							  BIT(DRM_ROTATE_0) |
> -							  BIT(DRM_ROTATE_90) |
> -							  BIT(DRM_ROTATE_180) |
> -							  BIT(DRM_ROTATE_270));
> -	if (!dev->mode_config.rotation_property)
> -		return ERR_PTR(-ENOMEM);
> -
>  	return props;
>  }
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index f3350c80704d..be3d4310ea97 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -903,9 +903,12 @@  static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,
 	}
 
 	if (desc->layout.xstride && desc->layout.pstride)
-		drm_object_attach_property(&plane->base.base,
-				plane->base.dev->mode_config.rotation_property,
-				BIT(DRM_ROTATE_0));
+		drm_plane_create_rotation_property(&plane->base,
+						   BIT(DRM_ROTATE_0),
+						   BIT(DRM_ROTATE_0) |
+						   BIT(DRM_ROTATE_90) |
+						   BIT(DRM_ROTATE_180) |
+						   BIT(DRM_ROTATE_270));
 
 	if (desc->layout.csc) {
 		/*
@@ -1054,15 +1057,6 @@  atmel_hlcdc_plane_create_properties(struct drm_device *dev)
 	if (!props->alpha)
 		return ERR_PTR(-ENOMEM);
 
-	dev->mode_config.rotation_property =
-			drm_mode_create_rotation_property(dev,
-							  BIT(DRM_ROTATE_0) |
-							  BIT(DRM_ROTATE_90) |
-							  BIT(DRM_ROTATE_180) |
-							  BIT(DRM_ROTATE_270));
-	if (!dev->mode_config.rotation_property)
-		return ERR_PTR(-ENOMEM);
-
 	return props;
 }