[Intel-gfx] [PATCH v3 6/7] drm/i915/tgl: add gen12 to stolen initialization

Matt Roper matthew.d.roper at intel.com
Tue Sep 3 22:10:34 UTC 2019


On Thu, Aug 29, 2019 at 02:25:53AM -0700, Lucas De Marchi wrote:
> Add case for gen == 12 and add MISSING_CASE() for future gens. We were
> already handling gen12 as the default, so this doesn't change the
> current behavior.
> 
> Cc: CQ Tang <cq.tang at intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>

Another approach would be to just convert the switch to a more
traditional if/else ladder as we use pretty much everywhere else in the
driver (which would also allow us to handle stuff like vlv and chv
without an extra level of nesting).  But this works too, so

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>

> ---
>  drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
> index aa533b4ab5f5..7ce5259d73d6 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
> @@ -425,8 +425,11 @@ int i915_gem_init_stolen(struct drm_i915_private *dev_priv)
>  			bdw_get_stolen_reserved(dev_priv,
>  						&reserved_base, &reserved_size);
>  		break;
> -	case 11:
>  	default:
> +		MISSING_CASE(INTEL_GEN(dev_priv));
> +		/* fall-through */
> +	case 11:
> +	case 12:
>  		icl_get_stolen_reserved(dev_priv, &reserved_base,
>  					&reserved_size);
>  		break;
> -- 
> 2.23.0
> 

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795


More information about the Intel-gfx mailing list