/* wait_for_engine_idle - waits for all hardware engines to finish  */
static int wait_for_engine_idle(struct fb_info *info)
/* wait_for_engine_idle - waits for all hardware engines to finish  */
static int wait_for_engine_idle(struct fb_info *info)
{
	struct i810fb_par *par = info->par;
	u8 __iomem *mmio = par->mmio_start_virtual;
	int count = WAIT_COUNT;
	if (wait_for_space(info, par->iring.size))
		return 1;
	while((i810_readw(INSTDONE, mmio) & 0x7B) != 0x7B && --count); 
	if (count) return 0;
	printk("accel engine lockup!!!\n");
	printk("INSTDONE: 0x%04x\n", i810_readl(INSTDONE, mmio));
	i810_report_error(mmio); 
	par->dev_flags |= LOCKUP;
	info->pixmap.scan_align = 1;
	return 1;
}