Message ID | 1317125366-16059-1-git-send-email-marek.vasut@gmail.com |
---|---|
State | Superseded |
Delegated to: | Anatolij Gustschin |
Headers | show |
Hi Marek, On Tue, Sep 27, 2011 at 9:09 AM, Marek Vasut <marek.vasut@gmail.com> wrote: > Signed-off-by: Marek Vasut <marek.vasut@gmail.com> > Cc: Stefano Babic <sbabic@denx.de> > --- > drivers/video/mxc_ipuv3_fb.c | 14 ++++++++++++-- > 1 files changed, 12 insertions(+), 2 deletions(-) > > diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c > index a66981c..c4443e8 100644 > --- a/drivers/video/mxc_ipuv3_fb.c > +++ b/drivers/video/mxc_ipuv3_fb.c > @@ -42,6 +42,16 @@ > > DECLARE_GLOBAL_DATA_PTR; > > +/* Use DISP #1 by default. */ > +#ifndef CONFIG_VIDEO_MX5_OUTPUT > +#define CONFIG_VIDEO_MX5_OUTPUT 0 > +#endif What about putting a define for selecting between IPU DI0 or DI1 in the board config file? There are boards that have DI0 connected as the primary display, others may have DI1. This way the mxc_ipuv3_fb.c driver could handle both cases depending on the board config. Regards, Fabio Estevam
On 09/27/2011 02:09 PM, Marek Vasut wrote: > Signed-off-by: Marek Vasut <marek.vasut@gmail.com> > Cc: Stefano Babic <sbabic@denx.de> > --- > drivers/video/mxc_ipuv3_fb.c | 14 ++++++++++++-- > 1 files changed, 12 insertions(+), 2 deletions(-) > > diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c > index a66981c..c4443e8 100644 > --- a/drivers/video/mxc_ipuv3_fb.c > +++ b/drivers/video/mxc_ipuv3_fb.c > @@ -42,6 +42,16 @@ > > DECLARE_GLOBAL_DATA_PTR; > > +/* Use DISP #1 by default. */ > +#ifndef CONFIG_VIDEO_MX5_OUTPUT > +#define CONFIG_VIDEO_MX5_OUTPUT 0 > +#endif > + > +/* Use RGB666 pixel format by default. */ > +#ifndef CONFIG_VIDEO_MX5_PIXFMT > +#define CONFIG_VIDEO_MX5_PIXFMT IPU_PIX_FMT_RGB666 > +#endif > + > void *lcd_base; /* Start of framebuffer memory */ > void *lcd_console_address; /* Start of console buffer */ > > @@ -550,7 +560,7 @@ static int mxcfb_probe(u32 interface_pix_fmt, struct fb_videomode *mode) > mxcfbi->blank = FB_BLANK_POWERDOWN; > } > > - mxcfbi->ipu_di = 0; > + mxcfbi->ipu_di = CONFIG_VIDEO_MX5_OUTPUT; > > ipu_disp_set_global_alpha(mxcfbi->ipu_ch, 1, 0x80); > ipu_disp_set_color_key(mxcfbi->ipu_ch, 0, 0); > @@ -636,7 +646,7 @@ int mx51_fb_init(struct fb_videomode *mode) > lcd_base += 56; > > debug("Framebuffer at 0x%x\n", (unsigned int)lcd_base); > - ret = mxcfb_probe(IPU_PIX_FMT_RGB666, mode); > + ret = mxcfb_probe(CONFIG_VIDEO_MX5_PIXFMT, mode); > What about to not use a CONFIG_ ? at the moment, the board code calls mx51_fb_init() to initialize the display parameter. We can add a second parameter (display_id) to the initialization and the board code is responsible to do that. And it is not required to recompile u-boot if the board as the mx51evk more as one display has or can have. Best regards, Stefano Babic
On Tuesday, September 27, 2011 02:22:18 PM Fabio Estevam wrote: > Hi Marek, > > On Tue, Sep 27, 2011 at 9:09 AM, Marek Vasut <marek.vasut@gmail.com> wrote: > > Signed-off-by: Marek Vasut <marek.vasut@gmail.com> > > Cc: Stefano Babic <sbabic@denx.de> > > --- > > drivers/video/mxc_ipuv3_fb.c | 14 ++++++++++++-- > > 1 files changed, 12 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c > > index a66981c..c4443e8 100644 > > --- a/drivers/video/mxc_ipuv3_fb.c > > +++ b/drivers/video/mxc_ipuv3_fb.c > > @@ -42,6 +42,16 @@ > > > > DECLARE_GLOBAL_DATA_PTR; > > > > +/* Use DISP #1 by default. */ > > +#ifndef CONFIG_VIDEO_MX5_OUTPUT > > +#define CONFIG_VIDEO_MX5_OUTPUT 0 > > +#endif > > What about putting a define for selecting between IPU DI0 or DI1 in > the board config file? > > There are boards that have DI0 connected as the primary display, > others may have DI1. > > This way the mxc_ipuv3_fb.c driver could handle both cases depending > on the board config. Sure, this is a default value for boards which just use the default (most common case). You can define CONFIG... in your board config file and change this. > > Regards, > > Fabio Estevam
diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c index a66981c..c4443e8 100644 --- a/drivers/video/mxc_ipuv3_fb.c +++ b/drivers/video/mxc_ipuv3_fb.c @@ -42,6 +42,16 @@ DECLARE_GLOBAL_DATA_PTR; +/* Use DISP #1 by default. */ +#ifndef CONFIG_VIDEO_MX5_OUTPUT +#define CONFIG_VIDEO_MX5_OUTPUT 0 +#endif + +/* Use RGB666 pixel format by default. */ +#ifndef CONFIG_VIDEO_MX5_PIXFMT +#define CONFIG_VIDEO_MX5_PIXFMT IPU_PIX_FMT_RGB666 +#endif + void *lcd_base; /* Start of framebuffer memory */ void *lcd_console_address; /* Start of console buffer */ @@ -550,7 +560,7 @@ static int mxcfb_probe(u32 interface_pix_fmt, struct fb_videomode *mode) mxcfbi->blank = FB_BLANK_POWERDOWN; } - mxcfbi->ipu_di = 0; + mxcfbi->ipu_di = CONFIG_VIDEO_MX5_OUTPUT; ipu_disp_set_global_alpha(mxcfbi->ipu_ch, 1, 0x80); ipu_disp_set_color_key(mxcfbi->ipu_ch, 0, 0); @@ -636,7 +646,7 @@ int mx51_fb_init(struct fb_videomode *mode) lcd_base += 56; debug("Framebuffer at 0x%x\n", (unsigned int)lcd_base); - ret = mxcfb_probe(IPU_PIX_FMT_RGB666, mode); + ret = mxcfb_probe(CONFIG_VIDEO_MX5_PIXFMT, mode); return ret; }
Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Stefano Babic <sbabic@denx.de> --- drivers/video/mxc_ipuv3_fb.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-)