summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ast/ast_mode.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2025-01-31 10:21:09 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2025-02-03 14:01:11 +0100
commit192cc9f2b74a8e3b7d7cc7f4d041698d7ba63efa (patch)
tree9e8bf7e6d404320c0129504d893de70498af68cd /drivers/gpu/drm/ast/ast_mode.c
parentc81202906b5cd56db403e95db3d29c9dfc8c74c1 (diff)
drm/ast: Add empty initializer for VBIOS modes
VBIOS mode tables are terminated by an entry with a refresh rate of 0xff. The code is hard to read and fragile to use. Therefore create an empty entry with AST_VBIOS_MODE_INVALID to terminate each mode list. Stop at the invalid entry when searching for modes in the tables. Instead of testing for refresh == 0xff, test with a helper function if the mode's size and refresh have meaningful values. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250131092257.115596-10-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast/ast_mode.c')
-rw-r--r--drivers/gpu/drm/ast/ast_mode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 961bc2efbc02..3f437f871a35 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -179,7 +179,7 @@ static bool ast_get_vbios_mode_info(const struct drm_format_info *format,
loop = vbios_mode->enh_table;
- while (loop->refresh_rate != 0xff) {
+ while (ast_vbios_mode_is_valid(loop)) {
if (((mode->flags & DRM_MODE_FLAG_NVSYNC) && (loop->flags & PVSync)) ||
((mode->flags & DRM_MODE_FLAG_PVSYNC) && (loop->flags & NVSync)) ||
((mode->flags & DRM_MODE_FLAG_NHSYNC) && (loop->flags & PHSync)) ||