From patchwork Thu May 9 19:46:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 2546861 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 3C76A3FC5A for ; Thu, 9 May 2013 22:42:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 240B2E63B2 for ; Thu, 9 May 2013 15:42:04 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-da0-f41.google.com (mail-da0-f41.google.com [209.85.210.41]) by gabe.freedesktop.org (Postfix) with ESMTP id C3A9AE5F65 for ; Thu, 9 May 2013 12:47:05 -0700 (PDT) Received: by mail-da0-f41.google.com with SMTP id y19so1785104dan.28 for ; Thu, 09 May 2013 12:47:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references:x-gm-message-state; bh=P+WiS7Kh9+j5XpxoaTF7a0zes56OGCzmbx0ws3c8RZY=; b=W7bXmueLp9heW7XKuGy3SqtdjsVrpJWn3x5+1JZiGUyqf1O/AoTbtOuqrYuqARVo9W ae7T5W/+dgGPkvoCxLodKJI7CgXRzeyOa0sEjhLj/Y3tLKEGzNnKsDAMno/ws29JwBX5 Wk/wrMeopCGNqVF8wSVvViaPGaotXaEBVge7RcKIV0WR/DsoAcynTR/uttD526XXgbRA Wlx4+BVOBv7hbJ7sfZAoMkzEjS49RyeEQhtKebxXJV9hi25ahjMiSCFwuOmdjGxXJq3L WcEGVl3Mn67jFxQ9gB4uKPY2QPVjiA9DzVhQzLU6qcckZIU5KUWcYhE/K0qzmAuE17BI CSpg== X-Received: by 10.66.122.97 with SMTP id lr1mr14365414pab.147.1368128825565; Thu, 09 May 2013 12:47:05 -0700 (PDT) Received: from localhost (50-76-60-73-ip-static.hfc.comcastbusiness.net. [50.76.60.73]) by mx.google.com with ESMTPSA id aj2sm4126693pbc.1.2013.05.09.12.47.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 09 May 2013 12:47:04 -0700 (PDT) From: Andy Lutomirski To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: [RFC/PATCH v2 7/8] uvesafb: Clean up MTRR code Date: Thu, 9 May 2013 12:46:26 -0700 Message-Id: <9b38320eba51f38d4d646438399313f7932d3a04.1368128020.git.luto@amacapital.net> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQmE4+ETJ6iOfaa/TvbWIW1d7CL/K9m832OhqEdzpz94EcZ7N7riuHw12ZlqyAakHOnd0R/x X-Mailman-Approved-At: Thu, 09 May 2013 15:36:02 -0700 Cc: Daniel Vetter , Andy Lutomirski , Michal Januszewski 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+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org The old code allowed very strange memory types. Now it works like all the other video drivers: ioremap_wc is used unconditionally, and MTRRs are set if PAT is unavailable (unless MTRR is disabled by a module parameter). UC, WB, and WT support is gone. If there are MTRR conflicts that prevent addition of a WC MTRR, adding a non-conflicting MTRR is pointless; it's better to just turn off MTRR support entirely. As an added bonus, any MTRR added is freed on unload. Signed-off-by: Andy Lutomirski --- Documentation/fb/uvesafb.txt | 16 ++++------ drivers/video/uvesafb.c | 70 +++++++++++--------------------------------- include/video/uvesafb.h | 1 + 3 files changed, 23 insertions(+), 64 deletions(-) diff --git a/Documentation/fb/uvesafb.txt b/Documentation/fb/uvesafb.txt index eefdd91..f6362d8 100644 --- a/Documentation/fb/uvesafb.txt +++ b/Documentation/fb/uvesafb.txt @@ -81,17 +81,11 @@ pmipal Use the protected mode interface for palette changes. mtrr:n Setup memory type range registers for the framebuffer where n: - 0 - disabled (equivalent to nomtrr) (default) - 1 - uncachable - 2 - write-back - 3 - write-combining - 4 - write-through - - If you see the following in dmesg, choose the type that matches - the old one. In this example, use "mtrr:2". -... -mtrr: type mismatch for e0000000,8000000 old: write-back new: write-combining -... + 0 - disabled (equivalent to nomtrr) + 3 - write-combining (default) + + Values other than 0 and 3 will result in a warning and will be + treated just like 3. nomtrr Do not use memory type range registers. diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index d428445..8701f96 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -24,9 +24,6 @@ #ifdef CONFIG_X86 #include