Commit cafc5fa3 authored by Andrew Morton's avatar Andrew Morton Committed by james toy

- clean up comments

- remove do-nothing tests
- use min()

Cc: Anatolij Gustschin <agust@denx.de>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Valentin Sitdikov <valentin.sitdikov@siemens.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent fd7a674a
...@@ -66,8 +66,10 @@ static void mb86290fb_copyarea(struct fb_info *info, ...@@ -66,8 +66,10 @@ static void mb86290fb_copyarea(struct fb_info *info,
mb862xxfb_write_fifo(6, cmd, info); mb862xxfb_write_fifo(6, cmd, info);
} }
/* Fill in the cmd array /GDC FIFO commands/ to draw a 1bit image. /*
* Make sure cmd has enough room! */ * Fill in the cmd array /GDC FIFO commands/ to draw a 1bit image.
* Make sure cmd has enough room!
*/
static void mb86290fb_imageblit1(u32 *cmd, u16 step, u16 dx, u16 dy, static void mb86290fb_imageblit1(u32 *cmd, u16 step, u16 dx, u16 dy,
u16 width, u16 height, u32 fgcolor, u16 width, u16 height, u32 fgcolor,
u32 bgcolor, const struct fb_image *image, u32 bgcolor, const struct fb_image *image,
...@@ -113,8 +115,10 @@ static void mb86290fb_imageblit1(u32 *cmd, u16 step, u16 dx, u16 dy, ...@@ -113,8 +115,10 @@ static void mb86290fb_imageblit1(u32 *cmd, u16 step, u16 dx, u16 dy,
} }
} }
/* Fill in the cmd array /GDC FIFO commands/ to draw a 8bit image. /*
* Make sure cmd has enough room! */ * Fill in the cmd array /GDC FIFO commands/ to draw a 8bit image.
* Make sure cmd has enough room!
*/
static void mb86290fb_imageblit8(u32 *cmd, u16 step, u16 dx, u16 dy, static void mb86290fb_imageblit8(u32 *cmd, u16 step, u16 dx, u16 dy,
u16 width, u16 height, u32 fgcolor, u16 width, u16 height, u32 fgcolor,
u32 bgcolor, const struct fb_image *image, u32 bgcolor, const struct fb_image *image,
...@@ -150,8 +154,10 @@ static void mb86290fb_imageblit8(u32 *cmd, u16 step, u16 dx, u16 dy, ...@@ -150,8 +154,10 @@ static void mb86290fb_imageblit8(u32 *cmd, u16 step, u16 dx, u16 dy,
} }
} }
/* Fill in the cmd array /GDC FIFO commands/ to draw a 16bit image. /*
* Make sure cmd has enough room! */ * Fill in the cmd array /GDC FIFO commands/ to draw a 16bit image.
* Make sure cmd has enough room!
*/
static void mb86290fb_imageblit16(u32 *cmd, u16 step, u16 dx, u16 dy, static void mb86290fb_imageblit16(u32 *cmd, u16 step, u16 dx, u16 dy,
u16 width, u16 height, u32 fgcolor, u16 width, u16 height, u32 fgcolor,
u32 bgcolor, const struct fb_image *image, u32 bgcolor, const struct fb_image *image,
...@@ -195,12 +201,10 @@ static void mb86290fb_imageblit(struct fb_info *info, ...@@ -195,12 +201,10 @@ static void mb86290fb_imageblit(struct fb_info *info,
mdr = (GDC_ROP_COPY << 9); mdr = (GDC_ROP_COPY << 9);
x2 = image->dx + image->width; x2 = image->dx + image->width;
y2 = image->dy + image->height; y2 = image->dy + image->height;
dx = image->dx > 0 ? image->dx : 0;
dy = image->dy > 0 ? image->dy : 0;
vxres = info->var.xres_virtual; vxres = info->var.xres_virtual;
vyres = info->var.yres_virtual; vyres = info->var.yres_virtual;
x2 = x2 < vxres ? x2 : vxres; x2 = min(x2, vxres);
y2 = y2 < vyres ? y2 : vyres; y2 = min(y2, vyres);
width = x2 - dx; width = x2 - dx;
height = y2 - dy; height = y2 - dy;
...@@ -265,8 +269,8 @@ static void mb86290fb_fillrect(struct fb_info *info, ...@@ -265,8 +269,8 @@ static void mb86290fb_fillrect(struct fb_info *info,
* hardware clipping by writing to framebuffer directly. */ * hardware clipping by writing to framebuffer directly. */
x2 = rect->dx + rect->width; x2 = rect->dx + rect->width;
y2 = rect->dy + rect->height; y2 = rect->dy + rect->height;
x2 = x2 < vxres ? x2 : vxres; x2 = min(x2, vxres);
y2 = y2 < vyres ? y2 : vyres; y2 = min(y2, vyres);
width = x2 - rect->dx; width = x2 - rect->dx;
height = y2 - rect->dy; height = y2 - rect->dy;
if (info->fix.visual == FB_VISUAL_TRUECOLOR || if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment