* [PATCH] drm/i915/glk: Improve rounding caused by pre-CSC gamma tables
@ 2017-03-10 10:18 Ander Conselvan de Oliveira
2017-03-10 10:18 ` [PATCH i-g-t] kms_cursor_crc: Add a subtest with a 256x256 gradient cursor Ander Conselvan de Oliveira
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ander Conselvan de Oliveira @ 2017-03-10 10:18 UTC (permalink / raw)
To: intel-gfx; +Cc: Ander Conselvan de Oliveira
The 33rd entry in the pre-CSC gamma table in Geminilake can represent a
value of 1.0 as 17 bits fixed point with one integer bit. However, the
table was generated such that the value of 1.0 would be 0.ffff with
all the intervals scaled accordingly. For instance, 0.5 mapped to
0.7fff instead of 0.8000.
For a reason that is not clear to the author, the rounding seems to be
different when a cursor plane is used, leading to some seemingly random
failures of the kms_cursor_crc igt tests. The differences weren't
perceptible at 8bpc with images captured by a Chamelium device, but did
cause CRC mismatches.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
---
drivers/gpu/drm/i915/intel_color.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
index b9e5266d..306c6b0 100644
--- a/drivers/gpu/drm/i915/intel_color.c
+++ b/drivers/gpu/drm/i915/intel_color.c
@@ -465,14 +465,14 @@ static void glk_load_degamma_lut(struct drm_crtc_state *state)
* different values per channel, so this just loads a linear table.
*/
for (i = 0; i < lut_size; i++) {
- uint32_t v = (i * ((1 << 16) - 1)) / (lut_size - 1);
+ uint32_t v = (i * (1 << 16)) / (lut_size - 1);
I915_WRITE(PRE_CSC_GAMC_DATA(pipe), v);
}
/* Clamp values > 1.0. */
while (i++ < 35)
- I915_WRITE(PRE_CSC_GAMC_DATA(pipe), (1 << 16) - 1);
+ I915_WRITE(PRE_CSC_GAMC_DATA(pipe), (1 << 16));
}
static void glk_load_luts(struct drm_crtc_state *state)
--
2.9.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH i-g-t] kms_cursor_crc: Add a subtest with a 256x256 gradient cursor
2017-03-10 10:18 [PATCH] drm/i915/glk: Improve rounding caused by pre-CSC gamma tables Ander Conselvan de Oliveira
@ 2017-03-10 10:18 ` Ander Conselvan de Oliveira
2017-03-10 10:27 ` Ander Conselvan De Oliveira
2017-03-10 12:48 ` [PATCH] drm/i915/glk: Improve rounding caused by pre-CSC gamma tables Ville Syrjälä
2017-03-10 13:18 ` ✓ Fi.CI.BAT: success for " Patchwork
2 siblings, 1 reply; 7+ messages in thread
From: Ander Conselvan de Oliveira @ 2017-03-10 10:18 UTC (permalink / raw)
To: intel-gfx; +Cc: Ander Conselvan de Oliveira
Some of the kms_cursor_crc subtests where failing on Geminilake. The
root cause was an error on programming the pre-CSC gamma tables, which
led to small rounding errors that, although not sufficient to change the
image as captured at 8bpc with the Chamelium, were enough to generate a
different CRC. It is not clear why the rounding is different when the
cursor is enabled, but this was caught by chance, since the cursor would
only be exercised with limited color combinations.
To improve coverage, add a test that uses a gradient covering all
possible 8bit values for a channel.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
---
tests/kms_cursor_crc.c | 42 ++++++++++++++++++++++++++++++++++++++----
1 file changed, 38 insertions(+), 4 deletions(-)
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 4851e18..0b232bf 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -87,6 +87,8 @@ static void draw_cursor(cairo_t *cr, int x, int y, int cw, int ch)
igt_paint_color_alpha(cr, x + wl, y + ht, wr, hb, 0.5, 0.5, 0.5, 1.0);
}
+typedef void(*draw_cursor_cb)(cairo_t *cr, int x, int y, int cw, int ch);
+
static void cursor_enable(data_t *data)
{
igt_output_t *output = data->output;
@@ -107,7 +109,8 @@ static void cursor_disable(data_t *data)
}
-static void do_single_test(data_t *data, int x, int y)
+static void do_single_test_with_cursor_cb(data_t *data, int x, int y,
+ draw_cursor_cb cursor_cb)
{
igt_display_t *display = &data->display;
igt_pipe_crc_t *pipe_crc = data->pipe_crc;
@@ -151,7 +154,7 @@ static void do_single_test(data_t *data, int x, int y)
igt_display_commit(display);
/* Now render the same in software and collect crc */
- draw_cursor(cr, x, y, data->curw, data->curh);
+ cursor_cb(cr, x, y, data->curw, data->curh);
igt_display_commit(display);
igt_wait_for_vblank(data->drm_fd, data->pipe);
@@ -162,6 +165,11 @@ static void do_single_test(data_t *data, int x, int y)
igt_paint_color(cr, 0, 0, data->screenw, data->screenh, 0.0, 0.0, 0.0);
}
+static void do_single_test(data_t *data, int x, int y)
+{
+ do_single_test_with_cursor_cb(data, x, y, draw_cursor);
+}
+
static void do_fail_test(data_t *data, int x, int y, int expect)
{
igt_display_t *display = &data->display;
@@ -386,7 +394,8 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
}
-static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
+static void create_cursor_fb_with_cb(data_t *data, int cur_w, int cur_h,
+ draw_cursor_cb cursor_cb)
{
cairo_t *cr;
uint32_t fb_id;
@@ -406,10 +415,15 @@ static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
igt_assert(fb_id);
cr = igt_get_cairo_ctx(data->drm_fd, &data->fb);
- draw_cursor(cr, 0, 0, cur_w, cur_h);
+ cursor_cb(cr, 0, 0, cur_w, cur_h);
igt_assert(cairo_status(cr) == 0);
}
+static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
+{
+ create_cursor_fb_with_cb(data, cur_w, cur_h, draw_cursor);
+}
+
static bool has_nonsquare_cursors(uint32_t devid)
{
/*
@@ -506,6 +520,23 @@ static void test_rapid_movement(data_t *data)
}
+static void draw_cursor_gradient(cairo_t *cr, int x, int y, int cw, int ch)
+{
+ cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
+ igt_paint_color_gradient(cr, x, y, cw, ch, 1.0, 1.0, 1.0);
+}
+
+static void test_cursor_colors(data_t *data)
+{
+ int cursor_w = data->curw;
+ int cursor_h = data->curh;
+
+ create_cursor_fb_with_cb(data, cursor_w, cursor_h,
+ draw_cursor_gradient);
+ do_single_test_with_cursor_cb(data, 0, 0, draw_cursor_gradient);
+ igt_remove_fb(data->drm_fd, &data->fb);
+}
+
static void run_test_generic(data_t *data)
{
int cursor_size;
@@ -613,6 +644,9 @@ igt_main
igt_subtest_f("cursor-size-change")
run_test(&data, test_cursor_size, cursor_width, cursor_height);
+ igt_subtest_f("gradient-cursor")
+ run_test(&data, test_cursor_colors, 256, 256);
+
run_test_generic(&data);
igt_fixture {
--
2.9.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH i-g-t] kms_cursor_crc: Add a subtest with a 256x256 gradient cursor
2017-03-10 10:18 ` [PATCH i-g-t] kms_cursor_crc: Add a subtest with a 256x256 gradient cursor Ander Conselvan de Oliveira
@ 2017-03-10 10:27 ` Ander Conselvan De Oliveira
2017-03-14 14:24 ` Ander Conselvan De Oliveira
0 siblings, 1 reply; 7+ messages in thread
From: Ander Conselvan De Oliveira @ 2017-03-10 10:27 UTC (permalink / raw)
To: intel-gfx
On Fri, 2017-03-10 at 12:18 +0200, Ander Conselvan de Oliveira wrote:
> Some of the kms_cursor_crc subtests where failing on Geminilake. The
> root cause was an error on programming the pre-CSC gamma tables, which
> led to small rounding errors that, although not sufficient to change the
> image as captured at 8bpc with the Chamelium, were enough to generate a
> different CRC. It is not clear why the rounding is different when the
> cursor is enabled, but this was caught by chance, since the cursor would
> only be exercised with limited color combinations.
>
> To improve coverage, add a test that uses a gradient covering all
> possible 8bit values for a channel.
>
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> ---
> tests/kms_cursor_crc.c | 42 ++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 38 insertions(+), 4 deletions(-)
>
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index 4851e18..0b232bf 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -87,6 +87,8 @@ static void draw_cursor(cairo_t *cr, int x, int y, int cw, int ch)
> igt_paint_color_alpha(cr, x + wl, y + ht, wr, hb, 0.5, 0.5, 0.5, 1.0);
> }
>
> +typedef void(*draw_cursor_cb)(cairo_t *cr, int x, int y, int cw, int ch);
> +
> static void cursor_enable(data_t *data)
> {
> igt_output_t *output = data->output;
> @@ -107,7 +109,8 @@ static void cursor_disable(data_t *data)
> }
>
>
> -static void do_single_test(data_t *data, int x, int y)
> +static void do_single_test_with_cursor_cb(data_t *data, int x, int y,
> + draw_cursor_cb cursor_cb)
> {
> igt_display_t *display = &data->display;
> igt_pipe_crc_t *pipe_crc = data->pipe_crc;
> @@ -151,7 +154,7 @@ static void do_single_test(data_t *data, int x, int y)
> igt_display_commit(display);
>
> /* Now render the same in software and collect crc */
> - draw_cursor(cr, x, y, data->curw, data->curh);
> + cursor_cb(cr, x, y, data->curw, data->curh);
> igt_display_commit(display);
>
> igt_wait_for_vblank(data->drm_fd, data->pipe);
> @@ -162,6 +165,11 @@ static void do_single_test(data_t *data, int x, int y)
> igt_paint_color(cr, 0, 0, data->screenw, data->screenh, 0.0, 0.0, 0.0);
> }
>
> +static void do_single_test(data_t *data, int x, int y)
> +{
> + do_single_test_with_cursor_cb(data, x, y, draw_cursor);
> +}
> +
> static void do_fail_test(data_t *data, int x, int y, int expect)
> {
> igt_display_t *display = &data->display;
> @@ -386,7 +394,8 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
> igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
> }
>
> -static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
> +static void create_cursor_fb_with_cb(data_t *data, int cur_w, int cur_h,
> + draw_cursor_cb cursor_cb)
> {
> cairo_t *cr;
> uint32_t fb_id;
> @@ -406,10 +415,15 @@ static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
> igt_assert(fb_id);
>
> cr = igt_get_cairo_ctx(data->drm_fd, &data->fb);
> - draw_cursor(cr, 0, 0, cur_w, cur_h);
> + cursor_cb(cr, 0, 0, cur_w, cur_h);
> igt_assert(cairo_status(cr) == 0);
> }
>
> +static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
> +{
> + create_cursor_fb_with_cb(data, cur_w, cur_h, draw_cursor);
> +}
> +
> static bool has_nonsquare_cursors(uint32_t devid)
> {
> /*
> @@ -506,6 +520,23 @@ static void test_rapid_movement(data_t *data)
>
> }
>
> +static void draw_cursor_gradient(cairo_t *cr, int x, int y, int cw, int ch)
> +{
> + cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
> + igt_paint_color_gradient(cr, x, y, cw, ch, 1.0, 1.0, 1.0);
> +}
> +
> +static void test_cursor_colors(data_t *data)
> +{
> + int cursor_w = data->curw;
> + int cursor_h = data->curh;
> +
> + create_cursor_fb_with_cb(data, cursor_w, cursor_h,
> + draw_cursor_gradient);
> + do_single_test_with_cursor_cb(data, 0, 0, draw_cursor_gradient);
> + igt_remove_fb(data->drm_fd, &data->fb);
> +}
> +
> static void run_test_generic(data_t *data)
> {
> int cursor_size;
> @@ -613,6 +644,9 @@ igt_main
> igt_subtest_f("cursor-size-change")
> run_test(&data, test_cursor_size, cursor_width, cursor_height);
>
> + igt_subtest_f("gradient-cursor")
Just realized this needs an igt_require(max_cursor_[wh] >= 256).
Ander
> + run_test(&data, test_cursor_colors, 256, 256);
> +
> run_test_generic(&data);
>
> igt_fixture {
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915/glk: Improve rounding caused by pre-CSC gamma tables
2017-03-10 10:18 [PATCH] drm/i915/glk: Improve rounding caused by pre-CSC gamma tables Ander Conselvan de Oliveira
2017-03-10 10:18 ` [PATCH i-g-t] kms_cursor_crc: Add a subtest with a 256x256 gradient cursor Ander Conselvan de Oliveira
@ 2017-03-10 12:48 ` Ville Syrjälä
2017-03-10 13:18 ` ✓ Fi.CI.BAT: success for " Patchwork
2 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2017-03-10 12:48 UTC (permalink / raw)
To: Ander Conselvan de Oliveira; +Cc: intel-gfx
On Fri, Mar 10, 2017 at 12:18:34PM +0200, Ander Conselvan de Oliveira wrote:
> The 33rd entry in the pre-CSC gamma table in Geminilake can represent a
> value of 1.0 as 17 bits fixed point with one integer bit. However, the
> table was generated such that the value of 1.0 would be 0.ffff with
> all the intervals scaled accordingly. For instance, 0.5 mapped to
> 0.7fff instead of 0.8000.
Actually all the gamma tables except the legacy 8bpc gamma have
this 1.0 thing. And yet we program them all to <1.0. But I guess
in most cases that doesn't cause any issues. But I think this is
definitely something someone should look at.
One problem is that the uapi we got in the end uses 0.16 representation
instead of the 8.24 that I thought we were going with. So the conversion
isn't going to as nice as it could be I suppose.
But yeah, this patch seems trouble free since we don't yet expose
the pre-csc gamma to userspace.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> For a reason that is not clear to the author, the rounding seems to be
> different when a cursor plane is used, leading to some seemingly random
> failures of the kms_cursor_crc igt tests. The differences weren't
> perceptible at 8bpc with images captured by a Chamelium device, but did
> cause CRC mismatches.
>
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> ---
> drivers/gpu/drm/i915/intel_color.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
> index b9e5266d..306c6b0 100644
> --- a/drivers/gpu/drm/i915/intel_color.c
> +++ b/drivers/gpu/drm/i915/intel_color.c
> @@ -465,14 +465,14 @@ static void glk_load_degamma_lut(struct drm_crtc_state *state)
> * different values per channel, so this just loads a linear table.
> */
> for (i = 0; i < lut_size; i++) {
> - uint32_t v = (i * ((1 << 16) - 1)) / (lut_size - 1);
> + uint32_t v = (i * (1 << 16)) / (lut_size - 1);
>
> I915_WRITE(PRE_CSC_GAMC_DATA(pipe), v);
> }
>
> /* Clamp values > 1.0. */
> while (i++ < 35)
> - I915_WRITE(PRE_CSC_GAMC_DATA(pipe), (1 << 16) - 1);
> + I915_WRITE(PRE_CSC_GAMC_DATA(pipe), (1 << 16));
> }
>
> static void glk_load_luts(struct drm_crtc_state *state)
> --
> 2.9.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915/glk: Improve rounding caused by pre-CSC gamma tables
2017-03-10 10:18 [PATCH] drm/i915/glk: Improve rounding caused by pre-CSC gamma tables Ander Conselvan de Oliveira
2017-03-10 10:18 ` [PATCH i-g-t] kms_cursor_crc: Add a subtest with a 256x256 gradient cursor Ander Conselvan de Oliveira
2017-03-10 12:48 ` [PATCH] drm/i915/glk: Improve rounding caused by pre-CSC gamma tables Ville Syrjälä
@ 2017-03-10 13:18 ` Patchwork
2017-03-14 14:23 ` Ander Conselvan De Oliveira
2 siblings, 1 reply; 7+ messages in thread
From: Patchwork @ 2017-03-10 13:18 UTC (permalink / raw)
To: Ander Conselvan de Oliveira; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/glk: Improve rounding caused by pre-CSC gamma tables
URL : https://patchwork.freedesktop.org/series/21049/
State : success
== Summary ==
Series 21049v1 drm/i915/glk: Improve rounding caused by pre-CSC gamma tables
https://patchwork.freedesktop.org/api/1.0/series/21049/revisions/1/mbox/
fi-bdw-5557u total:278 pass:267 dwarn:0 dfail:0 fail:0 skip:11 time: 459s
fi-bsw-n3050 total:278 pass:239 dwarn:0 dfail:0 fail:0 skip:39 time: 610s
fi-bxt-j4205 total:278 pass:259 dwarn:0 dfail:0 fail:0 skip:19 time: 536s
fi-bxt-t5700 total:278 pass:258 dwarn:0 dfail:0 fail:0 skip:20 time: 596s
fi-byt-j1900 total:278 pass:251 dwarn:0 dfail:0 fail:0 skip:27 time: 508s
fi-byt-n2820 total:278 pass:247 dwarn:0 dfail:0 fail:0 skip:31 time: 504s
fi-hsw-4770 total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 444s
fi-hsw-4770r total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 436s
fi-ilk-650 total:278 pass:228 dwarn:0 dfail:0 fail:0 skip:50 time: 437s
fi-ivb-3520m total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 508s
fi-ivb-3770 total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 500s
fi-kbl-7500u total:278 pass:259 dwarn:1 dfail:0 fail:0 skip:18 time: 479s
fi-skl-6260u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 510s
fi-skl-6700hq total:278 pass:261 dwarn:0 dfail:0 fail:0 skip:17 time: 591s
fi-skl-6700k total:278 pass:256 dwarn:4 dfail:0 fail:0 skip:18 time: 498s
fi-skl-6770hq total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 558s
fi-snb-2520m total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time: 556s
fi-snb-2600 total:278 pass:249 dwarn:0 dfail:0 fail:0 skip:29 time: 426s
d8d69f76555feef19e3e4b601378446604d90da5 drm-tip: 2017y-03m-10d-11h-50m-04s UTC integration manifest
f2f76a8 drm/i915/glk: Improve rounding caused by pre-CSC gamma tables
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4134/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ✓ Fi.CI.BAT: success for drm/i915/glk: Improve rounding caused by pre-CSC gamma tables
2017-03-10 13:18 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-03-14 14:23 ` Ander Conselvan De Oliveira
0 siblings, 0 replies; 7+ messages in thread
From: Ander Conselvan De Oliveira @ 2017-03-14 14:23 UTC (permalink / raw)
To: intel-gfx
On Fri, 2017-03-10 at 13:18 +0000, Patchwork wrote:
> == Series Details ==
>
> Series: drm/i915/glk: Improve rounding caused by pre-CSC gamma tables
> URL : https://patchwork.freedesktop.org/series/21049/
> State : success
Pushed. Thanks for reviewing.
Ander
>
> == Summary ==
>
> Series 21049v1 drm/i915/glk: Improve rounding caused by pre-CSC gamma tables
> https://patchwork.freedesktop.org/api/1.0/series/21049/revisions/1/mbox/
>
> fi-bdw-5557u total:278 pass:267 dwarn:0 dfail:0 fail:0 skip:11 time: 459s
> fi-bsw-n3050 total:278 pass:239 dwarn:0 dfail:0 fail:0 skip:39 time: 610s
> fi-bxt-j4205 total:278 pass:259 dwarn:0 dfail:0 fail:0 skip:19 time: 536s
> fi-bxt-t5700 total:278 pass:258 dwarn:0 dfail:0 fail:0 skip:20 time: 596s
> fi-byt-j1900 total:278 pass:251 dwarn:0 dfail:0 fail:0 skip:27 time: 508s
> fi-byt-n2820 total:278 pass:247 dwarn:0 dfail:0 fail:0 skip:31 time: 504s
> fi-hsw-4770 total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 444s
> fi-hsw-4770r total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 436s
> fi-ilk-650 total:278 pass:228 dwarn:0 dfail:0 fail:0 skip:50 time: 437s
> fi-ivb-3520m total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 508s
> fi-ivb-3770 total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 500s
> fi-kbl-7500u total:278 pass:259 dwarn:1 dfail:0 fail:0 skip:18 time: 479s
> fi-skl-6260u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 510s
> fi-skl-6700hq total:278 pass:261 dwarn:0 dfail:0 fail:0 skip:17 time: 591s
> fi-skl-6700k total:278 pass:256 dwarn:4 dfail:0 fail:0 skip:18 time: 498s
> fi-skl-6770hq total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 558s
> fi-snb-2520m total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time: 556s
> fi-snb-2600 total:278 pass:249 dwarn:0 dfail:0 fail:0 skip:29 time: 426s
>
> d8d69f76555feef19e3e4b601378446604d90da5 drm-tip: 2017y-03m-10d-11h-50m-04s UTC integration manifest
> f2f76a8 drm/i915/glk: Improve rounding caused by pre-CSC gamma tables
>
> == Logs ==
>
> For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4134/
> _______________________________________________
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH i-g-t] kms_cursor_crc: Add a subtest with a 256x256 gradient cursor
2017-03-10 10:27 ` Ander Conselvan De Oliveira
@ 2017-03-14 14:24 ` Ander Conselvan De Oliveira
0 siblings, 0 replies; 7+ messages in thread
From: Ander Conselvan De Oliveira @ 2017-03-14 14:24 UTC (permalink / raw)
To: intel-gfx
On Fri, 2017-03-10 at 12:27 +0200, Ander Conselvan De Oliveira wrote:
> On Fri, 2017-03-10 at 12:18 +0200, Ander Conselvan de Oliveira wrote:
> > Some of the kms_cursor_crc subtests where failing on Geminilake. The
> > root cause was an error on programming the pre-CSC gamma tables, which
> > led to small rounding errors that, although not sufficient to change the
> > image as captured at 8bpc with the Chamelium, were enough to generate a
> > different CRC. It is not clear why the rounding is different when the
> > cursor is enabled, but this was caught by chance, since the cursor would
> > only be exercised with limited color combinations.
> >
> > To improve coverage, add a test that uses a gradient covering all
> > possible 8bit values for a channel.
> >
> > Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> > ---
> > tests/kms_cursor_crc.c | 42 ++++++++++++++++++++++++++++++++++++++----
> > 1 file changed, 38 insertions(+), 4 deletions(-)
> >
> > diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> > index 4851e18..0b232bf 100644
> > --- a/tests/kms_cursor_crc.c
> > +++ b/tests/kms_cursor_crc.c
> > @@ -87,6 +87,8 @@ static void draw_cursor(cairo_t *cr, int x, int y, int cw, int ch)
> > igt_paint_color_alpha(cr, x + wl, y + ht, wr, hb, 0.5, 0.5, 0.5, 1.0);
> > }
> >
> > +typedef void(*draw_cursor_cb)(cairo_t *cr, int x, int y, int cw, int ch);
> > +
> > static void cursor_enable(data_t *data)
> > {
> > igt_output_t *output = data->output;
> > @@ -107,7 +109,8 @@ static void cursor_disable(data_t *data)
> > }
> >
> >
> > -static void do_single_test(data_t *data, int x, int y)
> > +static void do_single_test_with_cursor_cb(data_t *data, int x, int y,
> > + draw_cursor_cb cursor_cb)
> > {
> > igt_display_t *display = &data->display;
> > igt_pipe_crc_t *pipe_crc = data->pipe_crc;
> > @@ -151,7 +154,7 @@ static void do_single_test(data_t *data, int x, int y)
> > igt_display_commit(display);
> >
> > /* Now render the same in software and collect crc */
> > - draw_cursor(cr, x, y, data->curw, data->curh);
> > + cursor_cb(cr, x, y, data->curw, data->curh);
> > igt_display_commit(display);
> >
> > igt_wait_for_vblank(data->drm_fd, data->pipe);
> > @@ -162,6 +165,11 @@ static void do_single_test(data_t *data, int x, int y)
> > igt_paint_color(cr, 0, 0, data->screenw, data->screenh, 0.0, 0.0, 0.0);
> > }
> >
> > +static void do_single_test(data_t *data, int x, int y)
> > +{
> > + do_single_test_with_cursor_cb(data, x, y, draw_cursor);
> > +}
> > +
> > static void do_fail_test(data_t *data, int x, int y, int expect)
> > {
> > igt_display_t *display = &data->display;
> > @@ -386,7 +394,8 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
> > igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
> > }
> >
> > -static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
> > +static void create_cursor_fb_with_cb(data_t *data, int cur_w, int cur_h,
> > + draw_cursor_cb cursor_cb)
> > {
> > cairo_t *cr;
> > uint32_t fb_id;
> > @@ -406,10 +415,15 @@ static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
> > igt_assert(fb_id);
> >
> > cr = igt_get_cairo_ctx(data->drm_fd, &data->fb);
> > - draw_cursor(cr, 0, 0, cur_w, cur_h);
> > + cursor_cb(cr, 0, 0, cur_w, cur_h);
> > igt_assert(cairo_status(cr) == 0);
> > }
> >
> > +static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
> > +{
> > + create_cursor_fb_with_cb(data, cur_w, cur_h, draw_cursor);
> > +}
> > +
> > static bool has_nonsquare_cursors(uint32_t devid)
> > {
> > /*
> > @@ -506,6 +520,23 @@ static void test_rapid_movement(data_t *data)
> >
> > }
> >
> > +static void draw_cursor_gradient(cairo_t *cr, int x, int y, int cw, int ch)
> > +{
> > + cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
> > + igt_paint_color_gradient(cr, x, y, cw, ch, 1.0, 1.0, 1.0);
> > +}
> > +
> > +static void test_cursor_colors(data_t *data)
> > +{
> > + int cursor_w = data->curw;
> > + int cursor_h = data->curh;
> > +
> > + create_cursor_fb_with_cb(data, cursor_w, cursor_h,
> > + draw_cursor_gradient);
> > + do_single_test_with_cursor_cb(data, 0, 0, draw_cursor_gradient);
> > + igt_remove_fb(data->drm_fd, &data->fb);
> > +}
> > +
> > static void run_test_generic(data_t *data)
> > {
> > int cursor_size;
> > @@ -613,6 +644,9 @@ igt_main
> > igt_subtest_f("cursor-size-change")
> > run_test(&data, test_cursor_size, cursor_width, cursor_height);
> >
> > + igt_subtest_f("gradient-cursor")
>
> Just realized this needs an igt_require(max_cursor_[wh] >= 256).
I spoke too soon; run_test() actually does that check.
> Ander
>
> > + run_test(&data, test_cursor_colors, 256, 256);
> > +
> > run_test_generic(&data);
> >
> > igt_fixture {
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-03-14 14:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-10 10:18 [PATCH] drm/i915/glk: Improve rounding caused by pre-CSC gamma tables Ander Conselvan de Oliveira
2017-03-10 10:18 ` [PATCH i-g-t] kms_cursor_crc: Add a subtest with a 256x256 gradient cursor Ander Conselvan de Oliveira
2017-03-10 10:27 ` Ander Conselvan De Oliveira
2017-03-14 14:24 ` Ander Conselvan De Oliveira
2017-03-10 12:48 ` [PATCH] drm/i915/glk: Improve rounding caused by pre-CSC gamma tables Ville Syrjälä
2017-03-10 13:18 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-03-14 14:23 ` Ander Conselvan De Oliveira
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.