summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-01-25 20:04:37 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:05 -0800
commit6f1c07d7dd465e1c18a3641ac9e0b759e19c4060 (patch)
tree09d82a7e330ce31f43c25e38b6bf8cab9e48cbe9 /src/gallium/drivers
parentacdff2f9a68a1ce3879ad22b8602a97f58957340 (diff)
iris: actually softpin at an address
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);