From 55bea952b326b88f2fa6502321f605f96ee9be66 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 26 Aug 2005 00:16:01 +0000 Subject: [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) --- bsd-core/drm_context.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bsd-core/drm_context.c') 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); } } -- cgit v1.2.3