diff options
Diffstat (limited to 'include/drm/drm_crtc.h')
-rw-r--r-- | include/drm/drm_crtc.h | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 251b75e6bf7a..f1105d0da059 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -41,6 +41,7 @@ struct drm_framebuffer; | |||
41 | struct drm_object_properties; | 41 | struct drm_object_properties; |
42 | struct drm_file; | 42 | struct drm_file; |
43 | struct drm_clip_rect; | 43 | struct drm_clip_rect; |
44 | struct device_node; | ||
44 | 45 | ||
45 | #define DRM_MODE_OBJECT_CRTC 0xcccccccc | 46 | #define DRM_MODE_OBJECT_CRTC 0xcccccccc |
46 | #define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 | 47 | #define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 |
@@ -75,6 +76,14 @@ static inline uint64_t I642U64(int64_t val) | |||
75 | return (uint64_t)*((uint64_t *)&val); | 76 | return (uint64_t)*((uint64_t *)&val); |
76 | } | 77 | } |
77 | 78 | ||
79 | /* rotation property bits */ | ||
80 | #define DRM_ROTATE_0 0 | ||
81 | #define DRM_ROTATE_90 1 | ||
82 | #define DRM_ROTATE_180 2 | ||
83 | #define DRM_ROTATE_270 3 | ||
84 | #define DRM_REFLECT_X 4 | ||
85 | #define DRM_REFLECT_Y 5 | ||
86 | |||
78 | enum drm_connector_force { | 87 | enum drm_connector_force { |
79 | DRM_FORCE_UNSPECIFIED, | 88 | DRM_FORCE_UNSPECIFIED, |
80 | DRM_FORCE_OFF, | 89 | DRM_FORCE_OFF, |
@@ -314,6 +323,7 @@ struct drm_crtc_funcs { | |||
314 | */ | 323 | */ |
315 | struct drm_crtc { | 324 | struct drm_crtc { |
316 | struct drm_device *dev; | 325 | struct drm_device *dev; |
326 | struct device_node *port; | ||
317 | struct list_head head; | 327 | struct list_head head; |
318 | 328 | ||
319 | /** | 329 | /** |
@@ -331,6 +341,10 @@ struct drm_crtc { | |||
331 | struct drm_plane *primary; | 341 | struct drm_plane *primary; |
332 | struct drm_plane *cursor; | 342 | struct drm_plane *cursor; |
333 | 343 | ||
344 | /* position of cursor plane on crtc */ | ||
345 | int cursor_x; | ||
346 | int cursor_y; | ||
347 | |||
334 | /* Temporary tracking of the old fb while a modeset is ongoing. Used | 348 | /* Temporary tracking of the old fb while a modeset is ongoing. Used |
335 | * by drm_mode_set_config_internal to implement correct refcounting. */ | 349 | * by drm_mode_set_config_internal to implement correct refcounting. */ |
336 | struct drm_framebuffer *old_fb; | 350 | struct drm_framebuffer *old_fb; |
@@ -524,6 +538,8 @@ struct drm_connector { | |||
524 | struct drm_property_blob *edid_blob_ptr; | 538 | struct drm_property_blob *edid_blob_ptr; |
525 | struct drm_object_properties properties; | 539 | struct drm_object_properties properties; |
526 | 540 | ||
541 | struct drm_property_blob *path_blob_ptr; | ||
542 | |||
527 | uint8_t polled; /* DRM_CONNECTOR_POLL_* */ | 543 | uint8_t polled; /* DRM_CONNECTOR_POLL_* */ |
528 | 544 | ||
529 | /* requested DPMS state */ | 545 | /* requested DPMS state */ |
@@ -533,6 +549,7 @@ struct drm_connector { | |||
533 | 549 | ||
534 | /* forced on connector */ | 550 | /* forced on connector */ |
535 | enum drm_connector_force force; | 551 | enum drm_connector_force force; |
552 | bool override_edid; | ||
536 | uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; | 553 | uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; |
537 | struct drm_encoder *encoder; /* currently active encoder */ | 554 | struct drm_encoder *encoder; /* currently active encoder */ |
538 | 555 | ||
@@ -545,6 +562,8 @@ struct drm_connector { | |||
545 | int audio_latency[2]; | 562 | int audio_latency[2]; |
546 | int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */ | 563 | int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */ |
547 | unsigned bad_edid_counter; | 564 | unsigned bad_edid_counter; |
565 | |||
566 | struct dentry *debugfs_entry; | ||
548 | }; | 567 | }; |
549 | 568 | ||
550 | /** | 569 | /** |
@@ -800,6 +819,7 @@ struct drm_mode_config { | |||
800 | struct list_head property_blob_list; | 819 | struct list_head property_blob_list; |
801 | struct drm_property *edid_property; | 820 | struct drm_property *edid_property; |
802 | struct drm_property *dpms_property; | 821 | struct drm_property *dpms_property; |
822 | struct drm_property *path_property; | ||
803 | struct drm_property *plane_type_property; | 823 | struct drm_property *plane_type_property; |
804 | 824 | ||
805 | /* DVI-I properties */ | 825 | /* DVI-I properties */ |
@@ -823,6 +843,7 @@ struct drm_mode_config { | |||
823 | 843 | ||
824 | /* Optional properties */ | 844 | /* Optional properties */ |
825 | struct drm_property *scaling_mode_property; | 845 | struct drm_property *scaling_mode_property; |
846 | struct drm_property *aspect_ratio_property; | ||
826 | struct drm_property *dirty_info_property; | 847 | struct drm_property *dirty_info_property; |
827 | 848 | ||
828 | /* dumb ioctl parameters */ | 849 | /* dumb ioctl parameters */ |
@@ -852,7 +873,7 @@ struct drm_prop_enum_list { | |||
852 | extern int drm_crtc_init_with_planes(struct drm_device *dev, | 873 | extern int drm_crtc_init_with_planes(struct drm_device *dev, |
853 | struct drm_crtc *crtc, | 874 | struct drm_crtc *crtc, |
854 | struct drm_plane *primary, | 875 | struct drm_plane *primary, |
855 | void *cursor, | 876 | struct drm_plane *cursor, |
856 | const struct drm_crtc_funcs *funcs); | 877 | const struct drm_crtc_funcs *funcs); |
857 | extern int drm_crtc_init(struct drm_device *dev, | 878 | extern int drm_crtc_init(struct drm_device *dev, |
858 | struct drm_crtc *crtc, | 879 | struct drm_crtc *crtc, |
@@ -878,6 +899,8 @@ extern int drm_connector_init(struct drm_device *dev, | |||
878 | struct drm_connector *connector, | 899 | struct drm_connector *connector, |
879 | const struct drm_connector_funcs *funcs, | 900 | const struct drm_connector_funcs *funcs, |
880 | int connector_type); | 901 | int connector_type); |
902 | int drm_connector_register(struct drm_connector *connector); | ||
903 | void drm_connector_unregister(struct drm_connector *connector); | ||
881 | 904 | ||
882 | extern void drm_connector_cleanup(struct drm_connector *connector); | 905 | extern void drm_connector_cleanup(struct drm_connector *connector); |
883 | /* helper to unplug all connectors from sysfs for device */ | 906 | /* helper to unplug all connectors from sysfs for device */ |
@@ -937,6 +960,7 @@ extern const char *drm_get_tv_select_name(int val); | |||
937 | extern void drm_fb_release(struct drm_file *file_priv); | 960 | extern void drm_fb_release(struct drm_file *file_priv); |
938 | extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group); | 961 | extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group); |
939 | extern void drm_mode_group_destroy(struct drm_mode_group *group); | 962 | extern void drm_mode_group_destroy(struct drm_mode_group *group); |
963 | extern void drm_reinit_primary_mode_group(struct drm_device *dev); | ||
940 | extern bool drm_probe_ddc(struct i2c_adapter *adapter); | 964 | extern bool drm_probe_ddc(struct i2c_adapter *adapter); |
941 | extern struct edid *drm_get_edid(struct drm_connector *connector, | 965 | extern struct edid *drm_get_edid(struct drm_connector *connector, |
942 | struct i2c_adapter *adapter); | 966 | struct i2c_adapter *adapter); |
@@ -946,6 +970,8 @@ extern void drm_mode_config_init(struct drm_device *dev); | |||
946 | extern void drm_mode_config_reset(struct drm_device *dev); | 970 | extern void drm_mode_config_reset(struct drm_device *dev); |
947 | extern void drm_mode_config_cleanup(struct drm_device *dev); | 971 | extern void drm_mode_config_cleanup(struct drm_device *dev); |
948 | 972 | ||
973 | extern int drm_mode_connector_set_path_property(struct drm_connector *connector, | ||
974 | char *path); | ||
949 | extern int drm_mode_connector_update_edid_property(struct drm_connector *connector, | 975 | extern int drm_mode_connector_update_edid_property(struct drm_connector *connector, |
950 | struct edid *edid); | 976 | struct edid *edid); |
951 | 977 | ||
@@ -994,7 +1020,8 @@ extern struct drm_property *drm_property_create_enum(struct drm_device *dev, int | |||
994 | struct drm_property *drm_property_create_bitmask(struct drm_device *dev, | 1020 | struct drm_property *drm_property_create_bitmask(struct drm_device *dev, |
995 | int flags, const char *name, | 1021 | int flags, const char *name, |
996 | const struct drm_prop_enum_list *props, | 1022 | const struct drm_prop_enum_list *props, |
997 | int num_values); | 1023 | int num_props, |
1024 | uint64_t supported_bits); | ||
998 | struct drm_property *drm_property_create_range(struct drm_device *dev, int flags, | 1025 | struct drm_property *drm_property_create_range(struct drm_device *dev, int flags, |
999 | const char *name, | 1026 | const char *name, |
1000 | uint64_t min, uint64_t max); | 1027 | uint64_t min, uint64_t max); |
@@ -1010,6 +1037,7 @@ extern int drm_mode_create_dvi_i_properties(struct drm_device *dev); | |||
1010 | extern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats, | 1037 | extern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats, |
1011 | char *formats[]); | 1038 | char *formats[]); |
1012 | extern int drm_mode_create_scaling_mode_property(struct drm_device *dev); | 1039 | extern int drm_mode_create_scaling_mode_property(struct drm_device *dev); |
1040 | extern int drm_mode_create_aspect_ratio_property(struct drm_device *dev); | ||
1013 | extern int drm_mode_create_dirty_info_property(struct drm_device *dev); | 1041 | extern int drm_mode_create_dirty_info_property(struct drm_device *dev); |
1014 | 1042 | ||
1015 | extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, | 1043 | extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, |
@@ -1100,6 +1128,10 @@ extern int drm_format_plane_cpp(uint32_t format, int plane); | |||
1100 | extern int drm_format_horz_chroma_subsampling(uint32_t format); | 1128 | extern int drm_format_horz_chroma_subsampling(uint32_t format); |
1101 | extern int drm_format_vert_chroma_subsampling(uint32_t format); | 1129 | extern int drm_format_vert_chroma_subsampling(uint32_t format); |
1102 | extern const char *drm_get_format_name(uint32_t format); | 1130 | extern const char *drm_get_format_name(uint32_t format); |
1131 | extern struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, | ||
1132 | unsigned int supported_rotations); | ||
1133 | extern unsigned int drm_rotation_simplify(unsigned int rotation, | ||
1134 | unsigned int supported_rotations); | ||
1103 | 1135 | ||
1104 | /* Helpers */ | 1136 | /* Helpers */ |
1105 | 1137 | ||