|
|
@ -241,14 +241,6 @@ struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display) {
|
|
|
|
"eglQueryDmaBufModifiersEXT");
|
|
|
|
"eglQueryDmaBufModifiersEXT");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (check_egl_ext(display_exts_str, "EGL_MESA_image_dma_buf_export")) {
|
|
|
|
|
|
|
|
egl->exts.image_dma_buf_export_mesa = true;
|
|
|
|
|
|
|
|
load_egl_proc(&egl->procs.eglExportDMABUFImageQueryMESA,
|
|
|
|
|
|
|
|
"eglExportDMABUFImageQueryMESA");
|
|
|
|
|
|
|
|
load_egl_proc(&egl->procs.eglExportDMABUFImageMESA,
|
|
|
|
|
|
|
|
"eglExportDMABUFImageMESA");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (check_egl_ext(display_exts_str, "EGL_WL_bind_wayland_display")) {
|
|
|
|
if (check_egl_ext(display_exts_str, "EGL_WL_bind_wayland_display")) {
|
|
|
|
egl->exts.bind_wayland_display_wl = true;
|
|
|
|
egl->exts.bind_wayland_display_wl = true;
|
|
|
|
load_egl_proc(&egl->procs.eglBindWaylandDisplayWL,
|
|
|
|
load_egl_proc(&egl->procs.eglBindWaylandDisplayWL,
|
|
|
@ -699,37 +691,6 @@ const struct wlr_drm_format_set *wlr_egl_get_dmabuf_render_formats(
|
|
|
|
return &egl->dmabuf_render_formats;
|
|
|
|
return &egl->dmabuf_render_formats;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool wlr_egl_export_image_to_dmabuf(struct wlr_egl *egl, EGLImageKHR image,
|
|
|
|
|
|
|
|
int32_t width, int32_t height, uint32_t flags,
|
|
|
|
|
|
|
|
struct wlr_dmabuf_attributes *attribs) {
|
|
|
|
|
|
|
|
memset(attribs, 0, sizeof(struct wlr_dmabuf_attributes));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!egl->exts.image_dma_buf_export_mesa) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Only one set of modifiers is returned for all planes
|
|
|
|
|
|
|
|
if (!egl->procs.eglExportDMABUFImageQueryMESA(egl->display, image,
|
|
|
|
|
|
|
|
(int *)&attribs->format, &attribs->n_planes, &attribs->modifier)) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (attribs->n_planes > WLR_DMABUF_MAX_PLANES) {
|
|
|
|
|
|
|
|
wlr_log(WLR_ERROR, "EGL returned %d planes, but only %d are supported",
|
|
|
|
|
|
|
|
attribs->n_planes, WLR_DMABUF_MAX_PLANES);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!egl->procs.eglExportDMABUFImageMESA(egl->display, image, attribs->fd,
|
|
|
|
|
|
|
|
(EGLint *)attribs->stride, (EGLint *)attribs->offset)) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attribs->width = width;
|
|
|
|
|
|
|
|
attribs->height = height;
|
|
|
|
|
|
|
|
attribs->flags = flags;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static bool device_has_name(const drmDevice *device, const char *name) {
|
|
|
|
static bool device_has_name(const drmDevice *device, const char *name) {
|
|
|
|
for (size_t i = 0; i < DRM_NODE_MAX; i++) {
|
|
|
|
for (size_t i = 0; i < DRM_NODE_MAX; i++) {
|
|
|
|
if (!(device->available_nodes & (1 << i))) {
|
|
|
|
if (!(device->available_nodes & (1 << i))) {
|
|
|
|