From 0029713451af6f5f216079775ff77cae9b423c0e Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 13 Jul 2007 15:09:31 +1000 Subject: nouveau: nuke internal typedefs, and drm_device_t use. --- shared-core/nv30_graph.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'shared-core/nv30_graph.c') diff --git a/shared-core/nv30_graph.c b/shared-core/nv30_graph.c index a83ad714..23e0f7f0 100644 --- a/shared-core/nv30_graph.c +++ b/shared-core/nv30_graph.c @@ -16,9 +16,9 @@ * contexts are taken from dumps just after the 3D object is * created. */ -static void nv30_graph_context_init(drm_device_t *dev, nouveau_gpuobj_t *ctx) +static void nv30_graph_context_init(struct drm_device *dev, struct nouveau_gpuobj *ctx) { - drm_nouveau_private_t *dev_priv = dev->dev_private; + struct drm_nouveau_private *dev_priv = dev->dev_private; int i; INSTANCE_WR(ctx, 0x28/4, 0x10000000); @@ -100,12 +100,12 @@ static void nv30_graph_context_init(drm_device_t *dev, nouveau_gpuobj_t *ctx) } -int nv30_graph_create_context(drm_device_t *dev, int channel) +int nv30_graph_create_context(struct drm_device *dev, int channel) { - drm_nouveau_private_t *dev_priv = - (drm_nouveau_private_t *)dev->dev_private; + struct drm_nouveau_private *dev_priv = + (struct drm_nouveau_private *)dev->dev_private; struct nouveau_fifo *chan = dev_priv->fifos[channel]; - void (*ctx_init)(drm_device_t *, nouveau_gpuobj_t *); + void (*ctx_init)(struct drm_device *, struct nouveau_gpuobj *); unsigned int ctx_size; int ret; @@ -131,10 +131,10 @@ int nv30_graph_create_context(drm_device_t *dev, int channel) return 0; } -void nv30_graph_destroy_context(drm_device_t *dev, int channel) +void nv30_graph_destroy_context(struct drm_device *dev, int channel) { - drm_nouveau_private_t *dev_priv = - (drm_nouveau_private_t *)dev->dev_private; + struct drm_nouveau_private *dev_priv = + (struct drm_nouveau_private *)dev->dev_private; struct nouveau_fifo *chan = dev_priv->fifos[channel]; if (chan->ramin_grctx) @@ -144,9 +144,9 @@ void nv30_graph_destroy_context(drm_device_t *dev, int channel) } static int -nouveau_graph_wait_idle(drm_device_t *dev) +nouveau_graph_wait_idle(struct drm_device *dev) { - drm_nouveau_private_t *dev_priv = dev->dev_private; + struct drm_nouveau_private *dev_priv = dev->dev_private; int tv = 1000; while (tv--) { @@ -161,9 +161,9 @@ nouveau_graph_wait_idle(drm_device_t *dev) return 0; } -int nv30_graph_load_context(drm_device_t *dev, int channel) +int nv30_graph_load_context(struct drm_device *dev, int channel) { - drm_nouveau_private_t *dev_priv = dev->dev_private; + struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_fifo *chan = dev_priv->fifos[channel]; uint32_t inst; @@ -178,9 +178,9 @@ int nv30_graph_load_context(drm_device_t *dev, int channel) return nouveau_graph_wait_idle(dev); } -int nv30_graph_save_context(drm_device_t *dev, int channel) +int nv30_graph_save_context(struct drm_device *dev, int channel) { - drm_nouveau_private_t *dev_priv = dev->dev_private; + struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_fifo *chan = dev_priv->fifos[channel]; uint32_t inst; @@ -195,10 +195,10 @@ int nv30_graph_save_context(drm_device_t *dev, int channel) return nouveau_graph_wait_idle(dev); } -int nv30_graph_init(drm_device_t *dev) +int nv30_graph_init(struct drm_device *dev) { - drm_nouveau_private_t *dev_priv = - (drm_nouveau_private_t *)dev->dev_private; + struct drm_nouveau_private *dev_priv = + (struct drm_nouveau_private *)dev->dev_private; uint32_t vramsz, tmp; int ret, i; @@ -279,7 +279,7 @@ int nv30_graph_init(drm_device_t *dev) return 0; } -void nv30_graph_takedown(drm_device_t *dev) +void nv30_graph_takedown(struct drm_device *dev) { } -- cgit v1.2.3 From 875dd1e53852d231b60eb82bfed33c016f92f3b8 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 17 Jul 2007 14:06:05 +1000 Subject: nouveau: Destroy PGRAPH context table on PGRAPH takedown --- shared-core/nv30_graph.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'shared-core/nv30_graph.c') diff --git a/shared-core/nv30_graph.c b/shared-core/nv30_graph.c index 23e0f7f0..d7138772 100644 --- a/shared-core/nv30_graph.c +++ b/shared-core/nv30_graph.c @@ -281,5 +281,8 @@ int nv30_graph_init(struct drm_device *dev) void nv30_graph_takedown(struct drm_device *dev) { + struct drm_nouveau_private *dev_priv = dev->dev_private; + + nouveau_gpuobj_ref_del(dev, &dev_priv->ctx_table); } -- cgit v1.2.3 From e39286eb5eab8846a228863abf8f1b8b07a9e29d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 19 Jul 2007 17:00:17 -0700 Subject: Remove DRM_ERR OS macro. This was used to make all ioctl handlers return -errno on linux and errno on *BSD. Instead, just return -errno in shared code, and flip sign on return from shared code to *BSD code. --- shared-core/nv30_graph.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'shared-core/nv30_graph.c') diff --git a/shared-core/nv30_graph.c b/shared-core/nv30_graph.c index d7138772..4ed2e2ba 100644 --- a/shared-core/nv30_graph.c +++ b/shared-core/nv30_graph.c @@ -156,7 +156,7 @@ nouveau_graph_wait_idle(struct drm_device *dev) if (NV_READ(0x400700)) { DRM_ERROR("timeout!\n"); - return DRM_ERR(EBUSY); + return -EBUSY; } return 0; } @@ -168,7 +168,7 @@ int nv30_graph_load_context(struct drm_device *dev, int channel) uint32_t inst; if (!chan->ramin_grctx) - return DRM_ERR(EINVAL); + return -EINVAL; inst = chan->ramin_grctx->instance >> 4; NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_POINTER, inst); @@ -185,7 +185,7 @@ int nv30_graph_save_context(struct drm_device *dev, int channel) uint32_t inst; if (!chan->ramin_grctx) - return DRM_ERR(EINVAL); + return -EINVAL; inst = chan->ramin_grctx->instance >> 4; NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_POINTER, inst); -- cgit v1.2.3