From 71f0a3e389efb6c92a84299d05beb2a1bfa53469 Mon Sep 17 00:00:00 2001 From: vehemens Date: Fri, 29 Aug 2008 12:47:00 -0400 Subject: [FreeBSD] Replace typedefs on bsd. Signed-off-by: Robert Noland --- bsd-core/drm_context.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'bsd-core/drm_context.c') diff --git a/bsd-core/drm_context.c b/bsd-core/drm_context.c index 6d44fbec..a621ca52 100644 --- a/bsd-core/drm_context.c +++ b/bsd-core/drm_context.c @@ -140,7 +140,7 @@ void drm_ctxbitmap_cleanup(struct drm_device *dev) int drm_getsareactx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_priv_map_t *request = data; + struct drm_ctx_priv_map *request = data; drm_local_map_t *map; DRM_LOCK(); @@ -161,7 +161,7 @@ int drm_getsareactx(struct drm_device *dev, void *data, int drm_setsareactx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_priv_map_t *request = data; + struct drm_ctx_priv_map *request = data; drm_local_map_t *map = NULL; DRM_LOCK(); @@ -221,8 +221,8 @@ int drm_context_switch_complete(struct drm_device *dev, int new) int drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_res_t *res = data; - drm_ctx_t ctx; + struct drm_ctx_res *res = data; + struct drm_ctx ctx; int i; if ( res->count >= DRM_RESERVED_CONTEXTS ) { @@ -241,7 +241,7 @@ int drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_addctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_t *ctx = data; + struct drm_ctx *ctx = data; ctx->handle = drm_ctxbitmap_next(dev); if ( ctx->handle == DRM_KERNEL_CONTEXT ) { @@ -272,7 +272,7 @@ int drm_modctx(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_getctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_t *ctx = data; + struct drm_ctx *ctx = data; /* This is 0, because we don't handle any context flags */ ctx->flags = 0; @@ -283,7 +283,7 @@ int drm_getctx(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_switchctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_t *ctx = data; + struct drm_ctx *ctx = data; DRM_DEBUG( "%d\n", ctx->handle ); return drm_context_switch(dev, dev->last_context, ctx->handle); @@ -291,7 +291,7 @@ int drm_switchctx(struct drm_device *dev, void *data, int drm_newctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_t *ctx = data; + struct drm_ctx *ctx = data; DRM_DEBUG( "%d\n", ctx->handle ); drm_context_switch_complete(dev, ctx->handle); @@ -301,7 +301,7 @@ int drm_newctx(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_rmctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_t *ctx = data; + struct drm_ctx *ctx = data; DRM_DEBUG( "%d\n", ctx->handle ); if ( ctx->handle != DRM_KERNEL_CONTEXT ) { -- cgit v1.2.3 From 2649103bf9c4eb471a10800f4a3161dca6249086 Mon Sep 17 00:00:00 2001 From: vehemens Date: Fri, 29 Aug 2008 13:18:54 -0400 Subject: [FreeBSD] Convert drm_driver to a pointer like linux. Signed-off-by: Robert Noland --- bsd-core/drm_context.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bsd-core/drm_context.c') diff --git a/bsd-core/drm_context.c b/bsd-core/drm_context.c index a621ca52..b85922e1 100644 --- a/bsd-core/drm_context.c +++ b/bsd-core/drm_context.c @@ -255,9 +255,9 @@ int drm_addctx(struct drm_device *dev, void *data, struct drm_file *file_priv) return ENOMEM; } - if (dev->driver.context_ctor && ctx->handle != DRM_KERNEL_CONTEXT) { + if (dev->driver->context_ctor && ctx->handle != DRM_KERNEL_CONTEXT) { DRM_LOCK(); - dev->driver.context_ctor(dev, ctx->handle); + dev->driver->context_ctor(dev, ctx->handle); DRM_UNLOCK(); } @@ -305,9 +305,9 @@ int drm_rmctx(struct drm_device *dev, void *data, struct drm_file *file_priv) DRM_DEBUG( "%d\n", ctx->handle ); if ( ctx->handle != DRM_KERNEL_CONTEXT ) { - if (dev->driver.context_dtor) { + if (dev->driver->context_dtor) { DRM_LOCK(); - dev->driver.context_dtor(dev, ctx->handle); + dev->driver->context_dtor(dev, ctx->handle); DRM_UNLOCK(); } -- cgit v1.2.3 From 76dd74c64ef9b92025e76dd256e0641ff6fce0f4 Mon Sep 17 00:00:00 2001 From: vehemens Date: Tue, 2 Sep 2008 04:57:36 -0700 Subject: Style white space cleanup. Signed-off-by: Robert Noland --- bsd-core/drm_context.c | 70 +++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'bsd-core/drm_context.c') diff --git a/bsd-core/drm_context.c b/bsd-core/drm_context.c index b85922e1..24f34fdd 100644 --- a/bsd-core/drm_context.c +++ b/bsd-core/drm_context.c @@ -62,7 +62,7 @@ int drm_ctxbitmap_next(struct drm_device *dev) return -1; DRM_LOCK(); - bit = find_first_zero_bit( dev->ctx_bitmap, DRM_MAX_CTXBITMAP ); + bit = find_first_zero_bit(dev->ctx_bitmap, DRM_MAX_CTXBITMAP); if (bit >= DRM_MAX_CTXBITMAP) { DRM_UNLOCK(); return -1; @@ -116,9 +116,9 @@ int drm_ctxbitmap_init(struct drm_device *dev) dev->max_context = -1; DRM_UNLOCK(); - for ( i = 0 ; i < DRM_RESERVED_CONTEXTS ; i++ ) { + for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) { temp = drm_ctxbitmap_next(dev); - DRM_DEBUG( "drm_ctxbitmap_init : %d\n", temp ); + DRM_DEBUG("drm_ctxbitmap_init : %d\n", temp); } return 0; @@ -188,33 +188,33 @@ bad: int drm_context_switch(struct drm_device *dev, int old, int new) { - if ( test_and_set_bit( 0, &dev->context_flag ) ) { - DRM_ERROR( "Reentering -- FIXME\n" ); - return EBUSY; - } + if (test_and_set_bit(0, &dev->context_flag)) { + DRM_ERROR("Reentering -- FIXME\n"); + return EBUSY; + } - DRM_DEBUG( "Context switch from %d to %d\n", old, new ); + DRM_DEBUG("Context switch from %d to %d\n", old, new); - if ( new == dev->last_context ) { - clear_bit( 0, &dev->context_flag ); - return 0; - } + if (new == dev->last_context) { + clear_bit(0, &dev->context_flag); + return 0; + } - return 0; + return 0; } int drm_context_switch_complete(struct drm_device *dev, int new) { - dev->last_context = new; /* PRE/POST: This is the _only_ writer. */ + dev->last_context = new; /* PRE/POST: This is the _only_ writer. */ - if ( !_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) ) { - DRM_ERROR( "Lock isn't held after context switch\n" ); - } + if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { + DRM_ERROR("Lock isn't held after context switch\n"); + } - /* If a context switch is ever initiated - when the kernel holds the lock, release - that lock here. */ - clear_bit( 0, &dev->context_flag ); + /* If a context switch is ever initiated + when the kernel holds the lock, release + that lock here. */ + clear_bit(0, &dev->context_flag); return 0; } @@ -225,12 +225,12 @@ int drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv) struct drm_ctx ctx; int i; - if ( res->count >= DRM_RESERVED_CONTEXTS ) { + if (res->count >= DRM_RESERVED_CONTEXTS) { bzero(&ctx, sizeof(ctx)); - for ( i = 0 ; i < DRM_RESERVED_CONTEXTS ; i++ ) { + for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) { ctx.handle = i; - if ( DRM_COPY_TO_USER( &res->contexts[i], - &ctx, sizeof(ctx) ) ) + if (DRM_COPY_TO_USER( &res->contexts[i], + &ctx, sizeof(ctx))) return EFAULT; } } @@ -244,14 +244,14 @@ int drm_addctx(struct drm_device *dev, void *data, struct drm_file *file_priv) struct drm_ctx *ctx = data; ctx->handle = drm_ctxbitmap_next(dev); - if ( ctx->handle == DRM_KERNEL_CONTEXT ) { - /* Skip kernel's context and get a new one. */ + if (ctx->handle == DRM_KERNEL_CONTEXT) { + /* Skip kernel's context and get a new one. */ ctx->handle = drm_ctxbitmap_next(dev); } - DRM_DEBUG( "%d\n", ctx->handle ); - if ( ctx->handle == -1 ) { - DRM_DEBUG( "Not enough free contexts.\n" ); - /* Should this return -EBUSY instead? */ + DRM_DEBUG("%d\n", ctx->handle); + if (ctx->handle == -1) { + DRM_DEBUG("Not enough free contexts.\n"); + /* Should this return -EBUSY instead? */ return ENOMEM; } @@ -285,7 +285,7 @@ int drm_switchctx(struct drm_device *dev, void *data, { struct drm_ctx *ctx = data; - DRM_DEBUG( "%d\n", ctx->handle ); + DRM_DEBUG("%d\n", ctx->handle); return drm_context_switch(dev, dev->last_context, ctx->handle); } @@ -293,7 +293,7 @@ int drm_newctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_ctx *ctx = data; - DRM_DEBUG( "%d\n", ctx->handle ); + DRM_DEBUG("%d\n", ctx->handle); drm_context_switch_complete(dev, ctx->handle); return 0; @@ -303,8 +303,8 @@ int drm_rmctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_ctx *ctx = data; - DRM_DEBUG( "%d\n", ctx->handle ); - if ( ctx->handle != DRM_KERNEL_CONTEXT ) { + DRM_DEBUG("%d\n", ctx->handle); + if (ctx->handle != DRM_KERNEL_CONTEXT) { if (dev->driver->context_dtor) { DRM_LOCK(); dev->driver->context_dtor(dev, ctx->handle); -- cgit v1.2.3 From 0808cf923d4a851b100d9b7022cb82f5e1f52e28 Mon Sep 17 00:00:00 2001 From: vehemens Date: Sat, 6 Sep 2008 14:16:51 -0700 Subject: Style white space cleanup part 2. Signed-off-by: Robert Noland --- bsd-core/drm_context.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bsd-core/drm_context.c') diff --git a/bsd-core/drm_context.c b/bsd-core/drm_context.c index 24f34fdd..bca899cb 100644 --- a/bsd-core/drm_context.c +++ b/bsd-core/drm_context.c @@ -108,7 +108,7 @@ int drm_ctxbitmap_init(struct drm_device *dev) DRM_LOCK(); dev->ctx_bitmap = malloc(PAGE_SIZE, M_DRM, M_NOWAIT | M_ZERO); - if ( dev->ctx_bitmap == NULL ) { + if (dev->ctx_bitmap == NULL) { DRM_UNLOCK(); return ENOMEM; } @@ -214,9 +214,9 @@ int drm_context_switch_complete(struct drm_device *dev, int new) /* If a context switch is ever initiated when the kernel holds the lock, release that lock here. */ - clear_bit(0, &dev->context_flag); + clear_bit(0, &dev->context_flag); - return 0; + return 0; } int drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv) @@ -229,7 +229,7 @@ int drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv) bzero(&ctx, sizeof(ctx)); for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) { ctx.handle = i; - if (DRM_COPY_TO_USER( &res->contexts[i], + if (DRM_COPY_TO_USER(&res->contexts[i], &ctx, sizeof(ctx))) return EFAULT; } -- cgit v1.2.3