i965: Don't stomp initial kflags for program cache.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 10 Apr 2018 23:01:50 +0000 (16:01 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 30 Apr 2018 18:34:19 +0000 (11:34 -0700)
We want to flag EXEC_OBJECT_CAPTURE, but we ought to preserve any
existing kflags.  Today, there are none (as the program cache doesn't
support 48-bit addressing), but once we start using softpin, we'll
need to preserve EXEC_OBJECT_PINNED.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/mesa/drivers/dri/i965/brw_program_cache.c

index ce11f1d070308f1cb4700b6186a145facbc8b05e..78159288af0e91c1b03bf2a9f27c354bcc2cf9c9 100644 (file)
@@ -223,7 +223,7 @@ brw_cache_new_bo(struct brw_cache *cache, uint32_t new_size)
 
    new_bo = brw_bo_alloc(brw->bufmgr, "program cache", new_size);
    if (can_do_exec_capture(brw->screen))
-      new_bo->kflags = EXEC_OBJECT_CAPTURE;
+      new_bo->kflags |= EXEC_OBJECT_CAPTURE;
 
    void *map = brw_bo_map(brw, new_bo, MAP_READ | MAP_WRITE |
                                        MAP_ASYNC | MAP_PERSISTENT);
@@ -390,7 +390,7 @@ brw_init_caches(struct brw_context *brw)
 
    cache->bo = brw_bo_alloc(brw->bufmgr, "program cache", 16384);
    if (can_do_exec_capture(brw->screen))
-      cache->bo->kflags = EXEC_OBJECT_CAPTURE;
+      cache->bo->kflags |= EXEC_OBJECT_CAPTURE;
 
    cache->map = brw_bo_map(brw, cache->bo, MAP_READ | MAP_WRITE |
                                            MAP_ASYNC | MAP_PERSISTENT);