Merge tag 'drm-intel-next-2018-09-21' of git://anongit.freedesktop.org/drm/drm-intel...
[muen/linux.git] / drivers / gpu / drm / i915 / i915_gem_execbuffer.c
index 22b4cb77557631e726afbfeaefdeea735c48e3dc..09187286d34627df882e4ede753db7e40da41934 100644 (file)
@@ -693,9 +693,14 @@ static int eb_reserve(struct i915_execbuffer *eb)
                        eb_unreserve_vma(vma, &eb->flags[i]);
 
                        if (flags & EXEC_OBJECT_PINNED)
+                               /* Pinned must have their slot */
                                list_add(&vma->exec_link, &eb->unbound);
                        else if (flags & __EXEC_OBJECT_NEEDS_MAP)
+                               /* Map require the lowest 256MiB (aperture) */
                                list_add_tail(&vma->exec_link, &eb->unbound);
+                       else if (!(flags & EXEC_OBJECT_SUPPORTS_48B_ADDRESS))
+                               /* Prioritise 4GiB region for restricted bo */
+                               list_add(&vma->exec_link, &last);
                        else
                                list_add_tail(&vma->exec_link, &last);
                }
@@ -743,7 +748,7 @@ static int eb_select_context(struct i915_execbuffer *eb)
        }
 
        eb->context_flags = 0;
-       if (ctx->flags & CONTEXT_NO_ZEROMAP)
+       if (test_bit(UCONTEXT_NO_ZEROMAP, &ctx->user_flags))
                eb->context_flags |= __EXEC_OBJECT_NEEDS_BIAS;
 
        return 0;