Mesa (master): st/xa: Add a scanout flag for surfaces

Thomas Hellstrom thomash at kemper.freedesktop.org
Tue Nov 1 17:19:23 UTC 2011


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

Author: Thomas Hellstrom <thellstrom at vmware.com>
Date:   Tue Nov  1 17:42:21 2011 +0100

st/xa: Add a scanout flag for surfaces

Bump minor to signal availability.

Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob at vmware.com>

---

 src/gallium/state_trackers/xa/xa_tracker.c |   12 ++++++++++++
 src/gallium/state_trackers/xa/xa_tracker.h |    3 ++-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c
index 50bf4b7..529279a 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.c
+++ b/src/gallium/state_trackers/xa/xa_tracker.c
@@ -220,6 +220,12 @@ xa_flags_compat(unsigned int old_flags, unsigned int new_flags)
 	return ((new_flags & XA_FLAG_RENDER_TARGET) == 0);
 
     /*
+     * Don't recreate if we're dropping the scanout flag.
+     */
+    if (flag_diff & XA_FLAG_SCANOUT)
+	return ((new_flags & XA_FLAG_SCANOUT) == 0);
+
+    /*
      * Always recreate for unknown / unimplemented flags.
      */
     return 0;
@@ -263,6 +269,8 @@ xa_format_check_supported(struct xa_tracker *xa,
 	bind |= PIPE_BIND_SHARED;
     if (flags & XA_FLAG_RENDER_TARGET)
 	bind |= PIPE_BIND_RENDER_TARGET;
+    if (flags & XA_FLAG_SCANOUT)
+	bind |= PIPE_BIND_SCANOUT;
 
     if (!xa->screen->is_format_supported(xa->screen, fdesc.format,
 					 PIPE_TEXTURE_2D, 0, bind))
@@ -309,6 +317,8 @@ xa_surface_create(struct xa_tracker *xa,
 	template->bind |= PIPE_BIND_SHARED;
     if (flags & XA_FLAG_RENDER_TARGET)
 	template->bind |= PIPE_BIND_RENDER_TARGET;
+    if (flags & XA_FLAG_SCANOUT)
+	template->bind |= PIPE_BIND_SCANOUT;
 
     srf->tex = xa->screen->resource_create(xa->screen, template);
     if (!srf->tex)
@@ -359,6 +369,8 @@ xa_surface_redefine(struct xa_surface *srf,
 	template->bind |= PIPE_BIND_SHARED;
     if (new_flags & XA_FLAG_RENDER_TARGET)
 	template->bind |= PIPE_BIND_RENDER_TARGET;
+    if (new_flags & XA_FLAG_SCANOUT)
+	template->bind |= PIPE_BIND_SCANOUT;
 
     if (copy_contents) {
 	if (!xa_format_type_is_color(fdesc.xa_format) ||
diff --git a/src/gallium/state_trackers/xa/xa_tracker.h b/src/gallium/state_trackers/xa/xa_tracker.h
index 62f8a21..abc2457 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.h
+++ b/src/gallium/state_trackers/xa/xa_tracker.h
@@ -37,11 +37,12 @@
 #include <stdint.h>
 
 #define XA_TRACKER_VERSION_MAJOR 0
-#define XA_TRACKER_VERSION_MINOR 4
+#define XA_TRACKER_VERSION_MINOR 5
 #define XA_TRACKER_VERSION_PATCH 0
 
 #define XA_FLAG_SHARED         (1 << 0)
 #define XA_FLAG_RENDER_TARGET  (1 << 1)
+#define XA_FLAG_SCANOUT        (1 << 2)
 
 #define XA_MAP_READ            (1 << 0)
 #define XA_MAP_WRITE           (1 << 1)




More information about the mesa-commit mailing list