diff options
author | Francisco Jerez <currojerez@riseup.net> | 2010-10-17 21:55:48 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-12-03 00:06:42 -0500 |
commit | f091a3d403065416b7d27221bbeb956481132ffd (patch) | |
tree | 9a6f39cbf15fbc7f4b45379c628f207590641b12 /drivers/gpu/drm/nouveau/nouveau_drv.h | |
parent | 36c952e8b3bad911ef13111058f0a5c4b361027e (diff) |
drm/nouveau: Implement weak channel references.
nouveau_channel_ref() takes a "weak" channel reference that doesn't
prevent the hardware channel resources from being released, it just
keeps the channel data structure alive.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drv.h')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index e6708be58bc..d152bc334fd 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
@@ -165,7 +165,11 @@ struct nouveau_channel { | |||
165 | struct drm_device *dev; | 165 | struct drm_device *dev; |
166 | int id; | 166 | int id; |
167 | 167 | ||
168 | atomic_t refcount; | 168 | /* references to the channel data structure */ |
169 | struct kref ref; | ||
170 | /* users of the hardware channel resources, the hardware | ||
171 | * context will be kicked off when it reaches zero. */ | ||
172 | atomic_t users; | ||
169 | struct mutex mutex; | 173 | struct mutex mutex; |
170 | 174 | ||
171 | /* owner of this fifo */ | 175 | /* owner of this fifo */ |
@@ -808,6 +812,8 @@ extern struct nouveau_channel * | |||
808 | nouveau_channel_get(struct drm_device *, struct drm_file *, int id); | 812 | nouveau_channel_get(struct drm_device *, struct drm_file *, int id); |
809 | extern void nouveau_channel_put_unlocked(struct nouveau_channel **); | 813 | extern void nouveau_channel_put_unlocked(struct nouveau_channel **); |
810 | extern void nouveau_channel_put(struct nouveau_channel **); | 814 | extern void nouveau_channel_put(struct nouveau_channel **); |
815 | extern void nouveau_channel_ref(struct nouveau_channel *chan, | ||
816 | struct nouveau_channel **pchan); | ||
811 | 817 | ||
812 | /* nouveau_object.c */ | 818 | /* nouveau_object.c */ |
813 | extern int nouveau_gpuobj_early_init(struct drm_device *); | 819 | extern int nouveau_gpuobj_early_init(struct drm_device *); |