diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2015-07-08 16:00:45 -0300 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2015-08-05 17:21:48 -0300 |
commit | ffd7321c701411c6ffb4aa5b983aacb92289908c (patch) | |
tree | fc12c896df545f80805fe58f27219ba6655a4cd1 | |
parent | cd33b47a47251eadd21815bfd2ecc8529c7bcf6d (diff) |
kms_frontbuffer_tracking: use the dirty ioctl after MMAP_WC calls
We can't add this to igt_draw since igt_draw doesn't care whether it's
writing on a frontbuffer or not.
PS: the ENOSYS is for Kernels without the patch implementing the
IOCTL.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
-rw-r--r-- | tests/kms_frontbuffer_tracking.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index e9be045a..99d28110 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -843,6 +843,21 @@ static struct rect pat4_get_rect(struct fb_region *fb, int r) return rect; } +static void fb_dirty_ioctl(struct fb_region *fb, struct rect *rect) +{ + int rc; + drmModeClip clip = { + .x1 = rect->x, + .x2 = rect->x + rect->w, + .y1 = rect->y, + .y2 = rect->y + rect->h, + }; + + rc = drmModeDirtyFB(drm.fd, fb->fb->fb_id, &clip, 1); + + igt_assert(rc == 0 || rc == -ENOSYS); +} + static void draw_rect(struct draw_pattern_info *pattern, struct fb_region *fb, enum igt_draw_method method, int r) { @@ -851,6 +866,9 @@ static void draw_rect(struct draw_pattern_info *pattern, struct fb_region *fb, igt_draw_rect_fb(drm.fd, drm.bufmgr, NULL, fb->fb, method, fb->x + rect.x, fb->y + rect.y, rect.w, rect.h, rect.color); + + if (method == IGT_DRAW_MMAP_WC) + fb_dirty_ioctl(fb, &rect); } static void draw_rect_igt_fb(struct draw_pattern_info *pattern, |