/* BLT Engine Routines */
static inline void i810_report_error(u8 *mmio)
{
	printk("IIR     : 0x%04x\n"
	       "EIR     : 0x%04x\n"
	       "PGTBL_ER: 0x%04x\n"
	       "IPEIR   : 0x%04x\n"
	       "IPEHR   : 0x%04x\n",
	       i810_readw(IIR, mmio),
	       i810_readb(EIR, mmio),
	       i810_readl(PGTBL_ER, mmio),
	       i810_readl(IPEIR, mmio), 
	       i810_readl(IPEHR, mmio));
}
/** 
 * wait_for_engine_idle - waits for all hardware engines to finish
 * @par: pointer to i810fb_par structure
 *
 * DESCRIPTION:
 * This waits for lring(0), iring(1), and batch(3), etc to finish and
 * waits until ringbuffer is empty.
 */
static inline int wait_for_engine_idle(struct fb_info *info)
{
	struct i810fb_par *par = (struct i810fb_par *) info->par;
	u8 *mmio = par->mmio_start_virtual;
	int count = WAIT_COUNT;

	if (wait_for_space(info, par->iring.size)) /* flush */
		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;
}
Example #3
0
static inline void
i810_wait_for_blit_idle(I810DriverData *i810drv,
			I810DeviceData *i810dev )
{
	u32 count = 0;
		
	if (i810dev != NULL)
		i810dev->idle_calls++;
	
	while ((i810_readw(i810drv->mmio_base, INSTDONE) & 0x7b) != 0x7b &&
	       count++ < TIMER_LOOP) {
		if (i810dev != NULL)
			i810dev->idle_waitcycles++;
	}
	
	if (count >= TIMER_LOOP) {
		if (i810dev != NULL)
			i810dev->idle_timeoutsum++;
		D_BUG("warning: idle timeout exceeded");
	}
}