Skip to content

Commit

Permalink
anv/android: remove unneeded ANB implicit import flags
Browse files Browse the repository at this point in the history
ANB is only used by Android WSI which uses explicit sync so these
flags can be dropped.

Signed-off-by: Juston Li <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29883>
  • Loading branch information
juston-li committed Jul 30, 2024
1 parent 9b1302f commit 34031e3
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/intel/vulkan/anv_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,19 +339,13 @@ anv_image_init_from_gralloc(struct anv_device *device,
*/
int dma_buf = gralloc_info->handle->data[0];

/* We need to set the WRITE flag on window system buffers so that GEM will
* know we're writing to them and synchronize uses on other rings (for
* example, if the display server uses the blitter ring).
*
* If this function fails and if the imported bo was resident in the cache,
/* If this function fails and if the imported bo was resident in the cache,
* we should avoid updating the bo's flags. Therefore, we defer updating
* the flags until success is certain.
*
*/
result = anv_device_import_bo(device, dma_buf,
ANV_BO_ALLOC_EXTERNAL |
ANV_BO_ALLOC_IMPLICIT_SYNC |
ANV_BO_ALLOC_IMPLICIT_WRITE,
ANV_BO_ALLOC_EXTERNAL,
0 /* client_address */,
&bo);
if (result != VK_SUCCESS) {
Expand Down Expand Up @@ -441,20 +435,14 @@ anv_image_bind_from_gralloc(struct anv_device *device,
*/
int dma_buf = gralloc_info->handle->data[0];

/* We need to set the WRITE flag on window system buffers so that GEM will
* know we're writing to them and synchronize uses on other rings (for
* example, if the display server uses the blitter ring).
*
* If this function fails and if the imported bo was resident in the cache,
/* If this function fails and if the imported bo was resident in the cache,
* we should avoid updating the bo's flags. Therefore, we defer updating
* the flags until success is certain.
*
*/
struct anv_bo *bo = NULL;
VkResult result = anv_device_import_bo(device, dma_buf,
ANV_BO_ALLOC_EXTERNAL |
ANV_BO_ALLOC_IMPLICIT_SYNC |
ANV_BO_ALLOC_IMPLICIT_WRITE,
ANV_BO_ALLOC_EXTERNAL,
0 /* client_address */,
&bo);
if (result != VK_SUCCESS) {
Expand Down

0 comments on commit 34031e3

Please sign in to comment.