From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor: use safe values for test image to avoid rounding errors
Date: Thu, 14 Nov 2019 17:17:55 +0200 [thread overview]
Message-ID: <20191114151755.GA1208@intel.com> (raw)
In-Reply-To: <1573223082-29928-1-git-send-email-juhapekka.heikkila@gmail.com>
On Fri, Nov 08, 2019 at 04:24:42PM +0200, Juha-Pekka Heikkila wrote:
> instead of 0.5 use 1.0 for white color, this is due to bit replication
> effect.
I tested this on a glk here using the 10bit gamma LUT and 8bit pixel
format, and both primary and cursor 0.5 (ie. 0x80) ended up in the
same LUT entry (0x202). So it appears they both replicate the MSBs
in the LSBs when extending the precision from 8bit to whatever the
pipe uses internally. So my theory that they'd do it differently
doesn't really hold water. Which means it's still a total mystery
why this doesn't work with 0.5.
> Also set cairo to use same blending mode as what HW uses.
>
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> ---
> tests/kms_cursor_crc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index d0fb8f1..0125122 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -78,12 +78,13 @@ static void draw_cursor(cairo_t *cr, int x, int y, int cw, int ch, double a)
> /* Cairo doesn't like to be fed numbers that are too wild */
> if ((x < SHRT_MIN) || (x > SHRT_MAX) || (y < SHRT_MIN) || (y > SHRT_MAX))
> return;
> + cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
> cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
> /* 4 color rectangles in the corners, RGBY */
> igt_paint_color_alpha(cr, x, y, wl, ht, 1.0, 0.0, 0.0, a);
> igt_paint_color_alpha(cr, x + wl, y, wr, ht, 0.0, 1.0, 0.0, a);
> igt_paint_color_alpha(cr, x, y + ht, wl, hb, 0.0, 0.0, 1.0, a);
> - igt_paint_color_alpha(cr, x + wl, y + ht, wr, hb, 0.5, 0.5, 0.5, a);
> + igt_paint_color_alpha(cr, x + wl, y + ht, wr, hb, 1.0, 1.0, 1.0, a);
> }
>
> static void cursor_enable(data_t *data)
> --
> 2.7.4
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
--
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
prev parent reply other threads:[~2019-11-14 15:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 14:24 [igt-dev] [PATCH i-g-t] tests/kms_cursor: use safe values for test image to avoid rounding errors Juha-Pekka Heikkila
2019-11-08 15:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-11-10 5:17 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-11-11 13:30 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2019-11-13 8:50 ` [igt-dev] [PATCH i-g-t] " Kahola, Mika
2019-11-14 15:17 ` Ville Syrjälä [this message]
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=20191114151755.GA1208@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=juhapekka.heikkila@gmail.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