iris: Introduce a BO_ALLOC_NO_SUBALLOC flag and set it in a few places

We don't want to suballocate some buffers, such as ones that we know
we're intending to export to other clients, or ones with special
semantics (such as the workaround BO not having proper synchronization).

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12623>
This commit is contained in:
Kenneth Graunke
2021-08-08 01:31:30 -07:00
committed by Marge Bot
parent 5511e509cd
commit fb4e2ccc2b
4 changed files with 12 additions and 6 deletions
+2 -1
View File
@@ -363,9 +363,10 @@ create_batch(struct iris_batch *batch)
struct iris_screen *screen = batch->screen;
struct iris_bufmgr *bufmgr = screen->bufmgr;
/* TODO: We probably could suballocate batches... */
batch->bo = iris_bo_alloc(bufmgr, "command buffer",
BATCH_SZ + BATCH_RESERVED, 1,
IRIS_MEMZONE_OTHER, 0);
IRIS_MEMZONE_OTHER, BO_ALLOC_NO_SUBALLOC);
iris_get_backing_bo(batch->bo)->real.kflags |= EXEC_OBJECT_CAPTURE;
batch->map = iris_bo_map(NULL, batch->bo, MAP_READ | MAP_WRITE);
batch->map_next = batch->map;
+5 -4
View File
@@ -264,10 +264,11 @@ struct iris_bo {
};
};
#define BO_ALLOC_ZEROED (1<<0)
#define BO_ALLOC_COHERENT (1<<1)
#define BO_ALLOC_SMEM (1<<2)
#define BO_ALLOC_SCANOUT (1<<3)
#define BO_ALLOC_ZEROED (1<<0)
#define BO_ALLOC_COHERENT (1<<1)
#define BO_ALLOC_SMEM (1<<2)
#define BO_ALLOC_SCANOUT (1<<3)
#define BO_ALLOC_NO_SUBALLOC (1<<4)
/**
* Allocate a buffer object.
+4
View File
@@ -442,6 +442,10 @@ iris_resource_alloc_flags(const struct iris_screen *screen,
PIPE_RESOURCE_FLAG_MAP_PERSISTENT))
flags |= BO_ALLOC_SMEM;
if ((templ->bind & PIPE_BIND_SHARED) ||
util_format_get_num_planes(templ->format) > 1)
flags |= BO_ALLOC_NO_SUBALLOC;
return flags;
}
+1 -1
View File
@@ -805,7 +805,7 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
screen->workaround_bo =
iris_bo_alloc(screen->bufmgr, "workaround", 4096, 1,
IRIS_MEMZONE_OTHER, 0);
IRIS_MEMZONE_OTHER, BO_ALLOC_NO_SUBALLOC);
if (!screen->workaround_bo)
return NULL;