lib/igt_fb: Make igt_remove_fb more robust
PATCH 1/12 lib/igt_fb: Make igt_remove_fb more robust
This will make it easier for tests to unconditionally call igt_remove_fb, without first checking whether the FB is allocated.
--- lib/igt_fb.c | 4 ++++ 1 file changed, 4 insertions(+)
lib/igt_fb.c +4 -0
@@ -1623,9 +1623,13 @@ void igt_put_cairo_ctx(int fd, struct igt_fb *fb, cairo_t *cr)*/ void igt_remove_fb (int fd,struct igt_fb *fb) { +if (!fb || !fb->fb_id) +return ; +cairo_surface_destroy (fb->cairo_surface);do_or_die (drmModeRmFB (fd, fb->fb_id));gem_close (fd, fb->gem_handle); + fb->fb_id =0 ; }/**
Signature · 6 lines
2.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 2/12 tests: Always call igt_remove_fb without checking.
This cleans up the tests slightly.
--- tests/kms_flip.c | 3 +-- tests/kms_panel_fitting.c | 15 +++------------ tests/kms_plane_scaling.c | 7 +------ tests/kms_rotation_crc.c | 16 ++-------------- tests/kms_setmode.c | 12 +++--------- 5 files changed, 10 insertions(+), 43 deletions(-)
tests/kms_flip.c +1 -2
@@ -1332,8 +1332,7 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,igt_info ("\n%s: PASSED\n\n" , test_name); out: -if (o->fb_ids[2 ]) -igt_remove_fb (drm_fd, &o->fb_info[2 ]); +igt_remove_fb (drm_fd, &o->fb_info[2 ]);igt_remove_fb (drm_fd, &o->fb_info[1 ]);igt_remove_fb (drm_fd, &o->fb_info[0 ]);
tests/kms_panel_fitting.c +3 -12
@@ -51,10 +51,7 @@ 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->fb1.fb_id) { -igt_remove_fb (data->drm_fd, &data->fb1); - data->fb1.fb_id =0 ; - } +igt_remove_fb (data->drm_fd, &data->fb1);/* allocate fb for plane 1 */ igt_create_pattern_fb(data->drm_fd,
@@ -83,14 +80,8 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane) {igt_display_t *display = &data->display; -if (data->fb1.fb_id) { -igt_remove_fb (data->drm_fd, &data->fb1); - data->fb1.fb_id =0 ; - } -if (data->fb2.fb_id) { -igt_remove_fb (data->drm_fd, &data->fb2); - data->fb2.fb_id =0 ; - } +igt_remove_fb (data->drm_fd, &data->fb1); +igt_remove_fb (data->drm_fd, &data->fb2);if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) {igt_plane_t *primary;
tests/kms_plane_scaling.c +1 -6
@@ -62,13 +62,8 @@ static void cleanup_fbs(data_t *data) {int i; -for (i =0 ; i <ARRAY_SIZE (data->fb); i++) { -if (!data->fb[i].fb_id) -continue ; - +for (i =0 ; i <ARRAY_SIZE (data->fb); i++)igt_remove_fb (data->drm_fd, &data->fb[i]); - data->fb[i].fb_id =0 ; - } }static void cleanup_crtc (data_t *data)
tests/kms_rotation_crc.c +2 -14
@@ -174,17 +174,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,static void remove_fbs (data_t *data) { -if (!data->fb.fb_id) -return ; -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); - -if (data->fb_flip.fb_id) -igt_remove_fb (data->gfx_fd, &data->fb_flip); - - data->fb_flip.fb_id = data->fb.fb_id =0 ; +igt_remove_fb (data->gfx_fd, &data->fb_flip); }enum rectangle_type {
@@ -205,12 +198,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,uint32_t pixel_format = data->override_fmt ?:DRM_FORMAT_XRGB8888 ;const float flip_opacity =0.75 ; -if (data->fb.fb_id) { -igt_plane_set_fb (plane,NULL ); -igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_UNIVERSAL ); - -remove_fbs (data); - } +remove_fbs (data);igt_plane_set_rotation (plane,IGT_ROTATION_0 );
tests/kms_setmode.c +3 -9
@@ -361,6 +361,9 @@ static void cleanup_crtcs(struct crtc_config *crtcs, int crtc_count)int i;for (i =0 ; i < crtc_count; i++) { +igt_remove_fb (drm_fd, &crtcs[i].fb_info); +drmModeSetCrtc (drm_fd, crtcs[i].crtc_id,0 ,0 ,0 ,NULL ,0 ,NULL ); +free (crtcs[i].cconfs); } }
@@ -577,15 +580,6 @@ static void test_crtc_config(const struct test_config *tconf,if (ret ==0 && tconf->flags &TEST_TIMINGS )check_timings (crtcs[0 ].crtc_idx, &crtcs[0 ].mode); -for (i =0 ; i < crtc_count; i++) { -if (crtcs[i].fb_info.fb_id) { -drmModeSetCrtc (drm_fd, crtcs[i].crtc_id,0 ,0 ,0 ,NULL , -0 ,NULL ); -drmModeRmFB (drm_fd, crtcs[i].fb_info.fb_id); - crtcs[i].fb_info.fb_id =0 ; - } - } -return ; }
Signature · 6 lines
2.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 02/12] tests: Always call igt_remove_fb without checking.
Quoted 2 lines · Maarten Lankhorst
This cleans up the tests slightly.
Quoted 153 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_flip.c | 3 +--
tests/kms_panel_fitting.c | 15 +++------------
tests/kms_plane_scaling.c | 7 +------
tests/kms_rotation_crc.c | 16 ++--------------
tests/kms_setmode.c | 12 +++---------5 files changed, 10 insertions(+), 43 deletions(-)tests/kms_flip.c +0
-0@@ -1332,8 +1332,7 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs, igt_info("\n%s: PASSED\n\n", test_name);
out:tests/kms_flip.c +1
-2-if (o->fb_ids[2 ]) -igt_remove_fb (drm_fd, &o->fb_info[2 ]); +igt_remove_fb (drm_fd, &o->fb_info[2 ]);
igt_remove_fb(drm_fd, &o->fb_info[1]);
igt_remove_fb(drm_fd, &o->fb_info[0]);tests/kms_panel_fitting.c +0
-0@@ -51,10 +51,7 @@ 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
-4-if (data->fb1.fb_id) { -igt_remove_fb (data->drm_fd, &data->fb1); - data->fb1.fb_id =0 ; - } +igt_remove_fb (data->drm_fd, &data->fb1);
/* allocate fb for plane 1 */
igt_create_pattern_fb(data->drm_fd,tests/kms_panel_fitting.c +0
-0@@ -83,14 +80,8 @@ 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 +2
-8-if (data->fb1.fb_id) { -igt_remove_fb (data->drm_fd, &data->fb1); - data->fb1.fb_id =0 ; - } -if (data->fb2.fb_id) { -igt_remove_fb (data->drm_fd, &data->fb2); - data->fb2.fb_id =0 ; - } +igt_remove_fb (data->drm_fd, &data->fb1); +igt_remove_fb (data->drm_fd, &data->fb2);
if (plane->type!=DRM_PLANE_TYPE_PRIMARY) {igt_plane_t*primary;tests/kms_plane_scaling.c +0
-0@@ -62,13 +62,8 @@ static void cleanup_fbs(data_t *data) { int i;tests/kms_plane_scaling.c +1
-4-for (i =0 ; i <ARRAY_SIZE (data->fb); i++) { -if (!data->fb[i].fb_id) -continue ; - +for (i =0 ; i <ARRAY_SIZE (data->fb); i++)
igt_remove_fb(data->drm_fd, &data->fb[i]);tests/kms_plane_scaling.c +0
-2- data->fb[i].fb_id =0 ; - }}
static voidcleanup_crtc(data_t *data)tests/kms_rotation_crc.c +0
-0@@ -174,17 +174,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
static voidremove_fbs(data_t *data)
{tests/kms_rotation_crc.c +0
-3-if (!data->fb.fb_id) -return ; -
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);tests/kms_rotation_crc.c +1
-5- -if (data->fb_flip.fb_id) -igt_remove_fb (data->gfx_fd, &data->fb_flip); - - data->fb_flip.fb_id = data->fb.fb_id =0 ; +igt_remove_fb (data->gfx_fd, &data->fb_flip);}
enumrectangle_type{tests/kms_rotation_crc.c +0
-0@@ -205,12 +198,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
uint32_tpixel_format=data->override_fmt?:DRM_FORMAT_XRGB8888;
const floatflip_opacity= 0.75;tests/kms_rotation_crc.c +0
-3-if (data->fb.fb_id) { -igt_plane_set_fb (plane,NULL ); - igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_UNIVERSAL);tests/kms_rotation_crc.c +1
-3- -remove_fbs (data); - } +remove_fbs (data);
igt_plane_set_rotation(plane, IGT_ROTATION_0);tests/kms_setmode.c +0
-0@@ -361,6 +361,9 @@ static void cleanup_crtcs(struct crtc_config *crtcs, int crtc_count) int i;
for (i = 0; i <crtc_count; i++) {tests/kms_setmode.c +2
-0+igt_remove_fb (drm_fd, &crtcs[i].fb_info); + drmModeSetCrtc(drm_fd, crtcs[i].crtc_id, 0, 0, 0,NULL, 0, NULL);
+
free(crtcs[i].cconfs);
}
}tests/kms_setmode.c +0
-0@@ -577,15 +580,6 @@ static void test_crtc_config(const struct test_config *tconf, if (ret == 0 && tconf->flags & TEST_TIMINGS) check_timings(crtcs[0].crtc_idx, &crtcs[0].mode);tests/kms_setmode.c +0
-3-for (i =0 ; i < crtc_count; i++) { -if (crtcs[i].fb_info.fb_id) { - drmModeSetCrtc(drm_fd, crtcs[i].crtc_id, 0,0, 0, NULL,
tests/kms_setmode.c +0
-6- 0, NULL); -drmModeRmFB (drm_fd, crtcs[i].fb_info.fb_id); - crtcs[i].fb_info.fb_id =0 ; - } - } -return;
}
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 3/12 lib/igt_fb: Add igt_fb_supported_format()
In reply to Maarten LankhorstThis makes it possible to iterate whether a format is supported or not, without each driver having to open code it.
--- lib/igt_fb.c | 18 ++++++++++++++++++ lib/igt_fb.h | 1 + tests/kms_atomic.c | 13 +++---------- tests/kms_plane.c | 16 +--------------- tests/kms_plane_scaling.c | 22 ++++------------------ 5 files changed, 27 insertions(+), 43 deletions(-)
lib/igt_fb.c +18 -0
@@ -1719,3 +1719,21 @@ void igt_get_all_cairo_formats(const uint32_t **formats, int *format_count) *formats = drm_formats; *format_count = n_formats; } + +/** +* igt_fb_supported_format: +* @drm_format: drm fourcc to test. +* +* This functions returns whether @drm_format can be succesfully created by +* igt_create_fb() and drawn to by igt_get_cairo_ctx(). +*/ +bool igt_fb_supported_format (uint32_t drm_format) +{ +struct format_desc_struct *f; + +for_each_format (f) +if (f->drm_id == drm_format) +return f->cairo_id !=CAIRO_FORMAT_INVALID ; + +return false; +}
lib/igt_fb.h +1 -0
@@ -163,6 +163,7 @@ uint32_t igt_bpp_depth_to_drm_format(int bpp, int depth);uint32_t igt_drm_format_to_bpp (uint32_t drm_format);const char *igt_format_str (uint32_t drm_format);void igt_get_all_cairo_formats (const uint32_t **formats,int *format_count); +bool igt_fb_supported_format (uint32_t drm_format);#endif /* __IGT_FB_H__ */
tests/kms_atomic.c +3 -10
@@ -264,20 +264,13 @@ static void crtc_commit_atomic_flags_err(igt_pipe_t *pipe, igt_plane_t *plane,static uint32_t plane_get_igt_format (igt_plane_t *plane) {drmModePlanePtr plane_kms; -const uint32_t *igt_formats; -int num_igt_formats;int i; plane_kms = plane->drm_plane; -igt_get_all_cairo_formats (&igt_formats, &num_igt_formats); -for (i =0 ; i < num_igt_formats; i++) { -int j; - -for (j =0 ; j < plane_kms->count_formats; j++) { -if (plane_kms->formats[j] == igt_formats[i]) -return plane_kms->formats[j]; - } +for (i =0 ; i < plane_kms->count_formats; i++) { +if (igt_fb_supported_format (plane_kms->formats[i])) +return plane_kms->formats[i]; }return 0 ;
tests/kms_plane.c +1 -15
@@ -366,20 +366,6 @@ test_plane_panning(data_t *data, enum pipe pipe, unsigned int flags)igt_skip_on (connected_outs ==0 ); } -static bool can_draw (uint32_t drm_format) -{ -const uint32_t *drm_formats; -int format_count, i; - -igt_get_all_cairo_formats (&drm_formats, &format_count); - -for (i =0 ; i < format_count; i++) -if (drm_formats[i] == drm_format) -return true; - -return false; -} -static void test_format_plane (data_t *data,enum pipe pipe,igt_output_t *output,igt_plane_t *plane) {
@@ -420,7 +406,7 @@ static void test_format_plane(data_t *data, enum pipe pipe,for (i =0 ; i < plane->drm_plane->count_formats; i++) { format = plane->drm_plane->formats[i]; -if (!can_draw (format)) +if (!igt_fb_supported_format (format))continue ; igt_debug("Testing format 0x%x on %s.%u\n",
tests/kms_plane_scaling.c +4 -18
@@ -173,20 +173,6 @@ static bool can_rotate(unsigned format)return true; } -static bool can_draw (uint32_t drm_format) -{ -const uint32_t *drm_formats; -int format_count, i; - -igt_get_all_cairo_formats (&drm_formats, &format_count); - -for (i =0 ; i < format_count; i++) -if (drm_formats[i] == drm_format) -return true; - -return false; -} -static void test_scaler_with_rotation_pipe (data_t *d,enum pipe pipe,igt_output_t *output) {
@@ -202,7 +188,7 @@ static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,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)) +if (igt_fb_supported_format (format) &&can_rotate (format))check_scaling_pipe_plane_rot (d, plane, format,LOCAL_I915_FORMAT_MOD_Y_TILED , pipe, output, rot);
@@ -235,7 +221,7 @@ static void test_scaler_with_pixel_format_pipe(data_t *d, enum pipe pipe, igt_oufor (int j =0 ; j < plane->drm_plane->count_formats; j++) {uint32_t format = plane->drm_plane->formats[j]; -if (can_draw (format)) +if (igt_fb_supported_format (format))check_scaling_pipe_plane_rot (d, plane, format, tiling, pipe, output,IGT_ROTATION_0 );
@@ -446,13 +432,13 @@ test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe, igt_outpufor (int i =0 ; i < d->plane1->drm_plane->count_formats; i++) {unsigned f1 = d->plane1->drm_plane->formats[i]; -if (!can_draw (f1)) +if (!igt_fb_supported_format (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)) +if (!igt_fb_supported_format (f2))continue ;__test_scaler_with_clipping_clamping_scenario (d, mode, f1, f2);
Signature · 6 lines
2.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 03/12] lib/igt_fb: Add igt_fb_supported_format()
Quoted 31 lines · Maarten Lankhorst
This makes it possible to iterate whether a format is supported or not,
without each driver having to open code it.Signed-off-by Maarten Lankhorst <[email protected]>---
lib/igt_fb.c | 18 ++++++++++++++++++ lib/igt_fb.h | 1 + tests/kms_atomic.c | 13 +++---------- tests/kms_plane.c | 16 +---------------tests/kms_plane_scaling.c| 22 ++++------------------5 files changed, 27 insertions(+), 43 deletions(-)lib/igt_fb.c +0
-0@@ -1719,3 +1719,21 @@ void igt_get_all_cairo_formats(const uint32_t **formats, int *format_count) *formats = drm_formats; *format_count = n_formats;}
lib/igt_fb.c +6
-0+ +/** +* igt_fb_supported_format: +* @drm_format: drm fourcc to test. +* +* This functions returns whether @drm_format can be succesfully created by
+ *igt_create_fb()and drawn to byigt_get_cairo_ctx().
+ */
lib/igt_fb.c void igt_get_all_cairo_formats(const uint32_t **formats, int *format_count) · line 1737
Quoted 8 lines
lib/igt_fb.c +8
-0+bool igt_fb_supported_format (uint32_t drm_format) +{ +struct format_desc_struct *f; + +for_each_format (f) +if (f->drm_id == drm_format) +return f->cairo_id !=CAIRO_FORMAT_INVALID ; +
Maybe we could utilize the existing lookup_drm_format() function but even so we wouldn't save no more than couple of lines. I'm ok with this approach.
Quoted 162 lines
lib/igt_fb.c +2
-0+return false; +}lib/igt_fb.h +0
-0@@ -163,6 +163,7 @@ uint32_t igt_bpp_depth_to_drm_format(int bpp, int depth); uint32_t igt_drm_format_to_bpp(uint32_t drm_format); const char *igt_format_str(uint32_t drm_format);void
igt_get_all_cairo_formats(const uint32_t **formats, int *format_count);
+booligt_fb_supported_format(uint32_t drm_format);
#endif /*__IGT_FB_H__*/tests/kms_atomic.c +0
-2@@ -264,20 +264,13 @@ static void crtc_commit_atomic_flags_err(igt_pipe_t *pipe, igt_plane_t *plane, static uint32_t plane_get_igt_format(igt_plane_t *plane) { drmModePlanePtr plane_kms; - const uint32_t *igt_formats; - int num_igt_formats; int i;
plane_kms=plane->drm_plane;tests/kms_atomic.c +3
-8-igt_get_all_cairo_formats (&igt_formats, &num_igt_formats); -for (i =0 ; i < num_igt_formats; i++) { -int j; - -for (j =0 ; j < plane_kms->count_formats; j++) { -if (plane_kms->formats[j] == igt_formats[i]) -return plane_kms->formats[j]; - } +for (i =0 ; i < plane_kms->count_formats; i++) { +if (igt_fb_supported_format (plane_kms->formats[i])) +return plane_kms->formats[i];}
return 0;tests/kms_plane.c +0
-0@@ -366,20 +366,6 @@ test_plane_panning(data_t *data, enum pipe pipe, unsigned int flags) igt_skip_on(connected_outs == 0); }tests/kms_plane.c +0
-14-static bool can_draw (uint32_t drm_format) -{ -const uint32_t *drm_formats; -int format_count, i; - -igt_get_all_cairo_formats (&drm_formats, &format_count); - -for (i =0 ; i < format_count; i++) -if (drm_formats[i] == drm_format) -return true; - -return false; -} -static void
test_format_plane(data_t *data, enum pipe pipe, igt_output_t *output, igt_plane_t *plane)
{tests/kms_plane.c +0
-0@@ -420,7 +406,7 @@ static void test_format_plane(data_t *data, enum pipe pipe, for (i = 0; i < plane->drm_plane->count_formats; i++) { format = plane->drm_plane->formats[i];tests/kms_plane.c +1
-1-if (!can_draw (format)) +if (!igt_fb_supported_format (format))continue;
igt_debug("Testing format 0x%x on %s.%u\n",tests/kms_plane_scaling.c +0
-0@@ -173,20 +173,6 @@ static bool can_rotate(unsigned format) return true; }tests/kms_plane_scaling.c +0
-14-static bool can_draw (uint32_t drm_format) -{ -const uint32_t *drm_formats; -int format_count, i; - -igt_get_all_cairo_formats (&drm_formats, &format_count); - -for (i =0 ; i < format_count; i++) -if (drm_formats[i] == drm_format) -return true; - -return false; -} -static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,
igt_output_t *output) {tests/kms_plane_scaling.c +0
-0@@ -202,7 +188,7 @@ static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe, igt_rotation_t rot = rotations[i];for (int j = 0; j < plane->drm_plane-
Quoted 1 line
count_formats; j++) {unsigned format = plane->drm_plane-
Quoted 1 line
formats[j];
tests/kms_plane_scaling.c +0
-1- if (can_draw(format) &&
can_rotate(format))tests/kms_plane_scaling.c +1
-0+ if (igt_fb_supported_format(format)&&
can_rotate(format))
check_scaling_pipe_plane_rot(d, plane, format,
LOCAL_I915_FORMAT_MOD_Y_TILED,
pipe, output, rot);tests/kms_plane_scaling.c +0
-0@@ -235,7 +221,7 @@ static voidtest_scaler_with_pixel_format_pipe(data_t *d, enum pipe pipe,
igt_oufor (int j = 0; j < plane->drm_plane-Quoted 1 line
count_formats; j++) {
uint32_tformat = plane->drm_plane-Quoted 1 line
formats[j];
tests/kms_plane_scaling.c +1
-1-if (can_draw (format)) +if (igt_fb_supported_format (format))
check_scaling_pipe_plane_rot(d, plane,
format, tiling,
pipe, output,IGT_ROTATION_0);tests/kms_plane_scaling.c +0
-0@@ -446,13 +432,13 @@test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe,
igt_outpu
for (int i = 0; i <d->plane1->drm_plane->count_formats; i++) {
unsigned f1 = d->plane1->drm_plane->formats[i];tests/kms_plane_scaling.c +1
-1-if (!can_draw (f1)) +if (!igt_fb_supported_format (f1))continue;
for (int j = 0; j < d->plane2->drm_plane-Quoted 1 line
count_formats; j++) {unsigned f2 = d->plane2->drm_plane-
Quoted 1 line
formats[j];
tests/kms_plane_scaling.c +1
-1-if (!can_draw (f2)) +if (!igt_fb_supported_format (f2))continue;
__test_scaler_with_clipping_clamping_scenario(d, mode, f1, f2);
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 4/12 lib/igt_fb: Remove igt_get_all_cairo_formats()
In reply to Maarten LankhorstAll users have been converted to igt_fb_supported_format(), I don't think there's a valid use left for this.
--- lib/igt_fb.c | 33 --------------------------------- lib/igt_fb.h | 1 - 2 files changed, 34 deletions(-)
lib/igt_fb.c +0 -33
@@ -1687,39 +1687,6 @@ const char *igt_format_str(uint32_t drm_format)return f ? f->name :"invalid" ; } -/** -* igt_get_all_cairo_formats: -* @formats: pointer to pointer to store the allocated formats array -* @format_count: pointer to integer to store the size of the allocated array -* -* This functions returns an array of all the drm fourcc codes supported by -* cairo and this library. -*/ -void igt_get_all_cairo_formats (const uint32_t **formats,int *format_count) -{ -static uint32_t *drm_formats; -static int n_formats; - -if (!drm_formats) { -struct format_desc_struct *f; -uint32_t *format; - - n_formats =0 ; -for_each_format (f) -if (f->cairo_id !=CAIRO_FORMAT_INVALID ) - n_formats++; - - drm_formats =calloc (n_formats,sizeof (*drm_formats)); - format = &drm_formats[0 ]; -for_each_format (f) -if (f->cairo_id !=CAIRO_FORMAT_INVALID ) - *format++ = f->drm_id; - } - - *formats = drm_formats; - *format_count = n_formats; -} -/** * igt_fb_supported_format: * @drm_format: drm fourcc to test.
lib/igt_fb.h +0 -1
@@ -162,7 +162,6 @@ int igt_cairo_printf_line(cairo_t *cr, enum igt_text_align align,uint32_t igt_bpp_depth_to_drm_format (int bpp,int depth);uint32_t igt_drm_format_to_bpp (uint32_t drm_format);const char *igt_format_str (uint32_t drm_format); -void igt_get_all_cairo_formats (const uint32_t **formats,int *format_count);bool igt_fb_supported_format (uint32_t drm_format);#endif /* __IGT_FB_H__ */
Signature · 6 lines
2.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 04/12] lib/igt_fb: Remove igt_get_all_cairo_formats()
Quoted 3 lines · Maarten Lankhorst
All users have been converted to
igt_fb_supported_format(), I don't think there's a valid use left for this.
Quoted 69 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
lib/igt_fb.c | 33 ---------------------------------lib/igt_fb.h| 1 -2 files changed, 34 deletions(-)lib/igt_fb.c +0
-0@@ -1687,39 +1687,6 @@ const char *igt_format_str(uint32_t drm_format) return f ? f->name : "invalid"; }
-/**
- *igt_get_all_cairo_formats:
- * @formats: pointer to pointer to store the allocated formats array
- * @format_count: pointer to integer to store the size of the allocated array
- *
- * This functions returns an array of all the drm fourcc codes supported by
- * cairo and this library.
- */
-voidigt_get_all_cairo_formats(const uint32_t **formats, int *format_count)lib/igt_fb.c +0
-14-{ -static uint32_t *drm_formats; -static int n_formats; - -if (!drm_formats) { -struct format_desc_struct *f; -uint32_t *format; - - n_formats =0 ; -for_each_format (f) -if (f->cairo_id !=CAIRO_FORMAT_INVALID ) - n_formats++; - - drm_formats = calloc(n_formats,
sizeof(*drm_formats));lib/igt_fb.c +0
-10- format = &drm_formats[0 ]; -for_each_format (f) -if (f->cairo_id !=CAIRO_FORMAT_INVALID ) - *format++ = f->drm_id; - } - - *formats = drm_formats; - *format_count = n_formats; -} -/**
*igt_fb_supported_format:
* @drm_format: drm fourcc to test.lib/igt_fb.h +0
-1@@ -162,7 +162,6 @@ int igt_cairo_printf_line(cairo_t *cr, enumigt_text_align align, uint32_t igt_bpp_depth_to_drm_format(int bpp, int depth); uint32_t igt_drm_format_to_bpp(uint32_t drm_format); const char *igt_format_str(uint32_t drm_format); -void igt_get_all_cairo_formats (const uint32_t **formats,int *format_count); bool igt_fb_supported_format(uint32_t drm_format);
#endif /*__IGT_FB_H__*/
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 5/12 lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain.
In reply to Maarten LankhorstCollecting CRC may result in a modeset and extra vblank waits. On some tests this will increase the runtime a lot, so it makes sense to keep it enabled, and only collect the most recent CRC when needed.
--- lib/igt_debugfs.c | 73 ++++++++++++++++++++++++++++++++++++++++++++--- lib/igt_debugfs.h | 2 ++ tests/kms_cursor_legacy.c | 21 ++++---------- 3 files changed, 76 insertions(+), 20 deletions(-)
lib/igt_debugfs.c +69 -4
@@ -33,6 +33,7 @@#include <limits.h> #include <string.h> #include <fcntl.h> +#include <poll.h> #include <unistd.h> #include <i915_drm.h>
@@ -697,7 +698,7 @@ static bool pipe_crc_init_from_string(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc,return true; } -static int read_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out) +static int read_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out,bool override_nonblock) {ssize_t bytes_read;char buf[MAX_LINE_LEN +1 ];
@@ -706,7 +707,7 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) bytes_read =read (pipe_crc->crc_fd, &buf,MAX_LINE_LEN );igt_reset_timeout (); -if (bytes_read <0 && errno ==EAGAIN ) +if (bytes_read <0 && errno ==EAGAIN && !override_nonblock)igt_assert (pipe_crc->flags &O_NONBLOCK );if (bytes_read <0 )
@@ -722,7 +723,7 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)static void read_one_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out) { -while (read_crc (pipe_crc, out) ==0 ) +while (read_crc (pipe_crc, out, false) ==0 )usleep (1000 ); }
@@ -794,7 +795,7 @@ igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,igt_crc_t *crc = &crcs[n];int ret; - ret =read_crc (pipe_crc, crc); + ret =read_crc (pipe_crc, crc, false);if (ret <0 )continue ;if (ret ==0 )
@@ -854,6 +855,70 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)crc_sanity_checks (out_crc); } +/** +* igt_pipe_crc_drain: +* @pipe_crc: pipe CRC object +* +* Discards all currently queued CRC values from @pipe_crc. This function does +* not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh +* CRC with igt_pipe_crc_get_single(). +*/ +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc) +{ +igt_crc_t crc; +int ret; + +fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags |O_NONBLOCK ); +do { + ret =read_crc (pipe_crc, &crc, true); + }while (ret >0 || errno ==EINTR ); +fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags); +} + +/** +* igt_pipe_crc_get_single: +* @pipe_crc: pipe CRC object +* @crc: buffer pointer for the captured CRC value +* +* Read a single @crc from @pipe_crc. This function does not block +* when nonblocking CRC is requested, and will return false if no CRC +* can be captured. +* +* If opened in blocking mode it will always block until a new CRC is read, like +* igt_pipe_crc_collect_crc(). +* +* Callers must start and stop the capturing themselves by calling +* igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting +* look at igt_pipe_crc_collect_crc(). +* +* If capturing has been going on for a while and a fresh crc is required, +* you will need to call igt_pipe_crc_drain() first to remove stale entries. +* +* Returns: +* Whether a crc is captured, only false in non-blocking mode. +*/ +bool +igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *crc) +{ +bool found = true; + +if (pipe_crc->flags &O_NONBLOCK ) { +int ret; + +do { + ret =read_crc (pipe_crc, crc, false); + }while (ret <0 ); + + found = ret; + }else +read_one_crc (pipe_crc, crc); + +if (found) +crc_sanity_checks (crc); + +return found; +} +/* * Drop caches */
lib/igt_debugfs.h +2 -0
@@ -130,6 +130,8 @@ void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc); __attribute__((warn_unused_result))int igt_pipe_crc_get_crcs (igt_pipe_crc_t *pipe_crc,int n_crcs,igt_crc_t **out_crcs); +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc); +bool igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_pipe_crc_collect_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_hpd_storm_set_threshold (int fd,unsigned int threshold);
tests/kms_cursor_legacy.c +5 -16
@@ -1276,7 +1276,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)enum pipe pipe =find_connected_pipe (display, false);igt_pipe_t *pipe_connected = &display->pipes[pipe];igt_plane_t *plane_primary =igt_pipe_get_plane_type (pipe_connected,DRM_PLANE_TYPE_PRIMARY ); -igt_crc_t crcs[2 ]; +igt_crc_t crcs[2 ], test_crc;if (atomic)igt_require (display->is_atomic);
@@ -1290,7 +1290,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_LEGACY ); - pipe_crc =igt_pipe_crc_new_nonblock (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); + pipe_crc =igt_pipe_crc_new (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO );set_cursor_on_pipe (display, pipe, &cursor_fb);igt_display_commit2 (display,COMMIT_UNIVERSAL );
@@ -1322,9 +1322,6 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)/* Disable cursor, and immediately queue a flip. Check if resulting crc is correct. */ for (int i =1 ; i >=0 ; i--) {igt_spin_t *spin; -igt_crc_t *received_crcs =NULL ; -int ncrcs; -static const int max_crcs =8 ; spin =igt_spin_batch_new (display->drm_fd,0 ,0 , fb_info[1 ].gem_handle);
@@ -1336,7 +1333,8 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_assert_eq (get_vblank (display->drm_fd, pipe,0 ), vblank_start); - ncrcs =igt_pipe_crc_get_crcs (pipe_crc, max_crcs, &received_crcs); +igt_pipe_crc_drain (pipe_crc); +igt_pipe_crc_get_single (pipe_crc, &test_crc);igt_spin_batch_free (display->drm_fd, spin);
@@ -1349,16 +1347,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_plane_set_fb (plane_primary, &fb_info[0 ]);igt_display_commit2 (display,COMMIT_UNIVERSAL ); -/* -* We collect the crc nonblockingly, and should have at least 1 -* but not so many crcs that we overflow. Last CRC is the only -* one we care about here. Other CRCs may have been from before -* the cursor update and can contain garbage. -*/ -igt_assert (ncrcs >0 && ncrcs < max_crcs); - -igt_assert_crc_equal (&crcs[i], &received_crcs[ncrcs -1 ]); -free (received_crcs); +igt_assert_crc_equal (&crcs[i], &test_crc); }igt_remove_fb (display->drm_fd, &fb_info[1 ]);
Signature · 6 lines
2.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 05/12] lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain.
Quoted 70 lines · Maarten Lankhorst
Collecting CRC may result in a modeset and extra vblank waits. On some tests this will increase the runtime a lot, so it makes sense to keep it enabled, and only collect the most recent CRC when needed.
Signed-off-by Maarten Lankhorst <[email protected]>--- lib/igt_debugfs.c | 73 ++++++++++++++++++++++++++++++++++++++++++++--- lib/igt_debugfs.h | 2 ++ tests/kms_cursor_legacy.c | 21 ++++---------- 3 files changed, 76 insertions(+), 20 deletions(-)lib/igt_debugfs.c +12
-4@@ -33,6 +33,7 @@#include <limits.h> #include <string.h> #include <fcntl.h> +#include <poll.h> #include <unistd.h> #include <i915_drm.h> @@ -697,7 +698,7 @@ static bool pipe_crc_init_from_string(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc,return true; } -static int read_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out) +static int read_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out,bool override_nonblock) {ssize_t bytes_read;char buf[MAX_LINE_LEN +1 ];@@ -706,7 +707,7 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) bytes_read =read (pipe_crc->crc_fd, &buf,MAX_LINE_LEN );igt_reset_timeout (); -if (bytes_read <0 && errno ==EAGAIN ) +if (bytes_read <0 && errno ==EAGAIN && !override_nonblock)igt_assert (pipe_crc->flags &O_NONBLOCK );if (bytes_read <0 )@@ -722,7 +723,7 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)static void read_one_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out) { -while (read_crc (pipe_crc, out) ==0 ) +while (read_crc (pipe_crc, out, false) ==0 )usleep (1000 ); }@@ -794,7 +795,7 @@ igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,igt_crc_t *crc = &crcs[n];int ret; - ret =read_crc (pipe_crc, crc); + ret =read_crc (pipe_crc, crc, false);if (ret <0 )continue ;if (ret ==0 )@@ -854,6 +855,70 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)crc_sanity_checks (out_crc); } +/** +* igt_pipe_crc_drain: +* @pipe_crc: pipe CRC object +* +* Discards all currently queued CRC values from @pipe_crc. This function does +* not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh +* CRC with igt_pipe_crc_get_single().
lib/igt_debugfs.c void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc) · line 874
Quoted 10 lines
lib/igt_debugfs.c +10
-0+*/ +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc) +{ +igt_crc_t crc; +int ret; + +fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags |O_NONBLOCK ); +do { + ret =read_crc (pipe_crc, &crc, true); + }while (ret >0 || errno ==EINTR );
Is errno valid for ret==0?
Quoted 130 lines
lib/igt_debugfs.c +47
-0+fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags); +} + +/** +* igt_pipe_crc_get_single: +* @pipe_crc: pipe CRC object +* @crc: buffer pointer for the captured CRC value +* +* Read a single @crc from @pipe_crc. This function does not block +* when nonblocking CRC is requested, and will return false if no CRC +* can be captured. +* +* If opened in blocking mode it will always block until a new CRC is read, like +* igt_pipe_crc_collect_crc(). +* +* Callers must start and stop the capturing themselves by calling +* igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting +* look at igt_pipe_crc_collect_crc(). +* +* If capturing has been going on for a while and a fresh crc is required, +* you will need to call igt_pipe_crc_drain() first to remove stale entries. +* +* Returns: +* Whether a crc is captured, only false in non-blocking mode. +*/ +bool +igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *crc) +{ +bool found = true; + +if (pipe_crc->flags &O_NONBLOCK ) { +int ret; + +do { + ret =read_crc (pipe_crc, crc, false); + }while (ret <0 ); + + found = ret; + }else +read_one_crc (pipe_crc, crc); + +if (found) +crc_sanity_checks (crc); + +return found; +} +/* * Drop caches */ lib/igt_debugfs.h +2
-0@@ -130,6 +130,8 @@ void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc); __attribute__((warn_unused_result))int igt_pipe_crc_get_crcs (igt_pipe_crc_t *pipe_crc,int n_crcs,igt_crc_t **out_crcs); +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc); +bool igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_pipe_crc_collect_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_hpd_storm_set_threshold (int fd,unsigned int threshold);tests/kms_cursor_legacy.c +5
-16@@ -1276,7 +1276,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)enum pipe pipe =find_connected_pipe (display, false);igt_pipe_t *pipe_connected = &display->pipes[pipe];igt_plane_t *plane_primary =igt_pipe_get_plane_type (pipe_connected,DRM_PLANE_TYPE_PRIMARY ); -igt_crc_t crcs[2 ]; +igt_crc_t crcs[2 ], test_crc;if (atomic)igt_require (display->is_atomic);@@ -1290,7 +1290,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_LEGACY ); - pipe_crc =igt_pipe_crc_new_nonblock (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); + pipe_crc =igt_pipe_crc_new (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO );set_cursor_on_pipe (display, pipe, &cursor_fb);igt_display_commit2 (display,COMMIT_UNIVERSAL );@@ -1322,9 +1322,6 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)/* Disable cursor, and immediately queue a flip. Check if resulting crc is correct. */ for (int i =1 ; i >=0 ; i--) {igt_spin_t *spin; -igt_crc_t *received_crcs =NULL ; -int ncrcs; -static const int max_crcs =8 ; spin =igt_spin_batch_new (display->drm_fd,0 ,0 , fb_info[1 ].gem_handle);@@ -1336,7 +1333,8 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_assert_eq (get_vblank (display->drm_fd, pipe,0 ), vblank_start); - ncrcs =igt_pipe_crc_get_crcs (pipe_crc, max_crcs, &received_crcs); +igt_pipe_crc_drain (pipe_crc); +igt_pipe_crc_get_single (pipe_crc, &test_crc);igt_spin_batch_free (display->drm_fd, spin);@@ -1349,16 +1347,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_plane_set_fb (plane_primary, &fb_info[0 ]);igt_display_commit2 (display,COMMIT_UNIVERSAL ); -/* -* We collect the crc nonblockingly, and should have at least 1 -* but not so many crcs that we overflow. Last CRC is the only -* one we care about here. Other CRCs may have been from before -* the cursor update and can contain garbage. -*/ -igt_assert (ncrcs >0 && ncrcs < max_crcs); - -igt_assert_crc_equal (&crcs[i], &received_crcs[ncrcs -1 ]); -free (received_crcs); +igt_assert_crc_equal (&crcs[i], &test_crc); }igt_remove_fb (display->drm_fd, &fb_info[1 ]);Signature · 6 lines
2.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 05/12] lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain.
Op 06-02-18 om 17:11 schreef Ville Syrjälä:
Quoted 74 lines · Maarten Lankhorst
Quoted 73 lines
Collecting CRC may result in a modeset and extra vblank waits. On some tests this will increase the runtime a lot, so it makes sense to keep it enabled, and only collect the most recent CRC when needed.
Signed-off-by Maarten Lankhorst <[email protected]>--- lib/igt_debugfs.c | 73 ++++++++++++++++++++++++++++++++++++++++++++--- lib/igt_debugfs.h | 2 ++ tests/kms_cursor_legacy.c | 21 ++++---------- 3 files changed, 76 insertions(+), 20 deletions(-)lib/igt_debugfs.c +15
-4@@ -33,6 +33,7 @@#include <limits.h> #include <string.h> #include <fcntl.h> +#include <poll.h> #include <unistd.h> #include <i915_drm.h> @@ -697,7 +698,7 @@ static bool pipe_crc_init_from_string(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc,return true; } -static int read_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out) +static int read_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out,bool override_nonblock) {ssize_t bytes_read;char buf[MAX_LINE_LEN +1 ];@@ -706,7 +707,7 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) bytes_read =read (pipe_crc->crc_fd, &buf,MAX_LINE_LEN );igt_reset_timeout (); -if (bytes_read <0 && errno ==EAGAIN ) +if (bytes_read <0 && errno ==EAGAIN && !override_nonblock)igt_assert (pipe_crc->flags &O_NONBLOCK );if (bytes_read <0 )@@ -722,7 +723,7 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)static void read_one_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out) { -while (read_crc (pipe_crc, out) ==0 ) +while (read_crc (pipe_crc, out, false) ==0 )usleep (1000 ); }@@ -794,7 +795,7 @@ igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,igt_crc_t *crc = &crcs[n];int ret; - ret =read_crc (pipe_crc, crc); + ret =read_crc (pipe_crc, crc, false);if (ret <0 )continue ;if (ret ==0 )@@ -854,6 +855,70 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)crc_sanity_checks (out_crc); } +/** +* igt_pipe_crc_drain: +* @pipe_crc: pipe CRC object +* +* Discards all currently queued CRC values from @pipe_crc. This function does +* not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh +* CRC with igt_pipe_crc_get_single(). +*/ +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc) +{
Quoted 8 lines
lib/igt_debugfs.c void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc) · line 874
Quoted 7 lines
lib/igt_debugfs.c +7
-0+igt_crc_t crc; +int ret; + +fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags |O_NONBLOCK ); +do { + ret =read_crc (pipe_crc, &crc, true); + }while (ret >0 || errno ==EINTR );Is errno valid for ret==0?
Crap, whole read_crc has botched this part, -1 is never returned even for the -EINVAL branch, because it can never be triggered even with invalid CRC's...
I guess this patch needs more thought..
Quoted 123 lines
Quoted 123 lines
lib/igt_debugfs.c +47
-0+fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags); +} + +/** +* igt_pipe_crc_get_single: +* @pipe_crc: pipe CRC object +* @crc: buffer pointer for the captured CRC value +* +* Read a single @crc from @pipe_crc. This function does not block +* when nonblocking CRC is requested, and will return false if no CRC +* can be captured. +* +* If opened in blocking mode it will always block until a new CRC is read, like +* igt_pipe_crc_collect_crc(). +* +* Callers must start and stop the capturing themselves by calling +* igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting +* look at igt_pipe_crc_collect_crc(). +* +* If capturing has been going on for a while and a fresh crc is required, +* you will need to call igt_pipe_crc_drain() first to remove stale entries. +* +* Returns: +* Whether a crc is captured, only false in non-blocking mode. +*/ +bool +igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *crc) +{ +bool found = true; + +if (pipe_crc->flags &O_NONBLOCK ) { +int ret; + +do { + ret =read_crc (pipe_crc, crc, false); + }while (ret <0 ); + + found = ret; + }else +read_one_crc (pipe_crc, crc); + +if (found) +crc_sanity_checks (crc); + +return found; +} +/* * Drop caches */ lib/igt_debugfs.h +2
-0@@ -130,6 +130,8 @@ void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc); __attribute__((warn_unused_result))int igt_pipe_crc_get_crcs (igt_pipe_crc_t *pipe_crc,int n_crcs,igt_crc_t **out_crcs); +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc); +bool igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_pipe_crc_collect_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_hpd_storm_set_threshold (int fd,unsigned int threshold);tests/kms_cursor_legacy.c +5
-16@@ -1276,7 +1276,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)enum pipe pipe =find_connected_pipe (display, false);igt_pipe_t *pipe_connected = &display->pipes[pipe];igt_plane_t *plane_primary =igt_pipe_get_plane_type (pipe_connected,DRM_PLANE_TYPE_PRIMARY ); -igt_crc_t crcs[2 ]; +igt_crc_t crcs[2 ], test_crc;if (atomic)igt_require (display->is_atomic);@@ -1290,7 +1290,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_LEGACY ); - pipe_crc =igt_pipe_crc_new_nonblock (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); + pipe_crc =igt_pipe_crc_new (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO );set_cursor_on_pipe (display, pipe, &cursor_fb);igt_display_commit2 (display,COMMIT_UNIVERSAL );@@ -1322,9 +1322,6 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)/* Disable cursor, and immediately queue a flip. Check if resulting crc is correct. */ for (int i =1 ; i >=0 ; i--) {igt_spin_t *spin; -igt_crc_t *received_crcs =NULL ; -int ncrcs; -static const int max_crcs =8 ; spin =igt_spin_batch_new (display->drm_fd,0 ,0 , fb_info[1 ].gem_handle);@@ -1336,7 +1333,8 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_assert_eq (get_vblank (display->drm_fd, pipe,0 ), vblank_start); - ncrcs =igt_pipe_crc_get_crcs (pipe_crc, max_crcs, &received_crcs); +igt_pipe_crc_drain (pipe_crc); +igt_pipe_crc_get_single (pipe_crc, &test_crc);igt_spin_batch_free (display->drm_fd, spin);@@ -1349,16 +1347,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_plane_set_fb (plane_primary, &fb_info[0 ]);igt_display_commit2 (display,COMMIT_UNIVERSAL ); -/* -* We collect the crc nonblockingly, and should have at least 1 -* but not so many crcs that we overflow. Last CRC is the only -* one we care about here. Other CRCs may have been from before -* the cursor update and can contain garbage. -*/ -igt_assert (ncrcs >0 && ncrcs < max_crcs); - -igt_assert_crc_equal (&crcs[i], &received_crcs[ncrcs -1 ]); -free (received_crcs); +igt_assert_crc_equal (&crcs[i], &test_crc); }
Quoted 8 lines
Quoted 8 lines
tests/kms_cursor_legacy.c +0
-0igt_remove_fb (display->drm_fd, &fb_info[1 ]);Signature · 6 lines
2.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 1/1 lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain, v2.
In reply to Ville SyrjäläCollecting CRC may result in a modeset and extra vblank waits. On some tests this will increase the runtime a lot, so it makes sense to keep it enabled, and only collect the most recent CRC when needed.
Changes since v1:
- Fix read_crc semantics. (Ville)
--- lib/igt_debugfs.c | 74 +++++++++++++++++++++++++++++++++++++++++++---- lib/igt_debugfs.h | 2 ++ tests/kms_cursor_legacy.c | 21 ++++---------- 3 files changed, 76 insertions(+), 21 deletions(-)
lib/igt_debugfs.c +69 -5
@@ -710,11 +710,11 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)igt_assert (pipe_crc->flags &O_NONBLOCK );if (bytes_read <0 ) - bytes_read =0 ; - - buf[bytes_read] ='\0' ; + bytes_read = -errno; +else + buf[bytes_read] ='\0' ; -if (bytes_read && !pipe_crc_init_from_string (pipe_crc, out, buf)) +if (bytes_read >0 && !pipe_crc_init_from_string (pipe_crc, out, buf))return -EINVAL ;return bytes_read;
@@ -722,7 +722,9 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)static void read_one_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out) { -while (read_crc (pipe_crc, out) ==0 ) +int ret; + +while ((ret =read_crc (pipe_crc, out)) <=0 && ret != -EINVAL )usleep (1000 ); }
@@ -854,6 +856,68 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)crc_sanity_checks (out_crc); } +/** +* igt_pipe_crc_drain: +* @pipe_crc: pipe CRC object +* +* Discards all currently queued CRC values from @pipe_crc. This function does +* not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh +* CRC with igt_pipe_crc_get_single(). +*/ +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc) +{ +int ret; +igt_crc_t crc; + +fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags |O_NONBLOCK ); + +do { + ret =read_crc (pipe_crc, &crc); + }while (ret !=0 ); + +fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags); +} + +/** +* igt_pipe_crc_get_single: +* @pipe_crc: pipe CRC object +* @crc: buffer pointer for the captured CRC value +* +* Read a single @crc from @pipe_crc. This function does not block +* when nonblocking CRC is requested, and will return false if no CRC +* can be captured. +* +* If opened in blocking mode it will always block until a new CRC is read, like +* igt_pipe_crc_collect_crc(). +* +* Callers must start and stop the capturing themselves by calling +* igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting +* look at igt_pipe_crc_collect_crc(). +* +* If capturing has been going on for a while and a fresh crc is required, +* you will need to call igt_pipe_crc_drain() first to remove stale entries. +* +* Returns: +* Whether a crc is captured, only false in non-blocking mode. +*/ +bool +igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *crc) +{ +bool found = true; + +if (pipe_crc->flags &O_NONBLOCK ) { +int ret =read_crc (pipe_crc, crc); + + found = ret >0 ; + }else +read_one_crc (pipe_crc, crc); + +if (found) +crc_sanity_checks (crc); + +return found; +} +/* * Drop caches */
lib/igt_debugfs.h +2 -0
@@ -130,6 +130,8 @@ void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc); __attribute__((warn_unused_result))int igt_pipe_crc_get_crcs (igt_pipe_crc_t *pipe_crc,int n_crcs,igt_crc_t **out_crcs); +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc); +bool igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_pipe_crc_collect_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_hpd_storm_set_threshold (int fd,unsigned int threshold);
tests/kms_cursor_legacy.c +5 -16
@@ -1276,7 +1276,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)enum pipe pipe =find_connected_pipe (display, false);igt_pipe_t *pipe_connected = &display->pipes[pipe];igt_plane_t *plane_primary =igt_pipe_get_plane_type (pipe_connected,DRM_PLANE_TYPE_PRIMARY ); -igt_crc_t crcs[2 ]; +igt_crc_t crcs[2 ], test_crc;if (atomic)igt_require (display->is_atomic);
@@ -1290,7 +1290,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_LEGACY ); - pipe_crc =igt_pipe_crc_new_nonblock (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); + pipe_crc =igt_pipe_crc_new (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO );set_cursor_on_pipe (display, pipe, &cursor_fb);igt_display_commit2 (display,COMMIT_UNIVERSAL );
@@ -1322,9 +1322,6 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)/* Disable cursor, and immediately queue a flip. Check if resulting crc is correct. */ for (int i =1 ; i >=0 ; i--) {igt_spin_t *spin; -igt_crc_t *received_crcs =NULL ; -int ncrcs; -static const int max_crcs =8 ; spin =igt_spin_batch_new (display->drm_fd,0 ,0 , fb_info[1 ].gem_handle);
@@ -1336,7 +1333,8 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_assert_eq (get_vblank (display->drm_fd, pipe,0 ), vblank_start); - ncrcs =igt_pipe_crc_get_crcs (pipe_crc, max_crcs, &received_crcs); +igt_pipe_crc_drain (pipe_crc); +igt_pipe_crc_get_single (pipe_crc, &test_crc);igt_spin_batch_free (display->drm_fd, spin);
@@ -1349,16 +1347,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_plane_set_fb (plane_primary, &fb_info[0 ]);igt_display_commit2 (display,COMMIT_UNIVERSAL ); -/* -* We collect the crc nonblockingly, and should have at least 1 -* but not so many crcs that we overflow. Last CRC is the only -* one we care about here. Other CRCs may have been from before -* the cursor update and can contain garbage. -*/ -igt_assert (ncrcs >0 && ncrcs < max_crcs); - -igt_assert_crc_equal (&crcs[i], &received_crcs[ncrcs -1 ]); -free (received_crcs); +igt_assert_crc_equal (&crcs[i], &test_crc); }igt_remove_fb (display->drm_fd, &fb_info[1 ]);
Signature · 6 lines
2.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain, v2.
Quoted 8 lines · Maarten Lankhorst
Collecting CRC may result in a modeset and extra vblank waits. On some
tests this will increase the runtime a lot, so it makes sense to keep it enabled, and only collect the most recent CRC when needed.Changes since v1:
- Fixread_crcsemantics. (Ville)
Quoted 213 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
lib/igt_debugfs.c | 74
+++++++++++++++++++++++++++++++++++++++++++----
lib/igt_debugfs.h | 2 ++
tests/kms_cursor_legacy.c | 21 ++++----------3 files changed, 76 insertions(+), 21 deletions(-)lib/igt_debugfs.c +0
-0@@ -710,11 +710,11 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) igt_assert(pipe_crc->flags & O_NONBLOCK);
if (bytes_read< 0)lib/igt_debugfs.c +3
-3- bytes_read =0 ; - - buf[bytes_read] ='\0' ; + bytes_read = -errno; + else + buf[bytes_read] ='\0' ;lib/igt_debugfs.c +0
-1- if (bytes_read && !pipe_crc_init_from_string(pipe_crc, out,buf))
lib/igt_debugfs.c +1
-0+ if (bytes_read > 0 && !pipe_crc_init_from_string(pipe_crc,out, buf))
return-EINVAL;
returnbytes_read;lib/igt_debugfs.c +0
-0@@ -722,7 +722,9 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
static voidread_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out){lib/igt_debugfs.c +3
-2-while (read_crc (pipe_crc, out) ==0 ) +int ret; + + while ((ret = read_crc(pipe_crc, out)) <= 0 && ret != -EINVAL)usleep(1000);
}lib/igt_debugfs.c +0
-0@@ -854,6 +856,68 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc) crc_sanity_checks(out_crc); }
+/**
+ *igt_pipe_crc_drain:
+ * @pipe_crc: pipe CRC object
+ *
+ * Discards all currently queued CRC values from @pipe_crc. This function does
+ * not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh
+ * CRC withigt_pipe_crc_get_single().
+ */lib/igt_debugfs.c +6
-0+void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc) +{ +int ret; +igt_crc_t crc; + + fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags |
O_NONBLOCK);lib/igt_debugfs.c +15
-0+ +do { + ret =read_crc (pipe_crc, &crc); + }while (ret !=0 ); + +fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags); +} + +/** +* igt_pipe_crc_get_single: +* @pipe_crc: pipe CRC object +* @crc: buffer pointer for the captured CRC value +* +* Read a single @crc from @pipe_crc. This function does not block +* when nonblocking CRC is requested, and will return false if no CRC
+ * can be captured.
+ *
+ * If opened in blocking mode it will always block until a new CRC is read, like
+ *igt_pipe_crc_collect_crc().
+ *
+ * Callers must start and stop the capturing themselves by calling
+ *igt_pipe_crc_start()andigt_pipe_crc_stop(). For one-shot CRC collecting
+ * look atigt_pipe_crc_collect_crc().
+ *
+ * If capturing has been going on for a while and a fresh crc is required,
+ * you will need to calligt_pipe_crc_drain()first to remove stale entries.
+ *
+ * Returns:
+ * Whether a crc is captured, only false in non-blocking mode.
+ */lib/igt_debugfs.c +18
-0+bool +igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *crc) +{ +bool found = true; + +if (pipe_crc->flags &O_NONBLOCK ) { +int ret =read_crc (pipe_crc, crc); + + found = ret >0 ; + }else +read_one_crc (pipe_crc, crc); + +if (found) +crc_sanity_checks (crc); + +return found; +} +/*
* Drop caches
*/lib/igt_debugfs.h +2
-0@@ -130,6 +130,8 @@ void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc); __attribute__((warn_unused_result)) int igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs, igt_crc_t **out_crcs); +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc); +bool igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void
igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
voidigt_hpd_storm_set_threshold(int fd, unsigned int threshold);tests/kms_cursor_legacy.c +0
-0@@ -1276,7 +1276,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic) enum pipe pipe = find_connected_pipe(display, false); igt_pipe_t *pipe_connected = &display->pipes[pipe];
igt_plane_t*plane_primary=igt_pipe_get_plane_type(pipe_connected, DRM_PLANE_TYPE_PRIMARY);tests/kms_cursor_legacy.c +1
-1-igt_crc_t crcs[2 ]; +igt_crc_t crcs[2 ], test_crc;
if (atomic)
igt_require(display->is_atomic);tests/kms_cursor_legacy.c +0
-0@@ -1290,7 +1290,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)
igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);tests/kms_cursor_legacy.c +0
-1- pipe_crc = igt_pipe_crc_new_nonblock(display->drm_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);tests/kms_cursor_legacy.c +1
-0+ pipe_crc = igt_pipe_crc_new(display->drm_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
set_cursor_on_pipe(display, pipe, &cursor_fb);igt_display_commit2(display, COMMIT_UNIVERSAL);tests/kms_cursor_legacy.c +0
-0@@ -1322,9 +1322,6 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic) /* Disable cursor, and immediately queue a flip. Check ifresulting crc is correct. */
for (int i = 1; i >= 0; i--) {
igt_spin_t*spin;tests/kms_cursor_legacy.c +0
-3-igt_crc_t *received_crcs =NULL ; -int ncrcs; -static const int max_crcs =8 ;
spin =igt_spin_batch_new(display->drm_fd, 0, 0, fb_info[1].gem_handle);tests/kms_cursor_legacy.c +0
-0@@ -1336,7 +1333,8 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)
igt_assert_eq(get_vblank(display->drm_fd, pipe, 0), vblank_start);tests/kms_cursor_legacy.c +0
-1- ncrcs = igt_pipe_crc_get_crcs(pipe_crc, max_crcs,
&received_crcs);tests/kms_cursor_legacy.c +2
-0+igt_pipe_crc_drain (pipe_crc); +igt_pipe_crc_get_single (pipe_crc, &test_crc);
igt_spin_batch_free(display->drm_fd, spin);tests/kms_cursor_legacy.c +0
-0@@ -1349,16 +1347,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic) igt_plane_set_fb(plane_primary, &fb_info[0]); igt_display_commit2(display, COMMIT_UNIVERSAL);tests/kms_cursor_legacy.c +0
-2-/* -* We collect the crc nonblockingly, and should have at least 1
tests/kms_cursor_legacy.c +0
-1- * but not so many crcs that we overflow. Last CRCis the only
tests/kms_cursor_legacy.c +0
-1- * one we care about here. Other CRCs may have beenfrom before
tests/kms_cursor_legacy.c +1
-7-* the cursor update and can contain garbage. -*/ -igt_assert (ncrcs >0 && ncrcs < max_crcs); - -igt_assert_crc_equal (&crcs[i], &received_crcs[ncrcs - 1]); -free (received_crcs); +igt_assert_crc_equal (&crcs[i], &test_crc);}
igt_remove_fb(display->drm_fd, &fb_info[1]);
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 1/1 lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain, v3.
Collecting CRC may result in a modeset and extra vblank waits. On some tests this will increase the runtime a lot, so it makes sense to keep it enabled, and only collect the most recent CRC when needed.
Changes since v1:
- Fix read_crc semantics. (Ville)
Changes since v2:
- Remove EAGAIN assert, can be reached from drain_crc.
--- lib/igt_debugfs.c | 77 ++++++++++++++++++++++++++++++++++++++++++----- lib/igt_debugfs.h | 2 ++ tests/kms_cursor_legacy.c | 21 +++---------- 3 files changed, 76 insertions(+), 24 deletions(-)
lib/igt_debugfs.c +69 -8
@@ -706,15 +706,12 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) bytes_read =read (pipe_crc->crc_fd, &buf,MAX_LINE_LEN );igt_reset_timeout (); -if (bytes_read <0 && errno ==EAGAIN ) -igt_assert (pipe_crc->flags &O_NONBLOCK ); -if (bytes_read <0 ) - bytes_read =0 ; - - buf[bytes_read] ='\0' ; + bytes_read = -errno; +else + buf[bytes_read] ='\0' ; -if (bytes_read && !pipe_crc_init_from_string (pipe_crc, out, buf)) +if (bytes_read >0 && !pipe_crc_init_from_string (pipe_crc, out, buf))return -EINVAL ;return bytes_read;
@@ -722,7 +719,9 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)static void read_one_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out) { -while (read_crc (pipe_crc, out) ==0 ) +int ret; + +while ((ret =read_crc (pipe_crc, out)) <=0 && ret != -EINVAL )usleep (1000 ); }
@@ -854,6 +853,68 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)crc_sanity_checks (out_crc); } +/** +* igt_pipe_crc_drain: +* @pipe_crc: pipe CRC object +* +* Discards all currently queued CRC values from @pipe_crc. This function does +* not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh +* CRC with igt_pipe_crc_get_single(). +*/ +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc) +{ +int ret; +igt_crc_t crc; + +fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags |O_NONBLOCK ); + +do { + ret =read_crc (pipe_crc, &crc); + }while (ret !=0 ); + +fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags); +} + +/** +* igt_pipe_crc_get_single: +* @pipe_crc: pipe CRC object +* @crc: buffer pointer for the captured CRC value +* +* Read a single @crc from @pipe_crc. This function does not block +* when nonblocking CRC is requested, and will return false if no CRC +* can be captured. +* +* If opened in blocking mode it will always block until a new CRC is read, like +* igt_pipe_crc_collect_crc(). +* +* Callers must start and stop the capturing themselves by calling +* igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting +* look at igt_pipe_crc_collect_crc(). +* +* If capturing has been going on for a while and a fresh crc is required, +* you will need to call igt_pipe_crc_drain() first to remove stale entries. +* +* Returns: +* Whether a crc is captured, only false in non-blocking mode. +*/ +bool +igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *crc) +{ +bool found = true; + +if (pipe_crc->flags &O_NONBLOCK ) { +int ret =read_crc (pipe_crc, crc); + + found = ret >0 ; + }else +read_one_crc (pipe_crc, crc); + +if (found) +crc_sanity_checks (crc); + +return found; +} +/* * Drop caches */
lib/igt_debugfs.h +2 -0
@@ -130,6 +130,8 @@ void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc); __attribute__((warn_unused_result))int igt_pipe_crc_get_crcs (igt_pipe_crc_t *pipe_crc,int n_crcs,igt_crc_t **out_crcs); +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc); +bool igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_pipe_crc_collect_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_hpd_storm_set_threshold (int fd,unsigned int threshold);
tests/kms_cursor_legacy.c +5 -16
@@ -1276,7 +1276,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)enum pipe pipe =find_connected_pipe (display, false);igt_pipe_t *pipe_connected = &display->pipes[pipe];igt_plane_t *plane_primary =igt_pipe_get_plane_type (pipe_connected,DRM_PLANE_TYPE_PRIMARY ); -igt_crc_t crcs[2 ]; +igt_crc_t crcs[2 ], test_crc;if (atomic)igt_require (display->is_atomic);
@@ -1290,7 +1290,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_LEGACY ); - pipe_crc =igt_pipe_crc_new_nonblock (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); + pipe_crc =igt_pipe_crc_new (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO );set_cursor_on_pipe (display, pipe, &cursor_fb);igt_display_commit2 (display,COMMIT_UNIVERSAL );
@@ -1322,9 +1322,6 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)/* Disable cursor, and immediately queue a flip. Check if resulting crc is correct. */ for (int i =1 ; i >=0 ; i--) {igt_spin_t *spin; -igt_crc_t *received_crcs =NULL ; -int ncrcs; -static const int max_crcs =8 ; spin =igt_spin_batch_new (display->drm_fd,0 ,0 , fb_info[1 ].gem_handle);
@@ -1336,7 +1333,8 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_assert_eq (get_vblank (display->drm_fd, pipe,0 ), vblank_start); - ncrcs =igt_pipe_crc_get_crcs (pipe_crc, max_crcs, &received_crcs); +igt_pipe_crc_drain (pipe_crc); +igt_pipe_crc_get_single (pipe_crc, &test_crc);igt_spin_batch_free (display->drm_fd, spin);
@@ -1349,16 +1347,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_plane_set_fb (plane_primary, &fb_info[0 ]);igt_display_commit2 (display,COMMIT_UNIVERSAL ); -/* -* We collect the crc nonblockingly, and should have at least 1 -* but not so many crcs that we overflow. Last CRC is the only -* one we care about here. Other CRCs may have been from before -* the cursor update and can contain garbage. -*/ -igt_assert (ncrcs >0 && ncrcs < max_crcs); - -igt_assert_crc_equal (&crcs[i], &received_crcs[ncrcs -1 ]); -free (received_crcs); +igt_assert_crc_equal (&crcs[i], &test_crc); }igt_remove_fb (display->drm_fd, &fb_info[1 ]);
Signature · 6 lines
2.16.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain, v4.
Collecting CRC may result in a modeset and extra vblank waits. On some tests this will increase the runtime a lot, so it makes sense to keep it enabled, and only collect the most recent CRC when needed.
Changes since v1:
- Fix read_crc semantics. (Ville)
Changes since v2:
- Remove EAGAIN assert, can be reached from drain_crc. Changes since v3:
- Do not infinitely loop in igt_pipe_crc_drain().
---
Oops, thank $deity for CI.
lib/igt_debugfs.c | 77 ++++++++++++++++++++++++++++++++++++++++++----- lib/igt_debugfs.h | 2 ++ tests/kms_cursor_legacy.c | 21 +++---------- 3 files changed, 76 insertions(+), 24 deletions(-)
lib/igt_debugfs.c +69 -8
@@ -706,15 +706,12 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) bytes_read =read (pipe_crc->crc_fd, &buf,MAX_LINE_LEN );igt_reset_timeout (); -if (bytes_read <0 && errno ==EAGAIN ) -igt_assert (pipe_crc->flags &O_NONBLOCK ); -if (bytes_read <0 ) - bytes_read =0 ; - - buf[bytes_read] ='\0' ; + bytes_read = -errno; +else + buf[bytes_read] ='\0' ; -if (bytes_read && !pipe_crc_init_from_string (pipe_crc, out, buf)) +if (bytes_read >0 && !pipe_crc_init_from_string (pipe_crc, out, buf))return -EINVAL ;return bytes_read;
@@ -722,7 +719,9 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)static void read_one_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out) { -while (read_crc (pipe_crc, out) ==0 ) +int ret; + +while ((ret =read_crc (pipe_crc, out)) <=0 && ret != -EINVAL )usleep (1000 ); }
@@ -854,6 +853,68 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)crc_sanity_checks (out_crc); } +/** +* igt_pipe_crc_drain: +* @pipe_crc: pipe CRC object +* +* Discards all currently queued CRC values from @pipe_crc. This function does +* not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh +* CRC with igt_pipe_crc_get_single(). +*/ +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc) +{ +int ret; +igt_crc_t crc; + +fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags |O_NONBLOCK ); + +do { + ret =read_crc (pipe_crc, &crc); + }while (ret >0 || ret == -EINVAL ); + +fcntl (pipe_crc->crc_fd,F_SETFL , pipe_crc->flags); +} + +/** +* igt_pipe_crc_get_single: +* @pipe_crc: pipe CRC object +* @crc: buffer pointer for the captured CRC value +* +* Read a single @crc from @pipe_crc. This function does not block +* when nonblocking CRC is requested, and will return false if no CRC +* can be captured. +* +* If opened in blocking mode it will always block until a new CRC is read, like +* igt_pipe_crc_collect_crc(). +* +* Callers must start and stop the capturing themselves by calling +* igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting +* look at igt_pipe_crc_collect_crc(). +* +* If capturing has been going on for a while and a fresh crc is required, +* you will need to call igt_pipe_crc_drain() first to remove stale entries. +* +* Returns: +* Whether a crc is captured, only false in non-blocking mode. +*/ +bool +igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *crc) +{ +bool found = true; + +if (pipe_crc->flags &O_NONBLOCK ) { +int ret =read_crc (pipe_crc, crc); + + found = ret >0 ; + }else +read_one_crc (pipe_crc, crc); + +if (found) +crc_sanity_checks (crc); + +return found; +} +/* * Drop caches */
lib/igt_debugfs.h +2 -0
@@ -130,6 +130,8 @@ void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc); __attribute__((warn_unused_result))int igt_pipe_crc_get_crcs (igt_pipe_crc_t *pipe_crc,int n_crcs,igt_crc_t **out_crcs); +void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc); +bool igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_pipe_crc_collect_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_hpd_storm_set_threshold (int fd,unsigned int threshold);
tests/kms_cursor_legacy.c +5 -16
@@ -1276,7 +1276,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)enum pipe pipe =find_connected_pipe (display, false);igt_pipe_t *pipe_connected = &display->pipes[pipe];igt_plane_t *plane_primary =igt_pipe_get_plane_type (pipe_connected,DRM_PLANE_TYPE_PRIMARY ); -igt_crc_t crcs[2 ]; +igt_crc_t crcs[2 ], test_crc;if (atomic)igt_require (display->is_atomic);
@@ -1290,7 +1290,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_LEGACY ); - pipe_crc =igt_pipe_crc_new_nonblock (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); + pipe_crc =igt_pipe_crc_new (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO );set_cursor_on_pipe (display, pipe, &cursor_fb);igt_display_commit2 (display,COMMIT_UNIVERSAL );
@@ -1322,9 +1322,6 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)/* Disable cursor, and immediately queue a flip. Check if resulting crc is correct. */ for (int i =1 ; i >=0 ; i--) {igt_spin_t *spin; -igt_crc_t *received_crcs =NULL ; -int ncrcs; -static const int max_crcs =8 ; spin =igt_spin_batch_new (display->drm_fd,0 ,0 , fb_info[1 ].gem_handle);
@@ -1336,7 +1333,8 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_assert_eq (get_vblank (display->drm_fd, pipe,0 ), vblank_start); - ncrcs =igt_pipe_crc_get_crcs (pipe_crc, max_crcs, &received_crcs); +igt_pipe_crc_drain (pipe_crc); +igt_pipe_crc_get_single (pipe_crc, &test_crc);igt_spin_batch_free (display->drm_fd, spin);
@@ -1349,16 +1347,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)igt_plane_set_fb (plane_primary, &fb_info[0 ]);igt_display_commit2 (display,COMMIT_UNIVERSAL ); -/* -* We collect the crc nonblockingly, and should have at least 1 -* but not so many crcs that we overflow. Last CRC is the only -* one we care about here. Other CRCs may have been from before -* the cursor update and can contain garbage. -*/ -igt_assert (ncrcs >0 && ncrcs < max_crcs); - -igt_assert_crc_equal (&crcs[i], &received_crcs[ncrcs -1 ]); -free (received_crcs); +igt_assert_crc_equal (&crcs[i], &test_crc); }igt_remove_fb (display->drm_fd, &fb_info[1 ]);
Signature · 6 lines
2.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 6/12 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
@@ -411,7 +411,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 ; }
@@ -775,6 +775,7 @@ igt_maintest_plane_rotation (&data, subtest->plane); } } + data.flips =0 ; igt_subtest_f("sprite-rotation-90-pos-100-0") {igt_require (gen >=9 );
@@ -783,23 +784,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.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 06/12] tests/kms_rotation_crc: Fix bad-tiling testcase.
Quoted 5 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.
Is there a bug filed on this issue?
Quoted 66 lines
Also clear variables after subtests in main, so if the next subtest doesn't run we still clear the variables.
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@@ -411,7 +411,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@@ -775,6 +775,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@@ -783,23 +784,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
Re: [igt-dev] [PATCH i-g-t 06/12] tests/kms_rotation_crc: Fix bad-tiling testcase.
Op 08-02-18 om 13:08 schreef Mika Kahola:
Quoted 7 lines · Maarten Lankhorst
Quoted 5 lines
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.Is there a bug filed on this issue?
No, just nobody noticed because the test still outputs pass. :)
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 06/12] tests/kms_rotation_crc: Fix bad-tiling testcase.
In reply to Maarten LankhorstQuoted 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@@ -411,7 +411,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@@ -775,6 +775,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@@ -783,23 +784,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 7/12 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
@@ -356,7 +356,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;
@@ -456,16 +456,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)
@@ -772,7 +762,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 ;
@@ -782,7 +772,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 ;
@@ -791,7 +781,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 ;
@@ -799,7 +789,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 ;
@@ -834,7 +824,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.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 07/12] 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@@ -356,7 +356,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@@ -456,16 +456,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@@ -772,7 +762,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@@ -782,7 +772,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@@ -791,7 +781,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@@ -799,7 +789,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@@ -834,7 +824,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 8/12 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;
@@ -248,7 +247,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,
@@ -260,6 +259,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); }/*
@@ -296,18 +304,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)
@@ -366,9 +362,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 ;
@@ -427,7 +420,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);
@@ -676,63 +669,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 = {};
@@ -753,19 +720,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 );
@@ -814,16 +778,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.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 9/12 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
@@ -449,70 +449,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)
@@ -757,26 +693,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.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 09/12] tests/kms_rotation_crc: Remove primary-rotation-90-Y-tiled.
Quoted 11 lines
-----Original Message-----
From: igt-dev [mailto:[email protected]] On Behalf Of Maarten Lankhorst
Sent: Tuesday, February 6, 2018 12:14 PM
To: [email protected]
Subject: [igt-dev] [PATCH i-g-t 09/12] tests/kms_rotation_crc: Remove primary- rotation-90-Y-tiled.This is already tested by the rotation tests, which require Y-tiled for 90° and 270° rotations.
Quoted 114 lines
Signed-off-by Maarten Lankhorst <[email protected]>--- tests/kms_rotation_crc.c | 84 ------------------------------------------------ 1 file changed, 84 deletions(-)tests/kms_rotation_crc.c index renamed from tests/kms_rotation_crc.c +0
-0
7f50624a7425..74a611022d5a100644tests/kms_rotation_crc.c +0
-0@@ -449,70 +449,6 @@ static void test_plane_rotation(data_t *data, int
plane_type, booltest_bad_form
igt_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
-64- 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)@@ -757,26 +693,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++) {tests/kms_rotation_crc.c +0
-1igt_subtest_f("primary-%s-reflect-x-%s", tiling_test_str(reflect_x->tiling), --2.16.1
Quoted 4 lines
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 10/12 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 | 203 ++++++++++++++--------------------------------- 1 file changed, 60 insertions(+), 143 deletions(-)
tests/kms_rotation_crc.c +60 -143
@@ -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,61 +121,41 @@ 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 ); +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); +igt_remove_fb (data->gfx_fd, &data->fb_flip); +} -igt_output_set_pipe (output, pipe); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); +static void cleanup_crtc (data_t *data) +{ +igt_display_t *display = &data->display; -/* 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); + data->pipe_crc =NULL ; - w = mode->hdisplay; - h = mode->vdisplay; +remove_fbs (data); -igt_create_fb (data->gfx_fd, w, h, pixel_format, tiling, &data->fb_modeset); +igt_display_reset (display); +} -/* -* 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); +static void prepare_crtc (data_t *data,igt_output_t *output,enum pipe pipe, +igt_plane_t *plane) +{ +igt_display_t *display = &data->display; -if (commit <COMMIT_ATOMIC ) { -igt_plane_clear_prop_changed (primary,IGT_PLANE_ROTATION ); -igt_display_commit (display); +cleanup_crtc (data); -if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) -igt_plane_set_prop_changed (primary,IGT_PLANE_ROTATION ); - } +igt_output_set_pipe (output, pipe); +igt_plane_set_rotation (plane,IGT_ROTATION_0 ); -igt_plane_set_fb (plane,NULL ); +/* 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 ); -igt_display_commit2 (display, commit); -} - -static void remove_fbs (data_t *data) -{ -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); -igt_remove_fb (data->gfx_fd, &data->fb_flip); +igt_display_commit2 (display,COMMIT_ATOMIC ); }enum rectangle_type {
@@ -247,28 +226,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.
@@ -280,7 +255,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);
@@ -293,7 +268,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.
@@ -306,35 +281,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 };
@@ -359,18 +305,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;
@@ -383,7 +322,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 */
@@ -403,7 +342,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 ;
@@ -444,41 +383,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;
@@ -497,7 +423,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);
@@ -510,20 +436,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;
@@ -532,7 +458,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;
@@ -545,19 +471,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 ); }
@@ -714,9 +630,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.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 10/12] tests/kms_rotation_crc: Perform lazy cleanup and require atomic.
Quoted 11 lines
-----Original Message-----
From: igt-dev [mailto:[email protected]] On Behalf Of Maarten Lankhorst
Sent: Tuesday, February 6, 2018 12:14 PM
To: [email protected]
Subject: [igt-dev] [PATCH i-g-t 10/12] tests/kms_rotation_crc: Perform lazy cleanup and require atomic.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.
Quoted 398 lines
Signed-off-by Maarten Lankhorst <[email protected]>--- tests/kms_rotation_crc.c | 203 ++++++++++++++--------------------------------- 1 file changed, 60 insertions(+), 143 deletions(-)tests/kms_rotation_crc.c index renamed from tests/kms_rotation_crc.c +0
-0
74a611022d5a..9242ddee5feb100644tests/kms_rotation_crc.c +42
-67@@ -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,61 +121,41 @@ 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); +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); +igt_remove_fb (data->gfx_fd, &data->fb_flip); } -igt_output_set_pipe (output, pipe); -igt_plane_set_rotation (plane,IGT_ROTATION_0 ); +static void cleanup_crtc (data_t *data) +{ +igt_display_t *display = &data->display; -/* 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); + data->pipe_crc =NULL ; - w = mode->hdisplay; - h = mode->vdisplay; +remove_fbs (data); -igt_create_fb (data->gfx_fd, w, h, pixel_format, tiling, &data- >fb_modeset); +igt_display_reset (display); +} -/* -* 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); +static void prepare_crtc (data_t *data,igt_output_t *output,enum pipe pipe, +igt_plane_t *plane) +{ +igt_display_t *display = &data->display; -if (commit <COMMIT_ATOMIC ) { -igt_plane_clear_prop_changed (primary, IGT_PLANE_ROTATION); -igt_display_commit (display); +cleanup_crtc (data); -if (plane->type ==DRM_PLANE_TYPE_PRIMARY ) -igt_plane_set_prop_changed (primary, IGT_PLANE_ROTATION); - } +igt_output_set_pipe (output, pipe); +igt_plane_set_rotation (plane,IGT_ROTATION_0 ); -igt_plane_set_fb (plane,NULL ); +/* 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 ); -igt_display_commit2 (display, commit); -} - -static void remove_fbs (data_t *data) -{ -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); -igt_remove_fb (data->gfx_fd, &data->fb_flip); +igt_display_commit2 (display,COMMIT_ATOMIC ); }enum rectangle_type {@@ -247,28 +226,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);tests/kms_rotation_crc.c +1
-1/* * Create a reference CRC for a software-rotated fb. @@ -280,7 +255,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 );tests/kms_rotation_crc.c +1
-1igt_pipe_crc_collect_crc (data->pipe_crc, &data->ref_crc);@@ -293,7 +268,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 );tests/kms_rotation_crc.c +0
-28/* * Prepare the plane with an non-rotated fb let the hw rotate it. @@ -306,35 +281,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 }; @@ -359,18 +305,11 @@static void test_plane_rotation(data_t *data, int
plane_type, booltest_bad_formtests/kms_rotation_crc.c +0
-2enum 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)tests/kms_rotation_crc.c +0
-5- 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;@@ -383,7 +322,7 @@ static void test_plane_rotation(data_t *data, int
plane_type, booltest_bad_formtests/kms_rotation_crc.c +0
-0plane =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 */ @@ -403,7 +342,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->fb.height,data->fb.width);tests/kms_rotation_crc.c +1
-1- ret =igt_display_try_commit2 (display, commit); + ret = igt_display_try_commit2(display,
COMMIT_ATOMIC);tests/kms_rotation_crc.c +0
-0if (test_bad_format) {igt_assert_eq (ret, -EINVAL );continue ;@@ -444,41 +383,28 @@ static void test_plane_rotation(data_t *data, int
plane_type, booltest_bad_formtests/kms_rotation_crc.c +0
-1} valid_tests++; -cleanup_crtc (data, output, plane); } igt_require_f(valid_tests, "no valid crtc/connector combinationsfound\n"); }
static void test_plane_rotation_exhaust_fences(data_t *data,
tests/kms_rotation_crc.c +2
-6igt_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)tests/kms_rotation_crc.c +1
-9- 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;@@ -497,7 +423,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++) {tests/kms_rotation_crc.c +6
-6gem_handle =gem_create (fd, size);@@ -510,20 +436,20 @@ static voidtest_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" );tests/kms_rotation_crc.c +1
-1goto err_commit;@@ -532,7 +458,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);
tests/kms_rotation_crc.c +4
-13goto err_commit;@@ -545,19 +471,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 ); }@@ -714,9 +630,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);tests/kms_rotation_crc.c +0
-1valid_tests++;break ; --2.16.1
Quoted 4 lines
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 11/12 tests/kms_rotation_crc: Clean up exhaust-fences subtest
In reply to Maarten LankhorstThis seems to open code igt_calc_fb_size and igt_create_fb, just use both.
--- tests/kms_rotation_crc.c | 67 +++++++++--------------------------------------- 1 file changed, 12 insertions(+), 55 deletions(-)
tests/kms_rotation_crc.c +12 -55
@@ -388,31 +388,28 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form }static void test_plane_rotation_exhaust_fences (data_t *data, +enum pipe pipe,igt_output_t *output,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);int fd = data->gfx_fd;drmModeModeInfo *mode;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; +int i;igt_require (igt_plane_has_prop (plane,IGT_PLANE_ROTATION )); +prepare_crtc (data, output, pipe, plane); 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 ) - ; +igt_calc_fb_size (fd, w, h, format, tiling, &size, &stride);/* * Make sure there is atleast 90% of the available GTT space left
@@ -422,59 +419,20 @@ static void test_plane_rotation_exhaust_fences(data_t *data, total_aperture_size =gem_available_aperture_size (fd);igt_require (total_fbs_size < total_aperture_size *0.9 ); -igt_plane_set_fb (plane,NULL ); -igt_display_commit2 (display,COMMIT_ATOMIC ); -for (i =0 ; i <MAX_FENCES +1 ; i++) { - gem_handle =gem_create (fd, size); - ret =__gem_set_tiling (fd, gem_handle,I915_TILING_Y , stride); -if (ret) { -igt_warn ("failed to set tiling\n" ); - goto err_alloc; - } - - ret = (__kms_addfb (fd, gem_handle, w, h, stride, - format, tiling,NULL , -LOCAL_DRM_MODE_FB_MODIFIERS , - &fb[i].fb_id)); -if (ret) { -igt_warn ("failed to create framebuffer\n" ); - goto err_alloc; - } - - fb[i].width = w; - fb[i].height = h; - fb[i].gem_handle = gem_handle; +igt_create_fb (fd, w, h, format, tiling, &fb[i]);igt_plane_set_fb (plane, &fb[i]);igt_plane_set_rotation (plane,IGT_ROTATION_0 ); -igt_display_commit2 (display,COMMIT_ATOMIC ); -if (ret) { -igt_warn ("failed to commit unrotated fb\n" ); - goto err_commit; - }igt_plane_set_rotation (plane,IGT_ROTATION_90 );igt_plane_set_size (plane, h, w); -igt_display_commit2 (display,COMMIT_ATOMIC ); -if (ret) { -igt_warn ("failed to commit hardware rotated fb: %i\n" , ret); - goto err_commit; - } } -err_alloc: -if (ret) -gem_close (fd, gem_handle); - - i--; -err_commit: -for (; i >=0 ; i--) +for (i =0 ; i <MAX_FENCES +1 ; i++)igt_remove_fb (fd, &fb[i]); - -igt_assert_eq (ret,0 ); }static const char *plane_test_str (unsigned plane)
@@ -622,24 +580,23 @@ igt_main } } +/* +* exhaust-fences should be last test, if it fails we may OOM in +* the following subtests otherwise. +*/ igt_subtest_f("exhaust-fences") {enum pipe pipe;igt_output_t *output; -int valid_tests =0 ;igt_require (gen >=9 ); +igt_display_require_output (&data.display);for_each_pipe_with_valid_output (&data.display, pipe, output) {igt_plane_t *primary = &data.display.pipes[pipe].planes[0 ]; -prepare_crtc (&data, output, pipe, primary); -test_plane_rotation_exhaust_fences (&data, output, primary); - - valid_tests++; +test_plane_rotation_exhaust_fences (&data, pipe, output, primary);break ; } - -igt_require_f (valid_tests,"no valid crtc/connector combinations found\n" ); } igt_fixture {
Signature · 6 lines
2.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 11/12] tests/kms_rotation_crc: Clean up exhaust-fences subtest
Quoted 3 lines · Maarten Lankhorst
This seems to open code
igt_calc_fb_sizeandigt_create_fb, just use both.
Quoted 150 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_rotation_crc.c | 67 +++++++++-----------------------------
----------1 file changed, 12 insertions(+), 55 deletions(-)tests/kms_rotation_crc.c +0
-0@@ -388,31 +388,28 @@ static void test_plane_rotation(data_t *data,int
plane_type, booltest_bad_form
}
static void test_plane_rotation_exhaust_fences(data_t *data,tests/kms_rotation_crc.c +1
-0+ enum pipe pipe,igt_output_t *output,
igt_plane_t*plane) {
igt_display_t*display =&data->display;
uint64_ttiling =LOCAL_I915_FORMAT_MOD_Y_TILED;uint32_tformat =DRM_FORMAT_XRGB8888;tests/kms_rotation_crc.c +0
-1-int bpp =igt_drm_format_to_bpp (format);int fd =
data->gfx_fd;
drmModeModeInfo *mode;
structigt_fbfb[MAX_FENCES+1] = {};
unsigned int stride, size, w, h;tests/kms_rotation_crc.c +0
-1-uint32_t gem_handle;
uint64_ttotal_aperture_size,total_fbs_size;tests/kms_rotation_crc.c +1
-1-int i, ret; +int i;
igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));tests/kms_rotation_crc.c +1
-0+prepare_crtc (data, output, pipe, plane);mode =
igt_output_get_mode(output);
w =mode->hdisplay;
h =mode->vdisplay;tests/kms_rotation_crc.c +1
-4-for (stride =512 ; stride < (w * bpp /8 ); stride *=2 ) - ; -for (size =1024 *1024 ; size < stride * h; size *=2 ) - ; +igt_calc_fb_size (fd, w, h, format, tiling, &size, &stride);
/*
* Make sure there is atleast 90% of the available GTT space lefttests/kms_rotation_crc.c +0
-0@@ -422,59 +419,20 @@ static voidtest_plane_rotation_exhaust_fences (data_t *data, total_aperture_size = gem_available_aperture_size(fd); igt_require(total_fbs_size < total_aperture_size * 0.9);tests/kms_rotation_crc.c +0
-3-igt_plane_set_fb (plane,NULL ); -igt_display_commit2 (display,COMMIT_ATOMIC ); -for (i = 0; i <
MAX_FENCES+ 1; i++) {tests/kms_rotation_crc.c +0
-2- gem_handle =gem_create (fd, size); - ret = __gem_set_tiling(fd, gem_handle,
I915_TILING_Y, stride);tests/kms_rotation_crc.c +1
-17-if (ret) { -igt_warn ("failed to set tiling\n" ); - goto err_alloc; - } - - ret = (__kms_addfb (fd, gem_handle, w, h, stride, - format, tiling, NULL, - LOCAL_DRM_MODE_FB_MODIFIERS, - &fb[i].fb_id)); -if (ret) { -igt_warn ("failed to create framebuffer\n" ); - goto err_alloc; - } - - fb[i].width = w; - fb[i].height = h; - fb[i].gem_handle = gem_handle; +igt_create_fb (fd, w, h, format, tiling, &fb[i]);
igt_plane_set_fb(plane, &fb[i]);igt_plane_set_rotation(plane, IGT_ROTATION_0); -
igt_display_commit2(display, COMMIT_ATOMIC);tests/kms_rotation_crc.c +0
-4-if (ret) { -igt_warn ("failed to commit unrotated fb\n" ); - goto err_commit; - }
igt_plane_set_rotation(plane, IGT_ROTATION_90);igt_plane_set_size(plane, h, w);
-
igt_display_commit2(display, COMMIT_ATOMIC);tests/kms_rotation_crc.c +0
-2-if (ret) { - igt_warn("failed to commit hardware rotatedfb: %i\n", ret);
tests/kms_rotation_crc.c +0
-2- goto err_commit; - }}
tests/kms_rotation_crc.c +1
-7-err_alloc: -if (ret) -gem_close (fd, gem_handle); - - i--; -err_commit: -for (; i >=0 ; i--) +for (i =0 ; i <MAX_FENCES +1 ; i++)
igt_remove_fb(fd, &fb[i]);tests/kms_rotation_crc.c +0
-2- -igt_assert_eq (ret,0 );}
static const char *plane_test_str(unsigned plane)tests/kms_rotation_crc.c +0
-0@@ -622,24 +580,23 @@ igt_main } }tests/kms_rotation_crc.c +2
-0+/* +* exhaust-fences should be last test, if it fails we may OOM in
tests/kms_rotation_crc.c +2
-0+* the following subtests otherwise. +*/
igt_subtest_f("exhaust-fences"){
enum pipe pipe;
igt_output_t*output;tests/kms_rotation_crc.c +0
-1-int valid_tests =0 ;
igt_require(gen >= 9);tests/kms_rotation_crc.c +1
-0+igt_display_require_output (&data.display);
for_each_pipe_with_valid_output(&data.display, pipe, output){
igt_plane_t*primary = &data.display.pipes[pipe].planes[0];tests/kms_rotation_crc.c +0
-1-prepare_crtc (&data, output, pipe, primary);tests/kms_rotation_crc.c +0
-1- test_plane_rotation_exhaust_fences(&data,output, primary);
tests/kms_rotation_crc.c +1
-2- - valid_tests++; + test_plane_rotation_exhaust_fences(&data,pipe, output, primary);
break;
}tests/kms_rotation_crc.c +0
-2- - igt_require_f(valid_tests, "no valid crtc/connectorcombinations found\n");
}
igt_fixture{
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 12/12 tests/kms_rotation_crc: Test all pixel formats on all planes.
In reply to Maarten LankhorstThe test is modified to test all pixel formats on a plane, unless the pixel format is overridden by the subtest.
Attempting to test all pixel formats requires even more runtime and the overhead of toggling crc collection to capture a single CRC becomes significant, so keep the crc collection enabled during the entire test.
This reduces the runtime from ~24s to ~16s per subtest on SKL.
--- tests/kms_rotation_crc.c | 129 ++++++++++++++++++++++++++++------------------- 1 file changed, 77 insertions(+), 52 deletions(-)
tests/kms_rotation_crc.c +77 -52
@@ -153,9 +153,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,/* 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 );igt_display_commit2 (display,COMMIT_ATOMIC ); + data->pipe_crc =igt_pipe_crc_new (data->gfx_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); +igt_pipe_crc_start (data->pipe_crc); }enum rectangle_type {
@@ -167,7 +168,7 @@ enum rectangle_type { };static void prepare_fbs (data_t *data,igt_output_t *output, -igt_plane_t *plane,enum rectangle_type rect) +igt_plane_t *plane,enum rectangle_type rect,uint32_t format) {drmModeModeInfo *mode;igt_display_t *display = &data->display;
@@ -234,7 +235,8 @@ 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);igt_display_commit2 (display,COMMIT_ATOMIC ); -igt_pipe_crc_collect_crc (data->pipe_crc, &data->flip_crc); +igt_pipe_crc_drain (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &data->flip_crc);/* * Prepare the non-rotated flip fb.
@@ -257,7 +259,8 @@ static void prepare_fbs(data_t *data, igt_output_t *output,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->ref_crc); +igt_pipe_crc_drain (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &data->ref_crc);/* * Prepare the non-rotated reference fb.
@@ -298,21 +301,77 @@ static void wait_for_pageflip(int fd)igt_assert (drmHandleEvent (fd, &evctx) ==0 ); } +static void test_single_case (data_t *data,enum pipe pipe, +igt_output_t *output,igt_plane_t *plane, +enum rectangle_type rect, +uint32_t format,bool test_bad_format) +{ +igt_display_t *display = &data->display; +igt_crc_t crc_output; +int ret; + +igt_debug ("Testing case %i on pipe %s, format %s\n" , rect,kmstest_pipe_name (pipe),igt_format_str (format)); +prepare_fbs (data, output, plane, rect, format); + +igt_plane_set_rotation (plane, data->rotation); +if (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_ATOMIC ); +if (test_bad_format) { +igt_assert_eq (ret, -EINVAL ); +return ; + } + +/* Verify commit was ok. */ +igt_assert_eq (ret,0 ); + +/* Check CRC */ +igt_pipe_crc_drain (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &crc_output); +igt_assert_crc_equal (&data->ref_crc, &crc_output); + +/* +* If flips are requested flip to a different fb and +* check CRC against that one as well. +*/ +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); + +if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) { +igt_display_commit_atomic (display,DRM_MODE_PAGE_FLIP_EVENT |DRM_MODE_ATOMIC_NONBLOCK ,NULL ); + }else { + ret =drmModePageFlip (data->gfx_fd, + output->config.crtc->crtc_id, + data->fb_flip.fb_id, +DRM_MODE_PAGE_FLIP_EVENT , +NULL ); +igt_assert_eq (ret,0 ); + } +wait_for_pageflip (data->gfx_fd); +igt_pipe_crc_drain (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &crc_output); +igt_assert_crc_equal (&data->flip_crc, + &crc_output); + } +} +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;enum pipe pipe; -int valid_tests =0 ; -igt_crc_t crc_output; -int ret;if (plane_type ==DRM_PLANE_TYPE_CURSOR )igt_require (display->has_cursor_plane); +igt_display_require_output (display); +for_each_pipe_with_valid_output (display, pipe, output) {igt_plane_t *plane; -int i; +int i, j;if (IS_CHERRYVIEW (data->devid) && pipe !=PIPE_B )continue ;
@@ -335,56 +394,22 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form i != rectangle && intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9) continue; -igt_debug ("Testing case %i on pipe %s\n" , i,kmstest_pipe_name (pipe)); -prepare_fbs (data, output, plane, i); - -igt_plane_set_rotation (plane, data->rotation); -if (data->rotation & (IGT_ROTATION_90 |IGT_ROTATION_270 )) -igt_plane_set_size (plane, data->fb.height, data->fb.width); +if (!data->override_fmt) { +for (j =0 ; j < plane->drm_plane->count_formats; j++) { +uint32_t format = plane->drm_plane->formats[j]; - ret =igt_display_try_commit2 (display,COMMIT_ATOMIC ); -if (test_bad_format) { -igt_assert_eq (ret, -EINVAL ); -continue ; - } +if (!igt_fb_supported_format (format)) +continue ; -/* Verify commit was ok. */ -igt_assert_eq (ret,0 ); - -/* Check CRC */ -igt_pipe_crc_collect_crc (data->pipe_crc, &crc_output); -igt_assert_crc_equal (&data->ref_crc, &crc_output); - -/* -* If flips are requested flip to a different fb and -* check CRC against that one as well. -*/ -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); - -if (plane_type !=DRM_PLANE_TYPE_PRIMARY ) { -igt_display_commit_atomic (display,DRM_MODE_PAGE_FLIP_EVENT |DRM_MODE_ATOMIC_NONBLOCK ,NULL ); - }else { - ret =drmModePageFlip (data->gfx_fd, - output->config.crtc->crtc_id, - data->fb_flip.fb_id, -DRM_MODE_PAGE_FLIP_EVENT , -NULL ); -igt_assert_eq (ret,0 ); +test_single_case (data, pipe, output, plane, i, + format, test_bad_format); } -wait_for_pageflip (data->gfx_fd); -igt_pipe_crc_collect_crc (data->pipe_crc, - &crc_output); -igt_assert_crc_equal (&data->flip_crc, - &crc_output); + }else { +test_single_case (data, pipe, output, plane, i, + data->override_fmt, test_bad_format); } } - - valid_tests++; } -igt_require_f (valid_tests,"no valid crtc/connector combinations found\n" ); } static void test_plane_rotation_exhaust_fences(data_t *data,
Signature · 6 lines
2.16.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 12/12] tests/kms_rotation_crc: Test all pixel formats on all planes.
Commenting on the last patch in this series to cover all the patches related to kms_rotation_crc:
Tested kms_rotation_crc to be working correctly on GLK system. Please include my tested-by tag if required.
Regards
Vidya
Quoted 245 lines
-----Original Message-----
From: igt-dev [mailto:[email protected]] On Behalf Of Maarten Lankhorst
Sent: Tuesday, February 6, 2018 3:44 PM
To: [email protected]
Subject: [igt-dev] [PATCH i-g-t 12/12] tests/kms_rotation_crc: Test all pixel formats on all planes.The test is modified to test all pixel formats on a plane, unless the pixel format is overridden by the subtest.
Attempting to test all pixel formats requires even more runtime and the overhead of toggling crc collection to capture a single CRC becomes significant, so keep the crc collection enabled during the entire test.
This reduces the runtime from ~24s to ~16s per subtest on SKL.
Signed-off-by Maarten Lankhorst <[email protected]>--- tests/kms_rotation_crc.c | 129 ++++++++++++++++++++++++++++------------ ------- 1 file changed, 77 insertions(+), 52 deletions(-)tests/kms_rotation_crc.c index renamed from tests/kms_rotation_crc.c +0
-0
18c3e13431db..0cd5c6e52b57100644tests/kms_rotation_crc.c +2
-1@@ -153,9 +153,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,/* 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);igt_display_commit2 (display,COMMIT_ATOMIC ); + data->pipe_crc =igt_pipe_crc_new (data->gfx_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); +igt_pipe_crc_start (data->pipe_crc);}
enum
rectangle_type{tests/kms_rotation_crc.c +1
-1@@ -167,7 +168,7 @@ enum rectangle_type { };static void prepare_fbs (data_t *data,igt_output_t *output, -igt_plane_t *plane,enum rectangle_type rect) +igt_plane_t *plane,enum rectangle_type rect,uint32_t format) {drmModeModeInfo *mode; igt_display_t *display = &data->display; @@ -234,7 +235,8 @@static void prepare_fbs(data_t *data,
igt_output_t*output,tests/kms_rotation_crc.c +4
-2if (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); +igt_pipe_crc_drain (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &data->flip_crc);/* * Prepare the non-rotated flip fb. @@ -257,7 +259,8 @@ static void prepare_fbs(data_t *data, igt_output_t *output,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->ref_crc); +igt_pipe_crc_drain (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &data->ref_crc);/* tests/kms_rotation_crc.c +59
-4* Prepare the non-rotated reference fb. @@ -298,21 +301,77 @@ static void wait_for_pageflip(int fd)igt_assert (drmHandleEvent (fd, &evctx) ==0 ); } +static void test_single_case (data_t *data,enum pipe pipe, +igt_output_t *output,igt_plane_t *plane, +enum rectangle_type rect, +uint32_t format,bool test_bad_format) { +igt_display_t *display = &data->display; +igt_crc_t crc_output; +int ret; + +igt_debug ("Testing case %i on pipe %s, format %s\n" , rect,kmstest_pipe_name (pipe),igt_format_str (format)); +prepare_fbs (data, output, plane, rect, format); + +igt_plane_set_rotation (plane, data->rotation); +if (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_ATOMIC ); +if (test_bad_format) { +igt_assert_eq (ret, -EINVAL ); +return ; + } + +/* Verify commit was ok. */ +igt_assert_eq (ret,0 ); + +/* Check CRC */ +igt_pipe_crc_drain (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &crc_output); +igt_assert_crc_equal (&data->ref_crc, &crc_output); + +/* +* If flips are requested flip to a different fb and +* check CRC against that one as well. +*/ +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); + +if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) { +igt_display_commit_atomic (display,DRM_MODE_PAGE_FLIP_EVENT |DRM_MODE_ATOMIC_NONBLOCK ,NULL ); + }else { + ret =drmModePageFlip (data->gfx_fd, + output->config.crtc->crtc_id, + data->fb_flip.fb_id, +DRM_MODE_PAGE_FLIP_EVENT , +NULL ); +igt_assert_eq (ret,0 ); + } +wait_for_pageflip (data->gfx_fd); +igt_pipe_crc_drain (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &crc_output); +igt_assert_crc_equal (&data->flip_crc, + &crc_output); + } +} +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;enum pipe pipe; -int valid_tests =0 ; -igt_crc_t crc_output; -int ret;if (plane_type ==DRM_PLANE_TYPE_CURSOR )igt_require (display->has_cursor_plane); +igt_display_require_output (display); +for_each_pipe_with_valid_output (display, pipe, output) {igt_plane_t *plane; -int i; +int i, j;if (IS_CHERRYVIEW (data->devid) && pipe !=PIPE_B )continue ;@@ -335,56 +394,22 @@ static void test_plane_rotation(data_t *data, int
plane_type, booltest_bad_form
i != rectangle &&
intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9)tests/kms_rotation_crc.c +0
-1continue ; - igt_debug("Testing case %i on pipe %s\n", i,
kmstest_pipe_name(pipe));tests/kms_rotation_crc.c +0
-4-prepare_fbs (data, output, plane, i); - -igt_plane_set_rotation (plane, data->rotation); - if (data->rotation & (IGT_ROTATION_90 |
IGT_ROTATION_270))tests/kms_rotation_crc.c +0
-1- igt_plane_set_size(plane, data->fb.height,
data->fb.width);tests/kms_rotation_crc.c +2
-0+ if (!data->override_fmt) { + for (j = 0; j < plane->drm_plane-Quoted 1 line
count_formats; j++) {tests/kms_rotation_crc.c +1
-0+ uint32_t format = plane-Quoted 1 line
drm_plane->formats[j];
tests/kms_rotation_crc.c +0
-1- ret = igt_display_try_commit2(display,
COMMIT_ATOMIC);tests/kms_rotation_crc.c +1
-4-if (test_bad_format) { -igt_assert_eq (ret, -EINVAL ); -continue ; - } + if(!igt_fb_supported_format(format))
tests/kms_rotation_crc.c +1
-5+continue ; -/* Verify commit was ok. */ -igt_assert_eq (ret,0 ); - -/* Check CRC */ - igt_pipe_crc_collect_crc(data->pipe_crc,
&crc_output);tests/kms_rotation_crc.c +0
-9-igt_assert_crc_equal (&data->ref_crc, &crc_output); - -/* -* If flips are requested flip to a different fb and -* check CRC against that one as well. -*/ -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)tests/kms_rotation_crc.c +0
-1- igt_plane_set_size(plane, data-Quoted 1 line
fb.height,
data->fb.width);tests/kms_rotation_crc.c +0
-2- - if (plane_type !=
DRM_PLANE_TYPE_PRIMARY) {tests/kms_rotation_crc.c +0
-1- igt_display_commit_atomic(display,
DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_ATOMIC_NONBLOCK, NULL);tests/kms_rotation_crc.c +0
-2- }else { - ret = drmModePageFlip(data-Quoted 1 line
gfx_fd,tests/kms_rotation_crc.c +0
-1- output->config.crtc-Quoted 1 line
crtc_id,tests/kms_rotation_crc.c +0
-2- data->fb_flip.fb_id, -
DRM_MODE_PAGE_FLIP_EVENT,tests/kms_rotation_crc.c +1
-2- NULL); -igt_assert_eq (ret,0 ); + test_single_case(data, pipe, output,plane, i,
tests/kms_rotation_crc.c +1
-0+ format,
test_bad_format);tests/kms_rotation_crc.c +3
-5} -wait_for_pageflip (data->gfx_fd); -igt_pipe_crc_collect_crc (data->pipe_crc, - &crc_output); -igt_assert_crc_equal (&data->flip_crc, - &crc_output); + }else { + test_single_case(data, pipe, output, plane, i, + data->override_fmt,
test_bad_format);tests/kms_rotation_crc.c +0
-3} } - - valid_tests++; } - igt_require_f(valid_tests, "no valid crtc/connector combinationsfound\n");
}
Quoted 8 lines
static void test_plane_rotation_exhaust_fences(data_t *data,
--
2.16.1_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 12/12] tests/kms_rotation_crc: Test all pixel formats on all planes.
In reply to Maarten LankhorstQuoted 10 lines · Maarten Lankhorst
The test is modified to test all pixel formats on a plane, unless the pixel format is overridden by the subtest.
Attempting to test all pixel formats requires even more runtime and the overhead of toggling crc collection to capture a single CRC becomes significant, so keep the crc collection enabled during the entire test.
This reduces the runtime from ~24s to ~16s per subtest on SKL.
Quoted 248 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_rotation_crc.c | 129 ++++++++++++++++++++++++++++---------
----------1 file changed, 77 insertions(+), 52 deletions(-)tests/kms_rotation_crc.c +0
-0@@ -153,9 +153,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
/* create thepipe_crcobject for this pipe */igt_pipe_crc_free(data->pipe_crc);tests/kms_rotation_crc.c +0
-1- data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
igt_display_commit2(display, COMMIT_ATOMIC);tests/kms_rotation_crc.c +1
-0+ data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);tests/kms_rotation_crc.c +1
-0+igt_pipe_crc_start (data->pipe_crc);}
enumrectangle_type{tests/kms_rotation_crc.c +0
-0@@ -167,7 +168,7 @@ enum rectangle_type { };
static void prepare_fbs(data_t *data,igt_output_t*output,tests/kms_rotation_crc.c +0
-1- igt_plane_t *plane, enum rectangle_typerect)
tests/kms_rotation_crc.c +1
-0+ igt_plane_t *plane, enum rectangle_typerect,
uint32_tformat)
{
drmModeModeInfo *mode;
igt_display_t*display =&data->display;tests/kms_rotation_crc.c +0
-0@@ -234,7 +235,8 @@ 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);
igt_display_commit2(display, COMMIT_ATOMIC);tests/kms_rotation_crc.c +2
-1-igt_pipe_crc_collect_crc (data->pipe_crc, &data->flip_crc); +igt_pipe_crc_drain (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &data->flip_crc);
/*
* Prepare the non-rotated flip fb.tests/kms_rotation_crc.c +0
-0@@ -257,7 +259,8 @@ 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);
igt_display_commit2(display, COMMIT_ATOMIC);tests/kms_rotation_crc.c +2
-1-igt_pipe_crc_collect_crc (data->pipe_crc, &data->ref_crc); +igt_pipe_crc_drain (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &data->ref_crc);
/*
* Prepare the non-rotated reference fb.tests/kms_rotation_crc.c +0
-0@@ -298,21 +301,77 @@ static void wait_for_pageflip(int fd) igt_assert(drmHandleEvent(fd, &evctx) == 0); }tests/kms_rotation_crc.c +2
-0+static void test_single_case (data_t *data,enum pipe pipe, + igt_output_t *output, igt_plane_t*plane,
tests/kms_rotation_crc.c +8
-0+ enum rectangle_type rect, + uint32_t format, bool test_bad_format) +{ +igt_display_t *display = &data->display; +igt_crc_t crc_output; +int ret; + + igt_debug("Testing case %i on pipe %s, format %s\n", rect,
kmstest_pipe_name(pipe),igt_format_str(format));tests/kms_rotation_crc.c +5
-0+prepare_fbs (data, output, plane, rect, format); + +igt_plane_set_rotation (plane, data->rotation); +if (data->rotation & (IGT_ROTATION_90 |IGT_ROTATION_270 )) + igt_plane_set_size(plane, data->fb.height, data-Quoted 1 line
fb.width);
tests/kms_rotation_crc.c +22
-0+ + ret =igt_display_try_commit2 (display,COMMIT_ATOMIC ); +if (test_bad_format) { +igt_assert_eq (ret, -EINVAL ); +return ; + } + +/* Verify commit was ok. */ +igt_assert_eq (ret,0 ); + +/* Check CRC */ +igt_pipe_crc_drain (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &crc_output); +igt_assert_crc_equal (&data->ref_crc, &crc_output); + +/* +* If flips are requested flip to a different fb and +* check CRC against that one as well. +*/ + if (data->fb_flip.fb_id) { + igt_plane_set_fb(plane, &data->fb_flip); + if (data->rotation == IGT_ROTATION_90 || data-Quoted 1 line
rotation ==
IGT_ROTATION_270)tests/kms_rotation_crc.c +1
-0+ igt_plane_set_size(plane, data->fb.height,
data->fb.width);tests/kms_rotation_crc.c +3
-0+ +if (plane->type !=DRM_PLANE_TYPE_PRIMARY ) { + igt_display_commit_atomic(display,
DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_ATOMIC_NONBLOCK, NULL);tests/kms_rotation_crc.c +3
-0+ }else { + ret = drmModePageFlip(data->gfx_fd, + output->config.crtc-Quoted 1 line
crtc_id,tests/kms_rotation_crc.c +8
-0+ data->fb_flip.fb_id, +DRM_MODE_PAGE_FLIP_EVENT , + NULL); +igt_assert_eq (ret,0 ); + } +wait_for_pageflip (data->gfx_fd); +igt_pipe_crc_drain (data->pipe_crc); + igt_pipe_crc_get_single(data->pipe_crc,
&crc_output);tests/kms_rotation_crc.c +5
-0+igt_assert_crc_equal (&data->flip_crc, + &crc_output); + } +} +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;
enum pipe pipe;tests/kms_rotation_crc.c +0
-3-int valid_tests =0 ; -igt_crc_t crc_output; -int ret;
if (plane_type==DRM_PLANE_TYPE_CURSOR)igt_require(display->has_cursor_plane);tests/kms_rotation_crc.c +2
-0+igt_display_require_output (display); +
for_each_pipe_with_valid_output(display, pipe, output){igt_plane_t*plane;tests/kms_rotation_crc.c +1
-1-int i; +int i, j;
if (IS_CHERRYVIEW(data->devid)&& pipe !=PIPE_B) continue;tests/kms_rotation_crc.c +0
-0@@ -335,56 +394,22 @@ static void test_plane_rotation(data_t *data,int
plane_type, booltest_bad_form
i != rectangle &&
intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9)
continue;tests/kms_rotation_crc.c +0
-1- igt_debug("Testing case %i on pipe %s\n", i,
kmstest_pipe_name(pipe));tests/kms_rotation_crc.c +0
-3-prepare_fbs (data, output, plane, i); - - igt_plane_set_rotation(plane, data-Quoted 1 line
rotation);
tests/kms_rotation_crc.c +0
-1- if (data->rotation & (IGT_ROTATION_90 |
IGT_ROTATION_270))tests/kms_rotation_crc.c +0
-1- igt_plane_set_size(plane, data-Quoted 1 line
fb.height,
data->fb.width);tests/kms_rotation_crc.c +2
-0+ if (!data->override_fmt) { + for (j = 0; j < plane->drm_plane-Quoted 1 line
count_formats; j++) {tests/kms_rotation_crc.c +1
-0+ uint32_t format = plane-Quoted 1 line
drm_plane->formats[j];
tests/kms_rotation_crc.c +0
-1- ret = igt_display_try_commit2(display,
COMMIT_ATOMIC);tests/kms_rotation_crc.c +1
-4-if (test_bad_format) { -igt_assert_eq (ret, -EINVAL ); -continue ; - } + if(!igt_fb_supported_format(format))
tests/kms_rotation_crc.c +1
-0+continue ;tests/kms_rotation_crc.c +0
-5-/* Verify commit was ok. */ -igt_assert_eq (ret,0 ); - -/* Check CRC */ - igt_pipe_crc_collect_crc(data->pipe_crc,
&crc_output);tests/kms_rotation_crc.c +0
-1- igt_assert_crc_equal(&data->ref_crc,
&crc_output);tests/kms_rotation_crc.c +0
-3- -/* -* If flips are requested flip to a different fb and
tests/kms_rotation_crc.c +0
-4-* check CRC against that one as well. -*/ -if (data->fb_flip.fb_id) { - igt_plane_set_fb(plane, &data-Quoted 1 line
fb_flip);tests/kms_rotation_crc.c +0
-1- if (data->rotation ==
IGT_ROTATION_90||data->rotation==IGT_ROTATION_270)tests/kms_rotation_crc.c +0
-1- igt_plane_set_size(plane,
data->fb.height,data->fb.width);tests/kms_rotation_crc.c +0
-2- - if (plane_type !=
DRM_PLANE_TYPE_PRIMARY) {tests/kms_rotation_crc.c +0
-1- igt_display_commit_atomic(display,
DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_ATOMIC_NONBLOCK, NULL);tests/kms_rotation_crc.c +0
-2- }else { - ret = drmModePageFlip(data-Quoted 1 line
gfx_fd,tests/kms_rotation_crc.c +0
-1- output-Quoted 1 line
config.crtc->crtc_id,tests/kms_rotation_crc.c +0
-1- data-Quoted 1 line
fb_flip.fb_id,
tests/kms_rotation_crc.c +0
-1-DRM_MODE_PAG
E_FLIP_EVENT,tests/kms_rotation_crc.c +1
-2- NULL); -igt_assert_eq (ret,0 ); + test_single_case(data, pipe,output, plane, i,
tests/kms_rotation_crc.c +1
-0+ format,
test_bad_format);
}tests/kms_rotation_crc.c +0
-2-wait_for_pageflip (data->gfx_fd); - igt_pipe_crc_collect_crc(data-Quoted 1 line
pipe_crc,tests/kms_rotation_crc.c +0
-1- &crc_output);
tests/kms_rotation_crc.c +0
-1- igt_assert_crc_equal(&data-Quoted 1 line
flip_crc,tests/kms_rotation_crc.c +2
-1- &crc_output); + }else { + test_single_case(data, pipe, output,plane, i,
tests/kms_rotation_crc.c +1
-0+ data->override_fmt,
test_bad_format);
}
}tests/kms_rotation_crc.c +0
-2- - valid_tests++;}
tests/kms_rotation_crc.c +0
-1- igt_require_f(valid_tests, "no valid crtc/connectorcombinations found\n");
}
static void test_plane_rotation_exhaust_fences(data_t *data,
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 12/12] tests/kms_rotation_crc: Test all pixel formats on all planes.
Op 12-02-18 om 14:09 schreef Mika Kahola:
Quoted 12 lines · Maarten Lankhorst
Quoted 10 lines
The test is modified to test all pixel formats on a plane, unless the pixel format is overridden by the subtest.
Attempting to test all pixel formats requires even more runtime and the overhead of toggling crc collection to capture a single CRC becomes significant, so keep the crc collection enabled during the entire test.
This reduces the runtime from ~24s to ~16s per subtest on SKL.
Reviewed-by Mika Kahola <[email protected]>
Pushed with Vidya's t-b, thanks for reviewing. :)
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ Fi.CI.BAT: warning for series starting with [i-g-t,01/12] lib/igt_fb: Make igt_remove_fb more robust
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,01/12] lib/igt_fb: Make igt_remove_fb more robust
URL : https://patchwork.freedesktop.org/series/37726/
State : warning
== Summary ==
IGT patchset tested on top of latest successful build 3fd9b578b3138b04178b4ce8ee4a60e74a16ec91 tests/perf_pmu: Use short batches from hotplug test
with latest DRM-Tip kernel build CI_DRM_37275883e1383ed6 drm-tip: 2018y-02m-06d-09h-04m-49s 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
Test gem_ringfill:
Subgroup basic-default:
pass -> SKIP (fi-bsw-n3050)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
pass -> FAIL (fi-ivb-3520m) k.org#198519 +2k.org#198519 https://bugzilla.kernel.org/show_bug.cgi?id=198519
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:427s 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:381s fi-bsw-n3050 total:288 pass:241 dwarn:0 dfail:0 fail:0 skip:47 time:490s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:286s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:493s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:490s 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:459s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:566s fi-cnl-y3 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:580s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:421s fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:284s 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:390s fi-hsw-4770r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:406s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:418s fi-ivb-3520m total:288 pass:256 dwarn:0 dfail:0 fail:3 skip:29 time:412s 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:505s 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:595s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:434s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:505s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:532s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:493s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:485s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:414s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:429s fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:514s fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:401s
Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:472s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_868/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,01/12] lib/igt_fb: Make igt_remove_fb more robust (rev2)
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,01/12] lib/igt_fb: Make igt_remove_fb more robust (rev2)
URL : https://patchwork.freedesktop.org/series/37726/
State : success
== Summary ==
IGT patchset tested on top of latest successful build 2baf7ece5b6d2faccedc56527ec91623f41a85e4 lib: Move __gem_context_create to common ioctl wrapper library.
with latest DRM-Tip kernel build CI_DRM_3733ec960e17a65b drm-tip: 2018y-02m-07d-11h-43m-42s 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
Test gem_sync:
Subgroup basic-all:
skip -> PASS (fi-blb-e6850)
Subgroup basic-each:
skip -> PASS (fi-blb-e6850)
Subgroup basic-many-each:
skip -> PASS (fi-blb-e6850)
Subgroup basic-store-all:
skip -> PASS (fi-blb-e6850)
Subgroup basic-store-each:
skip -> PASS (fi-blb-e6850)
Test gem_tiled_blits:
Subgroup basic:
skip -> PASS (fi-blb-e6850)
Test gem_tiled_fence_blits:
Subgroup basic:
skip -> PASS (fi-blb-e6850)
Test gem_wait:
Subgroup basic-busy-all:
skip -> PASS (fi-blb-e6850)
Subgroup basic-wait-all:
skip -> PASS (fi-blb-e6850)
Subgroup basic-await-all:
skip -> PASS (fi-blb-e6850)
Test kms_busy:
Subgroup basic-flip-a:
skip -> PASS (fi-blb-e6850)
Subgroup basic-flip-b:
skip -> PASS (fi-blb-e6850)
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-legacy:
skip -> PASS (fi-blb-e6850)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
dmesg-fail -> PASS (fi-cnl-y3) fdo#104951fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:419s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:428s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:374s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:488s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:288s 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:492s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:472s 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:570s fi-cnl-y3 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:583s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:419s fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:288s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:511s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:393s 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:463s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:420s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:461s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:498s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:462s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:499s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:601s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:433s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:511s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:532s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:487s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:481s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:422s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:436s fi-snb-2520m total:245 pass:211 dwarn:0 dfail:0 fail:0 skip:33 fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:403s
Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:471s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_881/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 3 lines · Maarten Lankhorst
This will make it easier for tests to unconditionally call
igt_remove_fb, without first checking whether the FB is allocated.
Quoted 24 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
lib/igt_fb.c | 4 ++++1 file changed, 4 insertions(+)lib/igt_fb.c +4
-0@@ -1623,9 +1623,13 @@ void igt_put_cairo_ctx(int fd, struct igt_fb*fb, cairo_t *cr) */ void igt_remove_fb(int fd, struct igt_fb *fb) { +if (!fb || !fb->fb_id) +return ; + cairo_surface_destroy(fb->cairo_surface); do_or_die(drmModeRmFB(fd, fb->fb_id)); gem_close(fd, fb->gem_handle); + fb->fb_id =0 ; }
/**
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.IGT: failure for series starting with [i-g-t,01/12] lib/igt_fb: Make igt_remove_fb more robust (rev2)
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,01/12] lib/igt_fb: Make igt_remove_fb more robust (rev2)
URL : https://patchwork.freedesktop.org/series/37726/
State : failure
== Summary ==
Test kms_rotation_crc:
Subgroup primary-rotation-270:
pass -> FAIL (shard-apl)
Subgroup cursor-rotation-180:
pass -> FAIL (shard-snb)
pass -> FAIL (shard-hsw) fdo#102614
pass -> FAIL (shard-apl)
Subgroup sprite-rotation-270:
pass -> FAIL (shard-apl) fdo#103356 +2
Subgroup primary-rotation-90:
pass -> FAIL (shard-apl) fdo#103925 +2
Subgroup sprite-rotation-180:
pass -> FAIL (shard-snb)
pass -> FAIL (shard-hsw)
pass -> FAIL (shard-apl)
Subgroup primary-rotation-180:
pass -> FAIL (shard-snb)
pass -> FAIL (shard-hsw)
Subgroup bad-pixel-format:
pass -> FAIL (shard-apl)
Test kms_flip:
Subgroup 2x-plain-flip-ts-check-interruptible:
fail -> PASS (shard-hsw) fdo#100368 +4
Subgroup flip-vs-modeset-vs-hang-interruptible:
pass -> SKIP (shard-apl)
Test kms_cursor_legacy:
Subgroup flip-vs-cursor-busy-crc-atomic:
pass -> FAIL (shard-snb)
pass -> FAIL (shard-hsw)
pass -> FAIL (shard-apl)
Subgroup flip-vs-cursor-busy-crc-legacy:
pass -> FAIL (shard-snb)
pass -> FAIL (shard-hsw)
pass -> FAIL (shard-apl)
Test kms_sysfs_edid_timing:
pass -> WARN (shard-apl) fdo#100047
Test kms_draw_crc:
Subgroup draw-method-rgb565-blt-xtiled:
skip -> PASS (shard-snb)
Subgroup draw-method-xrgb2101010-mmap-cpu-xtiled:
pass -> SKIP (shard-apl)
Subgroup fill-fb:
pass -> SKIP (shard-apl)
Test kms_setmode:
Subgroup basic:
fail -> PASS (shard-hsw) fdo#99912
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-primscrn-pri-shrfb-draw-blt:
pass -> SKIP (shard-apl) fdo#101623
Test kms_cursor_crc:
Subgroup cursor-256x256-onscreen:
pass -> SKIP (shard-apl)
Subgroup cursor-128x128-suspend:
skip -> PASS (shard-snb) fdo#103880
Test kms_chv_cursor_fail:
Subgroup pipe-a-256x256-right-edge:
pass -> SKIP (shard-apl)
Test kms_color:
Subgroup pipe-c-ctm-green-to-red:
pass -> SKIP (shard-apl)
Subgroup pipe-c-ctm-max:
pass -> SKIP (shard-apl)
Test kms_plane_scaling:
Subgroup pipe-c-plane-scaling:
pass -> SKIP (shard-apl)
Test kms_pipe_crc_basic:
Subgroup nonblocking-crc-pipe-a:
pass -> SKIP (shard-apl)
Test kms_universal_plane:
Subgroup disable-primary-vs-flip-pipe-c:
pass -> SKIP (shard-apl)
Test drm_read:
Subgroup short-buffer-block:
pass -> SKIP (shard-apl)
Test kms_plane:
Subgroup plane-position-hole-dpms-pipe-a-planes:
fail -> PASS (shard-apl) fdo#103166fdo#102614
fdo#103356
fdo#103925
fdo#100368
fdo#100047
fdo#99912
fdo#101623
fdo#103880
fdo#103166
shard-apl total:3422 pass:1747 dwarn:1 dfail:0 fail:34 skip:1638 time:13359s shard-hsw total:3425 pass:1752 dwarn:1 dfail:0 fail:15 skip:1656 time:14333s shard-snb total:3425 pass:1343 dwarn:1 dfail:0 fail:16 skip:2065 time:7590s
Blacklisted hosts:
shard-kbl total:3425 pass:1892 dwarn:1 dfail:0 fail:33 skip:1499 time:11127s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_881/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI✓ Fi.CI.BAT: success for lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain, v3.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain, v3.
URL : https://patchwork.freedesktop.org/series/37910/
State : success
== Summary ==
IGT patchset tested on top of latest successful build3af87d45da24015b7a6124b59b2c4b854381cab6 tools/intel_aubdump: Simulate "enhanced execlist" submission for gen11+
with latest DRM-Tip kernel build CI_DRM_3747a326a34b0b8d drm-tip: 2018y-02m-08d-17h-29m-20s UTC integration manifest
No testlist changes.
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
pass -> DMESG-WARN (fi-cnl-y3) fdo#103191
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS (fi-snb-2520m) fdo#103713fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
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:424s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:380s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:489s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:287s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:484s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:488s 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:458s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:564s fi-cnl-y3 total:288 pass:261 dwarn:1 dfail:0 fail:0 skip:26 time:581s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:417s fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:287s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:516s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:393s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:415s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:470s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:416s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:461s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:502s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:457s 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:599s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:440s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:510s 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:488s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:494s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:414s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:435s fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:523s 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:258 dwarn:0 dfail:0 fail:0 skip:30 time:470s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_889/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.IGT: failure for lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain, v3.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain, v3.
URL : https://patchwork.freedesktop.org/series/37910/
State : failure
== Summary ==
Test kms_cursor_legacy:
Subgroup cursor-vs-flip-legacy:
fail -> PASS (shard-apl) fdo#103355
Subgroup flip-vs-cursor-busy-crc-legacy:
pass -> INCOMPLETE (shard-snb)
pass -> INCOMPLETE (shard-hsw)
pass -> INCOMPLETE (shard-apl)
Subgroup flip-vs-cursor-busy-crc-atomic:
pass -> INCOMPLETE (shard-snb)
pass -> INCOMPLETE (shard-hsw)
pass -> INCOMPLETE (shard-apl)
Test gem_exec_suspend:
Subgroup basic-s4:
skip -> FAIL (shard-snb) fdo#103375
Test kms_plane_lowres:
Subgroup pipe-c-tiling-yf:
pass -> FAIL (shard-apl) fdo#103166
Test drv_suspend:
Subgroup debugfs-reader:
skip -> PASS (shard-snb) fdo#102365 +1
Test perf_pmu:
Subgroup rc6:
pass -> SKIP (shard-hsw)
Test gem_eio:
Subgroup in-flight:
fail -> PASS (shard-hsw) fdo#104676
Test kms_flip:
Subgroup 2x-plain-flip-fb-recreate-interruptible:
fail -> PASS (shard-hsw)
Test perf:
Subgroup buffer-fill:
pass -> FAIL (shard-apl) fdo#103755
Test kms_sysfs_edid_timing:
warn -> PASS (shard-apl) fdo#100047fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
fdo#103755 https://bugs.freedesktop.org/show_bug.cgi?id=103755
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
shard-apl total:3304 pass:1696 dwarn:1 dfail:0 fail:22 skip:1582 time:13303s shard-hsw total:3398 pass:1730 dwarn:1 dfail:0 fail:10 skip:1654 time:13772s shard-snb total:3398 pass:1331 dwarn:1 dfail:0 fail:10 skip:2054 time:7244s
Blacklisted hosts:
shard-kbl total:3398 pass:1879 dwarn:1 dfail:0 fail:21 skip:1495 time:10670s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_889/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,01/12] lib/igt_fb: Make igt_remove_fb more robust (rev3)
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,01/12] lib/igt_fb: Make igt_remove_fb more robust (rev3)
URL : https://patchwork.freedesktop.org/series/37726/
State : success
== Summary ==
IGT patchset tested on top of latest successful build3af87d45da24015b7a6124b59b2c4b854381cab6 tools/intel_aubdump: Simulate "enhanced execlist" submission for gen11+
with latest DRM-Tip kernel build CI_DRM_3749da3b1ec8a65a drm-tip: 2018y-02m-09d-15h-38m-18s 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
Test debugfs_test:
Subgroup read_all_entries:
pass -> INCOMPLETE (fi-snb-2520m) fdo#103713
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
pass -> FAIL (fi-gdg-551) fdo#102575fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:420s 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:378s 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:289s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:488s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:484s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:486s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:463s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:569s fi-cnl-y3 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:583s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:419s fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:285s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:511s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:390s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:414s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:460s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:422s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:458s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:501s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:498s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:601s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:430s 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:528s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:488s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:476s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:414s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:434s fi-snb-2520m total:3 pass:2 dwarn:0 dfail:0 fail:0 skip:0 fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:397s
Blacklisted hosts:
fi-glk-dsi total:164 pass:87 dwarn:0 dfail:1 fail:1 skip:74
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_891/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,01/12] lib/igt_fb: Make igt_remove_fb more robust (rev3)
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,01/12] lib/igt_fb: Make igt_remove_fb more robust (rev3)
URL : https://patchwork.freedesktop.org/series/37726/
State : failure
== Summary ==
Test pm_rc6_residency:
Subgroup rc6-accuracy:
skip -> PASS (shard-snb)
Test kms_vblank:
Subgroup pipe-a-ts-continuation-dpms-suspend:
skip -> PASS (shard-snb)
Subgroup pipe-a-ts-continuation-idle-hang:
skip -> PASS (shard-snb)
Subgroup pipe-b-accuracy-idle:
pass -> FAIL (shard-hsw)
Test kms_plane_lowres:
Subgroup pipe-b-tiling-none:
pass -> FAIL (shard-apl) fdo#103166
Test kms_draw_crc:
Subgroup draw-method-xrgb2101010-render-xtiled:
skip -> PASS (shard-snb)
Test kms_sysfs_edid_timing:
pass -> WARN (shard-apl) fdo#100047
Test kms_flip:
Subgroup 2x-flip-vs-expired-vblank:
fail -> PASS (shard-hsw) fdo#102887
Subgroup plain-flip-ts-check:
pass -> FAIL (shard-hsw) fdo#100368
Test drv_suspend:
Subgroup fence-restore-tiled2untiled-hibernate:
fail -> DMESG-FAIL (shard-snb) fdo#103375 +1
Subgroup debugfs-reader:
skip -> PASS (shard-snb) fdo#102365 +1
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-primscrn-cur-indfb-draw-mmap-wc:
skip -> PASS (shard-snb) fdo#103167
Test perf_pmu:
Subgroup semaphore-wait-idle-bcs0:
fail -> PASS (shard-apl) fdo#105011
Test kms_cursor_legacy:
Subgroup cursor-vs-flip-legacy:
fail -> PASS (shard-apl) fdo#103355
Test gem_eio:
Subgroup in-flight:
fail -> PASS (shard-hsw) fdo#104676fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#105011 https://bugs.freedesktop.org/show_bug.cgi?id=105011
fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
shard-apl total:3354 pass:1745 dwarn:1 dfail:0 fail:21 skip:1585 time:13792s shard-hsw total:3427 pass:1757 dwarn:1 dfail:1 fail:11 skip:1656 time:14412s shard-snb total:3427 pass:1350 dwarn:1 dfail:1 fail:9 skip:2066 time:7582s
Blacklisted hosts:
shard-kbl total:3427 pass:1904 dwarn:1 dfail:2 fail:20 skip:1500 time:10981s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_891/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev