Bug 102643 - xf86-video-ati 7.10.0 with EXA acceleration GDM corruption unable to log into GNOME session
Summary: xf86-video-ati 7.10.0 with EXA acceleration GDM corruption unable to log into...
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/Radeon (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: xf86-video-ati maintainers
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-10 07:02 UTC by lei.pero
Modified: 2017-11-24 16:28 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
7.9_dmesg (251.01 KB, text/plain)
2017-09-11 02:50 UTC, lei.pero
no flags Details
7.9_Xorg (29.50 KB, text/plain)
2017-09-11 02:51 UTC, lei.pero
no flags Details
7.10_dmesg (280.23 KB, text/plain)
2017-09-11 02:51 UTC, lei.pero
no flags Details
7.10_Xorg (29.50 KB, text/plain)
2017-09-11 02:51 UTC, lei.pero
no flags Details
GDM corruption (1.68 MB, image/jpeg)
2017-09-11 02:52 UTC, lei.pero
no flags Details
Glitches on Cinnamon desktop (7.59 MB, video/mp4)
2017-09-15 16:22 UTC, pgkos
no flags Details

Description lei.pero 2017-09-10 07:02:33 UTC
With xf86-video-ati 7.10.0 and EXA acceleration enabled, GDM gets corrupted/unreadable typing password and pressing enter results in black screen with mouse pointer drawn, using alt+f2 brings back GDM with proper rendering, and then it does log in to Gnome-Shell (it does mess up resolution but that's because non-recommended/native resolution is used).

Using default value with glamor acceleration works as expected, this doesn't happen on 7.9.0-2 (both stable packages from Arch repository).

Reverting package or using glamor solves the problem (HD6770 GPU).
Comment 1 Michel Dänzer 2017-09-11 01:06:17 UTC
Please attach the corresponding Xorg log file and dmesg output.

Can you bisect between 7.9.0 and 7.10.0?
Comment 2 lei.pero 2017-09-11 02:49:48 UTC
(In reply to Michel Dänzer from comment #1)
> Please attach the corresponding Xorg log file and dmesg output.
> 
> Can you bisect between 7.9.0 and 7.10.0?

Sure, I'll addd picture (terrible quality but it will serve the purpose). I'm not sure what you mean by bisect?
Comment 3 lei.pero 2017-09-11 02:50:39 UTC
Created attachment 134140 [details]
7.9_dmesg
Comment 4 lei.pero 2017-09-11 02:51:01 UTC
Created attachment 134141 [details]
7.9_Xorg
Comment 5 lei.pero 2017-09-11 02:51:22 UTC
Created attachment 134142 [details]
7.10_dmesg
Comment 6 lei.pero 2017-09-11 02:51:37 UTC
Created attachment 134143 [details]
7.10_Xorg
Comment 7 lei.pero 2017-09-11 02:52:02 UTC
Created attachment 134144 [details]
GDM corruption
Comment 8 Michel Dänzer 2017-09-11 02:59:32 UTC
(In reply to lei.pero from comment #2)
> I'm not sure what you mean by bisect?

Search the web for something like "git bisect howto".
Comment 9 lei.pero 2017-09-11 03:14:02 UTC
(In reply to Michel Dänzer from comment #8)
> (In reply to lei.pero from comment #2)
> > I'm not sure what you mean by bisect?
> 
> Search the web for something like "git bisect howto".

Ok, will do asap, thanks.
Comment 10 lei.pero 2017-09-11 07:41:22 UTC
This is the commit where problem started happening:

https://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=55e513b978b2afc52b7cafc5bfcb0d1dc78d75f6

7.9.0.r7

With ckeckout at the one below, everything works fine:
https://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=944391b0052466b71bf9919b56139dc197a7e072

7.9.0.r6

Hope this helps, lot's of changes there.
Comment 11 loup001 2017-09-14 01:47:05 UTC
(In reply to lei.pero from comment #0)
> With xf86-video-ati 7.10.0 and EXA acceleration enabled, GDM gets
> corrupted/unreadable typing password and pressing enter results in black
> screen with mouse pointer drawn, using alt+f2 brings back GDM with proper
> rendering, and then it does log in to Gnome-Shell (it does mess up
> resolution but that's because non-recommended/native resolution is used).
> 
> Using default value with glamor acceleration works as expected, this doesn't
> happen on 7.9.0-2 (both stable packages from Arch repository).
> 
> Reverting package or using glamor solves the problem (HD6770 GPU).

I add a similar problem too.
Using sddm with xfce4.
Login agent 'sddm' with same symptoms as yours.
I fixed it by :
A downgraded xf86-video-ati to previous version,
Adjusted screen set-up to xorg default ( change from 1600x1200 @75hz to 60hz which is the default set-up for all distro on that machine)
Removed all config in radeon at /etc/X11/xorg.conf.d/10-radeon.conf
Reboot @ upgrade xf86-video-ati to 7.10
Upgraded successfully !
Customized radeon with previous set-up

Hope this work for you if you try !
Comment 12 lei.pero 2017-09-14 05:48:31 UTC
(In reply to loup001 from comment #11)
> 
> I add a similar problem too.
> Using sddm with xfce4.
> Login agent 'sddm' with same symptoms as yours.
> I fixed it by :
> A downgraded xf86-video-ati to previous version,
> Adjusted screen set-up to xorg default ( change from 1600x1200 @75hz to 60hz
> which is the default set-up for all distro on that machine)
> Removed all config in radeon at /etc/X11/xorg.conf.d/10-radeon.conf
> Reboot @ upgrade xf86-video-ati to 7.10
> Upgraded successfully !
> Customized radeon with previous set-up
> 
> Hope this work for you if you try !

Nope, that doesn't work in my case, and I don't see the reason why it should work, but thanks. I've solved my problem partially, got acceptable solution, simply using glamor, but forcing Option "DRI" "2". That was how I used it 1 year ago or so, but did found out that EXA works better for my use case.

Still, bug should be reported, I've tried all pageflip related options in Xorg configuration, same thing, from what I've seen in the code of the mentioned patch, it seems that removing:

-extern Bool
-radeon_get_pixmap_handle(PixmapPtr pixmap, uint32_t *handle);

from radeon_bo_helper.h togheter with the rest of the code broke things, I've tried to rever those changes but got compilation errors,a nd since I'm not programmer and not familiar with structure I assume other commits latter might relate to this one, so it would be hard for me to find what is the problem.

It could be that added lines in exa file did something, I will try to find it again, probably today.
Comment 13 lei.pero 2017-09-14 15:25:23 UTC
This is related to this problem, also resolution line from grub is not respected when corruption happens, if everything is applied from commit 	55e513b978b2afc52b7cafc5bfcb0d1dc78d75f6 except radeon.h resolutin stays properly recognized, but black only black screen is drawn, going to tty2 does show text, and after some waiting it is possible to type login and revert changes (packages or xorg configuration).

If it is used as patch (radeon.h.patch) and aplied to the half, same thing happens, black screen = resolution respected, under EXA ofc. With everything included (from below) it gets corrupted:

@@ -790,6 +797,72 @@ static inline Bool radeon_get_pixmap_shared(PixmapPtr pPix)
     return FALSE;
 }
 
+static inline struct drmmode_fb*
+radeon_fb_create(int drm_fd, uint32_t width, uint32_t height, uint8_t depth,
+		 uint8_t bpp, uint32_t pitch, uint32_t handle)
+{
Comment 14 pgkos 2017-09-15 16:22:44 UTC
Created attachment 134260 [details]
Glitches on Cinnamon desktop

I can confirm that the same problem occurs on ATI Mobility Radeon X1600.

It is very noticeable on Cinnamon desktop (see the attached video - lots of black flashing glitches, which can be triggered by just clicking the mouse on the desktop).

I did git bisect and the first bad commit is https://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=55e513b978b2afc52b7cafc5bfcb0d1dc78d75f6
(Use reference counting for tracking KMS framebuffer lifetimes) - same as in the previous comment.
Comment 15 Michel Dänzer 2017-10-19 17:00:16 UTC
I finally got a chance to reproduce and look into this. https://patchwork.freedesktop.org/patch/183771/ fixes it for me.
Comment 16 lei.pero 2017-10-19 18:29:28 UTC
(In reply to Michel Dänzer from comment #15)
> I finally got a chance to reproduce and look into this.
> https://patchwork.freedesktop.org/patch/183771/ fixes it for me.

This solves the problem, I've patched 7.10.0 version and it works fine with EXA acceleration and it detects resolutions properly, can be marked as solved as far as I'm concerned, thanks.
Comment 17 lei.pero 2017-10-20 12:25:03 UTC
I've marked it as resolved, if it doesn't work for some of affected please add it.
Comment 18 Michel Dänzer 2017-10-20 14:19:52 UTC
Thanks for the report and testing the fix, but please only resolve bug reports once the fix has landed in Git.

Anyway, that's the case now:

commit b93ae9b159790e8a979e9d5d567a0e6fccd7d08a
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Oct 19 18:57:45 2017 +0200

    Unreference pixmap's FB with EXA as well in radeon_set_pixmap_bo
Comment 19 lei.pero 2017-10-20 19:23:19 UTC
(In reply to Michel Dänzer from comment #18)
> Thanks for the report and testing the fix, but please only resolve bug
> reports once the fix has landed in Git.
> 
> Anyway, that's the case now:
> 
> commit b93ae9b159790e8a979e9d5d567a0e6fccd7d08a
> Author: Michel Dänzer <michel.daenzer@amd.com>
> Date:   Thu Oct 19 18:57:45 2017 +0200
> 
>     Unreference pixmap's FB with EXA as well in radeon_set_pixmap_bo

No problem, sorry, I know now for the future. I was waiting for others to confirm, but yeah, my bad.
Comment 20 Joakim Tjernlund 2017-11-24 12:02:53 UTC
(In reply to Michel Dänzer from comment #18)
> Thanks for the report and testing the fix, but please only resolve bug
> reports once the fix has landed in Git.
> 
> Anyway, that's the case now:
> 
> commit b93ae9b159790e8a979e9d5d567a0e6fccd7d08a
> Author: Michel Dänzer <michel.daenzer@amd.com>
> Date:   Thu Oct 19 18:57:45 2017 +0200
> 
>     Unreference pixmap's FB with EXA as well in radeon_set_pixmap_bo

This commit breaks builds without GLAMOUR:

In file included from /var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/src/radeon.h:84:0,
                 from /var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/src/r600_textured_videofuncs.c:35:
/var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/src/radeon.h: In function ‘radeon_set_pixmap_bo’:
/var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/src/radeon.h:772:38: error: ‘struct radeon_exa_pixmap_priv’ has no member named ‘fd’
      drmmode_fb_reference(driver_priv->fd, &driver_priv->fb, NULL);
                                      ^
/var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/src/drmmode_display.h:192:30: note: in definition of macro ‘drmmode_fb_reference’
     drmmode_fb_reference_loc(fd, old, new, __func__, __LINE__)
Comment 21 Joakim Tjernlund 2017-11-24 12:05:10 UTC
(In reply to Joakim Tjernlund from comment #20)
> (In reply to Michel Dänzer from comment #18)
> > Thanks for the report and testing the fix, but please only resolve bug
> > reports once the fix has landed in Git.
> > 
> > Anyway, that's the case now:
> > 
> > commit b93ae9b159790e8a979e9d5d567a0e6fccd7d08a
> > Author: Michel Dänzer <michel.daenzer@amd.com>
> > Date:   Thu Oct 19 18:57:45 2017 +0200
> > 
> >     Unreference pixmap's FB with EXA as well in radeon_set_pixmap_bo
> 
> This commit breaks builds without GLAMOUR:
> 
> In file included from
> /var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/
> src/radeon.h:84:0,
>                  from
> /var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/
> src/r600_textured_videofuncs.c:35:
> /var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/
> src/radeon.h: In function ‘radeon_set_pixmap_bo’:
> /var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/
> src/radeon.h:772:38: error: ‘struct radeon_exa_pixmap_priv’ has no member
> named ‘fd’
>       drmmode_fb_reference(driver_priv->fd, &driver_priv->fb, NULL);
>                                       ^
> /var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/
> src/drmmode_display.h:192:30: note: in definition of macro
> ‘drmmode_fb_reference’
>      drmmode_fb_reference_loc(fd, old, new, __func__, __LINE__)

Sorry wrong code, should be:
In file included from /var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/src/radeon.h:84:0,
                 from /var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/src/radeon_video.c:11:
/var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/src/radeon.h: In function ‘radeon_set_pixmap_bo’:
/var/tmp/portage/x11-drivers/xf86-video-ati-9999/work/xf86-video-ati-9999/src/radeon.h:772:27: error: ‘pRADEONEnt’ undeclared (first use in this function)
      drmmode_fb_reference(pRADEONEnt->fd, &driver_priv->fb, NULL);
Comment 22 Joakim Tjernlund 2017-11-24 12:11:05 UTC
Just moving:
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -712,9 +712,9 @@ uint32_t radeon_get_pixmap_tiling(PixmapPtr pPix);
 
 static inline Bool radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo)
 {
-#ifdef USE_GLAMOR
     ScrnInfoPtr scrn = xf86ScreenToScrn(pPix->drawable.pScreen);
     RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);
+#ifdef USE_GLAMOR
     RADEONInfoPtr info = RADEONPTR(scrn);
 
     if (info->use_glamor) {

makes it build but no idea if it runs
Comment 23 Michel Dänzer 2017-11-24 14:57:54 UTC
(In reply to Joakim Tjernlund from comment #22)
> makes it build but no idea if it runs

Looks good, can you send a patch generated with git format-patch (including your Signed-off-by line) to the amd-gfx mailing list?
Comment 24 Joakim Tjernlund 2017-11-24 16:28:21 UTC
(In reply to Michel Dänzer from comment #23)
> (In reply to Joakim Tjernlund from comment #22)
> > makes it build but no idea if it runs
> 
> Looks good, can you send a patch generated with git format-patch (including
> your Signed-off-by line) to the amd-gfx mailing list?

Done, pasting patch here as well:

From a254b97bc25733cb025ae4014512dbd80d101301 Mon Sep 17 00:00:00 2001
From: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Date: Fri, 24 Nov 2017 17:22:16 +0100
Subject: [PATCH] xf86-video-ati: Fix non GLAMOR build

Non GLAMOR builds needs pRADEONEnt so move the USE_GLAMOR define
down to make pRADEONEnt defined in this case.

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
---
 src/radeon.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/radeon.h b/src/radeon.h
index d54e4990..3e04101c 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -712,9 +712,9 @@ uint32_t radeon_get_pixmap_tiling(PixmapPtr pPix);
 
 static inline Bool radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo)
 {
-#ifdef USE_GLAMOR
     ScrnInfoPtr scrn = xf86ScreenToScrn(pPix->drawable.pScreen);
     RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);
+#ifdef USE_GLAMOR
     RADEONInfoPtr info = RADEONPTR(scrn);
 
     if (info->use_glamor) {
-- 
2.13.6


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.