* [igt-dev] [PATCH i-g-t v1] tests/kms_color: MPO + pipe color test - test for gamma LUT transformation using two planes.
@ 2022-04-08 8:42 Ananya Sharma
2022-04-08 12:14 ` [igt-dev] ✗ Fi.CI.BUILD: failure for " Patchwork
2022-04-08 18:05 ` [igt-dev] [PATCH i-g-t v1] " Sharma, Swati2
0 siblings, 2 replies; 4+ messages in thread
From: Ananya Sharma @ 2022-04-08 8:42 UTC (permalink / raw)
To: igt-dev
Signed-off-by: Ananya Sharma <ananya.sharma@intel.com>
---
tests/kms_color.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 95 insertions(+), 1 deletion(-)
diff --git a/tests/kms_color.c b/tests/kms_color.c
index 775f3596..c520cd5a 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -111,7 +111,95 @@ static void test_pipe_degamma(data_t *data,
free_lut(degamma_linear);
free_lut(degamma_full);
}
+static void test_pipe_gamma_multiplane(data_t *data,
+ igt_plane_t *primary, igt_plane_t *overlay)
+{
+ igt_output_t *output;
+ igt_display_t *display = &data->display;
+ gamma_lut_t *gamma_full;
+ color_t red_green_blue[] = {
+ { 1.0, 0.0, 0.0 },
+ { 0.0, 1.0, 0.0 },
+ { 0.0, 0.0, 1.0 }
+ };
+ drmModeModeInfo *mode;
+ struct igt_fb fb;
+ igt_crc_t crc_fullgamma, crc_fullcolors;
+ int fb_id;
+ int height_primary, height_overlay, width;
+ igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_GAMMA_LUT));
+ gamma_full = generate_table_max(data->gamma_lut_size);
+
+ output = igt_get_single_output_for_pipe(&data->display, primary->pipe->pipe);
+ igt_require(output);
+
+ igt_output_set_pipe(output, primary->pipe->pipe);
+ mode = igt_output_get_mode(output);
+
+ height_primary = mode->vdisplay/2;
+ height_overlay = mode->vdisplay/2+1;
+ width = mode->hdisplay;
+
+ /* Create a framebuffer at the size of the output. */
+ fb_id = igt_create_fb(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ DRM_FORMAT_XRGB8888,
+ DRM_FORMAT_MOD_LINEAR,
+ &fb);
+ igt_assert(fb_id);
+
+ igt_plane_set_fb(primary, &fb);
+ igt_plane_set_size(primary, width, height_primary);
+ igt_plane_set_fb(overlay, &fb);
+ igt_plane_set_size(overlay, width, height_overlay);
+
+ disable_ctm(primary->pipe);
+ disable_degamma(primary->pipe);
+ set_gamma(data, primary->pipe, gamma_full);
+ igt_display_commit(&data->display);
+
+ /* Draw solid colors with no gamma transformation. */
+ paint_rectangles(data, mode, red_green_blue, &fb);
+ igt_plane_set_fb(primary, &fb);
+
+ igt_display_commit(&data->display);
+ igt_wait_for_vblank(data->drm_fd,
+ display->pipes[primary->pipe->pipe].crtc_offset);
+ igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullcolors);
+ /* Draw a gradient with gamma LUT to remap all values
+ * to max red/green/blue.
+ */
+ /* paint_gradient_rectangles(data, mode, red_green_blue, &fb);*/
+ paint_gradient_rectangles(data, mode, red_green_blue, &fb);
+ igt_plane_set_fb(primary, &fb);
+ igt_plane_set_position(primary, 0,0);
+ igt_plane_set_size(primary, width, height_primary);
+ igt_plane_set_fb(overlay, &fb);
+ igt_plane_set_position(overlay, 0, height_primary);
+ igt_plane_set_size(overlay, width, height_overlay);
+
+ igt_display_commit(&data->display);
+ igt_wait_for_vblank(data->drm_fd,
+ display->pipes[primary->pipe->pipe].crtc_offset);
+ igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullgamma);
+
+ /* Verify that the CRC of the software computed output is
+ * equal to the CRC of the gamma LUT transformation output.
+ */
+
+ igt_assert_crc_equal(&crc_fullgamma, &crc_fullcolors);
+
+ disable_gamma(primary->pipe);
+ igt_plane_set_fb(primary, NULL);
+ igt_plane_set_fb(overlay, NULL);
+ igt_output_set_pipe(output, PIPE_NONE);
+ igt_display_commit(&data->display);
+ igt_remove_fb(data->drm_fd, &fb);
+
+ free_lut(gamma_full);
+}
/*
* Draw 3 gradient rectangles in red, green and blue, with a maxed out gamma
* LUT and verify we have the same CRC as drawing solid color rectangles.
@@ -662,7 +750,7 @@ static void
run_tests_for_pipe(data_t *data, enum pipe p)
{
igt_pipe_t *pipe;
- igt_plane_t *primary;
+ igt_plane_t *primary,*overlay;
double delta;
int i;
color_t red_green_blue[] = {
@@ -680,6 +768,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
igt_require(pipe->n_planes >= 0);
primary = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
+ overlay = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_OVERLAY);
data->pipe_crc = igt_pipe_crc_new(data->drm_fd,
primary->pipe->pipe,
@@ -860,6 +949,11 @@ run_tests_for_pipe(data_t *data, enum pipe p)
igt_subtest_f("pipe-%s-legacy-gamma-reset", kmstest_pipe_name(p))
test_pipe_legacy_gamma_reset(data, primary);
+ igt_describe("Verify that gamma LUT transformation works correctly for multiplane");
+ igt_subtest_f("pipe-%s-gamma-multiplane", kmstest_pipe_name(p))
+ test_pipe_gamma_multiplane(data,primary,overlay);
+
+
igt_fixture {
disable_degamma(primary->pipe);
disable_gamma(primary->pipe);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [igt-dev] ✗ Fi.CI.BUILD: failure for tests/kms_color: MPO + pipe color test - test for gamma LUT transformation using two planes.
2022-04-08 8:42 [igt-dev] [PATCH i-g-t v1] tests/kms_color: MPO + pipe color test - test for gamma LUT transformation using two planes Ananya Sharma
@ 2022-04-08 12:14 ` Patchwork
2022-04-08 18:05 ` [igt-dev] [PATCH i-g-t v1] " Sharma, Swati2
1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2022-04-08 12:14 UTC (permalink / raw)
To: Ananya Sharma; +Cc: igt-dev
== Series Details ==
Series: tests/kms_color: MPO + pipe color test - test for gamma LUT transformation using two planes.
URL : https://patchwork.freedesktop.org/series/102398/
State : failure
== Summary ==
Applying: tests/kms_color: MPO + pipe color test - test for gamma LUT transformation using two planes.
Using index info to reconstruct a base tree...
M tests/kms_color.c
Falling back to patching base and 3-way merge...
Auto-merging tests/kms_color.c
CONFLICT (content): Merge conflict in tests/kms_color.c
Patch failed at 0001 tests/kms_color: MPO + pipe color test - test for gamma LUT transformation using two planes.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v1] tests/kms_color: MPO + pipe color test - test for gamma LUT transformation using two planes.
2022-04-08 8:42 [igt-dev] [PATCH i-g-t v1] tests/kms_color: MPO + pipe color test - test for gamma LUT transformation using two planes Ananya Sharma
2022-04-08 12:14 ` [igt-dev] ✗ Fi.CI.BUILD: failure for " Patchwork
@ 2022-04-08 18:05 ` Sharma, Swati2
2022-04-11 4:53 ` Sharma, Ananya
1 sibling, 1 reply; 4+ messages in thread
From: Sharma, Swati2 @ 2022-04-08 18:05 UTC (permalink / raw)
To: Ananya Sharma, igt-dev
Hi Ananya,
Why such a long patch subject? Please reduce.
Also, indentation is complete off. Please correct.
There seems to be build failure for the patch. Check that too.
Correct these 3 things first, before proceeding for reviews.
On 08-Apr-22 2:12 PM, Ananya Sharma wrote:
> Signed-off-by: Ananya Sharma <ananya.sharma@intel.com>
> ---
> tests/kms_color.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 95 insertions(+), 1 deletion(-)
>
> diff --git a/tests/kms_color.c b/tests/kms_color.c
> index 775f3596..c520cd5a 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -111,7 +111,95 @@ static void test_pipe_degamma(data_t *data,
> free_lut(degamma_linear);
> free_lut(degamma_full);
> }
> +static void test_pipe_gamma_multiplane(data_t *data,
> + igt_plane_t *primary, igt_plane_t *overlay)
> +{
> + igt_output_t *output;
> + igt_display_t *display = &data->display;
> + gamma_lut_t *gamma_full;
> + color_t red_green_blue[] = {
> + { 1.0, 0.0, 0.0 },
> + { 0.0, 1.0, 0.0 },
> + { 0.0, 0.0, 1.0 }
> + };
> + drmModeModeInfo *mode;
> + struct igt_fb fb;
> + igt_crc_t crc_fullgamma, crc_fullcolors;
> + int fb_id;
> + int height_primary, height_overlay, width;
> + igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_GAMMA_LUT));
> + gamma_full = generate_table_max(data->gamma_lut_size);
> +
> + output = igt_get_single_output_for_pipe(&data->display, primary->pipe->pipe);
> + igt_require(output);
> +
> + igt_output_set_pipe(output, primary->pipe->pipe);
> + mode = igt_output_get_mode(output);
> +
> + height_primary = mode->vdisplay/2;
> + height_overlay = mode->vdisplay/2+1;
> + width = mode->hdisplay;
> +
> + /* Create a framebuffer at the size of the output. */
> + fb_id = igt_create_fb(data->drm_fd,
> + mode->hdisplay,
> + mode->vdisplay,
> + DRM_FORMAT_XRGB8888,
> + DRM_FORMAT_MOD_LINEAR,
> + &fb);
> + igt_assert(fb_id);
> +
> + igt_plane_set_fb(primary, &fb);
> + igt_plane_set_size(primary, width, height_primary);
> + igt_plane_set_fb(overlay, &fb);
> + igt_plane_set_size(overlay, width, height_overlay);
> +
> + disable_ctm(primary->pipe);
> + disable_degamma(primary->pipe);
> + set_gamma(data, primary->pipe, gamma_full);
> + igt_display_commit(&data->display);
> +
> + /* Draw solid colors with no gamma transformation. */
> + paint_rectangles(data, mode, red_green_blue, &fb);
> + igt_plane_set_fb(primary, &fb);
> +
> + igt_display_commit(&data->display);
> + igt_wait_for_vblank(data->drm_fd,
> + display->pipes[primary->pipe->pipe].crtc_offset);
> + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullcolors);
>
> + /* Draw a gradient with gamma LUT to remap all values
> + * to max red/green/blue.
> + */
> + /* paint_gradient_rectangles(data, mode, red_green_blue, &fb);*/
> + paint_gradient_rectangles(data, mode, red_green_blue, &fb);
> + igt_plane_set_fb(primary, &fb);
> + igt_plane_set_position(primary, 0,0);
> + igt_plane_set_size(primary, width, height_primary);
> + igt_plane_set_fb(overlay, &fb);
> + igt_plane_set_position(overlay, 0, height_primary);
> + igt_plane_set_size(overlay, width, height_overlay);
> +
> + igt_display_commit(&data->display);
> + igt_wait_for_vblank(data->drm_fd,
> + display->pipes[primary->pipe->pipe].crtc_offset);
> + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullgamma);
> +
> + /* Verify that the CRC of the software computed output is
> + * equal to the CRC of the gamma LUT transformation output.
> + */
> +
> + igt_assert_crc_equal(&crc_fullgamma, &crc_fullcolors);
> +
> + disable_gamma(primary->pipe);
> + igt_plane_set_fb(primary, NULL);
> + igt_plane_set_fb(overlay, NULL);
> + igt_output_set_pipe(output, PIPE_NONE);
> + igt_display_commit(&data->display);
> + igt_remove_fb(data->drm_fd, &fb);
> +
> + free_lut(gamma_full);
> +}
> /*
> * Draw 3 gradient rectangles in red, green and blue, with a maxed out gamma
> * LUT and verify we have the same CRC as drawing solid color rectangles.
> @@ -662,7 +750,7 @@ static void
> run_tests_for_pipe(data_t *data, enum pipe p)
> {
> igt_pipe_t *pipe;
> - igt_plane_t *primary;
> + igt_plane_t *primary,*overlay;
> double delta;
> int i;
> color_t red_green_blue[] = {
> @@ -680,6 +768,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
> igt_require(pipe->n_planes >= 0);
>
> primary = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
> + overlay = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_OVERLAY);
>
> data->pipe_crc = igt_pipe_crc_new(data->drm_fd,
> primary->pipe->pipe,
> @@ -860,6 +949,11 @@ run_tests_for_pipe(data_t *data, enum pipe p)
> igt_subtest_f("pipe-%s-legacy-gamma-reset", kmstest_pipe_name(p))
> test_pipe_legacy_gamma_reset(data, primary);
>
> + igt_describe("Verify that gamma LUT transformation works correctly for multiplane");
> + igt_subtest_f("pipe-%s-gamma-multiplane", kmstest_pipe_name(p))
> + test_pipe_gamma_multiplane(data,primary,overlay);
> +
> +
> igt_fixture {
> disable_degamma(primary->pipe);
> disable_gamma(primary->pipe);
--
~Swati Sharma
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v1] tests/kms_color: MPO + pipe color test - test for gamma LUT transformation using two planes.
2022-04-08 18:05 ` [igt-dev] [PATCH i-g-t v1] " Sharma, Swati2
@ 2022-04-11 4:53 ` Sharma, Ananya
0 siblings, 0 replies; 4+ messages in thread
From: Sharma, Ananya @ 2022-04-11 4:53 UTC (permalink / raw)
To: Sharma, Swati2; +Cc: igt-dev
Hi Swati,
Thank you for looking into this, will do the required changes as mentioned and will resubmit the patch.
-Ananya Sharma
-----Original Message-----
From: Sharma, Swati2 <swati2.sharma@intel.com>
Sent: Friday, April 8, 2022 11:35 PM
To: Sharma, Ananya <ananya.sharma@intel.com>; igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t v1] tests/kms_color: MPO + pipe color test - test for gamma LUT transformation using two planes.
Hi Ananya,
Why such a long patch subject? Please reduce.
Also, indentation is complete off. Please correct.
There seems to be build failure for the patch. Check that too.
Correct these 3 things first, before proceeding for reviews.
On 08-Apr-22 2:12 PM, Ananya Sharma wrote:
> Signed-off-by: Ananya Sharma <ananya.sharma@intel.com>
> ---
> tests/kms_color.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 95 insertions(+), 1 deletion(-)
>
> diff --git a/tests/kms_color.c b/tests/kms_color.c index
> 775f3596..c520cd5a 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -111,7 +111,95 @@ static void test_pipe_degamma(data_t *data,
> free_lut(degamma_linear);
> free_lut(degamma_full);
> }
> +static void test_pipe_gamma_multiplane(data_t *data,
> + igt_plane_t *primary, igt_plane_t
> +*overlay) {
> + igt_output_t *output;
> + igt_display_t *display = &data->display;
> + gamma_lut_t *gamma_full;
> + color_t red_green_blue[] = {
> + { 1.0, 0.0, 0.0 },
> + { 0.0, 1.0, 0.0 },
> + { 0.0, 0.0, 1.0 }
> + };
> + drmModeModeInfo *mode;
> + struct igt_fb fb;
> + igt_crc_t crc_fullgamma, crc_fullcolors;
> + int fb_id;
> + int height_primary, height_overlay, width;
> + igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_GAMMA_LUT));
> + gamma_full = generate_table_max(data->gamma_lut_size);
> +
> + output = igt_get_single_output_for_pipe(&data->display, primary->pipe->pipe);
> + igt_require(output);
> +
> + igt_output_set_pipe(output, primary->pipe->pipe);
> + mode = igt_output_get_mode(output);
> +
> + height_primary = mode->vdisplay/2;
> + height_overlay = mode->vdisplay/2+1;
> + width = mode->hdisplay;
> +
> + /* Create a framebuffer at the size of the output. */
> + fb_id = igt_create_fb(data->drm_fd,
> + mode->hdisplay,
> + mode->vdisplay,
> + DRM_FORMAT_XRGB8888,
> + DRM_FORMAT_MOD_LINEAR,
> + &fb);
> + igt_assert(fb_id);
> +
> + igt_plane_set_fb(primary, &fb);
> + igt_plane_set_size(primary, width, height_primary);
> + igt_plane_set_fb(overlay, &fb);
> + igt_plane_set_size(overlay, width, height_overlay);
> +
> + disable_ctm(primary->pipe);
> + disable_degamma(primary->pipe);
> + set_gamma(data, primary->pipe, gamma_full);
> + igt_display_commit(&data->display);
> +
> + /* Draw solid colors with no gamma transformation. */
> + paint_rectangles(data, mode, red_green_blue, &fb);
> + igt_plane_set_fb(primary, &fb);
> +
> + igt_display_commit(&data->display);
> + igt_wait_for_vblank(data->drm_fd,
> + display->pipes[primary->pipe->pipe].crtc_offset);
> + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullcolors);
>
> + /* Draw a gradient with gamma LUT to remap all values
> + * to max red/green/blue.
> + */
> + /* paint_gradient_rectangles(data, mode, red_green_blue, &fb);*/
> + paint_gradient_rectangles(data, mode, red_green_blue, &fb);
> + igt_plane_set_fb(primary, &fb);
> + igt_plane_set_position(primary, 0,0);
> + igt_plane_set_size(primary, width, height_primary);
> + igt_plane_set_fb(overlay, &fb);
> + igt_plane_set_position(overlay, 0, height_primary);
> + igt_plane_set_size(overlay, width, height_overlay);
> +
> + igt_display_commit(&data->display);
> + igt_wait_for_vblank(data->drm_fd,
> + display->pipes[primary->pipe->pipe].crtc_offset);
> + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullgamma);
> +
> + /* Verify that the CRC of the software computed output is
> + * equal to the CRC of the gamma LUT transformation output.
> + */
> +
> + igt_assert_crc_equal(&crc_fullgamma, &crc_fullcolors);
> +
> + disable_gamma(primary->pipe);
> + igt_plane_set_fb(primary, NULL);
> + igt_plane_set_fb(overlay, NULL);
> + igt_output_set_pipe(output, PIPE_NONE);
> + igt_display_commit(&data->display);
> + igt_remove_fb(data->drm_fd, &fb);
> +
> + free_lut(gamma_full);
> +}
> /*
> * Draw 3 gradient rectangles in red, green and blue, with a maxed out gamma
> * LUT and verify we have the same CRC as drawing solid color rectangles.
> @@ -662,7 +750,7 @@ static void
> run_tests_for_pipe(data_t *data, enum pipe p)
> {
> igt_pipe_t *pipe;
> - igt_plane_t *primary;
> + igt_plane_t *primary,*overlay;
> double delta;
> int i;
> color_t red_green_blue[] = {
> @@ -680,6 +768,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
> igt_require(pipe->n_planes >= 0);
>
> primary = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
> + overlay = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_OVERLAY);
>
> data->pipe_crc = igt_pipe_crc_new(data->drm_fd,
> primary->pipe->pipe,
> @@ -860,6 +949,11 @@ run_tests_for_pipe(data_t *data, enum pipe p)
> igt_subtest_f("pipe-%s-legacy-gamma-reset", kmstest_pipe_name(p))
> test_pipe_legacy_gamma_reset(data, primary);
>
> + igt_describe("Verify that gamma LUT transformation works correctly for multiplane");
> + igt_subtest_f("pipe-%s-gamma-multiplane", kmstest_pipe_name(p))
> + test_pipe_gamma_multiplane(data,primary,overlay);
> +
> +
> igt_fixture {
> disable_degamma(primary->pipe);
> disable_gamma(primary->pipe);
--
~Swati Sharma
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-11 4:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 8:42 [igt-dev] [PATCH i-g-t v1] tests/kms_color: MPO + pipe color test - test for gamma LUT transformation using two planes Ananya Sharma
2022-04-08 12:14 ` [igt-dev] ✗ Fi.CI.BUILD: failure for " Patchwork
2022-04-08 18:05 ` [igt-dev] [PATCH i-g-t v1] " Sharma, Swati2
2022-04-11 4:53 ` Sharma, Ananya
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.