[tip:x86/mm] drivers/video/fbdev/atyfb: Clarify ioremap() base and length used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

drivers/video/fbdev/atyfb: Clarify ioremap() base and length used

Adjust the ioremap() call for the framebuffer to use the same
values we later use for the framebuffer. This will make it
easier to review the next change.

The size of the framebuffer varies but since this is for PCI we
*know* this defaults to 0x800000. atyfb_setup_generic() is
*only* used on PCI probe.

No functional change.

Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxx>
Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Andrzej Hajda <a.hajda@xxxxxxxxxxx>
Cc: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
Cc: Antonino Daplas <adaplas@xxxxxxxxx>
Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
Cc: Dave Airlie <airlied@xxxxxxxxxx>
Cc: Davidlohr Bueso <dbueso@xxxxxxx>
Cc: H. Peter Anvin <hpa@xxxxxxxxx>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@xxxxxxxxxxxx>
Cc: Juergen Gross <jgross@xxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Mathias Krause <minipli@xxxxxxxxxxxxxx>
Cc: Mel Gorman <mgorman@xxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Rob Clark <robdclark@xxxxxxxxx>
Cc: Suresh Siddha <sbsiddha@xxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Tomi Valkeinen <tomi.valkeinen@xxxxxx>
Cc: Toshi Kani <toshi.kani@xxxxxx>
Cc: Ville Syrjälä <syrjala@xxxxxx>
Cc: Vlastimil Babka <vbabka@xxxxxxx>
Cc: arnd@xxxxxxxx
Cc: benh@xxxxxxxxxxxxxxxxxxx
Cc: dan.j.williams@xxxxxxxxx
Cc: geert@xxxxxxxxxxxxxx
Cc: hch@xxxxxx
Cc: hmh@xxxxxxxxxx
Cc: linux-fbdev@xxxxxxxxxxxxxxx
Cc: linux-mm@xxxxxxxxx
Cc: linux-pci@xxxxxxxxxxxxxxx
Cc: mpe@xxxxxxxxxxxxxx
Cc: mst@xxxxxxxxxx
Cc: ralf@xxxxxxxxxxxxxx
Cc: ross.zwisler@xxxxxxxxxxxxxxx
Cc: stefan.bader@xxxxxxxxxxxxx
Cc: tj@xxxxxxxxxx
Cc: ville.syrjala@xxxxxxxxxxxxxxx
Link: http://lkml.kernel.org/r/1436491499-3289-3-git-send-email-mcgrof@xxxxxxxxxxxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
 drivers/video/fbdev/aty/atyfb_base.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index 16936bb..de8f7e0 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -3489,7 +3489,21 @@ static int atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info,
 
 	/* Map in frame buffer */
 	info->fix.smem_start = addr;
-	info->screen_base = ioremap(addr, 0x800000);
+
+	/*
+	 * The framebuffer is not always 8 MiB, that's just the size of the
+	 * PCI BAR. We temporarily abuse smem_len here to store the size
+	 * of the BAR. aty_init() will later correct it to match the actual
+	 * framebuffer size.
+	 *
+	 * On devices that don't have the auxiliary register aperture, the
+	 * registers are housed at the top end of the framebuffer PCI BAR.
+	 * aty_fudge_framebuffer_len() is used to reduce smem_len to not
+	 * overlap with the registers.
+	 */
+	info->fix.smem_len = 0x800000;
+
+	info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len);
 	if (info->screen_base == NULL) {
 		ret = -ENOMEM;
 		goto atyfb_setup_generic_fail;
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux