summaryrefslogtreecommitdiff
path: root/src/smi_accel.c
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-04 15:57:12 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-04 15:57:12 -0200
commit1d7b9547e1d37601f14410857c22f256e5c74f14 (patch)
tree435e5494c22952c20843eb6282ccf0f67df18fc3 /src/smi_accel.c
parent93308d067c93126dd0aba9b718d9e0ba28dde9f4 (diff)
Add CSCVideo option to smi 501/502.
This code is an adaptation of SMI sample implementation. CSCVideo is an alternate way to render video, that should reduce memory bandwidth usage, and uses the color space conversion hardware to render video directly to the framebuffer memory. When using randr dual head mode, currently only XAA is supported. As it has a fixed format framebuffer (when using the Virtual xorg.conf option). This patch also ensures that pScrn->displayWidth, pScrn->virtualX and pScrn->virtualY are only changed by the driver when using EXA.
Diffstat (limited to 'src/smi_accel.c')
-rw-r--r--src/smi_accel.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/smi_accel.c b/src/smi_accel.c
index a98eb3f..fcfee41 100644
--- a/src/smi_accel.c
+++ b/src/smi_accel.c
@@ -91,15 +91,11 @@ SMI_EngineReset(ScrnInfoPtr pScrn)
{
SMIPtr pSmi = SMIPTR(pScrn);
CARD32 DEDataFormat = 0;
- int i;
+ int i, stride;
int xyAddress[] = { 320, 400, 512, 640, 800, 1024, 1280, 1600, 2048 };
ENTER();
- pSmi->Stride = ((pScrn->virtualX * pSmi->Bpp + 15) & ~15) / pSmi->Bpp;
- if(pScrn->bitsPerPixel==24)
- pSmi->Stride *= 3;
-
DEDataFormat = SMI_DEDataFormat(pScrn->bitsPerPixel);
for (i = 0; i < sizeof(xyAddress) / sizeof(xyAddress[0]); i++) {
if (xyAddress[i] == pScrn->virtualX) {
@@ -109,11 +105,14 @@ SMI_EngineReset(ScrnInfoPtr pScrn)
}
WaitIdle();
- WRITE_DPR(pSmi, 0x10, (pSmi->Stride << 16) | pSmi->Stride);
+ stride = pScrn->displayWidth;
+ if (pSmi->Bpp == 3)
+ stride *= 3;
+ WRITE_DPR(pSmi, 0x10, (stride << 16) | stride);
WRITE_DPR(pSmi, 0x1C, DEDataFormat);
WRITE_DPR(pSmi, 0x24, 0xFFFFFFFF);
WRITE_DPR(pSmi, 0x28, 0xFFFFFFFF);
- WRITE_DPR(pSmi, 0x3C, (pSmi->Stride << 16) | pSmi->Stride);
+ WRITE_DPR(pSmi, 0x3C, (stride << 16) | stride);
WRITE_DPR(pSmi, 0x40, pSmi->FBOffset >> 3);
WRITE_DPR(pSmi, 0x44, pSmi->FBOffset >> 3);