Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/solomon: Simplify mode_valid() using DRM helper

The ssd130x_crtc_mode_valid() function contains a manual implementation
to validate the display mode against the panel's single fixed resolution.

This pattern is common for simple displays, and the DRM core already
provides the drm_crtc_helper_mode_valid_fixed() helper for this exact
use case.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
Link: https://lore.kernel.org/r/20250920-improve-ssd130x-v2-3-77721e87ae08@gmail.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>

authored by

Iker Pedrosa and committed by
Javier Martinez Canillas
7556fe21 683bb242

+1 -9
+1 -9
drivers/gpu/drm/solomon/ssd130x.c
··· 1473 1473 { 1474 1474 struct ssd130x_device *ssd130x = drm_to_ssd130x(crtc->dev); 1475 1475 1476 - if (mode->hdisplay != ssd130x->mode.hdisplay && 1477 - mode->vdisplay != ssd130x->mode.vdisplay) 1478 - return MODE_ONE_SIZE; 1479 - else if (mode->hdisplay != ssd130x->mode.hdisplay) 1480 - return MODE_ONE_WIDTH; 1481 - else if (mode->vdisplay != ssd130x->mode.vdisplay) 1482 - return MODE_ONE_HEIGHT; 1483 - 1484 - return MODE_OK; 1476 + return drm_crtc_helper_mode_valid_fixed(crtc, mode, &ssd130x->mode); 1485 1477 } 1486 1478 1487 1479 static int ssd130x_crtc_atomic_check(struct drm_crtc *crtc,