Revert "drm: Unify handling of blob and object properties"
This reverts commit77953bd136
. This causes a kernel panic when trying to assign a blob to a property, and has obviously never been tested. Fixes:77953bd136
("drm: Unify handling of blob and object properties") Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Tested-by: Liu Ying <gnuiyl@gmail.com> Acked-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/8c0d3482-1bb5-6a15-b105-6bda2b31b5dc@linux.intel.com
This commit is contained in:
parent
737ba10928
commit
30c06570cd
|
@ -870,8 +870,20 @@ bool drm_property_change_valid_get(struct drm_property *property,
|
||||||
for (i = 0; i < property->num_values; i++)
|
for (i = 0; i < property->num_values; i++)
|
||||||
valid_mask |= (1ULL << property->values[i]);
|
valid_mask |= (1ULL << property->values[i]);
|
||||||
return !(value & ~valid_mask);
|
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)) {
|
struct drm_property_blob *blob;
|
||||||
|
|
||||||
|
if (value == 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
blob = drm_property_lookup_blob(property->dev, value);
|
||||||
|
if (blob) {
|
||||||
|
*ref = &blob->base;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) {
|
||||||
/* a zero value for an object property translates to null: */
|
/* a zero value for an object property translates to null: */
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
return true;
|
return true;
|
||||||
|
@ -888,12 +900,13 @@ bool drm_property_change_valid_get(struct drm_property *property,
|
||||||
}
|
}
|
||||||
|
|
||||||
void drm_property_change_valid_put(struct drm_property *property,
|
void drm_property_change_valid_put(struct drm_property *property,
|
||||||
struct drm_mode_object *ref)
|
struct drm_mode_object *ref)
|
||||||
{
|
{
|
||||||
if (!ref)
|
if (!ref)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT) ||
|
if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) {
|
||||||
drm_property_type_is(property, DRM_MODE_PROP_BLOB))
|
|
||||||
drm_mode_object_unreference(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));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue