diff options
author | Yaroslav Bolyukin | 2022-01-23 22:19:55 +0300 |
---|---|---|
committer | Jani Nikula | 2022-01-25 13:09:22 +0200 |
commit | 80ecb5d7c0f224218fdf956faec0ebe73d79f53d (patch) | |
tree | 741c42b83aa1b65095521381db77eb48477a485b | |
parent | a34b14a29d96db74876d2cbb466bbc2b73002f3d (diff) |
drm/edid: Support type 7 timings
Per VESA DisplayID Standard v2.0: Type VII Timing – Detailed Timing Data
Definitions were already provided as type I, but not used
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220123191955.57994-1-iam@lach.pw
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 5251925e3b92..a504542238ed 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5433,7 +5433,8 @@ out: } static struct drm_display_mode *drm_mode_displayid_detailed(struct drm_device *dev, - struct displayid_detailed_timings_1 *timings) + struct displayid_detailed_timings_1 *timings, + bool type_7) { struct drm_display_mode *mode; unsigned pixel_clock = (timings->pixel_clock[0] | @@ -5454,7 +5455,8 @@ static struct drm_display_mode *drm_mode_displayid_detailed(struct drm_device *d if (!mode) return NULL; - mode->clock = pixel_clock * 10; + /* resolution is kHz for type VII, and 10 kHz for type I */ + mode->clock = type_7 ? pixel_clock : pixel_clock * 10; mode->hdisplay = hactive; mode->hsync_start = mode->hdisplay + hsync; mode->hsync_end = mode->hsync_start + hsync_width; @@ -5485,6 +5487,7 @@ static int add_displayid_detailed_1_modes(struct drm_connector *connector, int num_timings; struct drm_display_mode *newmode; int num_modes = 0; + bool type_7 = block->tag == DATA_BLOCK_2_TYPE_7_DETAILED_TIMING; /* blocks must be multiple of 20 bytes length */ if (block->num_bytes % 20) return 0; @@ -5493,7 +5496,7 @@ static int add_displayid_detailed_1_modes(struct drm_connector *connector, for (i = 0; i < num_timings; i++) { struct displayid_detailed_timings_1 *timings = &det->timings[i]; - newmode = drm_mode_displayid_detailed(connector->dev, timings); + newmode = drm_mode_displayid_detailed(connector->dev, timings, type_7); if (!newmode) continue; @@ -5512,7 +5515,8 @@ static int add_displayid_detailed_modes(struct drm_connector *connector, displayid_iter_edid_begin(edid, &iter); displayid_iter_for_each(block, &iter) { - if (block->tag == DATA_BLOCK_TYPE_1_DETAILED_TIMING) + if (block->tag == DATA_BLOCK_TYPE_1_DETAILED_TIMING || + block->tag == DATA_BLOCK_2_TYPE_7_DETAILED_TIMING) num_modes += add_displayid_detailed_1_modes(connector, block); } displayid_iter_end(&iter); |