aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristoffer Ericson <kristoffer@Buttox.(none)>2009-04-09 00:02:13 +0200
committerKristoffer Ericson <kristoffer.ericson@gmail.com>2011-12-10 15:36:21 +0100
commita8958d478869bb84f060709b73d1e9227af663f5 (patch)
tree26df7593cbab1a1cc57b961f74e22351165d3e58
parent641243e4a51f49143090ca049f34e5e56b68881b (diff)
downloadlinux-hpc-a8958d478869bb84f060709b73d1e9227af663f5.tar.gz
drivers/video/s1d13xxxfb.c : Fix fill_rect bitblt accel * Fix earlier bug in fill_rect. We needed to set data stream to rectangle and not linear, hence our earlier problems with screen not clearing.
Seems to work fine now, and should offer some minor speedup for people.
-rw-r--r--drivers/video/s1d13xxxfb.c59
1 files changed, 39 insertions, 20 deletions
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
index c9f91a96258a47..7c4b290317d3ff 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -410,9 +410,11 @@ s1d13xxxfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
u8 bltbit_wait_bitset(struct fb_info *info, u8 bit, int timeout)
{
while (!(s1d13xxxfb_readreg(info->par, S1DREG_BBLT_CTL0) & bit)) {
- udelay(10);
- if (!--timeout)
- break;
+ udelay(10);
+ if (!--timeout) {
+ printk(KERN_ERR "s1d13xxxfb_bitblt : wait_bitset timeout\n");
+ break;
+ }
}
return timeout;
@@ -425,10 +427,12 @@ u8 bltbit_wait_bitset(struct fb_info *info, u8 bit, int timeout)
*/
u8 bltbit_wait_bitclear(struct fb_info *info, u8 bit, int timeout)
{
- while (s1d13xxxfb_readreg(info->par, S1DREG_BBLT_CTL0) & bit) {
- udelay(10);
- if (!--timeout)
- break;
+ while (s1d13xxxfb_readreg(info->par, S1DREG_BBLT_CTL0) & bit) {
+ udelay(10);
+ if (!--timeout) {
+ printk(KERN_ERR "s1d13xxxfb_bitblt : wait_bitclear timeout\n");
+ break;
+ }
}
return timeout;
@@ -469,33 +473,48 @@ u8 bltbit_fifo_status(struct fb_info *info)
void s1d13xxxfb_bitblt_solidfill(struct fb_info *info, const struct fb_fillrect *rect)
{
u32 screen_stride, dest;
-
- /* bits per width, what happens if this is odd number?*/
- screen_stride = (info->var.xres_virtual) * 2;
+
+ /* bytes per width line */
+ screen_stride = ((info->var.xres) * (info->var.bits_per_pixel >> 3));
+
/* bits to starting point */
- dest = (rect->dy * screen_stride) + (rect->dx * 2);
+ dest = ((rect->dy * screen_stride) + (info->var.bits_per_pixel >> 3));
+
+ printk(KERN_ERR "s1d13xxxfb_bitblt : request solid_fill\n"
+ " dx=%d, dy=%d, stride=%d, dest=%d\n"
+ " rect_width=%d, rect_height=%d\n",
+ rect->dx, rect->dy, screen_stride, dest,
+ rect->width, rect->height);
+
+ printk(KERN_ERR "s1d13xxxfb_bitblt : xres=%d, yres=%d, bpp=%d\n",
+ info->var.xres, info->var.yres,
+ info->var.bits_per_pixel);
/* We split the destination into the three registers */
s1d13xxxfb_writereg(info->par, S1DREG_BBLT_DST_START0, (dest & 0x00ff));
s1d13xxxfb_writereg(info->par, S1DREG_BBLT_DST_START1, ((dest >> 8) & 0x00ff));
s1d13xxxfb_writereg(info->par, S1DREG_BBLT_DST_START2, ((dest >> 16) & 0x00ff));
- /* give information regarding our rectangel size */
+ /* give information regarding rectangel width */
s1d13xxxfb_writereg(info->par, S1DREG_BBLT_WIDTH0, ((rect->width) & 0x00ff) - 1);
- s1d13xxxfb_writereg(info->par, S1DREG_BBLT_WIDTH1, ((rect->width) & 0xff00) >> 8);
-
+ s1d13xxxfb_writereg(info->par, S1DREG_BBLT_WIDTH1, (rect->width >> 8));
+
+ /* give information regarding rectangel height */
s1d13xxxfb_writereg(info->par, S1DREG_BBLT_HEIGHT0, ((rect->height) & 0x00ff) - 1);
- s1d13xxxfb_writereg(info->par, S1DREG_BBLT_HEIGHT1, ((rect->height) & 0xff00) >> 8);
-
+ s1d13xxxfb_writereg(info->par, S1DREG_BBLT_HEIGHT1, (rect->height >> 8));
+
/* set foreground color */
s1d13xxxfb_writereg(info->par, S1DREG_BBLT_FGC0, (rect->color) && 0x00ff);
- s1d13xxxfb_writereg(info->par, S1DREG_BBLT_FGC1, (rect->color) && 0xff00);
+ s1d13xxxfb_writereg(info->par, S1DREG_BBLT_FGC1, (rect->color >> 8));
+
+ /* set rectangual region of memory (rectangle and not linear) */
+ s1d13xxxfb_writereg(info->par, S1DREG_BBLT_CTL0, 0x0);
/* set operation mode SOLID_FILL */
s1d13xxxfb_writereg(info->par, S1DREG_BBLT_OP, BBLT_SOLID_FILL);
-
- /* set bits per pixel (1 = 16, 0 = 8) */
- s1d13xxxfb_writereg(info->par, S1DREG_BBLT_CTL1, (info->var.bits_per_pixel & 0x10));
+
+ /* set bits per pixel (1 = 16bpp, 0 = 8bpp) */
+ s1d13xxxfb_writereg(info->par, S1DREG_BBLT_CTL1, (info->var.bits_per_pixel >> 4));
/* set the memory offset for the bblt in word sizes */
s1d13xxxfb_writereg_w(info->par, S1DREG_BBLT_MEM_OFF0, (screen_stride >> 1));