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,22 +403,22 @@ u8 sys_inbuf(u8 *src) ...@@ -403,22 +403,22 @@ u8 sys_inbuf(u8 *src)
return *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, void move_buf_aligned(struct fb_info *info, u8 *dst, u8 *src, u32 d_pitch,
u32 s_pitch, u32 height) u32 s_pitch, u32 height)
{ {
int i, j; int i;
for (i = height; i--; ) { for (i = height; i--; ) {
for (j = 0; j < s_pitch; j++) info->pixmap.outbuf(src, dst, s_pitch);
info->pixmap.outbuf(*src++, dst+j); src += s_pitch;
dst += d_pitch; dst += d_pitch;
} }
} }
void move_buf_unaligned(struct fb_info *info, u8 *dst, u8 *src, u32 d_pitch, void move_buf_unaligned(struct fb_info *info, u8 *dst, u8 *src, u32 d_pitch,
u32 height, u32 mask, u32 shift_high, u32 shift_low, u32 height, u32 mask, u32 shift_high, u32 shift_low,
...@@ -432,20 +432,23 @@ void move_buf_unaligned(struct fb_info *info, u8 *dst, u8 *src, u32 d_pitch, ...@@ -432,20 +432,23 @@ void move_buf_unaligned(struct fb_info *info, u8 *dst, u8 *src, u32 d_pitch,
tmp = info->pixmap.inbuf(dst+j); tmp = info->pixmap.inbuf(dst+j);
tmp &= mask; tmp &= mask;
tmp |= *src >> shift_low; tmp |= *src >> shift_low;
info->pixmap.outbuf(tmp, dst+j); info->pixmap.outbuf(&tmp, dst+j, 1);
info->pixmap.outbuf(*src << shift_high, dst+j+1); tmp = *src << shift_high;
info->pixmap.outbuf(&tmp, dst+j+1, 1);
src++; src++;
} }
tmp = info->pixmap.inbuf(dst+idx); tmp = info->pixmap.inbuf(dst+idx);
tmp &= mask; tmp &= mask;
tmp |= *src >> shift_low; tmp |= *src >> shift_low;
info->pixmap.outbuf(tmp, dst+idx); info->pixmap.outbuf(&tmp, dst+idx, 1);
if (shift_high < mod) if (shift_high < mod) {
info->pixmap.outbuf(*src<<shift_high, dst+idx+1); tmp = *src << shift_high;
info->pixmap.outbuf(&tmp, dst+idx+1, 1);
}
src++; src++;
dst += d_pitch; dst += d_pitch;
} }
} }
/* /*
* we need to lock this section since fb_cursor * we need to lock this section since fb_cursor
...@@ -467,10 +470,8 @@ u32 fb_get_buffer_offset(struct fb_info *info, u32 size) ...@@ -467,10 +470,8 @@ u32 fb_get_buffer_offset(struct fb_info *info, u32 size)
offset = 0; offset = 0;
} }
info->pixmap.offset = offset + size; info->pixmap.offset = offset + size;
atomic_inc(&info->pixmap.count); atomic_inc(&info->pixmap.count);
smp_mb__after_atomic_inc(); smp_mb__after_atomic_inc();
spin_unlock(&info->pixmap.lock); spin_unlock(&info->pixmap.lock);
return offset; return offset;
} }
...@@ -678,7 +679,7 @@ int fb_show_logo(struct fb_info *info) ...@@ -678,7 +679,7 @@ int fb_show_logo(struct fb_info *info)
int x; int x;
/* Return if the frame buffer is not mapped */ /* Return if the frame buffer is not mapped */
if (!info->fbops->fb_imageblit || fb_logo.logo == NULL) if (fb_logo.logo == NULL)
return 0; return 0;
image.depth = fb_logo.depth; image.depth = fb_logo.depth;
...@@ -724,8 +725,8 @@ int fb_show_logo(struct fb_info *info) ...@@ -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)) { x <= info->var.xres-fb_logo.logo->width; x += (fb_logo.logo->width + 8)) {
image.dx = x; image.dx = x;
info->fbops->fb_imageblit(info, &image); info->fbops->fb_imageblit(info, &image);
atomic_dec(&info->pixmap.count); //atomic_dec(&info->pixmap.count);
smp_mb__after_atomic_dec(); //smp_mb__after_atomic_dec();
} }
if (palette != NULL) if (palette != NULL)
......
...@@ -409,7 +409,7 @@ static void imsttfb_remove(struct pci_dev *pdev); ...@@ -409,7 +409,7 @@ static void imsttfb_remove(struct pci_dev *pdev);
static inline u32 read_reg_le32(volatile u32 *base, int regindex) static inline u32 read_reg_le32(volatile u32 *base, int regindex)
{ {
#ifdef __powerpc__ #ifdef __powerpc__
in_le32((volatile u32 *) (base + regindex)); return in_le32((volatile u32 *) (base + regindex));
#else #else
return readl(base + regindex); return readl(base + regindex);
#endif #endif
......
...@@ -58,20 +58,19 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -58,20 +58,19 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
if (info->cursor.enable) { if (info->cursor.enable) {
switch (info->cursor.rop) { switch (info->cursor.rop) {
case ROP_XOR: 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]; src[i] = cursor->image.data[i] ^ info->cursor.mask[i];
break; break;
case ROP_COPY: case ROP_COPY:
default: default:
for (i = 0; i < size; i++) for (i = 0; i < dsize; i++)
src[i] = cursor->image.data[i] & info->cursor.mask[i]; src[i] = cursor->image.data[i] & info->cursor.mask[i];
break; break;
} }
} else } 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); move_buf_aligned(info, dst, src, d_pitch, s_pitch, info->cursor.image.height);
info->cursor.image.data = dst; info->cursor.image.data = dst;
info->fbops->fb_imageblit(info, &info->cursor.image); info->fbops->fb_imageblit(info, &info->cursor.image);
......
...@@ -338,7 +338,8 @@ struct fb_pixmap { ...@@ -338,7 +338,8 @@ struct fb_pixmap {
__u32 buf_align; /* byte alignment of each bitmap */ __u32 buf_align; /* byte alignment of each bitmap */
__u32 scan_align; /* alignment per scanline */ __u32 scan_align; /* alignment per scanline */
__u32 flags; /* see FB_PIXMAP_* */ __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); u8 (*inbuf) (u8 *addr);
spinlock_t lock; /* spinlock */ spinlock_t lock; /* spinlock */
atomic_t count; 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