mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 10:26:12 +00:00
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>
This commit is contained in:
parent
cd33b47a47
commit
ffd7321c70
@ -843,6 +843,21 @@ static struct rect pat4_get_rect(struct fb_region *fb, int r)
|
|||||||
return rect;
|
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,
|
static void draw_rect(struct draw_pattern_info *pattern, struct fb_region *fb,
|
||||||
enum igt_draw_method method, int r)
|
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,
|
igt_draw_rect_fb(drm.fd, drm.bufmgr, NULL, fb->fb, method,
|
||||||
fb->x + rect.x, fb->y + rect.y,
|
fb->x + rect.x, fb->y + rect.y,
|
||||||
rect.w, rect.h, rect.color);
|
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,
|
static void draw_rect_igt_fb(struct draw_pattern_info *pattern,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user