Mesa (master): i965/screen: Allocate ZEROED BOs for images

Jason Ekstrand jekstrand at kemper.freedesktop.org
Mon Jul 17 20:49:36 UTC 2017


Module: Mesa
Branch: master
Commit: cbee2d1102c50c631285fda4411bd6abc86c3d66
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cbee2d1102c50c631285fda4411bd6abc86c3d66

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Wed Jul 12 17:06:29 2017 -0700

i965/screen: Allocate ZEROED BOs for images

Reviewed-by: Chad Versace <chadversary at chromium.org>

---

 src/mesa/drivers/dri/i965/intel_screen.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 68026d991b..f137e3ecf9 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -674,9 +674,13 @@ intel_create_image_common(__DRIscreen *dri_screen,
       return NULL;
    }
 
+   /* We request that the bufmgr zero because, if a buffer gets re-used from
+    * the pool, we don't want to leak random garbage from our process to some
+    * other.
+    */
    image->bo = brw_bo_alloc_tiled(screen->bufmgr, "image", surf.size,
                                   isl_tiling_to_i915_tiling(mod_info->tiling),
-                                  surf.row_pitch, 0);
+                                  surf.row_pitch, BO_ALLOC_ZEROED);
    if (image->bo == NULL) {
       free(image);
       return NULL;




More information about the mesa-commit mailing list