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>
This commit is contained in:
Родитель
6b8837df7a
Коммит
fc6ff1935b
|
@ -334,7 +334,6 @@ int drm_addctx(struct drm_device *dev, void *data,
|
||||||
|
|
||||||
mutex_lock(&dev->ctxlist_mutex);
|
mutex_lock(&dev->ctxlist_mutex);
|
||||||
list_add(&ctx_entry->head, &dev->ctxlist);
|
list_add(&ctx_entry->head, &dev->ctxlist);
|
||||||
++dev->ctx_count;
|
|
||||||
mutex_unlock(&dev->ctxlist_mutex);
|
mutex_unlock(&dev->ctxlist_mutex);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -432,7 +431,6 @@ int drm_rmctx(struct drm_device *dev, void *data,
|
||||||
if (pos->handle == ctx->handle) {
|
if (pos->handle == ctx->handle) {
|
||||||
list_del(&pos->head);
|
list_del(&pos->head);
|
||||||
kfree(pos);
|
kfree(pos);
|
||||||
--dev->ctx_count;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -524,7 +524,6 @@ int drm_release(struct inode *inode, struct file *filp)
|
||||||
|
|
||||||
list_del(&pos->head);
|
list_del(&pos->head);
|
||||||
kfree(pos);
|
kfree(pos);
|
||||||
--dev->ctx_count;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ int via_final_context(struct drm_device *dev, int context)
|
||||||
|
|
||||||
/* Linux specific until context tracking code gets ported to BSD */
|
/* Linux specific until context tracking code gets ported to BSD */
|
||||||
/* Last context, perform cleanup */
|
/* Last context, perform cleanup */
|
||||||
if (dev->ctx_count == 1 && dev->dev_private) {
|
if (list_is_singular(&dev->ctxlist) && dev->dev_private) {
|
||||||
DRM_DEBUG("Last Context\n");
|
DRM_DEBUG("Last Context\n");
|
||||||
drm_irq_uninstall(dev);
|
drm_irq_uninstall(dev);
|
||||||
via_cleanup_futex(dev_priv);
|
via_cleanup_futex(dev_priv);
|
||||||
|
|
|
@ -1132,7 +1132,6 @@ struct drm_device {
|
||||||
/** \name Context handle management */
|
/** \name Context handle management */
|
||||||
/*@{ */
|
/*@{ */
|
||||||
struct list_head ctxlist; /**< Linked list of context handles */
|
struct list_head ctxlist; /**< Linked list of context handles */
|
||||||
int ctx_count; /**< Number of context handles */
|
|
||||||
struct mutex ctxlist_mutex; /**< For ctxlist */
|
struct mutex ctxlist_mutex; /**< For ctxlist */
|
||||||
|
|
||||||
struct idr ctx_idr;
|
struct idr ctx_idr;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче