Skip to content

drm: Provide helpers for programming gamma ramps and palettes

Thomas Zimmermann dri-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 2 repliesIn review
  2. v15 patches 9 repliesSuperseded

Changes in v2 from the cover letter

- fix coding style
- fix typos
- remove note on non-linear default gamma ramps

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5drm: Add helpers for programming hardware gamma LUTsdrivers/gpu/drm/drm_color_mgmt.c include/drm/drm_color_mgmt.h+233 -00 replies
2/5drm/ast: Use helpers for programming gamma ramps and palettesdrivers/gpu/drm/ast/ast_mode.c+42 -272 replies
3/5drm/mgag200: Use helpers for programming gamma rampsdrivers/gpu/drm/mgag200/mgag200_drv.h drivers/gpu/drm/mgag200/mgag200_g200er.c drivers/gpu/drm/mgag200/mgag200_g200ev.c +2 more+44 -580 replies
4/5drm/ofdrm: Use helpers for programming gamma rampsdrivers/gpu/drm/sysfb/ofdrm.c+30 -500 replies
5/5drm/vesadrm: Use helpers for programming gamma rampsdrivers/gpu/drm/sysfb/vesadrm.c+36 -640 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchJavier Martinez CanillasJocelyn Falempe
1/5A-b R-b
2/5A-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] drm: Provide helpers for programming gamma ramps and palettes

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).

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.

v2:
- fix coding style
- fix typos
- remove note on non-linear default gamma ramps

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    |   8 +-
 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   |  82 ++++-----
 drivers/gpu/drm/sysfb/ofdrm.c            |  80 ++++-----
 drivers/gpu/drm/sysfb/vesadrm.c          | 100 ++++-------
 include/drm/drm_color_mgmt.h             |  27 +++
 10 files changed, 385 insertions(+), 199 deletions(-)

base-commit: 842c3c276c106040f9b96d72b9df35ed6aed9ae9
prerequisite-patch-id: 0aa359f6144c4015c140c8a6750be19099c676fb
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
prerequisite-patch-id: a5a973e527c88a5b47053d7a72aefe0b550197cb
prerequisite-patch-id: 719d09751d38f5da743beed6266585ee063e1e29

Signature · 1 line
2.49.0