gallium: fix remaining users of pipe_reference function

This commit is contained in:
Roland Scheidegger
2009-12-03 23:58:30 +01:00
parent 86c8f70db1
commit 4153ec547c
4 changed files with 7 additions and 4 deletions

View File

@@ -48,13 +48,14 @@ so_ref(struct nouveau_stateobj *ref, struct nouveau_stateobj **pso)
struct nouveau_stateobj *so = *pso; struct nouveau_stateobj *so = *pso;
int i; int i;
if (pipe_reference((struct pipe_reference**)pso, &ref->reference)) { if (pipe_reference(&(*pso)->reference, &ref->reference)) {
free(so->push); free(so->push);
for (i = 0; i < so->cur_reloc; i++) for (i = 0; i < so->cur_reloc; i++)
nouveau_bo_ref(NULL, &so->reloc[i].bo); nouveau_bo_ref(NULL, &so->reloc[i].bo);
free(so->reloc); free(so->reloc);
free(so); free(so);
} }
*pso = ref;
} }
static INLINE void static INLINE void

View File

@@ -62,8 +62,9 @@ st_device_reference(struct st_device **ptr, struct st_device *st_dev)
{ {
struct st_device *old_dev = *ptr; struct st_device *old_dev = *ptr;
if (pipe_reference((struct pipe_reference **)ptr, &st_dev->reference)) if (pipe_reference(&(*ptr)->reference, &st_dev->reference))
st_device_really_destroy(old_dev); st_device_really_destroy(old_dev);
*ptr = st_dev;
} }

View File

@@ -39,11 +39,12 @@ intel_drm_fence_reference(struct intel_winsys *iws,
struct intel_drm_fence *old = (struct intel_drm_fence *)*ptr; struct intel_drm_fence *old = (struct intel_drm_fence *)*ptr;
struct intel_drm_fence *f = (struct intel_drm_fence *)fence; struct intel_drm_fence *f = (struct intel_drm_fence *)fence;
if (pipe_reference((struct pipe_reference**)ptr, &f->reference)) { if (pipe_reference(&(*ptr)->reference, &f->reference)) {
if (old->bo) if (old->bo)
drm_intel_bo_unreference(old->bo); drm_intel_bo_unreference(old->bo);
FREE(old); FREE(old);
} }
*ptr = fence;
} }
static int static int

View File

@@ -47,7 +47,7 @@ vmw_svga_winsys_surface_reference(struct vmw_svga_winsys_surface **pdst,
src_ref = src ? &src->refcnt : NULL; src_ref = src ? &src->refcnt : NULL;
dst_ref = dst ? &dst->refcnt : NULL; dst_ref = dst ? &dst->refcnt : NULL;
if (pipe_reference(&dst_ref, src_ref)) { if (pipe_reference(dst_ref, src_ref)) {
vmw_ioctl_surface_destroy(dst->screen, dst->sid); vmw_ioctl_surface_destroy(dst->screen, dst->sid);
#ifdef DEBUG #ifdef DEBUG
/* to detect dangling pointers */ /* to detect dangling pointers */