Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2564054imu; Thu, 29 Nov 2018 06:59:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/ULrtppsPg9vVgfSjm5tnCPMa43AR9iP3qWswAw55EeXqWMvmHIoeflzvSqL9ckqxE5rFkR X-Received: by 2002:a62:3a04:: with SMTP id h4mr1665021pfa.119.1543503554969; Thu, 29 Nov 2018 06:59:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543503554; cv=none; d=google.com; s=arc-20160816; b=hVaOzF1vLhS2m3nE+B+DW3VeB8OjquQB2mzN1w/btK9xBCsT/xKoIzYfHnbqOEzv9h pDPODDpIG7EhfNrzzACwTwGa23wJk4wsBHsEKGTlYMSjs6bYaBbOx7jV0tbrsSxILOXo DLtMGX91Tnfq4cfkKkac4JLNoDD7kbcV6aCCOPzrQJXECGbJeRjdldoalPNsAjyLZ/xK PzBYOYUDfOriIyk1tRC9vbPz8yQ18KH2ekjHlx3b1K1v0WUW91ZmE/jSd+AQdAtxeMlI /xMfk0qPNgfB/zQkTLYGDfczPVEThjU2CosiuXhxoY2Fm4ARVSrnmXT+zQk6esrPYaiz 6kUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6xgD3X5aUJ5gN5IGMKqdwsxXq6eeRQRXxog85Sh70z0=; b=gCZBRSvWnVYAx56IIsrtwGY2UGdYhI0sE33C1selJo3L5wmfm5SC9NgQ6dpc/LViPd +lBwkoPQBxMjw4HQ2dJ/a5LP0UU4dbogiwMbBIRjnMtlghGYSEAKrBt5qrPA1r73R2T9 wr/FkuozUb7fwf9YIqwoCV4mdVKYymVzuu0h/HJ6NL2kxm9/dcbqVcf/h0mXMQ8ceR4f EbGfA9clweoqK654q8xP4nKgv3os7GlDHQMc8/5fmLL63LwhiBLVl7cN+gzQnmMKqc4O E94dj15WK6YrsGIXkOUFJX4Ws22XmFBV3plW0i0IcfiSeN/fsR0fu+2CNOvb+p9BUNH6 hSQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NhvNmaVH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n12si2171437pgb.563.2018.11.29.06.58.55; Thu, 29 Nov 2018 06:59:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NhvNmaVH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731522AbeK3B0e (ORCPT + 99 others); Thu, 29 Nov 2018 20:26:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:50628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728678AbeK3B0d (ORCPT ); Thu, 29 Nov 2018 20:26:33 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0838E20868; Thu, 29 Nov 2018 14:21:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501262; bh=8jZ5seR/KtPhWBkvEKJiShN8Bjtn5S/h3O1f/MELzEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NhvNmaVHoU4ccFc4LFP/COG4ZErOz7UhABX1aXmiz8p35OMq75aDy+G1Hfcr4HUoy frW1iNsxY281aubwR3ahSReEvPRNRR9f5Vbyfo5G4Z+TeePMsYLy042uCffijO4ySp Cq37q3gYwltE8c+O9cUf7t+QqIFQFUCgfChOFIsM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Zimmermann , "Y.C. Chen" , Jean Delvare , Dave Airlie Subject: [PATCH 4.9 19/92] drm/ast: Remove existing framebuffers before loading driver Date: Thu, 29 Nov 2018 15:11:48 +0100 Message-Id: <20181129140107.929434946@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140106.520639693@linuxfoundation.org> References: <20181129140106.520639693@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Zimmermann commit 5478ad10e7850ce3d8b7056db05ddfa3c9ddad9a upstream. If vesafb attaches to the AST device, it configures the framebuffer memory for uncached access by default. When ast.ko later tries to attach itself to the device, it wants to use write-combining on the framebuffer memory, but vesefb's existing configuration for uncached access takes precedence. This results in reduced performance. Removing the framebuffer's configuration before loding the AST driver fixes the problem. Other DRM drivers already contain equivalent code. Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1112963 Signed-off-by: Thomas Zimmermann Cc: Tested-by: Y.C. Chen Reviewed-by: Jean Delvare Tested-by: Jean Delvare Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/ast/ast_drv.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) --- a/drivers/gpu/drm/ast/ast_drv.c +++ b/drivers/gpu/drm/ast/ast_drv.c @@ -60,8 +60,29 @@ static const struct pci_device_id pciidl MODULE_DEVICE_TABLE(pci, pciidlist); +static void ast_kick_out_firmware_fb(struct pci_dev *pdev) +{ + struct apertures_struct *ap; + bool primary = false; + + ap = alloc_apertures(1); + if (!ap) + return; + + ap->ranges[0].base = pci_resource_start(pdev, 0); + ap->ranges[0].size = pci_resource_len(pdev, 0); + +#ifdef CONFIG_X86 + primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; +#endif + drm_fb_helper_remove_conflicting_framebuffers(ap, "astdrmfb", primary); + kfree(ap); +} + static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { + ast_kick_out_firmware_fb(pdev); + return drm_get_pci_dev(pdev, ent, &driver); }