diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-02-06 04:58:17 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-02-09 05:15:18 -0500 |
commit | 4a67d39190315558631d944b1cea4466ed4c86d8 (patch) | |
tree | 1d90ec7e35c2f6048bf38ba3dfcb838d9df52a16 /include | |
parent | 198ceac091049003ffcc4b7cda76785510fc3b59 (diff) |
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')
-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 8d593ad95f1..3b93cdccea4 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -807,6 +807,10 @@ struct drm_mode_config { | |||
807 | #define obj_to_blob(x) container_of(x, struct drm_property_blob, base) | 807 | #define obj_to_blob(x) container_of(x, struct drm_property_blob, base) |
808 | #define obj_to_plane(x) container_of(x, struct drm_plane, base) | 808 | #define obj_to_plane(x) container_of(x, struct drm_plane, base) |
809 | 809 | ||
810 | struct drm_prop_enum_list { | ||
811 | int type; | ||
812 | char *name; | ||
813 | }; | ||
810 | 814 | ||
811 | extern void drm_crtc_init(struct drm_device *dev, | 815 | extern void drm_crtc_init(struct drm_device *dev, |
812 | struct drm_crtc *crtc, | 816 | struct drm_crtc *crtc, |
@@ -904,6 +908,10 @@ extern int drm_connector_attach_property(struct drm_connector *connector, | |||
904 | struct drm_property *property, uint64_t init_val); | 908 | struct drm_property *property, uint64_t init_val); |
905 | extern struct drm_property *drm_property_create(struct drm_device *dev, int flags, | 909 | extern struct drm_property *drm_property_create(struct drm_device *dev, int flags, |
906 | const char *name, int num_values); | 910 | const char *name, int num_values); |
911 | extern struct drm_property *drm_property_create_enum(struct drm_device *dev, int flags, | ||
912 | const char *name, | ||
913 | const struct drm_prop_enum_list *props, | ||
914 | int num_values); | ||
907 | extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property); | 915 | extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property); |
908 | extern int drm_property_add_enum(struct drm_property *property, int index, | 916 | extern int drm_property_add_enum(struct drm_property *property, int index, |
909 | uint64_t value, const char *name); | 917 | uint64_t value, const char *name); |