Lines Matching refs:property

100 	struct drm_property *property = NULL;  in drm_property_create()  local
109 property = kzalloc(sizeof(struct drm_property), GFP_KERNEL); in drm_property_create()
110 if (!property) in drm_property_create()
113 property->dev = dev; in drm_property_create()
116 property->values = kcalloc(num_values, sizeof(uint64_t), in drm_property_create()
118 if (!property->values) in drm_property_create()
122 ret = drm_mode_object_add(dev, &property->base, DRM_MODE_OBJECT_PROPERTY); in drm_property_create()
126 property->flags = flags; in drm_property_create()
127 property->num_values = num_values; in drm_property_create()
128 INIT_LIST_HEAD(&property->enum_list); in drm_property_create()
130 strscpy_pad(property->name, name, DRM_PROP_NAME_LEN); in drm_property_create()
132 list_add_tail(&property->head, &dev->mode_config.property_list); in drm_property_create()
134 return property; in drm_property_create()
136 kfree(property->values); in drm_property_create()
137 kfree(property); in drm_property_create()
166 struct drm_property *property; in drm_property_create_enum() local
171 property = drm_property_create(dev, flags, name, num_values); in drm_property_create_enum()
172 if (!property) in drm_property_create_enum()
176 ret = drm_property_add_enum(property, in drm_property_create_enum()
180 drm_property_destroy(dev, property); in drm_property_create_enum()
185 return property; in drm_property_create_enum()
215 struct drm_property *property; in drm_property_create_bitmask() local
221 property = drm_property_create(dev, flags, name, num_values); in drm_property_create_bitmask()
222 if (!property) in drm_property_create_bitmask()
228 ret = drm_property_add_enum(property, in drm_property_create_bitmask()
232 drm_property_destroy(dev, property); in drm_property_create_bitmask()
237 return property; in drm_property_create_bitmask()
245 struct drm_property *property; in property_create_range() local
247 property = drm_property_create(dev, flags, name, 2); in property_create_range()
248 if (!property) in property_create_range()
251 property->values[0] = min; in property_create_range()
252 property->values[1] = max; in property_create_range()
254 return property; in property_create_range()
335 struct drm_property *property; in drm_property_create_object() local
342 property = drm_property_create(dev, flags, name, 1); in drm_property_create_object()
343 if (!property) in drm_property_create_object()
346 property->values[0] = type; in drm_property_create_object()
348 return property; in drm_property_create_object()
389 int drm_property_add_enum(struct drm_property *property, in drm_property_add_enum() argument
398 if (WARN_ON(!drm_property_type_is(property, DRM_MODE_PROP_ENUM) && in drm_property_add_enum()
399 !drm_property_type_is(property, DRM_MODE_PROP_BITMASK))) in drm_property_add_enum()
406 if (WARN_ON(drm_property_type_is(property, DRM_MODE_PROP_BITMASK) && in drm_property_add_enum()
410 list_for_each_entry(prop_enum, &property->enum_list, head) { in drm_property_add_enum()
416 if (WARN_ON(index >= property->num_values)) in drm_property_add_enum()
426 property->values[index] = value; in drm_property_add_enum()
427 list_add_tail(&prop_enum->head, &property->enum_list); in drm_property_add_enum()
440 void drm_property_destroy(struct drm_device *dev, struct drm_property *property) in drm_property_destroy() argument
444 list_for_each_entry_safe(prop_enum, pt, &property->enum_list, head) { in drm_property_destroy()
449 if (property->num_values) in drm_property_destroy()
450 kfree(property->values); in drm_property_destroy()
451 drm_mode_object_unregister(dev, &property->base); in drm_property_destroy()
452 list_del(&property->head); in drm_property_destroy()
453 kfree(property); in drm_property_destroy()
461 struct drm_property *property; in drm_mode_getproperty_ioctl() local
472 property = drm_property_find(dev, file_priv, out_resp->prop_id); in drm_mode_getproperty_ioctl()
473 if (!property) in drm_mode_getproperty_ioctl()
476 strscpy_pad(out_resp->name, property->name, DRM_PROP_NAME_LEN); in drm_mode_getproperty_ioctl()
477 out_resp->flags = property->flags; in drm_mode_getproperty_ioctl()
479 value_count = property->num_values; in drm_mode_getproperty_ioctl()
484 put_user(property->values[i], values_ptr + i)) { in drm_mode_getproperty_ioctl()
493 if (drm_property_type_is(property, DRM_MODE_PROP_ENUM) || in drm_mode_getproperty_ioctl()
494 drm_property_type_is(property, DRM_MODE_PROP_BITMASK)) { in drm_mode_getproperty_ioctl()
495 list_for_each_entry(prop_enum, &property->enum_list, head) { in drm_mode_getproperty_ioctl()
520 if (drm_property_type_is(property, DRM_MODE_PROP_BLOB)) in drm_mode_getproperty_ioctl()
874 bool drm_property_change_valid_get(struct drm_property *property, in drm_property_change_valid_get() argument
879 if (property->flags & DRM_MODE_PROP_IMMUTABLE) in drm_property_change_valid_get()
884 if (drm_property_type_is(property, DRM_MODE_PROP_RANGE)) { in drm_property_change_valid_get()
885 if (value < property->values[0] || value > property->values[1]) in drm_property_change_valid_get()
888 } else if (drm_property_type_is(property, DRM_MODE_PROP_SIGNED_RANGE)) { in drm_property_change_valid_get()
891 if (svalue < U642I64(property->values[0]) || in drm_property_change_valid_get()
892 svalue > U642I64(property->values[1])) in drm_property_change_valid_get()
895 } else if (drm_property_type_is(property, DRM_MODE_PROP_BITMASK)) { in drm_property_change_valid_get()
898 for (i = 0; i < property->num_values; i++) in drm_property_change_valid_get()
899 valid_mask |= (1ULL << property->values[i]); in drm_property_change_valid_get()
901 } else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB)) { in drm_property_change_valid_get()
907 blob = drm_property_lookup_blob(property->dev, value); in drm_property_change_valid_get()
914 } else if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) { in drm_property_change_valid_get()
919 *ref = __drm_mode_object_find(property->dev, NULL, value, in drm_property_change_valid_get()
920 property->values[0]); in drm_property_change_valid_get()
924 for (i = 0; i < property->num_values; i++) in drm_property_change_valid_get()
925 if (property->values[i] == value) in drm_property_change_valid_get()
930 void drm_property_change_valid_put(struct drm_property *property, in drm_property_change_valid_put() argument
936 if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) { in drm_property_change_valid_put()
938 } else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB)) in drm_property_change_valid_put()