From patchwork Sun Nov 24 17:02:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Gnatenko X-Patchwork-Id: 3226861 Return-Path: X-Original-To: patchwork-intel-gfx@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 2E00D9F3A0 for ; Sun, 24 Nov 2013 17:02:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D729203F7 for ; Sun, 24 Nov 2013 17:02:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2B06E20328 for ; Sun, 24 Nov 2013 17:02:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 308F6FAEE2 for ; Sun, 24 Nov 2013 09:02:39 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-la0-f49.google.com (mail-la0-f49.google.com [209.85.215.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 24822FA821 for ; Sun, 24 Nov 2013 09:02:18 -0800 (PST) Received: by mail-la0-f49.google.com with SMTP id er20so2239575lab.22 for ; Sun, 24 Nov 2013 09:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; bh=VIdrusITeWDK21ZCCNIqak3rhzXuCRzQYnI8FLXryT0=; b=YtH5Nf87lq3ZR+CQCBcXELiqubh51Qam5MFlgfIDhD6tpccuJDVrIxraIq8eBBY+4S KcNvSapGCK3DKiyEZZF1HQJEHJg6WxwIdpylY0P8AGNcYLuKmiCBGo2v/FbYZdLQIbmR 237zSXhnie4Ib8ownf2Q0Z/lwZug05duzhm9Niz9ISvO88wqeDAghyZRiuHHwYjGdGwQ FMR8ZpCNhjhlRjr+gd9JcC8+AoECVzvykzpw2muK2ue3LxaBElgLiNJjWGHIedGwK6KV 80G+TEhfKD1W3NJhL2U+f4+kx+aNWm2s7kdEPKGBzr4woGml5o2tf1S5h8pp/ryctiXZ f14w== X-Received: by 10.152.116.7 with SMTP id js7mr19025211lab.11.1385312537859; Sun, 24 Nov 2013 09:02:17 -0800 (PST) Received: from [192.168.254.254] ([176.192.215.17]) by mx.google.com with ESMTPSA id j1sm17984474lbl.10.2013.11.24.09.02.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 24 Nov 2013 09:02:16 -0800 (PST) Message-ID: <1385312534.2501.4.camel@PC.localdomain> From: Igor Gnatenko To: Intel graphics driver community testing & development Date: Sun, 24 Nov 2013 21:02:14 +0400 X-Mailer: Evolution 3.10.2 (3.10.2-1.fc20) Mime-Version: 1.0 Cc: Kirill Rusinov , Axel Davy Subject: [Intel-gfx] [PATCH] xwayland: device isn't even open that explains why drmGetCap X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.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=unavailable 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 From 06c37e84627d0d49985c9e056d3fcf6a78bddd0d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sun, 24 Nov 2013 20:27:24 +0400 Subject: [PATCH] xwayland: device isn't even open that explains why drmGetCap fails and it advertises no Prime capabilities Since d9769c193765ac303ad4d4760e57ff368df1f663 DRI_PRIME=1 works isn't correctly. 1. $ xrandr --listproviders Providers: number : 2 Provider 0: id: 0x7b cap: 0x0 crtcs: 2 outputs: 4 associated providers: 0 name:Intel Provider 1: id: 0x55 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 6 outputs: 0 associated providers: 0 name:radeon 2. $ xrandr --setprovideroffloadsink 0x55 0x7b X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 139 (RANDR) Minor opcode of failed request: 34 () Value in failed request: 0x7b Serial number of failed request: 16 Current serial number in output stream: 17 Reported-and-tested-by: Kirill Rusinov Signed-off-by: Igor Gnatenko Signed-off-by: Axel Davy Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1033903 --- src/uxa/intel_driver.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) scrn->rgbBits = 8; @@ -604,14 +610,13 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags) } intel->drmSubFD = xwl_screen_get_drm_fd(intel->xwl_screen); + + if (!intel->xwl_screen && !intel_open_drm_master(scrn)) + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to become DRM master.\n"); } #endif - if (!intel->xwl_screen && !intel_open_drm_master(scrn)) - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to become DRM master.\n"); - - if (!intel_init_bufmgr(intel)) { PreInitCleanup(scrn); return FALSE; diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c index 1c38075..c5d85c8 100644 --- a/src/uxa/intel_driver.c +++ b/src/uxa/intel_driver.c @@ -549,6 +549,12 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags) intel->PciInfo = xf86GetPciInfoForEntity(intel->pEnt->index); + if (!xorgWayland && (!intel_open_drm_master(scrn))) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to become DRM master.\n"); + return FALSE; + } + scrn->monitor = scrn->confScreen->monitor; scrn->progClock = TRUE;