dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] drm: Provide helpers for programming gamma ramps and palettes
@ 2025-05-09  8:23 Thomas Zimmermann
  2025-05-09  8:23 ` [PATCH 1/5] drm: Add helpers for programming hardware gamma LUTs Thomas Zimmermann
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Thomas Zimmermann @ 2025-05-09  8:23 UTC (permalink / raw)
  To: jfalempe, javierm, airlied, simona, airlied, maarten.lankhorst,
	mripard
  Cc: dri-devel, Thomas Zimmermann

We have a number of drivers that offer simple gamma correction and
palette modes. Depending on their hardware, the drivers process the
provided data in similar ways. Unify the functionality in several
DRM color-management helpers and update the drivers. The new helpers
can load provided data or generate default data to load.

With the drivers; ast, mgag200 ofdrm and vesadrm; gamma ramps are
always 8 bit wide. For 24-bit color depth, 8-bit gamma ramps are being
loaded to hardware as provided. For lower color depths the hardware
often requires the gamma ramp to be reduced to the number of bits
per pixel component, which the new helpers can do automatically. The
exception is ast's hardware, which always uses 8-bit gamma ramps.

The default gamma ramp uses a factor of 1.0 (as has been the case in
existing the per-driver implementations). A later update could change
this to the common value of 2.2 or a system-specific value.

Helpers for palettes either load an 8-bit palette or generate a default
palette with increasing luminance. The goal for the default is to keep
the display content visible with black at index 0. A later update could
possibly load a system-specific default palette.

Thomas Zimmermann (5):
  drm: Add helpers for programming hardware gamma LUTs
  drm/ast: Use helpers for programming gamma ramps and palettes
  drm/mgag200: Use helpers for programming gamma ramps
  drm/ofdrm: Use helpers for programming gamma ramps
  drm/vesadrm: Use helpers for programming gamma ramps

 drivers/gpu/drm/ast/ast_mode.c           |  69 +++++---
 drivers/gpu/drm/drm_color_mgmt.c         | 206 +++++++++++++++++++++++
 drivers/gpu/drm/mgag200/mgag200_drv.h    |   4 +-
 drivers/gpu/drm/mgag200/mgag200_g200er.c |   4 +-
 drivers/gpu/drm/mgag200/mgag200_g200ev.c |   4 +-
 drivers/gpu/drm/mgag200/mgag200_g200se.c |   4 +-
 drivers/gpu/drm/mgag200/mgag200_mode.c   |  78 ++++-----
 drivers/gpu/drm/sysfb/ofdrm.c            |  78 ++++-----
 drivers/gpu/drm/sysfb/vesadrm.c          | 100 ++++-------
 include/drm/drm_color_mgmt.h             |  27 +++
 10 files changed, 380 insertions(+), 194 deletions(-)


base-commit: 842c3c276c106040f9b96d72b9df35ed6aed9ae9
-- 
2.49.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-05-19 13:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-09  8:23 [PATCH 0/5] drm: Provide helpers for programming gamma ramps and palettes Thomas Zimmermann
2025-05-09  8:23 ` [PATCH 1/5] drm: Add helpers for programming hardware gamma LUTs Thomas Zimmermann
2025-05-12 13:31   ` Jocelyn Falempe
2025-05-12 13:55     ` Thomas Zimmermann
2025-05-13 12:26   ` Jocelyn Falempe
2025-05-19 13:06   ` Javier Martinez Canillas
2025-05-09  8:23 ` [PATCH 2/5] drm/ast: Use helpers for programming gamma ramps and palettes Thomas Zimmermann
2025-05-13 12:26   ` Jocelyn Falempe
2025-05-09  8:23 ` [PATCH 3/5] drm/mgag200: Use helpers for programming gamma ramps Thomas Zimmermann
2025-05-13 12:27   ` Jocelyn Falempe
2025-05-09  8:23 ` [PATCH 4/5] drm/ofdrm: " Thomas Zimmermann
2025-05-19 13:16   ` Javier Martinez Canillas
2025-05-09  8:23 ` [PATCH 5/5] drm/vesadrm: " Thomas Zimmermann
2025-05-19 13:17   ` Javier Martinez Canillas
2025-05-12 11:48 ` [PATCH 0/5] drm: Provide helpers for programming gamma ramps and palettes Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).