intel: Keep region name in intel_miptree_create_for_dri2_buffer(). 71/6971/1
authorPaul Berry <stereotype441@gmail.com>
Tue, 28 May 2013 20:29:53 +0000 (13:29 -0700)
committerPaul Berry <stereotype441@gmail.com>
Wed, 12 Jun 2013 17:45:42 +0000 (10:45 -0700)
commita5efdca7b70a237b8786c595453f4599e38263ea
tree3b7679ddd584a2f21ceb26399c721530dac6ce3c
parentadf324ad28ccd9c6fdb8461661b95c2b5d49b6f7
intel: Keep region name in intel_miptree_create_for_dri2_buffer().

When processing a buffer received from the X server,
intel_process_dri2_buffer() examines intel_region::name to determine
whether it's received a brand new buffer, or the same buffer it
received from the X server the last time it made a request.

However, this didn't work properly, because in the call to
intel_miptree_create_for_dri2_buffer(), we create a fresh intel_region
object to represent the buffer, and this was causing us to forget the
buffer's previous name.

This patch fixes things by copying over the region name when creating
the fresh intel_region object.

At the moment, this is just a minor performance optimization.
However, when fast color clears are added, it will be necessary to
ensure that the fast color clear state for a buffer doesn't get
discarded the next time we receive that buffer from the X server.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/intel/intel_mipmap_tree.c