Not currently used.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
VkResult result;
memset(image, 0, sizeof(*image));
+ for (int i = 0; i < ARRAY_SIZE(image->fds); i++)
+ image->fds[i] = -1;
const struct wsi_image_create_info image_wsi_info = {
.sType = VK_STRUCTURE_TYPE_WSI_IMAGE_CREATE_INFO_MESA,
if (result != VK_SUCCESS)
goto fail;
- image->size = reqs.size;
- image->row_pitch = image_layout.rowPitch;
- image->offset = 0;
- image->fd = fd;
+ image->num_planes = 1;
+ image->sizes[0] = reqs.size;
+ image->row_pitches[0] = image_layout.rowPitch;
+ image->offsets[0] = 0;
+ image->fds[0] = fd;
return VK_SUCCESS;
if (result != VK_SUCCESS)
goto fail;
- image->size = linear_size;
- image->row_pitch = linear_stride;
- image->offset = 0;
- image->fd = fd;
+ image->num_planes = 1;
+ image->sizes[0] = linear_size;
+ image->row_pitches[0] = linear_stride;
+ image->offsets[0] = 0;
+ image->fds[0] = fd;
return VK_SUCCESS;
VkCommandBuffer *blit_cmd_buffers;
} prime;
- uint32_t size;
- uint32_t offset;
- uint32_t row_pitch;
- int fd;
+ int num_planes;
+ uint32_t sizes[4];
+ uint32_t offsets[4];
+ uint32_t row_pitches[4];
+ int fds[4];
};
struct wsi_swapchain {
if (result != VK_SUCCESS)
return result;
+ /* Without passing modifiers, we can't have multi-plane RGB images. */
+ assert(image->base.num_planes == 1);
+
image->buffer = wl_drm_create_prime_buffer(chain->drm_wrapper,
- image->base.fd, /* name */
+ image->base.fds[0], /* name */
chain->extent.width,
chain->extent.height,
chain->drm_format,
- image->base.offset,
- image->base.row_pitch,
+ image->base.offsets[0],
+ image->base.row_pitches[0],
0, 0, 0, 0 /* unused */);
- close(image->base.fd);
+ close(image->base.fds[0]);
if (!image->buffer)
goto fail_image;
image->pixmap = xcb_generate_id(chain->conn);
+ /* Without passing modifiers, we can't have multi-plane RGB images. */
+ assert(image->base.num_planes == 1);
+
cookie =
xcb_dri3_pixmap_from_buffer_checked(chain->conn,
image->pixmap,
chain->window,
- image->base.size,
+ image->base.sizes[0],
pCreateInfo->imageExtent.width,
pCreateInfo->imageExtent.height,
- image->base.row_pitch,
+ image->base.row_pitches[0],
chain->depth, bpp,
- image->base.fd);
+ image->base.fds[0]);
xcb_discard_reply(chain->conn, cookie.sequence);
- image->base.fd = -1; /* XCB has now taken ownership of the FD */
+ image->base.fds[0] = -1; /* XCB has now taken ownership of the FD */
int fence_fd = xshmfence_alloc_shm();
if (fence_fd < 0)