diff mbox

[v2,1/4] drm/i915: Also check view->type for a normal GGTT view

Message ID 20180220134208.24988-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Feb. 20, 2018, 1:42 p.m. UTC
We cannot simply use !view as shorthand for all normal GGTT views as a
few callers will always populate a i915_ggtt_view struct and set the
type to NORMAL instead. So check for (!view || view->type == NORMAL)
inside i915_gem_object_ggtt_pin().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Chris Wilson Feb. 20, 2018, 8:39 p.m. UTC | #1
Quoting Patchwork (2018-02-20 20:36:53)
> == Series Details ==
> 
> Series: series starting with [v2,1/4] drm/i915: Also check view->type for a normal GGTT view
> URL   : https://patchwork.freedesktop.org/series/38593/
> State : failure
> 
> == Summary ==
> 
> Test kms_flip:
>         Subgroup modeset-vs-vblank-race:
>                 pass       -> FAIL       (shard-hsw) fdo#103060
>         Subgroup plain-flip-ts-check-interruptible:
>                 fail       -> PASS       (shard-hsw) fdo#100368
> Test perf:
>         Subgroup buffer-fill:
>                 pass       -> FAIL       (shard-apl) fdo#103755
> Test kms_chv_cursor_fail:
>         Subgroup pipe-a-64x64-right-edge:
>                 pass       -> FAIL       (shard-apl)
> Test gem_eio:
>         Subgroup in-flight-external:
>                 pass       -> FAIL       (shard-hsw) fdo#104676
> Test kms_frontbuffer_tracking:
>         Subgroup fbc-rgb565-draw-pwrite:
>                 fail       -> PASS       (shard-apl) fdo#101623
> Test pm_rps:
>         Subgroup reset:
>                 fail       -> PASS       (shard-apl)

This time, it looks better. Thanks for the review, pushed to let CI
kasan attack it.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 631a2db2bb6e..1854a69bc354 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4282,7 +4282,8 @@  i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj,
 
 	lockdep_assert_held(&obj->base.dev->struct_mutex);
 
-	if (!view && flags & PIN_MAPPABLE) {
+	if ((!view || view->type == I915_GGTT_VIEW_NORMAL) &&
+	    flags & PIN_MAPPABLE) {
 		/* If the required space is larger than the available
 		 * aperture, we will not able to find a slot for the
 		 * object and unbinding the object now will be in