Skip to content

Commit df2ba57

Browse files
superm1alexdeucher
authored andcommitted
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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Timur Kristóf <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 6d62275 commit df2ba57

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -399,21 +399,22 @@ static void amdgpu_connector_add_common_modes(struct drm_encoder *encoder,
399399
struct drm_display_mode *native_mode = &amdgpu_encoder->native_mode;
400400
int i;
401401
int n;
402-
static const struct mode_size {
402+
struct mode_size {
403+
char name[DRM_DISPLAY_MODE_LEN];
403404
int w;
404405
int h;
405406
} common_modes[] = {
406-
{ 640, 480},
407-
{ 800, 600},
408-
{1024, 768},
409-
{1280, 720},
410-
{1280, 800},
411-
{1280, 1024},
412-
{1440, 900},
413-
{1680, 1050},
414-
{1600, 1200},
415-
{1920, 1080},
416-
{1920, 1200}
407+
{ "640x480", 640, 480},
408+
{ "800x600", 800, 600},
409+
{ "1024x768", 1024, 768},
410+
{ "1280x720", 1280, 720},
411+
{ "1280x800", 1280, 800},
412+
{"1280x1024", 1280, 1024},
413+
{ "1440x900", 1440, 900},
414+
{"1680x1050", 1680, 1050},
415+
{"1600x1200", 1600, 1200},
416+
{"1920x1080", 1920, 1080},
417+
{"1920x1200", 1920, 1200}
417418
};
418419

419420
n = ARRAY_SIZE(common_modes);
@@ -435,6 +436,7 @@ static void amdgpu_connector_add_common_modes(struct drm_encoder *encoder,
435436
mode = drm_cvt_mode(dev, common_modes[i].w, common_modes[i].h, 60, false, false, false);
436437
if (!mode)
437438
return;
439+
strscpy(mode->name, common_modes[i].name, DRM_DISPLAY_MODE_LEN);
438440

439441
drm_mode_probed_add(connector, mode);
440442
}

0 commit comments

Comments
 (0)