Skip to content

Commit 4f1a94d

Browse files
CertainLach1Naim
authored andcommitted
drm/edid: parse DRM VESA dsc bpp target
As per DisplayID v2.1a spec "DSC pass-through timing support", VESA vendor-specific data block may contain target DSC bits per pixel fields, that should be always used for the VII modes that declare they only support working with this value (Pass-through Timing Support for Target DSC Bits per Pixel). Signed-off-by: Yaroslav Bolyukin <iam@lach.pw> fixup parse DRM vesa dsc bpp target Reviewed-by: Jani Nikula <jani.nikula@intel.com>
1 parent bda3f27 commit 4f1a94d

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

drivers/gpu/drm/drm_displayid_internal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ struct displayid_formula_timing_block {
148148
#define DISPLAYID_VESA_DP_TYPE GENMASK(2, 0)
149149
#define DISPLAYID_VESA_MSO_OVERLAP GENMASK(3, 0)
150150
#define DISPLAYID_VESA_MSO_MODE GENMASK(6, 5)
151+
#define DISPLAYID_VESA_DSC_BPP_INT GENMASK(5, 0)
152+
#define DISPLAYID_VESA_DSC_BPP_FRACT GENMASK(3, 0)
151153

152154
#define DISPLAYID_VESA_DP_TYPE_EDP 0
153155
#define DISPLAYID_VESA_DP_TYPE_DP 1
@@ -157,6 +159,8 @@ struct displayid_vesa_vendor_specific_block {
157159
u8 oui[3];
158160
u8 data_structure_type;
159161
u8 mso;
162+
u8 dsc_bpp_int;
163+
u8 dsc_bpp_fract;
160164
} __packed;
161165

162166
/*

drivers/gpu/drm/drm_edid.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include <drm/drm_edid.h>
4646
#include <drm/drm_eld.h>
4747
#include <drm/drm_encoder.h>
48+
#include <drm/drm_fixed.h>
4849
#include <drm/drm_print.h>
4950

5051
#include "drm_crtc_internal.h"
@@ -6593,6 +6594,21 @@ static void drm_parse_vesa_specific_block(struct drm_connector *connector,
65936594
} else {
65946595
info->mso_pixel_overlap = 0;
65956596
}
6597+
6598+
if (block->num_bytes < 7) {
6599+
/* DSC bpp is optional */
6600+
return;
6601+
}
6602+
6603+
info->dp_dsc_bpp_x16 = FIELD_GET(DISPLAYID_VESA_DSC_BPP_INT, vesa->dsc_bpp_int) << 4 |
6604+
FIELD_GET(DISPLAYID_VESA_DSC_BPP_FRACT, vesa->dsc_bpp_fract);
6605+
6606+
if (info->dp_dsc_bpp_x16 > 0) {
6607+
drm_dbg_kms(connector->dev,
6608+
"[CONNECTOR:%d:%s] DSC bits per pixel " FXP_Q4_FMT "\n",
6609+
connector->base.id, connector->name,
6610+
FXP_Q4_ARGS(info->dp_dsc_bpp_x16));
6611+
}
65966612
}
65976613

65986614
static void drm_update_vesa_specific_block(struct drm_connector *connector,
@@ -6641,6 +6657,7 @@ static void drm_reset_display_info(struct drm_connector *connector)
66416657
info->mso_stream_count = 0;
66426658
info->mso_pixel_overlap = 0;
66436659
info->max_dsc_bpp = 0;
6660+
info->dp_dsc_bpp_x16 = 0;
66446661

66456662
kfree(info->vics);
66466663
info->vics = NULL;

include/drm/drm_connector.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,12 @@ struct drm_display_info {
837837
*/
838838
u32 max_dsc_bpp;
839839

840+
/**
841+
* @dp_dsc_bpp: DP Display-Stream-Compression (DSC) timing's target
842+
* DSC bits per pixel in 6.4 fixed point format. 0 means undefined.
843+
*/
844+
u16 dp_dsc_bpp_x16;
845+
840846
/**
841847
* @vics: Array of vics_len VICs. Internal to EDID parsing.
842848
*/

0 commit comments

Comments
 (0)