summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2007-08-06 21:45:50 +1000
committerBen Skeggs <skeggsb@gmail.com>2007-08-06 22:18:38 +1000
commitc7b16f6fff96ffcff8049feed2a0a9ef6de4209f (patch)
tree74b78853a45013f2b7351877c631b0fcac5b22d2
parent59d073c9b01a8f61675b8d74f5c55f134ddfb8bf (diff)
downloadxorg-driver-xf86-video-nouveau-c7b16f6fff96ffcff8049feed2a0a9ef6de4209f.tar.gz
Adapt to drm 0.0.10
-rw-r--r--src/nv_dma.c2
-rw-r--r--src/nv_dri.c21
-rw-r--r--src/nv_driver.c8
-rw-r--r--src/nv_notifier.c18
-rw-r--r--src/nv_proto.h25
-rw-r--r--src/nv_type.h5
-rw-r--r--src/nv_video.c8
7 files changed, 36 insertions, 51 deletions
diff --git a/src/nv_dma.c b/src/nv_dma.c
index 8ecda5e..ea022ee 100644
--- a/src/nv_dma.c
+++ b/src/nv_dma.c
@@ -263,7 +263,7 @@ Bool NVInitDma(ScrnInfoPtr pScrn)
pNv->fifo.fb_ctxdma_handle = NvDmaFB;
pNv->fifo.tt_ctxdma_handle = NvDmaTT;
- ret = drmCommandWriteRead(pNv->drm_fd, DRM_NOUVEAU_FIFO_ALLOC,
+ ret = drmCommandWriteRead(pNv->drm_fd, DRM_NOUVEAU_CHANNEL_ALLOC,
&pNv->fifo, sizeof(pNv->fifo));
if (ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
diff --git a/src/nv_dri.c b/src/nv_dri.c
index c854950..0640287 100644
--- a/src/nv_dri.c
+++ b/src/nv_dri.c
@@ -244,7 +244,7 @@ Bool NVDRIGetVersion(ScrnInfoPtr pScrn)
}
/* temporary lock step versioning */
-#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 9
+#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 10
#error nouveau_drm.h doesn't match expected patchlevel, update libdrm.
#endif
if (pNv->pKernelDRMVersion->version_patchlevel !=
@@ -278,7 +278,6 @@ Bool NVDRIScreenInit(ScrnInfoPtr pScrn)
ScreenPtr pScreen;
pScreen = screenInfo.screens[pScrn->scrnIndex];
int drm_page_size;
- int irq;
if (!NVDRICheckModules(pScrn))
return FALSE;
@@ -352,24 +351,6 @@ Bool NVDRIScreenInit(ScrnInfoPtr pScrn)
return FALSE;
}
-#if 0
- pNv->IRQ = 0;
-#else
- /* Ask DRM to install IRQ handler */
- irq = drmGetInterruptFromBusID(pNv->drm_fd,
- ((pciConfigPtr)pNv->PciInfo->thisCard)->busnum,
- ((pciConfigPtr)pNv->PciInfo->thisCard)->devnum,
- ((pciConfigPtr)pNv->PciInfo->thisCard)->funcnum);
-
- if (drmCtlInstHandler(pNv->drm_fd, irq)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to install IRQ handler\n");
- pNv->IRQ = 0;
- } else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IRQ handler initialised. IRQ %d\n", irq);
- pNv->IRQ = irq;
- }
-#endif
-
return TRUE;
}
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 2e8f8eb..b4c6533 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -2011,6 +2011,14 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!NVDRIScreenInit(pScrn))
return FALSE;
+ ret = drmCommandNone(pNv->drm_fd, DRM_NOUVEAU_CARD_INIT);
+ if (ret) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Error initialising the nouveau kernel module: %d\n",
+ ret);
+ return FALSE;
+ }
+
/* Allocate and map memory areas we need */
if (!NVMapMem(pScrn))
return FALSE;
diff --git a/src/nv_notifier.c b/src/nv_notifier.c
index 70a7fcc..bb7a4f9 100644
--- a/src/nv_notifier.c
+++ b/src/nv_notifier.c
@@ -16,11 +16,11 @@
NVPtr pNv = NVPTR(pScrn); \
volatile uint32_t *__v = (void*)pNv->NotifierBlock + notifier->offset
-struct drm_nouveau_notifier_alloc *
+struct drm_nouveau_notifierobj_alloc *
NVNotifierAlloc(ScrnInfoPtr pScrn, uint32_t handle)
{
NVPtr pNv = NVPTR(pScrn);
- struct drm_nouveau_notifier_alloc *notifier;
+ struct drm_nouveau_notifierobj_alloc *notifier;
int ret;
notifier = xcalloc(1, sizeof(*notifier));
@@ -32,7 +32,7 @@ NVNotifierAlloc(ScrnInfoPtr pScrn, uint32_t handle)
notifier->channel = pNv->fifo.channel;
notifier->handle = handle;
notifier->count = 1;
- ret = drmCommandWriteRead(pNv->drm_fd, DRM_NOUVEAU_NOTIFIER_ALLOC,
+ ret = drmCommandWriteRead(pNv->drm_fd, DRM_NOUVEAU_NOTIFIEROBJ_ALLOC,
notifier, sizeof(*notifier));
if (ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -47,7 +47,7 @@ NVNotifierAlloc(ScrnInfoPtr pScrn, uint32_t handle)
void
NVNotifierDestroy(ScrnInfoPtr pScrn,
- struct drm_nouveau_notifier_alloc *notifier)
+ struct drm_nouveau_notifierobj_alloc *notifier)
{
if (notifier) {
/*XXX: destroy notifier object */
@@ -57,7 +57,7 @@ NVNotifierDestroy(ScrnInfoPtr pScrn,
void
NVNotifierReset(ScrnInfoPtr pScrn,
- struct drm_nouveau_notifier_alloc *notifier)
+ struct drm_nouveau_notifierobj_alloc *notifier)
{
NOTIFIER(n);
@@ -70,7 +70,7 @@ NVNotifierReset(ScrnInfoPtr pScrn,
uint32_t
NVNotifierStatus(ScrnInfoPtr pScrn,
- struct drm_nouveau_notifier_alloc *notifier)
+ struct drm_nouveau_notifierobj_alloc *notifier)
{
NOTIFIER(n);
@@ -79,7 +79,7 @@ NVNotifierStatus(ScrnInfoPtr pScrn,
uint32_t
NVNotifierErrorCode(ScrnInfoPtr pScrn,
- struct drm_nouveau_notifier_alloc *notifier)
+ struct drm_nouveau_notifierobj_alloc *notifier)
{
NOTIFIER(n);
@@ -88,7 +88,7 @@ NVNotifierErrorCode(ScrnInfoPtr pScrn,
uint32_t
NVNotifierReturnVal(ScrnInfoPtr pScrn,
- struct drm_nouveau_notifier_alloc *notifier)
+ struct drm_nouveau_notifierobj_alloc *notifier)
{
NOTIFIER(n);
@@ -97,7 +97,7 @@ NVNotifierReturnVal(ScrnInfoPtr pScrn,
Bool
NVNotifierWaitStatus(ScrnInfoPtr pScrn,
- struct drm_nouveau_notifier_alloc *notifier,
+ struct drm_nouveau_notifierobj_alloc *notifier,
unsigned int status, unsigned int timeout)
{
NOTIFIER(n);
diff --git a/src/nv_proto.h b/src/nv_proto.h
index 5eac19f..9f5fbac 100644
--- a/src/nv_proto.h
+++ b/src/nv_proto.h
@@ -20,20 +20,17 @@ NVAllocRec *NVAllocateMemory(NVPtr pNv, int type, int size);
void NVFreeMemory(NVPtr pNv, NVAllocRec *mem);
/* in nv_notifier.c */
-struct drm_nouveau_notifier_alloc *NVNotifierAlloc(ScrnInfoPtr,uint32_t handle);
-void NVNotifierDestroy(ScrnInfoPtr,
- struct drm_nouveau_notifier_alloc *);
-void NVNotifierReset(ScrnInfoPtr,
- struct drm_nouveau_notifier_alloc *);
-uint32_t NVNotifierStatus(ScrnInfoPtr,
- struct drm_nouveau_notifier_alloc *);
-uint32_t NVNotifierErrorCode(ScrnInfoPtr,
- struct drm_nouveau_notifier_alloc *);
-uint32_t NVNotifierReturnVal(ScrnInfoPtr,
- struct drm_nouveau_notifier_alloc *);
-Bool NVNotifierWaitStatus(ScrnInfoPtr,
- struct drm_nouveau_notifier_alloc *,
- uint32_t status, uint32_t timeout);
+struct drm_nouveau_notifierobj_alloc *
+NVNotifierAlloc(ScrnInfoPtr, uint32_t handle);
+void NVNotifierDestroy(ScrnInfoPtr, struct drm_nouveau_notifierobj_alloc *);
+void NVNotifierReset(ScrnInfoPtr, struct drm_nouveau_notifierobj_alloc *);
+uint32_t NVNotifierStatus(ScrnInfoPtr, struct drm_nouveau_notifierobj_alloc *);
+uint32_t NVNotifierErrorCode(ScrnInfoPtr,
+ struct drm_nouveau_notifierobj_alloc *);
+uint32_t NVNotifierReturnVal(ScrnInfoPtr,
+ struct drm_nouveau_notifierobj_alloc *);
+Bool NVNotifierWaitStatus(ScrnInfoPtr, struct drm_nouveau_notifierobj_alloc *,
+ uint32_t status, uint32_t timeout);
/* in nv_dri.c */
unsigned int NVDRMGetParam(NVPtr pNv, unsigned int param);
diff --git a/src/nv_type.h b/src/nv_type.h
index be45799..6c3edb0 100644
--- a/src/nv_type.h
+++ b/src/nv_type.h
@@ -232,13 +232,12 @@ typedef struct _NVRec {
int PanelTweak;
Bool LVDS;
- int IRQ;
Bool LockedUp;
volatile void * NotifierBlock;
- struct drm_nouveau_notifier_alloc *Notifier0;
+ struct drm_nouveau_notifierobj_alloc *Notifier0;
- struct drm_nouveau_fifo_alloc fifo;
+ struct drm_nouveau_channel_alloc fifo;
CARD32 dmaPut;
CARD32 dmaCurrent;
CARD32 dmaFree;
diff --git a/src/nv_video.c b/src/nv_video.c
index 67a231f..86e2e69 100644
--- a/src/nv_video.c
+++ b/src/nv_video.c
@@ -63,7 +63,7 @@ typedef struct _NVPortPrivRec {
int offset;
NVAllocRec * TT_mem_chunk[2];
int currentHostBuffer;
- struct drm_nouveau_notifier_alloc *DMANotifier[2];
+ struct drm_nouveau_notifierobj_alloc *DMANotifier[2];
} NVPortPrivRec, *NVPortPrivPtr;
@@ -78,7 +78,7 @@ XV_DMA_NOTIFIER_FREE=2, //notifier allocated, ready for use
/* We have six notifiers available, they are not allocated at startup */
int XvDMANotifierStatus[6]= { XV_DMA_NOTIFIER_NOALLOC , XV_DMA_NOTIFIER_NOALLOC , XV_DMA_NOTIFIER_NOALLOC ,
XV_DMA_NOTIFIER_NOALLOC , XV_DMA_NOTIFIER_NOALLOC , XV_DMA_NOTIFIER_NOALLOC };
-struct drm_nouveau_notifier_alloc * XvDMANotifiers[6];
+struct drm_nouveau_notifierobj_alloc * XvDMANotifiers[6];
#define GET_OVERLAY_PRIVATE(pNv) \
(NVPortPrivPtr)((pNv)->overlayAdaptor->pPortPrivates[0].ptr)
@@ -236,7 +236,7 @@ NVStopOverlay (ScrnInfoPtr pScrn)
*
* @return a notifier instance or NULL on error
*/
-static struct drm_nouveau_notifier_alloc * NVXvDMANotifierAlloc(ScrnInfoPtr pScrn)
+static struct drm_nouveau_notifierobj_alloc * NVXvDMANotifierAlloc(ScrnInfoPtr pScrn)
{
int i;
for ( i = 0; i < 6; i ++ )
@@ -271,7 +271,7 @@ return NULL;
*
*
*/
-static void NVXvDMANotifierFree(ScrnInfoPtr pScrn, struct drm_nouveau_notifier_alloc * target)
+static void NVXvDMANotifierFree(ScrnInfoPtr pScrn, struct drm_nouveau_notifierobj_alloc * target)
{
int i;
for ( i = 0; i < 6; i ++ )