]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Fix ACPI edid parsing on some Lenovo systems
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 4 Apr 2025 14:34:52 +0000 (09:34 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 22 Apr 2025 20:48:44 +0000 (16:48 -0400)
[Why]
The ACPI EDID in the BIOS of a Lenovo laptop includes 3 blocks, but
dm_helpers_probe_acpi_edid() has a start that is 'char'.  The 3rd
block index starts after 255, so it can't be indexed properly.
This leads to problems with the display when the EDID is parsed.

[How]
Change the variable type to 'short' so that larger values can be indexed.

Cc: Renjith Pananchikkal <renjith.pananchikkal@amd.com>
Reported-by: Mark Pearson <mpearson@lenovo.com>
Suggested-by: David Ober <dober@lenovo.com>
Fixes: c6a837088bed ("drm/amd/display: Fetch the EDID from _DDC if available for eDP")
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Mark Broadworth <mark.broadworth@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit a918bb4a90d423ced2976a794f2724c362c1f063)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c

index 2cd35392e2da7ebc3d0e3f7d0b9acf264c3c76c6..1395a748d726c4dde7a6e9edb131fed370b0ae7e 100644 (file)
@@ -918,7 +918,7 @@ dm_helpers_probe_acpi_edid(void *data, u8 *buf, unsigned int block, size_t len)
 {
        struct drm_connector *connector = data;
        struct acpi_device *acpidev = ACPI_COMPANION(connector->dev->dev);
-       unsigned char start = block * EDID_LENGTH;
+       unsigned short start = block * EDID_LENGTH;
        struct edid *edid;
        int r;