Mesa (master): intel: Keep region name in intel_miptree_create_for_dri2_buffer().

Paul Berry stereotype441 at kemper.freedesktop.org
Wed Jun 12 18:12:22 UTC 2013


Module: Mesa
Branch: master
Commit: a5efdca7b70a237b8786c595453f4599e38263ea
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5efdca7b70a237b8786c595453f4599e38263ea

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Tue May 28 13:29:53 2013 -0700

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 at anholt.net>

---

 src/mesa/drivers/dri/intel/intel_mipmap_tree.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index c336c46..08b5d42 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -575,6 +575,7 @@ intel_miptree_create_for_dri2_buffer(struct intel_context *intel,
                                                  region->tiling);
    if (!singlesample_mt)
       return NULL;
+   singlesample_mt->region->name = region->name;
 
    if (num_samples == 0)
       return singlesample_mt;




More information about the mesa-commit mailing list