Skip to content

Commit 68b5610

Browse files
CertainLach1Naim
authored andcommitted
drm/edid: parse DSC DPP passthru support flag for mode VII timings
For timings v7 block revision >=1, revision field also contains a bit that indicates that the mode timings should only be used with fixed bits per pixel value specified in vesa vendor-specific block. Signed-off-by: Yaroslav Bolyukin <iam@lach.pw> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
1 parent 8576568 commit 68b5610

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

drivers/gpu/drm/drm_displayid_internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ struct displayid_header {
9797
u8 ext_count;
9898
} __packed;
9999

100+
#define DISPLAYID_BLOCK_REV GENMASK(2, 0)
100101
struct displayid_block {
101102
u8 tag;
102103
u8 rev;
@@ -125,6 +126,7 @@ struct displayid_detailed_timings_1 {
125126
__le16 vsw;
126127
} __packed;
127128

129+
#define DISPLAYID_BLOCK_PASSTHROUGH_TIMINGS_SUPPORT BIT(3)
128130
struct displayid_detailed_timing_block {
129131
struct displayid_block base;
130132
struct displayid_detailed_timings_1 timings[];

drivers/gpu/drm/drm_edid.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6794,8 +6794,8 @@ static void update_display_info(struct drm_connector *connector,
67946794
}
67956795

67966796
static struct drm_display_mode *drm_mode_displayid_detailed(struct drm_device *dev,
6797-
const struct displayid_detailed_timings_1 *timings,
6798-
bool type_7)
6797+
const struct displayid_block *block,
6798+
const struct displayid_detailed_timings_1 *timings)
67996799
{
68006800
struct drm_display_mode *mode;
68016801
unsigned int pixel_clock = (timings->pixel_clock[0] |
@@ -6811,11 +6811,16 @@ static struct drm_display_mode *drm_mode_displayid_detailed(struct drm_device *d
68116811
unsigned int vsync_width = le16_to_cpu(timings->vsw) + 1;
68126812
bool hsync_positive = le16_to_cpu(timings->hsync) & (1 << 15);
68136813
bool vsync_positive = le16_to_cpu(timings->vsync) & (1 << 15);
6814+
bool type_7 = block->tag == DATA_BLOCK_2_TYPE_7_DETAILED_TIMING;
68146815

68156816
mode = drm_mode_create(dev);
68166817
if (!mode)
68176818
return NULL;
68186819

6820+
if (type_7 && FIELD_GET(DISPLAYID_BLOCK_REV, block->rev) >= 1)
6821+
mode->dsc_passthrough_timings_support =
6822+
block->rev & DISPLAYID_BLOCK_PASSTHROUGH_TIMINGS_SUPPORT;
6823+
68196824
/* resolution is kHz for type VII, and 10 kHz for type I */
68206825
mode->clock = type_7 ? pixel_clock : pixel_clock * 10;
68216826
mode->hdisplay = hactive;
@@ -6848,7 +6853,6 @@ static int add_displayid_detailed_1_modes(struct drm_connector *connector,
68486853
int num_timings;
68496854
struct drm_display_mode *newmode;
68506855
int num_modes = 0;
6851-
bool type_7 = block->tag == DATA_BLOCK_2_TYPE_7_DETAILED_TIMING;
68526856
/* blocks must be multiple of 20 bytes length */
68536857
if (block->num_bytes % 20)
68546858
return 0;
@@ -6857,7 +6861,7 @@ static int add_displayid_detailed_1_modes(struct drm_connector *connector,
68576861
for (i = 0; i < num_timings; i++) {
68586862
struct displayid_detailed_timings_1 *timings = &det->timings[i];
68596863

6860-
newmode = drm_mode_displayid_detailed(connector->dev, timings, type_7);
6864+
newmode = drm_mode_displayid_detailed(connector->dev, block, timings);
68616865
if (!newmode)
68626866
continue;
68636867

include/drm/drm_modes.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,16 @@ struct drm_display_mode {
417417
*/
418418
enum hdmi_picture_aspect picture_aspect_ratio;
419419

420+
/**
421+
* @dsc_passthrough_timing_support:
422+
*
423+
* Indicates whether this mode timing descriptor is supported
424+
* with specific target DSC bits per pixel only.
425+
*
426+
* VESA vendor-specific data block shall exist with the relevant
427+
* DSC bits per pixel declaration when this flag is set to true.
428+
*/
429+
bool dsc_passthrough_timings_support;
420430
};
421431

422432
/**

0 commit comments

Comments
 (0)