Patchwork [igt,2/2] igt/kms_frontbuffer_tracking: Access via GGTT is not guaranteed to be tracked

login
register
mail settings
Submitter Chris Wilson
Date Dec. 7, 2017, 9:41 a.m.
Message ID <20171207094126.19160-2-chris@chris-wilson.co.uk>
Download mbox | patch
Permalink /patch/10097911/
State New
Headers show

Comments

Chris Wilson - Dec. 7, 2017, 9:41 a.m.
As the system may use a partial vma for a GGTT mmap, access via the GGTT
mmap is not guaranteed to be tracked by FBC's fence. The rule expressed has
been that any access to the frontbuffer should be followed by a fb-dirty
ioctl, so always apply and expect the driver to ellide no-ops.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/kms_frontbuffer_tracking.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
Chris Wilson - Dec. 14, 2017, 8:09 p.m.
Quoting Chris Wilson (2017-12-07 09:41:26)
> As the system may use a partial vma for a GGTT mmap, access via the GGTT
> mmap is not guaranteed to be tracked by FBC's fence. The rule expressed has
> been that any access to the frontbuffer should be followed by a fb-dirty
> ioctl, so always apply and expect the driver to ellide no-ops.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Ping?

> ---
>  tests/kms_frontbuffer_tracking.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> index a068c8afb..1fcca87c9 100644
> --- a/tests/kms_frontbuffer_tracking.c
> +++ b/tests/kms_frontbuffer_tracking.c
> @@ -1127,8 +1127,7 @@ static void draw_rect(struct draw_pattern_info *pattern, struct fb_region *fb,
>                          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);
> +       fb_dirty_ioctl(fb, &rect);
>  }
>  
>  static void draw_rect_igt_fb(struct draw_pattern_info *pattern,
> @@ -2132,16 +2131,10 @@ static void multidraw_subtest(const struct test_mode *t)
>  
>                                 draw_rect(pattern, target, used_method, r);
>  
> -                               if (used_method == IGT_DRAW_MMAP_WC)
> +                               if (used_method == IGT_DRAW_MMAP_WC ||
> +                                   used_method == IGT_DRAW_MMAP_GTT)
>                                         wc_used = true;
>  
> -                               if (used_method == IGT_DRAW_MMAP_GTT &&
> -                                   wc_used) {
> -                                       struct rect rect =
> -                                               pattern->get_rect(target, r);
> -                                       fb_dirty_ioctl(target, &rect);
> -                               }
> -
>                                 update_wanted_crc(t,
>                                                   &pattern->crcs[t->format][r]);
>  
> -- 
> 2.15.1
>
Arkadiusz Hiler - Dec. 19, 2017, 1:20 p.m.
On Thu, Dec 14, 2017 at 08:09:21PM +0000, Chris Wilson wrote:
> Quoting Chris Wilson (2017-12-07 09:41:26)
> > As the system may use a partial vma for a GGTT mmap, access via the GGTT
> > mmap is not guaranteed to be tracked by FBC's fence. The rule expressed has
> > been that any access to the frontbuffer should be followed by a fb-dirty
> > ioctl, so always apply and expect the driver to ellide no-ops.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> Ping?

Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

on both. Pushed.

Patch

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index a068c8afb..1fcca87c9 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1127,8 +1127,7 @@  static void draw_rect(struct draw_pattern_info *pattern, struct fb_region *fb,
 			 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);
+	fb_dirty_ioctl(fb, &rect);
 }
 
 static void draw_rect_igt_fb(struct draw_pattern_info *pattern,
@@ -2132,16 +2131,10 @@  static void multidraw_subtest(const struct test_mode *t)
 
 				draw_rect(pattern, target, used_method, r);
 
-				if (used_method == IGT_DRAW_MMAP_WC)
+				if (used_method == IGT_DRAW_MMAP_WC ||
+				    used_method == IGT_DRAW_MMAP_GTT)
 					wc_used = true;
 
-				if (used_method == IGT_DRAW_MMAP_GTT &&
-				    wc_used) {
-					struct rect rect =
-						pattern->get_rect(target, r);
-					fb_dirty_ioctl(target, &rect);
-				}
-
 				update_wanted_crc(t,
 						  &pattern->crcs[t->format][r]);