Bug 52267 - Desktop-shell failing with radeon drm
Summary: Desktop-shell failing with radeon drm
Status: VERIFIED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: weston (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: high major
Assignee: Wayland bug list
QA Contact: Kristian Høgsberg
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-19 15:11 UTC by charliemacdev
Modified: 2012-09-03 14:47 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
error log for desktop-shell on radeon drm (69.07 KB, application/octet-stream)
2012-07-19 15:11 UTC, charliemacdev
Details
radeon drm simple-egl crash (2.05 KB, application/octet-stream)
2012-07-25 17:38 UTC, Scott Moreau
Details
nouveau x11 simple-egl crash (1.49 KB, application/octet-stream)
2012-07-25 17:40 UTC, Scott Moreau
Details

Description charliemacdev 2012-07-19 15:11:01 UTC
Created attachment 64397 [details]
error log for desktop-shell on radeon drm

This error log is from weston 971cbc8c9e6fea2de0eaff9d4f7adad3c5ad0d58 though I'm seeing similar results on current HEAD(70a11b131d97ba4602b60d7915e7361d158fbfdc) I will post my libdrm and wayland versions when I am able but they were current HEAD as of Jul.17, 2012.

When running weston-launch, the screen blanks but never displays content. ctrl-alt-backspace is the only way out.

Attached is the error log produced when setting all the debugging env variables mentioned in the build guide. If there is some better output I should file, I'm willing to -- I just need to be directed on how to create it.

My gpu hardware is an AMD Radeon HD3200
Comment 1 Vova 2012-07-24 06:24:02 UTC
Regression began from this commits:
http://cgit.freedesktop.org/wayland/weston/commit/?id=76574d1fb7457a0aef14d2fcca6c66f3ffe97cf9

and:
http://cgit.freedesktop.org/wayland/weston/commit/?id=28f59b027a56da58a2cde306d8f0497a8a804ad3

and similar commit yet related to the planar buffers in mesa. I have builds of
weston and mesa befor this commits, on my ati hd 2600xt with radeon it working
fine on X11 and DRI2 backends. All builds after planar buffers commit doesn`t
work on any backends. 

> wl_drm@11: error 2: invalid name

Error happens because in egl_dri2.c[1323]:dri2_wl_reference_buffer result of call

buffer->driver_buffer =
      dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
                                           buffer->buffer.width,
                                           buffer->buffer.height, 
                                           __DRI_IMAGE_FORMAT_NONE, name,
                                           buffer->stride[0] / 4,
                                           NULL);

with "__DRI_IMAGE_FORMAT_NONE" is NULL.

createImageFromName - is pointer on radeon_screen.c[204]
static __DRIimage *
radeon_create_image_from_name(__DRIscreen *screen,
                              int width, int height, int format,
                              int name, int pitch, void *loaderPrivate)


switch (format) {

no have case __DRI_IMAGE_FORMAT_NONE and default return null

default:
      free(image);
      return NULL;

If make conversion from wayland image format to dri image format and replace __DRI_IMAGE_FORMAT_NONE to converted format - weston segfault. I don`t know what to do, but planar buffers commit(somewhere at the time) remove from dri2_wl_reference_buffer conversion wl format to dri format, and place __DRI_IMAGE_FORMAT_NONE constant. How the driver know what type of buffer need create? What need change in driver(?).
Comment 2 Scott Moreau 2012-07-25 17:38:44 UTC
Created attachment 64678 [details]
radeon drm simple-egl crash

With --enable-gallium-egl, on radeon, running weston drm backend. shm clients work but desktop-shell and others (egl clients) fail.
Comment 3 Scott Moreau 2012-07-25 17:40:31 UTC
Created attachment 64679 [details]
nouveau x11 simple-egl crash

This is from another user. I'm guessing they built mesa with --disable-gallium-egl.
Comment 4 Scott Moreau 2012-07-25 17:45:02 UTC
This bug is a pretty major problem. Basically, any wayland client that uses egl crashes on radeon and nouveau. It works fine on intel. Attached are bt's from people that have hit this case (myself included), with simple-egl client. Hopefully, this can be fixed before mesa 8.1 release. Escalating this issue to High/Major.
Comment 5 Vova 2012-07-25 18:31:17 UTC
(In reply to comment #4)
> This bug is a pretty major problem. Basically, any wayland client that uses egl
> crashes on radeon and nouveau. It works fine on intel. Attached are bt's from
> people that have hit this case (myself included), with simple-egl client.
> Hopefully, this can be fixed before mesa 8.1 release. Escalating this issue to
> High/Major.

I think this problem of mesa, not weston... Need correcting drivers, but for some reason no one does anything. On the nouveau it he has never worked..
Comment 6 Ander Conselvan de Oliveira 2012-07-26 08:29:34 UTC
(In reply to comment #1)
> If make conversion from wayland image format to dri image format and replace
> __DRI_IMAGE_FORMAT_NONE to converted format - weston segfault. I don`t know
> what to do, but planar buffers commit(somewhere at the time) remove from
> dri2_wl_reference_buffer conversion wl format to dri format, and place
> __DRI_IMAGE_FORMAT_NONE constant. How the driver know what type of buffer need
> create? What need change in driver(?).

I did some debugging on a radeon machine I have at home. The problem is that since mesa commit e6a33570, the dri2 egl driver is uncondionally using version 5 of the dri image extension. The flow is to create a dri image with format none, and later create one or more subimages out of that image with the appropriate formats. The segfault happens because the createSubImage hook is not implemented.
Comment 7 Darxus 2012-08-01 01:32:32 UTC
If this is a mesa bug, can someone more familiar please open a bug against mesa?  https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa
Comment 8 Scott Moreau 2012-08-13 17:03:49 UTC
To all interested, please test the following patches:

http://lists.freedesktop.org/archives/mesa-dev/2012-August/025603.html
http://lists.freedesktop.org/archives/mesa-dev/2012-August/025604.html

I tested on radeon and drm backend works. I do not have an nvidia chip to test with so if someone using nouveau could test and report back, it would be helpful.


Thanks,

Scott
Comment 9 Vova 2012-08-13 21:24:49 UTC
(In reply to comment #8)

On nvidia's earlier work under X server. I ran only under Xorg, since drm backend wayland has not worked because I have no hardware acceleration (GT520 Fermi). It write fails about gbm fd(dont remember). Radeon also work under X server, but recently not work on drm. I will try these patches on Radeon.
Comment 10 Vova 2012-08-14 17:22:14 UTC
(In reply to comment #9)

Yes, working on ati/amd. HD 2600xt
Comment 11 Scott Moreau 2012-08-14 22:44:40 UTC
(In reply to comment #10)
> (In reply to comment #9)
> 
> Yes, working on ati/amd. HD 2600xt

Can you possibly try to see if fullscreen works for clients? Pressing F11 in weston-terminal should be enough.
Comment 12 Vova 2012-08-15 11:11:55 UTC
(In reply to comment #11)

Full screen working too. Terminal, gears, etc.
Comment 14 charliemacdev 2012-08-16 02:39:42 UTC
With the exception of the small typo error on line 425 of mesa's src/gbm/backends/dri/gbm_dri.c, the above patch set works for me with radeon gpu. However, I have no available nvidia-based gpu, so I can't speak for its status.
Comment 15 Scott Moreau 2012-09-01 11:41:57 UTC
This should be fixed in latest mesa. I am closing this bug since the committed patches have been reviewed by Kristian Hogsberg and tested by several other parties.
Comment 17 Darxus 2012-09-03 01:25:44 UTC
desktop-shell stopped crashing on startup with "wl_drm@11: error 2: invalid name", thanks.
Comment 18 Vova 2012-09-03 14:41:06 UTC
(In reply to comment #17)
> desktop-shell stopped crashing on startup with "wl_drm@11: error 2: invalid
> name", thanks.

You are installed latest mesa from git?
Comment 19 Darxus 2012-09-03 14:47:18 UTC
(In reply to comment #18)
> (In reply to comment #17)
> > desktop-shell stopped crashing on startup with "wl_drm@11: error 2: invalid
> > name", thanks.
> 
> You are installed latest mesa from git?

Yes.  With a Radeon.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.