intel/isl: Don't request space for stencil/hiz packets unless needed
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 12 May 2017 20:31:05 +0000 (13:31 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 26 May 2017 14:58:01 +0000 (07:58 -0700)
On Iron Lake, the packets exist but we never emit them so there's no
need for us to ask the driver to make batch space for them.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/isl/isl.c

index f89f351c15771c3fc087a2a22b03e5af24450b2b..f70e1880583066dfcaf79a27bee9d9c466e8f25b 100644 (file)
@@ -84,17 +84,16 @@ isl_device_init(struct isl_device *dev,
    dev->ss.aux_addr_offset =
       (RENDER_SURFACE_STATE_AuxiliarySurfaceBaseAddress_start(info) & ~31) / 8;
 
-   dev->ds.size =
-      _3DSTATE_DEPTH_BUFFER_length(info) * 4 +
-      _3DSTATE_STENCIL_BUFFER_length(info) * 4 +
-      _3DSTATE_HIER_DEPTH_BUFFER_length(info) * 4 +
-      _3DSTATE_CLEAR_PARAMS_length(info) * 4;
-
+   dev->ds.size = _3DSTATE_DEPTH_BUFFER_length(info) * 4;
    assert(_3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_start(info) % 8 == 0);
    dev->ds.depth_offset =
       _3DSTATE_DEPTH_BUFFER_SurfaceBaseAddress_start(info) / 8;
 
-   if (info->has_hiz_and_separate_stencil) {
+   if (dev->use_separate_stencil) {
+      dev->ds.size += _3DSTATE_STENCIL_BUFFER_length(info) * 4 +
+                      _3DSTATE_HIER_DEPTH_BUFFER_length(info) * 4 +
+                      _3DSTATE_CLEAR_PARAMS_length(info) * 4;
+
       assert(_3DSTATE_STENCIL_BUFFER_SurfaceBaseAddress_start(info) % 8 == 0);
       dev->ds.stencil_offset =
          _3DSTATE_DEPTH_BUFFER_length(info) * 4 +