11 #include <linux/kernel.h>
12 #include <linux/string.h>
19 static u32 i810fb_rop[] = {
25 #define PUT_RING(n) { \
26 i810_writel(par->cur_tail, par->iring.virtual, n); \
28 par->cur_tail &= RING_SIZE_MASK; \
36 static inline void i810_report_error(
u8 __iomem *mmio)
70 (par->
iring.size - tail + head) >= space) ||
71 (tail < head && (head - tail) >= space)) {
75 printk(
"ringbuffer lockup!!!\n");
76 i810_report_error(mmio);
78 info->
pixmap.scan_align = 1;
90 static inline int wait_for_engine_idle(
struct fb_info *info)
96 if (wait_for_space(info, par->
iring.size))
102 printk(
"accel engine lockup!!!\n");
104 i810_report_error(mmio);
106 info->
pixmap.scan_align = 1;
118 static inline u32 begin_iring(
struct fb_info *info,
u32 space)
123 wait_for_engine_idle(info);
124 return wait_for_space(info, space);
135 static inline void end_iring(
struct i810fb_par *par)
161 static inline void source_copy_blit(
int dwidth,
int dheight,
int dpitch,
162 int xdir,
int src,
int dest,
int rop,
167 if (begin_iring(info, 24 +
IRING_PAD))
return;
196 int rop,
int what,
int blit_bpp,
201 if (begin_iring(info, 24 +
IRING_PAD))
return;
235 static inline void mono_src_copy_imm_blit(
int dwidth,
int dheight,
int dpitch,
236 int dsize,
int blit_bpp,
int rop,
237 int dest,
const u32 *src,
int bg,
242 if (begin_iring(info, 24 + (dsize << 2) +
IRING_PAD))
return;
256 static inline void load_front(
int offset,
struct fb_info *info)
260 if (begin_iring(info, 8 +
IRING_PAD))
return;
267 if (begin_iring(info, 8 +
IRING_PAD))
return;
314 rop = i810fb_rop[rect->
rop];
321 dest = info->
fix.smem_start + (dy * info->
fix.line_length) + dx;
322 color_blit(width, height, info->
fix.line_length, dest, rop,
color,
353 pitch = info->
fix.line_length;
356 pitch = (-(info->
fix.line_length)) & 0xFFFF;
360 src = info->
fix.smem_start + (sy * info->
fix.line_length) + sx;
361 dest = info->
fix.smem_start + (dy * info->
fix.line_length) + dx;
363 source_copy_blit(width, height, pitch, xdir, src, dest,
378 switch (info->
var.bits_per_pixel) {
390 dst = info->
fix.smem_start + (image->
dy * info->
fix.line_length) +
398 mono_src_copy_imm_blit(image->
width * par->
depth,
412 return wait_for_engine_idle(info);
423 load_front(offset, info);
441 wait_for_engine_idle(info);
442 i810fb_iring_enable(par,
OFF);
448 tmp1 = par->
iring.physical;
455 i810fb_iring_enable(par,
ON);