summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellström <thomas@shipmail.org>2008-10-29 10:54:11 +0000
committerThomas Hellström <thomas@shipmail.org>2008-10-29 10:54:11 +0000
commit48c9e3385ed215f6bdb043b64932cd91b35dc2d2 (patch)
tree5db658c4dc9088f27291c55974a38e258cbd82f1
parenta6962cb0faa2ca3bf78015ab398d5f6ac597e24c (diff)
Re-enable Xv. Don't build XvMC
-rw-r--r--Makefile.am2
-rw-r--r--src/ochr_ioctl.c2
-rw-r--r--src/via_accel.c22
-rw-r--r--src/via_driver.c18
-rw-r--r--src/via_driver.h1
-rw-r--r--src/via_swov.c35
-rw-r--r--src/via_video.c5
7 files changed, 55 insertions, 30 deletions
diff --git a/Makefile.am b/Makefile.am
index a3c5a91..97be4cc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,6 +19,6 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AUTOMAKE_OPTIONS = foreign
-SUBDIRS = src man libxvmc
+SUBDIRS = src man
EXTRA_DIST = COPYING NEWS README
diff --git a/src/ochr_ioctl.c b/src/ochr_ioctl.c
index 47b11f7..86c00dc 100644
--- a/src/ochr_ioctl.c
+++ b/src/ochr_ioctl.c
@@ -533,7 +533,7 @@ int ochr_execbuf(int fd, struct _ViaCommandBuffer *cBuf)
exec_req->cmd_buffer = (uint64_t) (unsigned long)
cBuf->buf;
exec_req->cmd_buffer_size = cBuf->pos << 2;
- exec_req->engine = 0;
+ exec_req->engine = VIA_ENGINE_AGP;
exec_req->exec_flags = DRM_VIA_FENCE_NO_USER;
exec_req->cliprect_offset = 0;
exec_req->num_cliprects = 0;
diff --git a/src/via_accel.c b/src/via_accel.c
index 72c7aab..ed13667 100644
--- a/src/via_accel.c
+++ b/src/via_accel.c
@@ -1437,9 +1437,29 @@ viaInitAccel(ScreenPtr pScreen)
VIAPtr pVia = VIAPTR(pScrn);
Bool nPOTSupported;
int ret;
+ unsigned long exaMemSize = pScrn->videoRam * 1024 / 2;
viaInitialize2DEngine(pScrn);
+#ifdef XF86DRI
+ if (pVia->directRenderingEnabled) {
+ struct drm_via_memsize_arg arg;
+
+ ret = drmCommandRead(pVia->drmFD, DRM_VIA_MEM_SIZE, &arg,
+ sizeof(arg));
+ if (ret == 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[Accel] Largest free vram region is %lu bytes.\n",
+ (unsigned long) arg.vram_size);
+ exaMemSize = (unsigned long) arg.vram_size / 2;
+ }
+ }
+#endif
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[Accel] Setting evictable pixmap cache "
+ "to %lu bytes.\n",
+ exaMemSize);
+
/*
* Pixmap cache.
*/
@@ -1455,7 +1475,7 @@ viaInitAccel(ScreenPtr pScreen)
return FALSE;
}
- ret = driBOData(pVia->exaMem.buf, 32*1024*1024, NULL, NULL, 0);
+ ret = driBOData(pVia->exaMem.buf, exaMemSize, NULL, NULL, 0);
if (ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"[Accel] Failed allocating offscreen pixmap space.\n");
diff --git a/src/via_driver.c b/src/via_driver.c
index 2ec66ba..2c96a0f 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -900,6 +900,9 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
} else {
DevUnion *pPriv;
VIAEntPtr pVIAEnt;
+
+ FatalError("This driver does currently "
+ "not support a dual screen setup.\n");
xf86SetPrimInitDone(pScrn->entityList[0]);
pPriv = xf86GetEntityPrivate(pScrn->entityList[0], gVIAEntityIndex);
@@ -1759,8 +1762,6 @@ VIAEnterVT(int scrnIndex, int flags)
Bool ret;
int retVal;
- ErrorF("Entervt vtsema = %d\n", pScrn->vtSema);
-
/* FIXME: Rebind AGP memory here. */
DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "VIAEnterVT\n"));
@@ -1784,7 +1785,6 @@ VIAEnterVT(int scrnIndex, int flags)
struct drm_via_vt vt;
vt.enter = 1;
- ErrorF("Vt enter\n");
if (drmCommandWrite(pVia->drmFD, DRM_VIA_VT,
&vt, sizeof(vt)) < 0)
ErrorF("Failed DRM VT enter.\n");
@@ -1829,7 +1829,6 @@ VIAEnterVT(int scrnIndex, int flags)
}
pVia->displayOffset = driBOOffset(pVia->scanout.bufs[VIA_SCANOUT_DISPLAY]);
- ErrorF("Frontoffset is 0x%08x\n", pVia->displayOffset);
pScrn->AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
retVal = driBOSetStatus(pVia->scanout.bufs[VIA_SCANOUT_CURSOR],
@@ -1919,8 +1918,8 @@ VIALeaveVT(int scrnIndex, int flags)
0,
DRM_BO_FLAG_NO_EVICT);
- (void) driBOData(pVia->scanout.bufs[VIA_SCANOUT_OVERLAY],
- 0, NULL, NULL, 0);
+ // (void) driBOData(pVia->scanout.bufs[VIA_SCANOUT_OVERLAY],
+ // 0, NULL, NULL, 0);
(void) driBOData(pVia->scanout.bufs[VIA_SCANOUT_DISPLAY],
0, NULL, NULL, 0);
@@ -1960,8 +1959,6 @@ VIALeaveVT(int scrnIndex, int flags)
vgaHWLock(hwp);
-
- ErrorF("Vgahwlock done.\n");
}
@@ -2436,7 +2433,6 @@ VIAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
int ret;
unsigned int displaySize;
- ErrorF("Screeninit\n");
pScrn->pScreen = pScreen;
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAScreenInit\n"));
@@ -2557,7 +2553,6 @@ VIAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pVia->front.size = driBOSize(pVia->scanout.bufs[VIA_SCANOUT_DISPLAY]);
pVia->displayOffset = driBOOffset(pVia->scanout.bufs[VIA_SCANOUT_DISPLAY]);
- ErrorF("Frontoffset is 0x%08x\n", pVia->displayOffset);
pScrn->AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
@@ -2826,8 +2821,6 @@ VIACloseScreen(int scrnIndex, ScreenPtr pScreen)
vgaHWPtr hwp = VGAHWPTR(pScrn);
VIAPtr pVia = VIAPTR(pScrn);
- ErrorF("Closescreen vtsema = %d\n", pScrn->vtSema);
-
DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "VIACloseScreen\n"));
/* Is the display currently visible? */
@@ -2943,7 +2936,6 @@ VIAAdjustFrame(int scrnIndex, int x, int y, int flags)
CARD32 Base;
CARD32 offset;
- ErrorF("Adjustframe\n");
DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "VIAAdjustFrame\n"));
offset = pVia->displayOffset;
diff --git a/src/via_driver.h b/src/via_driver.h
index 533fed1..912244c 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -224,6 +224,7 @@ enum _ViaScanoutTypes {
VIA_SCANOUT_DISPLAY,
VIA_SCANOUT_CURSOR,
VIA_SCANOUT_OVERLAY,
+ VIA_SCANOUT_HQV,
VIA_SCANOUT_NUM
};
diff --git a/src/via_swov.c b/src/via_swov.c
index b98872d..f2b2de1 100644
--- a/src/via_swov.c
+++ b/src/via_swov.c
@@ -1022,6 +1022,7 @@ AddHQVSurface(ScrnInfoPtr pScrn, unsigned int numbuf, CARD32 fourcc)
unsigned int i, width, height, pitch, fbsize, addr;
unsigned long retCode;
BOOL isplanar;
+ void *hqvMap;
VIAPtr pVia = VIAPTR(pScrn);
CARD32 AddrReg[3] = { HQV_DST_STARTADDR0, HQV_DST_STARTADDR1,
@@ -1039,13 +1040,19 @@ AddHQVSurface(ScrnInfoPtr pScrn, unsigned int numbuf, CARD32 fourcc)
pitch = pVia->swov.SWDevice.dwPitch;
fbsize = pitch * height * (isplanar ? 2 : 1);
- // VIAFreeLinear(&pVia->swov.HQVMem);
- // retCode = VIAAllocLinear(&pVia->swov.HQVMem, pScrn, fbsize * numbuf);
- if (retCode != Success)
- return retCode;
- // addr = pVia->swov.HQVMem.base;
+ retCode = driBOData(pVia->scanout.bufs[VIA_SCANOUT_HQV], fbsize * numbuf,
+ NULL, NULL, 0);
+ if (retCode)
+ return BadAlloc;
- // ViaYUVFillBlack(pVia, pVia->FBBase + addr, fbsize);
+ hqvMap = driBOMap(pVia->scanout.bufs[VIA_SCANOUT_HQV], WS_DRI_MAP_WRITE);
+ if (hqvMap == NULL)
+ return BadAlloc;
+
+ driBOUnmap(pVia->scanout.bufs[VIA_SCANOUT_HQV]);
+ ViaYUVFillBlack(pVia, hqvMap, fbsize);
+
+ addr = driBOOffset(pVia->scanout.bufs[VIA_SCANOUT_HQV]);
for (i = 0; i < numbuf; i++) {
pVia->swov.overlayRecordV1.dwHQVAddr[i] = addr;
@@ -1226,22 +1233,26 @@ ViaSwovSurfaceDestroy(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv)
case FOURCC_RV32:
case FOURCC_RV15:
pVia->swov.SrcFourCC = 0;
-
- // if ((pVia->swov.gdwVideoFlagSW & SW_USE_HQV))
- // VIAFreeLinear(&pVia->swov.HQVMem);
+
+ if ((pVia->swov.gdwVideoFlagSW & SW_USE_HQV))
+ (void) driBOData(pVia->scanout.bufs[VIA_SCANOUT_HQV], 0,
+ NULL, NULL, 0);
pVia->swov.gdwVideoFlagSW = 0;
break;
case FOURCC_HQVSW:
- // VIAFreeLinear(&pVia->swov.HQVMem);
+ (void) driBOData(pVia->scanout.bufs[VIA_SCANOUT_HQV], 0,
+ NULL, NULL, 0);
pVia->swov.gdwVideoFlagSW = 0;
break;
case FOURCC_YV12:
+ (void) driBOData(pVia->scanout.bufs[VIA_SCANOUT_OVERLAY], 0,
+ NULL, NULL, 0);
case FOURCC_XVMC:
pVia->swov.SrcFourCC = 0;
-
- // VIAFreeLinear(&pVia->swov.HQVMem);
+ (void) driBOData(pVia->scanout.bufs[VIA_SCANOUT_HQV], 0,
+ NULL, NULL, 0);
pVia->swov.gdwVideoFlagSW = 0;
break;
}
diff --git a/src/via_video.c b/src/via_video.c
index b87f654..b512e96 100644
--- a/src/via_video.c
+++ b/src/via_video.c
@@ -573,7 +573,7 @@ viaInitVideo(ScreenPtr pScreen)
((pVia->drmVerMajor == 2) && (pVia->drmVerMinor < 9)))
pVia->useDmaBlit = FALSE;
#endif
- pVia->useDmaBlit = pVia->useDmaBlit && pVia->dmaXV;
+ pVia->useDmaBlit = FALSE /* pVia->useDmaBlit && pVia->dmaXV */;
if (pVia->useDmaBlit)
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -1120,6 +1120,7 @@ nv12cp(unsigned char *dst,
#ifdef XF86DRI
+#if 0
static int
viaDmaBlitImage(VIAPtr pVia,
viaPortPrivPtr pPort,
@@ -1255,7 +1256,7 @@ viaDmaBlitImage(VIAPtr pVia,
return Success;
}
-
+#endif
#endif