Re: [Mesa-dev] [PATCH] r600g: Replace needless flush in texture upload.

2011-10-29 Thread Mathias Fröhlich

Hi,

On Thursday, October 27, 2011 18:17:41 Marek Olšák wrote:
 Looks good to me. Ideally even texture_barrier should not be needed.
 set_framebuffer_state() and flush() should flush caches automatically.
 If they don't, there is a bug.

I have pushed this now as an improovement above the former code.
Due to lack of time I did not look into improoving this further ...
As you all mentioned, most of the buffer overlap flush logic must be already 
there.  At the time I queued that up in my tree piglit passed even when the 
flush is just omitted without any replacement. I am just not sure if it's 
guaranteed in any case that this is sufficient.

Thanks

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


Re: [Mesa-dev] [PATCH] r600g: Replace needless flush in texture upload.

2011-10-27 Thread Marek Olšák
Looks good to me. Ideally even texture_barrier should not be needed.
set_framebuffer_state() and flush() should flush caches automatically.
If they don't, there is a bug.

Marek

2011/10/27 Mathias Fröhlich mathias.froehl...@gmx.net:

 Hi,

 On Saturday, October 22, 2011 13:36:37 Mathias Fröhlich wrote:
 The attached patch reduces the amount of pipe flushes for r600g.
 I am not exactly sure if we could skip this flush entirely because of the
 internal r600g winsys flush logic.
 But what we can do is the attached patch:

 Replace pipe-flush() with pipe-texture_barrier() in
 the texture upload path for the staging texture.
 This should be enough to get data out of the gpu
 caches ready to be read for texture fetch.

 Please review.
 Any comment on that?

 May be I need to mention that it passed r600g piglit tests on an rv770 and
 rv635.
 Additionally I am running that on my installed systems since july.

 Thanks

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

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


Re: [Mesa-dev] [PATCH] r600g: Replace needless flush in texture upload.

2011-10-27 Thread Fredrik Höglund
On Thursday 27 October 2011, Mathias Fröhlich wrote:
 
 Hi,
 
 On Saturday, October 22, 2011 13:36:37 Mathias Fröhlich wrote:
  The attached patch reduces the amount of pipe flushes for r600g.
  I am not exactly sure if we could skip this flush entirely because of the
  internal r600g winsys flush logic.
  But what we can do is the attached patch:
  
  Replace pipe-flush() with pipe-texture_barrier() in
  the texture upload path for the staging texture.
  This should be enough to get data out of the gpu
  caches ready to be read for texture fetch.
  
  Please review.
 Any comment on that?
 
 May be I need to mention that it passed r600g piglit tests on an rv770 and 
 rv635.
 Additionally I am running that on my installed systems since july.

A problem with texture_barrier() is that it flushes and invalidates
all the texture and cb caches. It may be an improvement over
pipe-flush(), but if we know which texture(s) are involved, I think
we should be able to do better.

Other than that I don't see a problem with it, assuming that
flushing the caches is the only reason for calling pipe-flush()
here.

Regards,
Fredrik

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


[Mesa-dev] [PATCH] r600g: Replace needless flush in texture upload.

2011-10-22 Thread Mathias Fröhlich

Hi,

The attached patch reduces the amount of pipe flushes for r600g.
I am not exactly sure if we could skip this flush entirely because of the 
internal r600g winsys flush logic.
But what we can do is the attached patch:

Replace pipe-flush() with pipe-texture_barrier() in
the texture upload path for the staging texture.
This should be enough to get data out of the gpu
caches ready to be read for texture fetch.

Please review.

Thanks

Mathias
From d301b1fa47aa80b94cce2a5d29c404654b025fc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mathias=20Fr=C3=B6hlich?= mathias.froehl...@gmx.net
Date: Tue, 26 Jul 2011 07:05:10 +0200
Subject: [PATCH] r600g: Replace needless flush in texture upload.

Replace pipe-flush() with pipe-texture_barrier() in
the texture upload path for the staging texture.
This should be enough to get data out of the gpu
caches ready to be read for texture fetch.
---
 src/gallium/drivers/r600/r600_texture.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 1682cc8..b914ff3 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -66,7 +66,7 @@ static void r600_copy_from_staging_texture(struct pipe_context *ctx, struct r600
   rtransfer-staging_texture,
   0, sbox);
 
-	r600_flush(ctx, NULL, RADEON_FLUSH_ASYNC);
+	ctx-texture_barrier(ctx);
 }
 
 unsigned r600_texture_get_offset(struct r600_resource_texture *rtex,
-- 
1.7.4.4

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