From: Daniel Vetter <daniel@ffwll.ch>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Pekka Paalanen <pekka.paalanen@collabora.com>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
dri-devel@lists.freedesktop.org, Sekhar Nori <nsekhar@ti.com>,
Jyri Sarha <jsarha@ti.com>, Nikhil Devshatwar <nikhil.nd@ti.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH v2 1/5] drm: add legacy support for using degamma for gamma
Date: Mon, 30 Nov 2020 15:10:57 +0100 [thread overview]
Message-ID: <20201130141057.GL401619@phenom.ffwll.local> (raw)
In-Reply-To: <f744a803-6d8c-5188-7bfa-93cc05cc26bf@ti.com>
On Mon, Nov 30, 2020 at 02:12:39PM +0200, Tomi Valkeinen wrote:
> On 30/11/2020 12:38, Laurent Pinchart wrote:
>
> >> + * can be used when the driver exposes either only GAMMA_LUT or both GAMMA_LUT
> >> + * and DEGAMMA_LUT.
> >> + */
> >> +int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
> >> + u16 *red, u16 *green, u16 *blue,
> >> + uint32_t size,
> >> + struct drm_modeset_acquire_ctx *ctx)
> >> +{
> >> + return legacy_gamma_degamma_set(crtc, red, green, blue, size, ctx, false);
> >> +}
> >
> > I wonder, would it make sense to make this automatic by setting the
> > degamma LUT when only the DEGAMMA_LUT property exists, and the gamma LUT
> > otherwise ? Are there use cases for drm_atomic_helper_legacy_degamma_set
> > for drivers that support both gamma and degamma ?
>
> Yes, I think drm_atomic_helper_legacy_gamma_set() could do that.
>
> But if you look at the second patch, the driver deals with crtc_state->degamma_lut. Having
> .gamma_set = drm_atomic_helper_legacy_degamma_set makes it bit more explicit and clear what the
> driver is doing.
>
> That said, documenting what drm_atomic_helper_legacy_gamma_set does if there's only degamma should
> also be clear enough, so... I don't have strong feelings either way =).
The thing is, the legacy helpers should be able to pull off what userspace
needs to do when it's using atomic anyway. Hard-coding information in the
kernel means we have a gap here. Hence imo legacy helpers doing the right
thing in all reasonable cases is imo better.
In many cases I think we should even go further, and ditch driver ability
to overwrite legacy helper hooks like this. I thought we'd need that
flexibility for legacy userspace being incompatible in awkward ways, but
wasn't ever really needed. Worse, many drivers forget to wire up the
compat hooks.
tldr, imo right thing to do here:
- move legacy gamma function from helpers into core code
- call it unconditionally for all atomic drivers (if there's no legacy
drivers using the hook left then we can outright remove it)
- make sure it dtrt in all cases
Cheers, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-11-30 14:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 8:03 [PATCH v2 0/5] drm/omap: add color mgmt support Tomi Valkeinen
2020-11-03 8:03 ` [PATCH v2 1/5] drm: add legacy support for using degamma for gamma Tomi Valkeinen
2020-11-30 10:38 ` Laurent Pinchart
2020-11-30 12:12 ` Tomi Valkeinen
2020-11-30 14:10 ` Daniel Vetter [this message]
2020-12-02 11:52 ` Tomi Valkeinen
2020-12-02 12:38 ` Daniel Vetter
2020-12-03 12:31 ` Ville Syrjälä
2020-12-03 12:35 ` Tomi Valkeinen
2020-11-03 8:03 ` [PATCH v2 2/5] drm/omap: use degamma property for gamma table Tomi Valkeinen
2020-11-30 10:39 ` Laurent Pinchart
2020-11-03 8:03 ` [PATCH v2 3/5] drm/omap: Implement CTM property for CRTC using OVL managers CPR matrix Tomi Valkeinen
2020-11-30 10:41 ` Laurent Pinchart
2020-11-30 11:39 ` Tomi Valkeinen
2020-11-03 8:03 ` [PATCH v2 4/5] drm/omap: rearrange includes in omapdss.h Tomi Valkeinen
2020-11-30 10:42 ` Laurent Pinchart
2020-11-03 8:03 ` [PATCH v2 5/5] drm/omap: Enable COLOR_ENCODING and COLOR_RANGE properties for planes Tomi Valkeinen
2020-11-30 10:50 ` Laurent Pinchart
2020-11-30 11:53 ` Tomi Valkeinen
2020-11-30 14:19 ` Laurent Pinchart
2020-11-30 14:36 ` Tomi Valkeinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201130141057.GL401619@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jsarha@ti.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=nikhil.nd@ti.com \
--cc=nsekhar@ti.com \
--cc=pekka.paalanen@collabora.com \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox