Skip to content

Commit 1adb35c

Browse files
committed
drm/vesadrm: Prepare color management for palette-based framebuffers
Distiguish between component-based formats and 'the rest' in vesadrm's color management. Scanout buffers with component-based format allow for gamma correction. Palette-based formats (i.e., 'the rest') require palette setup. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250714151513.309475-9-tzimmermann@suse.de
1 parent cbc383c commit 1adb35c

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

drivers/gpu/drm/sysfb/vesadrm.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,22 @@ static void vesadrm_crtc_helper_atomic_flush(struct drm_crtc *crtc,
223223
* plane's color format.
224224
*/
225225
if (crtc_state->enable && crtc_state->color_mgmt_changed) {
226-
if (sysfb_crtc_state->format == sysfb->fb_format) {
227-
if (crtc_state->gamma_lut)
228-
vesadrm_load_gamma_lut(vesa,
229-
sysfb_crtc_state->format,
230-
crtc_state->gamma_lut->data);
231-
else
226+
switch (sysfb->fb_format->format) {
227+
/*
228+
* Component formats
229+
*/
230+
default:
231+
if (sysfb_crtc_state->format == sysfb->fb_format) {
232+
if (crtc_state->gamma_lut)
233+
vesadrm_load_gamma_lut(vesa,
234+
sysfb_crtc_state->format,
235+
crtc_state->gamma_lut->data);
236+
else
237+
vesadrm_fill_gamma_lut(vesa, sysfb_crtc_state->format);
238+
} else {
232239
vesadrm_fill_gamma_lut(vesa, sysfb_crtc_state->format);
233-
} else {
234-
vesadrm_fill_gamma_lut(vesa, sysfb_crtc_state->format);
240+
}
241+
break;
235242
}
236243
}
237244
}

0 commit comments

Comments
 (0)