diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2005-11-07 04:00:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:53:51 -0500 |
commit | b4d8aea6d66aabc1d79aaeb1ecc90562abb8f575 (patch) | |
tree | 9d1acb46481ba54827463ae2d8f79821d5119953 /drivers/video/cfbimgblt.c | |
parent | dd0314f7bb407bc4bdb3ea769b9c8a3a5d39ffd7 (diff) |
[PATCH] fbdev: Remove software clipping from drawing functions
Remove software clipping from imageblit, fillrect and copyarea. Clipping is
not needed because the console layer assures that reads/writes doest not
happen beyond the extents of the framebuffer. And software clipping tends to
hide bugs, if they do exist.
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/cfbimgblt.c')
-rw-r--r-- | drivers/video/cfbimgblt.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/video/cfbimgblt.c b/drivers/video/cfbimgblt.c index 4c123abaa84..da664cea7ec 100644 --- a/drivers/video/cfbimgblt.c +++ b/drivers/video/cfbimgblt.c | |||
@@ -272,33 +272,13 @@ void cfb_imageblit(struct fb_info *p, const struct fb_image *image) | |||
272 | { | 272 | { |
273 | u32 fgcolor, bgcolor, start_index, bitstart, pitch_index = 0; | 273 | u32 fgcolor, bgcolor, start_index, bitstart, pitch_index = 0; |
274 | u32 bpl = sizeof(u32), bpp = p->var.bits_per_pixel; | 274 | u32 bpl = sizeof(u32), bpp = p->var.bits_per_pixel; |
275 | u32 width = image->width, height = image->height; | 275 | u32 width = image->width; |
276 | u32 dx = image->dx, dy = image->dy; | 276 | u32 dx = image->dx, dy = image->dy; |
277 | int x2, y2, vxres, vyres; | ||
278 | u8 __iomem *dst1; | 277 | u8 __iomem *dst1; |
279 | 278 | ||
280 | if (p->state != FBINFO_STATE_RUNNING) | 279 | if (p->state != FBINFO_STATE_RUNNING) |
281 | return; | 280 | return; |
282 | 281 | ||
283 | vxres = p->var.xres_virtual; | ||
284 | vyres = p->var.yres_virtual; | ||
285 | /* | ||
286 | * We could use hardware clipping but on many cards you get around | ||
287 | * hardware clipping by writing to framebuffer directly like we are | ||
288 | * doing here. | ||
289 | */ | ||
290 | if (image->dx > vxres || image->dy > vyres) | ||
291 | return; | ||
292 | |||
293 | x2 = image->dx + image->width; | ||
294 | y2 = image->dy + image->height; | ||
295 | dx = image->dx > 0 ? image->dx : 0; | ||
296 | dy = image->dy > 0 ? image->dy : 0; | ||
297 | x2 = x2 < vxres ? x2 : vxres; | ||
298 | y2 = y2 < vyres ? y2 : vyres; | ||
299 | width = x2 - dx; | ||
300 | height = y2 - dy; | ||
301 | |||
302 | bitstart = (dy * p->fix.line_length * 8) + (dx * bpp); | 282 | bitstart = (dy * p->fix.line_length * 8) + (dx * bpp); |
303 | start_index = bitstart & (32 - 1); | 283 | start_index = bitstart & (32 - 1); |
304 | pitch_index = (p->fix.line_length & (bpl - 1)) * 8; | 284 | pitch_index = (p->fix.line_length & (bpl - 1)) * 8; |