[-]
[+]
|
Changed |
_service:tar_git:mesa.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/sailfish-on-dontbeevil/mesa</param>
<param name="branch">master</param>
- <param name="revision">22.0.0+git5</param>
+ <param name="revision">22.0.0+git6</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:mesa-22.0.0+git6.tar.bz2/mesa/src/egl/drivers/dri2/egl_dri2.h
^
|
@@ -283,6 +283,8 @@
struct zwp_linux_dmabuf_feedback_v1 *wl_dmabuf_feedback;
struct dmabuf_feedback_format_table format_table;
bool authenticated;
+ BITSET_DECLARE(formats, EGL_DRI2_NUM_FORMATS);
+ uint32_t capabilities;
char *device_name;
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:mesa-22.0.0+git6.tar.bz2/mesa/src/egl/drivers/dri2/platform_wayland.c
^
|
@@ -1447,11 +1447,33 @@
ret = zwp_linux_buffer_params_v1_create_immed(params, width, height,
fourcc, 0);
zwp_linux_buffer_params_v1_destroy(params);
-
- return ret;
+ } else if (dri2_dpy->capabilities & WL_DRM_CAPABILITY_PRIME) {
+ struct wl_drm *wl_drm =
+ dri2_surf ? dri2_surf->wl_drm_wrapper : dri2_dpy->wl_drm;
+ int fd, stride;
+
+ if (num_planes > 1)
+ return NULL;
+
+ dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_FD, &fd);
+ dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
+ ret = wl_drm_create_prime_buffer(wl_drm, fd, width, height, fourcc, 0,
+ stride, 0, 0, 0, 0);
+ close(fd);
+ } else {
+ struct wl_drm *wl_drm =
+ dri2_surf ? dri2_surf->wl_drm_wrapper : dri2_dpy->wl_drm;
+ int name, stride;
+
+ if (num_planes > 1)
+ return NULL;
+
+ dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_NAME, &name);
+ dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
+ ret = wl_drm_create_buffer(wl_drm, name, width, height, stride, fourcc);
}
- return NULL;
+ return ret;
}
static EGLBoolean
@@ -1698,16 +1720,21 @@
static void
drm_handle_format(void *data, struct wl_drm *drm, uint32_t format)
{
- /* deprecated, as compositors already support the dma-buf protocol extension
- * and so we can rely on dmabuf_handle_modifier() to receive formats and
- * modifiers */
+ struct dri2_egl_display *dri2_dpy = data;
+ int visual_idx = dri2_wl_visual_idx_from_fourcc(format);
+
+ if (visual_idx == -1)
+ return;
+
+ BITSET_SET(dri2_dpy->formats.formats_bitmap, visual_idx);
}
static void
drm_handle_capabilities(void *data, struct wl_drm *drm, uint32_t value)
{
- /* deprecated, as compositors already support the dma-buf protocol extension
- * and so we can rely on it to create wl_buffer's */
+ struct dri2_egl_display *dri2_dpy = data;
+
+ dri2_dpy->capabilities = value;
}
static void
@@ -2075,31 +2102,9 @@
wl_registry_add_listener(dri2_dpy->wl_registry,
®istry_listener_drm, dri2_dpy);
- /* The compositor must expose the dma-buf interface. */
- if (roundtrip(dri2_dpy) < 0 /*|| dri2_dpy->wl_dmabuf == NULL*/)
- goto cleanup;
-
- /* Get default dma-buf feedback */
- if (dri2_dpy->wl_dmabuf && zwp_linux_dmabuf_v1_get_version(dri2_dpy->wl_dmabuf) >=
- ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION) {
- dmabuf_feedback_format_table_init(&dri2_dpy->format_table);
- dri2_dpy->wl_dmabuf_feedback =
- zwp_linux_dmabuf_v1_get_default_feedback(dri2_dpy->wl_dmabuf);
- zwp_linux_dmabuf_feedback_v1_add_listener(dri2_dpy->wl_dmabuf_feedback,
- &dmabuf_feedback_listener, dri2_dpy);
- }
-
- /* Receive events from the interfaces */
- if (roundtrip(dri2_dpy) < 0)
+ if (roundtrip(dri2_dpy) < 0 || dri2_dpy->wl_drm == NULL)
goto cleanup;
- /* Destroy the default dma-buf feedback and the format table. */
- if (dri2_dpy->wl_dmabuf_feedback) {
- zwp_linux_dmabuf_feedback_v1_destroy(dri2_dpy->wl_dmabuf_feedback);
- dri2_dpy->wl_dmabuf_feedback = NULL;
- dmabuf_feedback_format_table_fini(&dri2_dpy->format_table);
- }
-
/* We couldn't retrieve a render node from the dma-buf feedback (or the
* feedback was not advertised at all), so we must fallback to wl_drm. */
if (dri2_dpy->fd == -1) {
@@ -2176,6 +2181,23 @@
dri2_wl_setup_swap_interval(disp);
+ /* To use Prime, we must have _DRI_IMAGE v7 at least.
+ * createImageFromFds support indicates that Prime export/import
+ * is supported by the driver. Fall back to
+ * gem names if we don't have Prime support. */
+
+ if (dri2_dpy->image->base.version < 7 ||
+ dri2_dpy->image->createImageFromFds == NULL)
+ dri2_dpy->capabilities &= ~WL_DRM_CAPABILITY_PRIME;
+
+ /* We cannot use Gem names with render-nodes, only prime fds (dma-buf).
+ * The server needs to accept them */
+ if (dri2_dpy->is_render_node &&
+ !(dri2_dpy->capabilities & WL_DRM_CAPABILITY_PRIME)) {
+ _eglLog(_EGL_WARNING, "wayland-egl: display is not render-node capable");
+ goto cleanup;
+ }
+
if (dri2_dpy->is_different_gpu &&
(dri2_dpy->image->base.version < 9 ||
dri2_dpy->image->blitImage == NULL)) {
|