dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/omap: remove no-op cleanup code
@ 2017-08-16  9:11 Tomi Valkeinen
  2017-08-16 13:16 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: Tomi Valkeinen @ 2017-08-16  9:11 UTC (permalink / raw)
  To: dri-devel, Laurent Pinchart; +Cc: Daniel Vetter, Tomi Valkeinen

The driver sets crtc and plane rotation properties back to 0 degrees in
dev_lastclose() using drm_object_property_set_value().
drm_object_property_set_value() doesn't do anything with atomic drivers,
and a recent change added WARN_ON() when atomic driver calls the
function.

So remove the code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 33 ---------------------------------
 1 file changed, 33 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 17f13efcfebd..46ee0f25262e 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -464,44 +464,11 @@ static int dev_open(struct drm_device *dev, struct drm_file *file)
  */
 static void dev_lastclose(struct drm_device *dev)
 {
-	int i;
-
-	/* we don't support vga_switcheroo.. so just make sure the fbdev
-	 * mode is active
-	 */
 	struct omap_drm_private *priv = dev->dev_private;
 	int ret;
 
 	DBG("lastclose: dev=%p", dev);
 
-	/* need to restore default rotation state.. not sure
-	 * if there is a cleaner way to restore properties to
-	 * default state?  Maybe a flag that properties should
-	 * automatically be restored to default state on
-	 * lastclose?
-	 */
-	for (i = 0; i < priv->num_crtcs; i++) {
-		struct drm_crtc *crtc = priv->crtcs[i];
-
-		if (!crtc->primary->rotation_property)
-			continue;
-
-		drm_object_property_set_value(&crtc->base,
-					      crtc->primary->rotation_property,
-					      DRM_MODE_ROTATE_0);
-	}
-
-	for (i = 0; i < priv->num_planes; i++) {
-		struct drm_plane *plane = priv->planes[i];
-
-		if (!plane->rotation_property)
-			continue;
-
-		drm_object_property_set_value(&plane->base,
-					      plane->rotation_property,
-					      DRM_MODE_ROTATE_0);
-	}
-
 	if (priv->fbdev) {
 		ret = drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev);
 		if (ret)
-- 
2.7.4


Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/omap: remove no-op cleanup code
  2017-08-16  9:11 [PATCH] drm/omap: remove no-op cleanup code Tomi Valkeinen
@ 2017-08-16 13:16 ` Laurent Pinchart
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2017-08-16 13:16 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Daniel Vetter, dri-devel

Hi Tomi,

Thank you for the patch.

On Wednesday 16 Aug 2017 12:11:25 Tomi Valkeinen wrote:
> The driver sets crtc and plane rotation properties back to 0 degrees in
> dev_lastclose() using drm_object_property_set_value().
> drm_object_property_set_value() doesn't do anything with atomic drivers,
> and a recent change added WARN_ON() when atomic driver calls the
> function.
> 
> So remove the code.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/gpu/drm/omapdrm/omap_drv.c | 33 ---------------------------------
>  1 file changed, 33 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c
> b/drivers/gpu/drm/omapdrm/omap_drv.c index 17f13efcfebd..46ee0f25262e
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -464,44 +464,11 @@ static int dev_open(struct drm_device *dev, struct
> drm_file *file) */
>  static void dev_lastclose(struct drm_device *dev)
>  {
> -	int i;
> -
> -	/* we don't support vga_switcheroo.. so just make sure the fbdev
> -	 * mode is active
> -	 */
>  	struct omap_drm_private *priv = dev->dev_private;
>  	int ret;
> 
>  	DBG("lastclose: dev=%p", dev);
> 
> -	/* need to restore default rotation state.. not sure
> -	 * if there is a cleaner way to restore properties to
> -	 * default state?  Maybe a flag that properties should
> -	 * automatically be restored to default state on
> -	 * lastclose?
> -	 */
> -	for (i = 0; i < priv->num_crtcs; i++) {
> -		struct drm_crtc *crtc = priv->crtcs[i];
> -
> -		if (!crtc->primary->rotation_property)
> -			continue;
> -
> -		drm_object_property_set_value(&crtc->base,
> -					      crtc->primary-
>rotation_property,
> -					      DRM_MODE_ROTATE_0);
> -	}
> -
> -	for (i = 0; i < priv->num_planes; i++) {
> -		struct drm_plane *plane = priv->planes[i];
> -
> -		if (!plane->rotation_property)
> -			continue;
> -
> -		drm_object_property_set_value(&plane->base,
> -					      plane->rotation_property,
> -					      DRM_MODE_ROTATE_0);
> -	}
> -
>  	if (priv->fbdev) {
>  		ret = drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev);
>  		if (ret)

-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-16 13:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-16  9:11 [PATCH] drm/omap: remove no-op cleanup code Tomi Valkeinen
2017-08-16 13:16 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox