mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-16 19:48:20 +02:00
va: Set contiguous_planes for DMA-BUF imported surfaces
Set contiguous_planes if all planes share the same fd. This makes vaDeriveImage work with DMA-BUF imported surfaces. Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42086>
This commit is contained in:
parent
db382b3cae
commit
1825627cf8
1 changed files with 8 additions and 0 deletions
|
|
@ -35,6 +35,7 @@
|
|||
#include "util/u_sampler.h"
|
||||
#include "util/u_video.h"
|
||||
#include "util/set.h"
|
||||
#include "util/os_file.h"
|
||||
|
||||
#include "vl/vl_compositor.h"
|
||||
#include "vl/vl_video_buffer.h"
|
||||
|
|
@ -679,6 +680,13 @@ surface_from_prime(VADriverContextP ctx, vlVaSurface *surface,
|
|||
result = VA_STATUS_ERROR_ALLOCATION_FAILED;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
surface->buffer->contiguous_planes = true;
|
||||
for (uint32_t i = 1; i < desc->num_objects; i++) {
|
||||
if (os_same_file_description(desc->objects[0].fd, desc->objects[i].fd) != 0)
|
||||
surface->buffer->contiguous_planes = false;
|
||||
}
|
||||
|
||||
return VA_STATUS_SUCCESS;
|
||||
|
||||
fail:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue