Mesa (master): mesa: Specify a better GL_MAX_SERVER_WAIT_TIMEOUT limit.

2013-08-23 Thread Kenneth Graunke
Module: Mesa
Branch: master
Commit: a27180d0d8666c75befe5c5b26e6d7122b41588b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a27180d0d8666c75befe5c5b26e6d7122b41588b

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Wed Aug  7 12:56:37 2013 -0700

mesa: Specify a better GL_MAX_SERVER_WAIT_TIMEOUT limit.

The previous value of (GLuint64) ~0 has some problems:

GL_MAX_SERVER_WAIT_TIMEOUT is supposed to be a GLuint64 value, but has
to be queried via GetInteger64v(), which returns a GLint64.  This means
that some applications are likely to treat it as a signed integer, where
~0 means -1.  Negative values are nonsensical and problematic.

When interpreted correctly, ~0 translates to about 0.58 million years,
which seems rather excessive.

This patch changes it to 0x1fff7fff, which is about 1.11 years.
This is still plenty long, and is the same as both an int64 and uint64.
Applications that accidentally store it in a 32-bit int/unsigned also
get a non-negative value, which is again the same as both int and
unsigned.  This value was suggested by Ian Romanick.

v2: Add the ULL prefix on the constant (suggested by Ian).

Fixes Piglit's spec/!OpenGL 3.2/get-integer-64v.

Signed-off-by: Kenneth Graunke kenn...@whitecape.org
Cc: mesa-sta...@lists.freedesktop.org

---

 src/mesa/main/context.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index d687fb7..d726d11 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -622,7 +622,7 @@ _mesa_init_constants(struct gl_context *ctx)
ctx-Const.MaxSamples = 0;
 
/* GL_ARB_sync */
-   ctx-Const.MaxServerWaitTimeout = (GLuint64) ~0;
+   ctx-Const.MaxServerWaitTimeout = 0x1fff7fffULL;
 
/* GL_ATI_envmap_bumpmap */
ctx-Const.SupportedBumpUnits = SUPPORTED_ATI_BUMP_UNITS;

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


Mesa (master): meta: Set correct viewport and projection in decompress_texture_image.

2013-08-23 Thread Kenneth Graunke
Module: Mesa
Branch: master
Commit: 62411681da4d1b7f9417f34dbf92a3e79e24dc09
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=62411681da4d1b7f9417f34dbf92a3e79e24dc09

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Thu Aug 22 01:29:11 2013 -0700

meta: Set correct viewport and projection in decompress_texture_image.

_mesa_meta_begin() sets up an orthographic project and initializes the
viewport based on the current drawbuffer's width and height.  This is
likely the window size, since it occurs before the meta operation binds
any temporary buffers.

decompress_texture_image needs the viewport to be the size of the image
it's trying to draw.  Otherwise, it may only draw part of the image.

v2: Actually set the projection properly too.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68250
Signed-off-by: Kenneth Graunke kenn...@whitecape.org
Cc: Mak Nazecic-Andrlon owlberteinst...@gmail.com

---

 src/mesa/drivers/common/meta.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 1a42b05..798efa6 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -4022,6 +4022,11 @@ decompress_texture_image(struct gl_context *ctx,
verts[3].x = 0.0F;
verts[3].y = height;
 
+   _mesa_MatrixMode(GL_PROJECTION);
+   _mesa_LoadIdentity();
+   _mesa_Ortho(0.0, width, 0.0, height, -1.0, 1.0);
+   _mesa_set_viewport(ctx, 0, 0, width, height);
+
/* upload new vertex data */
_mesa_BufferSubData(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts);
 

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


Mesa (master): mesa: Fix assertion error with glDebugMessageControl

2013-08-23 Thread Brian Paul
Module: Mesa
Branch: master
Commit: f0072e3c6b0bd46d8ebf7ac0a2cf1bf63dc370e8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0072e3c6b0bd46d8ebf7ac0a2cf1bf63dc370e8

Author: Timothy Arceri t_arc...@yahoo.com.au
Date:   Wed Aug 21 00:18:00 2013 -0600

mesa: Fix assertion error with glDebugMessageControl

enums were being converted twice resulting in incorrect values.
The extra conversion has been removed and the redundant assert is
removed also.

Cc: 9.2 mesa-sta...@lists.freedesktop.org

Signed-off-by: Timothy Arceri t_arc...@yahoo.com.au
Reviewed-by: Brian Paul bri...@vmware.com

---

 src/mesa/main/errors.c |   15 ++-
 1 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
index 5a0758d..cc93d3b 100644
--- a/src/mesa/main/errors.c
+++ b/src/mesa/main/errors.c
@@ -609,11 +609,6 @@ control_app_messages(struct gl_context *ctx, GLenum 
esource, GLenum etype,
enum mesa_debug_type type = gl_enum_to_debug_type(etype);
enum mesa_debug_severity severity = gl_enum_to_debug_severity(eseverity);
 
-   if (count)
-  assert(severity == MESA_DEBUG_SEVERITY_COUNT
-  type != MESA_DEBUG_TYPE_COUNT
-  source != MESA_DEBUG_SOURCE_COUNT);
-
for (i = 0; i  count; i++)
   set_message_state(ctx, source, type, ids[i], enabled);
 
@@ -629,9 +624,6 @@ _mesa_DebugMessageControlARB(GLenum gl_source, GLenum 
gl_type,
  GLsizei count, const GLuint *ids,
  GLboolean enabled)
 {
-   enum mesa_debug_source source;
-   enum mesa_debug_type type;
-   enum mesa_debug_severity severity;
GET_CURRENT_CONTEXT(ctx);
 
if (count  0) {
@@ -651,11 +643,8 @@ _mesa_DebugMessageControlARB(GLenum gl_source, GLenum 
gl_type,
   return;
}
 
-   source = gl_enum_to_debug_source(gl_source);
-   type = gl_enum_to_debug_type(gl_type);
-   severity = gl_enum_to_debug_severity(gl_severity);
-
-   control_app_messages(ctx, source, type, severity, count, ids, enabled);
+   control_app_messages(ctx, gl_source, gl_type, gl_severity,
+count, ids, enabled);
 }
 
 void GLAPIENTRY

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


Mesa: tag mesa-9.2-rc2: Mesa 9.2 release candidate 2

2013-08-23 Thread Ian Romanick
Module: Mesa
Branch: refs/tags/mesa-9.2-rc2
Tag:2e09358d4b5a23dfc0c3fb21946a68f68ac60665
URL:
http://cgit.freedesktop.org/mesa/mesa/tag/?id=2e09358d4b5a23dfc0c3fb21946a68f68ac60665

Tagger: Ian Romanick ian.d.roman...@intel.com
Date:   Thu Aug 22 15:22:17 2013 -0700

Mesa 9.2 release candidate 2
___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): 24 new commits

2013-08-23 Thread Paul Berry
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=60ddb96f7e0ea8dfb277cd1f249c7912c07c46b1
Author: Paul Berry stereotype...@gmail.com
Date:   Fri Mar 22 12:34:19 2013 -0700

i965/gs: Add a data structure for tracking VS output VUE map.

Reviewed-by: Ian Romanick ian.d.roman...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org
Reviewed-by: Matt Turner matts...@gmail.com

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=06918f84c2d1092ac327d836ce9f136f41736e6f
Author: Paul Berry stereotype...@gmail.com
Date:   Tue Jun 11 14:23:12 2013 -0700

i965/vec4: Make a function for setting up vec4 program key clip info.

This functionality will need to be reused by geometry shaders.

Reviewed-by: Ian Romanick ian.d.roman...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org
Reviewed-by: Matt Turner matts...@gmail.com

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5b5d10bcd353bf5bef1cd12f3a84625e56af3bb0
Author: Paul Berry stereotype...@gmail.com
Date:   Wed Mar 27 12:39:37 2013 -0700

i965: Make prim_to_hw_prim accessible outside brw_draw.c.

We will need access to this array in order to configure the geometry
shader.

Reviewed-by: Ian Romanick ian.d.roman...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org
Reviewed-by: Matt Turner matts...@gmail.com

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=16512ba70d5a9b4645508030acf1572ee7c660a3
Author: Paul Berry stereotype...@gmail.com
Date:   Tue Feb 19 07:31:16 2013 -0800

i965/gs: add GS visitors.

This patch introduces the vec4_gs_visitor class, which translates
geometry shaders from GLSL IR to back-end opcodes.

This class is derived from vec4_visitor (which is also the base class
for vec4_vs_visitor), so as a result most of the back end code is
shared.  The only parts that differ are:

- Geometry shaders use a different input payload organization, since
  the inputs need to match up with the outputs of the previous
  pipeline stage (vec4_gs_visitor::setup_payload() and
  vec4_gs_visitor::setup_varying_inputs()).

- Geometry shader input array dereferences need a special stride
  computation, since all geometry shader inputs are interleaved into
  one giant array (vec4_gs_visitor::compute_array_stride()).

- There are no geometry shader system values
  (vec4_gs_visitor::make_reg_for_system_value()).

- At the beginning of a geometry shader, extra data in R0 needs to be
  zeroed out, and a vertex counter needs to be initialized
  (vec4_gs_visitor::emit_prolog()).

- When EmitVertex() appears in the shader, the current contents of
  output variables need to be emitted to the URB, and the vertex
  counter needs to be incremented
  (vec4_gs_visitor::visit(ir_emit_vertex *)).

- When generating a URB_WRITE message to output vertex data, the
  current state of the vertex counter needs to be used to store a
  write offset in the message header
  (vec4_gs_visitor::emit_urb_write_header()).

- The URB_WRITE message that outputs vertex data needs to be sent
  using GS_OPCODE_URB_WRITE, since VS_OPCODE_URB_WRITE would overwrite
  the offsets in the message header
  (vec4_gs_visitor::emit_urb_write_opcode()).

- At the end of a geometry shader, the final vertex count needs to be
  delivered using a URB WRITE message
  (vec4_gs_visitor::emit_thread_end()).

- EndPrimitive() functionality is not implemented yet
  (vec4_gs_visitor::visit(ir_end_primitive *)).

- There is no support for assembly shaders
  (vec4_gs_visitor::emit_program_code()).

v2: Make num_input_vertices const.  Refer to registers as rN rather
than gN, for consistency with the PRM.  Fix misspelling.  Improve
comment in the ir_emit_vertex visitor explaining why we emit vertices
inside a conditional.  Enclose the conditional code in the
ir_emit_vertex visitor between curly braces.

Reviewed-by: Ian Romanick ian.d.roman...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org
Reviewed-by: Matt Turner matts...@gmail.com

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=35bdd552d5beb31e9b8319986c8f78d762c1228c
Author: Paul Berry stereotype...@gmail.com
Date:   Tue Feb 19 07:31:16 2013 -0800

i965/gs: Add GS_OPCODE_SET_DWORD_2_IMMED.

Reviewed-by: Ian Romanick ian.d.roman...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org
Reviewed-by: Matt Turner matts...@gmail.com

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7417eddea9969cf09f36b05f218a59b22c076f0c
Author: Paul Berry stereotype...@gmail.com
Date:   Sat Mar 23 08:18:43 2013 -0700

i965/gs: Add GS_OPCODE_SET_VERTEX_COUNT.

Reviewed-by: Ian Romanick ian.d.roman...@intel.com
Reviewed-by: Kenneth Graunke 

Mesa (master): gallium/osmesa: Make and install an osmesa.pc.

2013-08-23 Thread Matt Turner
Module: Mesa
Branch: master
Commit: c8111904304a878a3d5831b453255f04e1ddcf56
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c8111904304a878a3d5831b453255f04e1ddcf56

Author: Jon Severinsson j...@severinsson.net
Date:   Fri Aug 23 11:18:59 2013 +0200

gallium/osmesa: Make and install an osmesa.pc.

As of 2f142d59 build: Add --enable-gallium-osmesa flag. the pkgconfig
file from classic osmesa is no longer installed when building gallium
osmesa, so copy it to gallium osmesa and install the copy instead.

CC: 9.2 mesa-sta...@lists.freedesktop.org
Reviewed-by: Matt Turner matts...@gmail.com

---

 configure.ac|1 +
 src/gallium/targets/osmesa/Makefile.am  |5 ++---
 src/gallium/targets/osmesa/osmesa.pc.in |   12 
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7a89591..40e052c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2066,6 +2066,7 @@ AC_CONFIG_FILES([Makefile
src/gallium/targets/gbm/Makefile
src/gallium/targets/opencl/Makefile
src/gallium/targets/osmesa/Makefile
+   src/gallium/targets/osmesa/osmesa.pc
src/gallium/targets/pipe-loader/Makefile
src/gallium/targets/libgl-xlib/Makefile
src/gallium/targets/vdpau-nouveau/Makefile
diff --git a/src/gallium/targets/osmesa/Makefile.am 
b/src/gallium/targets/osmesa/Makefile.am
index 38dbeb8..de78d8c 100644
--- a/src/gallium/targets/osmesa/Makefile.am
+++ b/src/gallium/targets/osmesa/Makefile.am
@@ -85,6 +85,5 @@ all-local: lib@OSMESA_LIB@.la
cp .libs/lib@OSMESA_LIB@.so.@OSMESA_VERSION@.0.0 
$(top_builddir)/$(LIB_DIR)/gallium/
 endif
 
-# XXX fix-up?
-#pkgconfigdir = $(libdir)/pkgconfig
-#pkgconfig_DATA = osmesa.pc
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = osmesa.pc
diff --git a/src/gallium/targets/osmesa/osmesa.pc.in 
b/src/gallium/targets/osmesa/osmesa.pc.in
new file mode 100644
index 000..cd77fd7
--- /dev/null
+++ b/src/gallium/targets/osmesa/osmesa.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=${prefix}
+libdir=@libdir@
+includedir=@includedir@
+
+Name: osmesa
+Description: Mesa Off-screen Rendering library
+Requires: @OSMESA_PC_REQ@
+Version: @OSMESA_VERSION@
+Libs: -L${libdir} -l@OSMESA_LIB@
+Libs.private: @OSMESA_PC_LIB_PRIV@
+Cflags: -I${includedir}

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


Mesa (master): gallium/osmesa: Link, not copy, the shared library to the LIB_DIR.

2013-08-23 Thread Matt Turner
Module: Mesa
Branch: master
Commit: b47bde00790c4d4cef107c8cd33ed17a08415caf
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b47bde00790c4d4cef107c8cd33ed17a08415caf

Author: Jon Severinsson j...@severinsson.net
Date:   Fri Aug 23 11:19:01 2013 +0200

gallium/osmesa: Link, not copy, the shared library to the LIB_DIR.

Just like all other mesa libraries...

CC: 9.2 mesa-sta...@lists.freedesktop.org
Reviewed-by: Matt Turner matts...@gmail.com

---

 src/gallium/targets/osmesa/Makefile.am |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/targets/osmesa/Makefile.am 
b/src/gallium/targets/osmesa/Makefile.am
index 25fee6f..8e6aff6 100644
--- a/src/gallium/targets/osmesa/Makefile.am
+++ b/src/gallium/targets/osmesa/Makefile.am
@@ -75,7 +75,7 @@ all-local: lib@OSMESA_LIB@.la
$(MKDIR_P) $(top_builddir)/$(LIB_DIR)/gallium;
ln -f .libs/lib@OSMESA_LIB@.so 
$(top_builddir)/$(LIB_DIR)/gallium/lib@OSMESA_LIB@.so;
ln -f .libs/lib@OSMESA_LIB@.so.@OSMESA_VERSION@ 
$(top_builddir)/$(LIB_DIR)/gallium/lib@OSMESA_LIB@.so.@OSMESA_VERSION@;
-   cp .libs/lib@OSMESA_LIB@.so.@OSMESA_VERSION@.0.0 
$(top_builddir)/$(LIB_DIR)/gallium/
+   ln -f .libs/lib@OSMESA_LIB@.so.@OSMESA_VERSION@.0.0 
$(top_builddir)/$(LIB_DIR)/gallium/
 endif
 
 pkgconfigdir = $(libdir)/pkgconfig

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


Mesa (master): gallium/osmesa: Always link with the c++ linker.

2013-08-23 Thread Matt Turner
Module: Mesa
Branch: master
Commit: aeb9c9e4b01af8a70432a961931abde5adf06c42
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aeb9c9e4b01af8a70432a961931abde5adf06c42

Author: Jon Severinsson j...@severinsson.net
Date:   Fri Aug 23 11:19:00 2013 +0200

gallium/osmesa: Always link with the c++ linker.

Just like all other gallium targets...

CC: 9.2 mesa-sta...@lists.freedesktop.org
Reviewed-by: Matt Turner matts...@gmail.com

---

 src/gallium/targets/osmesa/Makefile.am |   11 ++-
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/gallium/targets/osmesa/Makefile.am 
b/src/gallium/targets/osmesa/Makefile.am
index de78d8c..25fee6f 100644
--- a/src/gallium/targets/osmesa/Makefile.am
+++ b/src/gallium/targets/osmesa/Makefile.am
@@ -57,19 +57,12 @@ lib@OSMESA_LIB@_la_LIBADD = \
$(CLOCK_LIB)
 
 
+nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy.cpp
 
 if HAVE_MESA_LLVM
-lib@OSMESA_LIB@_la_LINK = $(CXXLINK) $(lib@OSMESA_LIB@_la_LDFLAGS)
-# Mention a dummy pure C++ file to trigger generation of the $(LINK) variable
-nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy-cpp.cpp
-
-lib@OSMESA_LIB@_la_LIBADD += 
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
 lib@OSMESA_LIB@_la_LDFLAGS += $(LLVM_LDFLAGS)
-else
-lib@OSMESA_LIB@_la_LINK = $(CXXLINK) $(lib@OSMESA_LIB@_la_LDFLAGS)
-# Mention a dummy pure C file to trigger generation of the $(LINK) variable
-nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy-c.c
+lib@OSMESA_LIB@_la_LIBADD += 
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
 endif
 
 

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


Mesa (master): radeonsi: copy r600_get_timestamp

2013-08-23 Thread Tom Stellard
Module: Mesa
Branch: master
Commit: 04349541cd6fd635db786e00568357f0dbfd1aa0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=04349541cd6fd635db786e00568357f0dbfd1aa0

Author: Niels Ole Salscheider niels_...@salscheider-online.de
Date:   Fri Aug  9 11:59:29 2013 +0200

radeonsi: copy r600_get_timestamp

Signed-off-by: Niels Ole Salscheider niels_...@salscheider-online.de
Reviewed-by: Marek Olšák mar...@gmail.com

---

 src/gallium/drivers/radeonsi/radeonsi_pipe.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.c 
b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
index 3351768..2258de9 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_pipe.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
@@ -788,6 +788,14 @@ static int r600_init_tiling(struct r600_screen *rscreen)
return evergreen_interpret_tiling(rscreen, tiling_config);
 }
 
+static uint64_t r600_get_timestamp(struct pipe_screen *screen)
+{
+   struct r600_screen *rscreen = (struct r600_screen*)screen;
+
+   return 100 * rscreen-ws-query_value(rscreen-ws, 
RADEON_TIMESTAMP) /
+   rscreen-info.r600_clock_crystal_freq;
+}
+
 static unsigned radeon_family_from_device(unsigned device)
 {
switch (device) {
@@ -839,6 +847,7 @@ struct pipe_screen *radeonsi_screen_create(struct 
radeon_winsys *ws)
rscreen-screen.get_shader_param = r600_get_shader_param;
rscreen-screen.get_paramf = r600_get_paramf;
rscreen-screen.get_compute_param = r600_get_compute_param;
+   rscreen-screen.get_timestamp = r600_get_timestamp;
rscreen-screen.is_format_supported = si_is_format_supported;
rscreen-screen.context_create = r600_create_context;
rscreen-screen.fence_reference = r600_fence_reference;

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


Mesa (master): radeonsi: Implement PIPE_QUERY_TIMESTAMP

2013-08-23 Thread Tom Stellard
Module: Mesa
Branch: master
Commit: db6f4165f4af89b8a963c5fd5ece4fc9a94c42d0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=db6f4165f4af89b8a963c5fd5ece4fc9a94c42d0

Author: Niels Ole Salscheider niels_...@salscheider-online.de
Date:   Fri Aug  9 11:59:28 2013 +0200

radeonsi: Implement PIPE_QUERY_TIMESTAMP

Signed-off-by: Niels Ole Salscheider niels_...@salscheider-online.de
Reviewed-by: Marek Olšák mar...@gmail.com

---

 src/gallium/drivers/radeonsi/r600.h|1 +
 src/gallium/drivers/radeonsi/r600_hw_context.c |   31 
 src/gallium/drivers/radeonsi/r600_query.c  |   14 ++-
 src/gallium/drivers/radeonsi/radeonsi_pipe.c   |2 +-
 4 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/r600.h 
b/src/gallium/drivers/radeonsi/r600.h
index 8f35cc2..ce0468d 100644
--- a/src/gallium/drivers/radeonsi/r600.h
+++ b/src/gallium/drivers/radeonsi/r600.h
@@ -102,6 +102,7 @@ void si_context_emit_fence(struct r600_context *ctx, struct 
si_resource *fence,
unsigned offset, unsigned value);
 
 void r600_context_draw_opaque_count(struct r600_context *ctx, struct 
r600_so_target *t);
+bool si_query_needs_begin(unsigned type);
 void si_need_cs_space(struct r600_context *ctx, unsigned num_dw, boolean 
count_draw_in);
 
 int si_context_init(struct r600_context *ctx);
diff --git a/src/gallium/drivers/radeonsi/r600_hw_context.c 
b/src/gallium/drivers/radeonsi/r600_hw_context.c
index 55daa82..59b2d70 100644
--- a/src/gallium/drivers/radeonsi/r600_hw_context.c
+++ b/src/gallium/drivers/radeonsi/r600_hw_context.c
@@ -110,6 +110,11 @@ err:
return;
 }
 
+bool si_query_needs_begin(unsigned type)
+{
+   return type != PIPE_QUERY_TIMESTAMP;
+}
+
 /* initialize */
 void si_need_cs_space(struct r600_context *ctx, unsigned num_dw,
boolean count_draw_in)
@@ -357,6 +362,12 @@ static boolean r600_query_result(struct r600_context *ctx, 
struct r600_query *qu
results_base = (results_base + 16) % 
query-buffer-b.b.width0;
}
break;
+   case PIPE_QUERY_TIMESTAMP:
+   {
+   uint32_t *current_result = (uint32_t*)map;
+   query-result.u64 = (uint64_t)current_result[0] | 
(uint64_t)current_result[1]  32;
+   break;
+   }
case PIPE_QUERY_TIME_ELAPSED:
while (results_base != query-results_end) {
query-result.u64 +=
@@ -502,6 +513,19 @@ void r600_query_end(struct r600_context *ctx, struct 
r600_query *query)
 {
struct radeon_winsys_cs *cs = ctx-cs;
uint64_t va;
+   unsigned new_results_end;
+
+   /* The queries which need begin already called this in begin_query. */
+   if (!si_query_needs_begin(query-type)) {
+   si_need_cs_space(ctx, query-num_cs_dw, TRUE);
+
+   new_results_end = (query-results_end + query-result_size) % 
query-buffer-b.b.width0;
+
+   /* collect current results if query buffer is full */
+   if (new_results_end == query-results_start) {
+   r600_query_result(ctx, query, TRUE);
+   }
+   }
 
va = r600_resource_va(ctx-screen-screen, (void*)query-buffer);
/* emit end query */
@@ -525,6 +549,8 @@ void r600_query_end(struct r600_context *ctx, struct 
r600_query *query)
break;
case PIPE_QUERY_TIME_ELAPSED:
va += query-results_end + query-result_size/2;
+   /* fall through */
+   case PIPE_QUERY_TIMESTAMP:
cs-buf[cs-cdw++] = PKT3(PKT3_EVENT_WRITE_EOP, 4, 0);
cs-buf[cs-cdw++] = 
EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH_AND_INV_TS_EVENT) | EVENT_INDEX(5);
cs-buf[cs-cdw++] = va;
@@ -602,6 +628,10 @@ struct r600_query *r600_context_query_create(struct 
r600_context *ctx, unsigned
query-result_size = 16 * ctx-max_db;
query-num_cs_dw = 6;
break;
+   case PIPE_QUERY_TIMESTAMP:
+   query-result_size = 8;
+   query-num_cs_dw = 8;
+   break;
case PIPE_QUERY_TIME_ELAPSED:
query-result_size = 16;
query-num_cs_dw = 8;
@@ -665,6 +695,7 @@ boolean r600_context_query_result(struct r600_context *ctx,
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
*result_b = query-result.b;
break;
+   case PIPE_QUERY_TIMESTAMP:
case PIPE_QUERY_TIME_ELAPSED:
*result_u64 = (100 * query-result.u64) / 
ctx-screen-info.r600_clock_crystal_freq;
break;
diff --git a/src/gallium/drivers/radeonsi/r600_query.c 
b/src/gallium/drivers/radeonsi/r600_query.c
index 0162cce..927577c 100644
--- a/src/gallium/drivers/radeonsi/r600_query.c
+++ b/src/gallium/drivers/radeonsi/r600_query.c
@@ -42,6 +42,11 @@ static void r600_begin_query(struct pipe_context *ctx, 
struct 

Mesa (master): radeonsi: Handle additional PIPE_COMPUTE_CAP_*

2013-08-23 Thread Tom Stellard
Module: Mesa
Branch: master
Commit: 288a25252386d2cc372a5938fd4ff05879efd3ca
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=288a25252386d2cc372a5938fd4ff05879efd3ca

Author: Niels Ole Salscheider niels_...@salscheider-online.de
Date:   Fri Aug  9 11:59:30 2013 +0200

radeonsi: Handle additional PIPE_COMPUTE_CAP_*

This patch adds support for:
PIPE_COMPUTE_CAP_MAX_INPUT_SIZE
PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE

Return the values reported by the closed source driver for now.

Signed-off-by: Niels Ole Salscheider niels_...@salscheider-online.de
Reviewed-by: Tom Stellard thomas.stell...@amd.com

---

 src/gallium/drivers/radeonsi/radeonsi_pipe.c |   15 ++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.c 
b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
index 2258de9..91c41e7 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_pipe.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
@@ -611,7 +611,20 @@ static int r600_get_compute_param(struct pipe_screen 
*screen,
*max_global_size = 20;
}
return sizeof(uint64_t);
-
+   case PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE:
+   if (ret) {
+   uint64_t *max_local_size = ret;
+   /* Value reported by the closed source driver. */
+   *max_local_size = 32768;
+   }
+   return sizeof(uint64_t);
+   case PIPE_COMPUTE_CAP_MAX_INPUT_SIZE:
+   if (ret) {
+   uint64_t *max_input_size = ret;
+   /* Value reported by the closed source driver. */
+   *max_input_size = 1024;
+   }
+   return sizeof(uint64_t);
case PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE:
if (ret) {
uint64_t max_global_size;

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