summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-11-04 23:09:05 +0000
committerKeith Whitwell <keithw@vmware.com>2009-11-04 23:09:05 +0000
commit18efe9a6878e52c53161c7a169863c4a7c5778fd (patch)
tree6ce03fa9e225dc13002ca7ad58e1ae8e84cdca2b /src
parent951fdac566c3f2124f82aa94da08f55a10608f25 (diff)
ws/i965: allow NULL buffer in winsys::bo_unreference
Special case to avoid clutter in the driver
Diffstat (limited to 'src')
-rw-r--r--src/gallium/winsys/drm/i965/xlib/xlib_i965.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/winsys/drm/i965/xlib/xlib_i965.c b/src/gallium/winsys/drm/i965/xlib/xlib_i965.c
index 4ce22a5a49..08fce4b20b 100644
--- a/src/gallium/winsys/drm/i965/xlib/xlib_i965.c
+++ b/src/gallium/winsys/drm/i965/xlib/xlib_i965.c
@@ -154,6 +154,12 @@ xlib_brw_bo_unreference( struct brw_winsys_buffer *buffer )
{
struct xlib_brw_buffer *buf = xlib_brw_buffer(buffer);
+ /* As a special favor in this call only, buffer is allowed to be
+ * NULL:
+ */
+ if (buffer == NULL)
+ return;
+
if (--buf->cheesy_refcount == 0) {
FREE(buffer);
}