dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Add relocation exceptions for two other platforms
@ 2021-06-11  6:23 Zbigniew Kempczyński
  0 siblings, 0 replies; 9+ messages in thread
From: Zbigniew Kempczyński @ 2021-06-11  6:23 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: Daniel Vetter, Lucas De Marchi, Rodrigo Vivi

We have established previously we stop using relocations starting
from gen12 platforms with Tigerlake as an exception. We keep this
statement but we want to enable relocations conditionally for
Alderlake S+P under require_force_probe flag set.

Keeping relocations under require_force_probe flag is interim solution
until IGTs will be rewritten to use softpin.

v2: - remove inline from function definition (Jani)
    - fix indentation

v3: change to GRAPHICS_VER() (Zbigniew)

v4: remove RKL from flag as it is already shipped (Rodrigo)

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Dave Airlie <airlied@redhat.com>
---
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 23 +++++++++++++++----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index a8abc9af5ff4..81064914640f 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -491,16 +491,29 @@ eb_unreserve_vma(struct eb_vma *ev)
 	ev->flags &= ~__EXEC_OBJECT_RESERVED;
 }
 
+static bool platform_has_relocs_enabled(const struct i915_execbuffer *eb)
+{
+	/*
+	 * Relocations are disallowed starting from gen12 with Tigerlake
+	 * as an exception. We allow temporarily use relocations for Alderlake
+	 * when require_force_probe flag is set.
+	 */
+	if (GRAPHICS_VER(eb->i915) < 12 || IS_TIGERLAKE(eb->i915))
+		return true;
+
+	if (INTEL_INFO(eb->i915)->require_force_probe &&
+	    (IS_ALDERLAKE_S(eb->i915) || IS_ALDERLAKE_P(eb->i915)))
+		return true;
+
+	return false;
+}
+
 static int
 eb_validate_vma(struct i915_execbuffer *eb,
 		struct drm_i915_gem_exec_object2 *entry,
 		struct i915_vma *vma)
 {
-	/* Relocations are disallowed for all platforms after TGL-LP.  This
-	 * also covers all platforms with local memory.
-	 */
-	if (entry->relocation_count &&
-	    GRAPHICS_VER(eb->i915) >= 12 && !IS_TIGERLAKE(eb->i915))
+	if (entry->relocation_count && !platform_has_relocs_enabled(eb))
 		return -EINVAL;
 
 	if (unlikely(entry->flags & eb->invalid_flags))
-- 
2.26.0


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

* [PATCH] drm/i915: Add relocation exceptions for two other platforms
@ 2021-06-10 10:39 Zbigniew Kempczyński
  0 siblings, 0 replies; 9+ messages in thread
From: Zbigniew Kempczyński @ 2021-06-10 10:39 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: Daniel Vetter

We have established previously we stop using relocations starting
from gen12 platforms with Tigerlake as an exception. We keep this
statement but we want to enable relocations conditionally for
Rocketlake and Alderlake under require_force_probe flag set.

Keeping relocations under require_force_probe flag is interim solution
until IGTs will be rewritten to use softpin.

v2: - remove inline from function definition (Jani)
    - fix indentation

v3: change to GRAPHICS_VER() (Zbigniew)

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Dave Airlie <airlied@redhat.com>
---
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 24 +++++++++++++++----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index a8abc9af5ff4..30c4f0549ea0 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -491,16 +491,30 @@ eb_unreserve_vma(struct eb_vma *ev)
 	ev->flags &= ~__EXEC_OBJECT_RESERVED;
 }
 
+static bool platform_has_relocs_enabled(const struct i915_execbuffer *eb)
+{
+	/*
+	 * Relocations are disallowed starting from gen12 with Tigerlake
+	 * as an exception. We allow temporarily use relocations for Rocketlake
+	 * and Alderlake when require_force_probe flag is set.
+	 */
+	if (GRAPHICS_VER(eb->i915) < 12 || IS_TIGERLAKE(eb->i915))
+		return true;
+
+	if (INTEL_INFO(eb->i915)->require_force_probe &&
+	    (IS_ROCKETLAKE(eb->i915) || IS_ALDERLAKE_S(eb->i915) ||
+	     IS_ALDERLAKE_P(eb->i915)))
+		return true;
+
+	return false;
+}
+
 static int
 eb_validate_vma(struct i915_execbuffer *eb,
 		struct drm_i915_gem_exec_object2 *entry,
 		struct i915_vma *vma)
 {
-	/* Relocations are disallowed for all platforms after TGL-LP.  This
-	 * also covers all platforms with local memory.
-	 */
-	if (entry->relocation_count &&
-	    GRAPHICS_VER(eb->i915) >= 12 && !IS_TIGERLAKE(eb->i915))
+	if (entry->relocation_count && !platform_has_relocs_enabled(eb))
 		return -EINVAL;
 
 	if (unlikely(entry->flags & eb->invalid_flags))
-- 
2.26.0


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

* Re: [PATCH] drm/i915: Add relocation exceptions for two other platforms
  2021-06-01 14:24 Zbigniew Kempczyński
  2021-06-03 19:45 ` David Airlie
@ 2021-06-09 13:14 ` Daniel Vetter
  1 sibling, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2021-06-09 13:14 UTC (permalink / raw)
  To: Zbigniew Kempczyński
  Cc: Dave Airlie, intel-gfx, Jason Ekstrand, dri-devel, Daniel Vetter

On Tue, Jun 01, 2021 at 04:24:42PM +0200, Zbigniew Kempczyński wrote:
> We have established previously we stop using relocations starting
> from gen12 platforms with Tigerlake as an exception. We keep this
> statement but we want to enable relocations conditionally for
> Rocketlake and Alderlake under require_force_probe flag set.
> 
> Keeping relocations under require_force_probe flag is interim solution
> until IGTs will be rewritten to use softpin.
> 
> v2: - remove inline from function definition (Jani)
>     - fix indentation
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Dave Airlie <airlied@redhat.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jason Ekstrand <jason@jlekstrand.net>

This conflicts with Lucas' switch from INTEL_GEN to GRAPHICS_VER. Can you
pls rebase and resend (with Dave's ack included).
-Daniel

> ---
>  .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 24 +++++++++++++++----
>  1 file changed, 19 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index 297143511f99..78b86a7bc39a 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -491,16 +491,30 @@ eb_unreserve_vma(struct eb_vma *ev)
>  	ev->flags &= ~__EXEC_OBJECT_RESERVED;
>  }
>  
> +static bool platform_has_relocs_enabled(const struct i915_execbuffer *eb)
> +{
> +	/*
> +	 * Relocations are disallowed starting from gen12 with Tigerlake
> +	 * as an exception. We allow temporarily use relocations for Rocketlake
> +	 * and Alderlake when require_force_probe flag is set.
> +	 */
> +	if (INTEL_GEN(eb->i915) < 12 || IS_TIGERLAKE(eb->i915))
> +		return true;
> +
> +	if (INTEL_INFO(eb->i915)->require_force_probe &&
> +	    (IS_ROCKETLAKE(eb->i915) || IS_ALDERLAKE_S(eb->i915) ||
> +	     IS_ALDERLAKE_P(eb->i915)))
> +		return true;
> +
> +	return false;
> +}
> +
>  static int
>  eb_validate_vma(struct i915_execbuffer *eb,
>  		struct drm_i915_gem_exec_object2 *entry,
>  		struct i915_vma *vma)
>  {
> -	/* Relocations are disallowed for all platforms after TGL-LP.  This
> -	 * also covers all platforms with local memory.
> -	 */
> -	if (entry->relocation_count &&
> -	    INTEL_GEN(eb->i915) >= 12 && !IS_TIGERLAKE(eb->i915))
> +	if (entry->relocation_count && !platform_has_relocs_enabled(eb))
>  		return -EINVAL;
>  
>  	if (unlikely(entry->flags & eb->invalid_flags))
> -- 
> 2.26.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH] drm/i915: Add relocation exceptions for two other platforms
  2021-06-01 14:24 Zbigniew Kempczyński
@ 2021-06-03 19:45 ` David Airlie
  2021-06-09 13:14 ` Daniel Vetter
  1 sibling, 0 replies; 9+ messages in thread
From: David Airlie @ 2021-06-03 19:45 UTC (permalink / raw)
  To: Zbigniew Kempczyński
  Cc: Daniel Vetter, Development, Intel, Jason Ekstrand, dri-devel

On Wed, Jun 2, 2021 at 12:25 AM Zbigniew Kempczyński
<zbigniew.kempczynski@intel.com> wrote:
>
> We have established previously we stop using relocations starting
> from gen12 platforms with Tigerlake as an exception. We keep this
> statement but we want to enable relocations conditionally for
> Rocketlake and Alderlake under require_force_probe flag set.
>
> Keeping relocations under require_force_probe flag is interim solution
> until IGTs will be rewritten to use softpin.
>
> v2: - remove inline from function definition (Jani)
>     - fix indentation
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Dave Airlie <airlied@redhat.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jason Ekstrand <jason@jlekstrand.net>

Acked-by: Dave Airlie <airlied@redhat.com>
> ---
>  .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 24 +++++++++++++++----
>  1 file changed, 19 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index 297143511f99..78b86a7bc39a 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -491,16 +491,30 @@ eb_unreserve_vma(struct eb_vma *ev)
>         ev->flags &= ~__EXEC_OBJECT_RESERVED;
>  }
>
> +static bool platform_has_relocs_enabled(const struct i915_execbuffer *eb)
> +{
> +       /*
> +        * Relocations are disallowed starting from gen12 with Tigerlake
> +        * as an exception. We allow temporarily use relocations for Rocketlake
> +        * and Alderlake when require_force_probe flag is set.
> +        */
> +       if (INTEL_GEN(eb->i915) < 12 || IS_TIGERLAKE(eb->i915))
> +               return true;
> +
> +       if (INTEL_INFO(eb->i915)->require_force_probe &&
> +           (IS_ROCKETLAKE(eb->i915) || IS_ALDERLAKE_S(eb->i915) ||
> +            IS_ALDERLAKE_P(eb->i915)))
> +               return true;
> +
> +       return false;
> +}
> +
>  static int
>  eb_validate_vma(struct i915_execbuffer *eb,
>                 struct drm_i915_gem_exec_object2 *entry,
>                 struct i915_vma *vma)
>  {
> -       /* Relocations are disallowed for all platforms after TGL-LP.  This
> -        * also covers all platforms with local memory.
> -        */
> -       if (entry->relocation_count &&
> -           INTEL_GEN(eb->i915) >= 12 && !IS_TIGERLAKE(eb->i915))
> +       if (entry->relocation_count && !platform_has_relocs_enabled(eb))
>                 return -EINVAL;
>
>         if (unlikely(entry->flags & eb->invalid_flags))
> --
> 2.26.0
>


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

* [PATCH] drm/i915: Add relocation exceptions for two other platforms
@ 2021-06-01 14:24 Zbigniew Kempczyński
  2021-06-03 19:45 ` David Airlie
  2021-06-09 13:14 ` Daniel Vetter
  0 siblings, 2 replies; 9+ messages in thread
From: Zbigniew Kempczyński @ 2021-06-01 14:24 UTC (permalink / raw)
  To: intel-gfx, dri-devel
  Cc: Dave Airlie, Zbigniew Kempczyński, Jason Ekstrand, Daniel Vetter

We have established previously we stop using relocations starting
from gen12 platforms with Tigerlake as an exception. We keep this
statement but we want to enable relocations conditionally for
Rocketlake and Alderlake under require_force_probe flag set.

Keeping relocations under require_force_probe flag is interim solution
until IGTs will be rewritten to use softpin.

v2: - remove inline from function definition (Jani)
    - fix indentation

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
---
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 24 +++++++++++++++----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 297143511f99..78b86a7bc39a 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -491,16 +491,30 @@ eb_unreserve_vma(struct eb_vma *ev)
 	ev->flags &= ~__EXEC_OBJECT_RESERVED;
 }
 
+static bool platform_has_relocs_enabled(const struct i915_execbuffer *eb)
+{
+	/*
+	 * Relocations are disallowed starting from gen12 with Tigerlake
+	 * as an exception. We allow temporarily use relocations for Rocketlake
+	 * and Alderlake when require_force_probe flag is set.
+	 */
+	if (INTEL_GEN(eb->i915) < 12 || IS_TIGERLAKE(eb->i915))
+		return true;
+
+	if (INTEL_INFO(eb->i915)->require_force_probe &&
+	    (IS_ROCKETLAKE(eb->i915) || IS_ALDERLAKE_S(eb->i915) ||
+	     IS_ALDERLAKE_P(eb->i915)))
+		return true;
+
+	return false;
+}
+
 static int
 eb_validate_vma(struct i915_execbuffer *eb,
 		struct drm_i915_gem_exec_object2 *entry,
 		struct i915_vma *vma)
 {
-	/* Relocations are disallowed for all platforms after TGL-LP.  This
-	 * also covers all platforms with local memory.
-	 */
-	if (entry->relocation_count &&
-	    INTEL_GEN(eb->i915) >= 12 && !IS_TIGERLAKE(eb->i915))
+	if (entry->relocation_count && !platform_has_relocs_enabled(eb))
 		return -EINVAL;
 
 	if (unlikely(entry->flags & eb->invalid_flags))
-- 
2.26.0


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

* [PATCH] drm/i915: Add relocation exceptions for two other platforms
@ 2021-06-01  8:28 Zbigniew Kempczyński
  0 siblings, 0 replies; 9+ messages in thread
From: Zbigniew Kempczyński @ 2021-06-01  8:28 UTC (permalink / raw)
  To: intel-gfx, dri-devel
  Cc: Dave Airlie, Zbigniew Kempczyński, Jason Ekstrand, Daniel Vetter

We have established previously we stop using relocations starting
from gen12 platforms with Tigerlake as an exception. We keep this
statement but we want to enable relocations conditionally for
Rocketlake and Alderlake under require_force_probe flag set.

Keeping relocations under require_force_probe flag is interim solution
until IGTs will be rewritten to use softpin.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
---
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 26 +++++++++++++++----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 297143511f99..c0562dd14837 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -491,16 +491,32 @@ eb_unreserve_vma(struct eb_vma *ev)
 	ev->flags &= ~__EXEC_OBJECT_RESERVED;
 }
 
+static inline bool
+platform_has_relocs_enabled(const struct i915_execbuffer *eb)
+{
+	/*
+	 * Relocations are disallowed starting from gen12 with Tigerlake
+	 * as an exception. We allow temporarily use relocations for Rocketlake
+	 * and Alderlake when require_force_probe flag is set.
+	 */
+
+	if (INTEL_GEN(eb->i915) < 12 || IS_TIGERLAKE(eb->i915))
+		return true;
+
+	if (INTEL_INFO(eb->i915)->require_force_probe &&
+		 (IS_ROCKETLAKE(eb->i915) || IS_ALDERLAKE_S(eb->i915) ||
+		  IS_ALDERLAKE_P(eb->i915)))
+		return true;
+
+	return false;
+}
+
 static int
 eb_validate_vma(struct i915_execbuffer *eb,
 		struct drm_i915_gem_exec_object2 *entry,
 		struct i915_vma *vma)
 {
-	/* Relocations are disallowed for all platforms after TGL-LP.  This
-	 * also covers all platforms with local memory.
-	 */
-	if (entry->relocation_count &&
-	    INTEL_GEN(eb->i915) >= 12 && !IS_TIGERLAKE(eb->i915))
+	if (entry->relocation_count && !platform_has_relocs_enabled(eb))
 		return -EINVAL;
 
 	if (unlikely(entry->flags & eb->invalid_flags))
-- 
2.26.0


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

* Re: [PATCH] drm/i915: Add relocation exceptions for two other platforms
  2021-05-11  8:31 Zbigniew Kempczyński
@ 2021-05-11 17:04 ` Daniel Vetter
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2021-05-11 17:04 UTC (permalink / raw)
  To: Zbigniew Kempczyński
  Cc: Dave Airlie, intel-gfx, Jason Ekstrand, dri-devel, Daniel Vetter

On Tue, May 11, 2021 at 10:31:39AM +0200, Zbigniew Kempczyński wrote:
> We have established previously we stop using relocations starting
> from gen12 platforms with Tigerlake as an exception. Unfortunately
> we need extend transition period and support relocations for two
> other igfx platforms - Rocketlake and Alderlake.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Dave Airlie <airlied@redhat.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jason Ekstrand <jason@jlekstrand.net>

So the annoying thing here is that now media-driver is fixed:

https://github.com/intel/media-driver/commit/144020c37770083974bedf59902b70b8f444c799

Which means igt is really the only thing left.

Dave, is this still ok for an acked exception, or is this now leaning
towards "just fix igt"?
-Daniel
> ---
>  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index 297143511f99..f80da1d6d9b2 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -496,11 +496,15 @@ eb_validate_vma(struct i915_execbuffer *eb,
>  		struct drm_i915_gem_exec_object2 *entry,
>  		struct i915_vma *vma)
>  {
> -	/* Relocations are disallowed for all platforms after TGL-LP.  This
> -	 * also covers all platforms with local memory.
> +	/*
> +	 * Relocations are disallowed starting from gen12 with some exceptions
> +	 * - TGL/RKL/ADL.
>  	 */
>  	if (entry->relocation_count &&
> -	    INTEL_GEN(eb->i915) >= 12 && !IS_TIGERLAKE(eb->i915))
> +	    INTEL_GEN(eb->i915) >= 12 && !(IS_TIGERLAKE(eb->i915) ||
> +					   IS_ROCKETLAKE(eb->i915) ||
> +					   IS_ALDERLAKE_S(eb->i915) ||
> +					   IS_ALDERLAKE_P(eb->i915)))
>  		return -EINVAL;
>  
>  	if (unlikely(entry->flags & eb->invalid_flags))
> -- 
> 2.26.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* [PATCH] drm/i915: Add relocation exceptions for two other platforms
@ 2021-05-11  8:31 Zbigniew Kempczyński
  2021-05-11 17:04 ` Daniel Vetter
  0 siblings, 1 reply; 9+ messages in thread
From: Zbigniew Kempczyński @ 2021-05-11  8:31 UTC (permalink / raw)
  To: intel-gfx, dri-devel
  Cc: Dave Airlie, Zbigniew Kempczyński, Jason Ekstrand, Daniel Vetter

We have established previously we stop using relocations starting
from gen12 platforms with Tigerlake as an exception. Unfortunately
we need extend transition period and support relocations for two
other igfx platforms - Rocketlake and Alderlake.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 297143511f99..f80da1d6d9b2 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -496,11 +496,15 @@ eb_validate_vma(struct i915_execbuffer *eb,
 		struct drm_i915_gem_exec_object2 *entry,
 		struct i915_vma *vma)
 {
-	/* Relocations are disallowed for all platforms after TGL-LP.  This
-	 * also covers all platforms with local memory.
+	/*
+	 * Relocations are disallowed starting from gen12 with some exceptions
+	 * - TGL/RKL/ADL.
 	 */
 	if (entry->relocation_count &&
-	    INTEL_GEN(eb->i915) >= 12 && !IS_TIGERLAKE(eb->i915))
+	    INTEL_GEN(eb->i915) >= 12 && !(IS_TIGERLAKE(eb->i915) ||
+					   IS_ROCKETLAKE(eb->i915) ||
+					   IS_ALDERLAKE_S(eb->i915) ||
+					   IS_ALDERLAKE_P(eb->i915)))
 		return -EINVAL;
 
 	if (unlikely(entry->flags & eb->invalid_flags))
-- 
2.26.0


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

* [PATCH] drm/i915: Add relocation exceptions for two other platforms
@ 2021-04-28 17:30 Zbigniew Kempczyński
  0 siblings, 0 replies; 9+ messages in thread
From: Zbigniew Kempczyński @ 2021-04-28 17:30 UTC (permalink / raw)
  To: intel-gfx
  Cc: Dave Airlie, Zbigniew Kempczyński, Jason Ekstrand,
	dri-devel, Daniel Vetter

We have established previously we stop using relocations starting
from gen12 platforms with Tigerlake as an exception. Unfortunately
we need extend transition period and support relocations for two
other igfx platforms - Rocketlake and Alderlake.

As Alderlake is coming in two variants - S and P and only S landed
upstream already we will need to extend the relocation enabling
condition one more time for P version in the future.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 297143511f99..6d621898698f 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -496,11 +496,14 @@ eb_validate_vma(struct i915_execbuffer *eb,
 		struct drm_i915_gem_exec_object2 *entry,
 		struct i915_vma *vma)
 {
-	/* Relocations are disallowed for all platforms after TGL-LP.  This
-	 * also covers all platforms with local memory.
+	/*
+	 * Relocations are disallowed starting from gen12 with some exceptions
+	 * - TGL/RKL/ADL.
 	 */
 	if (entry->relocation_count &&
-	    INTEL_GEN(eb->i915) >= 12 && !IS_TIGERLAKE(eb->i915))
+	    INTEL_GEN(eb->i915) >= 12 && !(IS_TIGERLAKE(eb->i915) ||
+					   IS_ROCKETLAKE(eb->i915) ||
+					   IS_ALDERLAKE_S(eb->i915)))
 		return -EINVAL;
 
 	if (unlikely(entry->flags & eb->invalid_flags))
-- 
2.26.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2021-06-11  6:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11  6:23 [PATCH] drm/i915: Add relocation exceptions for two other platforms Zbigniew Kempczyński
  -- strict thread matches above, loose matches on Subject: below --
2021-06-10 10:39 Zbigniew Kempczyński
2021-06-01 14:24 Zbigniew Kempczyński
2021-06-03 19:45 ` David Airlie
2021-06-09 13:14 ` Daniel Vetter
2021-06-01  8:28 Zbigniew Kempczyński
2021-05-11  8:31 Zbigniew Kempczyński
2021-05-11 17:04 ` Daniel Vetter
2021-04-28 17:30 Zbigniew Kempczyński

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).