aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/matrox
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/matrox')
-rw-r--r--drivers/video/matrox/matroxfb_accel.c38
-rw-r--r--drivers/video/matrox/matroxfb_base.h2
2 files changed, 30 insertions, 10 deletions
diff --git a/drivers/video/matrox/matroxfb_accel.c b/drivers/video/matrox/matroxfb_accel.c
index 8335a6fe303e..0d5cb85d071a 100644
--- a/drivers/video/matrox/matroxfb_accel.c
+++ b/drivers/video/matrox/matroxfb_accel.c
@@ -192,10 +192,18 @@ void matrox_cfbX_init(struct matrox_fb_info *minfo)
192 minfo->accel.m_dwg_rect = M_DWG_TRAP | M_DWG_SOLID | M_DWG_ARZERO | M_DWG_SGNZERO | M_DWG_SHIFTZERO; 192 minfo->accel.m_dwg_rect = M_DWG_TRAP | M_DWG_SOLID | M_DWG_ARZERO | M_DWG_SGNZERO | M_DWG_SHIFTZERO;
193 if (isMilleniumII(minfo)) minfo->accel.m_dwg_rect |= M_DWG_TRANSC; 193 if (isMilleniumII(minfo)) minfo->accel.m_dwg_rect |= M_DWG_TRANSC;
194 minfo->accel.m_opmode = mopmode; 194 minfo->accel.m_opmode = mopmode;
195 minfo->accel.m_access = maccess;
196 minfo->accel.m_pitch = mpitch;
195} 197}
196 198
197EXPORT_SYMBOL(matrox_cfbX_init); 199EXPORT_SYMBOL(matrox_cfbX_init);
198 200
201static void matrox_accel_restore_maccess(struct matrox_fb_info *minfo)
202{
203 mga_outl(M_MACCESS, minfo->accel.m_access);
204 mga_outl(M_PITCH, minfo->accel.m_pitch);
205}
206
199static void matrox_accel_bmove(struct matrox_fb_info *minfo, int vxres, int sy, 207static void matrox_accel_bmove(struct matrox_fb_info *minfo, int vxres, int sy,
200 int sx, int dy, int dx, int height, int width) 208 int sx, int dy, int dx, int height, int width)
201{ 209{
@@ -207,7 +215,8 @@ static void matrox_accel_bmove(struct matrox_fb_info *minfo, int vxres, int sy,
207 CRITBEGIN 215 CRITBEGIN
208 216
209 if ((dy < sy) || ((dy == sy) && (dx <= sx))) { 217 if ((dy < sy) || ((dy == sy) && (dx <= sx))) {
210 mga_fifo(2); 218 mga_fifo(4);
219 matrox_accel_restore_maccess(minfo);
211 mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_SGNZERO | 220 mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_SGNZERO |
212 M_DWG_BFCOL | M_DWG_REPLACE); 221 M_DWG_BFCOL | M_DWG_REPLACE);
213 mga_outl(M_AR5, vxres); 222 mga_outl(M_AR5, vxres);
@@ -215,7 +224,8 @@ static void matrox_accel_bmove(struct matrox_fb_info *minfo, int vxres, int sy,
215 start = sy*vxres+sx+curr_ydstorg(minfo); 224 start = sy*vxres+sx+curr_ydstorg(minfo);
216 end = start+width; 225 end = start+width;
217 } else { 226 } else {
218 mga_fifo(3); 227 mga_fifo(5);
228 matrox_accel_restore_maccess(minfo);
219 mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_BFCOL | M_DWG_REPLACE); 229 mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_BFCOL | M_DWG_REPLACE);
220 mga_outl(M_SGN, 5); 230 mga_outl(M_SGN, 5);
221 mga_outl(M_AR5, -vxres); 231 mga_outl(M_AR5, -vxres);
@@ -224,7 +234,8 @@ static void matrox_accel_bmove(struct matrox_fb_info *minfo, int vxres, int sy,
224 start = end+width; 234 start = end+width;
225 dy += height-1; 235 dy += height-1;
226 } 236 }
227 mga_fifo(4); 237 mga_fifo(6);
238 matrox_accel_restore_maccess(minfo);
228 mga_outl(M_AR0, end); 239 mga_outl(M_AR0, end);
229 mga_outl(M_AR3, start); 240 mga_outl(M_AR3, start);
230 mga_outl(M_FXBNDRY, ((dx+width)<<16) | dx); 241 mga_outl(M_FXBNDRY, ((dx+width)<<16) | dx);
@@ -246,7 +257,8 @@ static void matrox_accel_bmove_lin(struct matrox_fb_info *minfo, int vxres,
246 CRITBEGIN 257 CRITBEGIN
247 258
248 if ((dy < sy) || ((dy == sy) && (dx <= sx))) { 259 if ((dy < sy) || ((dy == sy) && (dx <= sx))) {
249 mga_fifo(2); 260 mga_fifo(4);
261 matrox_accel_restore_maccess(minfo);
250 mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_SGNZERO | 262 mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_SGNZERO |
251 M_DWG_BFCOL | M_DWG_REPLACE); 263 M_DWG_BFCOL | M_DWG_REPLACE);
252 mga_outl(M_AR5, vxres); 264 mga_outl(M_AR5, vxres);
@@ -254,7 +266,8 @@ static void matrox_accel_bmove_lin(struct matrox_fb_info *minfo, int vxres,
254 start = sy*vxres+sx+curr_ydstorg(minfo); 266 start = sy*vxres+sx+curr_ydstorg(minfo);
255 end = start+width; 267 end = start+width;
256 } else { 268 } else {
257 mga_fifo(3); 269 mga_fifo(5);
270 matrox_accel_restore_maccess(minfo);
258 mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_BFCOL | M_DWG_REPLACE); 271 mga_outl(M_DWGCTL, M_DWG_BITBLT | M_DWG_SHIFTZERO | M_DWG_BFCOL | M_DWG_REPLACE);
259 mga_outl(M_SGN, 5); 272 mga_outl(M_SGN, 5);
260 mga_outl(M_AR5, -vxres); 273 mga_outl(M_AR5, -vxres);
@@ -263,7 +276,8 @@ static void matrox_accel_bmove_lin(struct matrox_fb_info *minfo, int vxres,
263 start = end+width; 276 start = end+width;
264 dy += height-1; 277 dy += height-1;
265 } 278 }
266 mga_fifo(5); 279 mga_fifo(7);
280 matrox_accel_restore_maccess(minfo);
267 mga_outl(M_AR0, end); 281 mga_outl(M_AR0, end);
268 mga_outl(M_AR3, start); 282 mga_outl(M_AR3, start);
269 mga_outl(M_FXBNDRY, ((dx+width)<<16) | dx); 283 mga_outl(M_FXBNDRY, ((dx+width)<<16) | dx);
@@ -298,7 +312,8 @@ static void matroxfb_accel_clear(struct matrox_fb_info *minfo, u_int32_t color,
298 312
299 CRITBEGIN 313 CRITBEGIN
300 314
301 mga_fifo(5); 315 mga_fifo(7);
316 matrox_accel_restore_maccess(minfo);
302 mga_outl(M_DWGCTL, minfo->accel.m_dwg_rect | M_DWG_REPLACE); 317 mga_outl(M_DWGCTL, minfo->accel.m_dwg_rect | M_DWG_REPLACE);
303 mga_outl(M_FCOL, color); 318 mga_outl(M_FCOL, color);
304 mga_outl(M_FXBNDRY, ((sx + width) << 16) | sx); 319 mga_outl(M_FXBNDRY, ((sx + width) << 16) | sx);
@@ -341,7 +356,8 @@ static void matroxfb_cfb4_clear(struct matrox_fb_info *minfo, u_int32_t bgx,
341 width >>= 1; 356 width >>= 1;
342 sx >>= 1; 357 sx >>= 1;
343 if (width) { 358 if (width) {
344 mga_fifo(5); 359 mga_fifo(7);
360 matrox_accel_restore_maccess(minfo);
345 mga_outl(M_DWGCTL, minfo->accel.m_dwg_rect | M_DWG_REPLACE2); 361 mga_outl(M_DWGCTL, minfo->accel.m_dwg_rect | M_DWG_REPLACE2);
346 mga_outl(M_FCOL, bgx); 362 mga_outl(M_FCOL, bgx);
347 mga_outl(M_FXBNDRY, ((sx + width) << 16) | sx); 363 mga_outl(M_FXBNDRY, ((sx + width) << 16) | sx);
@@ -415,7 +431,8 @@ static void matroxfb_1bpp_imageblit(struct matrox_fb_info *minfo, u_int32_t fgx,
415 431
416 CRITBEGIN 432 CRITBEGIN
417 433
418 mga_fifo(3); 434 mga_fifo(5);
435 matrox_accel_restore_maccess(minfo);
419 if (easy) 436 if (easy)
420 mga_outl(M_DWGCTL, M_DWG_ILOAD | M_DWG_SGNZERO | M_DWG_SHIFTZERO | M_DWG_BMONOWF | M_DWG_LINEAR | M_DWG_REPLACE); 437 mga_outl(M_DWGCTL, M_DWG_ILOAD | M_DWG_SGNZERO | M_DWG_SHIFTZERO | M_DWG_BMONOWF | M_DWG_LINEAR | M_DWG_REPLACE);
421 else 438 else
@@ -425,7 +442,8 @@ static void matroxfb_1bpp_imageblit(struct matrox_fb_info *minfo, u_int32_t fgx,
425 fxbndry = ((xx + width - 1) << 16) | xx; 442 fxbndry = ((xx + width - 1) << 16) | xx;
426 mmio = minfo->mmio.vbase; 443 mmio = minfo->mmio.vbase;
427 444
428 mga_fifo(6); 445 mga_fifo(8);
446 matrox_accel_restore_maccess(minfo);
429 mga_writel(mmio, M_FXBNDRY, fxbndry); 447 mga_writel(mmio, M_FXBNDRY, fxbndry);
430 mga_writel(mmio, M_AR0, ar0); 448 mga_writel(mmio, M_AR0, ar0);
431 mga_writel(mmio, M_AR3, 0); 449 mga_writel(mmio, M_AR3, 0);
diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h
index 11ed57bb704e..556d96ce40bf 100644
--- a/drivers/video/matrox/matroxfb_base.h
+++ b/drivers/video/matrox/matroxfb_base.h
@@ -307,6 +307,8 @@ struct matrox_accel_data {
307#endif 307#endif
308 u_int32_t m_dwg_rect; 308 u_int32_t m_dwg_rect;
309 u_int32_t m_opmode; 309 u_int32_t m_opmode;
310 u_int32_t m_access;
311 u_int32_t m_pitch;
310}; 312};
311 313
312struct v4l2_queryctrl; 314struct v4l2_queryctrl;