[PATCH 03/11] drm: Retain reference to blob properties in lookup
Daniel Stone
daniels at collabora.com
Fri May 22 05:34:46 PDT 2015
When we look up a blob property, make sure we retain a reference to the
blob for the lifetime.
Signed-off-by: Daniel Stone <daniels at collabora.com>
Tested-by: Sean Paul <seanpaul at chromium.org>
---
drivers/gpu/drm/drm_crtc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 7e5085f..da2b117 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -4661,7 +4661,9 @@ bool drm_property_change_valid_get(struct drm_property *property,
for (i = 0; i < property->num_values; i++)
valid_mask |= (1ULL << property->values[i]);
return !(value & ~valid_mask);
- } else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB)) {
+ } else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB) ||
+ (drm_property_type_is(property, DRM_MODE_PROP_OBJECT) &&
+ property->values[0] == DRM_MODE_OBJECT_BLOB)) {
struct drm_property_blob *blob;
if (value == 0)
@@ -4709,6 +4711,8 @@ void drm_property_change_valid_put(struct drm_property *property,
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));
+ else if (property->values[0] == DRM_MODE_OBJECT_BLOB)
+ drm_property_unreference_blob(obj_to_blob(ref));
}
}
--
2.4.1
More information about the dri-devel
mailing list