From patchwork Sat May 21 19:42:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 806132 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4LJh3v2017363 for ; Sat, 21 May 2011 19:43:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757263Ab1EUTnD (ORCPT ); Sat, 21 May 2011 15:43:03 -0400 Received: from brigitte.telenet-ops.be ([195.130.137.66]:54468 "EHLO brigitte.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757242Ab1EUTnB (ORCPT ); Sat, 21 May 2011 15:43:01 -0400 Received: from ayla.of.borg ([84.193.80.148]) by brigitte.telenet-ops.be with bizsmtp id mKiz1g0073C005g0GKizMa; Sat, 21 May 2011 21:43:00 +0200 Received: from geert by ayla.of.borg with local (Exim 4.71) (envelope-from ) id 1QNs4h-0008MW-BZ; Sat, 21 May 2011 21:42:59 +0200 From: Geert Uytterhoeven To: Paul Mundt Cc: linux-fbdev@vger.kernel.org, linux-m68k@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 1/3] fbdev/amifb: Correct check for video memory size Date: Sat, 21 May 2011 21:42:54 +0200 Message-Id: <1306006976-32117-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.7.0.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 21 May 2011 19:43:04 +0000 (UTC) The check should compare the available memory size with the highest allocation value (VIDEOMEMSIZE_*_2M), not with the lowest value (VIDEOMEMSIZE_*_1M). Signed-off-by: Geert Uytterhoeven --- drivers/video/amifb.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index e5d6b56..603f84f 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c @@ -2295,7 +2295,7 @@ default_chipset: defmode = amiga_vblank == 50 ? DEFMODE_PAL : DEFMODE_NTSC; if (amiga_chip_avail()-CHIPRAM_SAFETY_LIMIT > - VIDEOMEMSIZE_ECS_1M) + VIDEOMEMSIZE_ECS_2M) fb_info.fix.smem_len = VIDEOMEMSIZE_ECS_2M; else fb_info.fix.smem_len = VIDEOMEMSIZE_ECS_1M; @@ -2312,7 +2312,7 @@ default_chipset: maxfmode = TAG_FMODE_4; defmode = DEFMODE_AGA; if (amiga_chip_avail()-CHIPRAM_SAFETY_LIMIT > - VIDEOMEMSIZE_AGA_1M) + VIDEOMEMSIZE_AGA_2M) fb_info.fix.smem_len = VIDEOMEMSIZE_AGA_2M; else fb_info.fix.smem_len = VIDEOMEMSIZE_AGA_1M;