From patchwork Fri Jul 10 01:24:57 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: 6760821 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 518B09F2F0 for ; Fri, 10 Jul 2015 01:31:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5027C207B9 for ; Fri, 10 Jul 2015 01:31:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A2218207A6 for ; Fri, 10 Jul 2015 01:31:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752386AbbGJBbi (ORCPT ); Thu, 9 Jul 2015 21:31:38 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34498 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752035AbbGJBbh (ORCPT ); Thu, 9 Jul 2015 21:31:37 -0400 Received: by pabvl15 with SMTP id vl15so159108055pab.1; Thu, 09 Jul 2015 18:31:36 -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=kYZ8eJ2yMc2VyJn1AUJKLveZnGjw++KK/UTkuHliuIc=; b=UaJ2PZIM5HGa+CR2DZ7yUve7AxEOk0B2LwmWxyRkyNfWzA/apsG27kvd9bVRXJW4QJ fv70olvPySmk8ilZrRZ+PG2fTUg0iqPU8EhjbV7GihmChnJYF3Et6oQZAffqyvcsYNUI aytqnEvirT6OYQN8xCAEG8WieqnN6m6f+ypJinsb4PIlUg/fUSvqCYkP40WwMQIfcqZb gy/FoiJut1eZa3j/69H7x3YuZBTFehV/dfRx+CeQl23T/6gzDSxoPm/UVtwQ+X52zHVk RLOkRGHuPVzpnMSVAxIInptYJaJv+wVGT8IihraPsmvFB17QXhxTxKz9L01Dhs6mOehn BYBA== X-Received: by 10.69.19.129 with SMTP id gu1mr37060208pbd.162.1436491896821; Thu, 09 Jul 2015 18:31:36 -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 ug1sm7085046pbc.39.2015.07.09.18.31.33 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 09 Jul 2015 18:31:35 -0700 (PDT) Received: by mcgrof@gmail.com (sSMTP sendmail emulation); Thu, 09 Jul 2015 18:29:25 -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" , Andrzej Hajda , Antonino Daplas , Daniel Vetter , Davidlohr Bueso , Ingo Molnar , Jean-Christophe Plagniol-Villard , Linus Torvalds , Mathias Krause , Mel Gorman , Rob Clark , Suresh Siddha , Vlastimil Babka Subject: [PATCH v6 2/4] drivers/video/fbdev/atyfb: Clarify ioremap() base and length used Date: Thu, 9 Jul 2015 18:24:57 -0700 Message-Id: <1436491499-3289-3-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> 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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" 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 Cc: airlied@redhat.com Cc: Andrew Morton Cc: Andrzej Hajda Cc: Andy Lutomirski Cc: Antonino Daplas Cc: benh@kernel.crashing.org Cc: Daniel Vetter Cc: Dave Airlie Cc: Davidlohr Bueso Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Jean-Christophe Plagniol-Villard Cc: Juergen Gross Cc: Linus Torvalds Cc: linux-fbdev@vger.kernel.org Cc: linux-pci@vger.kernel.org Cc: Mathias Krause Cc: Mel Gorman Cc: mst@redhat.com Cc: Rob Clark Cc: Suresh Siddha Cc: syrjala@sci.fi Cc: Thomas Gleixner Cc: Tomi Valkeinen Cc: Toshi Kani Cc: Ville Syrjälä Cc: Vlastimil Babka Signed-off-by: Borislav Petkov --- 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 16936bb1f865..513e58df9d3f 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;