From patchwork Thu Aug 16 14:55:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ville Syrjala X-Patchwork-Id: 1333191 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id B1D7BDFB34 for ; Thu, 16 Aug 2012 14:58:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 94D0AA0244 for ; Thu, 16 Aug 2012 07:58:18 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 518709F3A3 for ; Thu, 16 Aug 2012 07:55:39 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 16 Aug 2012 07:55:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.77,778,1336374000"; d="scan'208";a="181515553" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by orsmga001.jf.intel.com with SMTP; 16 Aug 2012 07:55:23 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 16 Aug 2012 17:55:23 +0300 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/4] drm: edid: Add some bounds checking Date: Thu, 16 Aug 2012 17:55:04 +0300 Message-Id: <1345128906-17681-3-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1345128906-17681-1-git-send-email-ville.syrjala@linux.intel.com> References: <1345128906-17681-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Ville Syrjälä Make sure drm_detect_hdmi_monitor() and drm_detect_monitor_audio() don't access beyond the extension block. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_edid.c | 99 ++++++++++++++++++++++++++++++++----------- 1 files changed, 73 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index a346b04..aa28d1c 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1502,16 +1502,57 @@ do_cea_modes (struct drm_connector *connector, u8 *db, u8 len) } static int +cea_db_payload_len(const u8 *db) +{ + return db[0] & 0x1f; +} + +static int +cea_db_tag(const u8 *db) +{ + return db[0] >> 5; +} + +static int +cea_revision(const u8 *cea) +{ + return cea[1]; +} + +static int +cea_db_offsets(const u8 *cea, int *start, int *end) +{ + /* Data block offset in CEA extension block */ + *start = 4; + *end = cea[2]; + if (*end == 0) + *end = 127; + if (*end < 4 || *end > 127) + return -ERANGE; + return 0; +} + +#define for_each_cea_db(cea, i, start, end) \ + for ((i) = (start); (i) < (end) && (i) + cea_db_payload_len(&(cea)[(i)]) < (end); (i) += cea_db_payload_len(&(cea)[(i)]) + 1) + +static int add_cea_modes(struct drm_connector *connector, struct edid *edid) { u8 * cea = drm_find_cea_extension(edid); u8 * db, dbl; int modes = 0; - if (cea && cea[1] >= 3) { - for (db = cea + 4; db < cea + cea[2]; db += dbl + 1) { - dbl = db[0] & 0x1f; - if (((db[0] & 0xe0) >> 5) == VIDEO_BLOCK) + if (cea && cea_revision(cea) >= 3) { + int i, start, end; + + if (cea_db_offsets(cea, &start, &end)) + return 0; + + for_each_cea_db(cea, i, start, end) { + db = &cea[i]; + dbl = cea_db_payload_len(db); + + if (cea_db_tag(db) == VIDEO_BLOCK) modes += do_cea_modes (connector, db+1, dbl); } } @@ -1602,19 +1643,29 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) eld[18] = edid->prod_code[0]; eld[19] = edid->prod_code[1]; - if (cea[1] >= 3) - for (db = cea + 4; db < cea + cea[2]; db += dbl + 1) { - dbl = db[0] & 0x1f; - - switch ((db[0] & 0xe0) >> 5) { + if (cea_revision(cea) >= 3) { + int i, start, end; + + if (cea_db_offsets(cea, &start, &end)) { + start = 0; + end = 0; + } + + for_each_cea_db(cea, i, start, end) { + db = &cea[i]; + dbl = cea_db_payload_len(db); + + switch (cea_db_tag(db)) { case AUDIO_BLOCK: /* Audio Data Block, contains SADs */ sad_count = dbl / 3; - memcpy(eld + 20 + mnl, &db[1], dbl); + if (dbl >= 1) + memcpy(eld + 20 + mnl, &db[1], dbl); break; case SPEAKER_BLOCK: - /* Speaker Allocation Data Block */ - eld[7] = db[1]; + /* Speaker Allocation Data Block */ + if (dbl >= 1) + eld[7] = db[1]; break; case VENDOR_BLOCK: /* HDMI Vendor-Specific Data Block */ @@ -1625,6 +1676,7 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) break; } } + } eld[5] |= sad_count << 4; eld[2] = (20 + mnl + sad_count * 3 + 3) / 4; @@ -1710,19 +1762,16 @@ bool drm_detect_hdmi_monitor(struct edid *edid) if (!edid_ext) goto end; - /* Data block offset in CEA extension block */ - start_offset = 4; - end_offset = edid_ext[2]; + if (cea_db_offsets(edid_ext, &start_offset, &end_offset)) + goto end; /* * Because HDMI identifier is in Vendor Specific Block, * search it from all data blocks of CEA extension. */ - for (i = start_offset; i < end_offset; - /* Increased by data block len */ - i += ((edid_ext[i] & 0x1f) + 1)) { + for_each_cea_db(edid_ext, i, start_offset, end_offset) { /* Find vendor specific block */ - if ((edid_ext[i] >> 5) == VENDOR_BLOCK) { + if (cea_db_tag(&edid_ext[i]) == VENDOR_BLOCK) { hdmi_id = edid_ext[i + 1] | (edid_ext[i + 2] << 8) | edid_ext[i + 3] << 16; /* Find HDMI identifier */ @@ -1765,15 +1814,13 @@ bool drm_detect_monitor_audio(struct edid *edid) goto end; } - /* Data block offset in CEA extension block */ - start_offset = 4; - end_offset = edid_ext[2]; + if (cea_db_offsets(edid_ext, &start_offset, &end_offset)) + goto end; - for (i = start_offset; i < end_offset; - i += ((edid_ext[i] & 0x1f) + 1)) { - if ((edid_ext[i] >> 5) == AUDIO_BLOCK) { + for_each_cea_db(edid_ext, i, start_offset, end_offset) { + if (cea_db_tag(&edid_ext[i]) == AUDIO_BLOCK) { has_audio = true; - for (j = 1; j < (edid_ext[i] & 0x1f); j += 3) + for (j = 1; j < cea_db_payload_len(&edid_ext[i]) + 1; j += 3) DRM_DEBUG_KMS("CEA audio format %d\n", (edid_ext[i + j] >> 3) & 0xf); goto end; From patchwork Thu Aug 16 14:55:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ville Syrjala X-Patchwork-Id: 1333201 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id BD8603FC33 for ; Thu, 16 Aug 2012 14:59:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A21DBA093A for ; Thu, 16 Aug 2012 07:59:14 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id E11589F0FF for ; Thu, 16 Aug 2012 07:55:47 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 16 Aug 2012 07:55:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.77,778,1336374000"; d="scan'208";a="209382482" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by fmsmga002.fm.intel.com with SMTP; 16 Aug 2012 07:55:27 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 16 Aug 2012 17:55:26 +0300 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/4] drm: edid: Add bounds checking to HDMI VSDB parsing Date: Thu, 16 Aug 2012 17:55:05 +0300 Message-Id: <1345128906-17681-4-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1345128906-17681-1-git-send-email-ville.syrjala@linux.intel.com> References: <1345128906-17681-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Ville Syrjälä The length of HDMI VSDB must be at least 5 bytes. Other than the minimum, nothing else about the length is specified. Check the length before accessing any additional field beyond the minimum length. --- drivers/gpu/drm/drm_edid.c | 33 +++++++++++++++++++++------------ 1 files changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index aa28d1c..2611ba8 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1561,19 +1561,28 @@ add_cea_modes(struct drm_connector *connector, struct edid *edid) } static void -parse_hdmi_vsdb(struct drm_connector *connector, uint8_t *db) +parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db) { - connector->eld[5] |= (db[6] >> 7) << 1; /* Supports_AI */ + u8 len = cea_db_payload_len(db); - connector->dvi_dual = db[6] & 1; - connector->max_tmds_clock = db[7] * 5; - - connector->latency_present[0] = db[8] >> 7; - connector->latency_present[1] = (db[8] >> 6) & 1; - connector->video_latency[0] = db[9]; - connector->audio_latency[0] = db[10]; - connector->video_latency[1] = db[11]; - connector->audio_latency[1] = db[12]; + if (len >= 6) { + connector->eld[5] |= (db[6] >> 7) << 1; /* Supports_AI */ + connector->dvi_dual = db[6] & 1; + } + if (len >= 7) + connector->max_tmds_clock = db[7] * 5; + if (len >= 8) { + connector->latency_present[0] = db[8] >> 7; + connector->latency_present[1] = (db[8] >> 6) & 1; + } + if (len >= 9) + connector->video_latency[0] = db[9]; + if (len >= 10) + connector->audio_latency[0] = db[10]; + if (len >= 11) + connector->video_latency[1] = db[11]; + if (len >= 12) + connector->audio_latency[1] = db[12]; DRM_LOG_KMS("HDMI: DVI dual %d, " "max TMDS clock %d, " @@ -1669,7 +1678,7 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) break; case VENDOR_BLOCK: /* HDMI Vendor-Specific Data Block */ - if (db[1] == 0x03 && db[2] == 0x0c && db[3] == 0) + if (dbl >= 5 && db[1] == 0x03 && db[2] == 0x0c && db[3] == 0) parse_hdmi_vsdb(connector, db); break; default: From patchwork Thu Aug 16 14:55:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ville Syrjala X-Patchwork-Id: 1333171 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 8DF9240211 for ; Thu, 16 Aug 2012 14:56:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E539A0244 for ; Thu, 16 Aug 2012 07:56:39 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 33D1F9F674 for ; Thu, 16 Aug 2012 07:55:33 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 16 Aug 2012 07:55:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.77,778,1336374000"; d="scan'208";a="187260524" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by orsmga002.jf.intel.com with SMTP; 16 Aug 2012 07:55:29 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 16 Aug 2012 17:55:29 +0300 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/4] drm: edid: Refactor HDMI VSDB detection Date: Thu, 16 Aug 2012 17:55:06 +0300 Message-Id: <1345128906-17681-5-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1345128906-17681-1-git-send-email-ville.syrjala@linux.intel.com> References: <1345128906-17681-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Ville Syrjälä There are two slightly different pieces of code for HDMI VSDB detection. Unify the code into a single helper function. Also fix a bug where drm_detect_hdmi_monitor() would stop looking for the HDMI VSDB after the first vendor specific block is found, whether or not that block happened to be the HDMI VSDB. The standard allows for any number of vendor specific blocks to be present. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_edid.c | 38 ++++++++++++++++++++++---------------- 1 files changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 2611ba8..f5c9cea 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1606,6 +1606,21 @@ monitor_name(struct detailed_timing *t, void *data) *(u8 **)data = t->data.other_data.data.str.str; } +static bool cea_db_is_hdmi_vsdb(const u8 *db) +{ + int hdmi_id; + + if (cea_db_tag(db) != VENDOR_BLOCK) + return false; + + if (cea_db_payload_len(db) < 5) + return false; + + hdmi_id = db[1] | (db[2] << 8) | (db[3] << 16); + + return hdmi_id == HDMI_IDENTIFIER; +} + /** * drm_edid_to_eld - build ELD from EDID * @connector: connector corresponding to the HDMI/DP sink @@ -1678,7 +1693,7 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) break; case VENDOR_BLOCK: /* HDMI Vendor-Specific Data Block */ - if (dbl >= 5 && db[1] == 0x03 && db[2] == 0x0c && db[3] == 0) + if (cea_db_is_hdmi_vsdb(db)) parse_hdmi_vsdb(connector, db); break; default: @@ -1763,35 +1778,26 @@ EXPORT_SYMBOL(drm_select_eld); bool drm_detect_hdmi_monitor(struct edid *edid) { u8 *edid_ext; - int i, hdmi_id; + int i; int start_offset, end_offset; - bool is_hdmi = false; edid_ext = drm_find_cea_extension(edid); if (!edid_ext) - goto end; + return false; if (cea_db_offsets(edid_ext, &start_offset, &end_offset)) - goto end; + return false; /* * Because HDMI identifier is in Vendor Specific Block, * search it from all data blocks of CEA extension. */ for_each_cea_db(edid_ext, i, start_offset, end_offset) { - /* Find vendor specific block */ - if (cea_db_tag(&edid_ext[i]) == VENDOR_BLOCK) { - hdmi_id = edid_ext[i + 1] | (edid_ext[i + 2] << 8) | - edid_ext[i + 3] << 16; - /* Find HDMI identifier */ - if (hdmi_id == HDMI_IDENTIFIER) - is_hdmi = true; - break; - } + if (cea_db_is_hdmi_vsdb(&edid_ext[i])) + return true; } -end: - return is_hdmi; + return false; } EXPORT_SYMBOL(drm_detect_hdmi_monitor); From patchwork Thu Aug 23 07:05:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shirish S X-Patchwork-Id: 1364501 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id B720BDF2AB for ; Thu, 23 Aug 2012 05:51:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A2769E93B for ; Wed, 22 Aug 2012 22:51:23 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTP id D9F109E746 for ; Wed, 22 Aug 2012 21:57:02 -0700 (PDT) Received: from epcpsbgm1.samsung.com (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M9600MKKZ1KMHM0@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 23 Aug 2012 13:57:02 +0900 (KST) X-AuditID: cbfee61a-b7fc66d0000043b7-05-5035b81e74f2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 5A.3E.17335.E18B5305; Thu, 23 Aug 2012 13:57:02 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M9600IJVZ2FO100@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 23 Aug 2012 13:57:02 +0900 (KST) From: Shirish S To: dri-devel@lists.freedesktop.org Subject: [PATCH V2] drm: edid: add support for E-DDC Date: Thu, 23 Aug 2012 12:35:01 +0530 Message-id: <1345705501-26246-2-git-send-email-s.shirish@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1345705501-26246-1-git-send-email-s.shirish@samsung.com> References: <1345705501-26246-1-git-send-email-s.shirish@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jAV25HaYBBveucltc+fqezYHR4373 caYAxigum5TUnMyy1CJ9uwSujNmXv7IUNAhUPJ53krmBsZmni5GTQ0LARGLthDOsELaYxIV7 69m6GLk4hAQWMUpsm7aQCcJZzSTxbsstsCo2AXWJi5NXM4PYIgLKEn8nrmLsYuTgYBbQktiz WwgkLAw09PWtTywgNouAqsTrhf/AbF4BV4nDy7sZIZYpSLQuO8QOYnMKuEkcnHsZbKQQUM3c HzuZJjDyLmBkWMUomlqQXFCclJ5rqFecmFtcmpeul5yfu4kR7PNnUjsYVzZYHGIU4GBU4uHN iDUNEGJNLCuuzD3EKMHBrCTCGz4PKMSbklhZlVqUH19UmpNafIhRmoNFSZyXv88wQEggPbEk NTs1tSC1CCbLxMEp1cB47LLLUnetvLf3bc7XVmnkcOx+WP7i7WLz2ZqlOcIGQUGtryrMan8U rf7BqS7fz+A4Obxz+4200ukqJx/KP80xvFvHOrlls1n+35iJHpbS5qmT3hz7ZKmds8OGe+O9 E1F3OLdlfSmwvyL7cWXFaZeTZT98enhzdye+XPKPp+Cg4Ju8IA5l6UQlluKMREMt5qLiRACc 3Z+M9QEAAA== X-TM-AS-MML: No X-Mailman-Approved-At: Wed, 22 Aug 2012 22:44:24 -0700 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org The current logic for probing ddc is limited to 2 blocks (256 bytes), this patch adds support for the 4 block (512) data. To do this, a single 8-bit segment index is passed to the display via the I2C address 30h. Data from the selected segment is then immediately read via the regular DDC2 address using a repeated I2C 'START' signal. Signed-off-by: Shirish S --- drivers/gpu/drm/drm_edid.c | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index a8743c3..33a3888 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -253,7 +253,9 @@ static int drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf, int block, int len) { - unsigned char start = block * EDID_LENGTH; + unsigned short start = block * EDID_LENGTH; + unsigned char segment = block >> 1; + unsigned short segFlags = segment ? 0 : I2C_M_IGNORE_NAK; int ret, retries = 5; /* The core i2c driver will automatically retry the transfer if the @@ -264,27 +266,32 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf, */ do { struct i2c_msg msgs[] = { - { + { /*set segment pointer */ + .addr = DDC_SEGMENT_ADDR, + .flags = segFlags, + .len = 1, + .buf = &segment, + }, { /*set offset */ .addr = DDC_ADDR, .flags = 0, .len = 1, .buf = &start, - }, { + }, { /*set data */ .addr = DDC_ADDR, .flags = I2C_M_RD, .len = len, .buf = buf, } }; - ret = i2c_transfer(adapter, msgs, 2); + ret = i2c_transfer(adapter, msgs, 3); if (ret == -ENXIO) { DRM_DEBUG_KMS("drm: skipping non-existent adapter %s\n", adapter->name); break; } - } while (ret != 2 && --retries); + } while (ret != 3 && --retries); - return ret == 2 ? 0 : -1; + return ret == 3 ? 0 : -1; } static bool drm_edid_is_zero(u8 *in_edid, int length) From patchwork Sun Aug 12 20:07:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Pilcher X-Patchwork-Id: 1310071 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 181A2DF280 for ; Sun, 12 Aug 2012 20:09:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 08DC39E933 for ; Sun, 12 Aug 2012 13:09:15 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by gabe.freedesktop.org (Postfix) with ESMTP id F25279E933 for ; Sun, 12 Aug 2012 13:08:11 -0700 (PDT) Received: by mail-ob0-f177.google.com with SMTP id ta17so5915609obb.36 for ; Sun, 12 Aug 2012 13:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=fR8X4nwVs2tm8Z8jz2PjI9xY9CQZvQIdSo5m8AUzj5M=; b=bC0TDMpj1VIgcmunwdK9nQtGd4phvf27E514Tzr4Fdfr2aX5NwmxQocbhk+0ETi/+/ /oZH9w8jNmo0bYXcfV2m7bc/jcG28j7c/9iS8GWa8fZIxGqKC08kvBfcEjXCkSa7FcdY hUafSNgjrefGrJAPoGV9yzPCRSzGpo7PJ8neyTeMpMPZydh+J/5ZDWN3TGSVDv+voTi2 kSY1hnTZ0qimKIAPjlXiwM69NAaHh0qYoqpWh6hjf52mibFpjZcLXQFfKsQvckqooFcc HqLHkIaLOK1LPyk5YQkMy2YmSYjsRlLyFq3AkPJitgrUOGmclgz9j0jjFRKXSF1VPngC l2Dw== Received: by 10.60.172.236 with SMTP id bf12mr14757978oec.23.1344802091641; Sun, 12 Aug 2012 13:08:11 -0700 (PDT) Received: from ian.icp.selfip.net (pool-71-170-109-80.dllstx.fios.verizon.net. [71.170.109.80]) by mx.google.com with ESMTPS id k8sm3266152oeh.9.2012.08.12.13.08.10 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 12 Aug 2012 13:08:11 -0700 (PDT) From: Ian Pilcher To: dri-devel@lists.freedesktop.org Subject: [PATCH v4 1/3] drm: Add user-defined EDID quirks capability Date: Sun, 12 Aug 2012 15:07:58 -0500 Message-Id: <1344802080-9575-2-git-send-email-arequipeno@gmail.com> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1344802080-9575-1-git-send-email-arequipeno@gmail.com> References: <1344754732.4980.5.camel@mattotaupa> <1344802080-9575-1-git-send-email-arequipeno@gmail.com> Cc: Ian Pilcher , paulepanter@users.sourceforge.net X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Add the ability for users to define their own EDID quirks via a module parameter or sysfs attribute. Signed-off-by: Ian Pilcher Acked-by: Paul Menzel --- Documentation/EDID/edid_quirks.txt | 126 ++++++++++ drivers/gpu/drm/drm_drv.c | 2 + drivers/gpu/drm/drm_edid.c | 500 ++++++++++++++++++++++++++++++++----- drivers/gpu/drm/drm_stub.c | 6 + drivers/gpu/drm/drm_sysfs.c | 19 ++ include/drm/drmP.h | 10 + include/drm/drm_edid.h | 13 +- 7 files changed, 615 insertions(+), 61 deletions(-) create mode 100644 Documentation/EDID/edid_quirks.txt diff --git a/Documentation/EDID/edid_quirks.txt b/Documentation/EDID/edid_quirks.txt new file mode 100644 index 0000000..0c9c746 --- /dev/null +++ b/Documentation/EDID/edid_quirks.txt @@ -0,0 +1,126 @@ + EDID Quirks + ============= + Ian Pilcher + August 11, 2012 + + + "EDID blocks out in the wild have a variety of bugs" + -- from drivers/gpu/drm/drm_edid.c + + +Overview +======== + +EDID quirks provide a mechanism for working around display hardware with buggy +EDID data. + +An individual EDID quirk maps a display type (identified by its EDID +manufacturer ID and product code[1]) to a set of "quirk flags." The kernel +includes a variety of built-in quirks. (They are stored in the edid_quirk_list +array in drivers/gpu/drm/drm_edid.c.) + +An example of a built-in EDID quirk is: + + ACR:0xad46:0x00000001 + +The first field is the manufacturer ID (Acer, Inc.), the second field is the +manufacturer's product code, and the third field contains the quirk flags for +that display type. + +The quirk flags are defined in drivers/gpu/drm/drm_edid.c. Each flag has a +symbolic name beginning with EDID_QUIRK_, along with a numerical value. Each +flag should also have an associated comment which provides an idea of its +effect. Note that the values in the source file are expressed as bit shifts[2]: + + * 1 << 0: 0x0001 + * 1 << 1: 0x0002 + * 1 << 2: 0x0004 + * etc. + + +sysfs interface +=============== + +The current EDID quirk list can be read from /sys/class/drm/edid_quirks: + + # cat /sys/class/drm/edid_quirks + ACR:0xad46:0x00000001 + API:0x7602:0x00000001 + ACR:0x0977:0x00000020 + 0x9e6a:0x077e:0x00000080 + ... + +("Nonconformant" manufacturer IDs are displayed as hexadecimal values.) + +The number of total "slots" in the list can be read from +/sys/class/drm/edid_quirks_size. This total includes both occupied slots (i.e. +the current list) and any slots available for additional quirks. The number of +available slots can be calculated by subtracting the number of quirks in the +current list from the total number of slots. + +If a slot is available, an additional quirk can be added to the list by writing +it to /sys/class/drm/edid_quirks: + + # echo FOO:0xffff:0x100 > /sys/class/drm/edid_quirks + +Manufacturer IDs can also be specified numerically. (This is the only way to +specify a nonconformant ID.) This command is equivalent to the previous one: + + # echo 0x19ef:0xffff:0x100 > /sys/class/drm/edid_quirks + +Numeric values can also be specified in decimal or octal formats; a number that +begins with a 0 is assumed to be octal: + + # echo FOO:65535:0400 > /sys/class/drm/edid_quirks + +An existing quirk can be replaced by writing a new set of flags: + + # echo FOO:0xffff:0x200 > /sys/class/drm/edid_quirks + +A quirk can be deleted from the list by writing an empty flag set (0). This +makes the slot occupied by that quirk available. + + # echo FOO:0xffff:0 > /sys/class/drm/edid_quirks + +Writing an "at symbol" (@) clears the entire quirk list: + + # echo @ > /sys/class/drm/edid_quirks + +Multiple changes to the list can be specified in a comma (or newline) separated +list. For example, the following command clears all of the existing quirks in +the list and adds 3 new quirks: + + # echo @,FOO:0xffff:0x100,BAR:0x1111:0x001,BAZ:0x2222:0x002 > \ + /sys/class/drm/edid_quirks + +Note however, that any error (an incorrectly formatted quirk or an attempt to +add a quirk when no slot is available) will abort processing of any further +changes, potentially making it difficult to determine exactly which change +caused the error and what changes were made. For this reason, making changes +one at a time is recommended, particularly if the changes are being made by a +script or program. + + +Module parameter +================ + +The EDID quirk list can also be modified via the edid_quirks module parameter +(drm.edid_quirks on the kernel command line). The effect of setting this +parameter is identical to the effect of writing its value to +/sys/class/drm/edid_quirks, with one important difference. When an error is +encountered during module parameter parsing or processing, any remaining quirks +in the parameter string will still be processed. (It is hoped that this approach +maximizes the probability of producing a working display.) + + +Follow-up +========= + +If you encounter a display that requires an additional EDID quirk in order to +function properly, please report it to the direct rendering development mailing +list . + + +[1] See http://en.wikipedia.org/wiki/Extended_display_identification_data for a + description of the manufacturer ID and product code fields. +[2] https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 9238de4..7fe39e0 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -276,6 +276,8 @@ static int __init drm_core_init(void) goto err_p3; } + drm_edid_quirks_param_process(); + DRM_INFO("Initialized %s %d.%d.%d %s\n", CORE_NAME, CORE_MAJOR, CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE); return 0; diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index a8743c3..ea535f6 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -31,6 +31,8 @@ #include #include #include +#include + #include "drmP.h" #include "drm_edid.h" #include "drm_edid_modes.h" @@ -82,51 +84,457 @@ struct detailed_mode_closure { #define LEVEL_GTF2 2 #define LEVEL_CVT 3 -static struct edid_quirk { - char vendor[4]; - int product_id; - u32 quirks; -} edid_quirk_list[] = { +union edid_quirk { + struct { + union edid_display_id display_id; + u32 quirks; + } __attribute__((packed)) s; + u64 u; +}; + +#define EDID_MFG_ID(c1, c2, c3) cpu_to_be16( \ + (c1 & 0x1f) << 10 | \ + (c2 & 0x1f) << 5 | \ + (c3 & 0x1f) \ + ) + +#define EDID_QUIRK_LIST_SIZE 24 + +union edid_quirk edid_quirk_list[EDID_QUIRK_LIST_SIZE] = { + /* Acer AL1706 */ - { "ACR", 44358, EDID_QUIRK_PREFER_LARGE_60 }, + { { { { EDID_MFG_ID('A', 'C', 'R'), cpu_to_le16(44358) } }, + EDID_QUIRK_PREFER_LARGE_60 } }, /* Acer F51 */ - { "API", 0x7602, EDID_QUIRK_PREFER_LARGE_60 }, + { { { { EDID_MFG_ID('A', 'P', 'I'), cpu_to_le16(0x7602) } }, + EDID_QUIRK_PREFER_LARGE_60 } }, /* Unknown Acer */ - { "ACR", 2423, EDID_QUIRK_FIRST_DETAILED_PREFERRED }, + { { { { EDID_MFG_ID('A', 'C', 'R'), cpu_to_le16(2423) } }, + EDID_QUIRK_FIRST_DETAILED_PREFERRED } }, /* Belinea 10 15 55 */ - { "MAX", 1516, EDID_QUIRK_PREFER_LARGE_60 }, - { "MAX", 0x77e, EDID_QUIRK_PREFER_LARGE_60 }, + { { { { EDID_MFG_ID('M', 'A', 'X'), cpu_to_le16(1516) } }, + EDID_QUIRK_PREFER_LARGE_60 } }, + { { { { EDID_MFG_ID('M', 'A', 'X'), cpu_to_le16(0x77e) } }, + EDID_QUIRK_PREFER_LARGE_60 } }, /* Envision Peripherals, Inc. EN-7100e */ - { "EPI", 59264, EDID_QUIRK_135_CLOCK_TOO_HIGH }, + { { { { EDID_MFG_ID('E', 'P', 'I'), cpu_to_le16(59264) } }, + EDID_QUIRK_135_CLOCK_TOO_HIGH } }, /* Envision EN2028 */ - { "EPI", 8232, EDID_QUIRK_PREFER_LARGE_60 }, + { { { { EDID_MFG_ID('E', 'P', 'I'), cpu_to_le16(8232) } }, + EDID_QUIRK_PREFER_LARGE_60 } }, /* Funai Electronics PM36B */ - { "FCM", 13600, EDID_QUIRK_PREFER_LARGE_75 | - EDID_QUIRK_DETAILED_IN_CM }, + { { { { EDID_MFG_ID('F', 'C', 'M'), cpu_to_le16(13600) } }, + EDID_QUIRK_PREFER_LARGE_75 | EDID_QUIRK_DETAILED_IN_CM } }, /* LG Philips LCD LP154W01-A5 */ - { "LPL", 0, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE }, - { "LPL", 0x2a00, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE }, + { { { { EDID_MFG_ID('L', 'P', 'L'), cpu_to_le16(0) } }, + EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE } }, + { { { { EDID_MFG_ID('L', 'P', 'L'), cpu_to_le16(0x2a00) } }, + EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE } }, /* Philips 107p5 CRT */ - { "PHL", 57364, EDID_QUIRK_FIRST_DETAILED_PREFERRED }, + { { { { EDID_MFG_ID('P', 'H', 'L'), cpu_to_le16(57364) } }, + EDID_QUIRK_FIRST_DETAILED_PREFERRED } }, /* Proview AY765C */ - { "PTS", 765, EDID_QUIRK_FIRST_DETAILED_PREFERRED }, + { { { { EDID_MFG_ID('P', 'T', 'S'), cpu_to_le16(765) } }, + EDID_QUIRK_FIRST_DETAILED_PREFERRED } }, /* Samsung SyncMaster 205BW. Note: irony */ - { "SAM", 541, EDID_QUIRK_DETAILED_SYNC_PP }, + { { { { EDID_MFG_ID('S', 'A', 'M'), cpu_to_le16(541) } }, + EDID_QUIRK_DETAILED_SYNC_PP } }, /* Samsung SyncMaster 22[5-6]BW */ - { "SAM", 596, EDID_QUIRK_PREFER_LARGE_60 }, - { "SAM", 638, EDID_QUIRK_PREFER_LARGE_60 }, + { { { { EDID_MFG_ID('S', 'A', 'M'), cpu_to_le16(596) } }, + EDID_QUIRK_PREFER_LARGE_60 } }, + { { { { EDID_MFG_ID('S', 'A', 'M'), cpu_to_le16(638) } }, + EDID_QUIRK_PREFER_LARGE_60 } }, /* ViewSonic VA2026w */ - { "VSC", 5020, EDID_QUIRK_FORCE_REDUCED_BLANKING }, + { { { { EDID_MFG_ID('V', 'S', 'C'), cpu_to_le16(5020) } }, + EDID_QUIRK_FORCE_REDUCED_BLANKING } }, + + /* + * When adding built-in quirks, please adjust EDID_QUIRK_LIST_SIZE to + * provide some room for user-supplied quirks. + */ }; +DEFINE_MUTEX(edid_quirk_list_mutex); + +/** + * drm_edid_mfg_format - format an "encoded" EDID manufacturer ID for printing + * @mfg_id: the encoded manufacturer ID + * @buf: destination buffer for the formatted manufacturer ID (minimum 7 bytes) + * @strip: if non-zero, the returned pointer will skip any leading spaces + * + * An EDID manufacturer ID is supposed to consist of 3 capital letters (A-Z). + * Each letter is stored as a 5-bit value between 1 and 26, taking up 15 bits of + * the 16-bit ID. The remaining bit should always be 0. If display manufacturers + * always did things correctly, however, EDID quirks wouldn't be required in + * the first place. This function does the following: + * + * - Broken IDs are printed in hexadecimal (0xffff). + * - "Correct" IDs are formatted as a 3-letter ID string, preceded by 3 spaces; + * the spaces ensure that both output formats are the same length. + * + * Thus, a formatted manufacturer ID is always 6 characters long (not including + * the terminating 0). + * + * If @strip is 0, or the manufacturer ID has been formatted as a hexadecimal + * number, @buf is returned. If @strip is non-zero, and the manufacturer ID has + * been formatted as a 3-letter string, a pointer to the first non-space + * character (@buf + 3) is returned. + */ +static const char *drm_edid_mfg_format(__be16 mfg_id, char *buf, int strip) +{ + u16 id = be16_to_cpu(mfg_id); + + if (id & 0x8000) + goto bad_id; + + buf[3] = ((id & 0x7c00) >> 10) + '@'; + if (!isupper(buf[3])) + goto bad_id; + + buf[4] = ((id & 0x03e0) >> 5) + '@'; + if (!isupper(buf[4])) + goto bad_id; + + buf[5] = (id & 0x001f) + '@'; + if (!isupper(buf[5])) + goto bad_id; + + memset(buf, ' ', 3); + buf[6] = 0; + + return strip ? (buf + 3) : buf; + +bad_id: + sprintf(buf, "0x%04hx", id); + return buf; +} + +#define EDID_MFG_BUF_SIZE 7 + +/** + * drm_edid_display_id_format - format an EDID "display ID" (manufacturer ID + * and product code) for printing + * @display_id: the display ID + * @buf: destination buffer for the formatted display ID (minimum 14 bytes) + * @strip: if non-zero, the returned pointer will skip any leading spaces + * + * A formatted display ID is always 13 characters long (not including the + * terminating 0). + * + * If @strip is 0, or the manufacturer ID has been formatted as a hexadecimal + * number, @buf is returned. If @strip is non-zero, and the manufacturer ID has + * been formatted as a 3-letter string, a pointer to the first non-space + * character (@buf + 3) is returned. + */ +static const char *drm_edid_display_id_format(union edid_display_id display_id, + char *buf, int strip) +{ + const char *s; + + s = drm_edid_mfg_format(display_id.s.mfg_id, buf, strip); + sprintf(buf + EDID_MFG_BUF_SIZE - 1, ":0x%04hx", + le16_to_cpu(display_id.s.prod_code)); + + return s; +} + +#define EDID_DISPLAY_ID_BUF_SIZE (EDID_MFG_BUF_SIZE + 7) + +/** + * drm_edid_quirk_format - format an EDID quirk for printing + * @quirk: the quirk + * @buf: destination buffer for the formatted quirk (minimum 25 bytes) + * @strip: if non-zero, the returned pointer will skip any leading spaces + * + * A formatted EDID quirk is always 24 characters long (not including the + * terminating 0). + * + * If @strip is 0, or the manufacturer ID has been formatted as a hexadecimal + * number, @buf is returned. If @strip is non-zero, and the manufacturer ID has + * been formatted as a 3-letter string, a pointer to the first non-space + * character (@buf + 3) is returned. + */ +static const char *drm_edid_quirk_format(const union edid_quirk *quirk, + char *buf, int strip) +{ + const char *s; + + s = drm_edid_display_id_format(quirk->s.display_id, buf, strip); + sprintf(buf + EDID_DISPLAY_ID_BUF_SIZE - 1, ":0x%08x", quirk->s.quirks); + + return s; +} + +#define EDID_QUIRK_BUF_SIZE (EDID_DISPLAY_ID_BUF_SIZE + 11) + +/** + * drm_edid_quirk_parse - parse an EDID quirk + * @s: string containing the quirk to be parsed + * @quirk: destination for parsed quirk + * + * Returns 0 on success, < 0 (currently -EINVAL) on error. + */ +static int drm_edid_quirk_parse(const char *s, union edid_quirk *quirk) +{ + char buf[EDID_QUIRK_BUF_SIZE]; + s32 mfg; + s32 product; + s64 quirks; + char *c; + + if (sscanf(s, "%i:%i:%lli", &mfg, &product, &quirks) == 3) { + if (mfg < 0 || mfg > 0xffff) + goto error; + quirk->s.display_id.s.mfg_id = cpu_to_be16((u16)mfg); + } else { + if (sscanf(s, "%3s:%i:%lli", buf, &product, &quirks) != 3 || + !isupper(buf[0]) || + !isupper(buf[1]) || + !isupper(buf[2])) + goto error; + quirk->s.display_id.s.mfg_id = + EDID_MFG_ID(buf[0], buf[1], buf[2]); + } + + if (product < 0 || product > 0xffff || + quirks < 0 || quirks > 0xffffffffLL) + goto error; + + quirk->s.display_id.s.prod_code = cpu_to_le16((u16)product); + quirk->s.quirks = (u32)quirks; + + DRM_DEBUG("Successfully parsed EDID quirk: %s\n", + drm_edid_quirk_format(quirk, buf, 1)); + + return 0; + +error: + c = strpbrk(s, ",\n"); + if (c == NULL) { + printk(KERN_WARNING "Invalid EDID quirk: '%s'\n", s); + } else { + printk(KERN_WARNING "Invalid EDID quirk: '%.*s'\n", + (int)(c - s), s); + } + + return -EINVAL; +} + +/** + * drm_edid_quirk_find_by_id - find the EDID quirk matching a display ID + * @display_id: the display ID to match + * + * Caller MUST hold edid_quirk_list_mutex. + * + * Returns a pointer to the matching quirk list entry, NULL if no such entry + * exists. + */ +static union edid_quirk *drm_edid_quirk_find_by_id(union edid_display_id id) +{ + union edid_quirk *q = edid_quirk_list; + + do { + if (q->s.display_id.u == id.u && q->s.quirks != 0) + return q; + } while (++q < edid_quirk_list + ARRAY_SIZE(edid_quirk_list)); + + return NULL; +} + +/** + * drm_edid_quirk_find_slot - find an empty slot in the EDID quirk list + * + * Caller MUST hold edid_quirk_list_mutex. + * + * Returns a pointer to the first empty slot, NULL if no empty slots exist. + */ +static union edid_quirk *drm_edid_quirk_find_empty(void) +{ + union edid_quirk *q = edid_quirk_list; + + do { + if (q->s.quirks == 0) + return q; + } while (++q < edid_quirk_list + ARRAY_SIZE(edid_quirk_list)); + + return NULL; +} + +/** + * drm_edid_quirk_process - process a newly parsed EDID quirk + * @quirk: the quirk to be processed + * + * Depending on the newly parsed quirk and the contents of the quirks list, this + * function will add, remove, or replace a quirk. + * + * Returns 0 on success, < 0 on error (-ENOSPC if there is no free slot for a + * new quirk). Note that trying to remove a quirk that isn't present is not + * considered an error. + */ +static int drm_edid_quirk_process(const union edid_quirk *quirk) +{ + char buf[EDID_QUIRK_BUF_SIZE]; + union edid_quirk *q; + int res = 0; + + mutex_lock(&edid_quirk_list_mutex); + + if (quirk->s.quirks == 0) { + DRM_INFO("Removing EDID quirk for display %s\n", + drm_edid_display_id_format(quirk->s.display_id, + buf, 1)); + q = drm_edid_quirk_find_by_id(quirk->s.display_id); + if (q == NULL) { + printk(KERN_WARNING "No quirk found for display %s\n", + drm_edid_display_id_format(quirk->s.display_id, + buf, 1)); + } else { + q->u = 0; + } + } else { + DRM_INFO("Adding EDID quirk: %s\n", + drm_edid_quirk_format(quirk, buf, 1)); + q = drm_edid_quirk_find_by_id(quirk->s.display_id); + if (q == NULL) { + q = drm_edid_quirk_find_empty(); + if (q == NULL) { + printk(KERN_WARNING + "No free slot in EDID quirk list\n"); + res = -ENOSPC; + } else { + q->u = quirk->u; + } + } else { + DRM_INFO("Replacing existing quirk: %s\n", + drm_edid_quirk_format(q, buf, 1)); + q->s.quirks = quirk->s.quirks; + } + } + + mutex_unlock(&edid_quirk_list_mutex); + + return res; +} + +/** + * drm_edid_quirks_process - parse and process a comma separated list of EDID + * quirks + * @s: string containing the quirks to be processed + * @strict: if non-zero, any parsing or processing error aborts further + * processing + * + * Returns 0 on success, < 0 if any error is encountered. (If multiple errors + * occur when strict is set to 0, the last error encountered is returned.) + */ +static int drm_edid_quirks_process(const char *s, int strict) +{ + union edid_quirk quirk; + int res = 0; + + do { + + if (*s == '@') { + DRM_INFO("Clearing EDID quirk list\n"); + mutex_lock(&edid_quirk_list_mutex); + memset(edid_quirk_list, 0, sizeof edid_quirk_list); + mutex_unlock(&edid_quirk_list_mutex); + } else { + res = drm_edid_quirk_parse(s, &quirk); + if (res != 0) { + if (strict) + goto error; + continue; + } + + res = drm_edid_quirk_process(&quirk); + if (res != 0) { + if (strict) + goto error; + } + } + + s = strpbrk(s, ",\n"); + + } while (s != NULL && *(++s) != 0); + + return res; + +error: + printk(KERN_WARNING "Aborting EDID quirk parsing\n"); + return res; +} + +/** + * drm_edid_quirks_param_process - process the edid_quirks module parameter + */ +void drm_edid_quirks_param_process(void) +{ + if (drm_edid_quirks != NULL) + drm_edid_quirks_process(drm_edid_quirks, 0); +} + +/** + * drm_edid_quirks_size_show - show the size of the EDID quirk list in sysfs + * @buf: destination buffer (PAGE_SIZE bytes) + */ +ssize_t drm_edid_quirks_size_show(struct class *class, + struct class_attribute *attr, char *buf) +{ + return sprintf(buf, "%zu\n", ARRAY_SIZE(edid_quirk_list)); +} + +/** + * drm_edid_quirks_show - show the contents of the EDID quirk list in sysfs + * @buf: destination buffer (PAGE_SIZE bytes) + */ +ssize_t drm_edid_quirks_show(struct class *class, struct class_attribute *attr, + char *buf) +{ + const union edid_quirk *q = edid_quirk_list; + ssize_t count = 0; + + BUILD_BUG_ON(ARRAY_SIZE(edid_quirk_list) > + PAGE_SIZE / EDID_QUIRK_BUF_SIZE); + + mutex_lock(&edid_quirk_list_mutex); + + do { + if (q->s.quirks != 0) { + drm_edid_quirk_format(q, buf + count, 0); + (buf + count)[EDID_QUIRK_BUF_SIZE - 1] = '\n'; + count += EDID_QUIRK_BUF_SIZE; + } + } while (++q < edid_quirk_list + ARRAY_SIZE(edid_quirk_list)); + + mutex_unlock(&edid_quirk_list_mutex); + + return count; +} + +/** + * drm_edid_quirks_store - parse and process EDID qurik list changes written + * to sysfs attribute + */ +ssize_t drm_edid_quirks_store(struct class *class, struct class_attribute *attr, + const char *buf, size_t count) +{ + int res; + + res = drm_edid_quirks_process(buf, 1); + if (res != 0) + return res; + + return count; +} + /*** DDC fetch and block validation ***/ static const u8 edid_header[] = { @@ -409,25 +817,6 @@ EXPORT_SYMBOL(drm_get_edid); /*** EDID parsing ***/ /** - * edid_vendor - match a string against EDID's obfuscated vendor field - * @edid: EDID to match - * @vendor: vendor string - * - * Returns true if @vendor is in @edid, false otherwise - */ -static bool edid_vendor(struct edid *edid, char *vendor) -{ - char edid_vendor[3]; - - edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@'; - edid_vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) | - ((edid->mfg_id[1] & 0xe0) >> 5)) + '@'; - edid_vendor[2] = (edid->mfg_id[1] & 0x1f) + '@'; - - return !strncmp(edid_vendor, vendor, 3); -} - -/** * edid_get_quirks - return quirk flags for a given EDID * @edid: EDID to process * @@ -435,18 +824,18 @@ static bool edid_vendor(struct edid *edid, char *vendor) */ static u32 edid_get_quirks(struct edid *edid) { - struct edid_quirk *quirk; - int i; + union edid_quirk *q; + u32 quirks = 0; - for (i = 0; i < ARRAY_SIZE(edid_quirk_list); i++) { - quirk = &edid_quirk_list[i]; + mutex_lock(&edid_quirk_list_mutex); - if (edid_vendor(edid, quirk->vendor) && - (EDID_PRODUCT_ID(edid) == quirk->product_id)) - return quirk->quirks; - } + q = drm_edid_quirk_find_by_id(edid->display_id); + if (q != NULL) + quirks = q->s.quirks; - return 0; + mutex_unlock(&edid_quirk_list_mutex); + + return quirks; } #define MODE_SIZE(m) ((m)->hdisplay * (m)->vdisplay) @@ -1162,7 +1551,7 @@ do_inferred_modes(struct detailed_timing *timing, void *c) closure->modes += drm_dmt_modes_for_range(closure->connector, closure->edid, timing); - + if (!version_greater(closure->edid, 1, 1)) return; /* GTF not defined yet */ @@ -1399,7 +1788,7 @@ do_cvt_mode(struct detailed_timing *timing, void *c) static int add_cvt_modes(struct drm_connector *connector, struct edid *edid) -{ +{ struct detailed_mode_closure closure = { connector, edid, 0, 0, 0 }; @@ -1615,15 +2004,12 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) eld[0] = 2 << 3; /* ELD version: 2 */ - eld[16] = edid->mfg_id[0]; - eld[17] = edid->mfg_id[1]; - eld[18] = edid->prod_code[0]; - eld[19] = edid->prod_code[1]; + *(u32 *)(&eld[16]) = edid->display_id.u; if (cea[1] >= 3) for (db = cea + 4; db < cea + cea[2]; db += dbl + 1) { dbl = db[0] & 0x1f; - + switch ((db[0] & 0xe0) >> 5) { case AUDIO_BLOCK: /* Audio Data Block, contains SADs */ diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 21bcd4a..b939d51 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -46,16 +46,22 @@ EXPORT_SYMBOL(drm_vblank_offdelay); unsigned int drm_timestamp_precision = 20; /* Default to 20 usecs. */ EXPORT_SYMBOL(drm_timestamp_precision); +char *drm_edid_quirks = NULL; +EXPORT_SYMBOL(drm_edid_quirks); + MODULE_AUTHOR(CORE_AUTHOR); MODULE_DESCRIPTION(CORE_DESC); MODULE_LICENSE("GPL and additional rights"); MODULE_PARM_DESC(debug, "Enable debug output"); MODULE_PARM_DESC(vblankoffdelay, "Delay until vblank irq auto-disable [msecs]"); MODULE_PARM_DESC(timestamp_precision_usec, "Max. error on timestamps [usecs]"); +MODULE_PARM_DESC(edid_quirks, "MFG:prod:flags[,MFG:prod:flags[...]]\n" + "(See Documentation/EDID/edid_quirks.txt)"); module_param_named(debug, drm_debug, int, 0600); module_param_named(vblankoffdelay, drm_vblank_offdelay, int, 0600); module_param_named(timestamp_precision_usec, drm_timestamp_precision, int, 0600); +module_param_named(edid_quirks, drm_edid_quirks, charp, 0400); struct idr drm_minors_idr; diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 45ac8d6..84dc365 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -84,6 +84,11 @@ static CLASS_ATTR_STRING(version, S_IRUGO, __stringify(CORE_PATCHLEVEL) " " CORE_DATE); +static CLASS_ATTR(edid_quirks_size, 0400, drm_edid_quirks_size_show, 0); + +static CLASS_ATTR(edid_quirks, 0600, drm_edid_quirks_show, + drm_edid_quirks_store); + /** * drm_sysfs_create - create a struct drm_sysfs_class structure * @owner: pointer to the module that is to "own" this struct drm_sysfs_class @@ -113,10 +118,22 @@ struct class *drm_sysfs_create(struct module *owner, char *name) if (err) goto err_out_class; + err = class_create_file(class, &class_attr_edid_quirks_size); + if (err) + goto err_out_version; + + err = class_create_file(class, &class_attr_edid_quirks); + if (err) + goto err_out_quirks_size; + class->devnode = drm_devnode; return class; +err_out_quirks_size: + class_remove_file(class, &class_attr_edid_quirks_size); +err_out_version: + class_remove_file(class, &class_attr_version.attr); err_out_class: class_destroy(class); err_out: @@ -132,6 +149,8 @@ void drm_sysfs_destroy(void) { if ((drm_class == NULL) || (IS_ERR(drm_class))) return; + class_remove_file(drm_class, &class_attr_edid_quirks); + class_remove_file(drm_class, &class_attr_edid_quirks_size); class_remove_file(drm_class, &class_attr_version.attr); class_destroy(drm_class); drm_class = NULL; diff --git a/include/drm/drmP.h b/include/drm/drmP.h index d6b67bb..c947f3e 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1501,6 +1501,7 @@ extern unsigned int drm_debug; extern unsigned int drm_vblank_offdelay; extern unsigned int drm_timestamp_precision; +extern char *drm_edid_quirks; extern struct class *drm_class; extern struct proc_dir_entry *drm_proc_root; @@ -1612,6 +1613,15 @@ void drm_gem_vm_open(struct vm_area_struct *vma); void drm_gem_vm_close(struct vm_area_struct *vma); int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); + /* EDID support (drm_edid.c) */ +void drm_edid_quirks_param_process(void); +ssize_t drm_edid_quirks_size_show(struct class *class, + struct class_attribute *attr, char *buf); +ssize_t drm_edid_quirks_show(struct class *class, struct class_attribute *attr, + char *buf); +ssize_t drm_edid_quirks_store(struct class *class, struct class_attribute *attr, + const char *buf, size_t count); + #include "drm_global.h" static inline void diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 0cac551..713229b 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -202,11 +202,18 @@ struct detailed_timing { #define DRM_EDID_FEATURE_PM_SUSPEND (1 << 6) #define DRM_EDID_FEATURE_PM_STANDBY (1 << 7) +union edid_display_id { + struct { + __be16 mfg_id; + __le16 prod_code; + } __attribute__((packed)) s; + u32 u; +}; + struct edid { u8 header[8]; /* Vendor & product info */ - u8 mfg_id[2]; - u8 prod_code[2]; + union edid_display_id display_id; u32 serial; /* FIXME: byte order */ u8 mfg_week; u8 mfg_year; @@ -242,8 +249,6 @@ struct edid { u8 checksum; } __attribute__((packed)); -#define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8)) - struct drm_encoder; struct drm_connector; struct drm_display_mode; From patchwork Sun Aug 12 20:07:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Pilcher X-Patchwork-Id: 1310081 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 73C76DF280 for ; Sun, 12 Aug 2012 20:10:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 698349F588 for ; Sun, 12 Aug 2012 13:10:14 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by gabe.freedesktop.org (Postfix) with ESMTP id A98B79E83C for ; Sun, 12 Aug 2012 13:08:12 -0700 (PDT) Received: by obbta17 with SMTP id ta17so5915621obb.36 for ; Sun, 12 Aug 2012 13:08:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=gzfDhDIWfkjRCJ6Ra42qZvtFedK7AcGPZf7Xmb8E7Cg=; b=aeQjjB8LTOMdnDIvObRiM6lMf7DkOMAFmP8n2X8Q3lRrsANFlBqxFkwjSQ6uXBF00g edaknwKAAXq7DNWKfRZSoyX3FCbfcEMDYfL/XLhJFPb7tN1UvfRFBUGgraYzGhJxWh4d 4GXl5Riqf+AOT7WS+Q/csb6AR86hm2ObpNH6JVW7QddbxBW0AjAWZLWWw8QTZ/cY8uJm aTr3Rx+3razChOR2Ii884rnhFHc2ea0A/sP9GkSZ5HV7lTetXHUHXqx976aatH6I1xW2 5W8xeCaKzueV/gxCd1oJVYFMXOKDGBslmK4VhPM2uEetLZbruJZuHGqsAYPH4eRr4Rnt z5ZA== Received: by 10.182.111.74 with SMTP id ig10mr7794070obb.14.1344802092225; Sun, 12 Aug 2012 13:08:12 -0700 (PDT) Received: from ian.icp.selfip.net (pool-71-170-109-80.dllstx.fios.verizon.net. [71.170.109.80]) by mx.google.com with ESMTPS id k8sm3266152oeh.9.2012.08.12.13.08.11 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 12 Aug 2012 13:08:11 -0700 (PDT) From: Ian Pilcher To: dri-devel@lists.freedesktop.org Subject: [PATCH v4 2/3] drm: Add EDID quirks to disable HDMI audio and InfoFrames Date: Sun, 12 Aug 2012 15:07:59 -0500 Message-Id: <1344802080-9575-3-git-send-email-arequipeno@gmail.com> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1344802080-9575-1-git-send-email-arequipeno@gmail.com> References: <1344754732.4980.5.camel@mattotaupa> <1344802080-9575-1-git-send-email-arequipeno@gmail.com> Cc: Ian Pilcher , paulepanter@users.sourceforge.net X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Add 2 new EDID quirk flags: - EDID_QUIRK_DISABLE_INFOFRAMES turns off all HDMI-specific functionality (audio, HDCP, etc.). Intended for displays that are confused by *any* InfoFrames. - EDID_QUIRK_NO_AUDIO disables HDMI audio. Intended for displays that incorrectely report audio capabilities in their EDID data. Signed-off-by: Ian Pilcher Acked-by: Paul Menzel --- drivers/gpu/drm/drm_edid.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index ea535f6..61586b4 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; @@ -2109,6 +2113,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 +2169,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) From patchwork Sun Aug 12 20:08:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Pilcher X-Patchwork-Id: 1310091 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id B78C6DF280 for ; Sun, 12 Aug 2012 20:11:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9E1CD9F620 for ; Sun, 12 Aug 2012 13:11:01 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 212FA9E83C for ; Sun, 12 Aug 2012 13:08:13 -0700 (PDT) Received: by mail-ob0-f177.google.com with SMTP id ta17so5915609obb.36 for ; Sun, 12 Aug 2012 13:08:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=qlAEIt3mSbEpS3yApjJMa3Nb5dtqXSzaFpzSH7/Alug=; b=Jo2549OpZ1pWZOSK+cqzUvexoH6SRKuhRjCBjCnhiI/5ei/iVLeJp41xxswrykzJbS AJZQ00z8uh6++qJE69sz5Jsj5txPmYU4TcU5ZuOwUtLYS5/q8XM1QaazsKoQMtZ73Y5W wcZ9EM8ug5BC58qoeOx8cWsmOzKyC+ENx1DKsCggbaaMp8eNheBKkxG8csCHxn1XEX/6 81cckl4UdRny5ia56OyfaX6c3yNXBurzc9gvdpMPVxPA36r1Xb6UC1XI3ooxzO8VEz9P uHANojxsQAKbNkf+5rqyE1nAWx9ftoYRaPnYYKRz1vqeklliaBYomHv5x7S9ZSeCWxLD gUEw== Received: by 10.182.131.98 with SMTP id ol2mr7779424obb.69.1344802092835; Sun, 12 Aug 2012 13:08:12 -0700 (PDT) Received: from ian.icp.selfip.net (pool-71-170-109-80.dllstx.fios.verizon.net. [71.170.109.80]) by mx.google.com with ESMTPS id k8sm3266152oeh.9.2012.08.12.13.08.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 12 Aug 2012 13:08:12 -0700 (PDT) From: Ian Pilcher To: dri-devel@lists.freedesktop.org Subject: [PATCH v4 3/3] drm: Add EDID quirk for LG L246WP Date: Sun, 12 Aug 2012 15:08:00 -0500 Message-Id: <1344802080-9575-4-git-send-email-arequipeno@gmail.com> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1344802080-9575-1-git-send-email-arequipeno@gmail.com> References: <1344754732.4980.5.camel@mattotaupa> <1344802080-9575-1-git-send-email-arequipeno@gmail.com> Cc: Ian Pilcher , paulepanter@users.sourceforge.net X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org This display is apparently confused by any InfoFrames (see https://bugzilla.redhat.com/show_bug.cgi?id=806091). Tested on a ThinkPad T510 (nVidia GT218 [NVS 3100M]) and a co- workers ThinkPad X220 with Intel graphics. EDID_QUIRK_NO_AUDIO makes this display work with the Intel driver; nouveau requires EDID_QUIRK_DISABLE_INFOFRAMES. Signed-off-by: Ian Pilcher Acked-by: Paul Menzel --- drivers/gpu/drm/drm_edid.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 61586b4..1f50e09 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -160,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. From patchwork Wed Aug 15 14:31:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Menzel X-Patchwork-Id: 1325871 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 577CF3FD8C for ; Wed, 15 Aug 2012 14:31:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 181C29F4BA for ; Wed, 15 Aug 2012 07:31:32 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.gw90.de (mail.gw90.de [188.40.100.199]) by gabe.freedesktop.org (Postfix) with ESMTP id A52819E925 for ; Wed, 15 Aug 2012 07:31:17 -0700 (PDT) Received: from e178248075.adsl.alicedsl.de ([85.178.248.75] helo=[192.168.178.20]) by mail.gw90.de with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1T1ect-0001vZ-1e; Wed, 15 Aug 2012 14:31:15 +0000 Message-ID: <1345041067.4264.16.camel@mattotaupa> Subject: [PATCH] drm: Add EDID_QUIRK_FORCE_REDUCED_BLANKING for Philips 32PFL5404H From: Paul Menzel To: dri-devel@lists.freedesktop.org Date: Wed, 15 Aug 2012 16:31:07 +0200 X-Mailer: Evolution 3.2.2-1+b1 Mime-Version: 1.0 Cc: Ian Pilcher , stable@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Date: Wed, 8 Aug 2012 23:12:19 +0200 < ajax> i would preface this whole discussion with the observation that all tvs are garbage Connecting the Philips 32PFL5404H [1] a garbled screen is shown with vertical stripes in the top half. As written in the referenced Bugzilla #26294 report I am pretty sure this worked sometime before 2010. My guess is that EDID beforehand was interpreted incorrectly – as probably MS Windows does – which made it work. In commit bc42aabc [2] commit bc42aabc6a01b92b0f961d65671564e0e1cd7592 Author: Adam Jackson Date: Wed May 23 16:26:54 2012 -0400 drm/edid/quirks: ViewSonic VA2026w Adam Jackson added the quirk `EDID_QUIRK_FORCE_REDUCED_BLANKING` which is also needed for this Philips TV. The problem is that the Model number is set to zero. I hope this will not break other Philips TVs out there. All log files and output from `xrandr` is included in the referenced Bugzilla report #26294. [1] http://www.p4c.philips.com/cgi-bin/dcbint/cpindex.pl?ctn=32PFL5404H/12&scy=DE&slg=de [2] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=bc42aabc6a01b92b0f961d65671564e0e1cd7592 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=26294 Tested-by: Paul Menzel (ASUS Eee PC 701 4G with Debian Sid/unstable connected over VGA) Signed-off-by: Paul Menzel Cc: Cc: Adam Jackson Cc: Ian Pilcher Cc: --- Ian, I did not base this patch on your series, to make it easier to get back ported. I can easily rebase it though, so hopefully some maintainer can tell me what to do. I also do not know if URLs in the quirk comments are considered useful or not. --- drivers/gpu/drm/drm_edid.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index a8743c3..eb452e6 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -111,6 +111,11 @@ static struct edid_quirk { { "LPL", 0, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE }, { "LPL", 0x2a00, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE }, + /* Philips 32PFL5404H TV */ + /* http://www.p4c.philips.com/cgi-bin/dcbint/cpindex.pl?ctn=32PFL5404H/12&scy=DE&slg=de */ + /* https://bugs.freedesktop.org/show_bug.cgi?id=26294 */ + { "PHL", 0, EDID_QUIRK_FORCE_REDUCED_BLANKING }, + /* Philips 107p5 CRT */ { "PHL", 57364, EDID_QUIRK_FIRST_DETAILED_PREFERRED }, From patchwork Wed Aug 15 15:18:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Menzel X-Patchwork-Id: 1326001 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id CAEE03FC66 for ; Wed, 15 Aug 2012 15:18:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FE609F50E for ; Wed, 15 Aug 2012 08:18:27 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.gw90.de (mail.gw90.de [188.40.100.199]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A7579E812 for ; Wed, 15 Aug 2012 08:18:17 -0700 (PDT) Received: from e178248075.adsl.alicedsl.de ([85.178.248.75] helo=[192.168.178.20]) by mail.gw90.de with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1T1fML-0002B1-Uo; Wed, 15 Aug 2012 15:18:14 +0000 Message-ID: <1345043886.4264.19.camel@mattotaupa> Subject: [PATCH] drm: Add EDID_QUIRK_FORCE_REDUCED_BLANKING for LG SL80 From: Paul Menzel To: dri-devel@lists.freedesktop.org Date: Wed, 15 Aug 2012 17:18:06 +0200 X-Mailer: Evolution 3.2.2-1+b1 Mime-Version: 1.0 Cc: Ian Pilcher , stable@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Date: Wed Aug 15 17:10:51 2012 +0200 Connecting a LG SL80 [1] a garbled screen is shown with vertical stripes in the top half. In commit bc42aabc [2] commit bc42aabc6a01b92b0f961d65671564e0e1cd7592 Author: Adam Jackson Date: Wed May 23 16:26:54 2012 -0400 drm/edid/quirks: ViewSonic VA2026w Adam Jackson added the quirk `EDID_QUIRK_FORCE_REDUCED_BLANKING` which is also needed for this LG TV. All log files and output from `xrandr` is included in the referenced Bugzilla report #53544. [1] http://www.lg.com/de/tv-heimkino-blu-ray/tv/LG-lcd-tv-42SL8000.jsp [2] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=bc42aabc6a01b92b0f961d65671564e0e1cd7592 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53544 Signed-off-by: Paul Menzel Cc: Cc: Adam Jackson Cc: Ian Pilcher Cc: --- Same as in previous patch: Ian, I did not base this patch on your series, to make it easier to get back ported. I can easily rebase it though, so hopefully some maintainer can tell me what to do. --- drivers/gpu/drm/drm_edid.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index eb452e6..75e252e 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -94,6 +94,9 @@ static struct edid_quirk { /* Unknown Acer */ { "ACR", 2423, EDID_QUIRK_FIRST_DETAILED_PREFERRED }, + /* LG SL80 */ + { "GSM", 1, EDID_QUIRK_FORCE_REDUCED_BLANKING }, + /* Belinea 10 15 55 */ { "MAX", 1516, EDID_QUIRK_PREFER_LARGE_60 }, { "MAX", 0x77e, EDID_QUIRK_PREFER_LARGE_60 }, From patchwork Wed Aug 15 15:40:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Menzel X-Patchwork-Id: 1326171 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 70699DFFED for ; Wed, 15 Aug 2012 15:44:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 33784A0A2D for ; Wed, 15 Aug 2012 08:44:37 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.gw90.de (mail.gw90.de [188.40.100.199]) by gabe.freedesktop.org (Postfix) with ESMTP id 77FCC9F572 for ; Wed, 15 Aug 2012 08:40:50 -0700 (PDT) Received: from e178248075.adsl.alicedsl.de ([85.178.248.75] helo=[192.168.178.20]) by mail.gw90.de with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1T1fiB-0002Hq-QC; Wed, 15 Aug 2012 15:40:48 +0000 Message-ID: <1345045240.4264.21.camel@mattotaupa> Subject: [PATCH] drm: Add EDID_QUIRK_FORCE_REDUCED_BLANKING for ASUS VW222S From: Paul Menzel To: dri-devel@lists.freedesktop.org Date: Wed, 15 Aug 2012 17:40:40 +0200 X-Mailer: Evolution 3.2.2-1+b1 Mime-Version: 1.0 Cc: Ian Pilcher , stable@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Date: Wed, 8 Aug 2012 23:12:19 +0200 Connecting an ASUS VW222S [1] over VGA a garbled screen is shown with vertical stripes in the top half. In commit bc42aabc [2] commit bc42aabc6a01b92b0f961d65671564e0e1cd7592 Author: Adam Jackson Date: Wed May 23 16:26:54 2012 -0400 drm/edid/quirks: ViewSonic VA2026w Adam Jackson added the quirk `EDID_QUIRK_FORCE_REDUCED_BLANKING` which is also needed for this ASUS monitor. All log files and output from `xrandr` is included in the referenced Bugzilla report #17629. [1] http://www.asus.com/Display/LCD_Monitors/VW222S/ [2] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=bc42aabc6a01b92b0f961d65671564e0e1cd7592 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=17629 Signed-off-by: Paul Menzel Cc: Cc: Adam Jackson Cc: Ian Pilcher Cc: --- Same comment as in previous patch. Ian, I did not base this patch on your series, to make it easier to get back ported. I can easily rebase it though, so hopefully some maintainer can tell me what to do. --- drivers/gpu/drm/drm_edid.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 75e252e..102346d 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -87,6 +87,9 @@ static struct edid_quirk { int product_id; u32 quirks; } edid_quirk_list[] = { + /* ASUS VW222S */ + { "ACI", 22a2, EDID_QUIRK_FORCE_REDUCED_BLANKING }, + /* Acer AL1706 */ { "ACR", 44358, EDID_QUIRK_PREFER_LARGE_60 }, /* Acer F51 */ From patchwork Fri Aug 10 22:52:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 1311661 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id B784B3FC71 for ; Mon, 13 Aug 2012 10:12:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 043569F0F8 for ; Mon, 13 Aug 2012 03:12:37 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [78.32.30.218]) by gabe.freedesktop.org (Postfix) with ESMTP id C74609E73D for ; Fri, 10 Aug 2012 15:52:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=d+ex18HkyJIfddD4g4uQBetQCOIlYj/t3whgqyZBpQ4=; b=oN51uGZTffUfT1cFpshpVfFwjf5vwTWoeYwuyoRyv1TdXbIdb+IHquKJiNghJY4tQcPaaanxpRmrIz71PYnBqZ60CbN/0SSn9wArBCJbvXYXZJi8ZYRJOeudc0zuDg5rMbpiq6AJcjaLavtd0vm9dgjUnpNV40RK89U9KfvFYxI=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:54475) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1Szy44-0000FX-8G for dri-devel@lists.freedesktop.org; Fri, 10 Aug 2012 23:52:20 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1Szy43-0003cf-Aj for dri-devel@lists.freedesktop.org; Fri, 10 Aug 2012 23:52:19 +0100 Date: Fri, 10 Aug 2012 23:52:18 +0100 From: Russell King - ARM Linux To: dri-devel@lists.freedesktop.org Subject: [PATCH] Consistently name interlaced modes Message-ID: <20120810225218.GA10243@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Mailman-Approved-At: Mon, 13 Aug 2012 03:12:12 -0700 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org At the moment, there is an inconsistency in the way modes are named. Modes with timings parsed from the EDID information will call drm_mode_set_name(), which will name the mode using this form: x eg, 1920x1080i for an interlaced mode, or 1920x1080 for a progressive mode. However, timings parsed using the tables in drm_edid_modes.h do not have the 'i' suffix. You are left to deduce that they're interlaced from xrandr's output by the lower vertical refresh frequencies. This patch changes the interlaced mode names in drm_edid_modes.h to follow the style set by drm_mode_set_name(), which makes it clear in xrandr which modes are interlaced and which are not (as xrandr groups the refresh rates on a line according to the name field.) Signed-off-by: Russell King Reviewed-by: Alex Deucher --- drivers/gpu/drm/drm_edid_modes.h | 42 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/drm_edid_modes.h b/drivers/gpu/drm/drm_edid_modes.h index ff98a7e..57459b3 100644 --- a/drivers/gpu/drm/drm_edid_modes.h +++ b/drivers/gpu/drm/drm_edid_modes.h @@ -89,7 +89,7 @@ static const struct drm_display_mode drm_dmt_modes[] = { 976, 1088, 0, 480, 486, 494, 517, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 1024x768@43Hz, interlace */ - { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 44900, 1024, 1032, + { DRM_MODE("1024x768i", DRM_MODE_TYPE_DRIVER, 44900, 1024, 1032, 1208, 1264, 0, 768, 768, 772, 817, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_INTERLACE) }, @@ -395,7 +395,7 @@ static const struct drm_display_mode edid_est_modes[] = { { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 65000, 1024, 1048, 1184, 1344, 0, 768, 771, 777, 806, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 1024x768@60Hz */ - { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER,44900, 1024, 1032, + { DRM_MODE("1024x768i", DRM_MODE_TYPE_DRIVER,44900, 1024, 1032, 1208, 1264, 0, 768, 768, 776, 817, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_INTERLACE) }, /* 1024x768@43Hz */ { DRM_MODE("832x624", DRM_MODE_TYPE_DRIVER, 57284, 832, 864, @@ -506,17 +506,17 @@ static const struct drm_display_mode edid_cea_modes[] = { 1430, 1650, 0, 720, 725, 730, 750, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 5 - 1920x1080i@60Hz */ - { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008, + { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008, 2052, 2200, 0, 1080, 1084, 1094, 1125, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_INTERLACE) }, /* 6 - 1440x480i@60Hz */ - { DRM_MODE("1440x480", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1478, + { DRM_MODE("1440x480i", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK) }, /* 7 - 1440x480i@60Hz */ - { DRM_MODE("1440x480", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1478, + { DRM_MODE("1440x480i", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK) }, @@ -531,12 +531,12 @@ static const struct drm_display_mode edid_cea_modes[] = { DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_DBLCLK) }, /* 10 - 2880x480i@60Hz */ - { DRM_MODE("2880x480", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2956, + { DRM_MODE("2880x480i", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2956, 3204, 3432, 0, 480, 488, 494, 525, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE) }, /* 11 - 2880x480i@60Hz */ - { DRM_MODE("2880x480", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2956, + { DRM_MODE("2880x480i", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2956, 3204, 3432, 0, 480, 488, 494, 525, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE) }, @@ -573,17 +573,17 @@ static const struct drm_display_mode edid_cea_modes[] = { 1760, 1980, 0, 720, 725, 730, 750, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 20 - 1920x1080i@50Hz */ - { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448, + { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448, 2492, 2640, 0, 1080, 1084, 1094, 1125, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_INTERLACE) }, /* 21 - 1440x576i@50Hz */ - { DRM_MODE("1440x576", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1464, + { DRM_MODE("1440x576i", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1464, 1590, 1728, 0, 576, 580, 586, 625, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK) }, /* 22 - 1440x576i@50Hz */ - { DRM_MODE("1440x576", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1464, + { DRM_MODE("1440x576i", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1464, 1590, 1728, 0, 576, 580, 586, 625, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK) }, @@ -598,12 +598,12 @@ static const struct drm_display_mode edid_cea_modes[] = { DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_DBLCLK) }, /* 25 - 2880x576i@50Hz */ - { DRM_MODE("2880x576", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2928, + { DRM_MODE("2880x576i", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2928, 3180, 3456, 0, 576, 580, 586, 625, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE) }, /* 26 - 2880x576i@50Hz */ - { DRM_MODE("2880x576", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2928, + { DRM_MODE("2880x576i", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2928, 3180, 3456, 0, 576, 580, 586, 625, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE) }, @@ -656,12 +656,12 @@ static const struct drm_display_mode edid_cea_modes[] = { 3184, 3456, 0, 576, 581, 586, 625, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 39 - 1920x1080i@50Hz */ - { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 72000, 1920, 1952, + { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 72000, 1920, 1952, 2120, 2304, 0, 1080, 1126, 1136, 1250, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE) }, /* 40 - 1920x1080i@100Hz */ - { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448, + { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448, 2492, 2640, 0, 1080, 1084, 1094, 1125, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_INTERLACE) }, @@ -688,7 +688,7 @@ static const struct drm_display_mode edid_cea_modes[] = { DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_DBLCLK) }, /* 46 - 1920x1080i@120Hz */ - { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008, + { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008, 2052, 2200, 0, 1080, 1084, 1094, 1125, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_INTERLACE) }, @@ -705,12 +705,12 @@ static const struct drm_display_mode edid_cea_modes[] = { 798, 858, 0, 480, 489, 495, 525, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 50 - 1440x480i@120Hz */ - { DRM_MODE("1440x480", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1478, + { DRM_MODE("1440x480i", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK) }, /* 51 - 1440x480i@120Hz */ - { DRM_MODE("1440x480", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1478, + { DRM_MODE("1440x480i", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK) }, @@ -723,12 +723,12 @@ static const struct drm_display_mode edid_cea_modes[] = { 796, 864, 0, 576, 581, 586, 625, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 54 - 1440x576i@200Hz */ - { DRM_MODE("1440x576", DRM_MODE_TYPE_DRIVER, 108000, 1440, 1464, + { DRM_MODE("1440x576i", DRM_MODE_TYPE_DRIVER, 108000, 1440, 1464, 1590, 1728, 0, 576, 580, 586, 625, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK) }, /* 55 - 1440x576i@200Hz */ - { DRM_MODE("1440x576", DRM_MODE_TYPE_DRIVER, 108000, 1440, 1464, + { DRM_MODE("1440x576i", DRM_MODE_TYPE_DRIVER, 108000, 1440, 1464, 1590, 1728, 0, 576, 580, 586, 625, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK) }, @@ -741,12 +741,12 @@ static const struct drm_display_mode edid_cea_modes[] = { 798, 858, 0, 480, 489, 495, 525, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 58 - 1440x480i@240 */ - { DRM_MODE("1440x480", DRM_MODE_TYPE_DRIVER, 108000, 1440, 1478, + { DRM_MODE("1440x480i", DRM_MODE_TYPE_DRIVER, 108000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK) }, /* 59 - 1440x480i@240 */ - { DRM_MODE("1440x480", DRM_MODE_TYPE_DRIVER, 108000, 1440, 1478, + { DRM_MODE("1440x480i", DRM_MODE_TYPE_DRIVER, 108000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK) },