diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2013-10-04 07:53:39 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-10-09 01:55:32 -0400 |
commit | fc6ff1935b550bdf525e0caa5ef0894010375414 (patch) | |
tree | 29c0cea9e21f7f210930ebc39148fa94bfa553df | |
parent | 6b8837df7a39d88f6a48a892312b08bbefba2540 (diff) |
drm: Kill ctx_count from struct drm_device
The only user of ctx_count is the via driver, and we can replace that
use with list_is_singular().
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/drm_context.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_fops.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/via/via_mm.c | 2 | ||||
-rw-r--r-- | include/drm/drmP.h | 1 |
4 files changed, 1 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c index 224ff965bcf7..a4b017b6849e 100644 --- a/drivers/gpu/drm/drm_context.c +++ b/drivers/gpu/drm/drm_context.c | |||
@@ -334,7 +334,6 @@ int drm_addctx(struct drm_device *dev, void *data, | |||
334 | 334 | ||
335 | mutex_lock(&dev->ctxlist_mutex); | 335 | mutex_lock(&dev->ctxlist_mutex); |
336 | list_add(&ctx_entry->head, &dev->ctxlist); | 336 | list_add(&ctx_entry->head, &dev->ctxlist); |
337 | ++dev->ctx_count; | ||
338 | mutex_unlock(&dev->ctxlist_mutex); | 337 | mutex_unlock(&dev->ctxlist_mutex); |
339 | 338 | ||
340 | return 0; | 339 | return 0; |
@@ -432,7 +431,6 @@ int drm_rmctx(struct drm_device *dev, void *data, | |||
432 | if (pos->handle == ctx->handle) { | 431 | if (pos->handle == ctx->handle) { |
433 | list_del(&pos->head); | 432 | list_del(&pos->head); |
434 | kfree(pos); | 433 | kfree(pos); |
435 | --dev->ctx_count; | ||
436 | } | 434 | } |
437 | } | 435 | } |
438 | } | 436 | } |
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 8bc94eaaf9f5..621b45e08bd1 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
@@ -524,7 +524,6 @@ int drm_release(struct inode *inode, struct file *filp) | |||
524 | 524 | ||
525 | list_del(&pos->head); | 525 | list_del(&pos->head); |
526 | kfree(pos); | 526 | kfree(pos); |
527 | --dev->ctx_count; | ||
528 | } | 527 | } |
529 | } | 528 | } |
530 | } | 529 | } |
diff --git a/drivers/gpu/drm/via/via_mm.c b/drivers/gpu/drm/via/via_mm.c index 7e3ad87c366c..927889105483 100644 --- a/drivers/gpu/drm/via/via_mm.c +++ b/drivers/gpu/drm/via/via_mm.c | |||
@@ -79,7 +79,7 @@ int via_final_context(struct drm_device *dev, int context) | |||
79 | 79 | ||
80 | /* Linux specific until context tracking code gets ported to BSD */ | 80 | /* Linux specific until context tracking code gets ported to BSD */ |
81 | /* Last context, perform cleanup */ | 81 | /* Last context, perform cleanup */ |
82 | if (dev->ctx_count == 1 && dev->dev_private) { | 82 | if (list_is_singular(&dev->ctxlist) && dev->dev_private) { |
83 | DRM_DEBUG("Last Context\n"); | 83 | DRM_DEBUG("Last Context\n"); |
84 | drm_irq_uninstall(dev); | 84 | drm_irq_uninstall(dev); |
85 | via_cleanup_futex(dev_priv); | 85 | via_cleanup_futex(dev_priv); |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 5b99c0e072ef..e26b80236719 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -1132,7 +1132,6 @@ struct drm_device { | |||
1132 | /** \name Context handle management */ | 1132 | /** \name Context handle management */ |
1133 | /*@{ */ | 1133 | /*@{ */ |
1134 | struct list_head ctxlist; /**< Linked list of context handles */ | 1134 | struct list_head ctxlist; /**< Linked list of context handles */ |
1135 | int ctx_count; /**< Number of context handles */ | ||
1136 | struct mutex ctxlist_mutex; /**< For ctxlist */ | 1135 | struct mutex ctxlist_mutex; /**< For ctxlist */ |
1137 | 1136 | ||
1138 | struct idr ctx_idr; | 1137 | struct idr ctx_idr; |