summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_edid.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2020-01-24 23:02:26 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2020-02-15 00:37:42 +0300
commitf447dd1fa3f55497b16e6b5e6c7ac89aa8171fac (patch)
tree5e173fa9ba7a2e9638cd52406364d44dc8798c69 /drivers/gpu/drm/drm_edid.c
parenta7a131ac18a23d31f572cac4cd20581e56add932 (diff)
downloadlinux-f447dd1fa3f55497b16e6b5e6c7ac89aa8171fac.tar.xz
drm/edid: Introduce is_detailed_timing_descritor()
Let's introduce is_detailed_timing_descritor() as the opposite counterpart of is_display_descriptor(). Cc: Allen Chen <allen.chen@ite.com.tw> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200124200231.10517-3-ville.syrjala@linux.intel.com Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r--drivers/gpu/drm/drm_edid.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index e878b0c839a0..c0d4635c07d5 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -2218,6 +2218,11 @@ static bool is_display_descriptor(const u8 d[18], u8 tag)
d[2] == 0x00 && d[3] == tag;
}
+static bool is_detailed_timing_descriptor(const u8 d[18])
+{
+ return d[0] != 0x00 || d[1] != 0x00;
+}
+
typedef void detailed_cb(struct detailed_timing *timing, void *closure);
static void
@@ -3117,27 +3122,28 @@ do_detailed_mode(struct detailed_timing *timing, void *c)
struct detailed_mode_closure *closure = c;
struct drm_display_mode *newmode;
- if (timing->pixel_clock) {
- newmode = drm_mode_detailed(closure->connector->dev,
- closure->edid, timing,
- closure->quirks);
- if (!newmode)
- return;
+ if (!is_detailed_timing_descriptor((const u8 *)timing))
+ return;
+
+ newmode = drm_mode_detailed(closure->connector->dev,
+ closure->edid, timing,
+ closure->quirks);
+ if (!newmode)
+ return;
- if (closure->preferred)
- newmode->type |= DRM_MODE_TYPE_PREFERRED;
+ if (closure->preferred)
+ newmode->type |= DRM_MODE_TYPE_PREFERRED;
- /*
- * Detailed modes are limited to 10kHz pixel clock resolution,
- * so fix up anything that looks like CEA/HDMI mode, but the clock
- * is just slightly off.
- */
- fixup_detailed_cea_mode_clock(newmode);
+ /*
+ * Detailed modes are limited to 10kHz pixel clock resolution,
+ * so fix up anything that looks like CEA/HDMI mode, but the clock
+ * is just slightly off.
+ */
+ fixup_detailed_cea_mode_clock(newmode);
- drm_mode_probed_add(closure->connector, newmode);
- closure->modes++;
- closure->preferred = false;
- }
+ drm_mode_probed_add(closure->connector, newmode);
+ closure->modes++;
+ closure->preferred = false;
}
/*