Commit 017d8461 authored by Nicholas Kazlauskas's avatar Nicholas Kazlauskas Committed by Harry Wentland

tests/kms_plane_alpha_blend: Paint FBs with cairo source operator

Cairo defaults to using a blended fill, so when IGT tries to paint on
top of a framebuffer in these tests with an alpha less than 1.0 the
previous framebuffer contents will still be present underneath.

On amdgpu this is an issue because the framebuffer is created in
an unitialized state and can have contents from previous tests
still within memory.

This patch explicitly sets the cairo filling operator to SOURCE to
overwrite the contents when performing fills with alpha < 1.0 in
this test.

It also fixes the creation of the transparent FB. My guess as for why
this test previously passed on i915 is because the primary FB was
also black, so the CRC would match even if the black overlay plane
was partially transparent.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Nicholas Kazlauskas's avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Ville Syrjälä's avatarVille Syrjälä <ville.syrjala@linux.intel.com>
parent b79007f9
Pipeline #21664 passed with stages
in 3 minutes and 7 seconds
......@@ -83,6 +83,7 @@ static void draw_squares(struct igt_fb *fb, int w, int h, double a)
{
cairo_t *cr = igt_get_cairo_ctx(fb->fd, fb);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
igt_paint_color_alpha(cr, 0, 0, w / 2, h / 2, 1., 0., 0., a);
igt_paint_color_alpha(cr, w / 2, 0, w / 2, h / 2, 0., 1., 0., a);
igt_paint_color_alpha(cr, 0, h / 2, w / 2, h / 2, 0., 0., 1., a);
......@@ -197,7 +198,8 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe)
&data->argb_fb_0);
cr = igt_get_cairo_ctx(data->gfx_fd, &data->argb_fb_0);
igt_paint_color_alpha(cr, 0, 0, w, h, 0., 0., 0., 1.0);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
igt_paint_color_alpha(cr, 0, 0, w, h, 0., 0., 0., 0.0);
igt_put_cairo_ctx(data->gfx_fd, &data->argb_fb_0, cr);
igt_create_fb(data->gfx_fd, w, h,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment