drm/i915: Allow user to set cache at BO creation
[sfrench/cifs-2.6.git] / drivers / gpu / drm / i915 / gem / i915_gem_object.c
index 46a19b099ec88c3c26ce20680abc61589dd653f2..97ac6fb37958f4a44e8ee8b5c826219be908eda8 100644 (file)
@@ -208,6 +208,12 @@ bool i915_gem_object_can_bypass_llc(struct drm_i915_gem_object *obj)
        if (!(obj->flags & I915_BO_ALLOC_USER))
                return false;
 
+       /*
+        * Always flush cache for UMD objects at creation time.
+        */
+       if (obj->pat_set_by_user)
+               return true;
+
        /*
         * EHL and JSL add the 'Bypass LLC' MOCS entry, which should make it
         * possible for userspace to bypass the GTT caching bits set by the