From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 2/5] lib: kms: add helpers for color management properties on pipes
Date: Tue, 8 Mar 2016 10:29:30 +0000 [thread overview]
Message-ID: <56DEA98A.2070301@intel.com> (raw)
In-Reply-To: <20160308021333.GA5450@intel.com>
On 08/03/16 02:13, Matt Roper wrote:
> On Thu, Feb 25, 2016 at 05:16:10PM +0000, Lionel Landwerlin wrote:
>> v2: Rename CTM_MATRIX property to CTM
>>
>> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>> ---
>> lib/igt_kms.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> lib/igt_kms.h | 17 +++++++++++++-
>> 2 files changed, 90 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
>> index dd4ca45..22996d5 100644
>> --- a/lib/igt_kms.c
>> +++ b/lib/igt_kms.c
>> @@ -1179,6 +1179,21 @@ void igt_display_init(igt_display_t *display, int drm_fd)
>> &prop_value,
>> NULL);
>> pipe->background = (uint32_t)prop_value;
>> + get_crtc_property(display->drm_fd, output->config.crtc->crtc_id,
>> + "DEGAMMA_LUT",
>> + &pipe->degamma_property,
>> + NULL,
>> + NULL);
>> + get_crtc_property(display->drm_fd, output->config.crtc->crtc_id,
>> + "CTM_MATRIX",
> Your changelog above indicates this was changed to just "CTM," but the
> change doesn't seem to have landed. Actually, it looks like it got
> applied to patch #3 by accident instead.
>
>
> Matt
Thanks Matt, fixing.
>> + &pipe->ctm_property,
>> + NULL,
>> + NULL);
>> + get_crtc_property(display->drm_fd, output->config.crtc->crtc_id,
>> + "GAMMA_LUT",
>> + &pipe->gamma_property,
>> + NULL,
>> + NULL);
>> }
>> }
>> }
>> @@ -1328,6 +1343,16 @@ static igt_plane_t *igt_pipe_get_plane(igt_pipe_t *pipe, enum igt_plane plane)
>> return &pipe->planes[idx];
>> }
>>
>> +bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name,
>> + uint32_t *prop_id, uint64_t *value,
>> + drmModePropertyPtr *prop)
>> +{
>> + return get_crtc_property(pipe->display->drm_fd,
>> + pipe->crtc_id,
>> + name,
>> + prop_id, value, prop);
>> +}
>> +
>> static uint32_t igt_plane_get_fb_id(igt_plane_t *plane)
>> {
>> if (plane->fb)
>> @@ -1635,6 +1660,17 @@ static int igt_output_commit(igt_output_t *output,
>> pipe->background_changed = false;
>> }
>>
>> + if (pipe->color_mgmt_changed) {
>> + igt_crtc_set_property(output, pipe->degamma_property,
>> + pipe->degamma_blob);
>> + igt_crtc_set_property(output, pipe->ctm_property,
>> + pipe->ctm_blob);
>> + igt_crtc_set_property(output, pipe->gamma_property,
>> + pipe->gamma_blob);
>> +
>> + pipe->color_mgmt_changed = false;
>> + }
>> +
>> for (i = 0; i < pipe->n_planes; i++) {
>> igt_plane_t *plane = &pipe->planes[i];
>>
>> @@ -1967,6 +2003,44 @@ void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation)
>> plane->rotation_changed = true;
>> }
>>
>> +static void
>> +igt_pipe_replace_blob(igt_pipe_t *pipe, uint64_t *blob, void *ptr, size_t length)
>> +{
>> + igt_display_t *display = pipe->display;
>> + uint32_t blob_id = 0;
>> +
>> + if (*blob != 0)
>> + igt_assert(drmModeDestroyPropertyBlob(display->drm_fd,
>> + *blob) == 0);
>> +
>> + if (length > 0)
>> + igt_assert(drmModeCreatePropertyBlob(display->drm_fd,
>> + ptr, length, &blob_id) == 0);
>> +
>> + *blob = blob_id;
>> +}
>> +
>> +void
>> +igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t length)
>> +{
>> + igt_pipe_replace_blob(pipe, &pipe->degamma_blob, ptr, length);
>> + pipe->color_mgmt_changed = 1;
>> +}
>> +
>> +void
>> +igt_pipe_set_ctm_matrix(igt_pipe_t *pipe, void *ptr, size_t length)
>> +{
>> + igt_pipe_replace_blob(pipe, &pipe->ctm_blob, ptr, length);
>> + pipe->color_mgmt_changed = 1;
>> +}
>> +
>> +void
>> +igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length)
>> +{
>> + igt_pipe_replace_blob(pipe, &pipe->gamma_blob, ptr, length);
>> + pipe->color_mgmt_changed = 1;
>> +}
>> +
>> /**
>> * igt_crtc_set_background:
>> * @pipe: pipe pointer to which background color to be set
>> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
>> index 77327c2..11a37d5 100644
>> --- a/lib/igt_kms.h
>> +++ b/lib/igt_kms.h
>> @@ -215,6 +215,15 @@ struct igt_pipe {
>> uint64_t background; /* Background color MSB BGR 16bpc LSB */
>> uint32_t background_changed : 1;
>> uint32_t background_property;
>> +
>> + uint64_t degamma_blob;
>> + uint32_t degamma_property;
>> + uint64_t ctm_blob;
>> + uint32_t ctm_property;
>> + uint64_t gamma_blob;
>> + uint32_t gamma_property;
>> + uint32_t color_mgmt_changed : 1;
>> +
>> uint32_t crtc_id;
>> };
>>
>> @@ -253,12 +262,19 @@ drmModeModeInfo *igt_output_get_mode(igt_output_t *output);
>> void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode);
>> void igt_output_set_pipe(igt_output_t *output, enum pipe pipe);
>> igt_plane_t *igt_output_get_plane(igt_output_t *output, enum igt_plane plane);
>> +bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name,
>> + uint32_t *prop_id, uint64_t *value,
>> + drmModePropertyPtr *prop);
>>
>> static inline bool igt_plane_supports_rotation(igt_plane_t *plane)
>> {
>> return plane->rotation_property != 0;
>> }
>>
>> +void igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t length);
>> +void igt_pipe_set_ctm_matrix(igt_pipe_t *pipe, void *ptr, size_t length);
>> +void igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length);
>> +
>> void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb);
>> void igt_plane_set_position(igt_plane_t *plane, int x, int y);
>> void igt_plane_set_size(igt_plane_t *plane, int w, int h);
>> @@ -294,4 +310,3 @@ const unsigned char* igt_kms_get_alt_edid(void);
>>
>>
>> #endif /* __IGT_KMS_H__ */
>> -
>> --
>> 2.7.0
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-03-08 10:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 17:16 [PATCH i-g-t 0/5] New pipe level color management tests V5 Lionel Landwerlin
2016-02-25 17:16 ` [PATCH i-g-t 1/5] lib: kms: add crtc_id to igt_pipe_t Lionel Landwerlin
2016-02-25 17:16 ` [PATCH i-g-t 2/5] lib: kms: add helpers for color management properties on pipes Lionel Landwerlin
2016-03-08 2:13 ` Matt Roper
2016-03-08 10:29 ` Lionel Landwerlin [this message]
2016-02-25 17:16 ` [PATCH i-g-t 3/5] lib: fb: add igt_paint_color_gradient_range Lionel Landwerlin
2016-02-25 17:16 ` [PATCH i-g-t 4/5] lib: add crc comparison function without an assert Lionel Landwerlin
2016-02-25 17:16 ` [PATCH i-g-t 5/5] tests/kms_color: New test for pipe level color management Lionel Landwerlin
2016-03-08 2:46 ` [PATCH i-g-t 0/5] New pipe level color management tests V5 Matt Roper
2016-03-08 10:42 ` Lionel Landwerlin
2016-03-08 11:50 ` Lionel Landwerlin
-- strict thread matches above, loose matches on Subject: below --
2016-02-19 15:46 [PATCH i-g-t 0/5] New pipe level color management tests V4 Lionel Landwerlin
2016-02-19 15:46 ` [PATCH i-g-t 2/5] lib: kms: add helpers for color management properties on pipes Lionel Landwerlin
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=56DEA98A.2070301@intel.com \
--to=lionel.g.landwerlin@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.d.roper@intel.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