Skip to content

Commit dacaaea

Browse files
jnikulagregkh
authored andcommitted
drm/displayid: fix Tiled Display Topology ID size
commit 90c0486 upstream. The Tiled Display Topology ID of a DisplayID Tiled Display Topology Data Block consists of three fields: - Tiled Display Manufacturer/Vendor ID Field (3 bytes) - Tiled Display Product ID Code Field (2 bytes) - Tiled Display Serial Number Field (4 bytes) i.e. a total of 9 bytes, not 8. The DisplayID Tiled Display Topology ID is used as the tile group identifier. Update both struct displayid_tiled_block topology_id member and struct drm_tile_group group_data member to full 9 bytes. The group data was missing the last byte of the serial number. I don't know whether there are known bug reports that might be linked to this, but it's plausible the last byte could be the differentiating part for the tile groups, and fewer tile groups might have been created than intended. Fixes: b49b55b ("drm/displayid: add displayid defines and edid extension (v2)") Fixes: 138f9eb ("drm: add tile_group support. (v3)") Cc: Dave Airlie <airlied@redhat.com> Cc: stable@vger.kernel.org # v3.19+ Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260610141549.555605-1-jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e15c25c commit dacaaea

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

drivers/gpu/drm/drm_connector.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3393,22 +3393,22 @@ EXPORT_SYMBOL(drm_mode_put_tile_group);
33933393
/**
33943394
* drm_mode_get_tile_group - get a reference to an existing tile group
33953395
* @dev: DRM device
3396-
* @topology: 8-bytes unique per monitor.
3396+
* @topology_id: 9-byte unique ID per monitor.
33973397
*
33983398
* Use the unique bytes to get a reference to an existing tile group.
33993399
*
34003400
* RETURNS:
34013401
* tile group or NULL if not found.
34023402
*/
34033403
struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
3404-
const char topology[8])
3404+
const char topology_id[9])
34053405
{
34063406
struct drm_tile_group *tg;
34073407
int id;
34083408

34093409
mutex_lock(&dev->mode_config.idr_mutex);
34103410
idr_for_each_entry(&dev->mode_config.tile_idr, tg, id) {
3411-
if (!memcmp(tg->group_data, topology, 8)) {
3411+
if (!memcmp(tg->group_data, topology_id, sizeof(tg->group_data))) {
34123412
if (!kref_get_unless_zero(&tg->refcount))
34133413
tg = NULL;
34143414
mutex_unlock(&dev->mode_config.idr_mutex);
@@ -3423,7 +3423,7 @@ EXPORT_SYMBOL(drm_mode_get_tile_group);
34233423
/**
34243424
* drm_mode_create_tile_group - create a tile group from a displayid description
34253425
* @dev: DRM device
3426-
* @topology: 8-bytes unique per monitor.
3426+
* @topology_id: 9-byte unique ID per monitor.
34273427
*
34283428
* Create a tile group for the unique monitor, and get a unique
34293429
* identifier for the tile group.
@@ -3432,7 +3432,7 @@ EXPORT_SYMBOL(drm_mode_get_tile_group);
34323432
* new tile group or NULL.
34333433
*/
34343434
struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
3435-
const char topology[8])
3435+
const char topology_id[9])
34363436
{
34373437
struct drm_tile_group *tg;
34383438
int ret;
@@ -3442,7 +3442,7 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
34423442
return NULL;
34433443

34443444
kref_init(&tg->refcount);
3445-
memcpy(tg->group_data, topology, 8);
3445+
memcpy(tg->group_data, topology_id, sizeof(tg->group_data));
34463446
tg->dev = dev;
34473447

34483448
mutex_lock(&dev->mode_config.idr_mutex);

drivers/gpu/drm/drm_displayid_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ struct displayid_tiled_block {
108108
u8 topo[3];
109109
u8 tile_size[4];
110110
u8 tile_pixel_bezel[5];
111-
u8 topology_id[8];
111+
u8 topology_id[9];
112112
} __packed;
113113

114114
struct displayid_detailed_timings_1 {

include/drm/drm_connector.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,13 +2312,13 @@ struct drm_tile_group {
23122312
struct kref refcount;
23132313
struct drm_device *dev;
23142314
int id;
2315-
u8 group_data[8];
2315+
u8 group_data[9];
23162316
};
23172317

23182318
struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
2319-
const char topology[8]);
2319+
const char topology_id[9]);
23202320
struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
2321-
const char topology[8]);
2321+
const char topology_id[9]);
23222322
void drm_mode_put_tile_group(struct drm_device *dev,
23232323
struct drm_tile_group *tg);
23242324

0 commit comments

Comments
 (0)