diff options
Diffstat (limited to 'drivers/gpu/drm/drm_property.c')
-rw-r--r-- | drivers/gpu/drm/drm_property.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c index a4d81cf4ffa0..7fc070f3e49e 100644 --- a/drivers/gpu/drm/drm_property.c +++ b/drivers/gpu/drm/drm_property.c @@ -34,7 +34,7 @@ * even the only way to transport metadata about the desired new modeset * configuration from userspace to the kernel. Properties have a well-defined * value range, which is enforced by the drm core. See the documentation of the - * flags member of struct &drm_property for an overview of the different + * flags member of &struct drm_property for an overview of the different * property types and ranges. * * Properties don't store the current value directly, but need to be @@ -42,8 +42,8 @@ * drm_object_attach_property(). * * Property values are only 64bit. To support bigger piles of data (like gamma - * tables, color correction matrizes or large structures) a property can instead - * point at a &drm_property_blob with that additional data + * tables, color correction matrices or large structures) a property can instead + * point at a &drm_property_blob with that additional data. * * Properties are defined by their symbolic name, userspace must keep a * per-object mapping from those names to the property ID used in the atomic @@ -65,9 +65,9 @@ static bool drm_property_type_valid(struct drm_property *property) * @num_values: number of pre-defined values * * This creates a new generic drm property which can then be attached to a drm - * object with drm_object_attach_property. The returned property object must be - * freed with drm_property_destroy(), which is done automatically when calling - * drm_mode_config_cleanup(). + * object with drm_object_attach_property(). The returned property object must + * be freed with drm_property_destroy(), which is done automatically when + * calling drm_mode_config_cleanup(). * * Returns: * A pointer to the newly created property on success, NULL on failure. @@ -125,9 +125,9 @@ EXPORT_SYMBOL(drm_property_create); * @num_values: number of pre-defined values * * This creates a new generic drm property which can then be attached to a drm - * object with drm_object_attach_property. The returned property object must be - * freed with drm_property_destroy(), which is done automatically when calling - * drm_mode_config_cleanup(). + * object with drm_object_attach_property(). The returned property object must + * be freed with drm_property_destroy(), which is done automatically when + * calling drm_mode_config_cleanup(). * * Userspace is only allowed to set one of the predefined values for enumeration * properties. @@ -173,9 +173,9 @@ EXPORT_SYMBOL(drm_property_create_enum); * @supported_bits: bitmask of all supported enumeration values * * This creates a new bitmask drm property which can then be attached to a drm - * object with drm_object_attach_property. The returned property object must be - * freed with drm_property_destroy(), which is done automatically when calling - * drm_mode_config_cleanup(). + * object with drm_object_attach_property(). The returned property object must + * be freed with drm_property_destroy(), which is done automatically when + * calling drm_mode_config_cleanup(). * * Compared to plain enumeration properties userspace is allowed to set any * or'ed together combination of the predefined property bitflag values @@ -245,9 +245,9 @@ static struct drm_property *property_create_range(struct drm_device *dev, * @max: maximum value of the property * * This creates a new generic drm property which can then be attached to a drm - * object with drm_object_attach_property. The returned property object must be - * freed with drm_property_destroy(), which is done automatically when calling - * drm_mode_config_cleanup(). + * object with drm_object_attach_property(). The returned property object must + * be freed with drm_property_destroy(), which is done automatically when + * calling drm_mode_config_cleanup(). * * Userspace is allowed to set any unsigned integer value in the (min, max) * range inclusive. @@ -273,9 +273,9 @@ EXPORT_SYMBOL(drm_property_create_range); * @max: maximum value of the property * * This creates a new generic drm property which can then be attached to a drm - * object with drm_object_attach_property. The returned property object must be - * freed with drm_property_destroy(), which is done automatically when calling - * drm_mode_config_cleanup(). + * object with drm_object_attach_property(). The returned property object must + * be freed with drm_property_destroy(), which is done automatically when + * calling drm_mode_config_cleanup(). * * Userspace is allowed to set any signed integer value in the (min, max) * range inclusive. @@ -300,9 +300,9 @@ EXPORT_SYMBOL(drm_property_create_signed_range); * @type: object type from DRM_MODE_OBJECT_* defines * * This creates a new generic drm property which can then be attached to a drm - * object with drm_object_attach_property. The returned property object must be - * freed with drm_property_destroy(), which is done automatically when calling - * drm_mode_config_cleanup(). + * object with drm_object_attach_property(). The returned property object must + * be freed with drm_property_destroy(), which is done automatically when + * calling drm_mode_config_cleanup(). * * Userspace is only allowed to set this to any property value of the given * @type. Only useful for atomic properties, which is enforced. @@ -338,9 +338,9 @@ EXPORT_SYMBOL(drm_property_create_object); * @name: name of the property * * This creates a new generic drm property which can then be attached to a drm - * object with drm_object_attach_property. The returned property object must be - * freed with drm_property_destroy(), which is done automatically when calling - * drm_mode_config_cleanup(). + * object with drm_object_attach_property(). The returned property object must + * be freed with drm_property_destroy(), which is done automatically when + * calling drm_mode_config_cleanup(). * * This is implemented as a ranged property with only {0, 1} as valid values. * @@ -729,7 +729,6 @@ int drm_mode_getblob_ioctl(struct drm_device *dev, struct drm_mode_get_blob *out_resp = data; struct drm_property_blob *blob; int ret = 0; - void __user *blob_ptr; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL; @@ -739,8 +738,9 @@ int drm_mode_getblob_ioctl(struct drm_device *dev, return -ENOENT; if (out_resp->length == blob->length) { - blob_ptr = (void __user *)(unsigned long)out_resp->data; - if (copy_to_user(blob_ptr, blob->data, blob->length)) { + if (copy_to_user(u64_to_user_ptr(out_resp->data), + blob->data, + blob->length)) { ret = -EFAULT; goto unref; } @@ -757,7 +757,6 @@ int drm_mode_createblob_ioctl(struct drm_device *dev, { struct drm_mode_create_blob *out_resp = data; struct drm_property_blob *blob; - void __user *blob_ptr; int ret = 0; if (!drm_core_check_feature(dev, DRIVER_MODESET)) @@ -767,8 +766,9 @@ int drm_mode_createblob_ioctl(struct drm_device *dev, if (IS_ERR(blob)) return PTR_ERR(blob); - blob_ptr = (void __user *)(unsigned long)out_resp->data; - if (copy_from_user(blob->data, blob_ptr, out_resp->length)) { + if (copy_from_user(blob->data, + u64_to_user_ptr(out_resp->data), + out_resp->length)) { ret = -EFAULT; goto out_blob; } |