[Intel-gfx] [PATCH 2/2] drm/i915: Return true by default in mocs settings

Kumar Valsan, Prathap prathap.kumar.valsan at intel.com
Thu Aug 8 14:46:44 UTC 2019


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 <stuart.summers at intel.com>

Reviewed-by:Prathap Kumar Valsan <prathap.kumar.valsan at intel.com>
> ---
>  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
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list