From patchwork Thu Feb 14 03:48:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Renaud X-Patchwork-Id: 220348 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 20E272C0291 for ; Thu, 14 Feb 2013 14:55:35 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 635344A175; Thu, 14 Feb 2013 04:55:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m51lPRC09O6l; Thu, 14 Feb 2013 04:55:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A2B224A176; Thu, 14 Feb 2013 04:55:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 32BB04A176 for ; Thu, 14 Feb 2013 04:55:29 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZzfZxOQIvLJs for ; Thu, 14 Feb 2013 04:55:28 +0100 (CET) X-Greylist: delayed 415 seconds by postgrey-1.27 at theia; Thu, 14 Feb 2013 04:55:26 CET X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ie0-f175.google.com (mail-ie0-f175.google.com [209.85.223.175]) by theia.denx.de (Postfix) with ESMTPS id AA1044A175 for ; Thu, 14 Feb 2013 04:55:25 +0100 (CET) Received: by mail-ie0-f175.google.com with SMTP id c12so2678327ieb.20 for ; Wed, 13 Feb 2013 19:55:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=Ygm4cCRohTTYBPslZh6T2lATxplSwq6q8v1r7L0TIcg=; b=OK/8Ri3xVlxTGKLVoCVrfUE4QsiHBlfB1tQ0nSbQuUxIjQd0+FuvUQkOAWeIdANzuW kewQuoMwRrlz86I2Of4kHJuCYLLirKfz5O4xMbxysE5a51jQ5wLwsgzNPJ2sDVMLqtLS 4cXBd2AI+uZoiyS5YvxeWAtQtmt0Lx2U76skkEiJzFOil9tIPJgsavZdM1ThMEfb9K6c sCsKBjXv3k3ygeaeSeXQ4t1Vdcguk/LwEkUMH+zkLWW87JqTlwdFLbq1rVqPr4WuBH4I mbJIa22a0fYg3i6qNTUH+ZQcQs7GFn4oZD8HCR6OjYaMTSHdBssyLUM0z9+GYdO6VmSg CB8Q== X-Received: by 10.50.57.166 with SMTP id j6mr16377324igq.21.1360813708039; Wed, 13 Feb 2013 19:48:28 -0800 (PST) Received: from teanau.bluewaternz.com (mail.bluewatersys.com. [202.124.120.130]) by mx.google.com with ESMTPS id br7sm40493497igb.0.2013.02.13.19.48.25 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Feb 2013 19:48:27 -0800 (PST) From: Andre Renaud To: u-boot@lists.denx.de Date: Thu, 14 Feb 2013 16:48:00 +1300 Message-Id: <1360813680-20508-1-git-send-email-andre@bluewatersys.com> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQnFWX+IlBU4QppEGIBMNvnKCLkmSDEygr0DBNo55RL24SAd6uemWeIFNs04nfBDRVU1CZOB Subject: [U-Boot] [PATCH] Fix bitmap offsets for non 8-bit LCDs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Currently bitmap logos don't interpret the X coordinate correctly if the bpp is anything other than 8. Signed-off-by: Andre Renaud --- common/lcd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/lcd.c b/common/lcd.c index 66d4f94..ee47712 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -589,15 +589,16 @@ void bitmap_plot(int x, int y) immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; cpm8xx_t *cp = &(immr->im_cpm); #endif + unsigned bpix = NBITS(panel_info.vl_bpix); debug("Logo: width %d height %d colors %d cmap %d\n", BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS, ARRAY_SIZE(bmp_logo_palette)); bmap = &bmp_logo_bitmap[0]; - fb = (uchar *)(lcd_base + y * lcd_line_length + x); + fb = (uchar *)(lcd_base + y * lcd_line_length + x * bpix / 8); - if (NBITS(panel_info.vl_bpix) < 12) { + if (bpix < 12) { /* Leave room for default color map * default case: generic system with no cmap (most likely 16bpp) * cmap was set to the source palette, so no change is done. @@ -648,7 +649,7 @@ void bitmap_plot(int x, int y) } else { /* true color mode */ u16 col16; - fb16 = (ushort *)(lcd_base + y * lcd_line_length + x); + fb16 = (ushort *)fb; for (i = 0; i < BMP_LOGO_HEIGHT; ++i) { for (j = 0; j < BMP_LOGO_WIDTH; j++) { col16 = bmp_logo_palette[(bmap[j]-16)];