From patchwork Tue Dec 17 17:12:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 3362961 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 8C6B09F384 for ; Tue, 17 Dec 2013 17:12:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA51D20394 for ; Tue, 17 Dec 2013 17:12:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8158720382 for ; Tue, 17 Dec 2013 17:12:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 422FEFCD8D; Tue, 17 Dec 2013 09:12:18 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id 993E7FCD8D; Tue, 17 Dec 2013 09:12:16 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id 5EF571488006; Tue, 17 Dec 2013 09:12:16 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from keithp.com ([127.0.0.1]) by localhost (keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZmUp7ERuH0uu; Tue, 17 Dec 2013 09:12:13 -0800 (PST) Received: by keithp.com (Postfix, from userid 1033) id 7D7451488005; Tue, 17 Dec 2013 09:12:13 -0800 (PST) Received: from miki.keithp.com (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id 54D6314A801C; Tue, 17 Dec 2013 09:12:13 -0800 (PST) Received: by miki.keithp.com (Postfix, from userid 1001) id E6096B00; Tue, 17 Dec 2013 09:12:12 -0800 (PST) From: Keith Packard To: intel-gfx@lists.freedesktop.org, Daniel Vetter Subject: [PATCH] drm/intel: Only smash VGA SR01 register if intel is default VGA device Date: Tue, 17 Dec 2013 09:12:10 -0800 Message-Id: <1387300330-8844-1-git-send-email-keithp@keithp.com> X-Mailer: git-send-email 1.8.5.1 Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org 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: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 We want to disable the (unused) VGA plane on the intel hardware, which should be a simple matter of writing the vga control register. However, in 2009 (commit 24f119c769bacac5729297b682fec7811a983cc6), that simple code was changed to also smash the SR01 VGA register to fix "random crash and lockups". When running efifb on an nVidia card, executing this store to SR01 ends up causing the screen to go black. I'm not sure if this store is still required; this patch limits it to when the intel card is primary. Signed-off-by: Keith Packard --- drivers/gpu/drm/i915/intel_display.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index c714d4d..545b271 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9038,12 +9038,14 @@ static void i915_disable_vga(struct drm_device *dev) u8 sr1; u32 vga_reg = i915_vgacntrl_reg(dev); - vga_get_uninterruptible(dev->pdev, VGA_RSRC_LEGACY_IO); - outb(SR01, VGA_SR_INDEX); - sr1 = inb(VGA_SR_DATA); - outb(sr1 | 1<<5, VGA_SR_DATA); - vga_put(dev->pdev, VGA_RSRC_LEGACY_IO); - udelay(300); + if (dev->pdev == vga_default_device()) { + vga_get_uninterruptible(dev->pdev, VGA_RSRC_LEGACY_IO); + outb(SR01, VGA_SR_INDEX); + sr1 = inb(VGA_SR_DATA); + outb(sr1 | 1<<5, VGA_SR_DATA); + vga_put(dev->pdev, VGA_RSRC_LEGACY_IO); + udelay(300); + } I915_WRITE(vga_reg, VGA_DISP_DISABLE); POSTING_READ(vga_reg);