RE: [PATCH] video: move CNVT_TOHW to a common place

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Geert Uytterhoeven,

Thanks for reviewing the patch.

On Wed, Aug 08, 2012 at 22:32:51, Geert Uytterhoeven wrote:
> On Wed, Aug 8, 2012 at 1:54 PM, Manjunathappa, Prakash
> <prakash.pm@xxxxxx> wrote:
> > --- a/include/linux/fb.h
> > +++ b/include/linux/fb.h
> > @@ -397,6 +397,11 @@ struct fb_cursor {
> >         struct fb_image image;  /* Cursor image */
> >  };
> >
> > +static inline __u32 CNVT_TOHW(__u32 val, __u32 width)
> 
> "__u32" is a bit misleading, as "val" is actually an unsigned 16-bit value.
> 

I agree, will correct this.

> > +{
> > +       return ((val << width) + 0x7FFF - val) >> 16;
> > +}
> 
> Also, if you move it to a public header, perhaps the function needs a more
> descriptive name? What it does is remap a 16-bit value "val" onto a value with
> "width" bits of resolution, where "width" must be smaller than 16.
> "reduce_resolution()"?
> 

I agree that it reduces the resolution, but it reduces to match the hardware.
So "CNVT_TOHW": convert to hardware supported resolution, isn't it more appropriate?

I will add description as it is going to public header file.

> Also, it can become more generic, not limiting to 16-bit input values.
> The "0x7fff" part is "(1 << (width -1)) - 1". But I'm not sure it's
> worth the effort
> (are there places where this is needed?).
> 

Florian Tobias Schandinat: Could you please comment here?

Thanks,
Prakash

> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
> 

��.n��������+%������w��{.n�����{����n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�

[Index of Archives]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Tourism]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux