diff options
Diffstat (limited to 'drivers/gpu/drm/atmel-hlcdc')
| -rw-r--r-- | drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 5 | ||||
| -rw-r--r-- | drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 41 | 
2 files changed, 24 insertions, 22 deletions
| diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index 5f484310bee9..cbd0070265c9 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -464,7 +464,7 @@ atmel_hlcdc_dc_atomic_complete(struct atmel_hlcdc_dc_commit *commit)  	drm_atomic_helper_cleanup_planes(dev, old_state); -	drm_atomic_state_free(old_state); +	drm_atomic_state_put(old_state);  	/* Complete the commit, wake up any waiter. */  	spin_lock(&dc->commit.wait.lock); @@ -521,6 +521,7 @@ static int atmel_hlcdc_dc_atomic_commit(struct drm_device *dev,  	/* Swap the state, this is the point of no return. */  	drm_atomic_helper_swap_state(state, true); +	drm_atomic_state_get(state);  	if (async)  		queue_work(dc->wq, &commit->work);  	else @@ -748,9 +749,7 @@ static const struct file_operations fops = {  	.open               = drm_open,  	.release            = drm_release,  	.unlocked_ioctl     = drm_ioctl, -#ifdef CONFIG_COMPAT  	.compat_ioctl       = drm_compat_ioctl, -#endif  	.poll               = drm_poll,  	.read               = drm_read,  	.llseek             = no_llseek, diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index 9d4c030672f0..246ed1e33d8a 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -393,7 +393,7 @@ static void atmel_hlcdc_plane_update_format(struct atmel_hlcdc_plane *plane,  	if ((state->base.fb->pixel_format == DRM_FORMAT_YUV422 ||  	     state->base.fb->pixel_format == DRM_FORMAT_NV61) && -	    (state->base.rotation & (DRM_ROTATE_90 | DRM_ROTATE_270))) +	    drm_rotation_90_or_270(state->base.rotation))  		cfg |= ATMEL_HLCDC_YUV422ROT;  	atmel_hlcdc_layer_update_cfg(&plane->layer, @@ -628,7 +628,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,  	/*  	 * Swap width and size in case of 90 or 270 degrees rotation  	 */ -	if (state->base.rotation & (DRM_ROTATE_90 | DRM_ROTATE_270)) { +	if (drm_rotation_90_or_270(state->base.rotation)) {  		tmp = state->crtc_w;  		state->crtc_w = state->crtc_h;  		state->crtc_h = tmp; @@ -883,9 +883,9 @@ static int atmel_hlcdc_plane_atomic_get_property(struct drm_plane *p,  	return 0;  } -static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane, -				const struct atmel_hlcdc_layer_desc *desc, -				struct atmel_hlcdc_plane_properties *props) +static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane, +					     const struct atmel_hlcdc_layer_desc *desc, +					     struct atmel_hlcdc_plane_properties *props)  {  	struct regmap *regmap = plane->layer.hlcdc->regmap; @@ -902,10 +902,18 @@ static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,  				ATMEL_HLCDC_LAYER_GA_MASK);  	} -	if (desc->layout.xstride && desc->layout.pstride) -		drm_object_attach_property(&plane->base.base, -				plane->base.dev->mode_config.rotation_property, -				DRM_ROTATE_0); +	if (desc->layout.xstride && desc->layout.pstride) { +		int ret; + +		ret = drm_plane_create_rotation_property(&plane->base, +							 DRM_ROTATE_0, +							 DRM_ROTATE_0 | +							 DRM_ROTATE_90 | +							 DRM_ROTATE_180 | +							 DRM_ROTATE_270); +		if (ret) +			return ret; +	}  	if (desc->layout.csc) {  		/* @@ -925,6 +933,8 @@ static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,  			     ATMEL_HLCDC_LAYER_CSC_CFG(&plane->layer, 2),  			     0x40040890);  	} + +	return 0;  }  static struct drm_plane_helper_funcs atmel_hlcdc_layer_plane_helper_funcs = { @@ -1036,7 +1046,9 @@ atmel_hlcdc_plane_create(struct drm_device *dev,  			     &atmel_hlcdc_layer_plane_helper_funcs);  	/* Set default property values*/ -	atmel_hlcdc_plane_init_properties(plane, desc, props); +	ret = atmel_hlcdc_plane_init_properties(plane, desc, props); +	if (ret) +		return ERR_PTR(ret);  	return plane;  } @@ -1054,15 +1066,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, -							  DRM_ROTATE_0 | -							  DRM_ROTATE_90 | -							  DRM_ROTATE_180 | -							  DRM_ROTATE_270); -	if (!dev->mode_config.rotation_property) -		return ERR_PTR(-ENOMEM); -  	return props;  } |