Re: [Mesa-dev] [PATCH 6/6] gallium, st/mesa: don't use blit-based transfers with software rasterizers

2013-03-15 Thread Brian Paul

On 03/14/2013 04:57 PM, Marek Olšák wrote:

On Thu, Mar 14, 2013 at 8:29 PM, Brian Paulbri...@vmware.com  wrote:

On 03/14/2013 12:45 PM, Marek Olšák wrote:


The blit-based paths for TexImage, GetTexImage, and ReadPixels aren't very
fast with software rasterizer. Now Gallium drivers have the ability to
turn
them off.
---



For the rest of the series:

Reviewed-by: Brian Paulbri...@vmware.com


Can you give me a day or two to test your branch with the VMware driver?


Sure. Please let me know when you're done.


OK, it seems alright with the svga driver.  With a debug build, it's 
just slightly slower than before.  I'll try a release build later.


Tested-by: Brian Paul bri...@vmware.com


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


[Mesa-dev] [PATCH 6/6] gallium, st/mesa: don't use blit-based transfers with software rasterizers

2013-03-14 Thread Marek Olšák
The blit-based paths for TexImage, GetTexImage, and ReadPixels aren't very
fast with software rasterizer. Now Gallium drivers have the ability to turn
them off.
---
 src/gallium/docs/source/screen.rst   |4 
 src/gallium/drivers/llvmpipe/lp_screen.c |2 ++
 src/gallium/drivers/nv30/nv30_screen.c   |1 +
 src/gallium/drivers/nv50/nv50_screen.c   |2 ++
 src/gallium/drivers/nvc0/nvc0_screen.c   |2 ++
 src/gallium/drivers/r300/r300_screen.c   |1 +
 src/gallium/drivers/r600/r600_pipe.c |1 +
 src/gallium/drivers/radeonsi/radeonsi_pipe.c |1 +
 src/gallium/drivers/softpipe/sp_screen.c |2 ++
 src/gallium/drivers/svga/svga_screen.c   |3 +++
 src/gallium/include/pipe/p_defines.h |3 ++-
 src/mesa/state_tracker/st_cb_readpixels.c|4 
 src/mesa/state_tracker/st_cb_texture.c   |8 
 src/mesa/state_tracker/st_context.c  |2 ++
 src/mesa/state_tracker/st_context.h  |1 +
 15 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/src/gallium/docs/source/screen.rst 
b/src/gallium/docs/source/screen.rst
index 68d1a35..6aec4f8 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -137,6 +137,10 @@ The integer capabilities:
 * ``PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT``: Describes the required
   alignment for pipe_sampler_view::u.buf.first_element, in bytes.
   If a driver does not support first/last_element, it should return 0.
+* ``PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER``: Whether it is preferable
+  to use a blit to implement a texture transfer which needs format conversions
+  and swizzling in state trackers. Generally, all hardware drivers with
+  dedicated memory should return 1 and all software rasterizers should return 
0.
 
 
 .. _pipe_capf:
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
b/src/gallium/drivers/llvmpipe/lp_screen.c
index 93e125d..7c33ceb 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -221,6 +221,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
   return 1;
case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
   return 1;
+   case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
+  return 0;
}
/* should only get here on unhandled cases */
debug_printf(Unexpected PIPE_CAP %d query\n, param);
diff --git a/src/gallium/drivers/nv30/nv30_screen.c 
b/src/gallium/drivers/nv30/nv30_screen.c
index 90c3672..94ddb27 100644
--- a/src/gallium/drivers/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nv30/nv30_screen.c
@@ -125,6 +125,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
+   case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
   return 1;
default:
   debug_printf(unknown param %d\n, param);
diff --git a/src/gallium/drivers/nv50/nv50_screen.c 
b/src/gallium/drivers/nv50/nv50_screen.c
index aed1dd5..d2467c5 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -186,6 +186,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
case PIPE_CAP_TEXTURE_MULTISAMPLE:
   return 0;
+   case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
+  return 1;
default:
   NOUVEAU_ERR(unknown PIPE_CAP %d\n, param);
   return 0;
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c 
b/src/gallium/drivers/nvc0/nvc0_screen.c
index 7d03479..5f45e3c 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -178,6 +178,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
   return 0;
case PIPE_CAP_COMPUTE:
   return (class_3d = NVE4_3D_CLASS) ? 1 : 0;
+   case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
+  return 1;
default:
   NOUVEAU_ERR(unknown PIPE_CAP %d\n, param);
   return 0;
diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index 06ed1cb..712a1a1 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -106,6 +106,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum 
pipe_cap param)
 case PIPE_CAP_USER_INDEX_BUFFERS:
 case PIPE_CAP_USER_CONSTANT_BUFFERS:
 case PIPE_CAP_DEPTH_CLIP_DISABLE: /* XXX implemented, but breaks 
Regnum Online */
+case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
 return 1;
 
 case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
diff --git a/src/gallium/drivers/r600/r600_pipe.c 
b/src/gallium/drivers/r600/r600_pipe.c
index 60a0247..de207a0 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ 

Re: [Mesa-dev] [PATCH 6/6] gallium, st/mesa: don't use blit-based transfers with software rasterizers

2013-03-14 Thread Brian Paul

On 03/14/2013 12:45 PM, Marek Olšák wrote:

The blit-based paths for TexImage, GetTexImage, and ReadPixels aren't very
fast with software rasterizer. Now Gallium drivers have the ability to turn
them off.
---


For the rest of the series:

Reviewed-by: Brian Paul bri...@vmware.com


Can you give me a day or two to test your branch with the VMware driver?

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


Re: [Mesa-dev] [PATCH 6/6] gallium, st/mesa: don't use blit-based transfers with software rasterizers

2013-03-14 Thread Marek Olšák
On Thu, Mar 14, 2013 at 8:29 PM, Brian Paul bri...@vmware.com wrote:
 On 03/14/2013 12:45 PM, Marek Olšák wrote:

 The blit-based paths for TexImage, GetTexImage, and ReadPixels aren't very
 fast with software rasterizer. Now Gallium drivers have the ability to
 turn
 them off.
 ---


 For the rest of the series:

 Reviewed-by: Brian Paul bri...@vmware.com


 Can you give me a day or two to test your branch with the VMware driver?

Sure. Please let me know when you're done.

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