aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2011-09-05 02:23:20 -0400
committerKeith Packard <keithp@keithp.com>2011-09-21 17:52:41 -0400
commit76adaa34db407f174dd06370cb60f6029c33b465 (patch)
tree0dd9e80ba2a6e24eb3e9c61e94b71ee9d760cdab /include/drm
parent578393cd1e6ebe2979664f11df630126c3f348a8 (diff)
drm: support routines for HDMI/DP ELD
ELD (EDID-Like Data) describes to the HDMI/DP audio driver the audio capabilities of the plugged monitor. This adds drm_edid_to_eld() for converting EDID to ELD. The converted ELD will be saved in a new drm_connector.eld[128] data field. This is necessary because the graphics driver will need to fixup some of the data fields (eg. HDMI/DP connection type, AV sync delay) before writing to the hardware ELD buffer. drm_av_sync_delay() will help the graphics drivers dynamically compute the AV sync delay for fixing-up the ELD. ELD selection policy: it's possible for one encoder to be associated with multiple connectors (ie. monitors), in which case the first found ELD will be returned by drm_select_eld(). This policy may not be suitable for all users, but let's start it simple first. The impact of ELD selection policy: assume there are two monitors, one supports stereo playback and the other has 8-channel output; cloned display mode is used, so that the two monitors are associated with the same internal encoder. If only the stereo playback capability is reported, the user won't be able to start 8-channel playback; if the 8-channel ELD is reported, then user space applications may send 8-channel samples down, however the user may actually be listening to the 2-channel monitor and not connecting speakers to the 8-channel monitor. According to James, many TVs will either refuse the display anything or pop-up an OSD warning whenever they receive hdmi audio which they cannot handle. Eventually we will require configurability and/or per-monitor audio control even when the video is cloned. CC: Zhao Yakui <yakui.zhao@intel.com> CC: Wang Zhenyu <zhenyu.z.wang@intel.com> CC: Jeremy Bush <contractfrombelow@gmail.com> CC: Christopher White <c.white@pulseforce.com> CC: Pierre-Louis Bossart <pierre-louis.bossart@intel.com> CC: Paul Menzel <paulepanter@users.sourceforge.net> CC: James Cloos <cloos@jhcloos.com> CC: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_crtc.h9
-rw-r--r--include/drm/drm_edid.h9
2 files changed, 18 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 44335e57eaaa..802079809282 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -466,6 +466,8 @@ enum drm_connector_force {
466/* DACs should rarely do this without a lot of testing */ 466/* DACs should rarely do this without a lot of testing */
467#define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2) 467#define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2)
468 468
469#define MAX_ELD_BYTES 128
470
469/** 471/**
470 * drm_connector - central DRM connector control structure 472 * drm_connector - central DRM connector control structure
471 * @crtc: CRTC this connector is currently connected to, NULL if none 473 * @crtc: CRTC this connector is currently connected to, NULL if none
@@ -523,6 +525,13 @@ struct drm_connector {
523 uint32_t force_encoder_id; 525 uint32_t force_encoder_id;
524 struct drm_encoder *encoder; /* currently active encoder */ 526 struct drm_encoder *encoder; /* currently active encoder */
525 527
528 /* EDID bits */
529 uint8_t eld[MAX_ELD_BYTES];
530 bool dvi_dual;
531 int max_tmds_clock; /* in MHz */
532 bool latency_present[2];
533 int video_latency[2]; /* [0]: progressive, [1]: interlaced */
534 int audio_latency[2];
526 int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */ 535 int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */
527}; 536};
528 537
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index eacb415b309a..74ce91684629 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -230,4 +230,13 @@ struct edid {
230 230
231#define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8)) 231#define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8))
232 232
233struct drm_encoder;
234struct drm_connector;
235struct drm_display_mode;
236void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid);
237int drm_av_sync_delay(struct drm_connector *connector,
238 struct drm_display_mode *mode);
239struct drm_connector *drm_select_eld(struct drm_encoder *encoder,
240 struct drm_display_mode *mode);
241
233#endif /* __DRM_EDID_H__ */ 242#endif /* __DRM_EDID_H__ */