summaryrefslogtreecommitdiff
path: root/linux-core/drm_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-core/drm_context.c')
-rw-r--r--linux-core/drm_context.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/linux-core/drm_context.c b/linux-core/drm_context.c
index 0cf34549..dd280e53 100644
--- a/linux-core/drm_context.c
+++ b/linux-core/drm_context.c
@@ -420,10 +420,13 @@ int DRM(addctx)( struct inode *inode, struct file *filp,
/* Should this return -EBUSY instead? */
return -ENOMEM;
}
-#ifdef DRIVER_CTX_CTOR
+
if ( ctx.handle != DRM_KERNEL_CONTEXT )
- DRIVER_CTX_CTOR(dev, ctx.handle);
-#endif
+ {
+ if (dev->fn_tbl.context_ctor)
+ dev->fn_tbl.context_ctor(dev, ctx.handle);
+ }
+
ctx_entry = DRM(alloc)( sizeof(*ctx_entry), DRM_MEM_CTXLIST );
if ( !ctx_entry ) {
DRM_DEBUG("out of memory\n");
@@ -555,9 +558,8 @@ int DRM(rmctx)( struct inode *inode, struct file *filp,
priv->remove_auth_on_close = 1;
}
if ( ctx.handle != DRM_KERNEL_CONTEXT ) {
-#ifdef DRIVER_CTX_DTOR
- DRIVER_CTX_DTOR(dev, ctx.handle);
-#endif
+ if (dev->fn_tbl.context_ctor)
+ dev->fn_tbl.context_ctor(dev, ctx.handle);
DRM(ctxbitmap_free)( dev, ctx.handle );
}