All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/selftests: Canonicalise gen8 addresses
@ 2019-03-06 14:09 Chris Wilson
  2019-03-06 14:40 ` Mika Kuoppala
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Chris Wilson @ 2019-03-06 14:09 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala, Matthew Auld

For igt_vm_isolation, we write into the whole 48b address space, and not
just our usual low 4G of global GTT. For these MI operations, play safe
and ensure we use the canonical address form.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c    | 19 -----------------
 drivers/gpu/drm/i915/intel_gpu_commands.h     | 21 +++++++++++++++++++
 .../gpu/drm/i915/selftests/i915_gem_context.c |  2 ++
 3 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 943a221acb21..c335c0a4099a 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -289,25 +289,6 @@ struct i915_execbuffer {
 
 #define exec_entry(EB, VMA) (&(EB)->exec[(VMA)->exec_flags - (EB)->flags])
 
-/*
- * Used to convert any address to canonical form.
- * Starting from gen8, some commands (e.g. STATE_BASE_ADDRESS,
- * MI_LOAD_REGISTER_MEM and others, see Broadwell PRM Vol2a) require the
- * addresses to be in a canonical form:
- * "GraphicsAddress[63:48] are ignored by the HW and assumed to be in correct
- * canonical form [63:48] == [47]."
- */
-#define GEN8_HIGH_ADDRESS_BIT 47
-static inline u64 gen8_canonical_addr(u64 address)
-{
-	return sign_extend64(address, GEN8_HIGH_ADDRESS_BIT);
-}
-
-static inline u64 gen8_noncanonical_addr(u64 address)
-{
-	return address & GENMASK_ULL(GEN8_HIGH_ADDRESS_BIT, 0);
-}
-
 static inline bool eb_use_cmdparser(const struct i915_execbuffer *eb)
 {
 	return intel_engine_needs_cmd_parser(eb->engine) && eb->batch_len;
diff --git a/drivers/gpu/drm/i915/intel_gpu_commands.h b/drivers/gpu/drm/i915/intel_gpu_commands.h
index a34ece53a771..b017bc928d00 100644
--- a/drivers/gpu/drm/i915/intel_gpu_commands.h
+++ b/drivers/gpu/drm/i915/intel_gpu_commands.h
@@ -7,6 +7,8 @@
 #ifndef _INTEL_GPU_COMMANDS_H_
 #define _INTEL_GPU_COMMANDS_H_
 
+#include <linux/bitops.h>
+
 /*
  * Instruction field definitions used by the command parser
  */
@@ -275,4 +277,23 @@
 #define COLOR_BLT     ((0x2<<29)|(0x40<<22))
 #define SRC_COPY_BLT  ((0x2<<29)|(0x43<<22))
 
+/*
+ * Used to convert any address to canonical form.
+ * Starting from gen8, some commands (e.g. STATE_BASE_ADDRESS,
+ * MI_LOAD_REGISTER_MEM and others, see Broadwell PRM Vol2a) require the
+ * addresses to be in a canonical form:
+ * "GraphicsAddress[63:48] are ignored by the HW and assumed to be in correct
+ * canonical form [63:48] == [47]."
+ */
+#define GEN8_HIGH_ADDRESS_BIT 47
+static inline u64 gen8_canonical_addr(u64 address)
+{
+	return sign_extend64(address, GEN8_HIGH_ADDRESS_BIT);
+}
+
+static inline u64 gen8_noncanonical_addr(u64 address)
+{
+	return address & GENMASK_ULL(GEN8_HIGH_ADDRESS_BIT, 0);
+}
+
 #endif /* _INTEL_GPU_COMMANDS_H_ */
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
index 0346ff224d5d..34a8c15273f4 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
@@ -1194,6 +1194,7 @@ static int write_to_scratch(struct i915_gem_context *ctx,
 
 	*cmd++ = MI_STORE_DWORD_IMM_GEN4;
 	if (INTEL_GEN(i915) >= 8) {
+		offset = gen8_canonical_addr(offset);
 		*cmd++ = lower_32_bits(offset);
 		*cmd++ = upper_32_bits(offset);
 	} else {
@@ -1284,6 +1285,7 @@ static int read_from_scratch(struct i915_gem_context *ctx,
 	if (INTEL_GEN(i915) >= 8) {
 		*cmd++ = MI_LOAD_REGISTER_MEM_GEN8;
 		*cmd++ = RCS_GPR0;
+		offset = gen8_canonical_addr(offset);
 		*cmd++ = lower_32_bits(offset);
 		*cmd++ = upper_32_bits(offset);
 		*cmd++ = MI_STORE_REGISTER_MEM_GEN8;
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915/selftests: Canonicalise gen8 addresses
  2019-03-06 14:09 [PATCH] drm/i915/selftests: Canonicalise gen8 addresses Chris Wilson
@ 2019-03-06 14:40 ` Mika Kuoppala
  2019-03-06 15:42 ` ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Mika Kuoppala @ 2019-03-06 14:40 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: Matthew Auld

Chris Wilson <chris@chris-wilson.co.uk> writes:

> For igt_vm_isolation, we write into the whole 48b address space, and not
> just our usual low 4G of global GTT. For these MI operations, play safe
> and ensure we use the canonical address form.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c    | 19 -----------------
>  drivers/gpu/drm/i915/intel_gpu_commands.h     | 21 +++++++++++++++++++
>  .../gpu/drm/i915/selftests/i915_gem_context.c |  2 ++
>  3 files changed, 23 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 943a221acb21..c335c0a4099a 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -289,25 +289,6 @@ struct i915_execbuffer {
>  
>  #define exec_entry(EB, VMA) (&(EB)->exec[(VMA)->exec_flags - (EB)->flags])
>  
> -/*
> - * Used to convert any address to canonical form.
> - * Starting from gen8, some commands (e.g. STATE_BASE_ADDRESS,
> - * MI_LOAD_REGISTER_MEM and others, see Broadwell PRM Vol2a) require the
> - * addresses to be in a canonical form:
> - * "GraphicsAddress[63:48] are ignored by the HW and assumed to be in correct
> - * canonical form [63:48] == [47]."
> - */
> -#define GEN8_HIGH_ADDRESS_BIT 47
> -static inline u64 gen8_canonical_addr(u64 address)
> -{
> -	return sign_extend64(address, GEN8_HIGH_ADDRESS_BIT);
> -}
> -
> -static inline u64 gen8_noncanonical_addr(u64 address)
> -{
> -	return address & GENMASK_ULL(GEN8_HIGH_ADDRESS_BIT, 0);
> -}
> -
>  static inline bool eb_use_cmdparser(const struct i915_execbuffer *eb)
>  {
>  	return intel_engine_needs_cmd_parser(eb->engine) && eb->batch_len;
> diff --git a/drivers/gpu/drm/i915/intel_gpu_commands.h b/drivers/gpu/drm/i915/intel_gpu_commands.h
> index a34ece53a771..b017bc928d00 100644
> --- a/drivers/gpu/drm/i915/intel_gpu_commands.h
> +++ b/drivers/gpu/drm/i915/intel_gpu_commands.h
> @@ -7,6 +7,8 @@
>  #ifndef _INTEL_GPU_COMMANDS_H_
>  #define _INTEL_GPU_COMMANDS_H_
>  
> +#include <linux/bitops.h>
> +
>  /*
>   * Instruction field definitions used by the command parser
>   */
> @@ -275,4 +277,23 @@
>  #define COLOR_BLT     ((0x2<<29)|(0x40<<22))
>  #define SRC_COPY_BLT  ((0x2<<29)|(0x43<<22))
>  
> +/*
> + * Used to convert any address to canonical form.
> + * Starting from gen8, some commands (e.g. STATE_BASE_ADDRESS,
> + * MI_LOAD_REGISTER_MEM and others, see Broadwell PRM Vol2a) require the
> + * addresses to be in a canonical form:
> + * "GraphicsAddress[63:48] are ignored by the HW and assumed to be in correct
> + * canonical form [63:48] == [47]."
> + */
> +#define GEN8_HIGH_ADDRESS_BIT 47
> +static inline u64 gen8_canonical_addr(u64 address)
> +{
> +	return sign_extend64(address, GEN8_HIGH_ADDRESS_BIT);
> +}
> +
> +static inline u64 gen8_noncanonical_addr(u64 address)
> +{
> +	return address & GENMASK_ULL(GEN8_HIGH_ADDRESS_BIT, 0);
> +}
> +
>  #endif /* _INTEL_GPU_COMMANDS_H_ */
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
> index 0346ff224d5d..34a8c15273f4 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
> @@ -1194,6 +1194,7 @@ static int write_to_scratch(struct i915_gem_context *ctx,
>  
>  	*cmd++ = MI_STORE_DWORD_IMM_GEN4;
>  	if (INTEL_GEN(i915) >= 8) {
> +		offset = gen8_canonical_addr(offset);
>  		*cmd++ = lower_32_bits(offset);
>  		*cmd++ = upper_32_bits(offset);
>  	} else {
> @@ -1284,6 +1285,7 @@ static int read_from_scratch(struct i915_gem_context *ctx,
>  	if (INTEL_GEN(i915) >= 8) {
>  		*cmd++ = MI_LOAD_REGISTER_MEM_GEN8;
>  		*cmd++ = RCS_GPR0;
> +		offset = gen8_canonical_addr(offset);

Yes. Now, I need to go and really convince myself that
MI_STORE_DWORD_IMM is not part of this club.

-Mika


>  		*cmd++ = lower_32_bits(offset);
>  		*cmd++ = upper_32_bits(offset);
>  		*cmd++ = MI_STORE_REGISTER_MEM_GEN8;
> -- 
> 2.20.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✗ Fi.CI.BAT: failure for drm/i915/selftests: Canonicalise gen8 addresses
  2019-03-06 14:09 [PATCH] drm/i915/selftests: Canonicalise gen8 addresses Chris Wilson
  2019-03-06 14:40 ` Mika Kuoppala
@ 2019-03-06 15:42 ` Patchwork
  2019-03-06 15:44   ` Chris Wilson
  2019-03-06 15:47 ` [PATCH] " Chris Wilson
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Patchwork @ 2019-03-06 15:42 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Canonicalise gen8 addresses
URL   : https://patchwork.freedesktop.org/series/57645/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5711 -> Patchwork_12393
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_12393 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_12393, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/57645/revisions/1/mbox/

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_12393:

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live_contexts:
    - fi-bdw-5557u:       PASS -> INCOMPLETE
    - fi-kbl-guc:         PASS -> INCOMPLETE
    - fi-kbl-r:           PASS -> INCOMPLETE
    - fi-skl-6260u:       PASS -> INCOMPLETE
    - fi-kbl-8809g:       PASS -> INCOMPLETE
    - fi-skl-6770hq:      PASS -> INCOMPLETE
    - fi-cfl-guc:         PASS -> INCOMPLETE
    - fi-kbl-x1275:       PASS -> INCOMPLETE
    - fi-skl-6700k2:      PASS -> INCOMPLETE
    - fi-cfl-8700k:       PASS -> INCOMPLETE
    - fi-skl-6600u:       PASS -> INCOMPLETE
    - fi-whl-u:           PASS -> INCOMPLETE
    - fi-skl-guc:         PASS -> INCOMPLETE
    - fi-kbl-7567u:       PASS -> INCOMPLETE
    - fi-cfl-8109u:       PASS -> INCOMPLETE

  * igt@runner@aborted:
    - fi-bdw-gvtdvm:      NOTRUN -> FAIL
    - fi-cfl-8109u:       NOTRUN -> FAIL
    - fi-bxt-j4205:       NOTRUN -> FAIL
    - fi-whl-u:           NOTRUN -> FAIL
    - fi-kbl-7560u:       NOTRUN -> FAIL
    - fi-cfl-guc:         NOTRUN -> FAIL
    - fi-kbl-7567u:       NOTRUN -> FAIL
    - fi-kbl-x1275:       NOTRUN -> FAIL
    - fi-cfl-8700k:       NOTRUN -> FAIL
    - fi-kbl-8809g:       NOTRUN -> FAIL
    - fi-apl-guc:         NOTRUN -> FAIL
    - fi-kbl-r:           NOTRUN -> FAIL
    - fi-bdw-5557u:       NOTRUN -> FAIL
    - fi-kbl-guc:         NOTRUN -> FAIL

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@i915_selftest@live_contexts:
    - {fi-skl-lmem}:      NOTRUN -> INCOMPLETE

  
Known issues
------------

  Here are the changes found in Patchwork_12393 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_basic@cs-sdma:
    - fi-kbl-7560u:       NOTRUN -> SKIP [fdo#109271] +17

  * igt@i915_selftest@live_contexts:
    - fi-bxt-j4205:       PASS -> INCOMPLETE [fdo#103927]
    - fi-bdw-gvtdvm:      PASS -> INCOMPLETE [fdo#105600]
    - fi-skl-gvtdvm:      PASS -> INCOMPLETE [fdo#105600]
    - fi-apl-guc:         PASS -> INCOMPLETE [fdo#103927]
    - fi-kbl-7560u:       NOTRUN -> INCOMPLETE [fdo#108767]

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
    - fi-byt-clapper:     PASS -> FAIL [fdo#103191] / [fdo#107362]

  * igt@runner@aborted:
    - fi-skl-guc:         NOTRUN -> FAIL [fdo#104108]
    - fi-skl-6700k2:      NOTRUN -> FAIL [fdo#104108]
    - fi-skl-6600u:       NOTRUN -> FAIL [fdo#104108]
    - fi-skl-6770hq:      NOTRUN -> FAIL [fdo#104108]
    - fi-skl-gvtdvm:      NOTRUN -> FAIL [fdo#104108]
    - fi-skl-6260u:       NOTRUN -> FAIL [fdo#104108]

  
#### Possible fixes ####

  * igt@i915_module_load@reload-with-fault-injection:
    - fi-kbl-7560u:       INCOMPLETE [fdo#109831] -> PASS

  * igt@prime_vgem@basic-fence-flip:
    - fi-gdg-551:         FAIL [fdo#103182] -> PASS

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
  [fdo#105600]: https://bugs.freedesktop.org/show_bug.cgi?id=105600
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#108767]: https://bugs.freedesktop.org/show_bug.cgi?id=108767
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109831]: https://bugs.freedesktop.org/show_bug.cgi?id=109831


Participating hosts (46 -> 40)
------------------------------

  Additional (1): fi-skl-lmem 
  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-icl-u3 fi-ivb-3520m 


Build changes
-------------

    * Linux: CI_DRM_5711 -> Patchwork_12393

  CI_DRM_5711: 221f1aafa4d61ada2b5693b88454d75b825bee0c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4873: f273b14e5e963195d7b2278693c361aec67abeac @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_12393: 2fee997e90e34266ce027ccb13a86db15ae54c84 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

2fee997e90e3 drm/i915/selftests: Canonicalise gen8 addresses

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12393/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ✗ Fi.CI.BAT: failure for drm/i915/selftests: Canonicalise gen8 addresses
  2019-03-06 15:42 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2019-03-06 15:44   ` Chris Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2019-03-06 15:44 UTC (permalink / raw)
  To: Patchwork; +Cc: intel-gfx

Quoting Patchwork (2019-03-06 15:42:32)
> == Series Details ==
> 
> Series: drm/i915/selftests: Canonicalise gen8 addresses
> URL   : https://patchwork.freedesktop.org/series/57645/
> State : failure
> 
> == Summary ==
> 
> CI Bug Log - changes from CI_DRM_5711 -> Patchwork_12393
> ====================================================
> 
> Summary
> -------
> 
>   **FAILURE**
> 
>   Serious unknown changes coming with Patchwork_12393 absolutely need to be
>   verified manually.
>   
>   If you think the reported changes have nothing to do with the changes
>   introduced in Patchwork_12393, please notify your bug team to allow them
>   to document this new failure mode, which will reduce false positives in CI.
> 
>   External URL: https://patchwork.freedesktop.org/api/1.0/series/57645/revisions/1/mbox/
> 
> Possible new issues
> -------------------
> 
>   Here are the unknown changes that may have been introduced in Patchwork_12393:
> 
> ### IGT changes ###
> 
> #### Possible regressions ####
> 
>   * igt@i915_selftest@live_contexts:
>     - fi-bdw-5557u:       PASS -> INCOMPLETE
>     - fi-kbl-guc:         PASS -> INCOMPLETE
>     - fi-kbl-r:           PASS -> INCOMPLETE
>     - fi-skl-6260u:       PASS -> INCOMPLETE
>     - fi-kbl-8809g:       PASS -> INCOMPLETE
>     - fi-skl-6770hq:      PASS -> INCOMPLETE
>     - fi-cfl-guc:         PASS -> INCOMPLETE
>     - fi-kbl-x1275:       PASS -> INCOMPLETE
>     - fi-skl-6700k2:      PASS -> INCOMPLETE
>     - fi-cfl-8700k:       PASS -> INCOMPLETE
>     - fi-skl-6600u:       PASS -> INCOMPLETE
>     - fi-whl-u:           PASS -> INCOMPLETE
>     - fi-skl-guc:         PASS -> INCOMPLETE
>     - fi-kbl-7567u:       PASS -> INCOMPLETE
>     - fi-cfl-8109u:       PASS -> INCOMPLETE

<3> [454.630961] check_scratch:1165 GEM_BUG_ON(offset >= node->start + node->size)

The offset wasn't as local as I thought.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] drm/i915/selftests: Canonicalise gen8 addresses
  2019-03-06 14:09 [PATCH] drm/i915/selftests: Canonicalise gen8 addresses Chris Wilson
  2019-03-06 14:40 ` Mika Kuoppala
  2019-03-06 15:42 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2019-03-06 15:47 ` Chris Wilson
  2019-03-06 17:38 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Canonicalise gen8 addresses (rev2) Patchwork
  2019-03-06 19:41 ` ✓ Fi.CI.IGT: " Patchwork
  4 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2019-03-06 15:47 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala, Matthew Auld

For igt_vm_isolation, we write into the whole 48b address space, and not
just our usual low 4G of global GTT. For these MI operations, play safe
and ensure we use the canonical address form.

v2: Leave original offset unmolested as we use that for our CPU pointer
offset

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c    | 19 -----------------
 drivers/gpu/drm/i915/intel_gpu_commands.h     | 21 +++++++++++++++++++
 .../gpu/drm/i915/selftests/i915_gem_context.c | 12 +++++++----
 3 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 943a221acb21..c335c0a4099a 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -289,25 +289,6 @@ struct i915_execbuffer {
 
 #define exec_entry(EB, VMA) (&(EB)->exec[(VMA)->exec_flags - (EB)->flags])
 
-/*
- * Used to convert any address to canonical form.
- * Starting from gen8, some commands (e.g. STATE_BASE_ADDRESS,
- * MI_LOAD_REGISTER_MEM and others, see Broadwell PRM Vol2a) require the
- * addresses to be in a canonical form:
- * "GraphicsAddress[63:48] are ignored by the HW and assumed to be in correct
- * canonical form [63:48] == [47]."
- */
-#define GEN8_HIGH_ADDRESS_BIT 47
-static inline u64 gen8_canonical_addr(u64 address)
-{
-	return sign_extend64(address, GEN8_HIGH_ADDRESS_BIT);
-}
-
-static inline u64 gen8_noncanonical_addr(u64 address)
-{
-	return address & GENMASK_ULL(GEN8_HIGH_ADDRESS_BIT, 0);
-}
-
 static inline bool eb_use_cmdparser(const struct i915_execbuffer *eb)
 {
 	return intel_engine_needs_cmd_parser(eb->engine) && eb->batch_len;
diff --git a/drivers/gpu/drm/i915/intel_gpu_commands.h b/drivers/gpu/drm/i915/intel_gpu_commands.h
index a34ece53a771..b017bc928d00 100644
--- a/drivers/gpu/drm/i915/intel_gpu_commands.h
+++ b/drivers/gpu/drm/i915/intel_gpu_commands.h
@@ -7,6 +7,8 @@
 #ifndef _INTEL_GPU_COMMANDS_H_
 #define _INTEL_GPU_COMMANDS_H_
 
+#include <linux/bitops.h>
+
 /*
  * Instruction field definitions used by the command parser
  */
@@ -275,4 +277,23 @@
 #define COLOR_BLT     ((0x2<<29)|(0x40<<22))
 #define SRC_COPY_BLT  ((0x2<<29)|(0x43<<22))
 
+/*
+ * Used to convert any address to canonical form.
+ * Starting from gen8, some commands (e.g. STATE_BASE_ADDRESS,
+ * MI_LOAD_REGISTER_MEM and others, see Broadwell PRM Vol2a) require the
+ * addresses to be in a canonical form:
+ * "GraphicsAddress[63:48] are ignored by the HW and assumed to be in correct
+ * canonical form [63:48] == [47]."
+ */
+#define GEN8_HIGH_ADDRESS_BIT 47
+static inline u64 gen8_canonical_addr(u64 address)
+{
+	return sign_extend64(address, GEN8_HIGH_ADDRESS_BIT);
+}
+
+static inline u64 gen8_noncanonical_addr(u64 address)
+{
+	return address & GENMASK_ULL(GEN8_HIGH_ADDRESS_BIT, 0);
+}
+
 #endif /* _INTEL_GPU_COMMANDS_H_ */
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
index 0346ff224d5d..25cb431824da 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
@@ -1194,8 +1194,10 @@ static int write_to_scratch(struct i915_gem_context *ctx,
 
 	*cmd++ = MI_STORE_DWORD_IMM_GEN4;
 	if (INTEL_GEN(i915) >= 8) {
-		*cmd++ = lower_32_bits(offset);
-		*cmd++ = upper_32_bits(offset);
+		u64 addr = gen8_canonical_addr(offset);
+
+		*cmd++ = lower_32_bits(addr);
+		*cmd++ = upper_32_bits(addr);
 	} else {
 		*cmd++ = 0;
 		*cmd++ = offset;
@@ -1282,10 +1284,12 @@ static int read_from_scratch(struct i915_gem_context *ctx,
 
 	memset(cmd, POISON_INUSE, PAGE_SIZE);
 	if (INTEL_GEN(i915) >= 8) {
+		u64 addr = gen8_canonical_addr(offset);
+
 		*cmd++ = MI_LOAD_REGISTER_MEM_GEN8;
 		*cmd++ = RCS_GPR0;
-		*cmd++ = lower_32_bits(offset);
-		*cmd++ = upper_32_bits(offset);
+		*cmd++ = lower_32_bits(addr);
+		*cmd++ = upper_32_bits(addr);
 		*cmd++ = MI_STORE_REGISTER_MEM_GEN8;
 		*cmd++ = RCS_GPR0;
 		*cmd++ = result;
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/selftests: Canonicalise gen8 addresses (rev2)
  2019-03-06 14:09 [PATCH] drm/i915/selftests: Canonicalise gen8 addresses Chris Wilson
                   ` (2 preceding siblings ...)
  2019-03-06 15:47 ` [PATCH] " Chris Wilson
@ 2019-03-06 17:38 ` Patchwork
  2019-03-06 17:53   ` Chris Wilson
  2019-03-06 19:41 ` ✓ Fi.CI.IGT: " Patchwork
  4 siblings, 1 reply; 8+ messages in thread
From: Patchwork @ 2019-03-06 17:38 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Canonicalise gen8 addresses (rev2)
URL   : https://patchwork.freedesktop.org/series/57645/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5712 -> Patchwork_12396
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/57645/revisions/2/mbox/

Known issues
------------

  Here are the changes found in Patchwork_12396 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s4-devices:
    - fi-blb-e6850:       PASS -> INCOMPLETE [fdo#107718]

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-bsw-kefka:       PASS -> SKIP [fdo#109271]

  * igt@i915_pm_rpm@basic-rte:
    - fi-bsw-kefka:       PASS -> FAIL [fdo#108800]

  * igt@kms_busy@basic-flip-b:
    - fi-gdg-551:         PASS -> FAIL [fdo#103182]

  * igt@kms_frontbuffer_tracking@basic:
    - fi-icl-u3:          PASS -> FAIL [fdo#103167]

  * igt@kms_pipe_crc_basic@read-crc-pipe-a:
    - fi-byt-clapper:     PASS -> FAIL [fdo#107362]

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-byt-clapper:     PASS -> FAIL [fdo#103191] / [fdo#107362] +1

  
#### Possible fixes ####

  * igt@i915_pm_rpm@module-reload:
    - fi-kbl-7560u:       CRASH -> PASS

  * igt@i915_selftest@live_hangcheck:
    - fi-kbl-7560u:       INCOMPLETE [fdo#108044] / [fdo#108744] -> PASS

  * igt@kms_busy@basic-flip-a:
    - fi-gdg-551:         FAIL [fdo#103182] -> PASS

  
#### Warnings ####

  * igt@i915_selftest@live_contexts:
    - fi-icl-u3:          DMESG-FAIL [fdo#108569] -> INCOMPLETE [fdo#108569]

  
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#108044]: https://bugs.freedesktop.org/show_bug.cgi?id=108044
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#108744]: https://bugs.freedesktop.org/show_bug.cgi?id=108744
  [fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271


Participating hosts (45 -> 40)
------------------------------

  Missing    (5): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 


Build changes
-------------

    * Linux: CI_DRM_5712 -> Patchwork_12396

  CI_DRM_5712: 5d4de376b9a03c2f74e049ee6a8221df96687ba0 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4875: 91908d36d0d5c90eea86e29736d2748d5ec55335 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_12396: 7d5bc8a26b168a0480ca17ba0c2af3c8f34b99ff @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

7d5bc8a26b16 drm/i915/selftests: Canonicalise gen8 addresses

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12396/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ✓ Fi.CI.BAT: success for drm/i915/selftests: Canonicalise gen8 addresses (rev2)
  2019-03-06 17:38 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Canonicalise gen8 addresses (rev2) Patchwork
@ 2019-03-06 17:53   ` Chris Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2019-03-06 17:53 UTC (permalink / raw)
  To: Patchwork; +Cc: intel-gfx

Quoting Patchwork (2019-03-06 17:38:42)
>   * igt@i915_selftest@live_contexts:
>     - fi-icl-u3:          DMESG-FAIL [fdo#108569] -> INCOMPLETE [fdo#108569]

Still no luck with that fix, then?

It's just the one fix actually.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915/selftests: Canonicalise gen8 addresses (rev2)
  2019-03-06 14:09 [PATCH] drm/i915/selftests: Canonicalise gen8 addresses Chris Wilson
                   ` (3 preceding siblings ...)
  2019-03-06 17:38 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Canonicalise gen8 addresses (rev2) Patchwork
@ 2019-03-06 19:41 ` Patchwork
  4 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2019-03-06 19:41 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Canonicalise gen8 addresses (rev2)
URL   : https://patchwork.freedesktop.org/series/57645/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5712_full -> Patchwork_12396_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Known issues
------------

  Here are the changes found in Patchwork_12396_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_param@invalid-param-get:
    - shard-skl:          NOTRUN -> FAIL [fdo#109559]

  * igt@gem_softpin@noreloc-s3:
    - shard-skl:          NOTRUN -> INCOMPLETE [fdo#104108] / [fdo#107773]

  * igt@kms_busy@extended-pageflip-hang-newfb-render-e:
    - shard-skl:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +5

  * igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-b:
    - shard-skl:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
    - shard-skl:          PASS -> DMESG-WARN [fdo#107956]

  * igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
    - shard-apl:          PASS -> FAIL [fdo#106510] / [fdo#108145]

  * igt@kms_color@pipe-a-degamma:
    - shard-apl:          PASS -> FAIL [fdo#104782] / [fdo#108145]

  * igt@kms_color@pipe-c-legacy-gamma:
    - shard-glk:          PASS -> FAIL [fdo#104782]

  * igt@kms_cursor_crc@cursor-64x21-sliding:
    - shard-apl:          PASS -> FAIL [fdo#103232] +1

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
    - shard-hsw:          PASS -> FAIL [fdo#105767]

  * igt@kms_flip@2x-flip-vs-expired-vblank:
    - shard-glk:          PASS -> FAIL [fdo#105363]

  * igt@kms_flip_tiling@flip-to-yf-tiled:
    - shard-skl:          NOTRUN -> FAIL [fdo#107931]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt:
    - shard-apl:          PASS -> FAIL [fdo#103167]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
    - shard-glk:          PASS -> FAIL [fdo#103167]

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-blt:
    - shard-hsw:          NOTRUN -> SKIP [fdo#109271] +28

  * igt@kms_frontbuffer_tracking@psr-2p-scndscrn-indfb-msflip-blt:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] +77

  * igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-move:
    - shard-skl:          NOTRUN -> SKIP [fdo#109271] +71

  * igt@kms_plane_alpha_blend@pipe-b-alpha-7efc:
    - shard-hsw:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +1

  * igt@kms_plane_alpha_blend@pipe-b-alpha-transparant-fb:
    - shard-skl:          NOTRUN -> FAIL [fdo#108145] +1

  * igt@kms_plane_multiple@atomic-pipe-c-tiling-x:
    - shard-glk:          PASS -> FAIL [fdo#103166] +1

  * igt@kms_plane_scaling@pipe-a-scaler-with-rotation:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +6

  * igt@kms_rotation_crc@multiplane-rotation:
    - shard-kbl:          PASS -> DMESG-FAIL [fdo#105763]

  * igt@kms_rotation_crc@multiplane-rotation-cropping-top:
    - shard-kbl:          PASS -> FAIL [fdo#109016]

  * igt@kms_universal_plane@universal-plane-pipe-b-functional:
    - shard-apl:          PASS -> FAIL [fdo#103166]

  * igt@kms_vblank@pipe-c-ts-continuation-suspend:
    - shard-hsw:          NOTRUN -> FAIL [fdo#104894]

  
#### Possible fixes ####

  * igt@kms_color@pipe-b-legacy-gamma:
    - shard-apl:          FAIL [fdo#104782] -> PASS

  * igt@kms_cursor_crc@cursor-128x128-onscreen:
    - shard-apl:          FAIL [fdo#103232] -> PASS +1

  * igt@kms_cursor_crc@cursor-256x256-suspend:
    - shard-apl:          FAIL [fdo#103191] / [fdo#103232] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
    - shard-apl:          FAIL [fdo#103167] -> PASS +3

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
    - shard-glk:          FAIL [fdo#103167] -> PASS +1

  * igt@kms_plane@plane-position-covered-pipe-c-planes:
    - shard-apl:          FAIL [fdo#103166] -> PASS +4

  * igt@kms_plane_alpha_blend@pipe-b-alpha-opaque-fb:
    - shard-glk:          FAIL [fdo#108145] -> PASS +1

  * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
    - shard-skl:          FAIL [fdo#107815] -> PASS

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
    - shard-glk:          FAIL [fdo#103166] -> PASS +4

  * igt@kms_setmode@basic:
    - shard-kbl:          FAIL [fdo#99912] -> PASS

  * igt@kms_vblank@pipe-b-ts-continuation-modeset-rpm:
    - shard-apl:          FAIL [fdo#104894] -> PASS +1

  
#### Warnings ####

  * igt@i915_pm_rpm@modeset-non-lpsp-stress:
    - shard-skl:          INCOMPLETE [fdo#107807] -> SKIP [fdo#109271]

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
  [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
  [fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
  [fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
  [fdo#106510]: https://bugs.freedesktop.org/show_bug.cgi?id=106510
  [fdo#107773]: https://bugs.freedesktop.org/show_bug.cgi?id=107773
  [fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
  [fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
  [fdo#107931]: https://bugs.freedesktop.org/show_bug.cgi?id=107931
  [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109559]: https://bugs.freedesktop.org/show_bug.cgi?id=109559
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (6 -> 6)
------------------------------

  No changes in participating hosts


Build changes
-------------

    * Linux: CI_DRM_5712 -> Patchwork_12396

  CI_DRM_5712: 5d4de376b9a03c2f74e049ee6a8221df96687ba0 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4875: 91908d36d0d5c90eea86e29736d2748d5ec55335 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_12396: 7d5bc8a26b168a0480ca17ba0c2af3c8f34b99ff @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12396/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-03-06 19:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06 14:09 [PATCH] drm/i915/selftests: Canonicalise gen8 addresses Chris Wilson
2019-03-06 14:40 ` Mika Kuoppala
2019-03-06 15:42 ` ✗ Fi.CI.BAT: failure for " Patchwork
2019-03-06 15:44   ` Chris Wilson
2019-03-06 15:47 ` [PATCH] " Chris Wilson
2019-03-06 17:38 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Canonicalise gen8 addresses (rev2) Patchwork
2019-03-06 17:53   ` Chris Wilson
2019-03-06 19:41 ` ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.