[Mesa-dev] [PATCH 1/2] Revert st/xa: Fix advertized version number and try to avoid future discrepancies

2014-04-07 Thread Emil Velikov
Parsing source files through build systems is never a good idea.
Especially when the issue can be resolved by adding a couple of
definitions to CPPFLAGS via the build system.

This reverts commit 61bedc3d6b08943f015f9d590c07a6af36c2a92c.

Cc: Thomas Hellstrom thellst...@vmware.com
---

Seems like I was a bit too quick to call it out, although IMHO we
should avoid making things more convoluted than what they already
are.

Cheers
Emil

 configure.ac  |   1 -
 src/gallium/state_trackers/xa/xa_tracker.h| 200 ++
 src/gallium/state_trackers/xa/xa_tracker.h.in | 200 --
 3 files changed, 200 insertions(+), 201 deletions(-)
 create mode 100644 src/gallium/state_trackers/xa/xa_tracker.h
 delete mode 100644 src/gallium/state_trackers/xa/xa_tracker.h.in

diff --git a/configure.ac b/configure.ac
index ee5c2d1..d182a39 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2063,7 +2063,6 @@ AC_CONFIG_FILES([Makefile
src/gallium/state_trackers/vdpau/Makefile
src/gallium/state_trackers/vega/Makefile
src/gallium/state_trackers/xa/Makefile
-src/gallium/state_trackers/xa/xa_tracker.h
src/gallium/state_trackers/xvmc/Makefile
src/gallium/targets/Makefile
src/gallium/targets/dri-freedreno/Makefile
diff --git a/src/gallium/state_trackers/xa/xa_tracker.h 
b/src/gallium/state_trackers/xa/xa_tracker.h
new file mode 100644
index 000..43e56ff
--- /dev/null
+++ b/src/gallium/state_trackers/xa/xa_tracker.h
@@ -0,0 +1,200 @@
+/**
+ * Copyright 2009-2011 VMware, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the Software), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The format encoding idea is partially borrowed from libpixman, but it is not
+ * considered a substantial part of the software, so the pixman copyright
+ * is left out for simplicity, and acknowledgment is instead given in this way.
+ *
+ *
+ * Authors:
+ * Zack Rusin zackr-at-vmware-dot-com
+ * Thomas Hellstrom thellstrom-at-vmware-dot-com
+ */
+
+#ifndef _XA_TRACKER_H_
+#define _XA_TRACKER_H_
+
+#include stdint.h
+
+#define XA_TRACKER_VERSION_MAJOR 2
+#define XA_TRACKER_VERSION_MINOR 1
+#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)
+#define XA_MAP_MAP_DIRECTLY (1  2)
+#define XA_MAP_UNSYNCHRONIZED   (1  3)
+#define XA_MAP_DONTBLOCK(1  4)
+#define XA_MAP_DISCARD_WHOLE_RESOURCE   (1  5)
+
+#define XA_ERR_NONE0
+#define XA_ERR_NORES   1
+#define XA_ERR_INVAL   2
+#define XA_ERR_BUSY3
+
+enum xa_surface_type {
+xa_type_other,
+xa_type_a,
+xa_type_argb,
+xa_type_abgr,
+xa_type_bgra,
+xa_type_z,
+xa_type_zs,
+xa_type_sz,
+xa_type_yuv_component
+};
+
+/*
+ * Note that these formats should not be assumed to be binary compatible with
+ * pixman formats, but with the below macros and a format type map,
+ * conversion should be simple. Macros for now. We might replace with
+ * inline functions.
+ */
+
+#define xa_format(bpp,type,a,r,g,b)(((bpp)  24) |  \
+((type)  16) | \
+((a)  12) |\
+((r)  8) | \
+((g)  4) | \
+((b)))
+/*
+ *  Non-RGBA one- and two component formats.
+ */
+
+#define xa_format_c(bpp,type,c1,c2) (((bpp)  24) | \
+((type)  16) | \
+((c1)  8) |\
+   

Re: [Mesa-dev] [PATCH 1/2] Revert st/xa: Fix advertized version number and try to avoid future discrepancies

2014-04-07 Thread Thomas Hellstrom
On 04/07/2014 02:44 PM, Emil Velikov wrote:
 Parsing source files through build systems is never a good idea.
 Especially when the issue can be resolved by adding a couple of
 definitions to CPPFLAGS via the build system.

I've nothing against reverting the commit, but the log message is incorrect,
xa_tracker.h is an installed header and thus must include the correct
defines.
(see my commit message).

If we don't parse it using autoconf, we need to use sed or some other
tool to
fix the header.


Otherwise Acked-by: Thomas Hellstrom thellst...@vmware.com

/Thomas



 This reverts commit 61bedc3d6b08943f015f9d590c07a6af36c2a92c.

 Cc: Thomas Hellstrom thellst...@vmware.com
 ---

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev