# Re: \[PATCH 34/57\] fbdev: sh\_mobile\_lcdc: Store the format in struct sh\_mobile\_lcdc\_chan

- From: Laurent Pinchart \<laurent.pinchart@ideasonboard.com\>
- Date: 2011-12-16 10:17:47 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2011/12/13462427
- Thread: https://ratatoskr.run/linux-fbdev/2011/12/13462425/t.md

```text
Hi Guennadi,

On Thursday 15 December 2011 23:29:29 Guennadi Liakhovetski wrote:
> On Tue, 13 Dec 2011, Laurent Pinchart wrote:
> > Store the active format in the channel structure, and use it instead of
> > parsing info->var all over the place when the format is needed.
> 
> Right, this is what I was wondering about, while looking at the previous
> patch:-)

So I'll consider your comment to patch 33/57 to be addressed :-)

> But:
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > 
> >  drivers/video/sh_mobile_lcdcfb.c |   21 ++++++++++-----------
> >  drivers/video/sh_mobile_lcdcfb.h |    4 +++-
> >  2 files changed, 13 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/video/sh_mobile_lcdcfb.c
> > b/drivers/video/sh_mobile_lcdcfb.c index c6b6b9d..9829e01 100644
> > --- a/drivers/video/sh_mobile_lcdcfb.c
> > +++ b/drivers/video/sh_mobile_lcdcfb.c
> 
> [snip]
> 
> > @@ -1350,6 +1345,8 @@ static int sh_mobile_set_par(struct fb_info *info)
> > 
> >  		info->fix.line_length = info->var.xres
> >  		
> >  				      * info->var.bits_per_pixel / 8;
> > 
> > +	ch->format > > sh_mobile_format_info(sh_mobile_format_fourcc(&info->var));
> 
> Cannot this be NULL? As far as I could trace it back, I'm not sure with
> hotplug bits_per_pixel would be initialised correctly along the lines of
> sh_mobile_fb_reconfig().

You're right, sh_mobile_fb_reconfig() doesn't set the bits_per_pixel (and 
other format-related) field. I'll fix this by initializing those fields from 
the current var in sh_mobile_fb_reconfig() in patch 30/57, as that's the one 
that introduces the problem.

-- 
Regards,

Laurent Pinchart
```
