Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ville Syrjälä and committed by
Dave Airlie
fc6ff193 6b8837df

+1 -5
-2
drivers/gpu/drm/drm_context.c
··· 334 334 335 335 mutex_lock(&dev->ctxlist_mutex); 336 336 list_add(&ctx_entry->head, &dev->ctxlist); 337 - ++dev->ctx_count; 338 337 mutex_unlock(&dev->ctxlist_mutex); 339 338 340 339 return 0; ··· 431 432 if (pos->handle == ctx->handle) { 432 433 list_del(&pos->head); 433 434 kfree(pos); 434 - --dev->ctx_count; 435 435 } 436 436 } 437 437 }
-1
drivers/gpu/drm/drm_fops.c
··· 524 524 525 525 list_del(&pos->head); 526 526 kfree(pos); 527 - --dev->ctx_count; 528 527 } 529 528 } 530 529 }
+1 -1
drivers/gpu/drm/via/via_mm.c
··· 79 79 80 80 /* Linux specific until context tracking code gets ported to BSD */ 81 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 83 DRM_DEBUG("Last Context\n"); 84 84 drm_irq_uninstall(dev); 85 85 via_cleanup_futex(dev_priv);
-1
include/drm/drmP.h
··· 1132 1132 /** \name Context handle management */ 1133 1133 /*@{ */ 1134 1134 struct list_head ctxlist; /**< Linked list of context handles */ 1135 - int ctx_count; /**< Number of context handles */ 1136 1135 struct mutex ctxlist_mutex; /**< For ctxlist */ 1137 1136 1138 1137 struct idr ctx_idr;