v3d: implement resource_get_param
authorSimon Ser <contact@emersion.fr>
Sat, 14 Aug 2021 12:05:43 +0000 (14:05 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 19 Aug 2021 13:12:51 +0000 (13:12 +0000)
commit8de086e12f5a20a75b227e48faeb83d9aacb21c3
tree3a1647e8c6c4671d9e3ab6fa9154d5901644d863
parentb1fbceac6f840172e2aeae929072ed92a4c47eb0
v3d: implement resource_get_param

Prior to this commit, the stride, offset and modifier were fetched
via WINSYS_HANDLE_TYPE_KMS. However we can't make such a query
succeed if the buffer couldn't be imported to the KMS device.

Instead, implement the resource_get_param hook to allow users to
fetch this information without WINSYS_HANDLE_TYPE_KMS.

A tiny helper function is introduced to compute the modifier of a
resource.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 7bcb22363935 ("v3d, vc4: Fix dmabuf import for non-scanout buffers")
Reported-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12370>
src/broadcom/ci/piglit-v3d-rpi4-fails.txt
src/gallium/drivers/v3d/v3d_resource.c