diff mbox

[v3,2/2] drm: Add EDID quirks to disable HDMI audio and InfoFrames

Message ID 1344745804-26475-3-git-send-email-arequipeno@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Pilcher Aug. 12, 2012, 4:30 a.m. UTC
Add EDID quirk flags to disable HDMI audio and HDMI InfoFrames.
Add quirk for LG L246WP.

Signed-off-by: Ian Pilcher <arequipeno@gmail.com>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
---
 drivers/gpu/drm/drm_edid.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

Paul Menzel Aug. 12, 2012, 3:45 p.m. UTC | #1
Am Samstag, den 11.08.2012, 23:30 -0500 schrieb Ian Pilcher:
> Add EDID quirk flags to disable HDMI audio and HDMI InfoFrames.
> Add quirk for LG L246WP.

I know, in

        commit bc42aabc6a01b92b0f961d65671564e0e1cd7592
        Author: Adam Jackson <ajax@redhat.com>
        Date:   Wed May 23 16:26:54 2012 -0400

            drm/edid/quirks: ViewSonic VA2026w

it also was committed together, but I would prefer to first add the
quirks and then the actual monitor. In my opinion the advantage is that
then it is more visible because it is mentioned in the commit summary
and therefore can be found more easily.

So it would be great if you could split this patch up too although it is
quite small too.

Could you also mention in the commit message of the patch adding the LG
monitor on what system you tested this just for the record.

> Signed-off-by: Ian Pilcher <arequipeno@gmail.com>
> Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
> ---
>  drivers/gpu/drm/drm_edid.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)

[…]


Thanks,

Paul
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index bb3ba20..6c143ed 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -70,6 +70,10 @@ 
 #define EDID_QUIRK_DETAILED_SYNC_PP		(1 << 6)
 /* Force reduced-blanking timings for detailed modes */
 #define EDID_QUIRK_FORCE_REDUCED_BLANKING	(1 << 7)
+/* Display is confused by InfoFrames; don't sent any */
+#define EDID_QUIRK_DISABLE_INFOFRAMES		(1 << 8)
+/* Display doesn't have any audio output */
+#define EDID_QUIRK_NO_AUDIO			(1 << 9)
 
 struct detailed_mode_closure {
 	struct drm_connector *connector;
@@ -156,6 +160,10 @@  union edid_quirk edid_quirk_list[EDID_QUIRK_LIST_SIZE] = {
 	{ { { { EDID_MFG_ID('V', 'S', 'C'), cpu_to_le16(5020) } },
 		EDID_QUIRK_FORCE_REDUCED_BLANKING } },
 
+	/* LG L246WP */
+	{ { { { EDID_MFG_ID('G', 'S', 'M'), cpu_to_le16(0x563f) } },
+		EDID_QUIRK_DISABLE_INFOFRAMES | EDID_QUIRK_NO_AUDIO } },
+
 	/*
 	 * When adding built-in quirks, please adjust EDID_QUIRK_LIST_SIZE to
 	 * provide some room for user-supplied quirks.
@@ -2109,6 +2117,14 @@  bool drm_detect_hdmi_monitor(struct edid *edid)
 	int i, hdmi_id;
 	int start_offset, end_offset;
 	bool is_hdmi = false;
+	char buf[EDID_DISPLAY_ID_BUF_SIZE];
+
+	if (edid_get_quirks(edid) & EDID_QUIRK_DISABLE_INFOFRAMES) {
+		DRM_INFO("Disabling HDMI InfoFrames on display %s "
+			 "due to EDID quirk\n",
+			 drm_edid_display_id_format(edid->display_id, buf, 1));
+		goto end;
+	}
 
 	edid_ext = drm_find_cea_extension(edid);
 	if (!edid_ext)
@@ -2157,6 +2173,14 @@  bool drm_detect_monitor_audio(struct edid *edid)
 	int i, j;
 	bool has_audio = false;
 	int start_offset, end_offset;
+	char buf[EDID_DISPLAY_ID_BUF_SIZE];
+
+	if (edid_get_quirks(edid) & EDID_QUIRK_NO_AUDIO) {
+		DRM_INFO("Disabling HDMI audio on display %s "
+			 "due to EDID quirk\n",
+			 drm_edid_display_id_format(edid->display_id, buf, 1));
+		goto end;
+	}
 
 	edid_ext = drm_find_cea_extension(edid);
 	if (!edid_ext)