Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21538>
/* BO should be mapped write-back on the CPU (else, write combine) */
AGX_BO_WRITEBACK = 1 << 3,
+
+ /* BO could potentially be shared (imported or exported) and therefore cannot
+ * be allocated as private
+ */
+ AGX_BO_SHAREABLE = 1 << 4,
};
struct agx_ptr {
create_flags |= AGX_BO_WRITEBACK;
}
+ /* Create buffers that might be shared with the SHAREABLE flag */
+ if (bind & (PIPE_BIND_SCANOUT | PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SHARED))
+ create_flags |= AGX_BO_SHAREABLE;
+
nresource->bo =
agx_bo_create(dev, nresource->layout.size_B, create_flags, label);