panfrost: Flag BO shareable when appropriate

Let the kmod backend know when we might end up exporting a BO. This
doesn't change anything for the Panfrost kmod backend, but will be
needed for Panthor.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
This commit is contained in:
Boris Brezillon 2023-07-05 10:44:35 +02:00 committed by Marge Bot
parent 30d6dfb861
commit 0463a951ad

View file

@ -737,9 +737,14 @@ panfrost_resource_create_with_modifier(struct pipe_screen *screen,
} else {
/* We create a BO immediately but don't bother mapping, since we don't
* care to map e.g. FBOs which the CPU probably won't touch */
uint32_t flags = PAN_BO_DELAY_MMAP;
so->image.data.bo = panfrost_bo_create(dev, so->image.layout.data_size,
PAN_BO_DELAY_MMAP, label);
/* If the resource is never exported, we can make the BO private. */
if (template->bind & PIPE_BIND_SHARED)
flags |= PAN_BO_SHAREABLE;
so->image.data.bo =
panfrost_bo_create(dev, so->image.layout.data_size, flags, label);
so->constant_stencil = true;
}