From patchwork Tue Oct 14 21:24:39 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 4526 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 77B55DEC17 for ; Wed, 15 Oct 2008 08:24:55 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by ozlabs.org (Postfix) with ESMTP id 7DCC5DDE21 for ; Wed, 15 Oct 2008 08:24:42 +1100 (EST) Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 7F3B01C08F65; Tue, 14 Oct 2008 23:24:40 +0200 (CEST) X-Auth-Info: 2jRxU4s+NUmAj5EuEQCvwzhmnWf8lpBzoIb1TrdodHo= X-Auth-Info: 2jRxU4s+NUmAj5EuEQCvwzhmnWf8lpBzoIb1TrdodHo= X-Auth-Info: 2jRxU4s+NUmAj5EuEQCvwzhmnWf8lpBzoIb1TrdodHo= X-Auth-Info: 2jRxU4s+NUmAj5EuEQCvwzhmnWf8lpBzoIb1TrdodHo= X-Auth-Info: 2jRxU4s+NUmAj5EuEQCvwzhmnWf8lpBzoIb1TrdodHo= Received: from [192.168.10.11] (p5496E26D.dip.t-dialin.net [84.150.226.109]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTP id 5D2C8903D0; Tue, 14 Oct 2008 23:24:40 +0200 (CEST) Message-ID: <48F50E17.7020801@denx.de> Date: Tue, 14 Oct 2008 23:24:39 +0200 From: Anatolij Gustschin User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Matteo Fortini Subject: Re: [PATCH] Add new framebuffer driver for Fujitsu MB862xx GDCs References: <1223997906-19900-1-git-send-email-agust@denx.de> <20081014170455.GA16338@oksana.dev.rtsoft.ru> <48F4D29F.6090909@selcomgroup.com> In-Reply-To: <48F4D29F.6090909@selcomgroup.com> Cc: Dmitry Baryshkov , linuxppc-dev@ozlabs.org, linux-fbdev-devel@lists.sourceforge.net X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Matteo Fortini wrote: > Carminefb driver, though, supports 800x600 resolution. if you use this patch below Best regards, Anatolij diff --git a/drivers/video/mb862xx/mb862xxfb.c b/drivers/video/mb862xx/mb862xxfb.c index 26b66cb..904a111 100644 --- a/drivers/video/mb862xx/mb862xxfb.c +++ b/drivers/video/mb862xx/mb862xxfb.c @@ -218,6 +218,8 @@ static int mb862xxfb_set_par(struct fb_info *fbi) if (par->pre_init) return 0; + fbi->fix.line_length = (fbi->var.xres_virtual * + fbi->var.bits_per_pixel) / 8; /* disp off */ reg = inreg(disp, GC_DCM1); reg &= ~GC_DCM01_DEN; and something like this in user space: int fd; struct fb_var_screeninfo var_info; if ((fd=open("/dev/fb0", O_RDWR))==-1) { fprintf(stderr, "Cannot open /dev/fb0\n"); exit(1); } var_info.xres = 800; var_info.yres = 600; var_info.xres_virtual = 800; var_info.yres_virtual = 600; var_info.pixclock = 25000; var_info.left_margin = 88; var_info.right_margin = 40; var_info.lower_margin = 1; var_info.upper_margin = 23; var_info.hsync_len = 128; var_info.vsync_len = 4; if (ioctl(fd, FBIOPUT_VSCREENINFO, &var_info)<0) { fprintf(stderr, "Cannot set fb var_info\n"); exit(1); } than 800x600 resolution should be possible too. Also 1024x768 resolution should be possible with appropriate parameters. > BTW, I tried this patch and I get wrong colors on a patched DirectFB > which is changing the endianness on the fly. Is this driver already > taking care of this? I don't know how it behaves with DirectFB. But to get proper framebuffer console colors with carmine/coralp GDCs I used a small patch below: diff --git a/include/linux/fb.h b/include/linux/fb.h index ae4ecdf..e998048 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -891,11 +891,11 @@ struct fb_info { #define fb_readb __raw_readb #define fb_readw __raw_readw -#define fb_readl __raw_readl +#define fb_readl readl #define fb_readq __raw_readq #define fb_writeb __raw_writeb #define fb_writew __raw_writew -#define fb_writel __raw_writel +#define fb_writel writel #define fb_writeq __raw_writeq #define fb_memset memset_io