Skip to content

Commit 4098d18

Browse files
sresuperna9999
authored andcommitted
drm/panel: sitronix-st7789v: avoid hardcoding panel size
Move the panel size information to the mode struct, so that different panel sizes can be specified depending on the panel type. Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 9b4454f commit 4098d18

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/panel/panel-sitronix-st7789v.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ static const struct drm_display_mode default_mode = {
163163
.vsync_start = 320 + 8,
164164
.vsync_end = 320 + 8 + 4,
165165
.vtotal = 320 + 8 + 4 + 4,
166+
.width_mm = 61,
167+
.height_mm = 103,
166168
};
167169

168170
static const struct st7789_panel_info default_panel = {
@@ -188,8 +190,8 @@ static int st7789v_get_modes(struct drm_panel *panel,
188190
mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
189191
drm_mode_probed_add(connector, mode);
190192

191-
connector->display_info.width_mm = 61;
192-
connector->display_info.height_mm = 103;
193+
connector->display_info.width_mm = ctx->info->mode->width_mm;
194+
connector->display_info.height_mm = ctx->info->mode->height_mm;
193195

194196
return 1;
195197
}

0 commit comments

Comments
 (0)