Commit 762dbb71 authored by James Simmons's avatar James Simmons

[FBDEV] Improved speed performance. We copy many bytes of data instead of just one at a time.

[IMSTT FBDEV] Fixed a bug that caused the hardware to lock up when scrolling.
parent 1fb277a5
......@@ -403,19 +403,19 @@ u8 sys_inbuf(u8 *src)
return *src;
}
void sys_outbuf(u8 src, u8 *dst)
void sys_outbuf(u8 *src, u8 *dst, unsigned int size)
{
*dst = src;
memcpy(dst, src, size);
}
void move_buf_aligned(struct fb_info *info, u8 *dst, u8 *src, u32 d_pitch,
u32 s_pitch, u32 height)
{
int i, j;
int i;
for (i = height; i--; ) {
for (j = 0; j < s_pitch; j++)
info->pixmap.outbuf(*src++, dst+j);
info->pixmap.outbuf(src, dst, s_pitch);
src += s_pitch;
dst += d_pitch;
}
}
......@@ -432,16 +432,19 @@ void move_buf_unaligned(struct fb_info *info, u8 *dst, u8 *src, u32 d_pitch,
tmp = info->pixmap.inbuf(dst+j);
tmp &= mask;
tmp |= *src >> shift_low;
info->pixmap.outbuf(tmp, dst+j);
info->pixmap.outbuf(*src << shift_high, dst+j+1);
info->pixmap.outbuf(&tmp, dst+j, 1);
tmp = *src << shift_high;
info->pixmap.outbuf(&tmp, dst+j+1, 1);
src++;
}
tmp = info->pixmap.inbuf(dst+idx);
tmp &= mask;
tmp |= *src >> shift_low;
info->pixmap.outbuf(tmp, dst+idx);
if (shift_high < mod)
info->pixmap.outbuf(*src<<shift_high, dst+idx+1);
info->pixmap.outbuf(&tmp, dst+idx, 1);
if (shift_high < mod) {
tmp = *src << shift_high;
info->pixmap.outbuf(&tmp, dst+idx+1, 1);
}
src++;
dst += d_pitch;
}
......@@ -467,10 +470,8 @@ u32 fb_get_buffer_offset(struct fb_info *info, u32 size)
offset = 0;
}
info->pixmap.offset = offset + size;
atomic_inc(&info->pixmap.count);
smp_mb__after_atomic_inc();
spin_unlock(&info->pixmap.lock);
return offset;
}
......@@ -678,7 +679,7 @@ int fb_show_logo(struct fb_info *info)
int x;
/* Return if the frame buffer is not mapped */
if (!info->fbops->fb_imageblit || fb_logo.logo == NULL)
if (fb_logo.logo == NULL)
return 0;
image.depth = fb_logo.depth;
......@@ -724,8 +725,8 @@ int fb_show_logo(struct fb_info *info)
x <= info->var.xres-fb_logo.logo->width; x += (fb_logo.logo->width + 8)) {
image.dx = x;
info->fbops->fb_imageblit(info, &image);
atomic_dec(&info->pixmap.count);
smp_mb__after_atomic_dec();
//atomic_dec(&info->pixmap.count);
//smp_mb__after_atomic_dec();
}
if (palette != NULL)
......
......@@ -409,7 +409,7 @@ static void imsttfb_remove(struct pci_dev *pdev);
static inline u32 read_reg_le32(volatile u32 *base, int regindex)
{
#ifdef __powerpc__
in_le32((volatile u32 *) (base + regindex));
return in_le32((volatile u32 *) (base + regindex));
#else
return readl(base + regindex);
#endif
......
......@@ -58,20 +58,19 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
if (info->cursor.enable) {
switch (info->cursor.rop) {
case ROP_XOR:
for (i = 0; i < size; i++)
for (i = 0; i < dsize; i++)
src[i] = cursor->image.data[i] ^ info->cursor.mask[i];
break;
case ROP_COPY:
default:
for (i = 0; i < size; i++)
for (i = 0; i < dsize; i++)
src[i] = cursor->image.data[i] & info->cursor.mask[i];
break;
}
} else
memcpy(src, cursor->image.data, size);
memcpy(src, cursor->image.data, dsize);
move_buf_aligned(info, dst, src, d_pitch, s_pitch, info->cursor.image.height);
info->cursor.image.data = dst;
info->fbops->fb_imageblit(info, &info->cursor.image);
......
......@@ -338,7 +338,8 @@ struct fb_pixmap {
__u32 buf_align; /* byte alignment of each bitmap */
__u32 scan_align; /* alignment per scanline */
__u32 flags; /* see FB_PIXMAP_* */
void (*outbuf)(u8 dst, u8 *addr); /* access methods */
/* access methods */
void (*outbuf)(u8 *dst, u8 *addr, unsigned int size);
u8 (*inbuf) (u8 *addr);
spinlock_t lock; /* spinlock */
atomic_t count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment