Re: [Intel-gfx] [PATCH] drm/i915/tgl: WaDisableGPGPUMidThreadPreemption

2020-03-10 Thread Mrozek, Michal
>>With "disable it completely" you mean disable preemption completely - go 
>>lower than thread-group in granularity?

Yes, disable it completely.

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


Re: [Intel-gfx] [PATCH] drm/i915/tgl: WaDisableGPGPUMidThreadPreemption

2020-03-10 Thread Tvrtko Ursulin



On 09/03/2020 17:02, Mrozek, Michal wrote:

But he asked whether it's possible for Media and OpenCL drivers to also disable 
mid-thread preemption through the INTERFACE_DESCRIPTOR_DATA, instead of from the 
>>kernel side, so we could try to experiment with it in the future.


Interface Descriptor setting only switches the preemption from mid thread to 
thread group.
It doesn't allow to disable it completely and there are cases where this is 
required  (i.e. VME).
For that we need mmio whitelist.


With "disable it completely" you mean disable preemption completely - go 
lower than thread-group in granularity?


Regards,

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


Re: [Intel-gfx] [PATCH] drm/i915/tgl: WaDisableGPGPUMidThreadPreemption

2020-03-09 Thread Mrozek, Michal
>>But he asked whether it's possible for Media and OpenCL drivers to also 
>>disable mid-thread preemption through the INTERFACE_DESCRIPTOR_DATA, instead 
>>of from the >>kernel side, so we could try to experiment with it in the 
>>future.

Interface Descriptor setting only switches the preemption from mid thread to 
thread group.
It doesn't allow to disable it completely and there are cases where this is 
required  (i.e. VME).
For that we need mmio whitelist.

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


Re: [Intel-gfx] [PATCH] drm/i915/tgl: WaDisableGPGPUMidThreadPreemption

2020-03-05 Thread Ye, Tony



On 3/5/2020 1:01 AM, Rafael Antognolli wrote:

On Wed, Mar 04, 2020 at 04:24:13PM +, Tvrtko Ursulin wrote:


On 04/03/2020 16:02, Rafael Antognolli wrote:

On Wed, Mar 04, 2020 at 03:31:44PM +, Tvrtko Ursulin wrote:

From: Tvrtko Ursulin 

Enable FtrPerCtxtPreemptionGranularityControl bit and select thread-
group as the default preemption level.

v2:
   * Remove register whitelisting (Rafael, Tony).

Signed-off-by: Tvrtko Ursulin 
Cc: Michał Winiarski 
Cc: Joonas Lahtinen 
Cc: piotr.zdunow...@intel.com
Cc: michal.mro...@intel.com
Cc: Tony Ye 
Cc: Rafael Antognolli 


Thanks for CC'ing me. I also saw a reply from Jason yesterday, but I
don't see it in the list now (though my mail client a mess lately).


I saw nothing from Jason, but there was an email from you asking about
interface descriptors and whitelisting which is why I copied you.


But he asked whether it's possible for Media and OpenCL drivers to
also disable mid-thread preemption through the
INTERFACE_DESCRIPTOR_DATA, instead of from the kernel side, so we could
try to experiment with it in the future.

Also, do you have an idea of how broken it is? Or is it just not tested
because no driver is currently implementing it? And do you know if the
windows 3D drivers implement it at all? I see code in the driver that
seems to me that it's only disabled in certain cases...

To summarize, I think we should either:
 1) Disable mid-thread preemption from the kernel and not whitelist
 the register (just like you do in this patch); or
 2) Not do anything at all from the kernel, and let userspace disable
 it if needed.

I think 2) is better, if it's not an issue to the other userspace
drivers (OpenCL and Media).


I know it is somewhat broken like in
https://gitlab.freedesktop.org/drm/intel/issues/1293.

And I know OpenCL and Media would prefer i915 to handle it, but that's
always the case. :) OpenCL and Media folks are on the thread so can comment
if they are okay with handling this themselves.

Indeed a blanket ban in i915 means no one can try it out later without
further kernel changes.


Well, based on your comment from the previous patch:

"General thinking is, since MTP is considered not validated / broken /
dangerous, i915 should default it off. But yes, whitelisting or not on
top is open."

Maybe we should simply ban it and be done. So this patch is:

Acked-by: Rafael Antognolli 


Acked-by: Tony Ye 




Regards,

Tvrtko

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


Re: [Intel-gfx] [PATCH] drm/i915/tgl: WaDisableGPGPUMidThreadPreemption

2020-03-05 Thread Chris Wilson
Quoting Tvrtko Ursulin (2020-03-04 15:31:44)
> From: Tvrtko Ursulin 
> 
> Enable FtrPerCtxtPreemptionGranularityControl bit and select thread-
> group as the default preemption level.
> 
> v2:
>  * Remove register whitelisting (Rafael, Tony).
> 
> Signed-off-by: Tvrtko Ursulin 
> Cc: Michał Winiarski 
> Cc: Joonas Lahtinen 
> Cc: piotr.zdunow...@intel.com
> Cc: michal.mro...@intel.com
> Cc: Tony Ye 
> Cc: Rafael Antognolli 

/me mutters

So do we need to disable force-preemption on rcs if we can't do
fine-grained preemption?

Acked-by: Chris Wilson 
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915/tgl: WaDisableGPGPUMidThreadPreemption

2020-03-04 Thread Jason Ekstrand
On Wed, Mar 4, 2020 at 11:01 AM Rafael Antognolli
 wrote:
>
> On Wed, Mar 04, 2020 at 04:24:13PM +, Tvrtko Ursulin wrote:
> >
> > On 04/03/2020 16:02, Rafael Antognolli wrote:
> > > On Wed, Mar 04, 2020 at 03:31:44PM +, Tvrtko Ursulin wrote:
> > > > From: Tvrtko Ursulin 
> > > >
> > > > Enable FtrPerCtxtPreemptionGranularityControl bit and select thread-
> > > > group as the default preemption level.
> > > >
> > > > v2:
> > > >   * Remove register whitelisting (Rafael, Tony).
> > > >
> > > > Signed-off-by: Tvrtko Ursulin 
> > > > Cc: Michał Winiarski 
> > > > Cc: Joonas Lahtinen 
> > > > Cc: piotr.zdunow...@intel.com
> > > > Cc: michal.mro...@intel.com
> > > > Cc: Tony Ye 
> > > > Cc: Rafael Antognolli 
> > >
> > > Thanks for CC'ing me. I also saw a reply from Jason yesterday, but I
> > > don't see it in the list now (though my mail client a mess lately).
> >
> > I saw nothing from Jason, but there was an email from you asking about
> > interface descriptors and whitelisting which is why I copied you.
> >
> > > But he asked whether it's possible for Media and OpenCL drivers to
> > > also disable mid-thread preemption through the
> > > INTERFACE_DESCRIPTOR_DATA, instead of from the kernel side, so we could
> > > try to experiment with it in the future.
> > >
> > > Also, do you have an idea of how broken it is? Or is it just not tested
> > > because no driver is currently implementing it? And do you know if the
> > > windows 3D drivers implement it at all? I see code in the driver that
> > > seems to me that it's only disabled in certain cases...
> > >
> > > To summarize, I think we should either:
> > > 1) Disable mid-thread preemption from the kernel and not whitelist
> > > the register (just like you do in this patch); or
> > > 2) Not do anything at all from the kernel, and let userspace disable
> > > it if needed.
> > >
> > > I think 2) is better, if it's not an issue to the other userspace
> > > drivers (OpenCL and Media).
> >
> > I know it is somewhat broken like in
> > https://gitlab.freedesktop.org/drm/intel/issues/1293.
> >
> > And I know OpenCL and Media would prefer i915 to handle it, but that's
> > always the case. :) OpenCL and Media folks are on the thread so can comment
> > if they are okay with handling this themselves.
> >
> > Indeed a blanket ban in i915 means no one can try it out later without
> > further kernel changes.
>
> Well, based on your comment from the previous patch:
>
> "General thinking is, since MTP is considered not validated / broken /
> dangerous, i915 should default it off. But yes, whitelisting or not on
> top is open."
>
> Maybe we should simply ban it and be done. So this patch is:
>
> Acked-by: Rafael Antognolli 

Agreed.  If we think that it's broken or is likely to take additional
kernel work to enable it properly, we shouldn't allow userspace to
turn it on until we know the kernel is in good shape.  Just ban it
outright and we can figure out white-listing later if and when we get
it properly working.

Acked-by: Jason Ekstrand 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915/tgl: WaDisableGPGPUMidThreadPreemption

2020-03-04 Thread Rafael Antognolli
On Wed, Mar 04, 2020 at 04:24:13PM +, Tvrtko Ursulin wrote:
> 
> On 04/03/2020 16:02, Rafael Antognolli wrote:
> > On Wed, Mar 04, 2020 at 03:31:44PM +, Tvrtko Ursulin wrote:
> > > From: Tvrtko Ursulin 
> > > 
> > > Enable FtrPerCtxtPreemptionGranularityControl bit and select thread-
> > > group as the default preemption level.
> > > 
> > > v2:
> > >   * Remove register whitelisting (Rafael, Tony).
> > > 
> > > Signed-off-by: Tvrtko Ursulin 
> > > Cc: Michał Winiarski 
> > > Cc: Joonas Lahtinen 
> > > Cc: piotr.zdunow...@intel.com
> > > Cc: michal.mro...@intel.com
> > > Cc: Tony Ye 
> > > Cc: Rafael Antognolli 
> > 
> > Thanks for CC'ing me. I also saw a reply from Jason yesterday, but I
> > don't see it in the list now (though my mail client a mess lately).
> 
> I saw nothing from Jason, but there was an email from you asking about
> interface descriptors and whitelisting which is why I copied you.
> 
> > But he asked whether it's possible for Media and OpenCL drivers to
> > also disable mid-thread preemption through the
> > INTERFACE_DESCRIPTOR_DATA, instead of from the kernel side, so we could
> > try to experiment with it in the future.
> > 
> > Also, do you have an idea of how broken it is? Or is it just not tested
> > because no driver is currently implementing it? And do you know if the
> > windows 3D drivers implement it at all? I see code in the driver that
> > seems to me that it's only disabled in certain cases...
> > 
> > To summarize, I think we should either:
> > 1) Disable mid-thread preemption from the kernel and not whitelist
> > the register (just like you do in this patch); or
> > 2) Not do anything at all from the kernel, and let userspace disable
> > it if needed.
> > 
> > I think 2) is better, if it's not an issue to the other userspace
> > drivers (OpenCL and Media).
> 
> I know it is somewhat broken like in
> https://gitlab.freedesktop.org/drm/intel/issues/1293.
> 
> And I know OpenCL and Media would prefer i915 to handle it, but that's
> always the case. :) OpenCL and Media folks are on the thread so can comment
> if they are okay with handling this themselves.
> 
> Indeed a blanket ban in i915 means no one can try it out later without
> further kernel changes.

Well, based on your comment from the previous patch:

"General thinking is, since MTP is considered not validated / broken /
dangerous, i915 should default it off. But yes, whitelisting or not on
top is open."

Maybe we should simply ban it and be done. So this patch is:

Acked-by: Rafael Antognolli 

> Regards,
> 
> Tvrtko
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915/tgl: WaDisableGPGPUMidThreadPreemption

2020-03-04 Thread Tvrtko Ursulin


On 04/03/2020 16:02, Rafael Antognolli wrote:

On Wed, Mar 04, 2020 at 03:31:44PM +, Tvrtko Ursulin wrote:

From: Tvrtko Ursulin 

Enable FtrPerCtxtPreemptionGranularityControl bit and select thread-
group as the default preemption level.

v2:
  * Remove register whitelisting (Rafael, Tony).

Signed-off-by: Tvrtko Ursulin 
Cc: Michał Winiarski 
Cc: Joonas Lahtinen 
Cc: piotr.zdunow...@intel.com
Cc: michal.mro...@intel.com
Cc: Tony Ye 
Cc: Rafael Antognolli 


Thanks for CC'ing me. I also saw a reply from Jason yesterday, but I
don't see it in the list now (though my mail client a mess lately).


I saw nothing from Jason, but there was an email from you asking about 
interface descriptors and whitelisting which is why I copied you.



But he asked whether it's possible for Media and OpenCL drivers to
also disable mid-thread preemption through the
INTERFACE_DESCRIPTOR_DATA, instead of from the kernel side, so we could
try to experiment with it in the future.

Also, do you have an idea of how broken it is? Or is it just not tested
because no driver is currently implementing it? And do you know if the
windows 3D drivers implement it at all? I see code in the driver that
seems to me that it's only disabled in certain cases...

To summarize, I think we should either:
1) Disable mid-thread preemption from the kernel and not whitelist
the register (just like you do in this patch); or
2) Not do anything at all from the kernel, and let userspace disable
it if needed.

I think 2) is better, if it's not an issue to the other userspace
drivers (OpenCL and Media).


I know it is somewhat broken like in 
https://gitlab.freedesktop.org/drm/intel/issues/1293.


And I know OpenCL and Media would prefer i915 to handle it, but that's 
always the case. :) OpenCL and Media folks are on the thread so can 
comment if they are okay with handling this themselves.


Indeed a blanket ban in i915 means no one can try it out later without 
further kernel changes.


Regards,

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


Re: [Intel-gfx] [PATCH] drm/i915/tgl: WaDisableGPGPUMidThreadPreemption

2020-03-04 Thread Rafael Antognolli
On Wed, Mar 04, 2020 at 03:31:44PM +, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin 
> 
> Enable FtrPerCtxtPreemptionGranularityControl bit and select thread-
> group as the default preemption level.
> 
> v2:
>  * Remove register whitelisting (Rafael, Tony).
> 
> Signed-off-by: Tvrtko Ursulin 
> Cc: Michał Winiarski 
> Cc: Joonas Lahtinen 
> Cc: piotr.zdunow...@intel.com
> Cc: michal.mro...@intel.com
> Cc: Tony Ye 
> Cc: Rafael Antognolli 

Thanks for CC'ing me. I also saw a reply from Jason yesterday, but I
don't see it in the list now (though my mail client a mess lately).

But he asked whether it's possible for Media and OpenCL drivers to
also disable mid-thread preemption through the
INTERFACE_DESCRIPTOR_DATA, instead of from the kernel side, so we could
try to experiment with it in the future.

Also, do you have an idea of how broken it is? Or is it just not tested
because no driver is currently implementing it? And do you know if the
windows 3D drivers implement it at all? I see code in the driver that
seems to me that it's only disabled in certain cases...

To summarize, I think we should either:
   1) Disable mid-thread preemption from the kernel and not whitelist
   the register (just like you do in this patch); or
   2) Not do anything at all from the kernel, and let userspace disable
   it if needed.

I think 2) is better, if it's not an issue to the other userspace
drivers (OpenCL and Media).

--
Rafael

> ---
>  drivers/gpu/drm/i915/gt/intel_workarounds.c | 9 +++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c 
> b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> index cb7d85c42f13..7be71a1a5719 100644
> --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> @@ -601,6 +601,11 @@ static void tgl_ctx_workarounds_init(struct 
> intel_engine_cs *engine,
>*/
>   wa_add(wal, FF_MODE2, FF_MODE2_TDS_TIMER_MASK,
>  FF_MODE2_TDS_TIMER_128, 0);
> +
> + /* WaDisableGPGPUMidThreadPreemption:tgl */
> + WA_SET_FIELD_MASKED(GEN8_CS_CHICKEN1,
> + GEN9_PREEMPT_GPGPU_LEVEL_MASK,
> + GEN9_PREEMPT_GPGPU_THREAD_GROUP_LEVEL);
>  }
>  
>  static void
> @@ -1475,8 +1480,8 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, 
> struct i915_wa_list *wal)
>PSDUNIT_CLKGATE_DIS);
>   }
>  
> - if (IS_GEN_RANGE(i915, 9, 11)) {
> - /* 
> FtrPerCtxtPreemptionGranularityControl:skl,bxt,kbl,cfl,cnl,icl */
> + if (IS_GEN_RANGE(i915, 9, 12)) {
> + /* 
> FtrPerCtxtPreemptionGranularityControl:skl,bxt,kbl,cfl,cnl,icl,tgl */
>   wa_masked_en(wal,
>GEN7_FF_SLICE_CS_CHICKEN1,
>GEN9_FFSC_PERCTX_PREEMPT_CTRL);
> -- 
> 2.20.1
> 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx