summaryrefslogtreecommitdiff
path: root/bsd/drm_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'bsd/drm_context.h')
-rw-r--r--bsd/drm_context.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/bsd/drm_context.h b/bsd/drm_context.h
index b4ec3bc3..a6116634 100644
--- a/bsd/drm_context.h
+++ b/bsd/drm_context.h
@@ -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 );
}