diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2022-09-27 20:00:02 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2022-10-05 01:18:04 +0300 |
commit | 9ed15f91310ceb722aa346ea58831ae0478d8018 (patch) | |
tree | 83dcc83400238db1a0d1af2b772d48c619815e81 /drivers/gpu/drm/drm_edid.c | |
parent | 86101bb7e00401e060fa2eaaa141e40ccb379e18 (diff) | |
download | linux-9ed15f91310ceb722aa346ea58831ae0478d8018.tar.xz |
drm/edid: Use GTF2 for inferred modes
For some reason we only use the secondary GTF curve for the
standard timings. Use it for inferred modes as well.
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-6-ville.syrjala@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 03b3c8841254..28655eda515d 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3546,6 +3546,35 @@ static int drm_gtf_modes_for_range(struct drm_connector *connector, return modes; } +static int drm_gtf2_modes_for_range(struct drm_connector *connector, + const struct drm_edid *drm_edid, + const struct detailed_timing *timing) +{ + int i, modes = 0; + struct drm_display_mode *newmode; + struct drm_device *dev = connector->dev; + + for (i = 0; i < ARRAY_SIZE(extra_modes); i++) { + const struct minimode *m = &extra_modes[i]; + + newmode = drm_gtf2_mode(dev, drm_edid, m->w, m->h, m->r); + if (!newmode) + return modes; + + drm_mode_fixup_1366x768(newmode); + if (!mode_in_range(newmode, drm_edid, timing) || + !valid_inferred_mode(connector, newmode)) { + drm_mode_destroy(dev, newmode); + continue; + } + + drm_mode_probed_add(connector, newmode); + modes++; + } + + return modes; +} + static int drm_cvt_modes_for_range(struct drm_connector *connector, const struct drm_edid *drm_edid, const struct detailed_timing *timing) @@ -3594,7 +3623,11 @@ do_inferred_modes(const struct detailed_timing *timing, void *c) return; /* GTF not defined yet */ switch (range->flags) { - case DRM_EDID_SECONDARY_GTF_SUPPORT_FLAG: /* XXX could do more */ + case DRM_EDID_SECONDARY_GTF_SUPPORT_FLAG: + closure->modes += drm_gtf2_modes_for_range(closure->connector, + closure->drm_edid, + timing); + break; case DRM_EDID_DEFAULT_GTF_SUPPORT_FLAG: closure->modes += drm_gtf_modes_for_range(closure->connector, closure->drm_edid, |