Re: [Mesa-dev] [PATCH] intel: Fix decoding for partial STATE_BASE_ADDRESS updates.

2018-10-22 Thread Kenneth Graunke
On Monday, October 22, 2018 2:57:10 AM PDT Lionel Landwerlin wrote:
> Could you maybe update src/intel/tools/aubinator_viewer_decoder.cpp 
> (function handle_state_base_address) ?
> 
> Either way :
> 
> Reviewed-by: Lionel Landwerlin 

Oops, good call, thanks!

Pushed a v2 that updates both.


signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] intel: Fix decoding for partial STATE_BASE_ADDRESS updates.

2018-10-22 Thread Lionel Landwerlin
Could you maybe update src/intel/tools/aubinator_viewer_decoder.cpp 
(function handle_state_base_address) ?


Either way :

Reviewed-by: Lionel Landwerlin 

On 22/10/2018 06:18, Kenneth Graunke wrote:

STATE_BASE_ADDRESS only modifies various bases if the "modify" bit is
set.  Otherwise, we want to keep the existing base address.

Iris uses this for updating Surface State Base Address while leaving the
others as-is.
---
  src/intel/common/gen_batch_decoder.c | 24 +---
  1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/intel/common/gen_batch_decoder.c 
b/src/intel/common/gen_batch_decoder.c
index 1a5c8c37968..827f3dbdd2f 100644
--- a/src/intel/common/gen_batch_decoder.c
+++ b/src/intel/common/gen_batch_decoder.c
@@ -200,15 +200,33 @@ handle_state_base_address(struct gen_batch_decode_ctx 
*ctx, const uint32_t *p)
 struct gen_field_iterator iter;
 gen_field_iterator_init(, inst, p, 0, false);
  
+   uint64_t surface_base = 0, dynamic_base = 0, instruction_base = 0;

+   bool surface_modify = 0, dynamic_modify = 0, instruction_modify = 0;
+
 while (gen_field_iterator_next()) {
if (strcmp(iter.name, "Surface State Base Address") == 0) {
- ctx->surface_base = iter.raw_value;
+ surface_base = iter.raw_value;
} else if (strcmp(iter.name, "Dynamic State Base Address") == 0) {
- ctx->dynamic_base = iter.raw_value;
+ dynamic_base = iter.raw_value;
} else if (strcmp(iter.name, "Instruction Base Address") == 0) {
- ctx->instruction_base = iter.raw_value;
+ instruction_base = iter.raw_value;
+  } else if (strcmp(iter.name, "Surface State Base Address Modify Enable") 
== 0) {
+ surface_modify = iter.raw_value;
+  } else if (strcmp(iter.name, "Dynamic State Base Address Modify Enable") 
== 0) {
+ dynamic_modify = iter.raw_value;
+  } else if (strcmp(iter.name, "Insntruction Base Address Modify Enable") 
== 0) {
+ instruction_modify = iter.raw_value;
}
 }
+
+   if (dynamic_modify)
+  ctx->dynamic_base = dynamic_base;
+
+   if (surface_modify)
+  ctx->surface_base = surface_base;
+
+   if (instruction_modify)
+  ctx->instruction_base = instruction_base;
  }
  
  static void



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


[Mesa-dev] [PATCH] intel: Fix decoding for partial STATE_BASE_ADDRESS updates.

2018-10-21 Thread Kenneth Graunke
STATE_BASE_ADDRESS only modifies various bases if the "modify" bit is
set.  Otherwise, we want to keep the existing base address.

Iris uses this for updating Surface State Base Address while leaving the
others as-is.
---
 src/intel/common/gen_batch_decoder.c | 24 +---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/intel/common/gen_batch_decoder.c 
b/src/intel/common/gen_batch_decoder.c
index 1a5c8c37968..827f3dbdd2f 100644
--- a/src/intel/common/gen_batch_decoder.c
+++ b/src/intel/common/gen_batch_decoder.c
@@ -200,15 +200,33 @@ handle_state_base_address(struct gen_batch_decode_ctx 
*ctx, const uint32_t *p)
struct gen_field_iterator iter;
gen_field_iterator_init(, inst, p, 0, false);
 
+   uint64_t surface_base = 0, dynamic_base = 0, instruction_base = 0;
+   bool surface_modify = 0, dynamic_modify = 0, instruction_modify = 0;
+
while (gen_field_iterator_next()) {
   if (strcmp(iter.name, "Surface State Base Address") == 0) {
- ctx->surface_base = iter.raw_value;
+ surface_base = iter.raw_value;
   } else if (strcmp(iter.name, "Dynamic State Base Address") == 0) {
- ctx->dynamic_base = iter.raw_value;
+ dynamic_base = iter.raw_value;
   } else if (strcmp(iter.name, "Instruction Base Address") == 0) {
- ctx->instruction_base = iter.raw_value;
+ instruction_base = iter.raw_value;
+  } else if (strcmp(iter.name, "Surface State Base Address Modify Enable") 
== 0) {
+ surface_modify = iter.raw_value;
+  } else if (strcmp(iter.name, "Dynamic State Base Address Modify Enable") 
== 0) {
+ dynamic_modify = iter.raw_value;
+  } else if (strcmp(iter.name, "Insntruction Base Address Modify Enable") 
== 0) {
+ instruction_modify = iter.raw_value;
   }
}
+
+   if (dynamic_modify)
+  ctx->dynamic_base = dynamic_base;
+
+   if (surface_modify)
+  ctx->surface_base = surface_base;
+
+   if (instruction_modify)
+  ctx->instruction_base = instruction_base;
 }
 
 static void
-- 
2.19.0

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