[PATCH 2/5] drm/omap: use degamma property for gamma table
Pekka Paalanen
ppaalanen at gmail.com
Fri Sep 25 08:14:12 UTC 2020
On Wed, 23 Sep 2020 14:57:24 +0300
Tomi Valkeinen <tomi.valkeinen at ti.com> wrote:
> omapdrm supports gamma via GAMMA_LUT property. However, the HW we have
> is:
>
> gamma -> ctm -> out
>
> instead of what the model DRM framework uses:
>
> ctm -> gamma -> out
>
> As the following patches add CTM support for omapdrm, lets first fix the
> gamma.
>
> This patch changes the property from GAMMA_LUT to DEGAMMA_LUT, and uses
> drm_atomic_helper_legacy_degamma_set for gamma_set helper. Thus we will
> have:
>
> degamma -> ctm -> out
>
> and the legacy ioctl will continue working as before.
>
Makes sense to me:
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.com>
Thanks,
pq
> ---
> drivers/gpu/drm/omapdrm/omap_crtc.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
> index 328a4a74f534..6116af920660 100644
> --- a/drivers/gpu/drm/omapdrm/omap_crtc.c
> +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
> @@ -573,8 +573,8 @@ static int omap_crtc_atomic_check(struct drm_crtc *crtc,
> {
> struct drm_plane_state *pri_state;
>
> - if (state->color_mgmt_changed && state->gamma_lut) {
> - unsigned int length = state->gamma_lut->length /
> + if (state->color_mgmt_changed && state->degamma_lut) {
> + unsigned int length = state->degamma_lut->length /
> sizeof(struct drm_color_lut);
>
> if (length < 2)
> @@ -614,10 +614,10 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,
> struct drm_color_lut *lut = NULL;
> unsigned int length = 0;
>
> - if (crtc->state->gamma_lut) {
> + if (crtc->state->degamma_lut) {
> lut = (struct drm_color_lut *)
> - crtc->state->gamma_lut->data;
> - length = crtc->state->gamma_lut->length /
> + crtc->state->degamma_lut->data;
> + length = crtc->state->degamma_lut->length /
> sizeof(*lut);
> }
> priv->dispc_ops->mgr_set_gamma(priv->dispc, omap_crtc->channel,
> @@ -738,7 +738,7 @@ static const struct drm_crtc_funcs omap_crtc_funcs = {
> .set_config = drm_atomic_helper_set_config,
> .destroy = omap_crtc_destroy,
> .page_flip = drm_atomic_helper_page_flip,
> - .gamma_set = drm_atomic_helper_legacy_gamma_set,
> + .gamma_set = drm_atomic_helper_legacy_degamma_set,
> .atomic_duplicate_state = omap_crtc_duplicate_state,
> .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
> .atomic_set_property = omap_crtc_atomic_set_property,
> @@ -839,7 +839,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
> if (priv->dispc_ops->mgr_gamma_size(priv->dispc, channel)) {
> unsigned int gamma_lut_size = 256;
>
> - drm_crtc_enable_color_mgmt(crtc, 0, false, gamma_lut_size);
> + drm_crtc_enable_color_mgmt(crtc, gamma_lut_size, false, 0);
> drm_mode_crtc_set_gamma_size(crtc, gamma_lut_size);
> }
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20200925/e4a439ec/attachment.sig>
More information about the dri-devel
mailing list