diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-02-06 13:58:17 +0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-02-09 14:15:18 +0400 |
commit | 4a67d39190315558631d944b1cea4466ed4c86d8 (patch) | |
tree | 1d90ec7e35c2f6048bf38ba3dfcb838d9df52a16 /include/drm | |
parent | 198ceac091049003ffcc4b7cda76785510fc3b59 (diff) | |
download | linux-4a67d39190315558631d944b1cea4466ed4c86d8.tar.xz |
drm: add convenience function to create an enum property
Creating an enum property is a common pattern, so create
a convenience function for this and use it where appropriate.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_crtc.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 8d593ad95f16..3b93cdccea49 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -807,6 +807,10 @@ struct drm_mode_config { #define obj_to_blob(x) container_of(x, struct drm_property_blob, base) #define obj_to_plane(x) container_of(x, struct drm_plane, base) +struct drm_prop_enum_list { + int type; + char *name; +}; extern void drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, @@ -904,6 +908,10 @@ extern int drm_connector_attach_property(struct drm_connector *connector, struct drm_property *property, uint64_t init_val); extern struct drm_property *drm_property_create(struct drm_device *dev, int flags, const char *name, int num_values); +extern struct drm_property *drm_property_create_enum(struct drm_device *dev, int flags, + const char *name, + const struct drm_prop_enum_list *props, + int num_values); extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property); extern int drm_property_add_enum(struct drm_property *property, int index, uint64_t value, const char *name); |