Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2573875imu; Thu, 29 Nov 2018 07:06:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/UrkPKLKqq1KwnePrjU3FVyBdK6zirZ5uROm1bkzkNCEBO+iFb8BsD9oN9tsuh50v0XdHCc X-Received: by 2002:a17:902:b03:: with SMTP id 3mr1789467plq.91.1543503973459; Thu, 29 Nov 2018 07:06:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543503973; cv=none; d=google.com; s=arc-20160816; b=NtMa3FLmqEZWPwCbTsmvtrIIUA9aUwNd2zBGHW5lJU/NO/IvN4RWGU2vgURHOkotKk JsXlCiQTBUi+HIC4rxG9Q90P4XDqpooLGCsNZ25oB66iTAeBiuMrh7IfBivB0g6aNqVl VgqwFWQr9JcwiOUwuohGc6ISvJWhdqTQYZGsOqGA70Xvq8x3CpNjeU4i3E8CGD9/X8+R LqhFDqr8PcVNTCF6tGb6p9WSW/dT3S2kpLNH5NqGLIefv9p5+BuTXtGQ3IDdz5mzF4iF f12KIA5ccFN7LpPh9bnn1Kd1FU3Xd4MvipgzUCM4K/MOgbWPGLbmag3cYc9//yu3dSW4 WXSw== 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=1ZOxKC3s59lo1191LgmKwgnJL1iIU13k8kDkp7EAX0Y=; b=EZiHSh46QXy/mFf3m3Dc++lICurJ7bjWU+cphjdarEHfyicXOi+0iB9+vo5WS3dN2S XsXrAxRGGJGyR8RU9+3J815V8gkB28z8T3ayX+fEM2uO18PP4/0htBQMOb62CI78EQrw 1/L2mJdsai7O46ZNTD5IsL2G/mIvfy4c2MDtCK2IpQVwdiJrN6azP/uXZe7OEdwzzdfP Or30ZDcONXWUPS/sleRU8sTYl6AiWuVnAj7LLKt82dLBCWZnklkgnxgSX/qj9llMC+iW kImb3V9kLZS0ZI7y9oeuLqH1bu2DZwS5hcmlSZj7JWCktykfw9pgMx14FmZF1kXzAyUn UDNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dYtmsA0p; 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 f18si2123639pgl.457.2018.11.29.07.05.58; Thu, 29 Nov 2018 07:06:13 -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=dYtmsA0p; 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 S1730059AbeK3BWE (ORCPT + 99 others); Thu, 29 Nov 2018 20:22:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:43626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728561AbeK3BWD (ORCPT ); Thu, 29 Nov 2018 20:22:03 -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 DEDBA2133F; Thu, 29 Nov 2018 14:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543500993; bh=6dCJOc7dQ7v4TebUD5HV780h1QbnRihcI4F4F6TMYEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dYtmsA0p1+E27dhb4jNjGqOMeyCU9BNKNr617BYOO78Ox7K7yuQFO/GzKQL8HpjZg T9BsSQvJJhLH0capZ/IxfDC+A6UsUhDwNN64q0WKZhmeI9tmnSp7FASPwRP1V+G7GV /tbceMlCIb4pIqj/LjpVWque5nCbOIputc4bchlo= 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 3.18 83/83] drm/ast: Remove existing framebuffers before loading driver Date: Thu, 29 Nov 2018 15:12:41 +0100 Message-Id: <20181129140142.765731691@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140138.002176596@linuxfoundation.org> References: <20181129140138.002176596@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 3.18-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 + 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); }