mesa: Add support for the GL_KHR_context_flush_control extension

The GL side of this extension just provides an accessor via glGetIntegerv for
the value of GL_CONTEXT_RELEASE_BEHAVIOR so it is trivial to implement. There
is a constant on the context for the value of the enum which is initialised to
GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH. The extension is always enabled because it
doesn't need any driver interaction to retrieve the value.

If the value of the enum is anything but FLUSH then _mesa_make_current will
now refrain from calling _mesa_flush. This should only affect drivers that
explicitly change the enum to a non-default value.
dri: Change __DriverApiRec::CreateContext to take a struct for attribs

Previously the CreateContext method of __DriverApiRec took a set of arguments
to describe the attribute values from the window system API's
CreateContextAttribs function. As more attributes get added this could quickly
get unworkable and every new attribute needs a modification for every driver.

To fix that this patch passes the attribute values in a struct instead. The
struct has a bitmask to specify which members are used. However the first
three members (two for the GL version and one for the flags) are always set.
If the bit is not set in the attribute mask then it can be assumed the
attribute has the default value. That way the drivers can quickly check if any
attributes were set that they don't understand. When we add any new attributes
we can just extend the struct and add a new flag and the existing drivers will
automatically report an error when the attribute is used.

Currently the only attribute using this mechanism is the reset strategy but
the plan is to also use it for the flush control attribute in a later patch.
dri: Add a flush control extension

Adds a DRI extension which advertises that the driver can accept a new
__DRI_CTX_ATTRIB_RELEASE_BEHAVIOR attribute in the createContextAttribs
function. If the attribute is specified then it will be passed down to the
CreateContext function in the release_behavior member of
__DriverContextConfig. The attribute is needed to implement the
GLX_ARB_context_flush_control extension.
glx: Add the GLX_ARB_flush_control_extension

This adds the framework for the GLX flush control extension. It is advertised
if the DRI driver implements the new __DRI2_FLUSH_CONTROL extension. The GLX
attributes are converted to the appropriate DRI attributes.
intel: Don't flush the old context in intelMakeCurrent

It shouldn't be necessary to flush the context within the driver
implementation because the old context is explicitly flushed in
_mesa_make_current before the driver code is reached. It is useful to only
have a single place that flushes the context when switching contexts to make
it easier to later implement the GL_KHR_context_flush_control extension.
i965: Implement the __DRI2_FLUSH_CONTROL extension

Implementing the extension just involves copying the release behaviour value
from the context config to the GL context's constants. The upper layers of
Mesa handles the actual flushing.