aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2007-10-16 04:29:16 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:18 -0400
commit1ddc28d7e7cb5f501e224a5868d34442c6203eb1 (patch)
treea581e0703d47c96df28363a5d562072d410456f0
parent2a36f9c497a907dd706e1eb2a7c00ced6105d65b (diff)
pm2fb: panning and hardware cursor fixes
This patch: - disallows setting of virtual height above 2048 as it does not work for accelerated copyarea and imageblit - fixes blinking of pm2v cursor by pushing cursor outside the display (x=2047) - fixes hardware cursor position on Permedia 2 chips with panning enabled - enables hardware cursor by default Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/video/pm2fb.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index 20476f4c43ae..9db1f2e1dadf 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -66,7 +66,7 @@
66/* 66/*
67 * Driver data 67 * Driver data
68 */ 68 */
69static int hwcursor; 69static int hwcursor = 1;
70static char *mode __devinitdata; 70static char *mode __devinitdata;
71 71
72/* 72/*
@@ -587,6 +587,11 @@ static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
587 return -EINVAL; 587 return -EINVAL;
588 } 588 }
589 589
590 /* permedia cannot blit over 2048 */
591 if (var->yres_virtual > 2047) {
592 var->yres_virtual = 2047;
593 }
594
590 if (var->xoffset) { 595 if (var->xoffset) {
591 DPRINTK("xoffset not supported\n"); 596 DPRINTK("xoffset not supported\n");
592 return -EINVAL; 597 return -EINVAL;
@@ -1258,12 +1263,21 @@ static int pm2vfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1258{ 1263{
1259 struct pm2fb_par *par = info->par; 1264 struct pm2fb_par *par = info->par;
1260 u8 mode = PM2F_CURSORMODE_TYPE_X; 1265 u8 mode = PM2F_CURSORMODE_TYPE_X;
1266 int x = cursor->image.dx - info->var.xoffset;
1267 int y = cursor->image.dy - info->var.yoffset;
1261 1268
1262 if (cursor->enable) 1269 if (cursor->enable)
1263 mode |= PM2F_CURSORMODE_CURSOR_ENABLE; 1270 mode |= PM2F_CURSORMODE_CURSOR_ENABLE;
1264 1271
1265 pm2v_RDAC_WR(par, PM2VI_RD_CURSOR_MODE, mode); 1272 pm2v_RDAC_WR(par, PM2VI_RD_CURSOR_MODE, mode);
1266 1273
1274 if (!cursor->enable)
1275 x = 2047; /* push it outside display */
1276 pm2v_RDAC_WR(par, PM2VI_RD_CURSOR_X_LOW, x & 0xff);
1277 pm2v_RDAC_WR(par, PM2VI_RD_CURSOR_X_HIGH, (x >> 8) & 0xf);
1278 pm2v_RDAC_WR(par, PM2VI_RD_CURSOR_Y_LOW, y & 0xff);
1279 pm2v_RDAC_WR(par, PM2VI_RD_CURSOR_Y_HIGH, (y >> 8) & 0xf);
1280
1267 /* 1281 /*
1268 * If the cursor is not be changed this means either we want the 1282 * If the cursor is not be changed this means either we want the
1269 * current cursor state (if enable is set) or we want to query what 1283 * current cursor state (if enable is set) or we want to query what
@@ -1272,16 +1286,6 @@ static int pm2vfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1272 if (!cursor->set) 1286 if (!cursor->set)
1273 return 0; 1287 return 0;
1274 1288
1275 if (cursor->set & FB_CUR_SETPOS) {
1276 int x = cursor->image.dx - info->var.xoffset;
1277 int y = cursor->image.dy - info->var.yoffset;
1278
1279 pm2v_RDAC_WR(par, PM2VI_RD_CURSOR_X_LOW, x & 0xff);
1280 pm2v_RDAC_WR(par, PM2VI_RD_CURSOR_X_HIGH, (x >> 8) & 0xf);
1281 pm2v_RDAC_WR(par, PM2VI_RD_CURSOR_Y_LOW, y & 0xff);
1282 pm2v_RDAC_WR(par, PM2VI_RD_CURSOR_Y_HIGH, (y >> 8) & 0xf);
1283 }
1284
1285 if (cursor->set & FB_CUR_SETHOT) { 1289 if (cursor->set & FB_CUR_SETHOT) {
1286 pm2v_RDAC_WR(par, PM2VI_RD_CURSOR_X_HOT, 1290 pm2v_RDAC_WR(par, PM2VI_RD_CURSOR_X_HOT,
1287 cursor->hot.x & 0x3f); 1291 cursor->hot.x & 0x3f);
@@ -1373,7 +1377,7 @@ static int pm2fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1373 if (par->type == PM2_TYPE_PERMEDIA2V) 1377 if (par->type == PM2_TYPE_PERMEDIA2V)
1374 return pm2vfb_cursor(info, cursor); 1378 return pm2vfb_cursor(info, cursor);
1375 1379
1376 mode = 0; 1380 mode = 0x40;
1377 if (cursor->enable) 1381 if (cursor->enable)
1378 mode = 0x43; 1382 mode = 0x43;
1379 1383
@@ -1388,10 +1392,9 @@ static int pm2fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1388 return 0; 1392 return 0;
1389 1393
1390 if (cursor->set & FB_CUR_SETPOS) { 1394 if (cursor->set & FB_CUR_SETPOS) {
1391 int x, y; 1395 int x = cursor->image.dx - info->var.xoffset + 63;
1396 int y = cursor->image.dy - info->var.yoffset + 63;
1392 1397
1393 x = cursor->image.dx + 63;
1394 y = cursor->image.dy + 63;
1395 WAIT_FIFO(par, 4); 1398 WAIT_FIFO(par, 4);
1396 pm2_WR(par, PM2R_RD_CURSOR_X_LSB, x & 0xff); 1399 pm2_WR(par, PM2R_RD_CURSOR_X_LSB, x & 0xff);
1397 pm2_WR(par, PM2R_RD_CURSOR_X_MSB, (x >> 8) & 0x7); 1400 pm2_WR(par, PM2R_RD_CURSOR_X_MSB, (x >> 8) & 0x7);
@@ -1838,7 +1841,7 @@ module_param(noaccel, bool, 0);
1838MODULE_PARM_DESC(noaccel, "Disable acceleration"); 1841MODULE_PARM_DESC(noaccel, "Disable acceleration");
1839module_param(hwcursor, int, 0644); 1842module_param(hwcursor, int, 0644);
1840MODULE_PARM_DESC(hwcursor, "Enable hardware cursor " 1843MODULE_PARM_DESC(hwcursor, "Enable hardware cursor "
1841 "(1=enable, 0=disable, default=0)"); 1844 "(1=enable, 0=disable, default=1)");
1842#ifdef CONFIG_MTRR 1845#ifdef CONFIG_MTRR
1843module_param(nomtrr, bool, 0); 1846module_param(nomtrr, bool, 0);
1844MODULE_PARM_DESC(nomtrr, "Disable MTRR support (0 or 1=disabled) (default=0)"); 1847MODULE_PARM_DESC(nomtrr, "Disable MTRR support (0 or 1=disabled) (default=0)");