summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/iris/iris_resource.c5
-rw-r--r--src/gallium/drivers/iris/iris_screen.c3
-rw-r--r--src/gallium/drivers/iris/iris_screen.h2
3 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 2566806ee27..b07664bc88d 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -262,6 +262,11 @@ iris_resource_create_with_modifiers(struct pipe_screen *pscreen,
if (!res->bo)
goto fail;
+ if (templ->flags & IRIS_RESOURCE_FLAG_INSTRUCTION_CACHE) {
+ // XXX: p_atomic_add is backwards :(
+ res->bo->gtt_offset = __atomic_fetch_add(&screen->next_instruction_address, res->bo->size, __ATOMIC_ACQ_REL);
+ }
+
return &res->base;
fail:
diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c
index 677860ee3e1..5f1caff180c 100644
--- a/src/gallium/drivers/iris/iris_screen.c
+++ b/src/gallium/drivers/iris/iris_screen.c
@@ -526,5 +526,8 @@ iris_screen_create(int fd)
pscreen->fence_finish = iris_fence_finish;
pscreen->query_memory_info = iris_query_memory_info;
+ /* Put them somewhere non-zero */
+ screen->next_instruction_address = 128 * 1024;
+
return pscreen;
}
diff --git a/src/gallium/drivers/iris/iris_screen.h b/src/gallium/drivers/iris/iris_screen.h
index 5484e535ac9..f24f567532f 100644
--- a/src/gallium/drivers/iris/iris_screen.h
+++ b/src/gallium/drivers/iris/iris_screen.h
@@ -47,6 +47,8 @@ struct iris_screen {
struct isl_device isl_dev;
struct iris_bufmgr *bufmgr;
struct brw_compiler *compiler;
+
+ uint32_t next_instruction_address;
};
struct pipe_screen *iris_screen_create(int fd);