From: Ville Syrjälä ville.syrjala@linux.intel.com
I was playing around with the tile stuff a bit and noticed a bunch of issues in the DisplayID parser. This series aims to fix what I found.
Ville Syrjälä (9): drm: Constify topology id drm/edid: Swap some operands in for_each_displayid_db() drm/edid: Remove idx==1 assumptions from all over the DispID parsing drm/edid: Return DispID length from drm_find_displayid_extension() drm/edid: Move validate_displayid() drm_find_displayid_extension() drm/edid: Don't parse garbage as DispID blocks drm/edid: Don't include ext block csum in DispID size drm/edid: Clarify validate_displayid() drm/edid: Fix DispID tile parsing for override EDID
drivers/gpu/drm/drm_connector.c | 6 +- drivers/gpu/drm/drm_crtc_internal.h | 1 + drivers/gpu/drm/drm_edid.c | 103 +++++++++++++--------------- include/drm/drm_connector.h | 4 +- include/drm/drm_displayid.h | 2 +- 5 files changed, 54 insertions(+), 62 deletions(-)
From: Ville Syrjälä ville.syrjala@linux.intel.com
Make the topology id const since we don't want to change it.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com --- drivers/gpu/drm/drm_connector.c | 4 ++-- include/drm/drm_connector.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 644f0ad10671..462d8caa6e72 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -2392,7 +2392,7 @@ EXPORT_SYMBOL(drm_mode_put_tile_group); * tile group or NULL if not found. */ struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev, - char topology[8]) + const char topology[8]) { struct drm_tile_group *tg; int id; @@ -2422,7 +2422,7 @@ EXPORT_SYMBOL(drm_mode_get_tile_group); * new tile group or NULL. */ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev, - char topology[8]) + const char topology[8]) { struct drm_tile_group *tg; int ret; diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 19ae6bb5c85b..fd543d1db9b2 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1617,9 +1617,9 @@ struct drm_tile_group { };
struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev, - char topology[8]); + const char topology[8]); struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev, - char topology[8]); + const char topology[8]); void drm_mode_put_tile_group(struct drm_device *dev, struct drm_tile_group *tg);
On Fri, Mar 13, 2020 at 12:21 PM Ville Syrjala ville.syrjala@linux.intel.com wrote:
From: Ville Syrjälä ville.syrjala@linux.intel.com
Make the topology id const since we don't want to change it.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com
Series is: Reviewed-by: Alex Deucher alexander.deucher@amd.com
drivers/gpu/drm/drm_connector.c | 4 ++-- include/drm/drm_connector.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 644f0ad10671..462d8caa6e72 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -2392,7 +2392,7 @@ EXPORT_SYMBOL(drm_mode_put_tile_group);
- tile group or NULL if not found.
*/ struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
char topology[8])
const char topology[8])
{ struct drm_tile_group *tg; int id; @@ -2422,7 +2422,7 @@ EXPORT_SYMBOL(drm_mode_get_tile_group);
- new tile group or NULL.
*/ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
char topology[8])
const char topology[8])
{ struct drm_tile_group *tg; int ret; diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 19ae6bb5c85b..fd543d1db9b2 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1617,9 +1617,9 @@ struct drm_tile_group { };
struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
char topology[8]);
const char topology[8]);
struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
char topology[8]);
const char topology[8]);
void drm_mode_put_tile_group(struct drm_device *dev, struct drm_tile_group *tg);
-- 2.24.1
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
On Fri, Mar 13, 2020 at 04:05:00PM -0400, Alex Deucher wrote:
On Fri, Mar 13, 2020 at 12:21 PM Ville Syrjala ville.syrjala@linux.intel.com wrote:
From: Ville Syrjälä ville.syrjala@linux.intel.com
Make the topology id const since we don't want to change it.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com
Series is: Reviewed-by: Alex Deucher alexander.deucher@amd.com
Thanks. Series pushed to drm-misc-next.
drivers/gpu/drm/drm_connector.c | 4 ++-- include/drm/drm_connector.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 644f0ad10671..462d8caa6e72 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -2392,7 +2392,7 @@ EXPORT_SYMBOL(drm_mode_put_tile_group);
- tile group or NULL if not found.
*/ struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
char topology[8])
const char topology[8])
{ struct drm_tile_group *tg; int id; @@ -2422,7 +2422,7 @@ EXPORT_SYMBOL(drm_mode_get_tile_group);
- new tile group or NULL.
*/ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
char topology[8])
const char topology[8])
{ struct drm_tile_group *tg; int ret; diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 19ae6bb5c85b..fd543d1db9b2 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1617,9 +1617,9 @@ struct drm_tile_group { };
struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
char topology[8]);
const char topology[8]);
struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
char topology[8]);
const char topology[8]);
void drm_mode_put_tile_group(struct drm_device *dev, struct drm_tile_group *tg);
-- 2.24.1
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
From: Ville Syrjälä ville.syrjala@linux.intel.com
A+B on the previous line, B+A on the next line. Brain hurts.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com --- include/drm/drm_displayid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/drm/drm_displayid.h b/include/drm/drm_displayid.h index 9d3b745c3107..27bdd273fc4e 100644 --- a/include/drm/drm_displayid.h +++ b/include/drm/drm_displayid.h @@ -97,7 +97,7 @@ struct displayid_detailed_timing_block { (idx) + sizeof(struct displayid_block) <= (length) && \ (idx) + sizeof(struct displayid_block) + (block)->num_bytes <= (length) && \ (block)->num_bytes > 0; \ - (idx) += (block)->num_bytes + sizeof(struct displayid_block), \ + (idx) += sizeof(struct displayid_block) + (block)->num_bytes, \ (block) = (struct displayid_block *)&(displayid)[idx])
#endif
From: Ville Syrjälä ville.syrjala@linux.intel.com
The fact that the DispID starts at byte offset 1 is due to the DispID coming from and EDID extension block (the first byte being the extesion block tag). Instead of hadrdocoding that idx==1 assumptions all over let's just have drm_find_displayid_extension() return it since it actually knows what it's talking about.
If at some point someone comes across a DispID which is not embedded inside an EDID the function that returns the new type of DispID can return it's own byte offset without having to updated all the code.
TODO: should probably just get rid of that idx thing altogether and just return the thing we want directly.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com --- drivers/gpu/drm/drm_edid.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index b269cd7f7679..3f9e659199af 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3212,15 +3212,22 @@ static u8 *drm_find_edid_extension(const struct edid *edid, int ext_id) }
-static u8 *drm_find_displayid_extension(const struct edid *edid) +static u8 *drm_find_displayid_extension(const struct edid *edid, int *idx) { - return drm_find_edid_extension(edid, DISPLAYID_EXT); + u8 *displayid = drm_find_edid_extension(edid, DISPLAYID_EXT); + + if (!displayid) + return NULL; + + *idx = 1; + + return displayid; }
static u8 *drm_find_cea_extension(const struct edid *edid) { int ret; - int idx = 1; + int idx; int length = EDID_LENGTH; struct displayid_block *block; u8 *cea; @@ -3232,7 +3239,7 @@ static u8 *drm_find_cea_extension(const struct edid *edid) return cea;
/* CEA blocks can also be found embedded in a DisplayID block */ - displayid = drm_find_displayid_extension(edid); + displayid = drm_find_displayid_extension(edid, &idx); if (!displayid) return NULL;
@@ -5182,12 +5189,12 @@ static int add_displayid_detailed_modes(struct drm_connector *connector, { u8 *displayid; int ret; - int idx = 1; + int idx; int length = EDID_LENGTH; struct displayid_block *block; int num_modes = 0;
- displayid = drm_find_displayid_extension(edid); + displayid = drm_find_displayid_extension(edid, &idx); if (!displayid) return 0;
@@ -5837,17 +5844,11 @@ static int drm_parse_tiled_block(struct drm_connector *connector, }
static int drm_parse_display_id(struct drm_connector *connector, - u8 *displayid, int length, - bool is_edid_extension) + u8 *displayid, int length, int idx) { - /* if this is an EDID extension the first byte will be 0x70 */ - int idx = 0; struct displayid_block *block; int ret;
- if (is_edid_extension) - idx = 1; - ret = validate_displayid(displayid, length, idx); if (ret) return ret; @@ -5881,15 +5882,17 @@ static void drm_get_displayid(struct drm_connector *connector, struct edid *edid) { void *displayid = NULL; + int idx; int ret; + connector->has_tile = false; - displayid = drm_find_displayid_extension(edid); + displayid = drm_find_displayid_extension(edid, &idx); if (!displayid) { /* drop reference to any tile group we had */ goto out_drop_ref; }
- ret = drm_parse_display_id(connector, displayid, EDID_LENGTH, true); + ret = drm_parse_display_id(connector, displayid, EDID_LENGTH, idx); if (ret < 0) goto out_drop_ref; if (!connector->has_tile)
From: Ville Syrjälä ville.syrjala@linux.intel.com
As with the byte offset (idx) drm_find_displayid_extension() is the only one who actually knows how much data the resulting DispID block can contain. So return the length from therein instead of assuming it's the EDID block length all over.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com --- drivers/gpu/drm/drm_edid.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 3f9e659199af..18c55f3b20de 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3212,13 +3212,15 @@ static u8 *drm_find_edid_extension(const struct edid *edid, int ext_id) }
-static u8 *drm_find_displayid_extension(const struct edid *edid, int *idx) +static u8 *drm_find_displayid_extension(const struct edid *edid, + int *length, int *idx) { u8 *displayid = drm_find_edid_extension(edid, DISPLAYID_EXT);
if (!displayid) return NULL;
+ *length = EDID_LENGTH; *idx = 1;
return displayid; @@ -3227,8 +3229,7 @@ static u8 *drm_find_displayid_extension(const struct edid *edid, int *idx) static u8 *drm_find_cea_extension(const struct edid *edid) { int ret; - int idx; - int length = EDID_LENGTH; + int length, idx; struct displayid_block *block; u8 *cea; u8 *displayid; @@ -3239,7 +3240,7 @@ static u8 *drm_find_cea_extension(const struct edid *edid) return cea;
/* CEA blocks can also be found embedded in a DisplayID block */ - displayid = drm_find_displayid_extension(edid, &idx); + displayid = drm_find_displayid_extension(edid, &length, &idx); if (!displayid) return NULL;
@@ -5189,12 +5190,11 @@ static int add_displayid_detailed_modes(struct drm_connector *connector, { u8 *displayid; int ret; - int idx; - int length = EDID_LENGTH; + int length, idx; struct displayid_block *block; int num_modes = 0;
- displayid = drm_find_displayid_extension(edid, &idx); + displayid = drm_find_displayid_extension(edid, &length, &idx); if (!displayid) return 0;
@@ -5882,17 +5882,17 @@ static void drm_get_displayid(struct drm_connector *connector, struct edid *edid) { void *displayid = NULL; - int idx; + int length, idx; int ret;
connector->has_tile = false; - displayid = drm_find_displayid_extension(edid, &idx); + displayid = drm_find_displayid_extension(edid, &length, &idx); if (!displayid) { /* drop reference to any tile group we had */ goto out_drop_ref; }
- ret = drm_parse_display_id(connector, displayid, EDID_LENGTH, idx); + ret = drm_parse_display_id(connector, displayid, length, idx); if (ret < 0) goto out_drop_ref; if (!connector->has_tile)
From: Ville Syrjälä ville.syrjala@linux.intel.com
Instead of everyone having to call validate_displayid() let's just have drm_find_displayid_extension() do it for them.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com --- drivers/gpu/drm/drm_edid.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 18c55f3b20de..dbd2e8474c2a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3216,6 +3216,7 @@ static u8 *drm_find_displayid_extension(const struct edid *edid, int *length, int *idx) { u8 *displayid = drm_find_edid_extension(edid, DISPLAYID_EXT); + int ret;
if (!displayid) return NULL; @@ -3223,12 +3224,15 @@ static u8 *drm_find_displayid_extension(const struct edid *edid, *length = EDID_LENGTH; *idx = 1;
+ ret = validate_displayid(displayid, *length, *idx); + if (ret) + return NULL; + return displayid; }
static u8 *drm_find_cea_extension(const struct edid *edid) { - int ret; int length, idx; struct displayid_block *block; u8 *cea; @@ -3244,10 +3248,6 @@ static u8 *drm_find_cea_extension(const struct edid *edid) if (!displayid) return NULL;
- ret = validate_displayid(displayid, length, idx); - if (ret) - return NULL; - idx += sizeof(struct displayid_hdr); for_each_displayid_db(displayid, block, idx, length) { if (block->tag == DATA_BLOCK_CTA) { @@ -5189,7 +5189,6 @@ static int add_displayid_detailed_modes(struct drm_connector *connector, struct edid *edid) { u8 *displayid; - int ret; int length, idx; struct displayid_block *block; int num_modes = 0; @@ -5198,10 +5197,6 @@ static int add_displayid_detailed_modes(struct drm_connector *connector, if (!displayid) return 0;
- ret = validate_displayid(displayid, length, idx); - if (ret) - return 0; - idx += sizeof(struct displayid_hdr); for_each_displayid_db(displayid, block, idx, length) { switch (block->tag) { @@ -5849,10 +5844,6 @@ static int drm_parse_display_id(struct drm_connector *connector, struct displayid_block *block; int ret;
- ret = validate_displayid(displayid, length, idx); - if (ret) - return ret; - idx += sizeof(struct displayid_hdr); for_each_displayid_db(displayid, block, idx, length) { DRM_DEBUG_KMS("block id 0x%x, rev %d, len %d\n",
From: Ville Syrjälä ville.syrjala@linux.intel.com
Currently the code assumes that the entire EDID extesion block can be taken up by the DispID blocks. That is not true. There is at least always the DispID checksum, and potentially fill bytes if the extension block uses the interior fill scheme to pad out to fill EDID block size.
So let's not parse the checksum or the fill bytes as DispID blocks by having drm_find_displayid_extension() return the actual length of the DispID data to the caller.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com --- drivers/gpu/drm/drm_edid.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index dbd2e8474c2a..3067be710e5b 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3216,6 +3216,7 @@ static u8 *drm_find_displayid_extension(const struct edid *edid, int *length, int *idx) { u8 *displayid = drm_find_edid_extension(edid, DISPLAYID_EXT); + struct displayid_hdr *base; int ret;
if (!displayid) @@ -3228,6 +3229,9 @@ static u8 *drm_find_displayid_extension(const struct edid *edid, if (ret) return NULL;
+ base = (struct displayid_hdr *)&displayid[*idx]; + *length = *idx + sizeof(*base) + base->bytes; + return displayid; }
From: Ville Syrjälä ville.syrjala@linux.intel.com
The EDID extension block checksum byte is not part of the actual DispID data, so don't use it in validate_displayid().
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com --- drivers/gpu/drm/drm_edid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 3067be710e5b..f1ba06396c0a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3222,7 +3222,8 @@ static u8 *drm_find_displayid_extension(const struct edid *edid, if (!displayid) return NULL;
- *length = EDID_LENGTH; + /* EDID extensions block checksum isn't for us */ + *length = EDID_LENGTH - 1; *idx = 1;
ret = validate_displayid(displayid, *length, *idx);
From: Ville Syrjälä ville.syrjala@linux.intel.com
Throw out the magic '5' from validate_displayid() and replace with the actual thing we mean sizeof(header)+checksum. Also rewrite the checksum loop to be less hard to parse for mere mortals.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com --- drivers/gpu/drm/drm_edid.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index f1ba06396c0a..185027f751f6 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5098,7 +5098,7 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
static int validate_displayid(u8 *displayid, int length, int idx) { - int i; + int i, dispid_length; u8 csum = 0; struct displayid_hdr *base;
@@ -5107,15 +5107,18 @@ static int validate_displayid(u8 *displayid, int length, int idx) DRM_DEBUG_KMS("base revision 0x%x, length %d, %d %d\n", base->rev, base->bytes, base->prod_id, base->ext_count);
- if (base->bytes + 5 > length - idx) + /* +1 for DispID checksum */ + dispid_length = sizeof(*base) + base->bytes + 1; + if (dispid_length > length - idx) return -EINVAL; - for (i = idx; i <= base->bytes + 5; i++) { - csum += displayid[i]; - } + + for (i = 0; i < dispid_length; i++) + csum += displayid[idx + i]; if (csum) { DRM_NOTE("DisplayID checksum invalid, remainder is %d\n", csum); return -EINVAL; } + return 0; }
From: Ville Syrjälä ville.syrjala@linux.intel.com
Currently the DispID tile block gets parsed in drm_get_edid(), which is an odd place for it considering we parse nothing else there. Also this doesn't work for override EDIDs since drm_connector_update_edid_property() refuses to do its job twice in such cases. Thus we never update the tile property with results of the DispID tile block parsing during drm_get_edid().
To fix this let's just move the tile block parsing to happen during drm_connector_update_edid_property(), which is where we parse a bunch of other stuff as well (and where we update both the EDID and tile properties).
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com --- drivers/gpu/drm/drm_connector.c | 2 ++ drivers/gpu/drm/drm_crtc_internal.h | 1 + drivers/gpu/drm/drm_edid.c | 33 +++++++++-------------------- 3 files changed, 13 insertions(+), 23 deletions(-)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 462d8caa6e72..b1099e1251a2 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1970,6 +1970,8 @@ int drm_connector_update_edid_property(struct drm_connector *connector, else drm_reset_display_info(connector);
+ drm_update_tile_info(connector, edid); + drm_object_property_set_value(&connector->base, dev->mode_config.non_desktop_property, connector->display_info.non_desktop); diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h index 16f2413403aa..feba683c12a6 100644 --- a/drivers/gpu/drm/drm_crtc_internal.h +++ b/drivers/gpu/drm/drm_crtc_internal.h @@ -278,3 +278,4 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, void drm_mode_fixup_1366x768(struct drm_display_mode *mode); void drm_reset_display_info(struct drm_connector *connector); u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid); +void drm_update_tile_info(struct drm_connector *connector, const struct edid *edid); diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 185027f751f6..8239fd5a335f 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1583,8 +1583,6 @@ module_param_named(edid_fixup, edid_fixup, int, 0400); MODULE_PARM_DESC(edid_fixup, "Minimum number of valid EDID header bytes (0-8, default 6)");
-static void drm_get_displayid(struct drm_connector *connector, - struct edid *edid); static int validate_displayid(u8 *displayid, int length, int idx);
static int drm_edid_block_checksum(const u8 *raw_edid) @@ -2018,18 +2016,13 @@ EXPORT_SYMBOL(drm_probe_ddc); struct edid *drm_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter) { - struct edid *edid; - if (connector->force == DRM_FORCE_OFF) return NULL;
if (connector->force == DRM_FORCE_UNSPECIFIED && !drm_probe_ddc(adapter)) return NULL;
- edid = drm_do_get_edid(connector, drm_do_probe_ddc_edid, adapter); - if (edid) - drm_get_displayid(connector, edid); - return edid; + return drm_do_get_edid(connector, drm_do_probe_ddc_edid, adapter); } EXPORT_SYMBOL(drm_get_edid);
@@ -5793,9 +5786,9 @@ drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame, EXPORT_SYMBOL(drm_hdmi_vendor_infoframe_from_display_mode);
static int drm_parse_tiled_block(struct drm_connector *connector, - struct displayid_block *block) + const struct displayid_block *block) { - struct displayid_tiled_block *tile = (struct displayid_tiled_block *)block; + const struct displayid_tiled_block *tile = (struct displayid_tiled_block *)block; u16 w, h; u8 tile_v_loc, tile_h_loc; u8 num_v_tile, num_h_tile; @@ -5846,10 +5839,10 @@ static int drm_parse_tiled_block(struct drm_connector *connector, return 0; }
-static int drm_parse_display_id(struct drm_connector *connector, - u8 *displayid, int length, int idx) +static int drm_displayid_parse_tiled(struct drm_connector *connector, + const u8 *displayid, int length, int idx) { - struct displayid_block *block; + const struct displayid_block *block; int ret;
idx += sizeof(struct displayid_hdr); @@ -5863,12 +5856,6 @@ static int drm_parse_display_id(struct drm_connector *connector, if (ret) return ret; break; - case DATA_BLOCK_TYPE_1_DETAILED_TIMING: - /* handled in mode gathering code. */ - break; - case DATA_BLOCK_CTA: - /* handled in the cea parser code. */ - break; default: DRM_DEBUG_KMS("found DisplayID tag 0x%x, unhandled\n", block->tag); break; @@ -5877,10 +5864,10 @@ static int drm_parse_display_id(struct drm_connector *connector, return 0; }
-static void drm_get_displayid(struct drm_connector *connector, - struct edid *edid) +void drm_update_tile_info(struct drm_connector *connector, + const struct edid *edid) { - void *displayid = NULL; + const void *displayid = NULL; int length, idx; int ret;
@@ -5891,7 +5878,7 @@ static void drm_get_displayid(struct drm_connector *connector, goto out_drop_ref; }
- ret = drm_parse_display_id(connector, displayid, length, idx); + ret = drm_displayid_parse_tiled(connector, displayid, length, idx); if (ret < 0) goto out_drop_ref; if (!connector->has_tile)
dri-devel@lists.freedesktop.org