tests: Cleanups and NV12 preparations.
cover tests: Cleanups and NV12 preparations.
Some cleanups and adding NV12 support to kms_plane_scaling.
The cleanups to kms_rotation_crc will make it easier to test each pixel format later on.
Maarten Lankhorst (9):
tests/kms_panel_fitting: Remove dead code tests/kms_atomic: Add the test for CRTC_ID/FB_ID mismatch. tests/kms_plane_scaling: Test all pixel formats in
pipe-*-scaler-with-rotation
tests/kms_plane_scaling: Test all pixel formats with clamping and
clipping too
tests/kms_rotation_crc: Fix bad-tiling testcase. tests/kms_rotation_crc: Move bad_format parameter to
test_plane_rotation
tests/kms_rotation_crc: Always run the flip tests when available. tests/kms_rotation_crc: Remove primary-rotation-90-Y-tiled. tests/kms_rotation_crc: Perform lazy cleanup and require atomic.
tests/kms_atomic.c | 8 + tests/kms_panel_fitting.c | 52 ++---- tests/kms_plane_scaling.c | 107 ++++++++---- tests/kms_rotation_crc.c | 415 ++++++++++++---------------------------------- 4 files changed, 198 insertions(+), 384 deletions(-)
Signature · 6 lines
2.15.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 1/9 tests/kms_panel_fitting: Remove dead code
fb3 is unused, and fb_id1/2 are also set in igt_framebuffer, so it doesn't need separate member values.
image_w/h are also unused and create_fb will always succeed, so more elimination of dead code.
--- tests/kms_panel_fitting.c | 52 +++++++++++++++-------------------------------- 1 file changed, 16 insertions(+), 36 deletions(-)
tests/kms_panel_fitting.c +16 -36
@@ -32,15 +32,8 @@ typedef struct {int drm_fd;igt_display_t display; -int image_w; -int image_h; -struct igt_fb fb1;struct igt_fb fb2; -struct igt_fb fb3; -int fb_id1; -int fb_id2; -int fb_id3;igt_plane_t *plane1;igt_plane_t *plane2;
@@ -58,18 +51,17 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,igt_output_set_pipe (output, pipe);/* before allocating, free if any older fb */ -if (data->fb_id1) { +if (data->fb1.fb_id) {igt_remove_fb (data->drm_fd, &data->fb1); - data->fb_id1 =0 ; + data->fb1.fb_id =0 ; }/* allocate fb for plane 1 */ - data->fb_id1 =igt_create_pattern_fb (data->drm_fd, - mode->hdisplay, mode->vdisplay, -DRM_FORMAT_XRGB8888 , -LOCAL_DRM_FORMAT_MOD_NONE , - &data->fb1); -igt_assert (data->fb_id1); +igt_create_pattern_fb (data->drm_fd, + mode->hdisplay, mode->vdisplay, +DRM_FORMAT_XRGB8888 , +LOCAL_DRM_FORMAT_MOD_NONE , + &data->fb1);/* * We always set the primary plane to actually enable the pipe as
@@ -91,17 +83,13 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane) {igt_display_t *display = &data->display; -if (data->fb_id1) { +if (data->fb1.fb_id) {igt_remove_fb (data->drm_fd, &data->fb1); - data->fb_id1 =0 ; + data->fb1.fb_id =0 ; } -if (data->fb_id2) { +if (data->fb2.fb_id) {igt_remove_fb (data->drm_fd, &data->fb2); - data->fb_id2 =0 ; - } -if (data->fb_id3) { -igt_remove_fb (data->drm_fd, &data->fb3); - data->fb_id3 =0 ; + data->fb2.fb_id =0 ; }if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) {
@@ -121,7 +109,6 @@ static void test_panel_fitting(data_t *d) {igt_display_t *display = &d->display;igt_output_t *output; -cairo_surface_t *image;enum pipe pipe;int valid_tests =0 ;
@@ -146,18 +133,11 @@ static void test_panel_fitting(data_t *d) mode =igt_output_get_mode (output); native_mode = *mode; -/* allocate fb2 with image size */ - image =igt_cairo_image_surface_create_from_png (FILE_NAME ); -igt_assert (cairo_surface_status (image) ==CAIRO_STATUS_SUCCESS ); - d->image_w =cairo_image_surface_get_width (image); - d->image_h =cairo_image_surface_get_height (image); -cairo_surface_destroy (image); - - d->fb_id2 =igt_create_image_fb (d->drm_fd,0 ,0 , -DRM_FORMAT_XRGB8888 , -LOCAL_DRM_FORMAT_MOD_NONE , -FILE_NAME , &d->fb2); -igt_assert (d->fb_id2); +/* allocate fb2 with image */ +igt_create_image_fb (d->drm_fd,0 ,0 , +DRM_FORMAT_XRGB8888 , +LOCAL_DRM_FORMAT_MOD_NONE , +FILE_NAME , &d->fb2);/* Set up display to enable panel fitting */ mode->hdisplay =640 ;
Signature · 6 lines
2.15.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 1/9] tests/kms_panel_fitting: Remove dead code
Quoted 6 lines · Maarten Lankhorst
fb3 is unused, and fb_id1/2 are also set in
igt_framebuffer, so it doesn't need separate member values.image_w/h are also unused and
create_fbwill always succeed, so more elimination of dead code.
Quoted 114 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_panel_fitting.c | 52 +++++++++++++++--------------------
------------1 file changed, 16 insertions(+), 36 deletions(-)tests/kms_panel_fitting.c +0
-0@@ -32,15 +32,8 @@ typedef struct { int drm_fd; igt_display_t display;tests/kms_panel_fitting.c +0
-3-int image_w; -int image_h; -struct
igt_fbfb1;
structigt_fbfb2;tests/kms_panel_fitting.c +0
-4-struct igt_fb fb3; -int fb_id1; -int fb_id2; -int fb_id3;
igt_plane_t*plane1;
igt_plane_t*plane2;tests/kms_panel_fitting.c +0
-0@@ -58,18 +51,17 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, igt_output_set_pipe(output, pipe);
/* before allocating, free if any older fb */tests/kms_panel_fitting.c +1
-1-if (data->fb_id1) { +if (data->fb1.fb_id) {
igt_remove_fb(data->drm_fd, &data->fb1);tests/kms_panel_fitting.c +1
-1- data->fb_id1 =0 ; + data->fb1.fb_id =0 ;}
/* allocate fb for plane 1 */tests/kms_panel_fitting.c +0
-2- data->fb_id1 = igt_create_pattern_fb(data->drm_fd, - mode->hdisplay,
mode->vdisplay,tests/kms_panel_fitting.c +0
-2-DRM_FORMAT_XRGB8888 , -LOCAL_DRM_FORMAT_MOD
_NONE,tests/kms_panel_fitting.c +5
-2- &data->fb1); -igt_assert (data->fb_id1); +igt_create_pattern_fb (data->drm_fd, + mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + &data->fb1);
/*
* We always set the primary plane to actually enable the pipe astests/kms_panel_fitting.c +0
-0@@ -91,17 +83,13 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane) { igt_display_t *display = &data->display;tests/kms_panel_fitting.c +1
-1-if (data->fb_id1) { +if (data->fb1.fb_id) {
igt_remove_fb(data->drm_fd, &data->fb1);tests/kms_panel_fitting.c +1
-1- data->fb_id1 =0 ; + data->fb1.fb_id =0 ;}
tests/kms_panel_fitting.c +1
-1-if (data->fb_id2) { +if (data->fb2.fb_id) {
igt_remove_fb(data->drm_fd, &data->fb2);tests/kms_panel_fitting.c +1
-5- data->fb_id2 =0 ; - } -if (data->fb_id3) { -igt_remove_fb (data->drm_fd, &data->fb3); - data->fb_id3 =0 ; + data->fb2.fb_id =0 ;}
if (plane->type!=DRM_PLANE_TYPE_PRIMARY) {tests/kms_panel_fitting.c +0
-1@@ -121,7 +109,6 @@ static void test_panel_fitting(data_t *d) { igt_display_t *display = &d->display; igt_output_t *output; -cairo_surface_t *image; enum pipe pipe; int valid_tests = 0;tests/kms_panel_fitting.c +0
-0@@ -146,18 +133,11 @@ static void test_panel_fitting(data_t *d) mode = igt_output_get_mode(output); native_mode = *mode;tests/kms_panel_fitting.c +0
-2-/* allocate fb2 with image size */ - image =
igt_cairo_image_surface_create_from_png(FILE_NAME);tests/kms_panel_fitting.c +0
-1- igt_assert(cairo_surface_status(image) ==
CAIRO_STATUS_SUCCESS);tests/kms_panel_fitting.c +0
-7- d->image_w =cairo_image_surface_get_width (image); - d->image_h =cairo_image_surface_get_height (image); -cairo_surface_destroy (image); - - d->fb_id2 =igt_create_image_fb (d->drm_fd,0 ,0 , -DRM_FORMAT_XRGB8888 , - LOCAL_DRM_FORMAT_MOD
_NONE,tests/kms_panel_fitting.c +5
-2- FILE_NAME, &d->fb2); -igt_assert (d->fb_id2); +/* allocate fb2 with image */ +igt_create_image_fb (d->drm_fd,0 ,0 , + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + FILE_NAME, &d->fb2);
/* Set up display to enable panel fitting */mode->hdisplay= 640;
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 2/9 tests/kms_atomic: Add the test for CRTC_ID/FB_ID mismatch.
In reply to Maarten LankhorstThis check was missing, and caused a WARN_ON that dates back to the original design of atomic.
---
Sent to see if it passes shards, doesn't need to be reviewed further.
tests/kms_atomic.c | 8 ++++++++ 1 file changed, 8 insertions(+)
tests/kms_atomic.c +8 -0
@@ -485,6 +485,10 @@ static void plane_invalid_params(igt_pipe_t *pipe,igt_plane_set_prop_value (plane,IGT_PLANE_FB_ID , pipe->values[IGT_CRTC_MODE_ID ]);plane_commit_atomic_err (plane,ATOMIC_RELAX_NONE ,EINVAL ); +/* Valid, but invalid because CRTC_ID is set. */ +igt_plane_set_prop_value (plane,IGT_PLANE_FB_ID ,0 ); +plane_commit_atomic_err (plane,ATOMIC_RELAX_NONE ,EINVAL ); +igt_plane_set_fb (plane, fb);plane_commit (plane,COMMIT_ATOMIC ,ATOMIC_RELAX_NONE );
@@ -501,6 +505,10 @@ static void plane_invalid_params(igt_pipe_t *pipe,igt_plane_set_prop_value (plane,IGT_PLANE_CRTC_ID , pipe->values[IGT_CRTC_MODE_ID ]);plane_commit_atomic_err (plane,ATOMIC_RELAX_NONE ,EINVAL ); +/* Valid, but invalid because FB_ID is set. */ +igt_plane_set_prop_value (plane,IGT_PLANE_CRTC_ID ,0 ); +plane_commit_atomic_err (plane,ATOMIC_RELAX_NONE ,EINVAL ); +igt_plane_set_fb (plane, fb);plane_commit (plane,COMMIT_ATOMIC ,ATOMIC_RELAX_NONE );
Signature · 6 lines
2.15.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 2/9] tests/kms_atomic: Add the test for CRTC_ID/FB_ID mismatch.
Quoted 7 lines · Maarten Lankhorst
This check was missing, and caused a
WARN_ONthat dates back to the original design of atomic.Signed-off-by Maarten Lankhorst <[email protected]>Acked-by Daniel Vetter <[email protected]>---
Sent to see if it passes shards, doesn't need to be reviewed further.
I reviewed it anyway
Quoted 34 lines
tests/kms_atomic.c | 8 ++++++++
1 file changed, 8 insertions(+)tests/kms_atomic.c +0
-0@@ -485,6 +485,10 @@ static void plane_invalid_params(igt_pipe_t *pipe,igt_plane_set_prop_value(plane,
IGT_PLANE_FB_ID, pipe-Quoted 1 line
values[IGT_CRTC_MODE_ID]);
plane_commit_atomic_err(plane, ATOMIC_RELAX_NONE, EINVAL);tests/kms_atomic.c +4
-0+/* Valid, but invalid because CRTC_ID is set. */ +igt_plane_set_prop_value (plane,IGT_PLANE_FB_ID ,0 ); +plane_commit_atomic_err (plane,ATOMIC_RELAX_NONE ,EINVAL ); +
igt_plane_set_fb(plane, fb);plane_commit(plane, COMMIT_ATOMIC, ATOMIC_RELAX_NONE);tests/kms_atomic.c +0
-0@@ -501,6 +505,10 @@ static void plane_invalid_params(igt_pipe_t *pipe,igt_plane_set_prop_value(plane,
IGT_PLANE_CRTC_ID, pipe-Quoted 1 line
values[IGT_CRTC_MODE_ID]);
plane_commit_atomic_err(plane, ATOMIC_RELAX_NONE, EINVAL);tests/kms_atomic.c +4
-0+/* Valid, but invalid because FB_ID is set. */ +igt_plane_set_prop_value (plane,IGT_PLANE_CRTC_ID ,0 ); +plane_commit_atomic_err (plane,ATOMIC_RELAX_NONE ,EINVAL ); +
igt_plane_set_fb(plane, fb);plane_commit(plane, COMMIT_ATOMIC, ATOMIC_RELAX_NONE);
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 3/9 tests/kms_plane_scaling: Test all pixel formats in pipe-*-scaler-with-rotation
In reply to Maarten LankhorstThis will allow us to test NV12 as well, when available.
--- tests/kms_plane_scaling.c | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-)
tests/kms_plane_scaling.c +29 -17
@@ -164,25 +164,13 @@ static const igt_rotation_t rotations[] = { IGT_ROTATION_270, }; -static void test_scaler_with_rotation_pipe (data_t *d,enum pipe pipe, -igt_output_t *output) +static bool can_rotate (unsigned format) { -igt_display_t *display = &d->display; -igt_plane_t *plane; - -igt_output_set_pipe (output, pipe); -for_each_plane_on_pipe (display, pipe, plane) { -if (plane->type ==DRM_PLANE_TYPE_CURSOR ) -continue ; +if (format ==DRM_FORMAT_C8 || + format ==DRM_FORMAT_RGB565 ) +return false; -for (int i =0 ; i <ARRAY_SIZE (rotations); i++) { -igt_rotation_t rot = rotations[i]; - -check_scaling_pipe_plane_rot (d, plane,DRM_FORMAT_XRGB8888 , -LOCAL_I915_FORMAT_MOD_Y_TILED , - pipe, output, rot); - } - } +return true; }static bool can_draw (uint32_t drm_format)
@@ -199,6 +187,30 @@ static bool can_draw(uint32_t drm_format)return false; } +static void test_scaler_with_rotation_pipe (data_t *d,enum pipe pipe, +igt_output_t *output) +{ +igt_display_t *display = &d->display; +igt_plane_t *plane; + +igt_output_set_pipe (output, pipe); +for_each_plane_on_pipe (display, pipe, plane) { +if (plane->type ==DRM_PLANE_TYPE_CURSOR ) +continue ; + +for (int i =0 ; i <ARRAY_SIZE (rotations); i++) { +igt_rotation_t rot = rotations[i]; +for (int j =0 ; j < plane->drm_plane->count_formats; j++) { +unsigned format = plane->drm_plane->formats[j]; +if (can_draw (format) &&can_rotate (format)) +check_scaling_pipe_plane_rot (d, plane, format, +LOCAL_I915_FORMAT_MOD_Y_TILED , + pipe, output, rot); + } + } + } +} +static const uint64_t tilings[] = {LOCAL_DRM_FORMAT_MOD_NONE ,LOCAL_I915_FORMAT_MOD_X_TILED ,
Signature · 6 lines
2.15.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 3/9] tests/kms_plane_scaling: Test all pixel formats in pipe-*-scaler-with-rotation
Quoted 2 lines · Maarten Lankhorst
This will allow us to test NV12 as well, when available.
Quoted 83 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_plane_scaling.c | 46 +++++++++++++++++++++++++++++------
-----------1 file changed, 29 insertions(+), 17 deletions(-)tests/kms_plane_scaling.c +0
-0@@ -164,25 +164,13 @@ static const igt_rotation_t rotations[] = { IGT_ROTATION_270, };
-static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,tests/kms_plane_scaling.c +1
-1- igt_output_t *output) +static bool can_rotate (unsigned format){
tests/kms_plane_scaling.c +3
-7-igt_display_t *display = &d->display; -igt_plane_t *plane; - -igt_output_set_pipe (output, pipe); -for_each_plane_on_pipe (display, pipe, plane) { -if (plane->type ==DRM_PLANE_TYPE_CURSOR ) -continue ; +if (format ==DRM_FORMAT_C8 || + format == DRM_FORMAT_RGB565) +return false;tests/kms_plane_scaling.c +0
-4-for (int i =0 ; i <ARRAY_SIZE (rotations); i++) { -igt_rotation_t rot = rotations[i]; - - check_scaling_pipe_plane_rot(d, plane,
DRM_FORMAT_XRGB8888,tests/kms_plane_scaling.c +0
-1- LOCAL_I915_FORM
AT_MOD_Y_TILED,tests/kms_plane_scaling.c +0
-1- pipe, output,rot);
tests/kms_plane_scaling.c +1
-2- } - } +return true;}
static boolcan_draw(uint32_t drm_format)tests/kms_plane_scaling.c +0
-0@@ -199,6 +187,30 @@ static bool can_draw(uint32_t drm_format) return false; }
+static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,tests/kms_plane_scaling.c +13
-0+ igt_output_t *output) +{ + igt_display_t *display = &d->display; + igt_plane_t *plane; + + igt_output_set_pipe(output, pipe); + for_each_plane_on_pipe(display, pipe, plane) { + if (plane->type == DRM_PLANE_TYPE_CURSOR) + continue; + + for (int i = 0; i < ARRAY_SIZE(rotations); i++) { + igt_rotation_t rot = rotations[i]; + for (int j = 0; j < plane->drm_plane-Quoted 1 line
count_formats; j++) {tests/kms_plane_scaling.c +1
-0+ unsigned format = plane->drm_plane-Quoted 1 line
formats[j];
tests/kms_plane_scaling.c +1
-0+ if (can_draw(format) &&
can_rotate(format))tests/kms_plane_scaling.c +1
-0+ check_scaling_pipe_plane_rot(d, plane, format,
tests/kms_plane_scaling.c +1
-0+LOCAL_I915_FORMAT_MOD_Y_TILED,
tests/kms_plane_scaling.c +1
-0+pipe, output, rot);
tests/kms_plane_scaling.c +5
-0+ } + } + } +} +static const
uint64_ttilings[] = {
LOCAL_DRM_FORMAT_MOD_NONE,
LOCAL_I915_FORMAT_MOD_X_TILED,
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Mika Kahola
Reviewed-byRe: [igt-dev] [PATCH i-g-t 3/9] tests/kms_plane_scaling: Test all pixel formats in pipe-*-scaler-with-rotation
Quoted 4 lines · Mika Kahola
Quoted 3 lines · Maarten Lankhorst
This will allow us to test NV12 as well, when available.
Oops, typo in email address. Now fixed.
Quoted 93 lines
Quoted 93 lines
Signed-off-by Maarten Lankhorst <[email protected]Quoted 1 line
---
tests/kms_plane_scaling.c | 46 +++++++++++++++++++++++++++++------
-----------1 file changed, 29 insertions(+), 17 deletions(-)tests/kms_plane_scaling.c +0
-0@@ -164,25 +164,13 @@ static const igt_rotation_t rotations[] = { IGT_ROTATION_270, };
-static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,tests/kms_plane_scaling.c +1
-1- igt_output_t *output) +static bool can_rotate (unsigned format){
tests/kms_plane_scaling.c +3
-7-igt_display_t *display = &d->display; -igt_plane_t *plane; - -igt_output_set_pipe (output, pipe); -for_each_plane_on_pipe (display, pipe, plane) { -if (plane->type ==DRM_PLANE_TYPE_CURSOR ) -continue ; +if (format ==DRM_FORMAT_C8 || + format == DRM_FORMAT_RGB565) +return false;tests/kms_plane_scaling.c +0
-4-for (int i =0 ; i <ARRAY_SIZE (rotations); i++) { -igt_rotation_t rot = rotations[i]; - - check_scaling_pipe_plane_rot(d, plane,
DRM_FORMAT_XRGB8888,tests/kms_plane_scaling.c +0
-1- LOCAL_I915_FORM
AT_MOD_Y_TILED,tests/kms_plane_scaling.c +0
-1- pipe, output,rot);
tests/kms_plane_scaling.c +1
-2- } - } +return true;}
static boolcan_draw(uint32_t drm_format)tests/kms_plane_scaling.c +0
-0@@ -199,6 +187,30 @@ static bool can_draw(uint32_t drm_format) return false; }
+static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,tests/kms_plane_scaling.c +13
-0+ igt_output_t *output) +{ + igt_display_t *display = &d->display; + igt_plane_t *plane; + + igt_output_set_pipe(output, pipe); + for_each_plane_on_pipe(display, pipe, plane) { + if (plane->type == DRM_PLANE_TYPE_CURSOR) + continue; + + for (int i = 0; i < ARRAY_SIZE(rotations); i++) { + igt_rotation_t rot = rotations[i]; + for (int j = 0; j < plane->drm_plane-Quoted 2 lines
count_formats; j++) {tests/kms_plane_scaling.c +1
-0+ unsigned format = plane-Quoted 3 lines
drm_plane-
formats[j];
tests/kms_plane_scaling.c +1
-0+ if (can_draw(format) &&
can_rotate(format))tests/kms_plane_scaling.c +1
-0+ check_scaling_pipe_plane_rot
(d, plane, format,tests/kms_plane_scaling.c +1
-0+
LOCAL_I915_FORMAT_MOD_Y_TILED,tests/kms_plane_scaling.c +1
-0+
pipe, output, rot);tests/kms_plane_scaling.c +5
-0+ } + } + } +} +static const
uint64_ttilings[] = {
LOCAL_DRM_FORMAT_MOD_NONE,
LOCAL_I915_FORMAT_MOD_X_TILED,
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 4/9 tests/kms_plane_scaling: Test all pixel formats with clamping and clipping too
In reply to Maarten LankhorstRun across all combinations of pixel formats to ensure better testing.
--- tests/kms_plane_scaling.c | 61 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 18 deletions(-)
tests/kms_plane_scaling.c +43 -18
@@ -58,14 +58,10 @@ static int get_num_scalers(uint32_t devid, enum pipe pipe)return 1 ; } -static void cleanup_crtc (data_t *data) +static void cleanup_fbs (data_t *data) {int i; -igt_display_reset (&data->display); -igt_pipe_crc_free (data->pipe_crc); - data->pipe_crc =NULL ; -for (i =0 ; i <ARRAY_SIZE (data->fb); i++) {if (!data->fb[i].fb_id)continue ;
@@ -75,6 +71,15 @@ static void cleanup_crtc(data_t *data) } } +static void cleanup_crtc (data_t *data) +{ +igt_display_reset (&data->display); +igt_pipe_crc_free (data->pipe_crc); + data->pipe_crc =NULL ; + +cleanup_fbs (data); +} +static void prepare_crtc (data_t *data,igt_output_t *output,enum pipe pipe,igt_plane_t *plane,drmModeModeInfo *mode) {
@@ -401,28 +406,20 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output) }static void -test_scaler_with_clipping_clamping_scenario (data_t *d,enum pipe pipe,igt_output_t *output) +__test_scaler_with_clipping_clamping_scenario (data_t *d,drmModeModeInfo *mode, +uint32_t f1,uint32_t f2) { -drmModeModeInfo *mode; - -igt_require (get_num_scalers (d->devid, pipe) >=2 ); - - mode =igt_output_get_mode (output); - d->plane1 = &d->display.pipes[pipe].planes[0 ]; -prepare_crtc (d, output, pipe, d->plane1, mode); +cleanup_fbs (d);igt_create_pattern_fb (d->drm_fd, - mode->hdisplay, mode->vdisplay, -DRM_FORMAT_XRGB8888 , + mode->hdisplay, mode->vdisplay, f1,LOCAL_I915_FORMAT_MOD_X_TILED , &d->fb[1 ]);igt_create_pattern_fb (d->drm_fd, - mode->hdisplay, mode->vdisplay, -DRM_FORMAT_XRGB8888 , + mode->hdisplay, mode->vdisplay, f2,LOCAL_I915_FORMAT_MOD_Y_TILED , &d->fb[2 ]);igt_plane_set_fb (d->plane1, &d->fb[1 ]); - d->plane2 =igt_output_get_plane (output,1 );igt_plane_set_fb (d->plane2, &d->fb[2 ]);igt_fb_set_position (&d->fb[1 ], d->plane1,0 ,0 );
@@ -440,6 +437,34 @@ test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe, igt_outpuigt_display_commit2 (&d->display,COMMIT_ATOMIC ); } +static void +test_scaler_with_clipping_clamping_scenario (data_t *d,enum pipe pipe,igt_output_t *output) +{ +drmModeModeInfo *mode; + +igt_require (get_num_scalers (d->devid, pipe) >=2 ); + + mode =igt_output_get_mode (output); + d->plane1 = &d->display.pipes[pipe].planes[0 ]; + d->plane2 = &d->display.pipes[pipe].planes[1 ]; +prepare_crtc (d, output, pipe, d->plane1, mode); + +for (int i =0 ; i < d->plane1->drm_plane->count_formats; i++) { +unsigned f1 = d->plane1->drm_plane->formats[i]; +if (!can_draw (f1)) +continue ; + +for (int j =0 ; j < d->plane2->drm_plane->count_formats; j++) { +unsigned f2 = d->plane2->drm_plane->formats[j]; + +if (!can_draw (f2)) +continue ; + +__test_scaler_with_clipping_clamping_scenario (d, mode, f1, f2); + } + } +} +static void find_connected_pipe (igt_display_t *display,bool second,enum pipe *pipe,igt_output_t **output) {enum pipe first =PIPE_NONE ;
Signature · 6 lines
2.15.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 4/9] tests/kms_plane_scaling: Test all pixel formats with clamping and clipping too
Quoted 3 lines · Maarten Lankhorst
Run across all combinations of pixel formats to ensure better testing.
Quoted 127 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_plane_scaling.c | 61 +++++++++++++++++++++++++++++++++--
------------1 file changed, 43 insertions(+), 18 deletions(-)tests/kms_plane_scaling.c +0
-0@@ -58,14 +58,10 @@ static int get_num_scalers(uint32_t devid, enum pipe pipe) return 1; }tests/kms_plane_scaling.c +1
-1-static void cleanup_crtc (data_t *data) +static void cleanup_fbs (data_t *data){
int i;tests/kms_plane_scaling.c +0
-4-igt_display_reset (&data->display); -igt_pipe_crc_free (data->pipe_crc); - data->pipe_crc =NULL ; -for (i = 0; i <
ARRAY_SIZE(data->fb); i++) { if (!data->fb[i].fb_id) continue;tests/kms_plane_scaling.c +0
-0@@ -75,6 +71,15 @@ static void cleanup_crtc(data_t *data) } }tests/kms_plane_scaling.c +9
-0+static void cleanup_crtc (data_t *data) +{ +igt_display_reset (&data->display); +igt_pipe_crc_free (data->pipe_crc); + data->pipe_crc =NULL ; + +cleanup_fbs (data); +} +static void prepare_crtc(data_t *data,
igt_output_t*output, enum pipe pipe,
igt_plane_t*plane, drmModeModeInfo *mode) {tests/kms_plane_scaling.c +0
-0@@ -401,28 +406,20 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output) }
static void -test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe,igt_output_t*output) +__test_scaler_with_clipping_clamping_scenario(data_t *d, drmModeModeInfo *mode,tests/kms_plane_scaling.c +1
-0+ uint32_t f1, uint32_tf2)
{tests/kms_plane_scaling.c +1
-7-drmModeModeInfo *mode; - -igt_require (get_num_scalers (d->devid, pipe) >=2 ); - - mode =igt_output_get_mode (output); - d->plane1 = &d->display.pipes[pipe].planes[0 ]; -prepare_crtc (d, output, pipe, d->plane1, mode); +cleanup_fbs (d);
igt_create_pattern_fb(d->drm_fd,tests/kms_plane_scaling.c +1
-2- mode->hdisplay, mode->vdisplay, - DRM_FORMAT_XRGB8888, + mode->hdisplay, mode->vdisplay, f1,LOCAL_I915_FORMAT_MOD_X_TILED, &d-
Quoted 1 line
fb[1]);
igt_create_pattern_fb(d->drm_fd,tests/kms_plane_scaling.c +1
-2- mode->hdisplay, mode->vdisplay, - DRM_FORMAT_XRGB8888, + mode->hdisplay, mode->vdisplay, f2,LOCAL_I915_FORMAT_MOD_Y_TILED, &d-
Quoted 1 line
fb[2]);
igt_plane_set_fb(d->plane1, &d->fb[1]);tests/kms_plane_scaling.c +0
-1- d->plane2 =igt_output_get_plane (output,1 );
igt_plane_set_fb(d->plane2, &d->fb[2]);
igt_fb_set_position(&d->fb[1], d->plane1, 0, 0);tests/kms_plane_scaling.c +0
-0@@ -440,6 +437,34 @@test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe,
igt_outpu
igt_display_commit2(&d->display, COMMIT_ATOMIC); }tests/kms_plane_scaling.c +2
-0+static void +test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipepipe,
igt_output_t*output)tests/kms_plane_scaling.c +11
-0+{ +drmModeModeInfo *mode; + +igt_require (get_num_scalers (d->devid, pipe) >=2 ); + + mode =igt_output_get_mode (output); + d->plane1 = &d->display.pipes[pipe].planes[0 ]; + d->plane2 = &d->display.pipes[pipe].planes[1 ]; +prepare_crtc (d, output, pipe, d->plane1, mode); + + for (int i = 0; i < d->plane1->drm_plane->count_formats;i++) {
tests/kms_plane_scaling.c +5
-0+unsigned f1 = d->plane1->drm_plane->formats[i]; +if (!can_draw (f1)) +continue ; + + for (int j = 0; j < d->plane2->drm_plane-Quoted 1 line
count_formats; j++) {tests/kms_plane_scaling.c +1
-0+ unsigned f2 = d->plane2->drm_plane-Quoted 1 line
formats[j];
tests/kms_plane_scaling.c +5
-0+ +if (!can_draw (f2)) +continue ; + + __test_scaler_with_clipping_clamping_scenari
o(d, mode, f1, f2);tests/kms_plane_scaling.c +4
-0+ } + } +} +static void
find_connected_pipe(igt_display_t *display, bool second, enum pipe *pipe, igt_output_t **output)
{
enum pipe first =PIPE_NONE;
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 5/9 tests/kms_rotation_crc: Fix bad-tiling testcase.
In reply to Maarten Lankhorstbad-tiling test didn't work, LOCAL_DRM_FORMAT_MODE_NONE == 0, so the fb was created with tiling = Y, but because test_bad_format was set but override_tiling wasn't, we fell through to the success case. Always assume failure if test_bad_format is set, and pass X tiled for fb, so the format override works.
Also clear variables after subtests in main, so if the next subtest doesn't run we still clear the variables.
--- tests/kms_rotation_crc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
tests/kms_rotation_crc.c +7 -5
@@ -423,7 +423,7 @@ static void __test_plane_rotation(data_t *data, int plane_type, bool test_bad_foigt_plane_set_size (plane, data->fb.height, data->fb.width); ret =igt_display_try_commit2 (display, commit); -if (test_bad_format && (data->override_fmt || data->override_tiling)) { +if (test_bad_format) {igt_assert_eq (ret, -EINVAL );continue ; }
@@ -787,6 +787,7 @@ igt_maintest_plane_rotation (&data, subtest->plane); } } + data.flips =0 ; igt_subtest_f("sprite-rotation-90-pos-100-0") {igt_require (gen >=9 );
@@ -795,23 +796,24 @@ igt_main data.pos_y =0 ;test_plane_rotation (&data,DRM_PLANE_TYPE_OVERLAY ); } + data.pos_x =0 , + data.pos_y =0 ; igt_subtest_f("bad-pixel-format") {igt_require (gen >=9 ); - data.pos_x =0 , - data.pos_y =0 ; data.rotation =IGT_ROTATION_90 ; data.override_fmt =DRM_FORMAT_RGB565 ;test_bad_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY ); } + data.override_fmt =0 ; igt_subtest_f("bad-tiling") {igt_require (gen >=9 ); - data.override_fmt =0 ; data.rotation =IGT_ROTATION_90 ; - data.override_tiling =LOCAL_DRM_FORMAT_MOD_NONE ; + data.override_tiling =LOCAL_I915_FORMAT_MOD_X_TILED ;test_bad_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY ); } + data.override_tiling =0 ; igt_subtest_f("primary-rotation-90-Y-tiled") {enum pipe pipe;
Signature · 6 lines
2.15.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 5/9] tests/kms_rotation_crc: Fix bad-tiling testcase.
Quoted 9 lines · Maarten Lankhorst
bad-tiling test didn't work,
LOCAL_DRM_FORMAT_MODE_NONE== 0, so the fb was created with tiling = Y, but becausetest_bad_formatwas set butoverride_tilingwasn't, we fell through to the success case. Always assume failure iftest_bad_formatis set, and pass X tiled for fb, so the format override works.Also clear variables after subtests in main, so if the next subtest doesn't run we still clear the variables.
Quoted 62 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_rotation_crc.c | 12 +++++++-----1 file changed, 7 insertions(+), 5 deletions(-)tests/kms_rotation_crc.c +0
-0@@ -423,7 +423,7 @@ static void __test_plane_rotation(data_t *data,int
plane_type, booltest_bad_foigt_plane_set_size(plane, data-Quoted 1 line
fb.height,
data->fb.width);
ret =igt_display_try_commit2(display, commit);tests/kms_rotation_crc.c +0
-1- if (test_bad_format && (data->override_fmt||
data->override_tiling)) {tests/kms_rotation_crc.c +1
-0+if (test_bad_format) {
igt_assert_eq(ret, -EINVAL); continue;
}tests/kms_rotation_crc.c +1
-0@@ -787,6 +787,7 @@ igt_main test_plane_rotation(&data, subtest->plane); } } + data.flips =0 ;
igt_subtest_f("sprite-rotation-90-pos-100-0"){igt_require(gen >= 9);tests/kms_rotation_crc.c +2
-0@@ -795,23 +796,24 @@ igt_main data.pos_y = 0; test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY); } + data.pos_x =0 , + data.pos_y =0 ;
igt_subtest_f("bad-pixel-format"){
igt_require(gen >= 9);tests/kms_rotation_crc.c +0
-2- data.pos_x =0 , - data.pos_y =0 ;data.rotation =
IGT_ROTATION_90; data.override_fmt =DRM_FORMAT_RGB565;test_bad_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
}tests/kms_rotation_crc.c +1
-0+ data.override_fmt =0 ;
igt_subtest_f("bad-tiling"){
igt_require(gen >= 9);tests/kms_rotation_crc.c +0
-1- data.override_fmt =0 ;data.rotation =
IGT_ROTATION_90;tests/kms_rotation_crc.c +1
-1- data.override_tiling =LOCAL_DRM_FORMAT_MOD_NONE ; + data.override_tiling =
LOCAL_I915_FORMAT_MOD_X_TILED;
test_bad_plane_rotation(&data,DRM_PLANE_TYPE_PRIMARY);
}tests/kms_rotation_crc.c +1
-0+ data.override_tiling =0 ;
igt_subtest_f("primary-rotation-90-Y-tiled"){ enum pipe pipe;
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 6/9 tests/kms_rotation_crc: Move bad_format parameter to test_plane_rotation
In reply to Maarten LankhorstInstead of 2 functions doing the same thing, consolidate to a single function.
--- tests/kms_rotation_crc.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-)
tests/kms_rotation_crc.c +6 -16
@@ -368,7 +368,7 @@ static void wait_for_pageflip(int fd)igt_assert (drmHandleEvent (fd, &evctx) ==0 ); } -static void __test_plane_rotation (data_t *data,int plane_type,bool test_bad_format) +static void test_plane_rotation (data_t *data,int plane_type,bool test_bad_format) {igt_display_t *display = &data->display;igt_output_t *output;
@@ -468,16 +468,6 @@ static void __test_plane_rotation(data_t *data, int plane_type, bool test_bad_foigt_require_f (valid_tests,"no valid crtc/connector combinations found\n" ); } -static inline void test_bad_plane_rotation (data_t *data,int plane_type) -{ -__test_plane_rotation (data, plane_type, true); -} - -static inline void test_plane_rotation (data_t *data,int plane_type) -{ -__test_plane_rotation (data, plane_type, false); -} -static void test_plane_rotation_ytiled_obj (data_t *data,igt_output_t *output,int plane_type)
@@ -784,7 +774,7 @@ igt_main gen >= 9); data.rotation = subtest->rot; data.flips = subtest->flips; -test_plane_rotation (&data, subtest->plane); +test_plane_rotation (&data, subtest->plane, false); } } data.flips =0 ;
@@ -794,7 +784,7 @@ igt_main data.rotation =IGT_ROTATION_90 ; data.pos_x =100 , data.pos_y =0 ; -test_plane_rotation (&data,DRM_PLANE_TYPE_OVERLAY ); +test_plane_rotation (&data,DRM_PLANE_TYPE_OVERLAY , false); } data.pos_x =0 , data.pos_y =0 ;
@@ -803,7 +793,7 @@ igt_mainigt_require (gen >=9 ); data.rotation =IGT_ROTATION_90 ; data.override_fmt =DRM_FORMAT_RGB565 ; -test_bad_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY ); +test_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY , true); } data.override_fmt =0 ;
@@ -811,7 +801,7 @@ igt_mainigt_require (gen >=9 ); data.rotation =IGT_ROTATION_90 ; data.override_tiling =LOCAL_I915_FORMAT_MOD_X_TILED ; -test_bad_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY ); +test_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY , true); } data.override_tiling =0 ;
@@ -846,7 +836,7 @@ igt_main data.rotation = (IGT_REFLECT_X | reflect_x->rot); data.override_tiling = reflect_x->tiling; data.flips = reflect_x->flips; -test_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY ); +test_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY , false); } }
Signature · 6 lines
2.15.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 6/9] tests/kms_rotation_crc: Move bad_format parameter to test_plane_rotation
Quoted 3 lines · Maarten Lankhorst
Instead of 2 functions doing the same thing, consolidate to a single function.
Quoted 95 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_rotation_crc.c | 22 ++++++----------------1 file changed, 6 insertions(+), 16 deletions(-)tests/kms_rotation_crc.c +0
-0@@ -368,7 +368,7 @@ static void wait_for_pageflip(int fd) igt_assert(drmHandleEvent(fd, &evctx) == 0); }
-static void__test_plane_rotation(data_t *data, int plane_type, bool test_bad_format)
+static voidtest_plane_rotation(data_t *data, int plane_type, bool test_bad_format)
{
igt_display_t*display =&data->display;igt_output_t*output;tests/kms_rotation_crc.c +0
-0@@ -468,16 +468,6 @@ static void __test_plane_rotation(data_t *data,int
plane_type, booltest_bad_foigt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
}
-static inline voidtest_bad_plane_rotation(data_t *data, int plane_type)tests/kms_rotation_crc.c +0
-9-{ -__test_plane_rotation (data, plane_type, true); -} - -static inline void test_plane_rotation (data_t *data,int plane_type) -{ -__test_plane_rotation (data, plane_type, false); -} -static void
test_plane_rotation_ytiled_obj(data_t *data, igt_output_t *output, int plane_type)tests/kms_rotation_crc.c +1
-1@@ -784,7 +774,7 @@ igt_main gen >= 9); data.rotation = subtest->rot; data.flips = subtest->flips; -test_plane_rotation (&data, subtest->plane); +test_plane_rotation (&data, subtest->plane, false); } }data.flips = 0;
tests/kms_rotation_crc.c +1
-1@@ -794,7 +784,7 @@ igt_main data.rotation = IGT_ROTATION_90; data.pos_x = 100, data.pos_y = 0; -test_plane_rotation (&data,DRM_PLANE_TYPE_OVERLAY ); +test_plane_rotation (&data,DRM_PLANE_TYPE_OVERLAY , false); } data.pos_x = 0,data.pos_y = 0;
tests/kms_rotation_crc.c +1
-1@@ -803,7 +793,7 @@ igt_main igt_require(gen >= 9); data.rotation = IGT_ROTATION_90; data.override_fmt = DRM_FORMAT_RGB565; -test_bad_plane_rotation (&data, DRM_PLANE_TYPE_PRIMARY); +test_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY , true); }data.override_fmt = 0;
tests/kms_rotation_crc.c +0
-0@@ -811,7 +801,7 @@ igt_main igt_require(gen >= 9); data.rotation = IGT_ROTATION_90;data.override_tiling =
LOCAL_I915_FORMAT_MOD_X_TILED;tests/kms_rotation_crc.c +0
-1- test_bad_plane_rotation(&data,
DRM_PLANE_TYPE_PRIMARY);tests/kms_rotation_crc.c +1
-0+ test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY,true);
}
data.override_tiling = 0;tests/kms_rotation_crc.c +0
-0@@ -846,7 +836,7 @@ igt_maindata.rotation = (
IGT_REFLECT_X| reflect_x-Quoted 1 line
rot);
data.override_tiling =
reflect_x->tiling; data.flips =reflect_x->flips;tests/kms_rotation_crc.c +0
-1- test_plane_rotation(&data,
DRM_PLANE_TYPE_PRIMARY);tests/kms_rotation_crc.c +1
-0+ test_plane_rotation(&data,
DRM_PLANE_TYPE_PRIMARY, false);
}
}
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 7/9 tests/kms_rotation_crc: Always run the flip tests when available.
In reply to Maarten LankhorstThe -flip tests are the same, but with a pageflip at the end, since the test is otherwise the same, run the test once with flips always enabled when possible.
--- tests/kms_rotation_crc.c | 106 +++++++++++++++-------------------------------- 1 file changed, 34 insertions(+), 72 deletions(-)
tests/kms_rotation_crc.c +34 -72
@@ -43,7 +43,6 @@ typedef struct {int pos_y;uint32_t override_fmt;uint64_t override_tiling; -bool flips;int devid; } data_t;
@@ -260,7 +259,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,/* * Create a reference software rotated flip framebuffer. */ -if (data->flips) { +if (plane->type ==DRM_PLANE_TYPE_PRIMARY || display->is_atomic) {igt_create_fb (data->gfx_fd, ref_w, ref_h, pixel_format, tiling, &data->fb_flip); paint_squares(data, data->rotation, &data->fb_flip,
@@ -272,6 +271,15 @@ static void prepare_fbs(data_t *data, igt_output_t *output, display->is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);igt_pipe_crc_collect_crc (data->pipe_crc, &data->flip_crc); + +/* +* Prepare the non-rotated flip fb. +*/ +igt_remove_fb (data->gfx_fd, &data->fb_flip); +igt_create_fb (data->gfx_fd, w, h, pixel_format, tiling, + &data->fb_flip); +paint_squares (data,IGT_ROTATION_0 , &data->fb_flip, + flip_opacity); }/*
@@ -308,18 +316,6 @@ static void prepare_fbs(data_t *data, igt_output_t *output,if (plane->type !=DRM_PLANE_TYPE_CURSOR )igt_plane_set_position (plane, data->pos_x, data->pos_y); - -/* -* Prepare the non-rotated flip fb. -*/ -if (data->flips) { -igt_remove_fb (data->gfx_fd, &data->fb_flip); -igt_create_fb (data->gfx_fd, w, h, pixel_format, tiling, - &data->fb_flip); -paint_squares (data,IGT_ROTATION_0 , &data->fb_flip, - flip_opacity); - } - }static void cleanup_crtc (data_t *data,igt_output_t *output,igt_plane_t *plane)
@@ -378,9 +374,6 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_formenum igt_commit_style commit =COMMIT_LEGACY ;int ret; -if (data->flips && plane_type !=DRM_PLANE_TYPE_PRIMARY ) -igt_require (data->display.is_atomic); -if (plane_type ==DRM_PLANE_TYPE_PRIMARY || plane_type ==DRM_PLANE_TYPE_CURSOR ) commit =COMMIT_UNIVERSAL ;
@@ -439,7 +432,7 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form* If flips are requested flip to a different fb and * check CRC against that one as well. */ -if (data->flips) { +if (data->fb_flip.fb_id) {igt_plane_set_fb (plane, &data->fb_flip);if (data->rotation ==IGT_ROTATION_90 || data->rotation ==IGT_ROTATION_270 )igt_plane_set_size (plane, data->fb.height, data->fb.width);
@@ -688,63 +681,37 @@ static const char *tiling_test_str(uint64_t tiling) } } -static const char *flip_test_str (unsigned flips) -{ -if (flips) -return "-flip" ; -else -return "" ; -} - igt_main {struct rot_subtest {unsigned plane;igt_rotation_t rot; -bool flips; } *subtest, subtests[] = { - {DRM_PLANE_TYPE_PRIMARY ,IGT_ROTATION_90 ,0 }, - {DRM_PLANE_TYPE_PRIMARY ,IGT_ROTATION_180 ,0 }, - {DRM_PLANE_TYPE_PRIMARY ,IGT_ROTATION_270 ,0 }, - {DRM_PLANE_TYPE_PRIMARY ,IGT_ROTATION_90 ,1 }, - {DRM_PLANE_TYPE_PRIMARY ,IGT_ROTATION_180 ,1 }, - {DRM_PLANE_TYPE_PRIMARY ,IGT_ROTATION_270 ,1 }, - {DRM_PLANE_TYPE_OVERLAY ,IGT_ROTATION_90 ,0 }, - {DRM_PLANE_TYPE_OVERLAY ,IGT_ROTATION_180 ,0 }, - {DRM_PLANE_TYPE_OVERLAY ,IGT_ROTATION_270 ,0 }, - {DRM_PLANE_TYPE_OVERLAY ,IGT_ROTATION_90 ,1 }, - {DRM_PLANE_TYPE_OVERLAY ,IGT_ROTATION_180 ,1 }, - {DRM_PLANE_TYPE_OVERLAY ,IGT_ROTATION_270 ,1 }, - {DRM_PLANE_TYPE_CURSOR ,IGT_ROTATION_180 ,0 }, - {0 ,0 ,0 } + {DRM_PLANE_TYPE_PRIMARY ,IGT_ROTATION_90 }, + {DRM_PLANE_TYPE_PRIMARY ,IGT_ROTATION_180 }, + {DRM_PLANE_TYPE_PRIMARY ,IGT_ROTATION_270 }, + {DRM_PLANE_TYPE_OVERLAY ,IGT_ROTATION_90 }, + {DRM_PLANE_TYPE_OVERLAY ,IGT_ROTATION_180 }, + {DRM_PLANE_TYPE_OVERLAY ,IGT_ROTATION_270 }, + {DRM_PLANE_TYPE_CURSOR ,IGT_ROTATION_180 }, + {0 ,0 } };struct reflect_x {uint64_t tiling;igt_rotation_t rot; -bool flips; } *reflect_x, reflect_x_subtests[] = { - {LOCAL_I915_FORMAT_MOD_X_TILED ,IGT_ROTATION_0 ,0 }, - {LOCAL_I915_FORMAT_MOD_X_TILED ,IGT_ROTATION_180 ,0 }, - {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_0 ,0 }, - {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_90 ,0 }, - {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_180 ,0 }, - {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_270 ,0 }, - { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_0 ,0 }, - { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_90 ,0 }, - { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_180 ,0 }, - { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_270 ,0 }, - {LOCAL_I915_FORMAT_MOD_X_TILED ,IGT_ROTATION_0 ,1 }, - {LOCAL_I915_FORMAT_MOD_X_TILED ,IGT_ROTATION_180 ,1 }, - {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_0 ,1 }, - {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_90 ,1 }, - {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_180 ,1 }, - {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_270 ,1 }, - { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_0 ,1 }, - { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_90 ,1 }, - { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_180 ,1 }, - { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_270 ,1 }, - {0 ,0 ,0 } + {LOCAL_I915_FORMAT_MOD_X_TILED ,IGT_ROTATION_0 }, + {LOCAL_I915_FORMAT_MOD_X_TILED ,IGT_ROTATION_180 }, + {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_0 }, + {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_90 }, + {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_180 }, + {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_270 }, + { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_0 }, + { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_90 }, + { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_180 }, + { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_270 }, + {0 ,0 } };data_t data = {};
@@ -765,19 +732,16 @@ igt_main }for (subtest = subtests; subtest->rot; subtest++) { -igt_subtest_f ("%s-rotation-%s%s" , +igt_subtest_f ("%s-rotation-%s" ,plane_test_str (subtest->plane), -rot_test_str (subtest->rot), - flip_test_str(subtest->flips)) { + rot_test_str(subtest->rot)) {igt_require (!(subtest->rot & (IGT_ROTATION_90 |IGT_ROTATION_270 )) || gen >=9 ); data.rotation = subtest->rot; - data.flips = subtest->flips;test_plane_rotation (&data, subtest->plane, false); } } - data.flips =0 ; igt_subtest_f("sprite-rotation-90-pos-100-0") {igt_require (gen >=9 );
@@ -826,16 +790,14 @@ igt_main }for (reflect_x = reflect_x_subtests; reflect_x->tiling; reflect_x++) { -igt_subtest_f ("primary-%s-reflect-x-%s%s" , +igt_subtest_f ("primary-%s-reflect-x-%s" ,tiling_test_str (reflect_x->tiling), -rot_test_str (reflect_x->rot), - flip_test_str(reflect_x->flips)) { + rot_test_str(reflect_x->rot)) {igt_require (gen >=10 || (IS_CHERRYVIEW (data.devid) && reflect_x->rot ==IGT_ROTATION_0 && reflect_x->tiling ==LOCAL_I915_FORMAT_MOD_X_TILED )); data.rotation = (IGT_REFLECT_X | reflect_x->rot); data.override_tiling = reflect_x->tiling; - data.flips = reflect_x->flips;test_plane_rotation (&data,DRM_PLANE_TYPE_PRIMARY , false); } }
Signature · 6 lines
2.15.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 7/9] tests/kms_rotation_crc: Always run the flip tests when available.
Quoted 4 lines · Maarten Lankhorst
The -flip tests are the same, but with a pageflip at the end, since the test is otherwise the same, run the test once with flips always enabled when possible.
Quoted 253 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_rotation_crc.c | 106 +++++++++++++++--------------------
------------1 file changed, 34 insertions(+), 72 deletions(-)tests/kms_rotation_crc.c +0
-1@@ -43,7 +43,6 @@ typedef struct { int pos_y; uint32_t override_fmt; uint64_t override_tiling; -bool flips; int devid; } data_t;tests/kms_rotation_crc.c +1
-1@@ -260,7 +259,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output, /** Create a reference software rotated flip framebuffer. */ -if (data->flips) { +if (plane->type ==DRM_PLANE_TYPE_PRIMARY || display- >is_atomic) { igt_create_fb(data->gfx_fd, ref_w, ref_h,
pixel_format, tiling,
&data->fb_flip); paint_squares(data,data->rotation,&data->fb_flip,tests/kms_rotation_crc.c +0
-0@@ -272,6 +271,15 @@ static void prepare_fbs(data_t *data, igt_output_t *output,display->is_atomic ?
COMMIT_ATOMIC:COMMIT_UNIVERSAL); igt_pipe_crc_collect_crc(data->pipe_crc, &data-Quoted 1 line
flip_crc);tests/kms_rotation_crc.c +6
-0+ +/* +* Prepare the non-rotated flip fb. +*/ +igt_remove_fb (data->gfx_fd, &data->fb_flip); + igt_create_fb(data->gfx_fd, w, h, pixel_format,tiling,
tests/kms_rotation_crc.c +3
-0+ &data->fb_flip); +paint_squares (data,IGT_ROTATION_0 , &data->fb_flip, + flip_opacity);}
/*tests/kms_rotation_crc.c +0
-0@@ -308,18 +316,6 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
if (plane->type!=DRM_PLANE_TYPE_CURSOR) igt_plane_set_position(plane,data->pos_x, data-Quoted 1 line
pos_y);tests/kms_rotation_crc.c +0
-7- -/* -* Prepare the non-rotated flip fb. -*/ -if (data->flips) { -igt_remove_fb (data->gfx_fd, &data->fb_flip); - igt_create_fb(data->gfx_fd, w, h, pixel_format,tiling,
tests/kms_rotation_crc.c +0
-5- &data->fb_flip); -paint_squares (data,IGT_ROTATION_0 , &data->fb_flip, - flip_opacity); - } -}
static voidcleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)tests/kms_rotation_crc.c +0
-0@@ -378,9 +374,6 @@ static void test_plane_rotation(data_t *data, int
plane_type, booltest_bad_form
enumigt_commit_stylecommit =COMMIT_LEGACY; int ret;tests/kms_rotation_crc.c +0
-3-if (data->flips && plane_type !=DRM_PLANE_TYPE_PRIMARY ) -igt_require (data->display.is_atomic); -if (
plane_type==DRM_PLANE_TYPE_PRIMARY||plane_type==DRM_PLANE_TYPE_CURSOR)
commit =COMMIT_UNIVERSAL;tests/kms_rotation_crc.c +0
-0@@ -439,7 +432,7 @@ static void test_plane_rotation(data_t *data, int
plane_type, booltest_bad_form
* If flips are requested flip to a different fb and
* check CRC against that one as well. */tests/kms_rotation_crc.c +1
-1-if (data->flips) { +if (data->fb_flip.fb_id) {igt_plane_set_fb(plane, &data-
Quoted 1 line
fb_flip);if (
data->rotation==IGT_ROTATION_90||data->rotation==IGT_ROTATION_270)igt_plane_set_size(plane, data->fb.height, data->fb.width);tests/kms_rotation_crc.c +0
-0@@ -688,63 +681,37 @@ static const char *tiling_test_str(uint64_t tiling) } }tests/kms_rotation_crc.c +0
-8-static const char *flip_test_str (unsigned flips) -{ -if (flips) -return "-flip" ; -else -return "" ; -} -igt_main
{
structrot_subtest{
unsigned plane;
igt_rotation_trot;tests/kms_rotation_crc.c +0
-1-bool flips;} *subtest, subtests[] = {
tests/kms_rotation_crc.c +8
-14- { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_90, 0 }, - { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_180, 0 }, - { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_270, 0 }, - { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_90, 1 }, - { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_180, 1 }, - { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_270, 1 }, - { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_90, 0 }, - { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_180, 0 }, - { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_270, 0 }, - { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_90, 1 }, - { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_180, 1 }, - { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_270, 1 }, - { DRM_PLANE_TYPE_CURSOR, IGT_ROTATION_180, 0 }, - { 0, 0, 0} + { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_90 }, + { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_180 }, + { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_270 }, + { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_90 }, + { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_180 }, + { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_270 }, + { DRM_PLANE_TYPE_CURSOR, IGT_ROTATION_180 }, + { 0, 0}};
structreflect_x{
uint64_ttiling;
igt_rotation_trot;tests/kms_rotation_crc.c +0
-1-bool flips;}
*reflect_x, reflect_x_subtests[] = {tests/kms_rotation_crc.c +0
-1- {LOCAL_I915_FORMAT_MOD_X_TILED ,IGT_ROTATION_0 ,0 },
tests/kms_rotation_crc.c +0
-1- {LOCAL_I915_FORMAT_MOD_X_TILED ,IGT_ROTATION_180 ,0 },
tests/kms_rotation_crc.c +0
-1- {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_0 ,0 },
tests/kms_rotation_crc.c +0
-1- {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_90 ,0 },
tests/kms_rotation_crc.c +0
-1- {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_180 ,0 },
tests/kms_rotation_crc.c +0
-1- {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_270 ,0 },
tests/kms_rotation_crc.c +0
-1- { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_0 ,0 },
tests/kms_rotation_crc.c +0
-1- { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_90 ,0 },
tests/kms_rotation_crc.c +0
-1- { LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_180,0 },
tests/kms_rotation_crc.c +0
-1- { LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_270,0 },
tests/kms_rotation_crc.c +0
-1- {LOCAL_I915_FORMAT_MOD_X_TILED ,IGT_ROTATION_0 ,1 },
tests/kms_rotation_crc.c +0
-1- {LOCAL_I915_FORMAT_MOD_X_TILED ,IGT_ROTATION_180 ,1 },
tests/kms_rotation_crc.c +0
-1- {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_0 ,1 },
tests/kms_rotation_crc.c +0
-1- {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_90 ,1 },
tests/kms_rotation_crc.c +0
-1- {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_180 ,1 },
tests/kms_rotation_crc.c +0
-1- {LOCAL_I915_FORMAT_MOD_Y_TILED ,IGT_ROTATION_270 ,1 },
tests/kms_rotation_crc.c +0
-1- { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_0 ,1 },
tests/kms_rotation_crc.c +0
-1- { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_90 ,1 },
tests/kms_rotation_crc.c +0
-1- { LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_180,1 },
tests/kms_rotation_crc.c +0
-1- { LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_270,1 },
tests/kms_rotation_crc.c +9
-1- { 0, 0, 0 } + { LOCAL_I915_FORMAT_MOD_X_TILED, IGT_ROTATION_0 }, + { LOCAL_I915_FORMAT_MOD_X_TILED, IGT_ROTATION_180 }, + { LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_0 }, + { LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_90 }, + { LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_180 }, + { LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_270 }, + { LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_0 }, + { LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_90 }, + { LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_180},
tests/kms_rotation_crc.c +1
-0+ { LOCAL_I915_FORMAT_MOD_Yf_TILED,IGT_ROTATION_270 },
tests/kms_rotation_crc.c +1
-0+ { 0, 0 }};
data_tdata = {};tests/kms_rotation_crc.c +0
-0@@ -765,19 +732,16 @@ igt_main }
for (subtest = subtests;subtest->rot; subtest++) {tests/kms_rotation_crc.c +1
-1- igt_subtest_f("%s-rotation-%s%s", + igt_subtest_f("%s-rotation-%s",plane_test_str(subtest->plane),
tests/kms_rotation_crc.c +1
-2- rot_test_str(subtest->rot), - flip_test_str(subtest->flips)) { + rot_test_str(subtest->rot)) {igt_require(!(subtest->rot & (
IGT_ROTATION_90|IGT_ROTATION_270)) ||
gen >= 9); data.rotation =subtest->rot;tests/kms_rotation_crc.c +0
-1- data.flips = subtest->flips;
test_plane_rotation(&data, subtest->plane, false);
}
}tests/kms_rotation_crc.c +0
-1- data.flips =0 ;
igt_subtest_f("sprite-rotation-90-pos-100-0"){igt_require(gen >= 9);tests/kms_rotation_crc.c +0
-0@@ -826,16 +790,14 @@ igt_main }
for (reflect_x=reflect_x_subtests;reflect_x->tiling; reflect_x++) {tests/kms_rotation_crc.c +1
-1- igt_subtest_f("primary-%s-reflect-x-%s%s", + igt_subtest_f("primary-%s-reflect-x-%s",tiling_test_str(reflect_x->tiling),
tests/kms_rotation_crc.c +1
-2- rot_test_str(reflect_x->rot), - flip_test_str(reflect_x->flips)) { + rot_test_str(reflect_x->rot)) {igt_require(gen >= 10 || (
IS_CHERRYVIEW(data.devid)&&reflect_x->rot==IGT_ROTATION_0
&&reflect_x->tiling==LOCAL_I915_FORMAT_MOD_X_TILED));
data.rotation = (IGT_REFLECT_X| reflect_x-Quoted 1 line
rot);
data.override_tiling =
reflect_x->tiling;tests/kms_rotation_crc.c +0
-1- data.flips = reflect_x->flips;
test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY, false);
}
}
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 8/9 tests/kms_rotation_crc: Remove primary-rotation-90-Y-tiled.
In reply to Maarten LankhorstThis is already tested by the rotation tests, which require Y-tiled for 90° and 270° rotations.
--- tests/kms_rotation_crc.c | 84 ------------------------------------------------ 1 file changed, 84 deletions(-)
tests/kms_rotation_crc.c +0 -84
@@ -461,70 +461,6 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_formigt_require_f (valid_tests,"no valid crtc/connector combinations found\n" ); } -static void test_plane_rotation_ytiled_obj (data_t *data, -igt_output_t *output, -int plane_type) -{ -igt_display_t *display = &data->display; -uint64_t tiling =LOCAL_I915_FORMAT_MOD_Y_TILED ; -uint32_t format =DRM_FORMAT_XRGB8888 ; -int bpp =igt_drm_format_to_bpp (format); -enum igt_commit_style commit =COMMIT_LEGACY ; -int fd = data->gfx_fd; -igt_plane_t *plane; -drmModeModeInfo *mode; -unsigned int stride, size, w, h; -uint32_t gem_handle; -int ret; - - plane =igt_output_get_plane_type (output, plane_type); -igt_require (igt_plane_has_prop (plane,IGT_PLANE_ROTATION )); - -if (plane_type ==DRM_PLANE_TYPE_PRIMARY || plane_type ==DRM_PLANE_TYPE_CURSOR ) - commit =COMMIT_UNIVERSAL ; - -if (plane_type ==DRM_PLANE_TYPE_CURSOR ) -igt_require (display->has_cursor_plane); - -if (data->display.is_atomic) - commit =COMMIT_ATOMIC ; - - mode =igt_output_get_mode (output); - w = mode->hdisplay; - h = mode->vdisplay; - -for (stride =512 ; stride < (w * bpp /8 ); stride *=2 ) - ; -for (size =1024 *1024 ; size < stride * h; size *=2 ) - ; - - gem_handle =gem_create (fd, size); - ret =__gem_set_tiling (fd, gem_handle,I915_TILING_Y , stride); -igt_assert_eq (ret,0 ); - -do_or_die (__kms_addfb (fd, gem_handle, w, h, stride, - format, tiling,NULL ,LOCAL_DRM_MODE_FB_MODIFIERS , - &data->fb.fb_id)); - data->fb.width = w; - data->fb.height = h; - data->fb.gem_handle = gem_handle; - -igt_plane_set_fb (plane,NULL ); -igt_display_commit (display); - -igt_plane_set_rotation (plane, data->rotation); -igt_plane_set_fb (plane, &data->fb); -igt_plane_set_size (plane, h, w); - - ret =igt_display_try_commit2 (display, commit); - -igt_output_set_pipe (output,PIPE_NONE ); - -kmstest_restore_vt_mode (); -igt_remove_fb (fd, &data->fb); -igt_assert_eq (ret,0 ); -} -static void test_plane_rotation_exhaust_fences (data_t *data,igt_output_t *output,int plane_type)
@@ -769,26 +705,6 @@ igt_main } data.override_tiling =0 ; - igt_subtest_f("primary-rotation-90-Y-tiled") { -enum pipe pipe; -igt_output_t *output; -int valid_tests =0 ; - -igt_require (gen >=9 ); - data.rotation =IGT_ROTATION_90 ; - -for_each_pipe_with_valid_output (&data.display, pipe, output) { -igt_output_set_pipe (output, pipe); - -test_plane_rotation_ytiled_obj (&data, output,DRM_PLANE_TYPE_PRIMARY ); - - valid_tests++; -break ; - } - -igt_require_f (valid_tests,"no valid crtc/connector combinations found\n" ); - } -for (reflect_x = reflect_x_subtests; reflect_x->tiling; reflect_x++) { igt_subtest_f("primary-%s-reflect-x-%s", tiling_test_str(reflect_x->tiling),
Signature · 6 lines
2.15.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 8/9] tests/kms_rotation_crc: Remove primary-rotation-90-Y-tiled.
Quoted 3 lines · Maarten Lankhorst
This is already tested by the rotation tests, which require Y-tiled for 90° and 270° rotations.
Quoted 116 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_rotation_crc.c | 84 --------------------------------------
----------1 file changed, 84 deletions(-)tests/kms_rotation_crc.c +0
-0@@ -461,70 +461,6 @@ static void test_plane_rotation(data_t *data,int
plane_type, booltest_bad_formigt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
}tests/kms_rotation_crc.c +0
-20-static void test_plane_rotation_ytiled_obj(data_t *data, - igt_output_t *output, - int plane_type) -{ - igt_display_t *display = &data->display; - uint64_t tiling = LOCAL_I915_FORMAT_MOD_Y_TILED; - uint32_t format = DRM_FORMAT_XRGB8888; - int bpp = igt_drm_format_to_bpp(format); - enum igt_commit_style commit = COMMIT_LEGACY; - int fd = data->gfx_fd; - igt_plane_t *plane; - drmModeModeInfo *mode; - unsigned int stride, size, w, h; - uint32_t gem_handle; - int ret; - - plane = igt_output_get_plane_type(output, plane_type); - igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION)); - - if (plane_type == DRM_PLANE_TYPE_PRIMARY || plane_type ==
DRM_PLANE_TYPE_CURSOR)tests/kms_rotation_crc.c +0
-19- commit =COMMIT_UNIVERSAL ; - -if (plane_type ==DRM_PLANE_TYPE_CURSOR ) -igt_require (display->has_cursor_plane); - -if (data->display.is_atomic) - commit =COMMIT_ATOMIC ; - - mode =igt_output_get_mode (output); - w = mode->hdisplay; - h = mode->vdisplay; - -for (stride =512 ; stride < (w * bpp /8 ); stride *=2 ) - ; -for (size =1024 *1024 ; size < stride * h; size *=2 ) - ; - - gem_handle =gem_create (fd, size); - ret = __gem_set_tiling(fd, gem_handle, I915_TILING_Y,stride);
tests/kms_rotation_crc.c +0
-25-igt_assert_eq (ret,0 ); - -do_or_die (__kms_addfb (fd, gem_handle, w, h, stride, - format, tiling, NULL, LOCAL_DRM_MODE_FB_MODIFIERS, - &data->fb.fb_id)); - data->fb.width = w; - data->fb.height = h; - data->fb.gem_handle = gem_handle; - -igt_plane_set_fb (plane,NULL ); -igt_display_commit (display); - -igt_plane_set_rotation (plane, data->rotation); -igt_plane_set_fb (plane, &data->fb); -igt_plane_set_size (plane, h, w); - - ret =igt_display_try_commit2 (display, commit); - -igt_output_set_pipe (output,PIPE_NONE ); - -kmstest_restore_vt_mode (); -igt_remove_fb (fd, &data->fb); -igt_assert_eq (ret,0 ); -} -static void
test_plane_rotation_exhaust_fences(data_t *data, igt_output_t *output, int plane_type)tests/kms_rotation_crc.c +0
-0@@ -769,26 +705,6 @@ igt_main } data.override_tiling = 0;tests/kms_rotation_crc.c +0
-9- igt_subtest_f("primary-rotation-90-Y-tiled") { -enum pipe pipe; -igt_output_t *output; -int valid_tests =0 ; - -igt_require (gen >=9 ); - data.rotation =IGT_ROTATION_90 ; - - for_each_pipe_with_valid_output(&data.display, pipe,output) {
tests/kms_rotation_crc.c +0
-3-igt_output_set_pipe (output, pipe); - - test_plane_rotation_ytiled_obj(&data,output,
DRM_PLANE_TYPE_PRIMARY);tests/kms_rotation_crc.c +0
-6- - valid_tests++; -break ; - } - - igt_require_f(valid_tests, "no valid crtc/connectorcombinations found\n");
tests/kms_rotation_crc.c +0
-2- } -for (
reflect_x=reflect_x_subtests;reflect_x->tiling; reflect_x++) {
igt_subtest_f("primary-%s-reflect-x-%s",tiling_test_str(reflect_x->tiling),
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 9/9 tests/kms_rotation_crc: Perform lazy cleanup and require atomic.
In reply to Maarten LankhorstThis won't clean up resources between subtests, so if subtests fail the next subtest will clean up everything. This allows all subtests even if one fails.
--- tests/kms_rotation_crc.c | 213 +++++++++++++++-------------------------------- 1 file changed, 66 insertions(+), 147 deletions(-)
tests/kms_rotation_crc.c +66 -147
@@ -33,7 +33,6 @@ typedef struct {struct igt_fb fb;struct igt_fb fb_reference;struct igt_fb fb_unrotated; -struct igt_fb fb_modeset;struct igt_fb fb_flip;igt_crc_t ref_crc;igt_crc_t flip_crc;
@@ -122,68 +121,50 @@ paint_squares(data_t *data, igt_rotation_t rotation,igt_put_cairo_ctx (data->gfx_fd, fb, cr); } -static void prepare_crtc (data_t *data,igt_output_t *output,enum pipe pipe, -igt_plane_t *plane,enum igt_commit_style commit) +static void remove_fbs (data_t *data) { -drmModeModeInfo *mode; -unsigned int w, h; -uint64_t tiling = data->override_tiling ?:LOCAL_DRM_FORMAT_MOD_NONE ; -uint32_t pixel_format = data->override_fmt ?:DRM_FORMAT_XRGB8888 ; -igt_display_t *display = &data->display; -igt_plane_t *primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); +if (data->fb.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb); -igt_output_set_pipe (output, pipe); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); +if (data->fb_reference.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb_reference); -/* create the pipe_crc object for this pipe */ -igt_pipe_crc_free (data->pipe_crc); - data->pipe_crc =igt_pipe_crc_new (data->gfx_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); - - mode =igt_output_get_mode (output); +if (data->fb_unrotated.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb_unrotated); - w = mode->hdisplay; - h = mode->vdisplay; - -igt_create_fb (data->gfx_fd, w, h, pixel_format, tiling, &data->fb_modeset); +if (data->fb_flip.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb_flip); -/* -* With igt_display_commit2 and COMMIT_UNIVERSAL, we call just the -* setplane without a modeset. So, to be able to call -* igt_display_commit and ultimately setcrtc to do the first modeset, -* we create an fb covering the crtc and call commit -* -* It's also a good idea to set a primary fb on the primary plane -* regardless, to force a underrun when watermarks are allocated -* incorrectly for other planes. -*/ -igt_plane_set_fb (primary, &data->fb_modeset); + data->fb_flip.fb_id = data->fb_reference.fb_id = data->fb_unrotated.fb_id = data->fb.fb_id =0 ; +} -if (commit <COMMIT_ATOMIC ) { -igt_plane_clear_prop_changed (primary,IGT_PLANE_ROTATION ); -igt_display_commit (display); +static void cleanup_crtc (data_t *data) +{ +igt_display_t *display = &data->display; -if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) -igt_plane_set_prop_changed (primary,IGT_PLANE_ROTATION ); - } +igt_pipe_crc_free (data->pipe_crc); + data->pipe_crc =NULL ; -igt_plane_set_fb (plane,NULL ); +remove_fbs (data); -igt_display_commit2 (display, commit); +igt_display_reset (display); } -static void remove_fbs (data_t *data) +static void prepare_crtc (data_t *data,igt_output_t *output,enum pipe pipe, +igt_plane_t *plane) { -if (!data->fb.fb_id) -return ; +igt_display_t *display = &data->display; -igt_remove_fb (data->gfx_fd, &data->fb); -igt_remove_fb (data->gfx_fd, &data->fb_reference); -igt_remove_fb (data->gfx_fd, &data->fb_unrotated); +cleanup_crtc (data); -if (data->fb_flip.fb_id) -igt_remove_fb (data->gfx_fd, &data->fb_flip); +igt_output_set_pipe (output, pipe); +igt_plane_set_rotation (plane,IGT_ROTATION_0 ); + +/* create the pipe_crc object for this pipe */ +igt_pipe_crc_free (data->pipe_crc); + data->pipe_crc =igt_pipe_crc_new (data->gfx_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); - data->fb_flip.fb_id = data->fb.fb_id =0 ; +igt_display_commit2 (display,COMMIT_ATOMIC ); }enum rectangle_type {
@@ -206,7 +187,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,if (data->fb.fb_id) {igt_plane_set_fb (plane,NULL ); -igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_UNIVERSAL ); +igt_display_commit2 (display,COMMIT_ATOMIC );remove_fbs (data); }
@@ -259,28 +240,24 @@ static void prepare_fbs(data_t *data, igt_output_t *output,/* * Create a reference software rotated flip framebuffer. */ -if (plane->type ==DRM_PLANE_TYPE_PRIMARY || display->is_atomic) { -igt_create_fb (data->gfx_fd, ref_w, ref_h, pixel_format, tiling, - &data->fb_flip); -paint_squares (data, data->rotation, &data->fb_flip, - flip_opacity); -igt_plane_set_fb (plane, &data->fb_flip); -if (plane->type !=DRM_PLANE_TYPE_CURSOR ) -igt_plane_set_position (plane, data->pos_x, data->pos_y); -igt_display_commit2 (display, - display->is_atomic ? -COMMIT_ATOMIC :COMMIT_UNIVERSAL ); -igt_pipe_crc_collect_crc (data->pipe_crc, &data->flip_crc); - -/* -* Prepare the non-rotated flip fb. -*/ -igt_remove_fb (data->gfx_fd, &data->fb_flip); -igt_create_fb (data->gfx_fd, w, h, pixel_format, tiling, - &data->fb_flip); -paint_squares (data,IGT_ROTATION_0 , &data->fb_flip, - flip_opacity); - } +igt_create_fb (data->gfx_fd, ref_w, ref_h, pixel_format, tiling, + &data->fb_flip); +paint_squares (data, data->rotation, &data->fb_flip, + flip_opacity); +igt_plane_set_fb (plane, &data->fb_flip); +if (plane->type !=DRM_PLANE_TYPE_CURSOR ) +igt_plane_set_position (plane, data->pos_x, data->pos_y); +igt_display_commit2 (display,COMMIT_ATOMIC ); +igt_pipe_crc_collect_crc (data->pipe_crc, &data->flip_crc); + +/* +* Prepare the non-rotated flip fb. +*/ +igt_remove_fb (data->gfx_fd, &data->fb_flip); +igt_create_fb (data->gfx_fd, w, h, pixel_format, tiling, + &data->fb_flip); +paint_squares (data,IGT_ROTATION_0 , &data->fb_flip, + flip_opacity);/* * Create a reference CRC for a software-rotated fb.
@@ -292,7 +269,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,igt_plane_set_fb (plane, &data->fb_reference);if (plane->type !=DRM_PLANE_TYPE_CURSOR )igt_plane_set_position (plane, data->pos_x, data->pos_y); -igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_UNIVERSAL ); +igt_display_commit2 (display,COMMIT_ATOMIC );igt_pipe_crc_collect_crc (data->pipe_crc, &data->ref_crc);
@@ -305,7 +282,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,igt_plane_set_rotation (plane,IGT_ROTATION_0 );if (plane->type !=DRM_PLANE_TYPE_CURSOR )igt_plane_set_position (plane, data->pos_x, data->pos_y); -igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_UNIVERSAL ); +igt_display_commit2 (display,COMMIT_ATOMIC );/* * Prepare the plane with an non-rotated fb let the hw rotate it.
@@ -318,35 +295,6 @@ static void prepare_fbs(data_t *data, igt_output_t *output,igt_plane_set_position (plane, data->pos_x, data->pos_y); } -static void cleanup_crtc (data_t *data,igt_output_t *output,igt_plane_t *plane) -{ -igt_display_t *display = &data->display; - -igt_pipe_crc_free (data->pipe_crc); - data->pipe_crc =NULL ; - -remove_fbs (data); - -igt_remove_fb (data->gfx_fd, &data->fb_modeset); - -/* XXX: see the note in prepare_crtc() */ -if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) { -igt_plane_t *primary; - - primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); -igt_plane_set_fb (primary,NULL ); - } - -igt_plane_set_fb (plane,NULL ); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); - -igt_display_commit2 (display,COMMIT_UNIVERSAL ); - -igt_output_set_pipe (output,PIPE_ANY ); - -igt_display_commit (display); -} -static void wait_for_pageflip (int fd) {drmEventContext evctx = { .version =2 };
@@ -371,18 +319,11 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_formenum pipe pipe;int valid_tests =0 ;igt_crc_t crc_output; -enum igt_commit_style commit =COMMIT_LEGACY ;int ret; -if (plane_type ==DRM_PLANE_TYPE_PRIMARY || plane_type ==DRM_PLANE_TYPE_CURSOR ) - commit =COMMIT_UNIVERSAL ; -if (plane_type ==DRM_PLANE_TYPE_CURSOR )igt_require (display->has_cursor_plane); -if (data->display.is_atomic) - commit =COMMIT_ATOMIC ; -for_each_pipe_with_valid_output (display, pipe, output) {igt_plane_t *plane;int i;
@@ -395,7 +336,7 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form plane =igt_output_get_plane_type (output, plane_type);igt_require (igt_plane_has_prop (plane,IGT_PLANE_ROTATION )); -prepare_crtc (data, output, pipe, plane, commit); +prepare_crtc (data, output, pipe, plane);for (i =0 ; i < num_rectangle_types; i++) {/* Unsupported on i915 */
@@ -415,7 +356,7 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_formif (data->rotation & (IGT_ROTATION_90 |IGT_ROTATION_270 ))igt_plane_set_size (plane, data->fb.height, data->fb.width); - ret =igt_display_try_commit2 (display, commit); + ret =igt_display_try_commit2 (display,COMMIT_ATOMIC );if (test_bad_format) {igt_assert_eq (ret, -EINVAL );continue ;
@@ -456,41 +397,28 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form } valid_tests++; -cleanup_crtc (data, output, plane); }igt_require_f (valid_tests,"no valid crtc/connector combinations found\n" ); }static void test_plane_rotation_exhaust_fences (data_t *data,igt_output_t *output, -int plane_type) +igt_plane_t *plane) {igt_display_t *display = &data->display;uint64_t tiling =LOCAL_I915_FORMAT_MOD_Y_TILED ;uint32_t format =DRM_FORMAT_XRGB8888 ;int bpp =igt_drm_format_to_bpp (format); -enum igt_commit_style commit =COMMIT_LEGACY ;int fd = data->gfx_fd; -igt_plane_t *plane;drmModeModeInfo *mode; -data_t data2[MAX_FENCES +1 ] = {}; +struct igt_fb fb[MAX_FENCES +1 ] = {};unsigned int stride, size, w, h;uint32_t gem_handle;uint64_t total_aperture_size, total_fbs_size;int i, ret; - plane =igt_output_get_plane_type (output, plane_type);igt_require (igt_plane_has_prop (plane,IGT_PLANE_ROTATION )); -if (plane_type ==DRM_PLANE_TYPE_PRIMARY || plane_type ==DRM_PLANE_TYPE_CURSOR ) - commit =COMMIT_UNIVERSAL ; - -if (plane_type ==DRM_PLANE_TYPE_CURSOR ) -igt_require (display->has_cursor_plane); - -if (data->display.is_atomic) - commit =COMMIT_ATOMIC ; - mode =igt_output_get_mode (output); w = mode->hdisplay; h = mode->vdisplay;
@@ -509,7 +437,7 @@ static void test_plane_rotation_exhaust_fences(data_t *data,igt_require (total_fbs_size < total_aperture_size *0.9 );igt_plane_set_fb (plane,NULL ); -igt_display_commit (display); +igt_display_commit2 (display,COMMIT_ATOMIC );for (i =0 ; i <MAX_FENCES +1 ; i++) { gem_handle =gem_create (fd, size);
@@ -522,20 +450,20 @@ static void test_plane_rotation_exhaust_fences(data_t *data, ret = (__kms_addfb (fd, gem_handle, w, h, stride, format, tiling,NULL ,LOCAL_DRM_MODE_FB_MODIFIERS , - &data2[i].fb.fb_id)); + &fb[i].fb_id));if (ret) {igt_warn ("failed to create framebuffer\n" ); goto err_alloc; } - data2[i].fb.width = w; - data2[i].fb.height = h; - data2[i].fb.gem_handle = gem_handle; + fb[i].width = w; + fb[i].height = h; + fb[i].gem_handle = gem_handle; -igt_plane_set_fb (plane, &data2[i].fb); +igt_plane_set_fb (plane, &fb[i]);igt_plane_set_rotation (plane,IGT_ROTATION_0 ); - ret =igt_display_try_commit2 (display, commit); +igt_display_commit2 (display,COMMIT_ATOMIC );if (ret) {igt_warn ("failed to commit unrotated fb\n" ); goto err_commit;
@@ -544,7 +472,7 @@ static void test_plane_rotation_exhaust_fences(data_t *data,igt_plane_set_rotation (plane,IGT_ROTATION_90 );igt_plane_set_size (plane, h, w); -igt_display_commit2 (display, commit); +igt_display_commit2 (display,COMMIT_ATOMIC );if (ret) {igt_warn ("failed to commit hardware rotated fb: %i\n" , ret); goto err_commit;
@@ -557,19 +485,9 @@ err_alloc: i--; err_commit: -igt_plane_set_fb (plane,NULL ); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); - -if (commit <COMMIT_ATOMIC ) -igt_display_commit2 (display, commit); - -igt_output_set_pipe (output,PIPE_NONE ); -igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_LEGACY ); -for (; i >=0 ; i--) -igt_remove_fb (fd, &data2[i].fb); +igt_remove_fb (fd, &fb[i]); -kmstest_restore_vt_mode ();igt_assert_eq (ret,0 ); }
@@ -726,9 +644,10 @@ igt_mainigt_require (gen >=9 );for_each_pipe_with_valid_output (&data.display, pipe, output) { -igt_output_set_pipe (output, pipe); +igt_plane_t *primary = &data.display.pipes[pipe].planes[0 ]; +prepare_crtc (&data, output, pipe, primary); -test_plane_rotation_exhaust_fences (&data, output,DRM_PLANE_TYPE_PRIMARY ); +test_plane_rotation_exhaust_fences (&data, output, primary); valid_tests++;break ;
Signature · 6 lines
2.15.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 9/9] tests/kms_rotation_crc: Perform lazy cleanup and require atomic.
Quoted 144 lines · Maarten Lankhorst
This won't clean up resources between subtests, so if subtests fail the next subtest will clean up everything. This allows all subtests even if one fails.
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_rotation_crc.c | 213 +++++++++++++++--------------------
------------1 file changed, 66 insertions(+), 147 deletions(-)tests/kms_rotation_crc.c +0
-1@@ -33,7 +33,6 @@ typedef struct { struct igt_fb fb; struct igt_fb fb_reference; struct igt_fb fb_unrotated; -struct igt_fb fb_modeset; struct igt_fb fb_flip; igt_crc_t ref_crc; igt_crc_t flip_crc;@@ -122,68 +121,50 @@ paint_squares(data_t *data, igt_rotation_t rotation, igt_put_cairo_ctx(data->gfx_fd, fb, cr); }
-static void prepare_crtc(data_t *data,igt_output_t*output, enum pipe pipe,tests/kms_rotation_crc.c +0
-1- igt_plane_t *plane, enum igt_commit_stylecommit)
+static voidremove_fbs(data_t *data)
{tests/kms_rotation_crc.c +0
-3-drmModeModeInfo *mode; -unsigned int w, h; - uint64_t tiling = data->override_tiling ?:
LOCAL_DRM_FORMAT_MOD_NONE;tests/kms_rotation_crc.c +0
-1- uint32_t pixel_format = data->override_fmt ?:
DRM_FORMAT_XRGB8888;tests/kms_rotation_crc.c +0
-2-igt_display_t *display = &data->display; - igt_plane_t *primary = igt_output_get_plane_type(output,
DRM_PLANE_TYPE_PRIMARY);tests/kms_rotation_crc.c +2
-0+if (data->fb.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb);tests/kms_rotation_crc.c +2
-2-igt_output_set_pipe (output, pipe); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); +if (data->fb_reference.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb_reference);tests/kms_rotation_crc.c +0
-3-/* create the pipe_crc object for this pipe */ -igt_pipe_crc_free (data->pipe_crc); - data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);tests/kms_rotation_crc.c +2
-2- - mode =igt_output_get_mode (output); +if (data->fb_unrotated.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb_unrotated);tests/kms_rotation_crc.c +0
-4- w = mode->hdisplay; - h = mode->vdisplay; - - igt_create_fb(data->gfx_fd, w, h, pixel_format, tiling,
&data->fb_modeset);tests/kms_rotation_crc.c +2
-0+if (data->fb_flip.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb_flip);tests/kms_rotation_crc.c +0
-2-/* -* With igt_display_commit2 and COMMIT_UNIVERSAL, we call just the
tests/kms_rotation_crc.c +0
-2- * setplane without a modeset. So, to be able to call - * igt_display_commit and ultimately setcrtc to do the firstmodeset,
tests/kms_rotation_crc.c +0
-3- * we create an fb covering the crtc and call commit - * - * It's also a good idea to set a primary fb on the primaryplane
tests/kms_rotation_crc.c +0
-1- * regardless, to force a underrun when watermarks areallocated
tests/kms_rotation_crc.c +1
-3-* incorrectly for other planes. -*/ -igt_plane_set_fb (primary, &data->fb_modeset); + data->fb_flip.fb_id = data->fb_reference.fb_id = data-Quoted 1 line
fb_unrotated.fb_id =
data->fb.fb_id= 0;+}
tests/kms_rotation_crc.c +0
-2-if (commit <COMMIT_ATOMIC ) { - igt_plane_clear_prop_changed(primary,
IGT_PLANE_ROTATION);tests/kms_rotation_crc.c +3
-1-igt_display_commit (display); +static void cleanup_crtc (data_t *data) +{ +igt_display_t *display = &data->display;tests/kms_rotation_crc.c +0
-2-if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) - igt_plane_set_prop_changed(primary,
IGT_PLANE_ROTATION);tests/kms_rotation_crc.c +2
-1- } +igt_pipe_crc_free (data->pipe_crc); + data->pipe_crc =NULL ;tests/kms_rotation_crc.c +1
-1-igt_plane_set_fb (plane,NULL ); +remove_fbs (data);tests/kms_rotation_crc.c +1
-1-igt_display_commit2 (display, commit); +igt_display_reset (display);}
tests/kms_rotation_crc.c +1
-1-static void remove_fbs (data_t *data) +static void prepare_crtc(data_t *data, igt_output_t *output, enumpipe pipe,
tests/kms_rotation_crc.c +1
-0+ igt_plane_t *plane){
tests/kms_rotation_crc.c +1
-2-if (!data->fb.fb_id) -return ; +igt_display_t *display = &data->display;tests/kms_rotation_crc.c +1
-3-igt_remove_fb (data->gfx_fd, &data->fb); -igt_remove_fb (data->gfx_fd, &data->fb_reference); -igt_remove_fb (data->gfx_fd, &data->fb_unrotated); +cleanup_crtc (data);tests/kms_rotation_crc.c +6
-2-if (data->fb_flip.fb_id) -igt_remove_fb (data->gfx_fd, &data->fb_flip); +igt_output_set_pipe (output, pipe); +igt_plane_set_rotation (plane,IGT_ROTATION_0 ); + +/* create the pipe_crc object for this pipe */ +igt_pipe_crc_free (data->pipe_crc); + data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);tests/kms_rotation_crc.c +1
-1- data->fb_flip.fb_id = data->fb.fb_id =0 ; +igt_display_commit2 (display,COMMIT_ATOMIC );}
enumrectangle_type{tests/kms_rotation_crc.c +0
-0@@ -206,7 +187,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
if (data->fb.fb_id) {
igt_plane_set_fb(plane, NULL);tests/kms_rotation_crc.c +0
-1- igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_UNIVERSAL);
tests/kms_rotation_crc.c
Quoted 1 line
tests/kms_rotation_crc.c +1
-0+igt_display_commit2 (display,COMMIT_ATOMIC );
Should we keep the legacy commit here or should we have a requirement for this test that it runs only atomic?
Quoted 306 lines
remove_fbs(data);
}tests/kms_rotation_crc.c +1
-22@@ -259,28 +240,24 @@ static void prepare_fbs(data_t *data,igt_output_t *output, /* * Create a reference software rotated flip framebuffer. */ -if (plane->type ==DRM_PLANE_TYPE_PRIMARY || display- >is_atomic) { -igt_create_fb (data->gfx_fd, ref_w, ref_h, pixel_format, tiling, - &data->fb_flip); -paint_squares (data, data->rotation, &data->fb_flip, - flip_opacity); -igt_plane_set_fb (plane, &data->fb_flip); -if (plane->type !=DRM_PLANE_TYPE_CURSOR ) -igt_plane_set_position (plane, data->pos_x, data->pos_y); -igt_display_commit2 (display, - display->is_atomic ? - COMMIT_ATOMIC : COMMIT_UNIVERSAL); -igt_pipe_crc_collect_crc (data->pipe_crc, &data- >flip_crc); - -/* -* Prepare the non-rotated flip fb. -*/ -igt_remove_fb (data->gfx_fd, &data->fb_flip); -igt_create_fb (data->gfx_fd, w, h, pixel_format, tiling, - &data->fb_flip); -paint_squares (data,IGT_ROTATION_0 , &data->fb_flip, - flip_opacity); - } + igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format,tiling,
tests/kms_rotation_crc.c +6
-0+ &data->fb_flip); +paint_squares (data, data->rotation, &data->fb_flip, + flip_opacity); +igt_plane_set_fb (plane, &data->fb_flip); +if (plane->type !=DRM_PLANE_TYPE_CURSOR ) + igt_plane_set_position(plane, data->pos_x, data-Quoted 1 line
pos_y);tests/kms_rotation_crc.c +11
-0+igt_display_commit2 (display,COMMIT_ATOMIC ); +igt_pipe_crc_collect_crc (data->pipe_crc, &data->flip_crc); + +/* +* Prepare the non-rotated flip fb. +*/ +igt_remove_fb (data->gfx_fd, &data->fb_flip); +igt_create_fb (data->gfx_fd, w, h, pixel_format, tiling, + &data->fb_flip); +paint_squares (data,IGT_ROTATION_0 , &data->fb_flip, + flip_opacity);
/*
* Create a reference CRC for a software-rotated fb.tests/kms_rotation_crc.c +0
-0@@ -292,7 +269,7 @@ static void prepare_fbs(data_t *data,igt_output_t *output, igt_plane_set_fb(plane, &data->fb_reference); if (plane->type != DRM_PLANE_TYPE_CURSOR)igt_plane_set_position(plane,
data->pos_x, data-Quoted 1 line
pos_y);tests/kms_rotation_crc.c +0
-1- igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_UNIVERSAL);tests/kms_rotation_crc.c +1
-0+igt_display_commit2 (display,COMMIT_ATOMIC );
igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc);tests/kms_rotation_crc.c +0
-0@@ -305,7 +282,7 @@ static void prepare_fbs(data_t *data,igt_output_t *output, igt_plane_set_rotation(plane, IGT_ROTATION_0); if (plane->type != DRM_PLANE_TYPE_CURSOR)igt_plane_set_position(plane,
data->pos_x, data-Quoted 1 line
pos_y);tests/kms_rotation_crc.c +0
-1- igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_UNIVERSAL);tests/kms_rotation_crc.c +1
-0+igt_display_commit2 (display,COMMIT_ATOMIC );
/*
* Prepare the plane with an non-rotated fb let the hw rotate it.tests/kms_rotation_crc.c +0
-0@@ -318,35 +295,6 @@ static void prepare_fbs(data_t *data, igt_output_t *output,igt_plane_set_position(plane,
data->pos_x, data-Quoted 1 line
pos_y);}
-static voidcleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)tests/kms_rotation_crc.c +0
-15-{ -igt_display_t *display = &data->display; - -igt_pipe_crc_free (data->pipe_crc); - data->pipe_crc =NULL ; - -remove_fbs (data); - -igt_remove_fb (data->gfx_fd, &data->fb_modeset); - -/* XXX: see the note in prepare_crtc() */ -if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) { -igt_plane_t *primary; - - primary = igt_output_get_plane_type(output,
DRM_PLANE_TYPE_PRIMARY);tests/kms_rotation_crc.c +0
-13-igt_plane_set_fb (primary,NULL ); - } - -igt_plane_set_fb (plane,NULL ); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); - -igt_display_commit2 (display,COMMIT_UNIVERSAL ); - -igt_output_set_pipe (output,PIPE_ANY ); - -igt_display_commit (display); -} -static void
wait_for_pageflip(int fd)
{
drmEventContext evctx = { .version = 2 };tests/kms_rotation_crc.c +0
-0@@ -371,18 +319,11 @@ static void test_plane_rotation(data_t *data,int
plane_type, booltest_bad_form
enum pipe pipe;
intvalid_tests= 0;
igt_crc_tcrc_output;tests/kms_rotation_crc.c +0
-1-enum igt_commit_style commit =COMMIT_LEGACY ;int ret;
tests/kms_rotation_crc.c +0
-1- if (plane_type == DRM_PLANE_TYPE_PRIMARY || plane_type ==
DRM_PLANE_TYPE_CURSOR)tests/kms_rotation_crc.c +0
-2- commit =COMMIT_UNIVERSAL ; -if (
plane_type==DRM_PLANE_TYPE_CURSOR)igt_require(display->has_cursor_plane);tests/kms_rotation_crc.c +0
-3-if (data->display.is_atomic) - commit =COMMIT_ATOMIC ; -
for_each_pipe_with_valid_output(display, pipe, output){igt_plane_t*plane;
int i;tests/kms_rotation_crc.c +0
-0@@ -395,7 +336,7 @@ static void test_plane_rotation(data_t *data, int
plane_type, booltest_bad_form
plane =igt_output_get_plane_type(output, plane_type);igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));tests/kms_rotation_crc.c +1
-1-prepare_crtc (data, output, pipe, plane, commit); +prepare_crtc (data, output, pipe, plane);
for (i = 0; i <num_rectangle_types; i++) { /* Unsupported on i915 */tests/kms_rotation_crc.c +0
-0@@ -415,7 +356,7 @@ static void test_plane_rotation(data_t *data, int
plane_type, booltest_bad_form
if (data->rotation& (IGT_ROTATION_90|IGT_ROTATION_270))
igt_plane_set_size(plane, data-Quoted 1 line
fb.height,
data->fb.width);tests/kms_rotation_crc.c +0
-1- ret = igt_display_try_commit2(display,commit);
tests/kms_rotation_crc.c +1
-0+ ret = igt_display_try_commit2(display,
COMMIT_ATOMIC);
if (test_bad_format) {igt_assert_eq(ret, -EINVAL); continue;tests/kms_rotation_crc.c +0
-0@@ -456,41 +397,28 @@ static void test_plane_rotation(data_t *data,int
plane_type, booltest_bad_form
}
valid_tests++;tests/kms_rotation_crc.c +0
-1-cleanup_crtc (data, output, plane);}
igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
}
static void test_plane_rotation_exhaust_fences(data_t *data,igt_output_t*output,tests/kms_rotation_crc.c +1
-1- int plane_type) + igt_plane_t *plane){
igt_display_t*display =&data->display;uint64_ttiling =LOCAL_I915_FORMAT_MOD_Y_TILED;uint32_tformat =DRM_FORMAT_XRGB8888; int bpp =igt_drm_format_to_bpp(format);tests/kms_rotation_crc.c +0
-1-enum igt_commit_style commit =COMMIT_LEGACY ;int fd =
data->gfx_fd;tests/kms_rotation_crc.c +0
-1-igt_plane_t *plane;drmModeModeInfo *mode;
tests/kms_rotation_crc.c +1
-1-data_t data2[MAX_FENCES +1 ] = {}; +struct igt_fb fb[MAX_FENCES +1 ] = {};unsigned int stride, size, w, h;
uint32_tgem_handle;
uint64_ttotal_aperture_size,total_fbs_size; int i, ret;tests/kms_rotation_crc.c +0
-1- plane =igt_output_get_plane_type (output, plane_type);
igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));tests/kms_rotation_crc.c +0
-1- if (plane_type == DRM_PLANE_TYPE_PRIMARY || plane_type ==
DRM_PLANE_TYPE_CURSOR)tests/kms_rotation_crc.c +0
-8- commit =COMMIT_UNIVERSAL ; - -if (plane_type ==DRM_PLANE_TYPE_CURSOR ) -igt_require (display->has_cursor_plane); - -if (data->display.is_atomic) - commit =COMMIT_ATOMIC ; -mode =
igt_output_get_mode(output);
w =mode->hdisplay;
h =mode->vdisplay;tests/kms_rotation_crc.c +0
-0@@ -509,7 +437,7 @@ static voidtest_plane_rotation_exhaust_fences (data_t *data, igt_require(total_fbs_size < total_aperture_size * 0.9);
igt_plane_set_fb(plane, NULL);tests/kms_rotation_crc.c +1
-1-igt_display_commit (display); +igt_display_commit2 (display,COMMIT_ATOMIC );
for (i = 0; i <MAX_FENCES+ 1; i++) {gem_handle=gem_create(fd, size);tests/kms_rotation_crc.c +1
-1@@ -522,20 +450,20 @@ static void test_plane_rotation_exhaust_fences(data_t *data, ret = (__kms_addfb(fd, gem_handle, w, h, stride, format, tiling, NULL, LOCAL_DRM_MODE_FB_MODIFIERS, - &data2[i].fb.fb_id)); + &fb[i].fb_id)); if (ret) { igt_warn("failed to create framebuffer\n"); goto err_alloc; }tests/kms_rotation_crc.c +3
-3- data2[i].fb.width = w; - data2[i].fb.height = h; - data2[i].fb.gem_handle = gem_handle; + fb[i].width = w; + fb[i].height = h; + fb[i].gem_handle = gem_handle;tests/kms_rotation_crc.c +1
-1-igt_plane_set_fb (plane, &data2[i].fb); +igt_plane_set_fb (plane, &fb[i]);
igt_plane_set_rotation(plane, IGT_ROTATION_0);tests/kms_rotation_crc.c +1
-1- ret =igt_display_try_commit2 (display, commit); +igt_display_commit2 (display,COMMIT_ATOMIC );if (ret) {
igt_warn("failed to commit unrotated fb\n"); gotoerr_commit;tests/kms_rotation_crc.c +0
-0@@ -544,7 +472,7 @@ static voidtest_plane_rotation_exhaust_fences (data_t *data, igt_plane_set_rotation(plane, IGT_ROTATION_90); igt_plane_set_size(plane, h, w);tests/kms_rotation_crc.c +1
-1-igt_display_commit2 (display, commit); +igt_display_commit2 (display,COMMIT_ATOMIC );if (ret) {
igt_warn("failed to commit hardware rotated
fb: %i\n", ret);
gotoerr_commit;tests/kms_rotation_crc.c +0
-0@@ -557,19 +485,9 @@ err_alloc:
i--;
err_commit:tests/kms_rotation_crc.c +0
-8-igt_plane_set_fb (plane,NULL ); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); - -if (commit <COMMIT_ATOMIC ) -igt_display_commit2 (display, commit); - -igt_output_set_pipe (output,PIPE_NONE ); - igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_LEGACY);
-
for (; i >= 0; i--)tests/kms_rotation_crc.c +1
-1-igt_remove_fb (fd, &data2[i].fb); +igt_remove_fb (fd, &fb[i]);tests/kms_rotation_crc.c +0
-1-kmstest_restore_vt_mode ();
igt_assert_eq(ret, 0);
}tests/kms_rotation_crc.c +0
-0@@ -726,9 +644,10 @@ igt_main igt_require(gen >= 9);
for_each_pipe_with_valid_output(&data.display, pipe, output){tests/kms_rotation_crc.c +1
-1-igt_output_set_pipe (output, pipe); + igt_plane_t *primary =&data.display.pipes[pipe].planes[0];
tests/kms_rotation_crc.c +1
-0+prepare_crtc (&data, output, pipe, primary);tests/kms_rotation_crc.c +0
-1- test_plane_rotation_exhaust_fences(&data,output,
DRM_PLANE_TYPE_PRIMARY);tests/kms_rotation_crc.c +1
-0+ test_plane_rotation_exhaust_fences(&data,output, primary);
valid_tests++;
break;
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 9/9] tests/kms_rotation_crc: Perform lazy cleanup and require atomic.
Op 07-02-18 om 09:55 schreef Mika Kahola:
Quoted 140 lines · Maarten Lankhorst
Quoted 139 lines
This won't clean up resources between subtests, so if subtests fail the next subtest will clean up everything. This allows all subtests even if one fails.
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_rotation_crc.c | 213 +++++++++++++++--------------------
------------1 file changed, 66 insertions(+), 147 deletions(-)tests/kms_rotation_crc.c +0
-1@@ -33,7 +33,6 @@ typedef struct { struct igt_fb fb; struct igt_fb fb_reference; struct igt_fb fb_unrotated; -struct igt_fb fb_modeset; struct igt_fb fb_flip; igt_crc_t ref_crc; igt_crc_t flip_crc;@@ -122,68 +121,50 @@ paint_squares(data_t *data, igt_rotation_t rotation, igt_put_cairo_ctx(data->gfx_fd, fb, cr); }
-static void prepare_crtc(data_t *data,igt_output_t*output, enum pipe pipe,tests/kms_rotation_crc.c +0
-1- igt_plane_t *plane, enum igt_commit_stylecommit)
+static voidremove_fbs(data_t *data)
{tests/kms_rotation_crc.c +0
-3-drmModeModeInfo *mode; -unsigned int w, h; - uint64_t tiling = data->override_tiling ?:
LOCAL_DRM_FORMAT_MOD_NONE;tests/kms_rotation_crc.c +0
-1- uint32_t pixel_format = data->override_fmt ?:
DRM_FORMAT_XRGB8888;tests/kms_rotation_crc.c +0
-2-igt_display_t *display = &data->display; - igt_plane_t *primary = igt_output_get_plane_type(output,
DRM_PLANE_TYPE_PRIMARY);tests/kms_rotation_crc.c +2
-0+if (data->fb.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb);tests/kms_rotation_crc.c +2
-2-igt_output_set_pipe (output, pipe); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); +if (data->fb_reference.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb_reference);tests/kms_rotation_crc.c +0
-3-/* create the pipe_crc object for this pipe */ -igt_pipe_crc_free (data->pipe_crc); - data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);tests/kms_rotation_crc.c +2
-2- - mode =igt_output_get_mode (output); +if (data->fb_unrotated.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb_unrotated);tests/kms_rotation_crc.c +0
-4- w = mode->hdisplay; - h = mode->vdisplay; - - igt_create_fb(data->gfx_fd, w, h, pixel_format, tiling,
&data->fb_modeset);tests/kms_rotation_crc.c +2
-0+if (data->fb_flip.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb_flip);tests/kms_rotation_crc.c +0
-2-/* -* With igt_display_commit2 and COMMIT_UNIVERSAL, we call just the
tests/kms_rotation_crc.c +0
-2- * setplane without a modeset. So, to be able to call - * igt_display_commit and ultimately setcrtc to do the firstmodeset,
tests/kms_rotation_crc.c +0
-3- * we create an fb covering the crtc and call commit - * - * It's also a good idea to set a primary fb on the primaryplane
tests/kms_rotation_crc.c +0
-1- * regardless, to force a underrun when watermarks areallocated
tests/kms_rotation_crc.c +1
-3-* incorrectly for other planes. -*/ -igt_plane_set_fb (primary, &data->fb_modeset); + data->fb_flip.fb_id = data->fb_reference.fb_id = data-Quoted 1 line
fb_unrotated.fb_id =
data->fb.fb_id= 0;+}
tests/kms_rotation_crc.c +0
-2-if (commit <COMMIT_ATOMIC ) { - igt_plane_clear_prop_changed(primary,
IGT_PLANE_ROTATION);tests/kms_rotation_crc.c +3
-1-igt_display_commit (display); +static void cleanup_crtc (data_t *data) +{ +igt_display_t *display = &data->display;tests/kms_rotation_crc.c +0
-2-if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) - igt_plane_set_prop_changed(primary,
IGT_PLANE_ROTATION);tests/kms_rotation_crc.c +2
-1- } +igt_pipe_crc_free (data->pipe_crc); + data->pipe_crc =NULL ;tests/kms_rotation_crc.c +1
-1-igt_plane_set_fb (plane,NULL ); +remove_fbs (data);tests/kms_rotation_crc.c +1
-1-igt_display_commit2 (display, commit); +igt_display_reset (display);}
tests/kms_rotation_crc.c +1
-1-static void remove_fbs (data_t *data) +static void prepare_crtc(data_t *data, igt_output_t *output, enumpipe pipe,
tests/kms_rotation_crc.c +1
-0+ igt_plane_t *plane){
tests/kms_rotation_crc.c +1
-2-if (!data->fb.fb_id) -return ; +igt_display_t *display = &data->display;tests/kms_rotation_crc.c +1
-3-igt_remove_fb (data->gfx_fd, &data->fb); -igt_remove_fb (data->gfx_fd, &data->fb_reference); -igt_remove_fb (data->gfx_fd, &data->fb_unrotated); +cleanup_crtc (data);tests/kms_rotation_crc.c +6
-2-if (data->fb_flip.fb_id) -igt_remove_fb (data->gfx_fd, &data->fb_flip); +igt_output_set_pipe (output, pipe); +igt_plane_set_rotation (plane,IGT_ROTATION_0 ); + +/* create the pipe_crc object for this pipe */ +igt_pipe_crc_free (data->pipe_crc); + data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);tests/kms_rotation_crc.c +1
-1- data->fb_flip.fb_id = data->fb.fb_id =0 ; +igt_display_commit2 (display,COMMIT_ATOMIC );}
enumrectangle_type{tests/kms_rotation_crc.c +0
-0@@ -206,7 +187,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
Quoted 8 lines
tests/kms_rotation_crc.c
Quoted 6 lines
if (data->fb.fb_id) {
igt_plane_set_fb(plane, NULL);tests/kms_rotation_crc.c +0
-1- igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_UNIVERSAL);tests/kms_rotation_crc.c +1
-0+igt_display_commit2 (display,COMMIT_ATOMIC );Should we keep the legacy commit here or should we have a requirement for this test that it runs only atomic?
Hey,
Only the 180° tests won't run on gen4 without i915.nuclear_pageflip=1, at least until gen3 wm patch series is finally merged. But they are never run in CI (shards) anyway . So in practice the requirement doesn't matter and if we do care then we should get those in finally...
~Maarten
Quoted 298 lines
Quoted 298 lines
remove_fbs(data);
}tests/kms_rotation_crc.c +1
-22@@ -259,28 +240,24 @@ static void prepare_fbs(data_t *data,igt_output_t *output, /* * Create a reference software rotated flip framebuffer. */ -if (plane->type ==DRM_PLANE_TYPE_PRIMARY || display- > is_atomic) { -igt_create_fb (data->gfx_fd, ref_w, ref_h, pixel_format, tiling, - &data->fb_flip); -paint_squares (data, data->rotation, &data->fb_flip, - flip_opacity); -igt_plane_set_fb (plane, &data->fb_flip); -if (plane->type !=DRM_PLANE_TYPE_CURSOR ) -igt_plane_set_position (plane, data->pos_x, data->pos_y); -igt_display_commit2 (display, - display->is_atomic ? - COMMIT_ATOMIC : COMMIT_UNIVERSAL); -igt_pipe_crc_collect_crc (data->pipe_crc, &data- > flip_crc); - -/* -* Prepare the non-rotated flip fb. -*/ -igt_remove_fb (data->gfx_fd, &data->fb_flip); -igt_create_fb (data->gfx_fd, w, h, pixel_format, tiling, - &data->fb_flip); -paint_squares (data,IGT_ROTATION_0 , &data->fb_flip, - flip_opacity); - } + igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format,tiling,
tests/kms_rotation_crc.c +6
-0+ &data->fb_flip); +paint_squares (data, data->rotation, &data->fb_flip, + flip_opacity); +igt_plane_set_fb (plane, &data->fb_flip); +if (plane->type !=DRM_PLANE_TYPE_CURSOR ) + igt_plane_set_position(plane, data->pos_x, data-Quoted 1 line
pos_y);tests/kms_rotation_crc.c +11
-0+igt_display_commit2 (display,COMMIT_ATOMIC ); +igt_pipe_crc_collect_crc (data->pipe_crc, &data->flip_crc); + +/* +* Prepare the non-rotated flip fb. +*/ +igt_remove_fb (data->gfx_fd, &data->fb_flip); +igt_create_fb (data->gfx_fd, w, h, pixel_format, tiling, + &data->fb_flip); +paint_squares (data,IGT_ROTATION_0 , &data->fb_flip, + flip_opacity);
/*
* Create a reference CRC for a software-rotated fb.tests/kms_rotation_crc.c +0
-0@@ -292,7 +269,7 @@ static void prepare_fbs(data_t *data,igt_output_t *output, igt_plane_set_fb(plane, &data->fb_reference); if (plane->type != DRM_PLANE_TYPE_CURSOR)igt_plane_set_position(plane,
data->pos_x, data-Quoted 1 line
pos_y);tests/kms_rotation_crc.c +0
-1- igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_UNIVERSAL);tests/kms_rotation_crc.c +1
-0+igt_display_commit2 (display,COMMIT_ATOMIC );
igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc);tests/kms_rotation_crc.c +0
-0@@ -305,7 +282,7 @@ static void prepare_fbs(data_t *data,igt_output_t *output, igt_plane_set_rotation(plane, IGT_ROTATION_0); if (plane->type != DRM_PLANE_TYPE_CURSOR)igt_plane_set_position(plane,
data->pos_x, data-Quoted 1 line
pos_y);tests/kms_rotation_crc.c +0
-1- igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_UNIVERSAL);tests/kms_rotation_crc.c +1
-0+igt_display_commit2 (display,COMMIT_ATOMIC );
/*
* Prepare the plane with an non-rotated fb let the hw rotate it.tests/kms_rotation_crc.c +0
-0@@ -318,35 +295,6 @@ static void prepare_fbs(data_t *data, igt_output_t *output,igt_plane_set_position(plane,
data->pos_x, data-Quoted 1 line
pos_y);}
-static voidcleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)tests/kms_rotation_crc.c +0
-15-{ -igt_display_t *display = &data->display; - -igt_pipe_crc_free (data->pipe_crc); - data->pipe_crc =NULL ; - -remove_fbs (data); - -igt_remove_fb (data->gfx_fd, &data->fb_modeset); - -/* XXX: see the note in prepare_crtc() */ -if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) { -igt_plane_t *primary; - - primary = igt_output_get_plane_type(output,
DRM_PLANE_TYPE_PRIMARY);tests/kms_rotation_crc.c +0
-13-igt_plane_set_fb (primary,NULL ); - } - -igt_plane_set_fb (plane,NULL ); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); - -igt_display_commit2 (display,COMMIT_UNIVERSAL ); - -igt_output_set_pipe (output,PIPE_ANY ); - -igt_display_commit (display); -} -static void
wait_for_pageflip(int fd)
{
drmEventContext evctx = { .version = 2 };tests/kms_rotation_crc.c +0
-0@@ -371,18 +319,11 @@ static void test_plane_rotation(data_t *data,int
plane_type, booltest_bad_form
enum pipe pipe;
intvalid_tests= 0;
igt_crc_tcrc_output;tests/kms_rotation_crc.c +0
-1-enum igt_commit_style commit =COMMIT_LEGACY ;int ret;
tests/kms_rotation_crc.c +0
-1- if (plane_type == DRM_PLANE_TYPE_PRIMARY || plane_type ==
DRM_PLANE_TYPE_CURSOR)tests/kms_rotation_crc.c +0
-2- commit =COMMIT_UNIVERSAL ; -if (
plane_type==DRM_PLANE_TYPE_CURSOR)igt_require(display->has_cursor_plane);tests/kms_rotation_crc.c +0
-3-if (data->display.is_atomic) - commit =COMMIT_ATOMIC ; -
for_each_pipe_with_valid_output(display, pipe, output){igt_plane_t*plane;
int i;tests/kms_rotation_crc.c +0
-0@@ -395,7 +336,7 @@ static void test_plane_rotation(data_t *data, int
plane_type, booltest_bad_form
plane =igt_output_get_plane_type(output, plane_type);igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));tests/kms_rotation_crc.c +1
-1-prepare_crtc (data, output, pipe, plane, commit); +prepare_crtc (data, output, pipe, plane);
for (i = 0; i <num_rectangle_types; i++) { /* Unsupported on i915 */tests/kms_rotation_crc.c +0
-0@@ -415,7 +356,7 @@ static void test_plane_rotation(data_t *data, int
plane_type, booltest_bad_form
if (data->rotation& (IGT_ROTATION_90|IGT_ROTATION_270))
igt_plane_set_size(plane, data-Quoted 1 line
fb.height,
data->fb.width);tests/kms_rotation_crc.c +0
-1- ret = igt_display_try_commit2(display,commit);
tests/kms_rotation_crc.c +1
-0+ ret = igt_display_try_commit2(display,
COMMIT_ATOMIC);
if (test_bad_format) {igt_assert_eq(ret, -EINVAL); continue;tests/kms_rotation_crc.c +0
-0@@ -456,41 +397,28 @@ static void test_plane_rotation(data_t *data,int
plane_type, booltest_bad_form
}
valid_tests++;tests/kms_rotation_crc.c +0
-1-cleanup_crtc (data, output, plane);}
igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
}
static void test_plane_rotation_exhaust_fences(data_t *data,igt_output_t*output,tests/kms_rotation_crc.c +1
-1- int plane_type) + igt_plane_t *plane){
igt_display_t*display =&data->display;uint64_ttiling =LOCAL_I915_FORMAT_MOD_Y_TILED;uint32_tformat =DRM_FORMAT_XRGB8888; int bpp =igt_drm_format_to_bpp(format);tests/kms_rotation_crc.c +0
-1-enum igt_commit_style commit =COMMIT_LEGACY ;int fd =
data->gfx_fd;tests/kms_rotation_crc.c +0
-1-igt_plane_t *plane;drmModeModeInfo *mode;
tests/kms_rotation_crc.c +1
-1-data_t data2[MAX_FENCES +1 ] = {}; +struct igt_fb fb[MAX_FENCES +1 ] = {};unsigned int stride, size, w, h;
uint32_tgem_handle;
uint64_ttotal_aperture_size,total_fbs_size; int i, ret;tests/kms_rotation_crc.c +0
-1- plane =igt_output_get_plane_type (output, plane_type);
igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));tests/kms_rotation_crc.c +0
-1- if (plane_type == DRM_PLANE_TYPE_PRIMARY || plane_type ==
DRM_PLANE_TYPE_CURSOR)tests/kms_rotation_crc.c +0
-8- commit =COMMIT_UNIVERSAL ; - -if (plane_type ==DRM_PLANE_TYPE_CURSOR ) -igt_require (display->has_cursor_plane); - -if (data->display.is_atomic) - commit =COMMIT_ATOMIC ; -mode =
igt_output_get_mode(output);
w =mode->hdisplay;
h =mode->vdisplay;tests/kms_rotation_crc.c +0
-0@@ -509,7 +437,7 @@ static voidtest_plane_rotation_exhaust_fences (data_t *data, igt_require(total_fbs_size < total_aperture_size * 0.9);
igt_plane_set_fb(plane, NULL);tests/kms_rotation_crc.c +1
-1-igt_display_commit (display); +igt_display_commit2 (display,COMMIT_ATOMIC );
for (i = 0; i <MAX_FENCES+ 1; i++) {gem_handle=gem_create(fd, size);tests/kms_rotation_crc.c +1
-1@@ -522,20 +450,20 @@ static void test_plane_rotation_exhaust_fences(data_t *data, ret = (__kms_addfb(fd, gem_handle, w, h, stride, format, tiling, NULL, LOCAL_DRM_MODE_FB_MODIFIERS, - &data2[i].fb.fb_id)); + &fb[i].fb_id)); if (ret) { igt_warn("failed to create framebuffer\n"); goto err_alloc; }tests/kms_rotation_crc.c +3
-3- data2[i].fb.width = w; - data2[i].fb.height = h; - data2[i].fb.gem_handle = gem_handle; + fb[i].width = w; + fb[i].height = h; + fb[i].gem_handle = gem_handle;tests/kms_rotation_crc.c +1
-1-igt_plane_set_fb (plane, &data2[i].fb); +igt_plane_set_fb (plane, &fb[i]);
igt_plane_set_rotation(plane, IGT_ROTATION_0);tests/kms_rotation_crc.c +1
-1- ret =igt_display_try_commit2 (display, commit); +igt_display_commit2 (display,COMMIT_ATOMIC );if (ret) {
igt_warn("failed to commit unrotated fb\n"); gotoerr_commit;tests/kms_rotation_crc.c +0
-0@@ -544,7 +472,7 @@ static voidtest_plane_rotation_exhaust_fences (data_t *data, igt_plane_set_rotation(plane, IGT_ROTATION_90); igt_plane_set_size(plane, h, w);tests/kms_rotation_crc.c +1
-1-igt_display_commit2 (display, commit); +igt_display_commit2 (display,COMMIT_ATOMIC );if (ret) {
igt_warn("failed to commit hardware rotated
fb: %i\n", ret);
gotoerr_commit;tests/kms_rotation_crc.c +0
-0@@ -557,19 +485,9 @@ err_alloc:
i--;
err_commit:tests/kms_rotation_crc.c +0
-8-igt_plane_set_fb (plane,NULL ); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); - -if (commit <COMMIT_ATOMIC ) -igt_display_commit2 (display, commit); - -igt_output_set_pipe (output,PIPE_NONE ); - igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_LEGACY);
-
for (; i >= 0; i--)tests/kms_rotation_crc.c +1
-1-igt_remove_fb (fd, &data2[i].fb); +igt_remove_fb (fd, &fb[i]);tests/kms_rotation_crc.c +0
-1-kmstest_restore_vt_mode ();
igt_assert_eq(ret, 0);
}tests/kms_rotation_crc.c +0
-0@@ -726,9 +644,10 @@ igt_main igt_require(gen >= 9);
for_each_pipe_with_valid_output(&data.display, pipe, output){tests/kms_rotation_crc.c +1
-1-igt_output_set_pipe (output, pipe); + igt_plane_t *primary =&data.display.pipes[pipe].planes[0];
tests/kms_rotation_crc.c +1
-0+prepare_crtc (&data, output, pipe, primary);
Quoted 8 lines
Quoted 8 lines
tests/kms_rotation_crc.c +0
-1- test_plane_rotation_exhaust_fences(&data,output,
DRM_PLANE_TYPE_PRIMARY);tests/kms_rotation_crc.c +1
-0+ test_plane_rotation_exhaust_fences(&data,output, primary);
valid_tests++;
break;
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Mika Kahola
Reviewed-byRe: [igt-dev] [PATCH i-g-t 9/9] tests/kms_rotation_crc: Perform lazy cleanup and require atomic.
Quoted 166 lines · Maarten Lankhorst
Op 07-02-18 om 09:55 schreef Mika Kahola:
Quoted 157 lines · Maarten Lankhorst
Quoted 155 lines
This won't clean up resources between subtests, so if subtests fail
the next subtest will clean up everything. This allows all subtests
even if one fails.Signed-off-by Maarten Lankhorst <[email protected]om>
---
tests/kms_rotation_crc.c | 213 +++++++++++++++----------------
----
------------1 file changed, 66 insertions(+), 147 deletions(-)tests/kms_rotation_crc.c +0
-1@@ -33,7 +33,6 @@ typedef struct { struct igt_fb fb; struct igt_fb fb_reference; struct igt_fb fb_unrotated; -struct igt_fb fb_modeset; struct igt_fb fb_flip; igt_crc_t ref_crc; igt_crc_t flip_crc;@@ -122,68 +121,50 @@ paint_squares(data_t *data, igt_rotation_t rotation, igt_put_cairo_ctx(data->gfx_fd, fb, cr); }
-static void prepare_crtc(data_t *data,igt_output_t*output, enum
pipe pipe,tests/kms_rotation_crc.c +0
-1- igt_plane_t *plane, enum
igt_commit_style
commit)
+static voidremove_fbs(data_t *data)
{tests/kms_rotation_crc.c +0
-3-drmModeModeInfo *mode; -unsigned int w, h; - uint64_t tiling = data->override_tiling ?:
LOCAL_DRM_FORMAT_MOD_NONE;tests/kms_rotation_crc.c +0
-1- uint32_t pixel_format = data->override_fmt ?:
DRM_FORMAT_XRGB8888;tests/kms_rotation_crc.c +0
-2-igt_display_t *display = &data->display; - igt_plane_t *primary = igt_output_get_plane_type(output,
DRM_PLANE_TYPE_PRIMARY);tests/kms_rotation_crc.c +2
-0+if (data->fb.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb);tests/kms_rotation_crc.c +2
-2-igt_output_set_pipe (output, pipe); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); +if (data->fb_reference.fb_id) + igt_remove_fb(data->gfx_fd, &data-Quoted 1 line
fb_reference);tests/kms_rotation_crc.c +0
-3-/* create the pipe_crc object for this pipe */ -igt_pipe_crc_free (data->pipe_crc); - data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);tests/kms_rotation_crc.c +2
-2- - mode =igt_output_get_mode (output); +if (data->fb_unrotated.fb_id) + igt_remove_fb(data->gfx_fd, &data-Quoted 1 line
fb_unrotated);tests/kms_rotation_crc.c +0
-4- w = mode->hdisplay; - h = mode->vdisplay; - - igt_create_fb(data->gfx_fd, w, h, pixel_format, tiling,
&data->fb_modeset);tests/kms_rotation_crc.c +2
-0+if (data->fb_flip.fb_id) +igt_remove_fb (data->gfx_fd, &data->fb_flip);tests/kms_rotation_crc.c +0
-2-/* -* With igt_display_commit2 and COMMIT_UNIVERSAL, we call
just thetests/kms_rotation_crc.c +0
-2- * setplane without a modeset. So, to be able to call - * igt_display_commit and ultimately setcrtc to do thefirst
modeset,tests/kms_rotation_crc.c +0
-3- * we create an fb covering the crtc and call commit - * - * It's also a good idea to set a primary fb on theprimary
planetests/kms_rotation_crc.c +0
-1- * regardless, to force a underrun when watermarks areallocated
tests/kms_rotation_crc.c +1
-3-* incorrectly for other planes. -*/ -igt_plane_set_fb (primary, &data->fb_modeset); + data->fb_flip.fb_id = data->fb_reference.fb_id = data-Quoted 2 lines
fb_unrotated.fb_id =
data->fb.fb_id= 0;+}
tests/kms_rotation_crc.c +0
-2-if (commit <COMMIT_ATOMIC ) { - igt_plane_clear_prop_changed(primary,
IGT_PLANE_ROTATION);tests/kms_rotation_crc.c +3
-1-igt_display_commit (display); +static void cleanup_crtc (data_t *data) +{ +igt_display_t *display = &data->display;tests/kms_rotation_crc.c +0
-2-if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) - igt_plane_set_prop_changed(primary,
IGT_PLANE_ROTATION);tests/kms_rotation_crc.c +2
-1- } +igt_pipe_crc_free (data->pipe_crc); + data->pipe_crc =NULL ;tests/kms_rotation_crc.c +1
-1-igt_plane_set_fb (plane,NULL ); +remove_fbs (data);tests/kms_rotation_crc.c +1
-1-igt_display_commit2 (display, commit); +igt_display_reset (display);}
tests/kms_rotation_crc.c +1
-1-static void remove_fbs (data_t *data) +static void prepare_crtc(data_t *data, igt_output_t *output,enum
pipe pipe,tests/kms_rotation_crc.c +1
-0+ igt_plane_t *plane){
tests/kms_rotation_crc.c +1
-2-if (!data->fb.fb_id) -return ; +igt_display_t *display = &data->display;tests/kms_rotation_crc.c +1
-3-igt_remove_fb (data->gfx_fd, &data->fb); -igt_remove_fb (data->gfx_fd, &data->fb_reference); -igt_remove_fb (data->gfx_fd, &data->fb_unrotated); +cleanup_crtc (data);tests/kms_rotation_crc.c +6
-2-if (data->fb_flip.fb_id) -igt_remove_fb (data->gfx_fd, &data->fb_flip); +igt_output_set_pipe (output, pipe); +igt_plane_set_rotation (plane,IGT_ROTATION_0 ); + +/* create the pipe_crc object for this pipe */ +igt_pipe_crc_free (data->pipe_crc); + data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);tests/kms_rotation_crc.c +1
-1- data->fb_flip.fb_id = data->fb.fb_id =0 ; +igt_display_commit2 (display,COMMIT_ATOMIC );}
enumrectangle_type{tests/kms_rotation_crc.c +0
-0@@ -206,7 +187,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
if (data->fb.fb_id) {Quoted 8 lines
tests/kms_rotation_crc.c
Quoted 5 lines
igt_plane_set_fb(plane, NULL);tests/kms_rotation_crc.c +0
-1- igt_display_commit2(display, display->is_atomic?
COMMIT_ATOMIC:COMMIT_UNIVERSAL);tests/kms_rotation_crc.c +1
-0+igt_display_commit2 (display,COMMIT_ATOMIC );Should we keep the legacy commit here or should we have a requirement
for this test that it runs only atomic?
Quoted 7 lines
Hey,
Only the 180° tests won't run on gen4 without i915.nuclear_pageflip=1, at least until gen3 wm patch series is finally merged. But they are never run in CI (shards) anyway . So in practice the requirement doesn't matter and if we do care then we should get those in finally...
Ok. Let's discard this. Otherwise, the patch looks good.
Quoted 340 lines
~Maarten
Quoted 336 lines
Quoted 336 lines
remove_fbs(data);
}tests/kms_rotation_crc.c +0
-1@@ -259,28 +240,24 @@ static void prepare_fbs(data_t *data, igt_output_t *output, /** Create a reference software rotated flip framebuffer. */ - if (plane->type == DRM_PLANE_TYPE_PRIMARY || display-Quoted 2 lines
is_atomic) {tests/kms_rotation_crc.c +0
-1- igt_create_fb(data->gfx_fd, ref_w, ref_h,
pixel_format, tiling,tests/kms_rotation_crc.c +0
-2- &data->fb_flip); - paint_squares(data, data->rotation, &data-Quoted 1 line
fb_flip,tests/kms_rotation_crc.c +0
-4- flip_opacity); -igt_plane_set_fb (plane, &data->fb_flip); -if (plane->type !=DRM_PLANE_TYPE_CURSOR ) - igt_plane_set_position(plane, data-Quoted 1 line
pos_x,
data->pos_y);tests/kms_rotation_crc.c +0
-3- igt_display_commit2(display, - display->is_atomic ? - COMMIT_ATOMIC :
COMMIT_UNIVERSAL);tests/kms_rotation_crc.c +0
-1- igt_pipe_crc_collect_crc(data->pipe_crc, &data-Quoted 2 lines
flip_crc);tests/kms_rotation_crc.c +0
-6- -/* -* Prepare the non-rotated flip fb. -*/ -igt_remove_fb (data->gfx_fd, &data->fb_flip); - igt_create_fb(data->gfx_fd, w, h, pixel_format,tiling,
tests/kms_rotation_crc.c +0
-2- &data->fb_flip); - paint_squares(data, IGT_ROTATION_0, &data-Quoted 1 line
fb_flip,tests/kms_rotation_crc.c +1
-2- flip_opacity); - } + igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format,tiling,
tests/kms_rotation_crc.c +6
-0+ &data->fb_flip); +paint_squares (data, data->rotation, &data->fb_flip, + flip_opacity); +igt_plane_set_fb (plane, &data->fb_flip); +if (plane->type !=DRM_PLANE_TYPE_CURSOR ) + igt_plane_set_position(plane, data->pos_x, data-Quoted 2 lines
pos_y);tests/kms_rotation_crc.c +2
-0+igt_display_commit2 (display,COMMIT_ATOMIC ); + igt_pipe_crc_collect_crc(data->pipe_crc, &data-Quoted 1 line
flip_crc);tests/kms_rotation_crc.c +9
-0+ +/* +* Prepare the non-rotated flip fb. +*/ +igt_remove_fb (data->gfx_fd, &data->fb_flip); +igt_create_fb (data->gfx_fd, w, h, pixel_format, tiling, + &data->fb_flip); +paint_squares (data,IGT_ROTATION_0 , &data->fb_flip, + flip_opacity);
/*
* Create a reference CRC for a software-rotated fb.tests/kms_rotation_crc.c +0
-0@@ -292,7 +269,7 @@ static void prepare_fbs(data_t *data,igt_output_t *output, igt_plane_set_fb(plane, &data->fb_reference); if (plane->type != DRM_PLANE_TYPE_CURSOR)igt_plane_set_position(plane,
data->pos_x, data-Quoted 2 lines
pos_y);tests/kms_rotation_crc.c +0
-1- igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_UNIVERSAL);tests/kms_rotation_crc.c +1
-0+igt_display_commit2 (display,COMMIT_ATOMIC );
igt_pipe_crc_collect_crc(data->pipe_crc, &data-Quoted 1 line
ref_crc);tests/kms_rotation_crc.c +0
-0@@ -305,7 +282,7 @@ static void prepare_fbs(data_t *data,igt_output_t *output, igt_plane_set_rotation(plane, IGT_ROTATION_0); if (plane->type != DRM_PLANE_TYPE_CURSOR)igt_plane_set_position(plane,
data->pos_x, data-Quoted 2 lines
pos_y);tests/kms_rotation_crc.c +0
-1- igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_UNIVERSAL);tests/kms_rotation_crc.c +1
-0+igt_display_commit2 (display,COMMIT_ATOMIC );
/*
* Prepare the plane with an non-rotated fb let the hw rotate it.tests/kms_rotation_crc.c +0
-0@@ -318,35 +295,6 @@ static void prepare_fbs(data_t *data, igt_output_t *output,igt_plane_set_position(plane,
data->pos_x, data-Quoted 2 lines
pos_y);}
-static voidcleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)tests/kms_rotation_crc.c +0
-15-{ -igt_display_t *display = &data->display; - -igt_pipe_crc_free (data->pipe_crc); - data->pipe_crc =NULL ; - -remove_fbs (data); - -igt_remove_fb (data->gfx_fd, &data->fb_modeset); - -/* XXX: see the note in prepare_crtc() */ -if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) { -igt_plane_t *primary; - - primary = igt_output_get_plane_type(output,
DRM_PLANE_TYPE_PRIMARY);tests/kms_rotation_crc.c +0
-13-igt_plane_set_fb (primary,NULL ); - } - -igt_plane_set_fb (plane,NULL ); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); - -igt_display_commit2 (display,COMMIT_UNIVERSAL ); - -igt_output_set_pipe (output,PIPE_ANY ); - -igt_display_commit (display); -} -static void
wait_for_pageflip(int fd)
{
drmEventContext evctx = { .version = 2 };tests/kms_rotation_crc.c +0
-0@@ -371,18 +319,11 @@ static void test_plane_rotation(data_t *data,int
plane_type, booltest_bad_form
enum pipe pipe;
intvalid_tests= 0;
igt_crc_tcrc_output;tests/kms_rotation_crc.c +0
-1-enum igt_commit_style commit =COMMIT_LEGACY ;int ret;
tests/kms_rotation_crc.c +0
-1- if (plane_type == DRM_PLANE_TYPE_PRIMARY || plane_type==
DRM_PLANE_TYPE_CURSOR)tests/kms_rotation_crc.c +0
-2- commit =COMMIT_UNIVERSAL ; -if (
plane_type==DRM_PLANE_TYPE_CURSOR)igt_require(display->has_cursor_plane);tests/kms_rotation_crc.c +0
-3-if (data->display.is_atomic) - commit =COMMIT_ATOMIC ; -
for_each_pipe_with_valid_output(display, pipe, output){igt_plane_t*plane;
int i;tests/kms_rotation_crc.c +0
-0@@ -395,7 +336,7 @@ static void test_plane_rotation(data_t *data,int
plane_type, booltest_bad_form
plane =igt_output_get_plane_type(output, plane_type);igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));tests/kms_rotation_crc.c +1
-1-prepare_crtc (data, output, pipe, plane, commit); +prepare_crtc (data, output, pipe, plane);
for (i = 0; i <num_rectangle_types; i++) { /* Unsupported on i915 */tests/kms_rotation_crc.c +0
-0@@ -415,7 +356,7 @@ static void test_plane_rotation(data_t *data,int
plane_type, booltest_bad_form
if (data->rotation& (IGT_ROTATION_90|IGT_ROTATION_270))
igt_plane_set_size(plane, data-Quoted 2 lines
fb.height,
data->fb.width);tests/kms_rotation_crc.c +0
-1- ret = igt_display_try_commit2(display,commit);
tests/kms_rotation_crc.c +1
-0+ ret = igt_display_try_commit2(display,
COMMIT_ATOMIC);
if (test_bad_format) {igt_assert_eq(ret, -EINVAL); continue;tests/kms_rotation_crc.c +0
-0@@ -456,41 +397,28 @@ static void test_plane_rotation(data_t *data,int
plane_type, booltest_bad_form
}
valid_tests++;tests/kms_rotation_crc.c +0
-1-cleanup_crtc (data, output, plane);}
igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
}
static void test_plane_rotation_exhaust_fences(data_t *data,igt_output_t*output,tests/kms_rotation_crc.c +1
-1- int plane_type) + igt_plane_t*plane)
{
igt_display_t*display =&data->display;uint64_ttiling =LOCAL_I915_FORMAT_MOD_Y_TILED;uint32_tformat =DRM_FORMAT_XRGB8888; int bpp =igt_drm_format_to_bpp(format);tests/kms_rotation_crc.c +0
-1-enum igt_commit_style commit =COMMIT_LEGACY ;int fd =
data->gfx_fd;tests/kms_rotation_crc.c +0
-1-igt_plane_t *plane;drmModeModeInfo *mode;
tests/kms_rotation_crc.c +1
-1-data_t data2[MAX_FENCES +1 ] = {}; +struct igt_fb fb[MAX_FENCES +1 ] = {};unsigned int stride, size, w, h;
uint32_tgem_handle;
uint64_ttotal_aperture_size,total_fbs_size; int i, ret;tests/kms_rotation_crc.c +0
-1- plane =igt_output_get_plane_type (output, plane_type);igt_require(igt_plane_has_prop(plane,
IGT_PLANE_ROTATION));tests/kms_rotation_crc.c +0
-1- if (plane_type == DRM_PLANE_TYPE_PRIMARY || plane_type==
DRM_PLANE_TYPE_CURSOR)tests/kms_rotation_crc.c +0
-8- commit =COMMIT_UNIVERSAL ; - -if (plane_type ==DRM_PLANE_TYPE_CURSOR ) -igt_require (display->has_cursor_plane); - -if (data->display.is_atomic) - commit =COMMIT_ATOMIC ; -mode =
igt_output_get_mode(output);
w =mode->hdisplay;
h =mode->vdisplay;tests/kms_rotation_crc.c +0
-0@@ -509,7 +437,7 @@ static voidtest_plane_rotation_exhaust_fences (data_t *data, igt_require(total_fbs_size < total_aperture_size * 0.9);
igt_plane_set_fb(plane, NULL);tests/kms_rotation_crc.c +1
-1-igt_display_commit (display); +igt_display_commit2 (display,COMMIT_ATOMIC );
for (i = 0; i <MAX_FENCES+ 1; i++) {gem_handle=gem_create(fd, size);tests/kms_rotation_crc.c +1
-1@@ -522,20 +450,20 @@ static void test_plane_rotation_exhaust_fences(data_t *data, ret = (__kms_addfb(fd, gem_handle, w, h, stride, format, tiling, NULL, LOCAL_DRM_MODE_FB_MODIFIERS, - &data2[i].fb.fb_id)); + &fb[i].fb_id)); if (ret) {
igt_warn("failed to create framebuffer\n");
gotoerr_alloc;
}tests/kms_rotation_crc.c +3
-3- data2[i].fb.width = w; - data2[i].fb.height = h; - data2[i].fb.gem_handle = gem_handle; + fb[i].width = w; + fb[i].height = h; + fb[i].gem_handle = gem_handle;tests/kms_rotation_crc.c +1
-1-igt_plane_set_fb (plane, &data2[i].fb); +igt_plane_set_fb (plane, &fb[i]);
igt_plane_set_rotation(plane, IGT_ROTATION_0);tests/kms_rotation_crc.c +1
-1- ret =igt_display_try_commit2 (display, commit); +igt_display_commit2 (display,COMMIT_ATOMIC );if (ret) {
igt_warn("failed to commit unrotated fb\n");
gotoerr_commit;tests/kms_rotation_crc.c +0
-0@@ -544,7 +472,7 @@ static voidtest_plane_rotation_exhaust_fences (data_t *data, igt_plane_set_rotation(plane, IGT_ROTATION_90); igt_plane_set_size(plane, h, w);tests/kms_rotation_crc.c +1
-1-igt_display_commit2 (display, commit); +igt_display_commit2 (display,COMMIT_ATOMIC );if (ret) {
igt_warn("failed to commit hardware rotated
fb: %i\n", ret);
gotoerr_commit;tests/kms_rotation_crc.c +0
-0@@ -557,19 +485,9 @@ err_alloc:
i--;
err_commit:tests/kms_rotation_crc.c +0
-8-igt_plane_set_fb (plane,NULL ); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); - -if (commit <COMMIT_ATOMIC ) -igt_display_commit2 (display, commit); - -igt_output_set_pipe (output,PIPE_NONE ); - igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_LEGACY);
-
for (; i >= 0; i--)tests/kms_rotation_crc.c +1
-1-igt_remove_fb (fd, &data2[i].fb); +igt_remove_fb (fd, &fb[i]);tests/kms_rotation_crc.c +0
-1-kmstest_restore_vt_mode ();
igt_assert_eq(ret, 0);
}tests/kms_rotation_crc.c +0
-0@@ -726,9 +644,10 @@ igt_main igt_require(gen >= 9);
for_each_pipe_with_valid_output(&data.display, pipe,
output) {tests/kms_rotation_crc.c +1
-1-igt_output_set_pipe (output, pipe); + igt_plane_t *primary =&data.display.pipes[pipe].planes[0];
tests/kms_rotation_crc.c +1
-0+ prepare_crtc(&data, output, pipe,primary);
tests/kms_rotation_crc.c +0
-1- test_plane_rotation_exhaust_fences(&data,
output,DRM_PLANE_TYPE_PRIMARY);tests/kms_rotation_crc.c +1
-0+ test_plane_rotation_exhaust_fences(&data,
output, primary);
valid_tests++;
break;
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for tests: Cleanups and NV12 preparations.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: tests: Cleanups and NV12 preparations.
URL : https://patchwork.freedesktop.org/series/37488/
State : success
== Summary ==
IGT patchset tested on top of latest successful build 902b754804ff76fbbf048ff889a95a4d7c0da5e6 tests/perf: fix report validity check on gen10+
with latest DRM-Tip kernel build CI_DRM_37114244f989341c drm-tip: 2018y-02m-01d-12h-39m-55s UTC integration manifest
Testlist changes:
-igt@kms_rotation_crc@primary-rotation-90-flip -igt@kms_rotation_crc@primary-rotation-90-y-tiled -igt@kms_rotation_crc@primary-rotation-180-flip -igt@kms_rotation_crc@primary-rotation-270-flip -igt@kms_rotation_crc@primary-x-tiled-reflect-x-0-flip -igt@kms_rotation_crc@primary-x-tiled-reflect-x-180-flip -igt@kms_rotation_crc@primary-yf-tiled-reflect-x-0-flip -igt@kms_rotation_crc@primary-yf-tiled-reflect-x-90-flip -igt@kms_rotation_crc@primary-yf-tiled-reflect-x-180-flip -igt@kms_rotation_crc@primary-yf-tiled-reflect-x-270-flip -igt@kms_rotation_crc@primary-y-tiled-reflect-x-0-flip -igt@kms_rotation_crc@primary-y-tiled-reflect-x-90-flip -igt@kms_rotation_crc@primary-y-tiled-reflect-x-180-flip -igt@kms_rotation_crc@primary-y-tiled-reflect-x-270-flip -igt@kms_rotation_crc@sprite-rotation-90-flip -igt@kms_rotation_crc@sprite-rotation-180-flip -igt@kms_rotation_crc@sprite-rotation-270-flip
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:418s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:426s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:372s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:498s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:285s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:482s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:486s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:471s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:464s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:579s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:410s fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:277s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:512s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:393s fi-hsw-4770r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:399s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:416s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:448s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:418s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:459s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:501s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:453s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:500s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:577s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:431s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:509s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:527s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:491s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:496s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:416s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:427s fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:528s fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:396s
Blacklisted hosts:
fi-glk-dsi total:288 pass:257 dwarn:1 dfail:0 fail:0 skip:30 time:470s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_849/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ Fi.CI.IGT: warning for tests: Cleanups and NV12 preparations.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: tests: Cleanups and NV12 preparations.
URL : https://patchwork.freedesktop.org/series/37488/
State : warning
== Summary ==
Test kms_flip:
Subgroup 2x-flip-vs-expired-vblank-interruptible:
pass -> FAIL (shard-hsw) fdo#102887
Subgroup plain-flip-ts-check:
fail -> PASS (shard-hsw) fdo#100368
Test perf_pmu:
Subgroup semaphore-wait-bcs0:
pass -> FAIL (shard-apl) fdo#104829
Test gem_eio:
Subgroup in-flight-contexts:
fail -> PASS (shard-hsw) fdo#104676
Test gem_tiled_blits:
Subgroup normal:
pass -> SKIP (shard-apl)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
skip -> PASS (shard-snb) fdo#103375
Test kms_vblank:
Subgroup pipe-a-accuracy-idle:
fail -> PASS (shard-apl) fdo#102583
Test gem_tiled_swapping:
Subgroup non-threaded:
pass -> SKIP (shard-apl)
Test kms_sysfs_edid_timing:
warn -> PASS (shard-apl) fdo#100047
Test kms_setmode:
Subgroup basic:
pass -> FAIL (shard-hsw) fdo#99912fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#104829 https://bugs.freedesktop.org/show_bug.cgi?id=104829
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#102583 https://bugs.freedesktop.org/show_bug.cgi?id=102583
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
shard-apl total:2819 pass:1740 dwarn:1 dfail:0 fail:22 skip:1056 time:12376s shard-hsw total:2819 pass:1731 dwarn:1 dfail:0 fail:11 skip:1075 time:11593s shard-snb total:2819 pass:1326 dwarn:1 dfail:0 fail:10 skip:1482 time:6527s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_849/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev