All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot for Luis R. Rodriguez" <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: bp@suse.de, minipli@googlemail.com, mcgrof@suse.com,
	tomi.valkeinen@ti.com, plagnioj@jcrosoft.com,
	linux-kernel@vger.kernel.org, mingo@kernel.org,
	tglx@linutronix.de, torvalds@linux-foundation.org, hpa@zytor.com,
	peterz@infradead.org
Subject: [tip:x86/mm] drivers/video/fbdev/atyfb: Carve out framebuffer length fudging into a helper
Date: Tue, 21 Jul 2015 02:42:53 -0700	[thread overview]
Message-ID: <tip-eacd2d542610e55cad0be445966ac8ae79124c6e@git.kernel.org> (raw)
In-Reply-To: <1436491499-3289-2-git-send-email-mcgrof@do-not-panic.com>

Commit-ID:  eacd2d542610e55cad0be445966ac8ae79124c6e
Gitweb:     http://git.kernel.org/tip/eacd2d542610e55cad0be445966ac8ae79124c6e
Author:     Luis R. Rodriguez <mcgrof@suse.com>
AuthorDate: Thu, 9 Jul 2015 18:24:56 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 21 Jul 2015 10:47:04 +0200

drivers/video/fbdev/atyfb: Carve out framebuffer length fudging into a helper

The size of the framebuffer to be used needs to be fudged to
account for the different type of devices that are out there.
This captures what is required to do well, we'll reuse this
later.

This has no functional changes.

Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathias Krause <minipli@googlemail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: airlied@redhat.com
Cc: arnd@arndb.de
Cc: benh@kernel.crashing.org
Cc: dan.j.williams@intel.com
Cc: geert@linux-m68k.org
Cc: hch@lst.de
Cc: hmh@hmh.eng.br
Cc: jgross@suse.com
Cc: linux-fbdev@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: luto@amacapital.net
Cc: mpe@ellerman.id.au
Cc: mst@redhat.com
Cc: ralf@linux-mips.org
Cc: ross.zwisler@linux.intel.com
Cc: stefan.bader@canonical.com
Cc: syrjala@sci.fi
Cc: tj@kernel.org
Cc: toshi.kani@hp.com
Cc: ville.syrjala@linux.intel.com
Link: http://lkml.kernel.org/r/1435251019-32421-1-git-send-email-mcgrof@do-not-panic.com
Link: http://lkml.kernel.org/r/1436491499-3289-2-git-send-email-mcgrof@do-not-panic.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 drivers/video/fbdev/aty/atyfb_base.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index 8789e48..16936bb 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -427,6 +427,20 @@ static struct {
 #endif /* CONFIG_FB_ATY_CT */
 };
 
+/*
+ * Last page of 8 MB (4 MB on ISA) aperture is MMIO,
+ * unless the auxiliary register aperture is used.
+ */
+static void aty_fudge_framebuffer_len(struct fb_info *info)
+{
+	struct atyfb_par *par = (struct atyfb_par *) info->par;
+
+	if (!par->aux_start &&
+	    (info->fix.smem_len == 0x800000 ||
+	     (par->bus_type == ISA && info->fix.smem_len == 0x400000)))
+		info->fix.smem_len -= GUI_RESERVE;
+}
+
 static int correct_chipset(struct atyfb_par *par)
 {
 	u8 rev;
@@ -2603,14 +2617,7 @@ static int aty_init(struct fb_info *info)
 	if (par->pll_ops->resume_pll)
 		par->pll_ops->resume_pll(info, &par->pll);
 
-	/*
-	 * Last page of 8 MB (4 MB on ISA) aperture is MMIO,
-	 * unless the auxiliary register aperture is used.
-	 */
-	if (!par->aux_start &&
-	    (info->fix.smem_len == 0x800000 ||
-	     (par->bus_type == ISA && info->fix.smem_len == 0x400000)))
-		info->fix.smem_len -= GUI_RESERVE;
+	aty_fudge_framebuffer_len(info);
 
 	/*
 	 * Disable register access through the linear aperture

  reply	other threads:[~2015-07-21  9:44 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10  1:24 [PATCH v6 0/4] atyfb: atyfb: address MTRR corner case Luis R. Rodriguez
2015-07-10  1:24 ` Luis R. Rodriguez
2015-07-10  1:24 ` Luis R. Rodriguez
2015-07-10  1:24 ` [PATCH v6 1/4] drivers/video/fbdev/atyfb: Carve out framebuffer length fudging into a helper Luis R. Rodriguez
2015-07-10  1:24   ` Luis R. Rodriguez
2015-07-10  1:24   ` Luis R. Rodriguez
2015-07-21  9:42   ` tip-bot for Luis R. Rodriguez [this message]
2015-07-10  1:24 ` [PATCH v6 2/4] drivers/video/fbdev/atyfb: Clarify ioremap() base and length used Luis R. Rodriguez
2015-07-10  1:24   ` Luis R. Rodriguez
2015-07-10  1:24   ` Luis R. Rodriguez
2015-07-21  9:43   ` [tip:x86/mm] " tip-bot for Luis R. Rodriguez
2015-07-10  1:24 ` [PATCH v6 3/4] drivers/video/fbdev/atyfb: Replace MTRR UC hole with strong UC Luis R. Rodriguez
2015-07-10  1:24   ` Luis R. Rodriguez
2015-07-10  1:24   ` Luis R. Rodriguez
2015-07-21  9:43   ` [tip:x86/mm] " tip-bot for Luis R. Rodriguez
2015-07-10  1:24 ` [PATCH v6 4/4] drivers/video/fbdev/atyfb: Use arch_phys_wc_add() and ioremap_wc() Luis R. Rodriguez
2015-07-10  1:24   ` Luis R. Rodriguez
2015-07-10  1:24   ` Luis R. Rodriguez
2015-07-21  9:43   ` [tip:x86/mm] " tip-bot for Luis R. Rodriguez
2015-07-17 20:37 ` [PATCH v6 0/4] atyfb: atyfb: address MTRR corner case Luis R. Rodriguez
2015-07-17 20:37   ` Luis R. Rodriguez
2015-07-17 20:37   ` Luis R. Rodriguez
  -- strict thread matches above, loose matches on Subject: below --
2015-06-25  1:34 [PATCH v5 0/3] " Luis R. Rodriguez
2015-06-25  1:34 ` Luis R. Rodriguez
2015-06-25  1:34 ` [PATCH v5 1/3] video: fbdev: atyfb: clarify ioremap() base and length used Luis R. Rodriguez
2015-06-25  1:34   ` Luis R. Rodriguez
2015-06-25 23:04   ` Ville Syrjälä
2015-06-25 23:04     ` Ville Syrjälä
2015-06-25 23:06     ` Luis R. Rodriguez
2015-06-25 23:06       ` Luis R. Rodriguez
2015-06-25 23:11       ` Ville Syrjälä
2015-06-25 23:11         ` Ville Syrjälä
2015-06-26  1:09         ` Luis R. Rodriguez
2015-06-26  1:09           ` Luis R. Rodriguez
2015-06-26  7:30           ` Borislav Petkov
2015-06-26  7:30             ` Borislav Petkov
2015-07-02 23:23             ` Luis R. Rodriguez
2015-07-02 23:23               ` Luis R. Rodriguez
2015-07-08  0:24               ` Luis R. Rodriguez
2015-07-08  0:24                 ` Luis R. Rodriguez
2015-07-08  8:38                 ` Ville Syrjälä
2015-07-08  8:38                   ` Ville Syrjälä
2015-07-09 17:25                   ` Luis R. Rodriguez
2015-07-09 17:25                     ` Luis R. Rodriguez
2015-06-25  1:34 ` [PATCH v5 2/3] video: fbdev: atyfb: replace MTRR UC hole with strong UC Luis R. Rodriguez
2015-06-25  1:34   ` Luis R. Rodriguez
2015-06-25  1:34 ` [PATCH v5 3/3] video: fbdev: atyfb: use arch_phys_wc_add() and ioremap_wc() Luis R. Rodriguez
2015-06-25  1:34   ` Luis R. Rodriguez
2015-06-25 16:43 ` [PATCH v5 0/3] atyfb: address MTRR corner case Luis R. Rodriguez
2015-06-25 16:43   ` Luis R. Rodriguez
2015-06-25 20:48 ` Borislav Petkov
2015-06-25 20:48   ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-eacd2d542610e55cad0be445966ac8ae79124c6e@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mcgrof@suse.com \
    --cc=mingo@kernel.org \
    --cc=minipli@googlemail.com \
    --cc=peterz@infradead.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=tglx@linutronix.de \
    --cc=tomi.valkeinen@ti.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.