iris: hook up resource creation from memory object
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Thu, 14 Jan 2021 11:28:28 +0000 (13:28 +0200)
committerEleni Maria Stea <elene.mst@gmail.com>
Tue, 20 Apr 2021 12:59:03 +0000 (15:59 +0300)
commit772dc50d162f6ac99676ef5134607f0d0e6db21e
tree90c48fa9373c770051af376a65a467a6226b46bd
parentcdb5a727644e9fd0195519f81ce34f79a99ae432
iris: hook up resource creation from memory object

v2:
* Fixed indentation in iris_resource_from_memobj

v3:
* Removed the call to iris_resource_configure_aux, as we don't
  have any auxiliary buffer support.

v4:
* Added a comment about the assertion that there's no aux buffer
  in case we add them later.

v5:
* Changed the logic of iris_resource_from_memobj. When the user doesn't
  explicitly set the tiling to linear, we use a similar logic with the
  anv driver's logic to calculate it instead of querying the kernel.
  This is because the Vulkan driver doesn't perform ioctls to update the
  kernel when it suballocates buffers.

v6:
* Removed the line that sets the modifier info in the resource. We
  shouldn't need it.

v7, v8:
* Removed left over code related to modifiers.

v9:
* Replaced FORCE_LINEAR_TILING flag with PIPE_BIND_LINEAR where
  necessary.

v10: rebase, use iris_resource_configure_main (Tapani)

v11:
* isl surfaces should be created only for textures and not for
  buffers (fixes: pixel buffer tests assertion failure on BDW).

v12:
* fix in return type is required after rebasing to master.

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> (v9)
Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (v12)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4337>
src/gallium/drivers/iris/iris_resource.c
src/gallium/drivers/iris/iris_resource.h