From patchwork Tue Apr 21 20:26:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Luis R. Rodriguez" X-Patchwork-Id: 6253611 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D6258BF4A6 for ; Tue, 21 Apr 2015 20:30:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F3D5F201E4 for ; Tue, 21 Apr 2015 20:30:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74DAA201BB for ; Tue, 21 Apr 2015 20:30:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932646AbbDUU3i (ORCPT ); Tue, 21 Apr 2015 16:29:38 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:33883 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932834AbbDUU2F (ORCPT ); Tue, 21 Apr 2015 16:28:05 -0400 Received: by pdbqa5 with SMTP id qa5so252054828pdb.1; Tue, 21 Apr 2015 13:28:05 -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 :mime-version:content-type:content-transfer-encoding; bh=h/2MWue7knHFy+BfiEldXfjA/tMTPlvd0xPK7niHhus=; b=f28fplJjjT+6MPa6WS615g2+wKCNttyeLicECEQ1gKnS2PIW7mmMp42ctxKraon4kf D71AOv25UnLSZd0jmp4/b0krkRN+FDW2lEO3yx8XyevFCUy0nL2ulhiGWqTVwNA3fS+S B8VbZkzM6rr+kxIYpbxV6ViCcviQjy3PnnaHRpsm8fvfJjBcENVsPlqqQY46Qo/k694k sR0dQNvDXNewslEeAqrkPUpbvRZZwW5dhd7FrFS9GFpJZjjQ5zjKZm8qw9WHW20L5mQs qcCsGNYW2EIcNaNyP4PFagIh+TtOW2T3AtL3lhbCoISEuHm+UFCcqk1Zv9jRaa/C26Zf rhSw== X-Received: by 10.66.224.109 with SMTP id rb13mr39806967pac.133.1429648085088; Tue, 21 Apr 2015 13:28:05 -0700 (PDT) Received: from mcgrof@gmail.com (c-98-234-145-61.hsd1.ca.comcast.net. [98.234.145.61]) by mx.google.com with ESMTPSA id x1sm2902204pdp.1.2015.04.21.13.28.02 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 21 Apr 2015 13:28:04 -0700 (PDT) Received: by mcgrof@gmail.com (sSMTP sendmail emulation); Tue, 21 Apr 2015 13:28:01 -0700 From: "Luis R. Rodriguez" To: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com, syrjala@sci.fi, plagnioj@jcrosoft.com, tomi.valkeinen@ti.com Cc: linux-fbdev@vger.kernel.org, luto@amacapital.net, mst@redhat.com, cocci@systeme.lip6.fr, "Luis R. Rodriguez" , Toshi Kani , Suresh Siddha , Linus Torvalds , Juergen Gross , Daniel Vetter , Dave Airlie , Antonino Daplas , Rob Clark , Mathias Krause , Andrzej Hajda , Mel Gorman , Vlastimil Babka , Borislav Petkov , Davidlohr Bueso , linux-kernel@vger.kernel.org Subject: [PATCH v3 3/6] video: fbdev: atyfb: move framebuffer length fudging to helper Date: Tue, 21 Apr 2015 13:26:07 -0700 Message-Id: <1429647970-17479-4-git-send-email-mcgrof@do-not-panic.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1429647970-17479-1-git-send-email-mcgrof@do-not-panic.com> References: <1429647970-17479-1-git-send-email-mcgrof@do-not-panic.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no 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 resuse this later. This has no functional changes. Cc: Toshi Kani Cc: Suresh Siddha Cc: Ingo Molnar Cc: Linus Torvalds Cc: Thomas Gleixner Cc: Juergen Gross Cc: Daniel Vetter Cc: Andy Lutomirski Cc: Dave Airlie Cc: Antonino Daplas Cc: Jean-Christophe Plagniol-Villard Cc: Tomi Valkeinen Cc: Rob Clark Cc: Mathias Krause Cc: Andrzej Hajda Cc: Ville Syrjälä Cc: Mel Gorman Cc: Vlastimil Babka Cc: Borislav Petkov Cc: Davidlohr Bueso Cc: linux-fbdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Luis R. Rodriguez --- 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