intel: make intel_flush_front safe to call during initial MakeCurrent
authorPaul Berry <stereotype441@gmail.com>
Thu, 30 May 2013 14:08:07 +0000 (07:08 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 7 Jun 2013 20:26:36 +0000 (13:26 -0700)
commit03cc31031315059a80d12485a402ea2a8731dc8a
treee1328c769198d741d4aed38e48dcee054d502a08
parentbc8bfdc42cce18cf3a44f487b73460bebe8c2ae4
intel: make intel_flush_front safe to call during initial MakeCurrent

The patch that follows will fix a bug that prevents
intel_flush_front() from being called often enough.  In doing so, it
will create a situation where intel_flush_front() is called during the
initial call to glXMakeCurrent().  In this circumstance,
ctx->DrawBuffer hasn't been initialized yet and is NULL.  Fortunately,
intel->front_buffer_dirty is false, so intel_flush_front() doesn't
actually need to do anything.  To avoid a segfault, swap the order of
terms in intel_flush_front()'s if statement.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/intel/intel_context.c