summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2025-09-24 19:16:24 +0300
committerAlex Deucher <alexander.deucher@amd.com>2025-09-25 22:54:22 +0300
commitdf2ba5709416ac6ce8dab1d141fc246b79549e78 (patch)
treefa049bb82bbd75f1b609803d62c0166fa7680cc7 /drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
parent6d622755bc9774a1edcb85325951f4c4a8ba9a55 (diff)
downloadlinux-df2ba5709416ac6ce8dab1d141fc246b79549e78.tar.xz
drm/amd: Add name to modes from amdgpu_connector_add_common_modes()
[Why] When DC adds common modes it adds modes with a string to match what they are. Non-DC doesn't. This can be inconsistent when turning on/off DC support. [How] Add a name member to common_modes[] and copy it into the drm display mode. Cc: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Link: https://lore.kernel.org/r/20250924161624.1975819-6-mario.limonciello@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 0ab22b919da5..47e9bfba0642 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -399,21 +399,22 @@ static void amdgpu_connector_add_common_modes(struct drm_encoder *encoder,
struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode;
int i;
int n;
- static const struct mode_size {
+ struct mode_size {
+ char name[DRM_DISPLAY_MODE_LEN];
int w;
int h;
} common_modes[] = {
- { 640, 480},
- { 800, 600},
- {1024, 768},
- {1280, 720},
- {1280, 800},
- {1280, 1024},
- {1440, 900},
- {1680, 1050},
- {1600, 1200},
- {1920, 1080},
- {1920, 1200}
+ { "640x480", 640, 480},
+ { "800x600", 800, 600},
+ { "1024x768", 1024, 768},
+ { "1280x720", 1280, 720},
+ { "1280x800", 1280, 800},
+ {"1280x1024", 1280, 1024},
+ { "1440x900", 1440, 900},
+ {"1680x1050", 1680, 1050},
+ {"1600x1200", 1600, 1200},
+ {"1920x1080", 1920, 1080},
+ {"1920x1200", 1920, 1200}
};
n = ARRAY_SIZE(common_modes);
@@ -435,6 +436,7 @@ static void amdgpu_connector_add_common_modes(struct drm_encoder *encoder,
mode = drm_cvt_mode(dev, common_modes[i].w, common_modes[i].h, 60, false, false, false);
if (!mode)
return;
+ strscpy(mode->name, common_modes[i].name, DRM_DISPLAY_MODE_LEN);
drm_mode_probed_add(connector, mode);
}