[Mesa-dev] [PATCH] st/egl: Fix build after changes in src/egl/wayland/

Scott Moreau oreaus at gmail.com
Sat Mar 23 08:34:59 PDT 2013


Hi all,

I am having some pretty bad crashes and graphical corruption due to
these series. The commit messages say tested-by but they weren't even
compile-tested apparently. Here's what I have
https://bugs.freedesktop.org/show_bug.cgi?id=62663 I have no idea
what's going on but it seems nasty.

- Scott

On Wed, Mar 20, 2013 at 9:33 AM, Kristian Høgsberg <krh at bitplanet.net> wrote:
> I pushed a different fix for this.  The gallium egl code doesn't have
> support for buffer sharing via fd passing so we can't just ask the
> protocol code to advertise that, even if the kernel has the
> DRM_CAP_PRIME features.  Instead we just pass 0 for the flags
> argument.
>
> thanks,
> Kristian
>
> On Tue, Mar 19, 2013 at 6:07 AM, Michel Dänzer <michel at daenzer.net> wrote:
>> From: Michel Dänzer <michel.daenzer at amd.com>
>>
>> Not sure it actually works though, some buffer callbacks seem to have rotted
>> before.
>>
>> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
>> ---
>>  src/gallium/state_trackers/egl/drm/native_drm.c     |  8 +++++++-
>>  src/gallium/state_trackers/egl/wayland/native_drm.c |  8 +++++++-
>>  src/gallium/state_trackers/egl/x11/native_dri2.c    | 14 +++++++++++++-
>>  3 files changed, 27 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/gallium/state_trackers/egl/drm/native_drm.c b/src/gallium/state_trackers/egl/drm/native_drm.c
>> index f0c0f54..65c91cf 100644
>> --- a/src/gallium/state_trackers/egl/drm/native_drm.c
>> +++ b/src/gallium/state_trackers/egl/drm/native_drm.c
>> @@ -207,13 +207,19 @@ drm_display_bind_wayland_display(struct native_display *ndpy,
>>                                    struct wl_display *wl_dpy)
>>  {
>>     struct drm_display *drmdpy = drm_display(ndpy);
>> +   int ret, flags = 0;
>> +   uint64_t cap;
>>
>>     if (drmdpy->wl_server_drm)
>>        return FALSE;
>>
>> +   ret = drmGetCap(drmdpy->fd, DRM_CAP_PRIME, &cap);
>> +   if (ret == 0 && cap == (DRM_PRIME_CAP_IMPORT | DRM_PRIME_CAP_EXPORT))
>> +      flags |= WAYLAND_DRM_PRIME;
>> +
>>     drmdpy->wl_server_drm = wayland_drm_init(wl_dpy,
>>           drmdpy->device_name,
>> -         &wl_drm_callbacks, ndpy);
>> +         &wl_drm_callbacks, ndpy, flags);
>>
>>     if (!drmdpy->wl_server_drm)
>>        return FALSE;
>> diff --git a/src/gallium/state_trackers/egl/wayland/native_drm.c b/src/gallium/state_trackers/egl/wayland/native_drm.c
>> index 3801fac..7633379 100644
>> --- a/src/gallium/state_trackers/egl/wayland/native_drm.c
>> +++ b/src/gallium/state_trackers/egl/wayland/native_drm.c
>> @@ -265,13 +265,19 @@ wayland_drm_display_bind_wayland_display(struct native_display *ndpy,
>>                                           struct wl_display *wl_dpy)
>>  {
>>     struct wayland_drm_display *drmdpy = wayland_drm_display(ndpy);
>> +   int ret, flags = 0;
>> +   uint64_t cap;
>>
>>     if (drmdpy->wl_server_drm)
>>        return FALSE;
>>
>> +   ret = drmGetCap(drmdpy->fd, DRM_CAP_PRIME, &cap);
>> +   if (ret == 0 && cap == (DRM_PRIME_CAP_IMPORT | DRM_PRIME_CAP_EXPORT))
>> +      flags |= WAYLAND_DRM_PRIME;
>> +
>>     drmdpy->wl_server_drm =
>>        wayland_drm_init(wl_dpy, drmdpy->device_name,
>> -                       &wl_drm_callbacks, ndpy);
>> +                       &wl_drm_callbacks, ndpy, flags);
>>
>>     if (!drmdpy->wl_server_drm)
>>        return FALSE;
>> diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c
>> index a989f9e..67ecb60 100644
>> --- a/src/gallium/state_trackers/egl/x11/native_dri2.c
>> +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c
>> @@ -40,6 +40,7 @@
>>
>>  #include "common/native_helper.h"
>>  #ifdef HAVE_WAYLAND_BACKEND
>> +#include <xf86drm.h>
>>  #include "common/native_wayland_drm_bufmgr_helper.h"
>>  #endif
>>
>> @@ -63,6 +64,7 @@ struct dri2_display {
>>     struct util_hash_table *surfaces;
>>  #ifdef HAVE_WAYLAND_BACKEND
>>     struct wl_drm *wl_server_drm; /* for EGL_WL_bind_wayland_display */
>> +   int fd;
>>  #endif
>>  };
>>
>> @@ -817,6 +819,10 @@ dri2_display_init_screen(struct native_display *ndpy)
>>        return FALSE;
>>     }
>>
>> +#ifdef HAVE_WAYLAND_BACKEND
>> +   dri2dpy->fd = fd;
>> +#endif
>> +
>>     return TRUE;
>>  }
>>
>> @@ -855,13 +861,19 @@ dri2_display_bind_wayland_display(struct native_display *ndpy,
>>                                    struct wl_display *wl_dpy)
>>  {
>>     struct dri2_display *dri2dpy = dri2_display(ndpy);
>> +   int ret, flags = 0;
>> +   uint64_t cap;
>>
>>     if (dri2dpy->wl_server_drm)
>>        return FALSE;
>>
>> +   ret = drmGetCap(dri2dpy->fd, DRM_CAP_PRIME, &cap);
>> +   if (ret == 0 && cap == (DRM_PRIME_CAP_IMPORT | DRM_PRIME_CAP_EXPORT))
>> +      flags |= WAYLAND_DRM_PRIME;
>> +
>>     dri2dpy->wl_server_drm = wayland_drm_init(wl_dpy,
>>           x11_screen_get_device_name(dri2dpy->xscr),
>> -         &wl_drm_callbacks, ndpy);
>> +         &wl_drm_callbacks, ndpy, flags);
>>
>>     if (!dri2dpy->wl_server_drm)
>>        return FALSE;
>> --
>> 1.8.2.rc3
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list