]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
drm/i915: add HAS_ALIASING_PPGTT parameter for userspace
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 15 Feb 2012 22:50:25 +0000 (23:50 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 20 Mar 2012 20:55:40 +0000 (21:55 +0100)
On Sanybridge a few MI read/write commands only work when ppgtt is
enabled.  Userspace therefore needs to be able to check whether ppgtt
is enabled. For added hilarity, you need to reset the "use global GTT"
bit on snb when ppgtt is enabled, otherwise it won't work.  Despite
what bspec says about automatically using ppgtt ...

Luckily PIPE_CONTROL (the only write cmd current userspace uses) is
not affected by all this, as tested by tests/gem_pipe_control_store_loop.

Reviewed-and-tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_dma.c
include/drm/i915_drm.h

index 3c086d707a919098c4a8f5e9bb462976eaceecfa..fdff0097cf2b668b75780207c9fa41bbbb06a088 100644 (file)
@@ -790,6 +790,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
        case I915_PARAM_HAS_LLC:
                value = HAS_LLC(dev);
                break;
+       case I915_PARAM_HAS_ALIASING_PPGTT:
+               value = dev_priv->mm.aliasing_ppgtt ? 1 : 0;
+               break;
        default:
                DRM_DEBUG_DRIVER("Unknown parameter %d\n",
                                 param->param);
index da929bb5b7886e3387cd130ab3b0ee5aac2abb71..f3f82242bf1dc9312551c9b2526ce892bcb5ed5b 100644 (file)
@@ -296,7 +296,8 @@ typedef struct drm_i915_irq_wait {
 #define I915_PARAM_HAS_EXEC_CONSTANTS   14
 #define I915_PARAM_HAS_RELAXED_DELTA    15
 #define I915_PARAM_HAS_GEN7_SOL_RESET   16
-#define I915_PARAM_HAS_LLC              17
+#define I915_PARAM_HAS_LLC                      17
+#define I915_PARAM_HAS_ALIASING_PPGTT   18
 
 typedef struct drm_i915_getparam {
        int param;