iris: hook up memory object creation from handle
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Thu, 26 Mar 2020 15:16:25 +0000 (16:16 +0100)
committerEleni Maria Stea <elene.mst@gmail.com>
Tue, 20 Apr 2021 12:59:03 +0000 (15:59 +0300)
commitcdb5a727644e9fd0195519f81ce34f79a99ae432
treee827fec57552d9a2f7e0e7064c27f8c0e9cc19b4
parent58e93711412a6b0358f4800c18aa302676845de9
iris: hook up memory object creation from handle

v2: use iris_bo_import_dmabuf (Tapani)
v3: included "util/u_memory.h" to fixed compilation errors caused by
    using the CALLOC_STRUCT macro
v4: implemented iris_memobj_destroy (pscreen->memobj_destroy) callback
v5: removed iris_bo_from_handle and changed the approach for setting the
    tiling: Instead of querying the kernel and call
    iris_bo_import_dmabuf to create the bo, we call
    iris_bo_import_dmabuf_no_mods that imports the bo but without
    setting the tiling mode. We are going to update it when we create
    the resource. Also: implemented the iris_bo_import_dmabuf_no_mods.
v6: rebase to iris_bo_import_dmabuf changes and take a reference
    to memobj->bo (Tapani Pälli)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Eleni Maria Stea <estea@igalia.com>
Co-authored-by: Eleni Maria Stea <estea@igalia.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4337>
src/gallium/drivers/iris/iris_bufmgr.c
src/gallium/drivers/iris/iris_bufmgr.h
src/gallium/drivers/iris/iris_resource.c
src/gallium/drivers/iris/iris_resource.h