tests/kms_cursor_legacy: Handle cursor movements as slow patch for display 9+
PATCH v2 1/4 tests/kms_cursor_legacy: Handle cursor movements as slow patch for display 9+
i915 is dropping frontbuffer rendering support for display 9+ so this evasion attempts will never happen as DRM_IOCTL_MODE_CURSOR will be converted to atomic commits that will be executed during vblanks.
v2:
- Not using data filed by fixture to generate subtest list (Petri)
--- tests/kms_cursor_legacy.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
tests/kms_cursor_legacy.c +14 -10
@@ -303,8 +303,13 @@ enum flip_test { flip_test_last = flip_test_atomic_transitions_varying_size }; -static bool cursor_slowpath (enum flip_test mode) +static bool cursor_slowpath (igt_display_t *display,enum flip_test mode) { +/* Intel display 9 and newer will handle cursor movement as fastsets */ +if (is_i915_device (display->drm_fd) && +intel_display_ver (intel_get_drm_devid (display->drm_fd)) >=9 ) +return true; +/* cursor moving doesn't take slowpath, everything else does. */ if (mode == flip_test_legacy || mode == flip_test_atomic)return false;
@@ -600,7 +605,7 @@ static void basic_flip_cursor(igt_display_t *display,if (miss) {/* compare nothing, already failed */ } -else if (!cursor_slowpath (mode)) +else if (!cursor_slowpath (display, mode)) miss = delta !=0 ;else miss = delta !=0 && delta !=1 ;
@@ -753,7 +758,7 @@ static void flip_vs_cursor(igt_display_t *display, enum flip_test mode, int nloodo_ioctl (display->drm_fd,DRM_IOCTL_MODE_CURSOR , &arg[nloops &1 ]);/* Nor should it have delayed the following cursor update */ -if (!cursor_slowpath (mode)) +if (!cursor_slowpath (display, mode))igt_assert_eq (kmstest_get_vblank (display->drm_fd, pipe,0 ), vblank_start);else igt_assert_lte (kmstest_get_vblank (display->drm_fd, pipe,0 ), vblank_start +1 );
@@ -1119,7 +1124,7 @@ static void cursor_vs_flip(igt_display_t *display, enum flip_test mode, int nloo vblank_last = vbl.sequence; } -if (!cursor_slowpath (mode)) +if (!cursor_slowpath (display, mode))igt_assert_lte (vbl.sequence, vblank_start +5 * vrefresh /8 ); shared[0 ] =1 ;
@@ -1558,12 +1563,11 @@ igt_main igt_subtest_f("%sflip-before-cursor-%s", prefix, modes[i])basic_flip_cursor (&display, i,FLIP_BEFORE_CURSOR ,0 ); -if (!cursor_slowpath (i)) { - igt_subtest_f("%sbusy-flip-before-cursor-%s", prefix, modes[i]) { -igt_require_gem (display.drm_fd); -basic_flip_cursor (&display, i,FLIP_BEFORE_CURSOR , -BASIC_BUSY ); - } + igt_subtest_f("%sbusy-flip-before-cursor-%s", prefix, modes[i]) { +igt_require (!cursor_slowpath (&display, i)); +igt_require_gem (display.drm_fd); +basic_flip_cursor (&display, i,FLIP_BEFORE_CURSOR , +BASIC_BUSY ); } }
Signature · 1 line
2.32.0
PATCH v2 2/4 tests/kms_psr2_su: Set the damaged clip in page flips
Without this i915 will not know what was updated in the screen and update the whole plane causing mismatch between the read SU blocks and the expected value when PSR2 selective fetch is enabled.
--- tests/kms_psr2_su.c | 6 ++++++ 1 file changed, 6 insertions(+)
tests/kms_psr2_su.c +6 -0
@@ -149,11 +149,17 @@ static bool update_screen_and_test(data_t *data)switch (data->op) {case PAGE_FLIP : { +struct drm_mode_rect clip;igt_plane_t *primary; + clip.x1 = clip.y1 =0 ; + clip.x2 = clip.y2 =SQUARE_SIZE ; + primary =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_PRIMARY ); +igt_plane_replace_prop_blob (primary,IGT_PLANE_FB_DAMAGE_CLIPS , + &clip,sizeof (clip));igt_plane_set_fb (primary, &data->fb[data->screen_changes &1 ]);igt_display_commit2 (&data->display,COMMIT_ATOMIC );break ;
Signature · 1 line
2.32.0
Re: [igt-dev] [PATCH i-g-t v2 2/4] tests/kms_psr2_su: Set the damaged clip in page flips
Looks good to me.
Quoted 33 lines · José Roberto de Souza
Without this i915 will not know what was updated in the screen and update the whole plane causing mismatch between the read SU blocks and the expected value when PSR2 selective fetch is enabled.
Cc Gwan-gyeong Mun <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- tests/kms_psr2_su.c | 6 ++++++ 1 file changed, 6 insertions(+)tests/kms_psr2_su.c +6
-0@@ -149,11 +149,17 @@ static bool update_screen_and_test(data_t *data)switch (data->op) {case PAGE_FLIP : { +struct drm_mode_rect clip;igt_plane_t *primary; + clip.x1 = clip.y1 =0 ; + clip.x2 = clip.y2 =SQUARE_SIZE ; + primary =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_PRIMARY ); +igt_plane_replace_prop_blob (primary,IGT_PLANE_FB_DAMAGE_CLIPS , + &clip,sizeof (clip));igt_plane_set_fb (primary, &data->fb[data->screen_changes &1 ]);igt_display_commit2 (&data->display,COMMIT_ATOMIC );break ;
PATCH v2 3/4 test/kms_frontbuffer_tracking: Fix multidraw test
In reply to José Roberto de SouzaMultidraw tests was not notifying driver about the area it uses blitter to pain the primary background color between drawing methods. Without this notification driver will not update pipe and the CRC will not update causing the tests fail due a CRC mismatch.
All the other callers of fill_fb_region() are safe, doing a page flip or a atomic commit afterwards.
--- tests/kms_frontbuffer_tracking.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
tests/kms_frontbuffer_tracking.c +12 -0
@@ -1123,6 +1123,17 @@ static void fill_fb_region(struct fb_region *region, enum color ecolor) color); } +static void _fb_dirty_ioctl (struct fb_region *region) +{ +struct rect rect; + + rect.x = region->x; + rect.y = region->y; + rect.w = region->w; + rect.h = region->h; +fb_dirty_ioctl (region, &rect); +} +static void unset_all_crtcs (void ) {igt_display_reset (&drm.display);
@@ -2122,6 +2133,7 @@ static void multidraw_subtest(const struct test_mode *t) }fill_fb_region (target,COLOR_PRIM_BG ); +_fb_dirty_ioctl (target);update_wanted_crc (t, &blue_crcs[t->format].crc);do_assertions (ASSERT_NO_ACTION_CHANGE );
Signature · 1 line
2.32.0
Re: [igt-dev] [PATCH i-g-t v2 3/4] test/kms_frontbuffer_tracking: Fix multidraw test
Looks good to me.
Quoted 45 lines · José Roberto de Souza
Multidraw tests was not notifying driver about the area it uses blitter to pain the primary background color between drawing methods. Without this notification driver will not update pipe and the CRC will not update causing the tests fail due a CRC mismatch.
All the other callers of
fill_fb_region()are safe, doing a page flip or a atomic commit afterwards.Cc Gwan-gyeong Mun <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- tests/kms_frontbuffer_tracking.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)tests/kms_frontbuffer_tracking.c +12
-0@@ -1123,6 +1123,17 @@ static void fill_fb_region(struct fb_region *region, enum color ecolor) color); } +static void _fb_dirty_ioctl (struct fb_region *region) +{ +struct rect rect; + + rect.x = region->x; + rect.y = region->y; + rect.w = region->w; + rect.h = region->h; +fb_dirty_ioctl (region, &rect); +} +static void unset_all_crtcs (void ) {igt_display_reset (&drm.display);@@ -2122,6 +2133,7 @@ static void multidraw_subtest(const struct test_mode *t) }fill_fb_region (target,COLOR_PRIM_BG ); +_fb_dirty_ioctl (target);update_wanted_crc (t, &blue_crcs[t->format].crc);do_assertions (ASSERT_NO_ACTION_CHANGE );
PATCH v2 4/4 tests/kms_psr: Add drmModeDirtyFB() calls to handle frontbuffer rendering tests
In reply to José Roberto de SouzaWithout this i915 don't know that frontbuffer was updated. This will be a problem when frontbuffer rendering is dropped from i915 in modern platforms.
--- tests/kms_psr.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
tests/kms_psr.c +18 -0
@@ -259,6 +259,20 @@ static bool drrs_disabled(data_t *data)return !strstr (buf,"DRRS Enabled : Yes\n" ); } +static void fb_dirty_fb_ioctl (data_t *data,struct igt_fb *fb) +{ +int ret; +drmModeClip clip = { + .x1 =0 , + .x2 = fb->width, + .y1 =0 , + .y2 = fb->height + }; + + ret =drmModeDirtyFB (data->drm_fd, fb->fb_id, &clip,1 ); +igt_assert (ret ==0 || ret == -ENOSYS ); +} +static void run_test (data_t *data) {uint32_t handle = data->fb_white.gem_handle;
@@ -299,6 +313,7 @@ static void run_test(data_t *data) I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);memset (ptr,0xcc , data->mod_size);munmap (ptr, data->mod_size); +fb_dirty_fb_ioctl (data, &data->fb_white); expected ="BLACK or TRANSPARENT mark on top of plane in test" ;break ;case MMAP_CPU :
@@ -309,14 +324,17 @@ static void run_test(data_t *data)memset (ptr,0 , data->mod_size);munmap (ptr, data->mod_size);gem_sw_finish (data->drm_fd, handle); +fb_dirty_fb_ioctl (data, &data->fb_white); expected ="BLACK or TRANSPARENT mark on top of plane in test" ;break ;case BLT :fill_blt (data, &data->fb_white,0 ); +fb_dirty_fb_ioctl (data, &data->fb_white); expected ="BLACK or TRANSPARENT mark on top of plane in test" ;break ;case RENDER :fill_render (data, &data->fb_white,0 ); +fb_dirty_fb_ioctl (data, &data->fb_white); expected ="BLACK or TRANSPARENT mark on top of plane in test" ;break ;case PLANE_MOVE :
Signature · 1 line
2.32.0
Re: [igt-dev] [PATCH i-g-t v2 4/4] tests/kms_psr: Add drmModeDirtyFB() calls to handle frontbuffer rendering tests
Looks good to me. but in kms_frontbuffer_tracking.c, there is a function with the same role called fb_dirty_ioctl(), so it seems good to use it as a common igt function in the future.
Quoted 62 lines · José Roberto de Souza
Without this i915 don't know that frontbuffer was updated. This will be a problem when frontbuffer rendering is dropped from i915 in modern platforms.
Cc Gwan-gyeong Mun <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- tests/kms_psr.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)tests/kms_psr.c +18
-0@@ -259,6 +259,20 @@ static bool drrs_disabled(data_t *data)return !strstr (buf,"DRRS Enabled : Yes\n" ); } +static void fb_dirty_fb_ioctl (data_t *data,struct igt_fb *fb) +{ +int ret; +drmModeClip clip = { + .x1 =0 , + .x2 = fb->width, + .y1 =0 , + .y2 = fb->height + }; + + ret =drmModeDirtyFB (data->drm_fd, fb->fb_id, &clip,1 ); +igt_assert (ret ==0 || ret == -ENOSYS ); +} +static void run_test (data_t *data) {uint32_t handle = data->fb_white.gem_handle;@@ -299,6 +313,7 @@ static void run_test(data_t *data) I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);memset (ptr,0xcc , data->mod_size);munmap (ptr, data->mod_size); +fb_dirty_fb_ioctl (data, &data->fb_white); expected ="BLACK or TRANSPARENT mark on top of plane in test" ;break ;case MMAP_CPU :@@ -309,14 +324,17 @@ static void run_test(data_t *data)memset (ptr,0 , data->mod_size);munmap (ptr, data->mod_size);gem_sw_finish (data->drm_fd, handle); +fb_dirty_fb_ioctl (data, &data->fb_white); expected ="BLACK or TRANSPARENT mark on top of plane in test" ;break ;case BLT :fill_blt (data, &data->fb_white,0 ); +fb_dirty_fb_ioctl (data, &data->fb_white); expected ="BLACK or TRANSPARENT mark on top of plane in test" ;break ;case RENDER :fill_render (data, &data->fb_white,0 ); +fb_dirty_fb_ioctl (data, &data->fb_white); expected ="BLACK or TRANSPARENT mark on top of plane in test" ;break ;case PLANE_MOVE :