diff options
author | Chia-I Wu <[email protected]> | 2015-03-06 02:03:10 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2015-03-06 02:25:03 +0800 |
commit | 4ddd981e407f9e97fcbb862c241f1ce165616fd4 (patch) | |
tree | 5127116d96ae302939b00c7ad718796899fc95c1 /src/gallium/winsys | |
parent | 70ef171e91582f60a010a4f0ea9f7ff5ba971ab4 (diff) |
ilo: add more convenient intel_bo_{ref,unref}()
They both check for NULL and intel_bo_ref() returns the referenced bo. They
replace intel_bo_{reference,unreference}().
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/intel/drm/intel_drm_winsys.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/winsys/intel/drm/intel_drm_winsys.c b/src/gallium/winsys/intel/drm/intel_drm_winsys.c index d05e0362a6c..b5ffceb7e65 100644 --- a/src/gallium/winsys/intel/drm/intel_drm_winsys.c +++ b/src/gallium/winsys/intel/drm/intel_drm_winsys.c @@ -464,16 +464,20 @@ intel_winsys_decode_bo(struct intel_winsys *winsys, intel_bo_unmap(bo); } -void -intel_bo_reference(struct intel_bo *bo) +struct intel_bo * +intel_bo_ref(struct intel_bo *bo) { - drm_intel_bo_reference(gem_bo(bo)); + if (bo) + drm_intel_bo_reference(gem_bo(bo)); + + return bo; } void -intel_bo_unreference(struct intel_bo *bo) +intel_bo_unref(struct intel_bo *bo) { - drm_intel_bo_unreference(gem_bo(bo)); + if (bo) + drm_intel_bo_unreference(gem_bo(bo)); } int |