From: allen <allen.chen@ite.com.tw>
To: unlisted-recipients:; (no To-header on input)
Cc: Allen Chen <allen.chen@ite.com.tw>,
Pi-Hsun Shih <pihsun@chromium.org>,
Jau-Chih Tseng <Jau-Chih.Tseng@ite.com.tw>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>,
"open list:DRM DRIVERS" <dri-devel@lists.freedesktop.org>,
open list <linux-kernel@vger.kernel.org>
Subject: [PATCH v2] drm/edid: fixup EDID 1.4 judge reduced-blanking timings logic
Date: Thu, 12 Dec 2019 10:33:42 +0800 [thread overview]
Message-ID: <1576118022-4347-1-git-send-email-allen.chen@ite.com.tw> (raw)
According to VESA ENHANCED EXTENDED DISPLAY IDENTIFICATION DATA STANDARD
(Defines EDID Structure Version 1, Revision 4) page: 39
How to determine whether the monitor support RB timing or not?
EDID 1.4
First: read detailed timing descriptor and make sure byte 0 = 0x00,
byte 1 = 0x00, byte 2 = 0x00 and byte 3 = 0xFD
Second: read EDID bit 0 in feature support byte at address 18h = 1
and detailed timing descriptor byte 10 = 0x04
Third: if EDID bit 0 in feature support byte = 1 &&
detailed timing descriptor byte 10 = 0x04
then we can check byte 15, if bit 4 in byte 15 = 1 is support RB
if EDID bit 0 in feature support byte != 1 ||
detailed timing descriptor byte 10 != 0x04,
then byte 15 can not be used
The linux code is_rb function not follow the VESA's rule
Signed-off-by: Allen Chen <allen.chen@ite.com.tw>
Reported-by: kbuild test robot <lkp@intel.com>
---
drivers/gpu/drm/drm_edid.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index f5926bf..826ed78 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -2017,13 +2017,21 @@ struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
}
}
+static bool
+is_display_descriptor(const u8 *r, u8 tag)
+{
+ return (!r[0] && !r[1] && !r[2] && r[3] == tag) ? true : false;
+}
+
static void
is_rb(struct detailed_timing *t, void *data)
{
u8 *r = (u8 *)t;
- if (r[3] == EDID_DETAIL_MONITOR_RANGE)
- if (r[15] & 0x10)
- *(bool *)data = true;
+
+ if (is_display_descriptor(r, EDID_DETAIL_MONITOR_RANGE)) {
+ if (r[10] == BIT(2))
+ *(int *)data = !!(r[15] & 0x10);
+ }
}
/* EDID 1.4 defines this explicitly. For EDID 1.3, we guess, badly. */
@@ -2031,9 +2039,13 @@ struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
drm_monitor_supports_rb(struct edid *edid)
{
if (edid->revision >= 4) {
- bool ret = false;
- drm_for_each_detailed_block((u8 *)edid, is_rb, &ret);
- return ret;
+ if (edid->features & BIT(0)) {
+ int ret = -1;
+
+ drm_for_each_detailed_block((u8 *)edid, is_rb, &ret);
+ if (ret != -1)
+ return ret;
+ }
}
return ((edid->input & DRM_EDID_INPUT_DIGITAL) != 0);
--
1.9.1
reply other threads:[~2019-12-12 2:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1576118022-4347-1-git-send-email-allen.chen@ite.com.tw \
--to=allen.chen@ite.com.tw \
--cc=Jau-Chih.Tseng@ite.com.tw \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=maxime.ripard@bootlin.com \
--cc=pihsun@chromium.org \
--cc=sean@poorly.run \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®