aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via/accel.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2010-04-22 15:48:09 -0400
committerJonathan Corbet <corbet@lwn.net>2010-05-07 19:16:02 -0400
commit24b4d82e4715841848a499534ed5cb7db3d6bca3 (patch)
tree957c3664ac41da616e2aec7e8adb07247ee1a551 /drivers/video/via/accel.c
parentf045f77bc0bf238a871b10bea9e425329a8e4abc (diff)
viafb: Separate global and fb-specific data
This patch moves data of interest into a new viafb_dev structure which describes the device as a whole; the idea here is to create a separation between what all devices may need and what the framebuffer device in particular needs. I've also made some small steps toward thinning out the global.h mess. Cc: ScottFang@viatech.com.cn Cc: JosephChan@via.com.tw Cc: Harald Welte <laforge@gnumonks.org> Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/video/via/accel.c')
-rw-r--r--drivers/video/via/accel.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/video/via/accel.c b/drivers/video/via/accel.c
index 0d90c859cc1c..e77746857c8f 100644
--- a/drivers/video/via/accel.c
+++ b/drivers/video/via/accel.c
@@ -18,6 +18,7 @@
18 * Foundation, Inc., 18 * Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */ 20 */
21#include "via-core.h"
21#include "global.h" 22#include "global.h"
22 23
23/* 24/*
@@ -321,8 +322,7 @@ int viafb_init_engine(struct fb_info *info)
321 u32 vq_start_addr, vq_end_addr, vq_start_low, vq_end_low, vq_high, 322 u32 vq_start_addr, vq_end_addr, vq_start_low, vq_end_low, vq_high,
322 vq_len, chip_name = viapar->shared->chip_info.gfx_chip_name; 323 vq_len, chip_name = viapar->shared->chip_info.gfx_chip_name;
323 324
324 engine = ioremap_nocache(info->fix.mmio_start, info->fix.mmio_len); 325 engine = viapar->shared->vdev->engine_mmio;
325 viapar->shared->engine_mmio = engine;
326 if (!engine) { 326 if (!engine) {
327 printk(KERN_WARNING "viafb_init_accel: ioremap failed, " 327 printk(KERN_WARNING "viafb_init_accel: ioremap failed, "
328 "hardware acceleration disabled\n"); 328 "hardware acceleration disabled\n");
@@ -465,7 +465,7 @@ void viafb_show_hw_cursor(struct fb_info *info, int Status)
465 struct viafb_par *viapar = info->par; 465 struct viafb_par *viapar = info->par;
466 u32 temp, iga_path = viapar->iga_path; 466 u32 temp, iga_path = viapar->iga_path;
467 467
468 temp = readl(viapar->shared->engine_mmio + VIA_REG_CURSOR_MODE); 468 temp = readl(viapar->shared->vdev->engine_mmio + VIA_REG_CURSOR_MODE);
469 switch (Status) { 469 switch (Status) {
470 case HW_Cursor_ON: 470 case HW_Cursor_ON:
471 temp |= 0x1; 471 temp |= 0x1;
@@ -482,7 +482,7 @@ void viafb_show_hw_cursor(struct fb_info *info, int Status)
482 default: 482 default:
483 temp &= 0x7FFFFFFF; 483 temp &= 0x7FFFFFFF;
484 } 484 }
485 writel(temp, viapar->shared->engine_mmio + VIA_REG_CURSOR_MODE); 485 writel(temp, viapar->shared->vdev->engine_mmio + VIA_REG_CURSOR_MODE);
486} 486}
487 487
488void viafb_wait_engine_idle(struct fb_info *info) 488void viafb_wait_engine_idle(struct fb_info *info)
@@ -490,6 +490,7 @@ void viafb_wait_engine_idle(struct fb_info *info)
490 struct viafb_par *viapar = info->par; 490 struct viafb_par *viapar = info->par;
491 int loop = 0; 491 int loop = 0;
492 u32 mask; 492 u32 mask;
493 void __iomem *engine = viapar->shared->vdev->engine_mmio;
493 494
494 switch (viapar->shared->chip_info.twod_engine) { 495 switch (viapar->shared->chip_info.twod_engine) {
495 case VIA_2D_ENG_H5: 496 case VIA_2D_ENG_H5:
@@ -498,7 +499,7 @@ void viafb_wait_engine_idle(struct fb_info *info)
498 VIA_3D_ENG_BUSY_M1; 499 VIA_3D_ENG_BUSY_M1;
499 break; 500 break;
500 default: 501 default:
501 while (!(readl(viapar->shared->engine_mmio + VIA_REG_STATUS) & 502 while (!(readl(engine + VIA_REG_STATUS) &
502 VIA_VR_QUEUE_BUSY) && (loop < MAXLOOP)) { 503 VIA_VR_QUEUE_BUSY) && (loop < MAXLOOP)) {
503 loop++; 504 loop++;
504 cpu_relax(); 505 cpu_relax();
@@ -507,8 +508,7 @@ void viafb_wait_engine_idle(struct fb_info *info)
507 break; 508 break;
508 } 509 }
509 510
510 while ((readl(viapar->shared->engine_mmio + VIA_REG_STATUS) & mask) && 511 while ((readl(engine + VIA_REG_STATUS) & mask) && (loop < MAXLOOP)) {
511 (loop < MAXLOOP)) {
512 loop++; 512 loop++;
513 cpu_relax(); 513 cpu_relax();
514 } 514 }