From: David Zhang <dingchen.zhang@amd.com>
To: <igt-dev@lists.freedesktop.org>
Subject: [igt-dev] [PATCH v2 1/4] tests/amdgpu/amd_psr: some fix for PSR-SU MPO test case
Date: Mon, 9 May 2022 22:41:08 -0400 [thread overview]
Message-ID: <20220510024111.404004-2-dingchen.zhang@amd.com> (raw)
In-Reply-To: <20220510024111.404004-1-dingchen.zhang@amd.com>
[why]
Analogous to usermode behavior, when there are primary plane and
overlay plane committed, alpha region of overlay corresponding to
the primary plane position/size should be set to zero to explicitly
display the content of primary plane (emulated as video playback in
this test case) in general.
The input arguments of width/height of the helper to paint the
framebuffer should not exceed the size of the created framebuffer.
[how]
- set the alpha region of overlay plane framebuffer to zero aligned
to the position/size of the primary plane
- paint the primary plane framebuffer background/foreground w/ the
valid width/height.
Cc: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Leo Li <sunpeng.li@amd.com>
Cc: Jay Pillai <aurabindo.pillai@amd.com>
Cc: Wayne Lin <wayne.lin@amd.com>
changes in v2:
------------------
- correct the word "toplay" and replace w/ "overlay" to make it
more clear and accurate
Signed-off-by: David Zhang <dingchen.zhang@amd.com>
Reviewed-by: Leo Li <sunpeng.li@amd.com>
---
tests/amdgpu/amd_psr.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/tests/amdgpu/amd_psr.c b/tests/amdgpu/amd_psr.c
index b930b20e..de12bd04 100644
--- a/tests/amdgpu/amd_psr.c
+++ b/tests/amdgpu/amd_psr.c
@@ -351,9 +351,9 @@ static void run_check_psr_su_mpo(data_t *data)
cr = igt_get_cairo_ctx(data->fd, &rect_fb[i]);
igt_assert_f(cr, "Failed to get cairo context\n");
/* background in black */
- igt_paint_color(cr, 0, 0, data->w, data->h, .0, .0, .0);
+ igt_paint_color(cr, 0, 0, data->w / 2, data->h / 2, .0, .0, .0);
/* foreground (megenta strip) */
- igt_paint_color(cr, i * strip_w, 0, strip_w, data->h, 1.0, .0, 1.0);
+ igt_paint_color(cr, i * strip_w, 0, strip_w, data->h / 2, 1.0, .0, 1.0);
igt_put_cairo_ctx(cr);
}
@@ -364,8 +364,18 @@ static void run_check_psr_su_mpo(data_t *data)
igt_plane_set_position(data->primary, 0, 0);
igt_plane_set_size(data->primary, data->w / 2, data->h / 2);
- /* adjust alpha for vpb (primary plane) region in overlay */
- draw_color_alpha(&ov_fb, 0, 0, data->w / 2, data->h / 2, .5, .5, .5, .3);
+ /**
+ * adjust alpha for vpb (primary plane) region in overlay.
+ * given alpha, we have below formula:
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ * blended = alpha * overlay + (1 - alpha) * underlay
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ * since primary plane is underlay while overlay plane is overlay,
+ * to display the content of primary plane w/ blending, we'd set
+ * the alpha of each pixel in overlay corresponding to primary plane
+ * position/size to be zero.
+ */
+ draw_color_alpha(&ov_fb, 0, 0, data->w / 2, data->h / 2, .5, .5, .5, .0);
igt_output_set_pipe(data->output, data->pipe_id);
igt_display_commit_atomic(&data->display, 0, NULL);
--
2.25.1
next prev parent reply other threads:[~2022-05-10 2:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-10 2:41 [igt-dev] [PATCH v2 0/4] amdgpu PSR-SU scaling tests and some fix David Zhang
2022-05-10 2:41 ` David Zhang [this message]
2022-05-10 2:41 ` [igt-dev] [PATCH v2 2/4] tests/amdgpu/amd_psr: clean-up the code David Zhang
2022-05-10 2:41 ` [igt-dev] [PATCH v2 3/4] tests/amdgpu/amd_psr: use double framebuffers to emulate MPO case David Zhang
2022-05-10 2:41 ` [igt-dev] [PATCH v2 4/4] tests/amdgpu/amd_psr: add PSR-SU scaling test cases David Zhang
2022-05-10 3:58 ` [igt-dev] ✗ Fi.CI.BAT: failure for amdgpu PSR-SU scaling tests and some fix Patchwork
2022-05-10 13:17 ` Zhang, Dingchen (David)
2022-05-10 15:25 ` Vudum, Lakshminarayana
2022-05-10 14:58 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2022-05-10 19:23 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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=20220510024111.404004-2-dingchen.zhang@amd.com \
--to=dingchen.zhang@amd.com \
--cc=igt-dev@lists.freedesktop.org \
/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 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.