[U-Boot] [PATCH 1/2 V2] new video driver for bus vcxk framebuffers
Wolfgang Denk
wd at denx.de
Thu Jul 23 21:40:07 CEST 2009
Dear Jens Scharsig,
In message <4A65A19E.6060605 at bus-elektronik.de> you wrote:
> This patch adds a new video driver
...
> +int vcxk_display_bitmap (ulong addr, int x, int y)
> +{
...
> + if ((bmp->header.signature[0] == 'B') &&
> + (bmp->header.signature[1] == 'M'))
> + {
> + compression = le32_to_cpu (bmp->header.compression);
> + width = le32_to_cpu (bmp->header.width);
> + height = le32_to_cpu (bmp->header.height);
> + bpp = le16_to_cpu (bmp->header.bit_count);
> +
> + dataptr = (unsigned char *) bmp +
> + le32_to_cpu(bmp->header.data_offset);
> +
> + if (display_width < (width + x))
> + {
> + cp_width = display_width - x;
> + }
> + else
> + {
> + cp_width = width;
> + }
> + if (display_height < (height + y))
> + {
> + cp_height = display_height - y;
> + }
> + else
> + {
> + cp_height = height;
> + }
...
Incorrect brace style.
...
> + switch (bpp)
> + {
> + case 1:
> + for (ycnt = cp_height;ycnt > 0; ycnt--)
> + {
> + lineptr = dataptr;
> + for (xcnt = 0;xcnt < cp_width; xcnt++)
> + {
> + if ((*lineptr << (xcnt % 8))
> + & 0x80) {
> + vcxk_setpixel(xcnt,
> + ycnt - 1,
> + 0xFFFFFF);
> + } else {
> + vcxk_setpixel(xcnt,
> + ycnt-1,0);
> + }
Quoting the CodingStyle:
Now, some people will claim that having 8-character
indentations makes the code move too far to the right, and
makes it hard to read on a 80-character terminal screen. The
answer to that is that if you need more than 3 levels of
indentation, you're screwed anyway, and should fix your
program.
Please clean up and resubmit.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Shakespeare's Law of Prototyping: (Hamlet III, iv, 156-160)
O, throw away the worser part of it,
And live the purer with the other half.
More information about the U-Boot
mailing list