aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@suse.com>2015-07-09 21:24:56 -0400
committerIngo Molnar <mingo@kernel.org>2015-07-21 04:47:04 -0400
commiteacd2d542610e55cad0be445966ac8ae79124c6e (patch)
tree7aeb52101ebf21258ca52ba1ada66090def78da1 /drivers/video
parent8c7ea50c010b2f1e006ad37c43f98202a31de2cb (diff)
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>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/aty/atyfb_base.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index 8789e487b96e..16936bb1f865 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -427,6 +427,20 @@ static struct {
427#endif /* CONFIG_FB_ATY_CT */ 427#endif /* CONFIG_FB_ATY_CT */
428}; 428};
429 429
430/*
431 * Last page of 8 MB (4 MB on ISA) aperture is MMIO,
432 * unless the auxiliary register aperture is used.
433 */
434static void aty_fudge_framebuffer_len(struct fb_info *info)
435{
436 struct atyfb_par *par = (struct atyfb_par *) info->par;
437
438 if (!par->aux_start &&
439 (info->fix.smem_len == 0x800000 ||
440 (par->bus_type == ISA && info->fix.smem_len == 0x400000)))
441 info->fix.smem_len -= GUI_RESERVE;
442}
443
430static int correct_chipset(struct atyfb_par *par) 444static int correct_chipset(struct atyfb_par *par)
431{ 445{
432 u8 rev; 446 u8 rev;
@@ -2603,14 +2617,7 @@ static int aty_init(struct fb_info *info)
2603 if (par->pll_ops->resume_pll) 2617 if (par->pll_ops->resume_pll)
2604 par->pll_ops->resume_pll(info, &par->pll); 2618 par->pll_ops->resume_pll(info, &par->pll);
2605 2619
2606 /* 2620 aty_fudge_framebuffer_len(info);
2607 * Last page of 8 MB (4 MB on ISA) aperture is MMIO,
2608 * unless the auxiliary register aperture is used.
2609 */
2610 if (!par->aux_start &&
2611 (info->fix.smem_len == 0x800000 ||
2612 (par->bus_type == ISA && info->fix.smem_len == 0x400000)))
2613 info->fix.smem_len -= GUI_RESERVE;
2614 2621
2615 /* 2622 /*
2616 * Disable register access through the linear aperture 2623 * Disable register access through the linear aperture