summaryrefslogtreecommitdiff
path: root/linux-core/drm_crtc.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2007-11-27 14:31:02 +1000
committerDave Airlie <airlied@redhat.com>2007-11-27 14:31:02 +1000
commitb3af2b59a77a6916ea7151236d3da9bde6a537fc (patch)
tree5d376ad9c6c4727dd7c8fdca4277c56b7d33cb85 /linux-core/drm_crtc.h
parentf9ac54b0319b273de83a004d6cfdf46a3b9d6ced (diff)
drm/modesetting: add initial gettable properites code.
This allow the user to retrieve a list of properties for an output. Properties can either be 32-bit values or an enum with an associated name. Range properties are to be supported. This API is probably not all correct, I may make properties part of the general resource get when I think about it some more. So basically you can create properties and attached them to whatever outputs you want, so it should be possible to create some generics and just attach them to every output.
Diffstat (limited to 'linux-core/drm_crtc.h')
-rw-r--r--linux-core/drm_crtc.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/linux-core/drm_crtc.h b/linux-core/drm_crtc.h
index fc97525d..011903ce 100644
--- a/linux-core/drm_crtc.h
+++ b/linux-core/drm_crtc.h
@@ -233,6 +233,24 @@ struct drm_framebuffer {
void *virtual_base;
struct list_head filp_head;
};
+
+struct drm_property_enum {
+ struct list_head head;
+ uint32_t value;
+ unsigned char name[DRM_PROP_NAME_LEN];
+};
+
+struct drm_property {
+ struct list_head head;
+ int id; /* idr assigned */
+ uint32_t flags;
+ char name[DRM_PROP_NAME_LEN];
+ uint32_t num_values;
+ uint32_t *values;
+
+ struct list_head enum_list;
+};
+
struct drm_crtc;
struct drm_output;
@@ -376,6 +394,7 @@ struct drm_output_funcs {
};
#define DRM_OUTPUT_MAX_UMODES 16
+#define DRM_OUTPUT_MAX_PROPERTY 16
#define DRM_OUTPUT_LEN 32
/**
* drm_output - central DRM output control structure
@@ -431,6 +450,8 @@ struct drm_output {
u32 user_mode_ids[DRM_OUTPUT_MAX_UMODES];
+ u32 property_ids[DRM_OUTPUT_MAX_PROPERTY];
+ u32 property_values[DRM_OUTPUT_MAX_PROPERTY];
};
/**
@@ -464,6 +485,9 @@ struct drm_mode_config {
struct list_head crtc_list;
struct list_head usermode_list;
+
+ struct list_head property_list;
+
int min_width, min_height;
int max_width, max_height;
/* DamagePtr rotationDamage? */
@@ -529,6 +553,14 @@ extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
extern bool drm_crtc_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode,
int x, int y);
+extern int drm_output_attach_property(struct drm_output *output,
+ struct drm_property *property, int init_val);
+extern struct drm_property *drm_property_create(struct drm_device *dev, int flags,
+ const char *name, 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,
+ uint32_t value, const char *name);
+
/* IOCTLs */
extern int drm_mode_getresources(struct drm_device *dev,
void *data, struct drm_file *file_priv);
@@ -554,5 +586,7 @@ extern int drm_mode_attachmode_ioctl(struct drm_device *dev,
extern int drm_mode_detachmode_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv);
+extern int drm_mode_getproperty_ioctl(struct drm_device *dev,
+ void *data, struct drm_file *file_priv);
#endif /* __DRM_CRTC_H__ */