summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-04-06 04:51:32 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-04-06 04:51:32 +0000
commita9ebd512f1f519674e3fbc5637f8f27b8d40dd3e (patch)
tree3ad117eddb8ffe2ba3232913e4273014fe03b713 /sys/dev
parent071593aded91939c0b8949599c2ebcbdaf576e39 (diff)
Remove the context constructor and destructor driver hooks. sisdrm's old
code was the only that that needed them.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/drmP.h5
-rw-r--r--sys/dev/pci/drm/drm_context.c34
2 files changed, 14 insertions, 25 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h
index 45af2b7fec9..0d2030dca6b 100644
--- a/sys/dev/pci/drm/drmP.h
+++ b/sys/dev/pci/drm/drmP.h
@@ -354,8 +354,6 @@ struct drm_driver_info {
int (*dma_ioctl)(struct drm_device *, struct drm_dma *,
struct drm_file *);
int (*dma_quiescent)(struct drm_device *);
- int (*context_ctor)(struct drm_device *, int);
- int (*context_dtor)(struct drm_device *, int);
int (*irq_install)(struct drm_device *);
void (*irq_uninstall)(struct drm_device *);
int vblank_pipes;
@@ -489,8 +487,7 @@ void drm_free_block(struct drm_heap *, struct drm_mem *);
void drm_mem_release(struct drm_heap *, struct drm_file *);
void drm_mem_takedown(struct drm_heap *);
-
-
+/* Context management (DRI1, deprecated) */
int drm_ctxbitmap_init(struct drm_device *);
void drm_ctxbitmap_cleanup(struct drm_device *);
void drm_ctxbitmap_free(struct drm_device *, int);
diff --git a/sys/dev/pci/drm/drm_context.c b/sys/dev/pci/drm/drm_context.c
index 7c3135bb422..0c2500b93d4 100644
--- a/sys/dev/pci/drm/drm_context.c
+++ b/sys/dev/pci/drm/drm_context.c
@@ -57,22 +57,22 @@ drm_ctxbitmap_free(struct drm_device *dev, int ctx_handle)
int
drm_ctxbitmap_next(struct drm_device *dev)
{
- int bit;
+ int bit;
if (dev->ctx_bitmap == NULL)
- return -1;
+ return (-1);
DRM_LOCK();
bit = find_first_zero_bit(dev->ctx_bitmap, DRM_MAX_CTXBITMAP);
if (bit >= DRM_MAX_CTXBITMAP) {
DRM_UNLOCK();
- return -1;
+ return (-1);
}
set_bit(bit, dev->ctx_bitmap);
DRM_DEBUG("drm_ctxbitmap_next bit : %d\n", bit);
DRM_UNLOCK();
- return bit;
+ return (bit);
}
int
@@ -82,8 +82,7 @@ drm_ctxbitmap_init(struct drm_device *dev)
int i, temp;
- bitmap = drm_calloc(1, PAGE_SIZE);
- if (bitmap == NULL)
+ if ((bitmap = drm_calloc(1, PAGE_SIZE)) == NULL)
return (ENOMEM);
DRM_LOCK();
dev->ctx_bitmap = bitmap;
@@ -94,7 +93,7 @@ drm_ctxbitmap_init(struct drm_device *dev)
DRM_DEBUG("drm_ctxbitmap_init : %d\n", temp);
}
- return 0;
+ return (0);
}
void
@@ -122,12 +121,12 @@ drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv)
ctx.handle = i;
if (DRM_COPY_TO_USER(&res->contexts[i],
&ctx, sizeof(ctx)))
- return EFAULT;
+ return (EFAULT);
}
}
res->count = DRM_RESERVED_CONTEXTS;
- return 0;
+ return (0);
}
int
@@ -144,13 +143,10 @@ drm_addctx(struct drm_device *dev, void *data, struct drm_file *file_priv)
if (ctx->handle == -1) {
DRM_DEBUG("Not enough free contexts.\n");
/* Should this return -EBUSY instead? */
- return ENOMEM;
+ return (ENOMEM);
}
- if (dev->driver->context_ctor && ctx->handle != DRM_KERNEL_CONTEXT)
- dev->driver->context_ctor(dev, ctx->handle);
-
- return 0;
+ return (0);
}
int
@@ -161,7 +157,7 @@ drm_getctx(struct drm_device *dev, void *data, struct drm_file *file_priv)
/* This is 0, because we don't handle any context flags */
ctx->flags = 0;
- return 0;
+ return (0);
}
int
@@ -170,12 +166,8 @@ drm_rmctx(struct drm_device *dev, void *data, struct drm_file *file_priv)
struct drm_ctx *ctx = data;
DRM_DEBUG("%d\n", ctx->handle);
- if (ctx->handle != DRM_KERNEL_CONTEXT) {
- if (dev->driver->context_dtor)
- dev->driver->context_dtor(dev, ctx->handle);
-
+ if (ctx->handle != DRM_KERNEL_CONTEXT)
drm_ctxbitmap_free(dev, ctx->handle);
- }
- return 0;
+ return (0);
}