linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / video / aty / mach64_accel.c
index 1490e5e..c98f4a4 100644 (file)
@@ -200,6 +200,8 @@ void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
        if (!area->width || !area->height)
                return;
        if (!par->accel_flags) {
+               if (par->blitter_may_be_busy)
+                       wait_for_idle(par);
                cfb_copyarea(info, area);
                return;
        }
@@ -246,6 +248,8 @@ void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
        if (!rect->width || !rect->height)
                return;
        if (!par->accel_flags) {
+               if (par->blitter_may_be_busy)
+                       wait_for_idle(par);
                cfb_fillrect(info, rect);
                return;
        }
@@ -284,10 +288,14 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image)
                return;
        if (!par->accel_flags ||
            (image->depth != 1 && info->var.bits_per_pixel != image->depth)) {
+               if (par->blitter_may_be_busy)
+                       wait_for_idle(par);
+
                cfb_imageblit(info, image);
                return;
        }
 
+       wait_for_idle(par);
        pix_width = pix_width_save = aty_ld_le32(DP_PIX_WIDTH, par);
        host_cntl = aty_ld_le32(HOST_CNTL, par) | HOST_BYTE_ALIGN;
 
@@ -417,6 +425,8 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image)
                }
        }
 
+       wait_for_idle(par);
+
        /* restore pix_width */
        wait_for_fifo(1, par);
        aty_st_le32(DP_PIX_WIDTH, pix_width_save, par);