From patchwork Fri Feb 21 13:37:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 3697171 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C13B19F1EE for ; Fri, 21 Feb 2014 13:37:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 448952018A for ; Fri, 21 Feb 2014 13:37:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 096EC20121 for ; Fri, 21 Feb 2014 13:37:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FED6FB50F; Fri, 21 Feb 2014 05:37:14 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-f41.google.com (mail-qg0-f41.google.com [209.85.192.41]) by gabe.freedesktop.org (Postfix) with ESMTP id EA718FB50B for ; Fri, 21 Feb 2014 05:37:11 -0800 (PST) Received: by mail-qg0-f41.google.com with SMTP id i50so7625805qgf.0 for ; Fri, 21 Feb 2014 05:37:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=vdqOuqP3LyWxBX/aT2O3Cuc7LpYD26q/Kf/8/hz9v84=; b=PWUvFTKi6otQF7zVHoWr/077ehJwPBiI8ob4CmrUdOOWkqKVI41Idk1PprtAOsxYY7 0vZY1c535jPeyJ/NJ9SehrxLyoef5PXWlxibfGH2ry0RcdYaCR8Gg7FHD9Y+w7YVvXUA oytqWC7HgPo3xVPJpuxlzAFyYmmp8H06aWdmWz1IbVbz6Rkb7JPP1ix7XO9S8hwFO36W TBcVlhu9sBo09tgJwaq/8I3vUkIMaNrcThKG/JO4eSL2vQYgPU3RCBf0W0abEvG8nCLu kKguPmgsFTCkLJjc/PQMjdVNoVF2lj++AbGH04XAJBO70nkURloAH4hlb6MHlpkfvM/u gLnw== MIME-Version: 1.0 X-Received: by 10.224.160.83 with SMTP id m19mr9690034qax.21.1392989831032; Fri, 21 Feb 2014 05:37:11 -0800 (PST) Received: by 10.140.44.68 with HTTP; Fri, 21 Feb 2014 05:37:10 -0800 (PST) In-Reply-To: References: <5304674C.6060604@pr.hu> <1392803965.770.8.camel@thor.local> <53048DEF.1010003@pr.hu> <1392866428.12428.3.camel@thor.local> <53058E22.1060101@pr.hu> <1392875249.12428.9.camel@thor.local> <5305B263.4080309@pr.hu> <1392949559.12428.46.camel@thor.local> Date: Fri, 21 Feb 2014 08:37:10 -0500 Message-ID: Subject: Re: AMD/AMD hybrid graphics From: Alex Deucher To: Dave Airlie Cc: =?ISO-8859-1?Q?Michel_D=E4nzer?= , Maling list - DRI developers X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Feb 20, 2014 at 9:37 PM, Dave Airlie wrote: > On Fri, Feb 21, 2014 at 12:25 PM, Michel Dänzer 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=, key=, >>> privates=0x169d558) at ../../../include/privates.h:122 >>> #5 0x00000000004810eb in dixGetPrivateAddr (key=, key=, >>> privates=0x169d558) at xf86cmap.c:239 >>> #6 dixSetPrivate (val=, key=0x822f80 , >>> privates=0x169d558) at ../../../include/privates.h:148 >>> #7 xf86HandleColormaps (pScreen=pScreen@entry=0x169d180, maxColors=maxColors@entry=256, >>> sigRGBbits=10, loadPalette=loadPalette@entry=0x7fadbcd37ea0 , >>> 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 , >>> argc=argc@entry=1, argv=argv@entry=0x7fff83c684c8) at dispatch.c:3874 >>> #11 0x000000000047aa9f in InitOutput (pScreenInfo=pScreenInfo@entry=0x82dd60 , >>> 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 From b6aef10258062e2a8ec638b9431a52214b61fdf0 Mon Sep 17 00:00:00 2001 From: Alex Deucher 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 --- 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