On Wed, Aug 07, 2019 at 01:55:56PM -0700, Stuart Summers wrote:
> Reduce code by defaulting to true in the MOCS settings
> initialization function. Set to false for unexpected
> platforms.
> 
> Signed-off-by: Stuart Summers <[email protected]>

Reviewed-by:Prathap Kumar Valsan <[email protected]>
> ---
>  drivers/gpu/drm/i915/gt/intel_mocs.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_mocs.c 
> b/drivers/gpu/drm/i915/gt/intel_mocs.c
> index fea8ef2fd2aa..ffd105c53ff4 100644
> --- a/drivers/gpu/drm/i915/gt/intel_mocs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_mocs.c
> @@ -291,31 +291,28 @@ static bool get_mocs_settings(struct intel_gt *gt,
>                             struct drm_i915_mocs_table *table)
>  {
>       struct drm_i915_private *i915 = gt->i915;
> -     bool result = false;
> +     bool result = true;
>  
>       if (INTEL_GEN(i915) >= 12) {
>               table->size  = ARRAY_SIZE(tigerlake_mocs_table);
>               table->table = tigerlake_mocs_table;
>               table->n_entries = GEN11_NUM_MOCS_ENTRIES;
> -             result = true;
>       } else if (IS_GEN(i915, 11)) {
>               table->size  = ARRAY_SIZE(icelake_mocs_table);
>               table->table = icelake_mocs_table;
>               table->n_entries = GEN11_NUM_MOCS_ENTRIES;
> -             result = true;
>       } else if (IS_GEN9_BC(i915) || IS_CANNONLAKE(i915)) {
>               table->size  = ARRAY_SIZE(skylake_mocs_table);
>               table->n_entries = GEN9_NUM_MOCS_ENTRIES;
>               table->table = skylake_mocs_table;
> -             result = true;
>       } else if (IS_GEN9_LP(i915)) {
>               table->size  = ARRAY_SIZE(broxton_mocs_table);
>               table->n_entries = GEN9_NUM_MOCS_ENTRIES;
>               table->table = broxton_mocs_table;
> -             result = true;
>       } else {
>               WARN_ONCE(INTEL_GEN(i915) >= 9,
>                         "Platform that should have a MOCS table does not.\n");
> +             result = false;
>       }
>  
>       /* WaDisableSkipCaching:skl,bxt,kbl,glk */
> -- 
> 2.22.0
> 
> _______________________________________________
> Intel-gfx mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to