diff mbox series

[24/27] drm/i915/gt: Set unused mocs entry to follow PTE on tgl as on all others

Message ID 20191112092854.869-24-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [01/27] drm/i915: Flush context free work on cleanup | expand

Commit Message

Chris Wilson Nov. 12, 2019, 9:28 a.m. UTC
Be consistent in our mocs setup on Tigerlake and set the unused control
value to follow the PTE entry as we previously have done. The unused
values are beyond the defines of the ABI, the consistency simplifies our
checking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_mocs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mika Kuoppala Nov. 12, 2019, 2:13 p.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> Be consistent in our mocs setup on Tigerlake and set the unused control
> value to follow the PTE entry as we previously have done. The unused
> values are beyond the defines of the ABI, the consistency simplifies our
> checking.

Simplifies how?

>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/gt/intel_mocs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_mocs.c b/drivers/gpu/drm/i915/gt/intel_mocs.c
> index 6e881c735b20..d2b445d6c258 100644
> --- a/drivers/gpu/drm/i915/gt/intel_mocs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_mocs.c
> @@ -489,7 +489,7 @@ static void intel_mocs_init_global(struct intel_gt *gt)
>  	for (; index < table.n_entries; index++)
>  		intel_uncore_write(uncore,
>  				   GEN12_GLOBAL_MOCS(index),
> -				   table.table[0].control_value);
> +				   table.table[I915_MOCS_PTE].control_value);

This sets it point into reserved, so I am confused.

Also the comment above and the part in generic MOCS tables will
be stale.

-Mika

>  }
>  
>  void intel_mocs_init(struct intel_gt *gt)
> -- 
> 2.24.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chris Wilson Nov. 12, 2019, 2:39 p.m. UTC | #2
Quoting Mika Kuoppala (2019-11-12 14:13:56)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > Be consistent in our mocs setup on Tigerlake and set the unused control
> > value to follow the PTE entry as we previously have done. The unused
> > values are beyond the defines of the ABI, the consistency simplifies our
> > checking.
> 
> Simplifies how?

Because all platforms follow the same pattern, we only need one routine
not multiples.

> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >  drivers/gpu/drm/i915/gt/intel_mocs.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/gt/intel_mocs.c b/drivers/gpu/drm/i915/gt/intel_mocs.c
> > index 6e881c735b20..d2b445d6c258 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_mocs.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_mocs.c
> > @@ -489,7 +489,7 @@ static void intel_mocs_init_global(struct intel_gt *gt)
> >       for (; index < table.n_entries; index++)
> >               intel_uncore_write(uncore,
> >                                  GEN12_GLOBAL_MOCS(index),
> > -                                table.table[0].control_value);
> > +                                table.table[I915_MOCS_PTE].control_value);
> 
> This sets it point into reserved, so I am confused.

Outside of the ABI.

> Also the comment above and the part in generic MOCS tables will
> be stale.

Look at the next pair of patches for removing most of the file, now
possible because the dissimilarity is removed.
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_mocs.c b/drivers/gpu/drm/i915/gt/intel_mocs.c
index 6e881c735b20..d2b445d6c258 100644
--- a/drivers/gpu/drm/i915/gt/intel_mocs.c
+++ b/drivers/gpu/drm/i915/gt/intel_mocs.c
@@ -489,7 +489,7 @@  static void intel_mocs_init_global(struct intel_gt *gt)
 	for (; index < table.n_entries; index++)
 		intel_uncore_write(uncore,
 				   GEN12_GLOBAL_MOCS(index),
-				   table.table[0].control_value);
+				   table.table[I915_MOCS_PTE].control_value);
 }
 
 void intel_mocs_init(struct intel_gt *gt)