@@ -3420,6 +3420,8 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
struct drm_mode_object *arg_obj;
struct drm_mode_object *prop_obj;
struct drm_property *property;
+ struct drm_property_enum *prop_enum;
+ bool supported_val = false;
int ret = -EINVAL;
int i;
@@ -3451,6 +3453,22 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
}
property = obj_to_property(prop_obj);
+ if (property->flags | DRM_MODE_PROP_BITMASK) {
+ if (!list_empty(&property->enum_blob_list)) {
+ list_for_each_entry(prop_enum,
+ &property->enum_blob_list, head) {
+ if (BIT(prop_enum->value) == arg->value) {
+ supported_val = true;
+ break;
+ }
+ }
+ }
+ if (!supported_val) {
+ ret = -EINVAL;
+ goto out;
+ }
+ }
+
if (!drm_property_change_is_valid(property, arg->value))
goto out;