]> git.baikalelectronics.ru Git - kernel.git/commit
drm: add legacy support for using degamma for gamma
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 11 Dec 2020 11:42:37 +0000 (13:42 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 15 Dec 2020 13:46:03 +0000 (15:46 +0200)
commitdcd855e6503f0fc226b01f3254c4db229b175004
treec88f73abe2340fc120bd883418a03dc6b150b97d
parent31772352bbed98385c8ccb4a7616596d17d46ee9
drm: add legacy support for using degamma for gamma

The DRM core handles legacy gamma-set ioctl by setting GAMMA_LUT and
clearing CTM and DEGAMMA_LUT.

This works fine on HW where we have either:

degamma -> ctm -> gamma -> out

or

ctm -> gamma -> out

However, if the HW has gamma table before ctm, the atomic property
should be DEGAMMA_LUT, and thus we have:

degamma -> ctm -> out

This is fine for userspace which sets gamma table using the properties,
as the userspace can check for the existence of gamma & degamma, but the
legacy gamma-set ioctl does not work.

Change the DRM core to use DEGAMMA_LUT instead of GAMMA_LUT when the
latter is unavailable.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201211114237.213288-3-tomi.valkeinen@ti.com
drivers/gpu/drm/drm_color_mgmt.c
drivers/gpu/drm/drm_fb_helper.c