diff mbox

AMD/AMD hybrid graphics

Message ID CADnq5_N6x_vt3TSF8Vkg0j9Gj1UQ5W3V96sX9EESOfTmrY+9mQ@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Deucher Feb. 21, 2014, 1:37 p.m. UTC
On Thu, Feb 20, 2014 at 9:37 PM, Dave Airlie <airlied@gmail.com> wrote:
> On Fri, Feb 21, 2014 at 12:25 PM, Michel Dänzer <michel@daenzer.net> wrote:
>> On Don, 2014-02-20 at 08:44 +0100, Boszormenyi Zoltan wrote:
>>> 2014-02-20 06:47 keltezéssel, Michel Dänzer írta:
>>> > On Don, 2014-02-20 at 06:09 +0100, Boszormenyi Zoltan wrote:
>>> >> 2014-02-20 04:20 keltezéssel, Michel Dänzer írta:
>>> >>> On Mit, 2014-02-19 at 11:56 +0100, Boszormenyi Zoltan wrote:
>>> >>>> 2014-02-19 10:59 keltezéssel, Michel Dänzer írta:
>>> >>>>> On Mit, 2014-02-19 at 09:11 +0100, Boszormenyi Zoltan wrote:
>>> >>>>>
>>> >>>>>> Can Mesa/Xorg use both r600g and radeonsi at the same time?
>>> >>>>> Yes, that seems to work fine for others. You may need Mesa 10.1 or newer
>>> >>>>> though.
>>> >>>> Do you mean mean with Mesa 9.2.5 and Xorg server 1.14.4 in
>>> >>>> Fedora 20 at this time, it's not possible unless I compile my own
>>> >>>> llvm-3.5 SVN, Mesa 10.1 or 10.2 GIT and Xorg 1.15 GIT?
>>> >>> I don't think Xorg 1.15 is necessary, but it shouldn't hurt either.
>>> >>>
>>> >>>
>>> >>>> Attached is the log from both 1.14.4 (FC20) and 1.15.0 (rawhide), [...]
>>> >>> The log files end abruptly, so we need to see the X server stderr
>>> >>> output. Assuming you're using gdm, it should be captured
>>> >>> in /var/log/gdm*/:0.log .
>>> >> FC20 has lightdm by default, here's /var/log/lightdm/x-0.log
>>> > [...]
>>> >
>>> >> X: ../../../include/privates.h:122: dixGetPrivateAddr: Assertion
>>> >> `key->initialized' failed.
>>> > Can you get a backtrace for this assertion failure with gdb? See
>>> > http://wiki.x.org/wiki/Development/Documentation/ServerDebugging/
>>
>> [...]
>>
>>> #0  0x00007fadc165f1c9 in __GI_raise (sig=sig@entry=6) at
>>> ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>>> #1  0x00007fadc16608d8 in __GI_abort () at abort.c:89
>>> #2  0x00007fadc1658126 in __assert_fail_base (fmt=0x7fadc17a98a0 "%s%s%s:%u: %s%sAssertion
>>> `%s' failed.\n%n", assertion=assertion@entry=0x5a4c53 "key->initialized",
>>>      file=file@entry=0x5a8dfc "../../../include/privates.h", line=line@entry=122,
>>> function=function@entry=0x5aaa90 <__PRETTY_FUNCTION__.8544> "dixGetPrivateAddr") at
>>> assert.c:92
>>> #3  0x00007fadc16581d2 in __GI___assert_fail (assertion=assertion@entry=0x5a4c53
>>> "key->initialized", file=file@entry=0x5a8dfc "../../../include/privates.h",
>>> line=line@entry=122,
>>>      function=function@entry=0x5aaa90 <__PRETTY_FUNCTION__.8544> "dixGetPrivateAddr") at
>>> assert.c:101
>>> #4  0x0000000000424f70 in dixGetPrivateAddr (key=<optimized out>, key=<optimized out>,
>>> privates=0x169d558) at ../../../include/privates.h:122
>>> #5  0x00000000004810eb in dixGetPrivateAddr (key=<optimized out>, key=<optimized out>,
>>> privates=0x169d558) at xf86cmap.c:239
>>> #6  dixSetPrivate (val=<optimized out>, key=0x822f80 <CMapScreenKeyRec>,
>>> privates=0x169d558) at ../../../include/privates.h:148
>>> #7  xf86HandleColormaps (pScreen=pScreen@entry=0x169d180, maxColors=maxColors@entry=256,
>>> sigRGBbits=10, loadPalette=loadPalette@entry=0x7fadbcd37ea0 <drmmode_load_palette>,
>>>      setOverscan=setOverscan@entry=0x0, flags=flags@entry=3) at xf86cmap.c:184
>>> #8  0x00007fadbcd3b32c in drmmode_setup_colormap (pScreen=pScreen@entry=0x169d180,
>>> pScrn=pScrn@entry=0x169c930) at drmmode_display.c:1990
>>> #9  0x00007fadbcd370ef in RADEONScreenInit_KMS (pScreen=pScreen@entry=0x169d180,
>>> argc=argc@entry=1, argv=argv@entry=0x7fff83c684c8) at radeon_kms.c:1366
>>> #10 0x0000000000438b4d in AddGPUScreen (pfnInit=0x7fadbcd36c60 <RADEONScreenInit_KMS>,
>>> argc=argc@entry=1, argv=argv@entry=0x7fff83c684c8) at dispatch.c:3874
>>> #11 0x000000000047aa9f in InitOutput (pScreenInfo=pScreenInfo@entry=0x82dd60 <screenInfo>,
>>> argc=argc@entry=1, argv=argv@entry=0x7fff83c684c8) at xf86Init.c:886
>>
>> Hmm, looks like there's confusion about how colormaps are supposed to be
>> handled.
>>
>>
>> Dave, any ideas?
>
> xf86_crtc_supports_gamma probably stops us from ever getting into that
> function, but in the case where we have 0 crtcs I could see fallout.
>
> Either fix the DDX to not call colormap handling if we have 0 crtcs
> and/or fix the server to not install bother with colormaps if we have
> 0 crtcs.
>

Does the attached patch help?

Alex

> Dave.
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

Comments

Zoltán Böszörményi Feb. 21, 2014, 2:32 p.m. UTC | #1
2014-02-21 14:37 keltezéssel, Alex Deucher írta:
>
> Does the attached patch help?
>
> Alex

Yes, it helped, thank you very much.
The compressed Xorg.0.log is attached as proof.

To others: the patch is against xf86-video-ati.

Two notes, though:

1. Is it normal that "xrandr --listproviders" lists 3 providers?

[zozo@localhost ~]$ cat xrandr-providers
Providers: number : 3
Provider 0: id: 0x86 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload 
crtcs: 4 outputs: 3 associated providers: 2 name:radeon
Provider 1: id: 0x4f cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload 
crtcs: 0 outputs: 0 associated providers: 2 name:radeon
Provider 2: id: 0x4f cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload 
crtcs: 0 outputs: 0 associated providers: 2 name:radeon

2. I tried glxgears with and without DRI_PRIME=1 as below:

[zozo@localhost ~]$ glxgears
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
299 frames in 5.0 seconds = 59.558 FPS
[zozo@localhost ~]$ DRI_PRIME=1 glxgears
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
5589 frames in 5.0 seconds = 1117.730 FPS
5369 frames in 5.0 seconds = 1073.715 FPS
5699 frames in 5.0 seconds = 1139.670 FPS

Obviously, it doesn't sync to the framerate with PRIME.
On the other hand, nothing is displayed in the glxgears window.
I have llvm 3.4-4 and Mesa 10.1-rc1 from Fedora 21 rawhide.

I will go back to plain Fedora 20 (Xorg 1.14, llvm 3.3 and Mesa 9.2.5)
and try the same patch to see if there's any difference.

Best regards,
Zoltán Böszörményi
Zoltán Böszörményi Feb. 21, 2014, 2:58 p.m. UTC | #2
2014-02-21 15:32 keltezéssel, Boszormenyi Zoltan írta:
> 2014-02-21 14:37 keltezéssel, Alex Deucher írta:
>>
>> Does the attached patch help?
>>
>> Alex
>
> Yes, it helped, thank you very much.
> The compressed Xorg.0.log is attached as proof.
>
> To others: the patch is against xf86-video-ati.
>
> Two notes, though:
>
> 1. Is it normal that "xrandr --listproviders" lists 3 providers?
>
> [zozo@localhost ~]$ cat xrandr-providers
> Providers: number : 3
> Provider 0: id: 0x86 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload 
> crtcs: 4 outputs: 3 associated providers: 2 name:radeon
> Provider 1: id: 0x4f cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload 
> crtcs: 0 outputs: 0 associated providers: 2 name:radeon
> Provider 2: id: 0x4f cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload 
> crtcs: 0 outputs: 0 associated providers: 2 name:radeon
>
> 2. I tried glxgears with and without DRI_PRIME=1 as below:
>
> [zozo@localhost ~]$ glxgears
> Running synchronized to the vertical refresh.  The framerate should be
> approximately the same as the monitor refresh rate.
> 299 frames in 5.0 seconds = 59.558 FPS
> [zozo@localhost ~]$ DRI_PRIME=1 glxgears
> Running synchronized to the vertical refresh.  The framerate should be
> approximately the same as the monitor refresh rate.
> 5589 frames in 5.0 seconds = 1117.730 FPS
> 5369 frames in 5.0 seconds = 1073.715 FPS
> 5699 frames in 5.0 seconds = 1139.670 FPS
>
> Obviously, it doesn't sync to the framerate with PRIME.
> On the other hand, nothing is displayed in the glxgears window.
> I have llvm 3.4-4 and Mesa 10.1-rc1 from Fedora 21 rawhide.
>
> I will go back to plain Fedora 20 (Xorg 1.14, llvm 3.3 and Mesa 9.2.5)
> and try the same patch to see if there's any difference.

With Fedora 20 packages X doesn't come up.
The last message on the screen is:

[ 19.016881] pci_pm_runtime_suspend(): radeon_pmops_runtime_suspend+0x0/0xa0 [radeon] 
return -22

Xorg crashes and Xorg.0.log now contains the backtrace, attached.

Best regards,
Zoltán Böszörményi
Alex Deucher Feb. 21, 2014, 3:12 p.m. UTC | #3
On Fri, Feb 21, 2014 at 9:32 AM, Boszormenyi Zoltan <zboszor@pr.hu> wrote:
> 2014-02-21 14:37 keltezéssel, Alex Deucher írta:
>
>>
>> Does the attached patch help?
>>
>> Alex
>
>
> Yes, it helped, thank you very much.
> The compressed Xorg.0.log is attached as proof.
>
> To others: the patch is against xf86-video-ati.
>
> Two notes, though:
>
> 1. Is it normal that "xrandr --listproviders" lists 3 providers?
>
> [zozo@localhost ~]$ cat xrandr-providers
> Providers: number : 3
> Provider 0: id: 0x86 cap: 0xf, Source Output, Sink Output, Source Offload,
> Sink Offload crtcs: 4 outputs: 3 associated providers: 2 name:radeon
> Provider 1: id: 0x4f cap: 0xf, Source Output, Sink Output, Source Offload,
> Sink Offload crtcs: 0 outputs: 0 associated providers: 2 name:radeon
> Provider 2: id: 0x4f cap: 0xf, Source Output, Sink Output, Source Offload,
> Sink Offload crtcs: 0 outputs: 0 associated providers: 2 name:radeon
>
> 2. I tried glxgears with and without DRI_PRIME=1 as below:
>
> [zozo@localhost ~]$ glxgears
> Running synchronized to the vertical refresh.  The framerate should be
> approximately the same as the monitor refresh rate.
> 299 frames in 5.0 seconds = 59.558 FPS
> [zozo@localhost ~]$ DRI_PRIME=1 glxgears
> Running synchronized to the vertical refresh.  The framerate should be
> approximately the same as the monitor refresh rate.
> 5589 frames in 5.0 seconds = 1117.730 FPS
> 5369 frames in 5.0 seconds = 1073.715 FPS
> 5699 frames in 5.0 seconds = 1139.670 FPS
>
> Obviously, it doesn't sync to the framerate with PRIME.
> On the other hand, nothing is displayed in the glxgears window.
> I have llvm 3.4-4 and Mesa 10.1-rc1 from Fedora 21 rawhide.
>

Make sure you are running a compositor.

Alex
Zoltán Böszörményi Feb. 21, 2014, 7:05 p.m. UTC | #4
2014-02-21 16:12 keltezéssel, Alex Deucher írta:
> On Fri, Feb 21, 2014 at 9:32 AM, Boszormenyi Zoltan <zboszor@pr.hu> wrote:
>> [zozo@localhost ~]$ DRI_PRIME=1 glxgears
>> Running synchronized to the vertical refresh.  The framerate should be
>> approximately the same as the monitor refresh rate.
>> 5589 frames in 5.0 seconds = 1117.730 FPS
>> 5369 frames in 5.0 seconds = 1073.715 FPS
>> 5699 frames in 5.0 seconds = 1139.670 FPS
>>
>> Obviously, it doesn't sync to the framerate with PRIME.
>> On the other hand, nothing is displayed in the glxgears window.
>> I have llvm 3.4-4 and Mesa 10.1-rc1 from Fedora 21 rawhide.
>>
> Make sure you are running a compositor.

Turning on compositing in MATE fixed it. Thank you very much.
It seems I will have to keep Rawhide on this notebook. :-)

Best regards,
Zoltán Böszörményi
diff mbox

Patch

From b6aef10258062e2a8ec638b9431a52214b61fdf0 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
Date: Fri, 21 Feb 2014 08:33:21 -0500
Subject: [PATCH] radeon: don't install colormap handling if there are no crtcs

Fixes a crash on cards with 0 crtcs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 src/drmmode_display.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 76b79d8..641e231 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1939,19 +1939,23 @@  static void drmmode_load_palette(ScrnInfoPtr pScrn, int numColors,
 
 Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
 {
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+
     xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
                   "Initializing kms color map\n");
-    if (!miCreateDefColormap(pScreen))
-        return FALSE;
-    /* all radeons support 10 bit CLUTs */
-    if (!xf86HandleColormaps(pScreen, 256, 10,
-                             drmmode_load_palette, NULL,
-                             CMAP_PALETTED_TRUECOLOR
+    if (xf86_config->num_crtc) {
+	if (!miCreateDefColormap(pScreen))
+	    return FALSE;
+	/* all radeons support 10 bit CLUTs */
+	if (!xf86HandleColormaps(pScreen, 256, 10,
+				 drmmode_load_palette, NULL,
+				 CMAP_PALETTED_TRUECOLOR
 #if 0 /* This option messes up text mode! (eich@suse.de) */
-                             | CMAP_LOAD_EVEN_IF_OFFSCREEN
+				 | CMAP_LOAD_EVEN_IF_OFFSCREEN
 #endif
-                             | CMAP_RELOAD_ON_MODE_SWITCH))
-         return FALSE;
+				 | CMAP_RELOAD_ON_MODE_SWITCH))
+	    return FALSE;
+    }
     return TRUE;
 }
 
-- 
1.8.3.1