diff options
author | Eric Anholt <anholt@freebsd.org> | 2005-08-26 00:16:01 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2005-08-26 00:16:01 +0000 |
commit | 55bea952b326b88f2fa6502321f605f96ee9be66 (patch) | |
tree | 9de73f0fa9527d8e3954808e7cb30493f166d1ac /bsd-core/drm_context.c | |
parent | 9942cad1f6078c24bb69a126795635b2f34d65b5 (diff) |
[1] Fix BSD DRM for the nonroot changes. [2] Don't attempt to acquire the
DMA lock in a non-DMA driver, as it will be uninitialized.
Submitted by: [1] jkim (minor changes by me)
Diffstat (limited to 'bsd-core/drm_context.c')
-rw-r--r-- | bsd-core/drm_context.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bsd-core/drm_context.c b/bsd-core/drm_context.c index 11d23c6f..8e009540 100644 --- a/bsd-core/drm_context.c +++ b/bsd-core/drm_context.c @@ -228,14 +228,17 @@ int drm_context_switch_complete(drm_device_t *dev, int new) int drm_resctx(DRM_IOCTL_ARGS) { drm_ctx_res_t res; + drm_ctx_t ctx; int i; DRM_COPY_FROM_USER_IOCTL( res, (drm_ctx_res_t *)data, sizeof(res) ); if ( res.count >= DRM_RESERVED_CONTEXTS ) { + bzero(&ctx, sizeof(ctx)); for ( i = 0 ; i < DRM_RESERVED_CONTEXTS ; i++ ) { + ctx.handle = i; if ( DRM_COPY_TO_USER( &res.contexts[i], - &i, sizeof(i) ) ) + &ctx, sizeof(ctx) ) ) return DRM_ERR(EFAULT); } } |