aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_crtc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/drm/drm_crtc.h')
-rw-r--r--include/drm/drm_crtc.h86
1 files changed, 61 insertions, 25 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index e250eda4e3a8..73e45600f95d 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -36,6 +36,7 @@
36struct drm_device; 36struct drm_device;
37struct drm_mode_set; 37struct drm_mode_set;
38struct drm_framebuffer; 38struct drm_framebuffer;
39struct drm_object_properties;
39 40
40 41
41#define DRM_MODE_OBJECT_CRTC 0xcccccccc 42#define DRM_MODE_OBJECT_CRTC 0xcccccccc
@@ -50,6 +51,14 @@ struct drm_framebuffer;
50struct drm_mode_object { 51struct drm_mode_object {
51 uint32_t id; 52 uint32_t id;
52 uint32_t type; 53 uint32_t type;
54 struct drm_object_properties *properties;
55};
56
57#define DRM_OBJECT_MAX_PROPERTY 16
58struct drm_object_properties {
59 int count;
60 uint32_t ids[DRM_OBJECT_MAX_PROPERTY];
61 uint64_t values[DRM_OBJECT_MAX_PROPERTY];
53}; 62};
54 63
55/* 64/*
@@ -285,19 +294,16 @@ struct drm_plane;
285 294
286/** 295/**
287 * drm_crtc_funcs - control CRTCs for a given device 296 * drm_crtc_funcs - control CRTCs for a given device
288 * @reset: reset CRTC after state has been invalidate (e.g. resume)
289 * @dpms: control display power levels
290 * @save: save CRTC state 297 * @save: save CRTC state
291 * @resore: restore CRTC state 298 * @restore: restore CRTC state
292 * @lock: lock the CRTC 299 * @reset: reset CRTC after state has been invalidate (e.g. resume)
293 * @unlock: unlock the CRTC 300 * @cursor_set: setup the cursor
294 * @shadow_allocate: allocate shadow pixmap 301 * @cursor_move: move the cursor
295 * @shadow_create: create shadow pixmap for rotation support
296 * @shadow_destroy: free shadow pixmap
297 * @mode_fixup: fixup proposed mode
298 * @mode_set: set the desired mode on the CRTC
299 * @gamma_set: specify color ramp for CRTC 302 * @gamma_set: specify color ramp for CRTC
300 * @destroy: deinit and free object. 303 * @destroy: deinit and free object
304 * @set_property: called when a property is changed
305 * @set_config: apply a new CRTC configuration
306 * @page_flip: initiate a page flip
301 * 307 *
302 * The drm_crtc_funcs structure is the central CRTC management structure 308 * The drm_crtc_funcs structure is the central CRTC management structure
303 * in the DRM. Each CRTC controls one or more connectors (note that the name 309 * in the DRM. Each CRTC controls one or more connectors (note that the name
@@ -341,6 +347,9 @@ struct drm_crtc_funcs {
341 int (*page_flip)(struct drm_crtc *crtc, 347 int (*page_flip)(struct drm_crtc *crtc,
342 struct drm_framebuffer *fb, 348 struct drm_framebuffer *fb,
343 struct drm_pending_vblank_event *event); 349 struct drm_pending_vblank_event *event);
350
351 int (*set_property)(struct drm_crtc *crtc,
352 struct drm_property *property, uint64_t val);
344}; 353};
345 354
346/** 355/**
@@ -360,6 +369,7 @@ struct drm_crtc_funcs {
360 * @framedur_ns: precise line timing 369 * @framedur_ns: precise line timing
361 * @pixeldur_ns: precise pixel timing 370 * @pixeldur_ns: precise pixel timing
362 * @helper_private: mid-layer private data 371 * @helper_private: mid-layer private data
372 * @properties: property tracking for this CRTC
363 * 373 *
364 * Each CRTC may have one or more connectors associated with it. This structure 374 * Each CRTC may have one or more connectors associated with it. This structure
365 * allows the CRTC to be controlled. 375 * allows the CRTC to be controlled.
@@ -395,6 +405,8 @@ struct drm_crtc {
395 405
396 /* if you are using the helper */ 406 /* if you are using the helper */
397 void *helper_private; 407 void *helper_private;
408
409 struct drm_object_properties properties;
398}; 410};
399 411
400 412
@@ -404,11 +416,8 @@ struct drm_crtc {
404 * @save: save connector state 416 * @save: save connector state
405 * @restore: restore connector state 417 * @restore: restore connector state
406 * @reset: reset connector after state has been invalidate (e.g. resume) 418 * @reset: reset connector after state has been invalidate (e.g. resume)
407 * @mode_valid: is this mode valid on the given connector?
408 * @mode_fixup: try to fixup proposed mode for this connector
409 * @mode_set: set this mode
410 * @detect: is this connector active? 419 * @detect: is this connector active?
411 * @get_modes: get mode list for this connector 420 * @fill_modes: fill mode list for this connector
412 * @set_property: property for this connector may need update 421 * @set_property: property for this connector may need update
413 * @destroy: make object go away 422 * @destroy: make object go away
414 * @force: notify the driver the connector is forced on 423 * @force: notify the driver the connector is forced on
@@ -451,7 +460,6 @@ struct drm_encoder_funcs {
451}; 460};
452 461
453#define DRM_CONNECTOR_MAX_UMODES 16 462#define DRM_CONNECTOR_MAX_UMODES 16
454#define DRM_CONNECTOR_MAX_PROPERTY 16
455#define DRM_CONNECTOR_LEN 32 463#define DRM_CONNECTOR_LEN 32
456#define DRM_CONNECTOR_MAX_ENCODER 3 464#define DRM_CONNECTOR_MAX_ENCODER 3
457 465
@@ -520,8 +528,7 @@ enum drm_connector_force {
520 * @funcs: connector control functions 528 * @funcs: connector control functions
521 * @user_modes: user added mode list 529 * @user_modes: user added mode list
522 * @edid_blob_ptr: DRM property containing EDID if present 530 * @edid_blob_ptr: DRM property containing EDID if present
523 * @property_ids: property tracking for this connector 531 * @properties: property tracking for this connector
524 * @property_values: value pointers or data for properties
525 * @polled: a %DRM_CONNECTOR_POLL_<foo> value for core driven polling 532 * @polled: a %DRM_CONNECTOR_POLL_<foo> value for core driven polling
526 * @dpms: current dpms state 533 * @dpms: current dpms state
527 * @helper_private: mid-layer private data 534 * @helper_private: mid-layer private data
@@ -565,8 +572,7 @@ struct drm_connector {
565 572
566 struct list_head user_modes; 573 struct list_head user_modes;
567 struct drm_property_blob *edid_blob_ptr; 574 struct drm_property_blob *edid_blob_ptr;
568 u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY]; 575 struct drm_object_properties properties;
569 uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY];
570 576
571 uint8_t polled; /* DRM_CONNECTOR_POLL_* */ 577 uint8_t polled; /* DRM_CONNECTOR_POLL_* */
572 578
@@ -595,6 +601,7 @@ struct drm_connector {
595 * @update_plane: update the plane configuration 601 * @update_plane: update the plane configuration
596 * @disable_plane: shut down the plane 602 * @disable_plane: shut down the plane
597 * @destroy: clean up plane resources 603 * @destroy: clean up plane resources
604 * @set_property: called when a property is changed
598 */ 605 */
599struct drm_plane_funcs { 606struct drm_plane_funcs {
600 int (*update_plane)(struct drm_plane *plane, 607 int (*update_plane)(struct drm_plane *plane,
@@ -605,6 +612,9 @@ struct drm_plane_funcs {
605 uint32_t src_w, uint32_t src_h); 612 uint32_t src_w, uint32_t src_h);
606 int (*disable_plane)(struct drm_plane *plane); 613 int (*disable_plane)(struct drm_plane *plane);
607 void (*destroy)(struct drm_plane *plane); 614 void (*destroy)(struct drm_plane *plane);
615
616 int (*set_property)(struct drm_plane *plane,
617 struct drm_property *property, uint64_t val);
608}; 618};
609 619
610/** 620/**
@@ -622,6 +632,7 @@ struct drm_plane_funcs {
622 * @enabled: enabled flag 632 * @enabled: enabled flag
623 * @funcs: helper functions 633 * @funcs: helper functions
624 * @helper_private: storage for drver layer 634 * @helper_private: storage for drver layer
635 * @properties: property tracking for this plane
625 */ 636 */
626struct drm_plane { 637struct drm_plane {
627 struct drm_device *dev; 638 struct drm_device *dev;
@@ -644,6 +655,8 @@ struct drm_plane {
644 655
645 const struct drm_plane_funcs *funcs; 656 const struct drm_plane_funcs *funcs;
646 void *helper_private; 657 void *helper_private;
658
659 struct drm_object_properties properties;
647}; 660};
648 661
649/** 662/**
@@ -761,7 +774,7 @@ struct drm_mode_config {
761 774
762 int min_width, min_height; 775 int min_width, min_height;
763 int max_width, max_height; 776 int max_width, max_height;
764 struct drm_mode_config_funcs *funcs; 777 const struct drm_mode_config_funcs *funcs;
765 resource_size_t fb_base; 778 resource_size_t fb_base;
766 779
767 /* output poll support */ 780 /* output poll support */
@@ -898,6 +911,12 @@ extern int drm_connector_property_set_value(struct drm_connector *connector,
898extern int drm_connector_property_get_value(struct drm_connector *connector, 911extern int drm_connector_property_get_value(struct drm_connector *connector,
899 struct drm_property *property, 912 struct drm_property *property,
900 uint64_t *value); 913 uint64_t *value);
914extern int drm_object_property_set_value(struct drm_mode_object *obj,
915 struct drm_property *property,
916 uint64_t val);
917extern int drm_object_property_get_value(struct drm_mode_object *obj,
918 struct drm_property *property,
919 uint64_t *value);
901extern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev); 920extern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev);
902extern void drm_framebuffer_set_object(struct drm_device *dev, 921extern void drm_framebuffer_set_object(struct drm_device *dev,
903 unsigned long handle); 922 unsigned long handle);
@@ -910,14 +929,21 @@ extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
910extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY); 929extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY);
911extern bool drm_crtc_in_use(struct drm_crtc *crtc); 930extern bool drm_crtc_in_use(struct drm_crtc *crtc);
912 931
913extern int drm_connector_attach_property(struct drm_connector *connector, 932extern void drm_connector_attach_property(struct drm_connector *connector,
914 struct drm_property *property, uint64_t init_val); 933 struct drm_property *property, uint64_t init_val);
934extern void drm_object_attach_property(struct drm_mode_object *obj,
935 struct drm_property *property,
936 uint64_t init_val);
915extern struct drm_property *drm_property_create(struct drm_device *dev, int flags, 937extern struct drm_property *drm_property_create(struct drm_device *dev, int flags,
916 const char *name, int num_values); 938 const char *name, int num_values);
917extern struct drm_property *drm_property_create_enum(struct drm_device *dev, int flags, 939extern struct drm_property *drm_property_create_enum(struct drm_device *dev, int flags,
918 const char *name, 940 const char *name,
919 const struct drm_prop_enum_list *props, 941 const struct drm_prop_enum_list *props,
920 int num_values); 942 int num_values);
943struct drm_property *drm_property_create_bitmask(struct drm_device *dev,
944 int flags, const char *name,
945 const struct drm_prop_enum_list *props,
946 int num_values);
921struct drm_property *drm_property_create_range(struct drm_device *dev, int flags, 947struct drm_property *drm_property_create_range(struct drm_device *dev, int flags,
922 const char *name, 948 const char *name,
923 uint64_t min, uint64_t max); 949 uint64_t min, uint64_t max);
@@ -1012,10 +1038,11 @@ extern int drm_add_modes_noedid(struct drm_connector *connector,
1012 int hdisplay, int vdisplay); 1038 int hdisplay, int vdisplay);
1013 1039
1014extern int drm_edid_header_is_valid(const u8 *raw_edid); 1040extern int drm_edid_header_is_valid(const u8 *raw_edid);
1015extern bool drm_edid_block_valid(u8 *raw_edid); 1041extern bool drm_edid_block_valid(u8 *raw_edid, int block);
1016extern bool drm_edid_is_valid(struct edid *edid); 1042extern bool drm_edid_is_valid(struct edid *edid);
1017struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev, 1043struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
1018 int hsize, int vsize, int fresh); 1044 int hsize, int vsize, int fresh,
1045 bool rb);
1019 1046
1020extern int drm_mode_create_dumb_ioctl(struct drm_device *dev, 1047extern int drm_mode_create_dumb_ioctl(struct drm_device *dev,
1021 void *data, struct drm_file *file_priv); 1048 void *data, struct drm_file *file_priv);
@@ -1023,7 +1050,16 @@ extern int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
1023 void *data, struct drm_file *file_priv); 1050 void *data, struct drm_file *file_priv);
1024extern int drm_mode_destroy_dumb_ioctl(struct drm_device *dev, 1051extern int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
1025 void *data, struct drm_file *file_priv); 1052 void *data, struct drm_file *file_priv);
1053extern int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
1054 struct drm_file *file_priv);
1055extern int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
1056 struct drm_file *file_priv);
1026 1057
1027extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth, 1058extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
1028 int *bpp); 1059 int *bpp);
1060extern int drm_format_num_planes(uint32_t format);
1061extern int drm_format_plane_cpp(uint32_t format, int plane);
1062extern int drm_format_horz_chroma_subsampling(uint32_t format);
1063extern int drm_format_vert_chroma_subsampling(uint32_t format);
1064
1029#endif /* __DRM_CRTC_H__ */ 1065#endif /* __DRM_CRTC_H__ */