Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2527841imu; Thu, 29 Nov 2018 06:26:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vuo6Ucb9gG92yT+laqnL9k3UTZPYUhinllp0eHrI2hmXnILm+QTiZDKjjnGkyvU6RVz9ge X-Received: by 2002:a62:d885:: with SMTP id e127mr1565325pfg.197.1543501596569; Thu, 29 Nov 2018 06:26:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501596; cv=none; d=google.com; s=arc-20160816; b=uqhKTH/pX5qOsKpuF3HS0iffMN9ctSDtV/9axcK9KpH+HvrytslXUobyquyc7rphPJ t6WbOj+vHSb50yhxH9j6aoi1n3viR60nvyYJkLVZQVaLSdZvD4nVQa/rmMJmiPskCSCE bdyz6+zXD1NGNIOtlBVq51he2XeqlQb1+ePIyEgiYmeRtDMM1dje0OAceQsMx9ejfhN8 /WIKnWXCjoXeh/cc7MWrjKsrx3ELRhBkLcP/uxBtuqkJGIp6Dihg3AOQsXd392x9VTYx D4kNvY/yi00smLiOPr2CvgoIE3GcRmCzKdKE0nXaXM1TGtFhpSbL98nJaWWkYNVLuoUQ lLcg== 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=AvwAa0A9eDPaiiQ08fdu3QaXwsFmUbX7i4NinKspyRY=; b=W3oM5Jh8m8epXkI3KrW2F9G8di8UbJNvDNPZw82otCbq1V5PJtN0keZat7/K+MTxEi 69+M6C30+7dbrr5gdEkCTeRGBTqtKnhllSKsLWALgAo2kulP4nZ2A0DbTQ4fBv3bWQpV E//GfHgY07ljUIr/X+piOocf4m2MAHggmRDtyTuh+X8pttWEndlqRqpVxiw7tzXnZ2B6 pysYlHohQCFRwbM9es5zw3rt+bwXqpLz9Z0/Dv53xe1DiYhAB3X9iXGYhpV82q8BLQzk JdZ9fyDc5JCE25x9wH/EAAwlqg383VVASHjjirBzyx+RKAy9N8OWVlp1bzxNmT2ivWGz B9Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qVE3MC2h; 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 j61si2255467plb.232.2018.11.29.06.26.21; Thu, 29 Nov 2018 06:26:36 -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=qVE3MC2h; 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 S1733015AbeK3BbD (ORCPT + 99 others); Thu, 29 Nov 2018 20:31:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:58402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733006AbeK3BbC (ORCPT ); Thu, 29 Nov 2018 20:31:02 -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 185C221104; Thu, 29 Nov 2018 14:25:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501530; bh=KDVFzHBcv3E185h7ZQ1spo93gxbixLbGZJLpieRtn/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qVE3MC2hikbr/wClxxxvqgwxOXXtGyrapWC7jjuXf9YG1FtuJzCettRPq/IsMXSRY kKVsiOggFAf9uGR1CBfFmocUkWJAQenEW15sn4yGhTyt83217PY56lN6ypg5hSvFU0 9yAmTHWUJ+ntaOira1U7b9ENYbB9P2tJRW/lRjAg= 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.14 035/100] drm/ast: Remove existing framebuffers before loading driver Date: Thu, 29 Nov 2018 15:12:05 +0100 Message-Id: <20181129140101.884849953@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140058.768942700@linuxfoundation.org> References: <20181129140058.768942700@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.14-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); }