diff options
Diffstat (limited to 'include/drm/drm_crtc.h')
-rw-r--r-- | include/drm/drm_crtc.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index bfacf0d5a225..3fa18b7e9497 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
31 | #include <linux/idr.h> | 31 | #include <linux/idr.h> |
32 | #include <linux/fb.h> | 32 | #include <linux/fb.h> |
33 | #include <drm/drm_mode.h> | ||
33 | 34 | ||
34 | #include <drm/drm_fourcc.h> | 35 | #include <drm/drm_fourcc.h> |
35 | 36 | ||
@@ -215,11 +216,10 @@ struct drm_display_info { | |||
215 | u32 color_formats; | 216 | u32 color_formats; |
216 | 217 | ||
217 | u8 cea_rev; | 218 | u8 cea_rev; |
218 | |||
219 | char *raw_edid; /* if any */ | ||
220 | }; | 219 | }; |
221 | 220 | ||
222 | struct drm_framebuffer_funcs { | 221 | struct drm_framebuffer_funcs { |
222 | /* note: use drm_framebuffer_remove() */ | ||
223 | void (*destroy)(struct drm_framebuffer *framebuffer); | 223 | void (*destroy)(struct drm_framebuffer *framebuffer); |
224 | int (*create_handle)(struct drm_framebuffer *fb, | 224 | int (*create_handle)(struct drm_framebuffer *fb, |
225 | struct drm_file *file_priv, | 225 | struct drm_file *file_priv, |
@@ -244,6 +244,16 @@ struct drm_framebuffer_funcs { | |||
244 | 244 | ||
245 | struct drm_framebuffer { | 245 | struct drm_framebuffer { |
246 | struct drm_device *dev; | 246 | struct drm_device *dev; |
247 | /* | ||
248 | * Note that the fb is refcounted for the benefit of driver internals, | ||
249 | * for example some hw, disabling a CRTC/plane is asynchronous, and | ||
250 | * scanout does not actually complete until the next vblank. So some | ||
251 | * cleanup (like releasing the reference(s) on the backing GEM bo(s)) | ||
252 | * should be deferred. In cases like this, the driver would like to | ||
253 | * hold a ref to the fb even though it has already been removed from | ||
254 | * userspace perspective. | ||
255 | */ | ||
256 | struct kref refcount; | ||
247 | struct list_head head; | 257 | struct list_head head; |
248 | struct drm_mode_object base; | 258 | struct drm_mode_object base; |
249 | const struct drm_framebuffer_funcs *funcs; | 259 | const struct drm_framebuffer_funcs *funcs; |
@@ -359,6 +369,9 @@ struct drm_crtc_funcs { | |||
359 | * @enabled: is this CRTC enabled? | 369 | * @enabled: is this CRTC enabled? |
360 | * @mode: current mode timings | 370 | * @mode: current mode timings |
361 | * @hwmode: mode timings as programmed to hw regs | 371 | * @hwmode: mode timings as programmed to hw regs |
372 | * @invert_dimensions: for purposes of error checking crtc vs fb sizes, | ||
373 | * invert the width/height of the crtc. This is used if the driver | ||
374 | * is performing 90 or 270 degree rotated scanout | ||
362 | * @x: x position on screen | 375 | * @x: x position on screen |
363 | * @y: y position on screen | 376 | * @y: y position on screen |
364 | * @funcs: CRTC control functions | 377 | * @funcs: CRTC control functions |
@@ -392,6 +405,8 @@ struct drm_crtc { | |||
392 | */ | 405 | */ |
393 | struct drm_display_mode hwmode; | 406 | struct drm_display_mode hwmode; |
394 | 407 | ||
408 | bool invert_dimensions; | ||
409 | |||
395 | int x, y; | 410 | int x, y; |
396 | const struct drm_crtc_funcs *funcs; | 411 | const struct drm_crtc_funcs *funcs; |
397 | 412 | ||
@@ -593,6 +608,7 @@ struct drm_connector { | |||
593 | int video_latency[2]; /* [0]: progressive, [1]: interlaced */ | 608 | int video_latency[2]; /* [0]: progressive, [1]: interlaced */ |
594 | int audio_latency[2]; | 609 | int audio_latency[2]; |
595 | int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */ | 610 | int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */ |
611 | unsigned bad_edid_counter; | ||
596 | }; | 612 | }; |
597 | 613 | ||
598 | /** | 614 | /** |
@@ -862,6 +878,7 @@ extern char *drm_get_tv_subconnector_name(int val); | |||
862 | extern char *drm_get_tv_select_name(int val); | 878 | extern char *drm_get_tv_select_name(int val); |
863 | extern void drm_fb_release(struct drm_file *file_priv); | 879 | extern void drm_fb_release(struct drm_file *file_priv); |
864 | extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group); | 880 | extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group); |
881 | extern bool drm_probe_ddc(struct i2c_adapter *adapter); | ||
865 | extern struct edid *drm_get_edid(struct drm_connector *connector, | 882 | extern struct edid *drm_get_edid(struct drm_connector *connector, |
866 | struct i2c_adapter *adapter); | 883 | struct i2c_adapter *adapter); |
867 | extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid); | 884 | extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid); |
@@ -920,6 +937,9 @@ extern void drm_framebuffer_set_object(struct drm_device *dev, | |||
920 | extern int drm_framebuffer_init(struct drm_device *dev, | 937 | extern int drm_framebuffer_init(struct drm_device *dev, |
921 | struct drm_framebuffer *fb, | 938 | struct drm_framebuffer *fb, |
922 | const struct drm_framebuffer_funcs *funcs); | 939 | const struct drm_framebuffer_funcs *funcs); |
940 | extern void drm_framebuffer_unreference(struct drm_framebuffer *fb); | ||
941 | extern void drm_framebuffer_reference(struct drm_framebuffer *fb); | ||
942 | extern void drm_framebuffer_remove(struct drm_framebuffer *fb); | ||
923 | extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb); | 943 | extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb); |
924 | extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc); | 944 | extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc); |
925 | extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); | 945 | extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); |
@@ -1035,7 +1055,7 @@ extern int drm_add_modes_noedid(struct drm_connector *connector, | |||
1035 | int hdisplay, int vdisplay); | 1055 | int hdisplay, int vdisplay); |
1036 | 1056 | ||
1037 | extern int drm_edid_header_is_valid(const u8 *raw_edid); | 1057 | extern int drm_edid_header_is_valid(const u8 *raw_edid); |
1038 | extern bool drm_edid_block_valid(u8 *raw_edid, int block); | 1058 | extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid); |
1039 | extern bool drm_edid_is_valid(struct edid *edid); | 1059 | extern bool drm_edid_is_valid(struct edid *edid); |
1040 | struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev, | 1060 | struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev, |
1041 | int hsize, int vsize, int fresh, | 1061 | int hsize, int vsize, int fresh, |