[v2 2/2] tests/kms_async_flips: Reuse the already mmapped buffer
Vandita Kulkarni
vandita.kulkarni at intel.com
Mon Mar 25 09:37:30 UTC 2024
In crc test case where we are trying to update the fb
dont mmap it agian. On some platforms it was found that
updating a newly mmapped buffer takes longer time.
Signed-off-by: Vandita Kulkarni <vandita.kulkarni at intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
tests/kms_async_flips.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 2895168f7..4658ca4c0 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -221,12 +221,19 @@ static void test_init_fbs(data_t *data)
prev_modifier = data->modifier;
if (data->bufs[0].fb_id) {
- for (i = 0; i < NUM_FBS; i++)
+ for (i = 0; i < NUM_FBS; i++) {
+ if (is_intel_device(data->drm_fd))
+ igt_fb_unmap_buffer(&data->bufs[i], data->bufs[i].driver_priv);
igt_remove_fb(data->drm_fd, &data->bufs[i]);
+ }
}
- for (i = 0; i < NUM_FBS; i++)
+ for (i = 0; i < NUM_FBS; i++) {
make_fb(data, &data->bufs[i], width, height, i);
+ if (is_intel_device(data->drm_fd))
+ data->bufs[i].driver_priv = igt_fb_map_buffer(data->drm_fd,
+ &data->bufs[i]);
+ }
}
igt_plane_set_fb(data->plane, &data->bufs[0]);
@@ -730,8 +737,11 @@ igt_main
}
igt_fixture {
- for (i = 0; i < NUM_FBS; i++)
+ for (i = 0; i < NUM_FBS; i++) {
+ if (is_intel_device(data.drm_fd))
+ igt_fb_unmap_buffer(&data.bufs[i], data.bufs[i].driver_priv);
igt_remove_fb(data.drm_fd, &data.bufs[i]);
+ }
if (is_intel_device(data.drm_fd))
buf_ops_destroy(data.bops);
--
2.43.2
More information about the igt-dev
mailing list