summaryrefslogtreecommitdiff
path: root/bsd-core/drm_context.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2003-08-29 19:24:36 +0000
committerEric Anholt <anholt@freebsd.org>2003-08-29 19:24:36 +0000
commitfabc64dd573f01a2160be474b4abc65a3a9aa5ea (patch)
tree03d8b6a2a7a7b3ea0348a320aa4e44841ff6dd51 /bsd-core/drm_context.c
parenta7aebb6dac3287374721dd2101a4584f12c63c82 (diff)
Port the SiS DRM to FreeBSD. This includes the ability for the DRM to
allocate framebuffer memory without sisfb, and a new ioctl to be used by the X Server which tells the DRM what region of framebuffer memory to allocate from. Also fixes a possibility to panic the kernel I believe. Tested on linux with sisfb and FreeBSD (without sisfb) with new DRI only.
Diffstat (limited to 'bsd-core/drm_context.c')
-rw-r--r--bsd-core/drm_context.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bsd-core/drm_context.c b/bsd-core/drm_context.c
index b4ec3bc3..a6116634 100644
--- a/bsd-core/drm_context.c
+++ b/bsd-core/drm_context.c
@@ -282,6 +282,11 @@ int DRM(addctx)( DRM_IOCTL_ARGS )
return DRM_ERR(ENOMEM);
}
+#ifdef DRIVER_CTX_CTOR
+ if ( ctx.handle != DRM_KERNEL_CONTEXT )
+ DRIVER_CTX_CTOR(ctx.handle); /* XXX: also pass dev ? */
+#endif
+
DRM_COPY_TO_USER_IOCTL( (drm_ctx_t *)data, ctx, sizeof(ctx) );
return 0;
@@ -340,6 +345,9 @@ int DRM(rmctx)( DRM_IOCTL_ARGS )
DRM_DEBUG( "%d\n", ctx.handle );
if ( ctx.handle != DRM_KERNEL_CONTEXT ) {
+#ifdef DRIVER_CTX_DTOR
+ DRIVER_CTX_DTOR(ctx.handle); /* XXX: also pass dev ? */
+#endif
DRM(ctxbitmap_free)( dev, ctx.handle );
}