From patchwork Fri Jul 10 01:24:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luis R. Rodriguez" X-Patchwork-Id: 6760791 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B312A9F2F0 for ; Fri, 10 Jul 2015 01:29:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B8CB6207B0 for ; Fri, 10 Jul 2015 01:29:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B8B35207A0 for ; Fri, 10 Jul 2015 01:29:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751748AbbGJB31 (ORCPT ); Thu, 9 Jul 2015 21:29:27 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:35403 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbbGJB3Z (ORCPT ); Thu, 9 Jul 2015 21:29:25 -0400 Received: by pactm7 with SMTP id tm7so159353032pac.2; Thu, 09 Jul 2015 18:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=rxHEqgFW2/YLXDO/epgYKPVTfHKBx9Ytua2R9Ge9XTU=; b=XqIx5JlEQud61NYiK9ncvohBZjDBwuTzqDTlmR5K2gjuJw16R5ScvRxfnvinQYHs/t WcUlwPavf8lM4hIDNtIyZlr2ltGdNH/k+/wXaUB/dn/ODncv3g/dOMQXkHR8OTGEiFqg /j6kWtYVJrjuiFmObCjuiF4U49KTdV04A5o1UIcLBY2J66mc46uw1tSjW3xxVsLhjxG9 yFfN298IkYc5S/IppnCZ420Vex3M45qSnVLAMCZIdwSNr+wLxOQWvhTP9vFTngOVeSiK skP74YGoqEXXjfpW0zBWNhzKDm2sBzKGqCCKe8H99GSofNDug8lfqTIuuyACJTSpsKOu qL2g== X-Received: by 10.68.114.131 with SMTP id jg3mr37065492pbb.54.1436491765227; Thu, 09 Jul 2015 18:29:25 -0700 (PDT) Received: from mcgrof@gmail.com (c-98-234-145-61.hsd1.ca.comcast.net. [98.234.145.61]) by smtp.gmail.com with ESMTPSA id qg5sm7452428pdb.13.2015.07.09.18.29.21 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 09 Jul 2015 18:29:24 -0700 (PDT) Received: by mcgrof@gmail.com (sSMTP sendmail emulation); Thu, 09 Jul 2015 18:27:13 -0700 From: "Luis R. Rodriguez" To: mingo@kernel.org Cc: bp@suse.de, tomi.valkeinen@ti.com, airlied@redhat.com, arnd@arndb.de, dan.j.williams@intel.com, hch@lst.de, luto@amacapital.net, hpa@zytor.com, tglx@linutronix.de, geert@linux-m68k.org, ralf@linux-mips.org, hmh@hmh.eng.br, ross.zwisler@linux.intel.com, akpm@linux-foundation.org, jgross@suse.com, benh@kernel.crashing.org, mpe@ellerman.id.au, tj@kernel.org, x86@kernel.org, mst@redhat.com, toshi.kani@hp.com, stefan.bader@canonical.com, syrjala@sci.fi, ville.syrjala@linux.intel.com, linux-pci@vger.kernel.org, linux-mm@kvack.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Luis R. Rodriguez" , Jean-Christophe Plagniol-Villard , Mathias Krause Subject: [PATCH v6 1/4] drivers/video/fbdev/atyfb: Carve out framebuffer length fudging into a helper Date: Thu, 9 Jul 2015 18:24:56 -0700 Message-Id: <1436491499-3289-2-git-send-email-mcgrof@do-not-panic.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436491499-3289-1-git-send-email-mcgrof@do-not-panic.com> References: <1436491499-3289-1-git-send-email-mcgrof@do-not-panic.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Luis R. Rodriguez" 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 Cc: H. Peter Anvin Cc: Jean-Christophe Plagniol-Villard Cc: Mathias Krause Cc: Tomi Valkeinen Cc: linux-fbdev@vger.kernel.org Link: http://lkml.kernel.org/r/1435251019-32421-1-git-send-email-mcgrof@do-not-panic.com Signed-off-by: Borislav Petkov --- 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 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 { #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