summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Fufutos <fufutos610@hotmail.com>2006-06-14 01:27:25 +0300
committerLuc Verhaegen <libv@skynet.be>2006-06-14 06:14:59 +0200
commita58e76492a02f344614f942d82009e466e7ed579 (patch)
treeb39cd76e4664e4dfd0c3579a792dc68307d0c0f8
parent38fbea1e4ced5a0b19aca0cc4368afb793c9aeab (diff)
[PATCH] Reduce maximum width/height for hardware-accelerated operations to half theorigin
current values. EXA hits these limits for some operations on offscreen pixmaps and GTPRO seems to support the reduced signed limits.
-rw-r--r--src/atimach64.c30
-rw-r--r--src/atimach64accel.h4
2 files changed, 25 insertions, 9 deletions
diff --git a/src/atimach64.c b/src/atimach64.c
index bb1add5..f8144a6 100644
--- a/src/atimach64.c
+++ b/src/atimach64.c
@@ -83,7 +83,6 @@ ATIMach64PreInit
)
{
CARD32 bus_cntl, config_cntl;
- int tmp;
pATIHW->crtc_off_pitch = SetBits(pATI->displayWidth >> 3, CRTC_PITCH);
@@ -241,12 +240,29 @@ ATIMach64PreInit
pATIHW->src_cntl = SRC_LINE_X_DIR;
/* Initialise scissor, allowing for offscreen areas */
- pATIHW->sc_right = (pATI->displayWidth * pATI->XModifier) - 1;
- tmp = pATI->displayWidth * pATI->bitsPerPixel;
- tmp = (((pScreenInfo->videoRam * (1024 * 8)) + tmp - 1) / tmp) - 1;
- if (tmp > ATIMach64MaxY)
- tmp = ATIMach64MaxY;
- pATIHW->sc_bottom = tmp;
+#ifdef USE_XAA
+ if (!pATI->useEXA)
+ {
+ int width, height, total;
+
+ pATIHW->sc_right = (pATI->displayWidth * pATI->XModifier) - 1;
+ width = pATI->displayWidth * pATI->bitsPerPixel;
+ total = pScreenInfo->videoRam * (1024 * 8);
+ height = (total + width - 1) / width;
+ if (height > ATIMach64MaxY + 1)
+ height = ATIMach64MaxY + 1;
+ pATIHW->sc_bottom = height - 1;
+ }
+#endif /* USE_XAA */
+
+#ifdef USE_EXA
+ if (pATI->useEXA)
+ {
+ pATIHW->sc_right = ATIMach64MaxX;
+ pATIHW->sc_bottom = ATIMach64MaxY;
+ }
+#endif /* USE_EXA */
+
pATI->sc_left_right = SetWord(pATI->NewHW.sc_right, 1) |
SetWord(pATI->NewHW.sc_left, 0);
pATI->sc_top_bottom = SetWord(pATI->NewHW.sc_bottom, 1) |
diff --git a/src/atimach64accel.h b/src/atimach64accel.h
index 7cfcdaa..21302df 100644
--- a/src/atimach64accel.h
+++ b/src/atimach64accel.h
@@ -29,8 +29,8 @@
#include "xaa.h"
#include "exa.h"
-#define ATIMach64MaxX 8191
-#define ATIMach64MaxY 32767
+#define ATIMach64MaxX 4095
+#define ATIMach64MaxY 16383
#ifdef USE_EXA
extern Bool ATIMach64ExaInit(ScreenPtr);