summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_edid.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2022-09-27 19:00:04 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2022-10-05 00:18:11 +0200
commitf72f9529b0ba69d0d00563f54868c5efbf00e88d (patch)
treec4167ef4b7855ebe57378d870892162148f2bd0a /drivers/gpu/drm/drm_edid.c
parentdrm/edid: Use the correct formula for standard timings (diff)
downloadlinux-f72f9529b0ba69d0d00563f54868c5efbf00e88d.tar.xz
linux-f72f9529b0ba69d0d00563f54868c5efbf00e88d.zip
drm/edid: Unconfuse preferred timing stuff a bit
For EDID 1.4 the first detailed timing is always preferred, for older EDIDs there was a feature flag to indicate the same. While correct, the code setting that up is rather confusing. Restate it in a slightly more straightforward manner. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220927170006.27855-8-ville.syrjala@linux.intel.com
Diffstat (limited to '')
-rw-r--r--drivers/gpu/drm/drm_edid.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index fdf23dc95131..075ed4e7eae9 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3952,13 +3952,14 @@ static int add_detailed_modes(struct drm_connector *connector,
struct detailed_mode_closure closure = {
.connector = connector,
.drm_edid = drm_edid,
- .preferred = true,
.quirks = quirks,
};
- if (closure.preferred && !version_greater(drm_edid, 1, 3))
+ if (version_greater(drm_edid, 1, 3))
+ closure.preferred = true; /* first detailed timing is always preferred */
+ else
closure.preferred =
- (drm_edid->edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING);
+ drm_edid->edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING;
drm_for_each_detailed_block(drm_edid, do_detailed_mode, &closure);