Re: [Mesa-dev] [PATCH] i965: Issue perf_debug messages for unsynchronized maps on !LLC systems.

2015-03-09 Thread Ben Widawsky
On Tue, Feb 24, 2015 at 09:34:30PM -0800, Kenneth Graunke wrote:
 We haven't implemented proper unsynchronized map support on !LLC systems
 (pre-SNB, Atom).  MapBufferRange with GL_MAP_UNSYNCHRONIZE_BIT will
 actually do a synchronized map, probably killing performance.
 
 Also warn on BufferSubData, when we should be doing an unsynchronized
 upload, but instead have to do a synchronous map.
 
 v2: Only complain if the buffer is actually busy - we use unsynchronized
 maps internally for vertex upload and such, but expect those to not
 be busy.
 
 Signed-off-by: Kenneth Graunke kenn...@whitecape.org

Sorry I let this slip. I actually thought it was merged, and screwed up the
patchwork state.

This is both:
Tested-by: Ben Widawsky b...@bwidawsk.net 
Reviewed-by: Ben Widawsky b...@bwidawsk.net

My only nit is that I do already have the fix for this. Not sure if we want to
pursue that instead. I'll defer to you.

-- 
Ben Widawsky, Intel Open Source Technology Center
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] i965: Issue perf_debug messages for unsynchronized maps on !LLC systems.

2015-02-24 Thread Kenneth Graunke
We haven't implemented proper unsynchronized map support on !LLC systems
(pre-SNB, Atom).  MapBufferRange with GL_MAP_UNSYNCHRONIZE_BIT will
actually do a synchronized map, probably killing performance.

Also warn on BufferSubData, when we should be doing an unsynchronized
upload, but instead have to do a synchronous map.

v2: Only complain if the buffer is actually busy - we use unsynchronized
maps internally for vertex upload and such, but expect those to not
be busy.

Signed-off-by: Kenneth Graunke kenn...@whitecape.org
---
 src/mesa/drivers/dri/i965/intel_buffer_objects.c | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_buffer_objects.c 
b/src/mesa/drivers/dri/i965/intel_buffer_objects.c
index f2d2bcb..39a7147 100644
--- a/src/mesa/drivers/dri/i965/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/i965/intel_buffer_objects.c
@@ -254,9 +254,9 @@ brw_buffer_subdata(struct gl_context *ctx,
 * (otherwise, an app that might occasionally stall but mostly not will end
 * up with blitting all the time, at the cost of bandwidth)
 */
-   if (brw-has_llc) {
-  if (offset + size = intel_obj-gpu_active_start ||
-  intel_obj-gpu_active_end = offset) {
+   if (offset + size = intel_obj-gpu_active_start ||
+   intel_obj-gpu_active_end = offset) {
+  if (brw-has_llc) {
  drm_intel_gem_bo_map_unsynchronized(intel_obj-buffer);
  memcpy(intel_obj-buffer-virtual + offset, data, size);
  drm_intel_bo_unmap(intel_obj-buffer);
@@ -264,6 +264,8 @@ brw_buffer_subdata(struct gl_context *ctx,
  if (intel_obj-gpu_active_end  intel_obj-gpu_active_start)
 intel_obj-prefer_stall_to_blit = true;
  return;
+  } else {
+ perf_debug(BufferSubData could be unsynchronized, but !LLC doesn't 
support it yet\n);
   }
}
 
@@ -437,9 +439,13 @@ brw_map_buffer_range(struct gl_context *ctx,
   return obj-Mappings[index].Pointer;
}
 
-   if (access  GL_MAP_UNSYNCHRONIZED_BIT)
+   if (access  GL_MAP_UNSYNCHRONIZED_BIT) {
+  if (!brw-has_llc  brw-perf_debug 
+  drm_intel_bo_busy(intel_obj-buffer)) {
+ perf_debug(MapBufferRange with GL_MAP_UNSYNCHRONIZED_BIT stalling 
(it's actually synchronized on non-LLC platforms)\n);
+  }
   drm_intel_gem_bo_map_unsynchronized(intel_obj-buffer);
-   else if (!brw-has_llc  (!(access  GL_MAP_READ_BIT) ||
+   } else if (!brw-has_llc  (!(access  GL_MAP_READ_BIT) ||
   (access  GL_MAP_PERSISTENT_BIT))) {
   drm_intel_gem_bo_map_gtt(intel_obj-buffer);
   mark_buffer_inactive(intel_obj);
-- 
2.1.2

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