aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/matrox/matroxfb_accel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/matrox/matroxfb_accel.c')
-rw-r--r--drivers/video/matrox/matroxfb_accel.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/drivers/video/matrox/matroxfb_accel.c b/drivers/video/matrox/matroxfb_accel.c
index 9c3aeee1cc4f..ed42bf6a0c15 100644
--- a/drivers/video/matrox/matroxfb_accel.c
+++ b/drivers/video/matrox/matroxfb_accel.c
@@ -81,7 +81,7 @@
81#include "matroxfb_Ti3026.h" 81#include "matroxfb_Ti3026.h"
82#include "matroxfb_misc.h" 82#include "matroxfb_misc.h"
83 83
84#define curr_ydstorg(x) ACCESS_FBINFO2(x, curr.ydstorg.pixels) 84#define curr_ydstorg(x) ((x)->curr.ydstorg.pixels)
85 85
86#define mga_ydstlen(y,l) mga_outl(M_YDSTLEN | M_EXEC, ((y) << 16) | (l)) 86#define mga_ydstlen(y,l) mga_outl(M_YDSTLEN | M_EXEC, ((y) << 16) | (l))
87 87
@@ -115,59 +115,59 @@ void matrox_cfbX_init(WPMINFO2) {
115 115
116 DBG(__func__) 116 DBG(__func__)
117 117
118 mpitch = ACCESS_FBINFO(fbcon).var.xres_virtual; 118 mpitch = minfo->fbcon.var.xres_virtual;
119 119
120 ACCESS_FBINFO(fbops).fb_copyarea = cfb_copyarea; 120 minfo->fbops.fb_copyarea = cfb_copyarea;
121 ACCESS_FBINFO(fbops).fb_fillrect = cfb_fillrect; 121 minfo->fbops.fb_fillrect = cfb_fillrect;
122 ACCESS_FBINFO(fbops).fb_imageblit = cfb_imageblit; 122 minfo->fbops.fb_imageblit = cfb_imageblit;
123 ACCESS_FBINFO(fbops).fb_cursor = NULL; 123 minfo->fbops.fb_cursor = NULL;
124 124
125 accel = (ACCESS_FBINFO(fbcon).var.accel_flags & FB_ACCELF_TEXT) == FB_ACCELF_TEXT; 125 accel = (minfo->fbcon.var.accel_flags & FB_ACCELF_TEXT) == FB_ACCELF_TEXT;
126 126
127 switch (ACCESS_FBINFO(fbcon).var.bits_per_pixel) { 127 switch (minfo->fbcon.var.bits_per_pixel) {
128 case 4: maccess = 0x00000000; /* accelerate as 8bpp video */ 128 case 4: maccess = 0x00000000; /* accelerate as 8bpp video */
129 mpitch = (mpitch >> 1) | 0x8000; /* disable linearization */ 129 mpitch = (mpitch >> 1) | 0x8000; /* disable linearization */
130 mopmode = M_OPMODE_4BPP; 130 mopmode = M_OPMODE_4BPP;
131 matrox_cfb4_pal(ACCESS_FBINFO(cmap)); 131 matrox_cfb4_pal(minfo->cmap);
132 if (accel && !(mpitch & 1)) { 132 if (accel && !(mpitch & 1)) {
133 ACCESS_FBINFO(fbops).fb_copyarea = matroxfb_cfb4_copyarea; 133 minfo->fbops.fb_copyarea = matroxfb_cfb4_copyarea;
134 ACCESS_FBINFO(fbops).fb_fillrect = matroxfb_cfb4_fillrect; 134 minfo->fbops.fb_fillrect = matroxfb_cfb4_fillrect;
135 } 135 }
136 break; 136 break;
137 case 8: maccess = 0x00000000; 137 case 8: maccess = 0x00000000;
138 mopmode = M_OPMODE_8BPP; 138 mopmode = M_OPMODE_8BPP;
139 matrox_cfb8_pal(ACCESS_FBINFO(cmap)); 139 matrox_cfb8_pal(minfo->cmap);
140 if (accel) { 140 if (accel) {
141 ACCESS_FBINFO(fbops).fb_copyarea = matroxfb_copyarea; 141 minfo->fbops.fb_copyarea = matroxfb_copyarea;
142 ACCESS_FBINFO(fbops).fb_fillrect = matroxfb_fillrect; 142 minfo->fbops.fb_fillrect = matroxfb_fillrect;
143 ACCESS_FBINFO(fbops).fb_imageblit = matroxfb_imageblit; 143 minfo->fbops.fb_imageblit = matroxfb_imageblit;
144 } 144 }
145 break; 145 break;
146 case 16: if (ACCESS_FBINFO(fbcon).var.green.length == 5) 146 case 16: if (minfo->fbcon.var.green.length == 5)
147 maccess = 0xC0000001; 147 maccess = 0xC0000001;
148 else 148 else
149 maccess = 0x40000001; 149 maccess = 0x40000001;
150 mopmode = M_OPMODE_16BPP; 150 mopmode = M_OPMODE_16BPP;
151 if (accel) { 151 if (accel) {
152 ACCESS_FBINFO(fbops).fb_copyarea = matroxfb_copyarea; 152 minfo->fbops.fb_copyarea = matroxfb_copyarea;
153 ACCESS_FBINFO(fbops).fb_fillrect = matroxfb_fillrect; 153 minfo->fbops.fb_fillrect = matroxfb_fillrect;
154 ACCESS_FBINFO(fbops).fb_imageblit = matroxfb_imageblit; 154 minfo->fbops.fb_imageblit = matroxfb_imageblit;
155 } 155 }
156 break; 156 break;
157 case 24: maccess = 0x00000003; 157 case 24: maccess = 0x00000003;
158 mopmode = M_OPMODE_24BPP; 158 mopmode = M_OPMODE_24BPP;
159 if (accel) { 159 if (accel) {
160 ACCESS_FBINFO(fbops).fb_copyarea = matroxfb_copyarea; 160 minfo->fbops.fb_copyarea = matroxfb_copyarea;
161 ACCESS_FBINFO(fbops).fb_fillrect = matroxfb_fillrect; 161 minfo->fbops.fb_fillrect = matroxfb_fillrect;
162 ACCESS_FBINFO(fbops).fb_imageblit = matroxfb_imageblit; 162 minfo->fbops.fb_imageblit = matroxfb_imageblit;
163 } 163 }
164 break; 164 break;
165 case 32: maccess = 0x00000002; 165 case 32: maccess = 0x00000002;
166 mopmode = M_OPMODE_32BPP; 166 mopmode = M_OPMODE_32BPP;
167 if (accel) { 167 if (accel) {
168 ACCESS_FBINFO(fbops).fb_copyarea = matroxfb_copyarea; 168 minfo->fbops.fb_copyarea = matroxfb_copyarea;
169 ACCESS_FBINFO(fbops).fb_fillrect = matroxfb_fillrect; 169 minfo->fbops.fb_fillrect = matroxfb_fillrect;
170 ACCESS_FBINFO(fbops).fb_imageblit = matroxfb_imageblit; 170 minfo->fbops.fb_imageblit = matroxfb_imageblit;
171 } 171 }
172 break; 172 break;
173 default: maccess = 0x00000000; 173 default: maccess = 0x00000000;
@@ -176,10 +176,10 @@ void matrox_cfbX_init(WPMINFO2) {
176 } 176 }
177 mga_fifo(8); 177 mga_fifo(8);
178 mga_outl(M_PITCH, mpitch); 178 mga_outl(M_PITCH, mpitch);
179 mga_outl(M_YDSTORG, curr_ydstorg(MINFO)); 179 mga_outl(M_YDSTORG, curr_ydstorg(minfo));
180 if (ACCESS_FBINFO(capable.plnwt)) 180 if (minfo->capable.plnwt)
181 mga_outl(M_PLNWT, -1); 181 mga_outl(M_PLNWT, -1);
182 if (ACCESS_FBINFO(capable.srcorg)) { 182 if (minfo->capable.srcorg) {
183 mga_outl(M_SRCORG, 0); 183 mga_outl(M_SRCORG, 0);
184 mga_outl(M_DSTORG, 0); 184 mga_outl(M_DSTORG, 0);
185 } 185 }
@@ -188,9 +188,9 @@ void matrox_cfbX_init(WPMINFO2) {
188 mga_outl(M_YTOP, 0); 188 mga_outl(M_YTOP, 0);
189 mga_outl(M_YBOT, 0x01FFFFFF); 189 mga_outl(M_YBOT, 0x01FFFFFF);
190 mga_outl(M_MACCESS, maccess); 190 mga_outl(M_MACCESS, maccess);
191 ACCESS_FBINFO(accel.m_dwg_rect) = M_DWG_TRAP | M_DWG_SOLID | M_DWG_ARZERO | M_DWG_SGNZERO | M_DWG_SHIFTZERO; 191 minfo->accel.m_dwg_rect = M_DWG_TRAP | M_DWG_SOLID | M_DWG_ARZERO | M_DWG_SGNZERO | M_DWG_SHIFTZERO;
192 if (isMilleniumII(MINFO)) ACCESS_FBINFO(accel.m_dwg_rect) |= M_DWG_TRANSC; 192 if (isMilleniumII(minfo)) minfo->accel.m_dwg_rect |= M_DWG_TRANSC;
193 ACCESS_FBINFO(accel.m_opmode) = mopmode; 193 minfo->accel.m_opmode = mopmode;
194} 194}
195 195
196EXPORT_SYMBOL(matrox_cfbX_init); 196EXPORT_SYMBOL(matrox_cfbX_init);
@@ -209,7 +209,7 @@ static void matrox_accel_bmove(WPMINFO int vxres, int sy, int sx, int dy, int dx
209 M_DWG_BFCOL | M_DWG_REPLACE); 209 M_DWG_BFCOL | M_DWG_REPLACE);
210 mga_outl(M_AR5, vxres); 210 mga_outl(M_AR5, vxres);
211 width--; 211 width--;
212 start = sy*vxres+sx+curr_ydstorg(MINFO); 212 start = sy*vxres+sx+curr_ydstorg(minfo);
213 end = start+width; 213 end = start+width;
214 } else { 214 } else {
215 mga_fifo(3); 215 mga_fifo(3);
@@ -217,7 +217,7 @@ static void matrox_accel_bmove(WPMINFO int vxres, int sy, int sx, int dy, int dx
217 mga_outl(M_SGN, 5); 217 mga_outl(M_SGN, 5);
218 mga_outl(M_AR5, -vxres); 218 mga_outl(M_AR5, -vxres);
219 width--; 219 width--;
220 end = (sy+height-1)*vxres+sx+curr_ydstorg(MINFO); 220 end = (sy+height-1)*vxres+sx+curr_ydstorg(minfo);
221 start = end+width; 221 start = end+width;
222 dy += height-1; 222 dy += height-1;
223 } 223 }
@@ -245,7 +245,7 @@ static void matrox_accel_bmove_lin(WPMINFO int vxres, int sy, int sx, int dy, in
245 M_DWG_BFCOL | M_DWG_REPLACE); 245 M_DWG_BFCOL | M_DWG_REPLACE);
246 mga_outl(M_AR5, vxres); 246 mga_outl(M_AR5, vxres);
247 width--; 247 width--;
248 start = sy*vxres+sx+curr_ydstorg(MINFO); 248 start = sy*vxres+sx+curr_ydstorg(minfo);
249 end = start+width; 249 end = start+width;
250 } else { 250 } else {
251 mga_fifo(3); 251 mga_fifo(3);
@@ -253,7 +253,7 @@ static void matrox_accel_bmove_lin(WPMINFO int vxres, int sy, int sx, int dy, in
253 mga_outl(M_SGN, 5); 253 mga_outl(M_SGN, 5);
254 mga_outl(M_AR5, -vxres); 254 mga_outl(M_AR5, -vxres);
255 width--; 255 width--;
256 end = (sy+height-1)*vxres+sx+curr_ydstorg(MINFO); 256 end = (sy+height-1)*vxres+sx+curr_ydstorg(minfo);
257 start = end+width; 257 start = end+width;
258 dy += height-1; 258 dy += height-1;
259 } 259 }
@@ -274,13 +274,13 @@ static void matroxfb_cfb4_copyarea(struct fb_info* info, const struct fb_copyare
274 if ((area->sx | area->dx | area->width) & 1) 274 if ((area->sx | area->dx | area->width) & 1)
275 cfb_copyarea(info, area); 275 cfb_copyarea(info, area);
276 else 276 else
277 matrox_accel_bmove_lin(PMINFO ACCESS_FBINFO(fbcon.var.xres_virtual) >> 1, area->sy, area->sx >> 1, area->dy, area->dx >> 1, area->height, area->width >> 1); 277 matrox_accel_bmove_lin(PMINFO minfo->fbcon.var.xres_virtual >> 1, area->sy, area->sx >> 1, area->dy, area->dx >> 1, area->height, area->width >> 1);
278} 278}
279 279
280static void matroxfb_copyarea(struct fb_info* info, const struct fb_copyarea* area) { 280static void matroxfb_copyarea(struct fb_info* info, const struct fb_copyarea* area) {
281 MINFO_FROM_INFO(info); 281 MINFO_FROM_INFO(info);
282 282
283 matrox_accel_bmove(PMINFO ACCESS_FBINFO(fbcon.var.xres_virtual), area->sy, area->sx, area->dy, area->dx, area->height, area->width); 283 matrox_accel_bmove(PMINFO minfo->fbcon.var.xres_virtual, area->sy, area->sx, area->dy, area->dx, area->height, area->width);
284} 284}
285 285
286static void matroxfb_accel_clear(WPMINFO u_int32_t color, int sy, int sx, int height, 286static void matroxfb_accel_clear(WPMINFO u_int32_t color, int sy, int sx, int height,
@@ -292,7 +292,7 @@ static void matroxfb_accel_clear(WPMINFO u_int32_t color, int sy, int sx, int he
292 CRITBEGIN 292 CRITBEGIN
293 293
294 mga_fifo(5); 294 mga_fifo(5);
295 mga_outl(M_DWGCTL, ACCESS_FBINFO(accel.m_dwg_rect) | M_DWG_REPLACE); 295 mga_outl(M_DWGCTL, minfo->accel.m_dwg_rect | M_DWG_REPLACE);
296 mga_outl(M_FCOL, color); 296 mga_outl(M_FCOL, color);
297 mga_outl(M_FXBNDRY, ((sx + width) << 16) | sx); 297 mga_outl(M_FXBNDRY, ((sx + width) << 16) | sx);
298 mga_ydstlen(sy, height); 298 mga_ydstlen(sy, height);
@@ -333,16 +333,16 @@ static void matroxfb_cfb4_clear(WPMINFO u_int32_t bgx, int sy, int sx, int heigh
333 sx >>= 1; 333 sx >>= 1;
334 if (width) { 334 if (width) {
335 mga_fifo(5); 335 mga_fifo(5);
336 mga_outl(M_DWGCTL, ACCESS_FBINFO(accel.m_dwg_rect) | M_DWG_REPLACE2); 336 mga_outl(M_DWGCTL, minfo->accel.m_dwg_rect | M_DWG_REPLACE2);
337 mga_outl(M_FCOL, bgx); 337 mga_outl(M_FCOL, bgx);
338 mga_outl(M_FXBNDRY, ((sx + width) << 16) | sx); 338 mga_outl(M_FXBNDRY, ((sx + width) << 16) | sx);
339 mga_outl(M_YDST, sy * ACCESS_FBINFO(fbcon).var.xres_virtual >> 6); 339 mga_outl(M_YDST, sy * minfo->fbcon.var.xres_virtual >> 6);
340 mga_outl(M_LEN | M_EXEC, height); 340 mga_outl(M_LEN | M_EXEC, height);
341 WaitTillIdle(); 341 WaitTillIdle();
342 } 342 }
343 if (whattodo) { 343 if (whattodo) {
344 u_int32_t step = ACCESS_FBINFO(fbcon).var.xres_virtual >> 1; 344 u_int32_t step = minfo->fbcon.var.xres_virtual >> 1;
345 vaddr_t vbase = ACCESS_FBINFO(video.vbase); 345 vaddr_t vbase = minfo->video.vbase;
346 if (whattodo & 1) { 346 if (whattodo & 1) {
347 unsigned int uaddr = sy * step + sx - 1; 347 unsigned int uaddr = sy * step + sx - 1;
348 u_int32_t loop; 348 u_int32_t loop;
@@ -412,7 +412,7 @@ static void matroxfb_1bpp_imageblit(WPMINFO u_int32_t fgx, u_int32_t bgx,
412 mga_outl(M_FCOL, fgx); 412 mga_outl(M_FCOL, fgx);
413 mga_outl(M_BCOL, bgx); 413 mga_outl(M_BCOL, bgx);
414 fxbndry = ((xx + width - 1) << 16) | xx; 414 fxbndry = ((xx + width - 1) << 16) | xx;
415 mmio = ACCESS_FBINFO(mmio.vbase); 415 mmio = minfo->mmio.vbase;
416 416
417 mga_fifo(6); 417 mga_fifo(6);
418 mga_writel(mmio, M_FXBNDRY, fxbndry); 418 mga_writel(mmio, M_FXBNDRY, fxbndry);