summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>2021-12-06 17:02:06 +0800
committerRodrigo Siqueira <Rodrigo.Siqueira@amd.com>2021-12-07 10:22:20 -0500
commit5dac3ab649b2e78aafc9550d510af48f4fdadb4e (patch)
tree032ee909e10806f5b43a870e210584b741ed41fd
parent425bd94a22fa05b5f3e4767648321430dd5e785d (diff)
tests/amdgpu: Add full screen scaling test case
[Why] Full screen scaling is a common usecase [How] Rework the scaling tests to add a 'fullscreen' test case. Change the test_plane function to use "dst_w/h" instead of a scale multiplier. This way we can easily add a full screen scale multiplier. Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
-rw-r--r--tests/amdgpu/amd_plane.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/amdgpu/amd_plane.c b/tests/amdgpu/amd_plane.c
index 12669239f..66302ebfd 100644
--- a/tests/amdgpu/amd_plane.c
+++ b/tests/amdgpu/amd_plane.c
@@ -274,7 +274,7 @@ static void set_regamma_lut(data_t *data, lut_t const *lut, int n)
* NOTE: The reason for using White+White is to speed up the crc (reuse the ref crc for all cases vs taking
* a ref crc per flip)
*/
-static void test_plane(data_t *data, int n, int x, int y, double w, double h, double scale, int pw, int ph, struct fbc *fbc){
+static void test_plane(data_t *data, int n, int x, int y, double w, double h, double dw, double dh, int pw, int ph, struct fbc *fbc){
igt_crc_t test_crc;
igt_display_t *display = &data->display;
@@ -291,14 +291,14 @@ static void test_plane(data_t *data, int n, int x, int y, double w, double h, do
/* Test: */
/* Draw a white overlay with a cutout */
draw_color_alpha(&fbc[n].test_overlay, 0, 0, pw, ph, 1.0, 1.0, 1.0, 1.00);
- draw_color_alpha(&fbc[n].test_overlay, x, y, w*scale, h*scale, 0.0, 0.0, 0.0, 0.0);
+ draw_color_alpha(&fbc[n].test_overlay, x, y, dw, dh, 0.0, 0.0, 0.0, 0.0);
igt_plane_set_fb(data->primary[n], &fbc[n].test_primary);
igt_plane_set_fb(data->overlay[n], &fbc[n].test_overlay);
/* Move the overlay to cover the cutout */
igt_plane_set_position(data->primary[n], x, y);
- igt_plane_set_size(data->primary[n], w*scale, h*scale);
+ igt_plane_set_size(data->primary[n], dw, dh);
igt_display_commit_atomic(display, 0, 0);
igt_pipe_crc_collect_crc(data->pipe_crc[n], &test_crc);
@@ -351,7 +351,7 @@ static void test_panning_1_display(data_t *data, int display_count, int w, int h
if (pw <= w && ph <= h)
break;
- test_plane(data, n, x, y, w, h, 1.0, pw, ph, fb);
+ test_plane(data, n, x, y, w, h, w, h, pw, ph, fb);
}
}
@@ -390,8 +390,11 @@ static void test_scaling_planes(data_t *data, int display_count, int w, int h, s
/* No need to scale a overley that is bigger than the display */
if (pw <= w*scale[i] && ph <= h*scale[i])
break;
- test_plane(data, n, 0, 0, w, h, scale[i], pw, ph, fb);
+ test_plane(data, n, 0, 0, w, h, w*scale[i], h*scale[i], pw, ph, fb);
}
+
+ /* Test Fullscreen scale*/
+ test_plane(data, n, 0, 0, w, h, pw, ph, pw, ph, fb);
}
return;
@@ -425,9 +428,9 @@ static void test_panning_2_display(data_t *data, int w, int h, struct fbc *fbc)
for (int j = 0; j < ARRAY_SIZE(y); j++){
for (int i = 0; i < it; i++){
if (toggle)
- test_plane(data, 0, pw-w, y[j], w, h, 1.0, pw, ph, fbc);
+ test_plane(data, 0, pw-w, y[j], w, h, w, h, pw, ph, fbc);
else
- test_plane(data, 1, 0, y[j], w, h, 1.0, pw2, ph2, fbc);
+ test_plane(data, 1, 0, y[j], w, h, w, h, pw2, ph2, fbc);
toggle = !toggle;
}