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.h46
1 files changed, 39 insertions, 7 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 3e5a51af757c..33d12f87f0e0 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -65,7 +65,7 @@ enum drm_mode_status {
65 MODE_H_ILLEGAL, /* mode has illegal horizontal timings */ 65 MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
66 MODE_V_ILLEGAL, /* mode has illegal horizontal timings */ 66 MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
67 MODE_BAD_WIDTH, /* requires an unsupported linepitch */ 67 MODE_BAD_WIDTH, /* requires an unsupported linepitch */
68 MODE_NOMODE, /* no mode with a maching name */ 68 MODE_NOMODE, /* no mode with a matching name */
69 MODE_NO_INTERLACE, /* interlaced mode not supported */ 69 MODE_NO_INTERLACE, /* interlaced mode not supported */
70 MODE_NO_DBLESCAN, /* doublescan mode not supported */ 70 MODE_NO_DBLESCAN, /* doublescan mode not supported */
71 MODE_NO_VSCAN, /* multiscan mode not supported */ 71 MODE_NO_VSCAN, /* multiscan mode not supported */
@@ -183,7 +183,9 @@ enum subpixel_order {
183 SubPixelNone, 183 SubPixelNone,
184}; 184};
185 185
186 186#define DRM_COLOR_FORMAT_RGB444 (1<<0)
187#define DRM_COLOR_FORMAT_YCRCB444 (1<<1)
188#define DRM_COLOR_FORMAT_YCRCB422 (1<<2)
187/* 189/*
188 * Describes a given display (e.g. CRT or flat panel) and its limitations. 190 * Describes a given display (e.g. CRT or flat panel) and its limitations.
189 */ 191 */
@@ -198,8 +200,10 @@ struct drm_display_info {
198 unsigned int min_vfreq, max_vfreq; 200 unsigned int min_vfreq, max_vfreq;
199 unsigned int min_hfreq, max_hfreq; 201 unsigned int min_hfreq, max_hfreq;
200 unsigned int pixel_clock; 202 unsigned int pixel_clock;
203 unsigned int bpc;
201 204
202 enum subpixel_order subpixel_order; 205 enum subpixel_order subpixel_order;
206 u32 color_formats;
203 207
204 char *raw_edid; /* if any */ 208 char *raw_edid; /* if any */
205}; 209};
@@ -221,7 +225,8 @@ struct drm_framebuffer_funcs {
221 * the semantics and arguments have a one to one mapping 225 * the semantics and arguments have a one to one mapping
222 * on this function. 226 * on this function.
223 */ 227 */
224 int (*dirty)(struct drm_framebuffer *framebuffer, unsigned flags, 228 int (*dirty)(struct drm_framebuffer *framebuffer,
229 struct drm_file *file_priv, unsigned flags,
225 unsigned color, struct drm_clip_rect *clips, 230 unsigned color, struct drm_clip_rect *clips,
226 unsigned num_clips); 231 unsigned num_clips);
227}; 232};
@@ -274,6 +279,7 @@ struct drm_pending_vblank_event;
274 279
275/** 280/**
276 * drm_crtc_funcs - control CRTCs for a given device 281 * drm_crtc_funcs - control CRTCs for a given device
282 * @reset: reset CRTC after state has been invalidate (e.g. resume)
277 * @dpms: control display power levels 283 * @dpms: control display power levels
278 * @save: save CRTC state 284 * @save: save CRTC state
279 * @resore: restore CRTC state 285 * @resore: restore CRTC state
@@ -301,6 +307,8 @@ struct drm_crtc_funcs {
301 void (*save)(struct drm_crtc *crtc); /* suspend? */ 307 void (*save)(struct drm_crtc *crtc); /* suspend? */
302 /* Restore CRTC state */ 308 /* Restore CRTC state */
303 void (*restore)(struct drm_crtc *crtc); /* resume? */ 309 void (*restore)(struct drm_crtc *crtc); /* resume? */
310 /* Reset CRTC state */
311 void (*reset)(struct drm_crtc *crtc);
304 312
305 /* cursor controls */ 313 /* cursor controls */
306 int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv, 314 int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv,
@@ -317,7 +325,7 @@ struct drm_crtc_funcs {
317 325
318 /* 326 /*
319 * Flip to the given framebuffer. This implements the page 327 * Flip to the given framebuffer. This implements the page
320 * flip ioctl descibed in drm_mode.h, specifically, the 328 * flip ioctl described in drm_mode.h, specifically, the
321 * implementation must return immediately and block all 329 * implementation must return immediately and block all
322 * rendering to the current fb until the flip has completed. 330 * rendering to the current fb until the flip has completed.
323 * If userspace set the event flag in the ioctl, the event 331 * If userspace set the event flag in the ioctl, the event
@@ -350,8 +358,14 @@ struct drm_crtc {
350 358
351 bool enabled; 359 bool enabled;
352 360
361 /* Requested mode from modesetting. */
353 struct drm_display_mode mode; 362 struct drm_display_mode mode;
354 363
364 /* Programmed mode in hw, after adjustments for encoders,
365 * crtc, panel scaling etc. Needed for timestamping etc.
366 */
367 struct drm_display_mode hwmode;
368
355 int x, y; 369 int x, y;
356 const struct drm_crtc_funcs *funcs; 370 const struct drm_crtc_funcs *funcs;
357 371
@@ -359,6 +373,9 @@ struct drm_crtc {
359 uint32_t gamma_size; 373 uint32_t gamma_size;
360 uint16_t *gamma_store; 374 uint16_t *gamma_store;
361 375
376 /* Constants needed for precise vblank and swap timestamping. */
377 s64 framedur_ns, linedur_ns, pixeldur_ns;
378
362 /* if you are using the helper */ 379 /* if you are using the helper */
363 void *helper_private; 380 void *helper_private;
364}; 381};
@@ -369,6 +386,7 @@ struct drm_crtc {
369 * @dpms: set power state (see drm_crtc_funcs above) 386 * @dpms: set power state (see drm_crtc_funcs above)
370 * @save: save connector state 387 * @save: save connector state
371 * @restore: restore connector state 388 * @restore: restore connector state
389 * @reset: reset connector after state has been invalidate (e.g. resume)
372 * @mode_valid: is this mode valid on the given connector? 390 * @mode_valid: is this mode valid on the given connector?
373 * @mode_fixup: try to fixup proposed mode for this connector 391 * @mode_fixup: try to fixup proposed mode for this connector
374 * @mode_set: set this mode 392 * @mode_set: set this mode
@@ -386,6 +404,7 @@ struct drm_connector_funcs {
386 void (*dpms)(struct drm_connector *connector, int mode); 404 void (*dpms)(struct drm_connector *connector, int mode);
387 void (*save)(struct drm_connector *connector); 405 void (*save)(struct drm_connector *connector);
388 void (*restore)(struct drm_connector *connector); 406 void (*restore)(struct drm_connector *connector);
407 void (*reset)(struct drm_connector *connector);
389 408
390 /* Check to see if anything is attached to the connector. 409 /* Check to see if anything is attached to the connector.
391 * @force is set to false whilst polling, true when checking the 410 * @force is set to false whilst polling, true when checking the
@@ -403,6 +422,7 @@ struct drm_connector_funcs {
403}; 422};
404 423
405struct drm_encoder_funcs { 424struct drm_encoder_funcs {
425 void (*reset)(struct drm_encoder *encoder);
406 void (*destroy)(struct drm_encoder *encoder); 426 void (*destroy)(struct drm_encoder *encoder);
407}; 427};
408 428
@@ -500,6 +520,8 @@ struct drm_connector {
500 uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; 520 uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER];
501 uint32_t force_encoder_id; 521 uint32_t force_encoder_id;
502 struct drm_encoder *encoder; /* currently active encoder */ 522 struct drm_encoder *encoder; /* currently active encoder */
523
524 int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */
503}; 525};
504 526
505/** 527/**
@@ -643,9 +665,10 @@ extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid
643extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode); 665extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
644extern void drm_mode_remove(struct drm_connector *connector, struct drm_display_mode *mode); 666extern void drm_mode_remove(struct drm_connector *connector, struct drm_display_mode *mode);
645extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev, 667extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
646 struct drm_display_mode *mode); 668 const struct drm_display_mode *mode);
647extern void drm_mode_debug_printmodeline(struct drm_display_mode *mode); 669extern void drm_mode_debug_printmodeline(struct drm_display_mode *mode);
648extern void drm_mode_config_init(struct drm_device *dev); 670extern void drm_mode_config_init(struct drm_device *dev);
671extern void drm_mode_config_reset(struct drm_device *dev);
649extern void drm_mode_config_cleanup(struct drm_device *dev); 672extern void drm_mode_config_cleanup(struct drm_device *dev);
650extern void drm_mode_set_name(struct drm_display_mode *mode); 673extern void drm_mode_set_name(struct drm_display_mode *mode);
651extern bool drm_mode_equal(struct drm_display_mode *mode1, struct drm_display_mode *mode2); 674extern bool drm_mode_equal(struct drm_display_mode *mode1, struct drm_display_mode *mode2);
@@ -668,8 +691,8 @@ extern void drm_mode_validate_size(struct drm_device *dev,
668extern void drm_mode_prune_invalid(struct drm_device *dev, 691extern void drm_mode_prune_invalid(struct drm_device *dev,
669 struct list_head *mode_list, bool verbose); 692 struct list_head *mode_list, bool verbose);
670extern void drm_mode_sort(struct list_head *mode_list); 693extern void drm_mode_sort(struct list_head *mode_list);
671extern int drm_mode_hsync(struct drm_display_mode *mode); 694extern int drm_mode_hsync(const struct drm_display_mode *mode);
672extern int drm_mode_vrefresh(struct drm_display_mode *mode); 695extern int drm_mode_vrefresh(const struct drm_display_mode *mode);
673extern void drm_mode_set_crtcinfo(struct drm_display_mode *p, 696extern void drm_mode_set_crtcinfo(struct drm_display_mode *p,
674 int adjust_flags); 697 int adjust_flags);
675extern void drm_mode_connector_list_update(struct drm_connector *connector); 698extern void drm_mode_connector_list_update(struct drm_connector *connector);
@@ -761,7 +784,9 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
761 void *data, struct drm_file *file_priv); 784 void *data, struct drm_file *file_priv);
762extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, 785extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
763 void *data, struct drm_file *file_priv); 786 void *data, struct drm_file *file_priv);
787extern u8 *drm_find_cea_extension(struct edid *edid);
764extern bool drm_detect_hdmi_monitor(struct edid *edid); 788extern bool drm_detect_hdmi_monitor(struct edid *edid);
789extern bool drm_detect_monitor_audio(struct edid *edid);
765extern int drm_mode_page_flip_ioctl(struct drm_device *dev, 790extern int drm_mode_page_flip_ioctl(struct drm_device *dev,
766 void *data, struct drm_file *file_priv); 791 void *data, struct drm_file *file_priv);
767extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, 792extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
@@ -780,4 +805,11 @@ extern int drm_add_modes_noedid(struct drm_connector *connector,
780extern bool drm_edid_is_valid(struct edid *edid); 805extern bool drm_edid_is_valid(struct edid *edid);
781struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev, 806struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
782 int hsize, int vsize, int fresh); 807 int hsize, int vsize, int fresh);
808
809extern int drm_mode_create_dumb_ioctl(struct drm_device *dev,
810 void *data, struct drm_file *file_priv);
811extern int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
812 void *data, struct drm_file *file_priv);
813extern int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
814 void *data, struct drm_file *file_priv);
783#endif /* __DRM_CRTC_H__ */ 815#endif /* __DRM_CRTC_H__ */