intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	intel-gfx@lists.freedesktop.org,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Add relocation exceptions for two other platforms
Date: Mon, 14 Jun 2021 12:28:35 -0400	[thread overview]
Message-ID: <YMeDs+jFXkxFIoRG@intel.com> (raw)
In-Reply-To: <20210614083530.GB3302@zkempczy-mobl2>

On Mon, Jun 14, 2021 at 10:35:30AM +0200, Zbigniew Kempczyński wrote:
> On Fri, Jun 11, 2021 at 04:54:32AM -0400, Rodrigo Vivi wrote:
> > On Fri, Jun 11, 2021 at 08:09:00AM +0200, Zbigniew Kempczyński wrote:
> > > On Thu, Jun 10, 2021 at 10:36:12AM -0400, Rodrigo Vivi wrote:
> > > > On Thu, Jun 10, 2021 at 12:39:55PM +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.
> > > > 
> > > > hmm... to be really honest I'm not so happy that we are introducing
> > > > a new criteria to the force_probe.
> > > > 
> > > > The criteria was to have a functional driver and not to track uapi.
> > > > 
> > > > But on the other hand I do recognize that the current definition
> > > > of the flag allows that, because we have established that with
> > > > this behavior, the "driver for new Intel graphics devices that
> > > > are recognized but not properly supported by this kernel version"
> > > > (as stated in the Kconfig for the DRM_I915_FORCE_PROBE).
> > > > 
> > > > However...
> > > > 
> > > > > 
> > > > > 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)
> > > > 
> > > > This ship has sailed... RKL is not protected by this flag any longer.
> > > > Should this be on the TGL side now?
> > > 
> > > +Lucas
> > > 
> > > I think no, RKL has relocations disabled so we cannot put it to TGL side.
> > > So if RKL is already released then putting it under require_force_probe 
> > > flag is wrong and only I can do is to remove it from that condition. 
> > > There's no option to unblock RKL on IGT CI until we rewrite all the tests.
> > > We have to rely then on ADL* with require_force_probe flag to check how
> > > ADL will work with relocations. 
> > 
> > So... I'm confused now. I'm missing the point of this patch then.
> > I thought the reason was to protect from any user space to attempt to
> > use the relocation, unless using the force_probe temporarily only for
> > these platforms.
> > But if I'm understanding correctly now it is only to silence CI?!
> > Is that the case?
> > Is the CI noise so bad?
> 
> The point of the patch is to verify driver on ADL. IGT still uses 
> relocations (we're rewriting them now but it takes time) so execbuf
> on ADL just exits with failure. We're blind right now about driver
> behavior and we want to address this - temporary enable relocations
> on ADL (under flag) to see if driver works properly on that platform.

Okay, so I believe we need a bigger code refactor here. Whenever
we attempt to use the relocation but we are on ADL we need to have
a big bold message saying this should not be used. That this code
path is deprecated and getting removed...

My fear is that after adding this some UMD, other than IGT,
would start using relocation back again and then the removal
of require_force_probe of ADL would mean regression and we would
need to support that forever again.

Ideally a bold drm_warn, but I understand this might impact CI
so at least a drm_info with capital letters...

> 
> > 
> > > 
> > > > 
> > > > >  || IS_ALDERLAKE_S(eb->i915) ||
> > > > > +	     IS_ALDERLAKE_P(eb->i915)))
> > > > 
> > > > How to ensure that we will easily catch this when removing the
> > > > flag?
> > > > 
> > > > I mean, should we have a GEM_BUG or drm_err message when these
> > > > platforms in this list has not the required_force_probe?
> > > 
> > > I don't think we need GEM_BUG()/drm_err() - when IGT tests will support
> > > both - reloc + no-reloc - then condition will be limited to:
> > > 
> > >         if (GRAPHICS_VER(eb->i915) < 12 || IS_TIGERLAKE(eb->i915))
> > >                 return true;
> > >  
> > >         return false;
> > > 
> > > so require_force_probe condition will be deleted and we won't need it
> > > anymore (IGTs will be ready).
> > 
> > yes...
> > but then, when we remove the flag we will forget to come here and remove
> > this check.
> 
> I think we won't forget - this is cherry on top of rewriting IGT -
> to switch to no-reloc on ADL, so that condition disappear.

believe me, we will forget to remove this function if we don't
start warning that ADL is not protected by the flag anymore...
like we were about to add RKL and live that useless there forever...

> 
> > 
> > Oh, and I just thought that we might need drm_error when the protection
> > doesn't exist for the platform, but also a drm_info to the user to tell
> > this is a temporary accepted behavior, but that will be removed later
> > 
> > The concern is if any other userspace was using the flag and suddently move to a
> > version without the flag, it would be considered a regression...
> 
> That means I don't understand the meaning of that flag. I thought it is
> to enforce probe of driver on platform which behavior is not already 
> well defined and we want to "try" driver on it.

The goal of the flag is to protect end users to get a unstable driver
support. In special, linux installer .iso images where driver cannot be
updated... if user gets a old .iso with driver from the enabling times
and a brand new platform, the installation migh hang or get blank screens.
It was a nightmare in the past.

But the flag was never intended to be used with UAPI decisions, so
this case here is changing this...

> 
> --
> Zbigniew
> 
> > 
> > > 
> > > --
> > > Zbigniew
> > > 
> > > > 
> > > > > +		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
> > > > > 
> > > > > _______________________________________________
> > > > > 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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-06-14 16:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 10:39 [Intel-gfx] [PATCH] drm/i915: Add relocation exceptions for two other platforms Zbigniew Kempczyński
2021-06-10 12:53 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Add relocation exceptions for two other platforms (rev5) Patchwork
2021-06-10 14:36 ` [Intel-gfx] [PATCH] drm/i915: Add relocation exceptions for two other platforms Rodrigo Vivi
2021-06-11  6:09   ` Zbigniew Kempczyński
2021-06-11  8:54     ` Rodrigo Vivi
2021-06-14  8:35       ` Zbigniew Kempczyński
2021-06-14 16:28         ` Rodrigo Vivi [this message]
2021-06-10 15:02 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915: Add relocation exceptions for two other platforms (rev5) Patchwork
2021-06-11  6:46   ` Zbigniew Kempczyński
  -- strict thread matches above, loose matches on Subject: below --
2021-06-17  5:44 [Intel-gfx] [PATCH] drm/i915: Add relocation exceptions for two other platforms Zbigniew Kempczyński
2021-06-17 10:19 ` Rodrigo Vivi
2021-06-16  9:48 Zbigniew Kempczyński
2021-06-16 13:54 ` Rodrigo Vivi
2021-06-11  6:23 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-06-01 12:26 ` Jani Nikula
2021-05-11  8:31 Zbigniew Kempczyński
2021-05-11 17:04 ` Daniel Vetter
2021-05-26  0:35   ` Dave Airlie
2021-05-27 10:04     ` Daniel Vetter
2021-06-01  7:19       ` Dave Airlie
2021-06-01  7:28         ` Daniel Vetter
2021-04-28 17:30 Zbigniew Kempczyński

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YMeDs+jFXkxFIoRG@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=zbigniew.kempczynski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).