Commit 027b3f8b authored by Dave Airlie's avatar Dave Airlie

drm/modes: stop handling framebuffer special

Since ref counting is in the object now we can just call the
normal interfaces.
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 2ddea3fd
...@@ -4850,19 +4850,7 @@ bool drm_property_change_valid_get(struct drm_property *property, ...@@ -4850,19 +4850,7 @@ bool drm_property_change_valid_get(struct drm_property *property,
if (value == 0) if (value == 0)
return true; return true;
/* handle refcnt'd objects specially: */ return _object_find(property->dev, value, property->values[0]) != NULL;
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;
}
} }
for (i = 0; i < property->num_values; i++) for (i = 0; i < property->num_values; i++)
...@@ -4878,8 +4866,7 @@ void drm_property_change_valid_put(struct drm_property *property, ...@@ -4878,8 +4866,7 @@ void drm_property_change_valid_put(struct drm_property *property,
return; return;
if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) { if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) {
if (property->values[0] == DRM_MODE_OBJECT_FB) drm_mode_object_unreference(ref);
drm_framebuffer_unreference(obj_to_fb(ref));
} else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB)) } else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB))
drm_property_unreference_blob(obj_to_blob(ref)); drm_property_unreference_blob(obj_to_blob(ref));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment