diff mbox

[11/15] drm/modes: stop handling framebuffer special

Message ID 1460697046-23781-12-git-send-email-airlied@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dave Airlie April 15, 2016, 5:10 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

Since ref counting is in the object now we can just call the
normal interfaces.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/drm_crtc.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

Comments

Daniel Vetter April 21, 2016, 9:06 a.m. UTC | #1
On Fri, Apr 15, 2016 at 03:10:42PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
> 
> Since ref counting is in the object now we can just call the
> normal interfaces.
> 
> Signed-off-by: Dave Airlie <airlied@redhat.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/drm_crtc.c | 17 ++---------------
>  1 file changed, 2 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 46f32f2..f6bf828 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -4810,19 +4810,7 @@ bool drm_property_change_valid_get(struct drm_property *property,
>  		if (value == 0)
>  			return true;
>  
> -		/* handle refcnt'd objects specially: */
> -		if (property->values[0] == DRM_MODE_OBJECT_FB) {
> -			struct drm_framebuffer *fb;
> -			fb = drm_framebuffer_lookup(property->dev, value);
> -			if (fb) {
> -				*ref = &fb->base;
> -				return true;
> -			} else {
> -				return false;
> -			}
> -		} else {
> -			return _object_find(property->dev, value, property->values[0]) != NULL;
> -		}
> +		return _object_find(property->dev, value, property->values[0]) != NULL;
>  	}
>  
>  	for (i = 0; i < property->num_values; i++)
> @@ -4838,8 +4826,7 @@ void drm_property_change_valid_put(struct drm_property *property,
>  		return;
>  
>  	if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) {
> -		if (property->values[0] == DRM_MODE_OBJECT_FB)
> -			drm_framebuffer_unreference(obj_to_fb(ref));
> +		drm_mode_object_unreference(ref);
>  	} else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB))
>  		drm_property_unreference_blob(obj_to_blob(ref));
>  }
> -- 
> 2.5.5
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 46f32f2..f6bf828 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -4810,19 +4810,7 @@  bool drm_property_change_valid_get(struct drm_property *property,
 		if (value == 0)
 			return true;
 
-		/* handle refcnt'd objects specially: */
-		if (property->values[0] == DRM_MODE_OBJECT_FB) {
-			struct drm_framebuffer *fb;
-			fb = drm_framebuffer_lookup(property->dev, value);
-			if (fb) {
-				*ref = &fb->base;
-				return true;
-			} else {
-				return false;
-			}
-		} else {
-			return _object_find(property->dev, value, property->values[0]) != NULL;
-		}
+		return _object_find(property->dev, value, property->values[0]) != NULL;
 	}
 
 	for (i = 0; i < property->num_values; i++)
@@ -4838,8 +4826,7 @@  void drm_property_change_valid_put(struct drm_property *property,
 		return;
 
 	if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) {
-		if (property->values[0] == DRM_MODE_OBJECT_FB)
-			drm_framebuffer_unreference(obj_to_fb(ref));
+		drm_mode_object_unreference(ref);
 	} else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB))
 		drm_property_unreference_blob(obj_to_blob(ref));
 }