summaryrefslogtreecommitdiff
path: root/src/smi_exa.c
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-14 22:37:56 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-14 22:37:56 -0200
commited6aba73259a1412e23a954d6a8dba439ad98a8a (patch)
tree12eeda620d5f6d4c4bb99f4bd12ca3e30fdab4c5 /src/smi_exa.c
parent85d118ee288fe7aa32db003bfa322ddf06944bf6 (diff)
Correct EXA+Randr+rotated mode.
The smi 501/502 cannot rotate-blt more than 32 bytes at a time. Patch based on smi's sample smi_shadow.c. XAA + randr + rotated mode currently not supported.
Diffstat (limited to 'src/smi_exa.c')
-rw-r--r--src/smi_exa.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/smi_exa.c b/src/smi_exa.c
index 5453539..c77ac7f 100644
--- a/src/smi_exa.c
+++ b/src/smi_exa.c
@@ -65,6 +65,9 @@ static void
SMI_Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
int dstX, int dstY, int width, int height);
static void
+SMI501_Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
+ int dstX, int dstY, int width, int height);
+static void
SMI730_Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
int dstX, int dstY, int width, int height);
static void
@@ -153,7 +156,9 @@ SMI_EXAInit(ScreenPtr pScreen)
pSmi->EXADriverPtr->CheckComposite = SMI_CheckComposite;
pSmi->EXADriverPtr->PrepareComposite = SMI_PrepareComposite;
- if (pSmi->Chipset == SMI_COUGAR3DR)
+ if (IS_MSOC(pSmi))
+ pSmi->EXADriverPtr->Composite = SMI501_Composite;
+ else if (pSmi->Chipset == SMI_COUGAR3DR)
pSmi->EXADriverPtr->Composite = SMI730_Composite;
else
pSmi->EXADriverPtr->Composite = SMI_Composite;
@@ -644,6 +649,27 @@ SMI_Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
LEAVE();
}
+#define MSOC_ROTBLTWIDTH 8
+static void
+SMI501_Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
+ int dstX, int dstY, int width, int height)
+{
+ ENTER();
+
+ /* SMI501 cannot rotate-blt more than 32 bytes.
+ * Based on smi's sample smi_shadow.c */
+ while (height > MSOC_ROTBLTWIDTH) {
+ SMI_Composite(pDst, srcX, srcY, maskX, maskY, dstX, dstY,
+ width, MSOC_ROTBLTWIDTH);
+ srcY += MSOC_ROTBLTWIDTH;
+ dstY += MSOC_ROTBLTWIDTH;
+ height -= MSOC_ROTBLTWIDTH;
+ }
+ SMI_Composite(pDst, srcX, srcY, maskX, maskY, dstX, dstY, width, height);
+
+ LEAVE();
+}
+
static void
SMI730_Composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
int dstX, int dstY, int width, int height)