lkml.org 
[lkml]   [2009]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2] fbdev: fix fillrect for 24bpp modes
    On Sat, 18 Apr 2009 20:52:34 +0200
    Michal Januszewski <spock@gentoo.org> wrote:

    > while (height--) {
    > - dst += dst_idx >> (ffs(bits) - 1);
    > + dst += dst_idx / bits;
    > dst_idx &= (bits - 1);
    > - fill_op(p, dst, dst_idx, pat, left, right,
    > + r = dst_idx % bpp;
    > + /* rotate pattern to the correct start position */
    > +#ifdef __LITTLE_ENDIAN
    > + pat2 = pat << r | pat >> (bpp-r);
    > +#else
    > + pat2 = pat << (bpp-r) | pat >> r;
    > +#endif
    > + fill_op(p, dst, dst_idx, pat2, left, right,
    > width*bpp, bits);
    > - r = (p->fix.line_length*8) % bpp;
    > - pat = pat << (bpp-r) | pat >> r;
    > dst_idx += p->fix.line_length*8;

    hm, that's fairly eye-popping.

    Could we do something like

    pat2 = le32_to_cpu(rol32(cpu_to_le32(pat), r));

    (might be wrong, but you see what I mean...)


    \
     
     \ /
      Last update: 2009-04-21 01:23    [W:0.022 / U:32.752 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site