summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/sysfb/simpledrm.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2025-04-01 11:37:13 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2025-04-07 11:02:07 +0200
commitea86aba47c3a724ea18a26ad498c1835f087dc63 (patch)
tree464466bf457821ec082732346d2bf5e85ad2e2c4 /drivers/gpu/drm/sysfb/simpledrm.c
parent68ab3253df1312bc22257cc217d77cdaef14186a (diff)
drm/sysfb: Merge CRTC functions
Merge the CRTC functions of ofdrm and simpledrm. Replace the code in each driver with the shared helpers. Set up callbacks with initializer macros. Ofdrm supports a gamma LUT, while simpledrm does not. So far ofdrm's LUT size has been hard-coded in the driver CRTC's atomic_check helper. Now pass the size of the LUT to the sysfb device. Ofdrm's custom atomic_flush is still required to apply changes to the LUT. Simpledrm passes a LUT size of 0, which disables the gamma LUT. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250401094056.32904-11-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/sysfb/simpledrm.c')
-rw-r--r--drivers/gpu/drm/sysfb/simpledrm.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/gpu/drm/sysfb/simpledrm.c b/drivers/gpu/drm/sysfb/simpledrm.c
index 986177e4a0f0..9616e67ea42c 100644
--- a/drivers/gpu/drm/sysfb/simpledrm.c
+++ b/drivers/gpu/drm/sysfb/simpledrm.c
@@ -14,7 +14,6 @@
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_connector.h>
-#include <drm/drm_crtc_helper.h>
#include <drm/drm_damage_helper.h>
#include <drm/drm_device.h>
#include <drm/drm_drv.h>
@@ -696,22 +695,8 @@ static const struct drm_plane_funcs simpledrm_primary_plane_funcs = {
DRM_GEM_SHADOW_PLANE_FUNCS,
};
-static enum drm_mode_status simpledrm_crtc_helper_mode_valid(struct drm_crtc *crtc,
- const struct drm_display_mode *mode)
-{
- struct drm_sysfb_device *sysfb = to_drm_sysfb_device(crtc->dev);
-
- return drm_crtc_helper_mode_valid_fixed(crtc, mode, &sysfb->fb_mode);
-}
-
-/*
- * The CRTC is always enabled. Screen updates are performed by
- * the primary plane's atomic_update function. Disabling clears
- * the screen in the primary plane's atomic_disable function.
- */
static const struct drm_crtc_helper_funcs simpledrm_crtc_helper_funcs = {
- .mode_valid = simpledrm_crtc_helper_mode_valid,
- .atomic_check = drm_crtc_helper_atomic_check,
+ DRM_SYSFB_CRTC_HELPER_FUNCS,
};
static const struct drm_crtc_funcs simpledrm_crtc_funcs = {