Re: [U-Boot] [PATCH 1/2] Add flexibility to mx51 video support

2010-11-02 Thread Stefano Babic
On 11/02/2010 06:15 AM, Frias Renato-B13784 wrote:
 This patch adds flexibility to mxc_ipuv3_fb.c by allowing the display
 interface and pixel format to be passed to mx51_fb_init.
 
 Signed-off-by: Renato Frias renato.fr...@freescale.com

Hi Renato,

you patch seems to be corrupted and does not apply. It seems your mailer
is responsible for this. It puts html code in the mail, too:

nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; pixfmt =3D =
IPU_PIX_FMT_RGB565;BR
+nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; =
nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; break;BR

Consider using git send-mail to post your patches to the list. This
avoid mail corruption.

 -   strcpy(fbi-fix.id, DISP3 BG);
 +   if (ipu_di == 0)
 +   strcpy(fbi-fix.id, DISP3 BG);
 +   else if (ipu_di == 1)
 +   strcpy(fbi-fix.id, DISP3 BG - DI1);

I admit that I took the fix.id string from the linux driver, but it is
not used at all in the code. If we do not find a useful reason for it,
it should be probably better to get rid of it to avoid confusion.

 @@ -593,7 +596,7 @@ static int mxcfb_probe(u32 interface_pix_fmt, struct
 fb_videomode *mode)
 XRES = %d YRES = %d BitsXpixel = %d\n,
 panel_info.vl_col,
 panel_info.vl_row,
 -   panel_info.vl_bpix);
 +   NBITS(panel_info.vl_bpix));

This is only a debug output to check the values in the panel_info
structure and prints them without doing any computation. If you want to
add the NBITS value (that in any case can be computed), please leave the
original output of vl_bpix, too.

Stefano

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] Add flexibility to mx51 video support

2010-11-02 Thread Renato Frias
Hello Stefano B,

On Tue, Nov 2, 2010 at 4:57 AM, Stefano Babic sba...@denx.de wrote:

 you patch seems to be corrupted and does not apply. It seems your mailer
 is responsible for this. It puts html code in the mail, too:

Shame on me! I apologize for the mess, I configured Outlook for plain text.
I'll submit again...

 I admit that I took the fix.id string from the linux driver, but it is
 not used at all in the code. If we do not find a useful reason for it,
 it should be probably better to get rid of it to avoid confusion.

Agree! I can not see usage for this, will remove from the patch.

 This is only a debug output to check the values in the panel_info
 structure and prints them without doing any computation. If you want to
 add the NBITS value (that in any case can be computed), please leave the
 original output of vl_bpix, too.

Agree! I will remove from the patch.

Thanks,
Renato
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] Add flexibility to mx51 video support

2010-11-01 Thread Frias Renato-B13784
This patch adds flexibility to mxc_ipuv3_fb.c by allowing the display
interface and pixel format to be passed to mx51_fb_init.

Signed-off-by: Renato Frias renato.fr...@freescale.com
---
 drivers/video/mxc_ipuv3_fb.c |   31 +--
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c
index a66981c..024275a 100644
--- a/drivers/video/mxc_ipuv3_fb.c
+++ b/drivers/video/mxc_ipuv3_fb.c
@@ -526,7 +526,7 @@ static struct fb_info *mxcfb_init_fbinfo(void)
  *
  * @return  Appropriate error code to the kernel common code
  */
-static int mxcfb_probe(u32 interface_pix_fmt, struct fb_videomode
*mode)
+static int mxcfb_probe(u32 interface_pix_fmt, struct fb_videomode
*mode, u32 ipu_di)
 {
struct fb_info *fbi;
struct mxcfb_info *mxcfbi;
@@ -550,11 +550,14 @@ static int mxcfb_probe(u32 interface_pix_fmt,
struct fb_videomode *mode)
mxcfbi-blank = FB_BLANK_POWERDOWN;
}
 
-   mxcfbi-ipu_di = 0;
+   mxcfbi-ipu_di = ipu_di;
 
ipu_disp_set_global_alpha(mxcfbi-ipu_ch, 1, 0x80);
ipu_disp_set_color_key(mxcfbi-ipu_ch, 0, 0);
-   strcpy(fbi-fix.id, DISP3 BG);
+   if (ipu_di == 0)
+   strcpy(fbi-fix.id, DISP3 BG);
+   else if (ipu_di == 1)
+   strcpy(fbi-fix.id, DISP3 BG - DI1);
 
g_dp_in_use = 1;
 
@@ -593,7 +596,7 @@ static int mxcfb_probe(u32 interface_pix_fmt, struct
fb_videomode *mode)
XRES = %d YRES = %d BitsXpixel = %d\n,
panel_info.vl_col,
panel_info.vl_row,
-   panel_info.vl_bpix);
+   NBITS(panel_info.vl_bpix));
 
ipu_dump_registers();
 
@@ -625,9 +628,10 @@ void lcd_ctrl_init(void *lcdbase)
memset(lcdbase, 0, mem_len);
 }
 
-int mx51_fb_init(struct fb_videomode *mode)
+int mx51_fb_init(struct fb_videomode *mode, u32 ipu_di, u32 bppix)
 {
int ret;
+   uint32_t pixfmt = 0;
 
ret = ipu_probe();
if (ret)
@@ -635,8 +639,23 @@ int mx51_fb_init(struct fb_videomode *mode)
 
lcd_base += 56;
 
+   switch (bppix) {
+   case 32:
+   pixfmt = IPU_PIX_FMT_BGR32;
+   break;
+   case 24:
+   pixfmt = IPU_PIX_FMT_BGR24;
+   break;
+   case 18:
+   pixfmt = IPU_PIX_FMT_RGB666;
+   break;
+   case 16:
+   pixfmt = IPU_PIX_FMT_RGB565;
+   break;
+   }
+
debug(Framebuffer at 0x%x\n, (unsigned int)lcd_base);
-   ret = mxcfb_probe(IPU_PIX_FMT_RGB666, mode);
+   ret = mxcfb_probe(pixfmt, mode, ipu_di);
 
return ret;
 }
-- 
1.6.0.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot