summaryrefslogtreecommitdiff
path: root/tests/kms_frontbuffer_tracking.c
diff options
context:
space:
mode:
authorVanshidhar Konda <vanshidhar.r.konda@intel.com>2019-12-18 11:39:10 -0800
committerImre Deak <imre.deak@intel.com>2020-02-13 10:20:45 +0200
commitca614f87196204fbd19b69e691360d8049eccfe0 (patch)
tree051767c3df20903a55ba44c2039ef2c6d1ee61fd /tests/kms_frontbuffer_tracking.c
parent0e249d67f661e07d6d23dfcca9120a2d5b93bdbe (diff)
lib/igt_draw: Refactor get_tiling calls
Simplify the number of places from which gem_get_tiling method is called and call it only if the device has support in hardware for tiling. For consistency also fix up the gem_mmap__cpu() prot argument in draw_rect_mmap_cpu(). Atm, gem_mmap__cpu() ignores this, however the implementation of it may change, so make sure we pass the correct protection flags. v2: - Use gem_available_fences() to check for HW detiling. v3: (Matt) - Fix docbook for draw_rect_render() - Remove unused swizzle params from the blt/render draw funcs. - Describe the gem_mmap__cpu() prot argument fix in the commit log. Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Vanshidhar Konda <vanshidhar.r.konda@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Diffstat (limited to 'tests/kms_frontbuffer_tracking.c')
-rw-r--r--tests/kms_frontbuffer_tracking.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 2c765c34..9c2c3a5d 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -291,6 +291,7 @@ struct {
int height;
uint32_t color;
int bpp;
+ uint32_t tiling;
} busy_thread = {
.stop = true,
};
@@ -1126,9 +1127,9 @@ static void *busy_thread_func(void *data)
while (!busy_thread.stop)
igt_draw_rect(drm.fd, drm.bufmgr, NULL, busy_thread.handle,
busy_thread.size, busy_thread.stride,
- IGT_DRAW_BLT, 0, 0, busy_thread.width,
- busy_thread.height, busy_thread.color,
- busy_thread.bpp);
+ busy_thread.tiling, IGT_DRAW_BLT, 0, 0,
+ busy_thread.width, busy_thread.height,
+ busy_thread.color, busy_thread.bpp);
pthread_exit(0);
}
@@ -1146,6 +1147,7 @@ static void start_busy_thread(struct igt_fb *fb)
busy_thread.height = fb->height;
busy_thread.color = pick_color(fb, COLOR_PRIM_BG);
busy_thread.bpp = igt_drm_format_to_bpp(fb->drm_format);
+ busy_thread.tiling = igt_fb_mod_to_tiling(fb->modifier);
rc = pthread_create(&busy_thread.thread, NULL, busy_thread_func, NULL);
igt_assert_eq(rc, 0);