May I ask how to retrieve Weston cursor image data from dmabuf?
May I ask how to retrieve Weston cursor image data from dmabuf? When Weston is running on Xorg, I want to set the Weston cursor image data to the X11 window cursor and hide the Weston cursor, so that mouse operations are smoother. The mmap method may cause errors on some AMD graphics cards. mmap error: 38-Function not implemented。
weston/libweston/input.c:
static void
pointer_set_cursor(struct wl_client *client, struct wl_resource *resource,
uint32_t serial, struct wl_resource *surface_resource,
int32_t x, int32_t y)
{
......
if (surface_resource)
surface = wl_resource_get_user_data(surface_resource);
......
struct linux_dmabuf_buffer *dmabuf;
dmabuf = linux_dmabuf_buffer_get(surface->buffer_ref.buffer->resource);
if (dmabuf) {
int fd = dmabuf->attributes.fd[0];
int width = dmabuf->attributes.width;
int height = dmabuf->attributes.height;
int stride = dmabuf->attributes.stride[0];
int size = stride * height;
uint8_t *data = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);//mmap error: 38-Function not implemented。
.......
}
......
}
Edited by Marius Vlad