From: Jyri Sarha <jsarha@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>,
dri-devel@lists.freedesktop.org, daniel@ffwll.ch
Cc: peter.ujfalusi@ti.com, laurent.pinchart@ideasonboard.com
Subject: Re: [PATCH v5 1/4] drm: drm_helper_crtc_enable_color_mgmt() => drm_crtc_enable_color_mgmt()
Date: Thu, 26 May 2016 12:59:09 +0300 [thread overview]
Message-ID: <5746C8ED.4050208@ti.com> (raw)
In-Reply-To: <5746BC5C.1070600@ti.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 2331 bytes --]
On 05/26/16 12:05, Tomi Valkeinen wrote:
> Hi Jyri, Daniel,
>
> On 26/05/16 11:35, Jyri Sarha wrote:
>> Add drm_crtc_enable_color_mgmt(), remove drm_helper_crtc_enable_color_mgmt()
>> and update drm/i915-driver (the only user of the old function).
>>
>> The new function is more flexible. It allows driver to enable only the
>> features it has without forcing to enable all three color management
>> properties: degamma lut, csc matrix (ctm), and gamma lut.
>>
>> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
>> Signed-off-by: Jyri Sarha <jsarha@ti.com>
>
>> +void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc,
>> + uint degamma_lut_size,
>> + bool has_ctm,
>> + uint gamma_lut_size)
>> +{
>> + struct drm_device *dev = crtc->dev;
>> + struct drm_mode_config *config = &dev->mode_config;
>> +
>> + if (degamma_lut_size) {
>> + drm_object_attach_property(&crtc->base,
>> + config->degamma_lut_property, 0);
>> + drm_object_attach_property(&crtc->base,
>> + config->degamma_lut_size_property,
>> + degamma_lut_size);
>> + }
>> +
>> + if (has_ctm)
>> + drm_object_attach_property(&crtc->base,
>> + config->ctm_property, 0);
>> +
>> + if (gamma_lut_size) {
>> + drm_object_attach_property(&crtc->base,
>> + config->gamma_lut_property, 0);
>> + drm_object_attach_property(&crtc->base,
>> + config->gamma_lut_size_property,
>> + gamma_lut_size);
>> + }
>> +}
>
> As I mentioned, I think it would make sense to call
> drm_mode_crtc_set_gamma_size() here. At least from omapdrm perspective.
>
> I had a look at i915, and that one looks a bit odd. It always sets
> drm_mode_crtc_set_gamma_size(256), but then only calls
> drm_helper_crtc_enable_color_mgmt() if
> INTEL_INFO(dev)->color.gamma_lut_size > 0, and gives gamma_lut_size as
> the size.
>
> Is there some legacy stuff at play here? drm_mode_crtc_set_gamma_size()
> should always be 256 (as X expects that), but the GAMMA_LUT property can
> give the real gamma lut size?
>
This indeed seems to be the case. If call drm_mode_crtc_set_gamma_size,
with 256, but set the gamma_lut_size_property to 1024, the X still works
but trough atomic API I can use the full length gamma table.
I wonder if should do yet one more patch-round?
BR,
Jyri
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-05-26 9:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-26 8:35 [PATCH v5 0/4] drm/omapdrm: gamma table support + drm_crtc_enable_color_mgmt() Jyri Sarha
2016-05-26 8:35 ` [PATCH v5 1/4] drm: drm_helper_crtc_enable_color_mgmt() => drm_crtc_enable_color_mgmt() Jyri Sarha
2016-05-26 9:05 ` Tomi Valkeinen
2016-05-26 9:59 ` Jyri Sarha [this message]
2016-05-26 10:13 ` Daniel Vetter
2016-05-26 8:35 ` [PATCH v5 2/4] drm/omapdrm: Add gamma table support to DSS dispc Jyri Sarha
2016-05-26 8:35 ` [PATCH v5 3/4] drm/omapdrm: Workaround for errata i734 (LCD1 Gamma) in " Jyri Sarha
2016-05-26 8:35 ` [PATCH v5 4/4] drm/omapdrm: Implement gamma_lut atomic crtc properties Jyri Sarha
2016-05-26 10:17 ` [PATCH v5 0/4] drm/omapdrm: gamma table support + drm_crtc_enable_color_mgmt() Daniel Vetter
2016-05-26 12:18 ` Tomi Valkeinen
2016-05-26 12:19 ` Jyri Sarha
2016-05-26 11:15 ` 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=5746C8ED.4050208@ti.com \
--to=jsarha@ti.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=peter.ujfalusi@ti.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