[Intel-gfx] [PATCH] drm: Add standardized boolean props

Thierry Reding thierry.reding at gmail.com
Thu Jan 22 00:52:40 PST 2015


On Wed, Jan 21, 2015 at 08:47:38AM +0100, Daniel Vetter wrote:
[...]
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
[...]
> @@ -3738,6 +3738,24 @@ struct drm_property *drm_property_create_range(struct drm_device *dev, int flags
>  }
>  EXPORT_SYMBOL(drm_property_create_range);
>  
> +/**
> + * drm_property_create_signed_range - create a new signed ranged property type
> + * @dev: drm device
> + * @flags: flags specifying the property type
> + * @name: name of the property
> + * @min: minimum value of the property
> + * @max: maximum value of the property
> + *
> + * This creates a new generic drm property which can then be attached to a drm

Nit: s/drm/DRM/ but that's the same for all others so can be done in a
follow-up. I'll volunteer because I realize that not everybody is that
pedantic.

>  /**
> + * drm_property_create_bool - create a new boolean property type
> + * @dev: drm device
> + * @flags: flags specifying the property type
> + * @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.
> + *
> + * This is implemented as a ranged property with only {0, 1} as valid values.
> + *
> + * Returns:
> + * A pointer to the newly created property on success, NULL on failure.
> + */
> +struct drm_property *drm_property_create_bool(struct drm_device *dev, int flags,

I find that int is a strange type for flags. unsigned long is a little
more idiomatic in my opinion. But again all other functions seem to do
the same, so no need to respin because of that.

Reviewed-by: Thierry Reding <treding at nvidia.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20150122/c6f75ee2/attachment.sig>


More information about the Intel-gfx mailing list