On Tue, Mar 07, 2023 at 04:51:11PM -0300, Gustavo Sousa wrote:
> From: Madhumitha Tolakanahalli Pradeep 
> <madhumitha.tolakanahalli.prad...@intel.com>
> 
> Add support to load DMC on MTL.
> 
> According to the spec and based on tests done on real hardware, 0x7000
> is a reasonable size limit that covers each possible payload.
> 
> v2:
>   - Tighten payload size limit. (Matt, Rodrigo)
>   - Use a better name for the defined payload limit. (Rodrigo)
> 
> Signed-off-by: Madhumitha Tolakanahalli Pradeep 
> <madhumitha.tolakanahalli.prad...@intel.com>
> Signed-off-by: Gustavo Sousa <gustavo.so...@intel.com>
> Cc: Rodrigo Vivi <rodrigo.v...@intel.com>
> Cc: Matt Roper <matthew.d.ro...@intel.com>
> Cc: Anusha Srivatsa <anusha.sriva...@intel.com>

Reviewed-by: Matt Roper <matthew.d.ro...@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_dmc.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c 
> b/drivers/gpu/drm/i915/display/intel_dmc.c
> index 6b162f77340e..d84cf9237b9c 100644
> --- a/drivers/gpu/drm/i915/display/intel_dmc.c
> +++ b/drivers/gpu/drm/i915/display/intel_dmc.c
> @@ -89,10 +89,13 @@ static struct intel_dmc *i915_to_dmc(struct 
> drm_i915_private *i915)
>       __stringify(major) "_"                  \
>       __stringify(minor) ".bin"
>  
> +#define XELPDP_DMC_MAX_FW_SIZE               0x7000
>  #define DISPLAY_VER13_DMC_MAX_FW_SIZE        0x20000
> -
>  #define DISPLAY_VER12_DMC_MAX_FW_SIZE        ICL_DMC_MAX_FW_SIZE
>  
> +#define MTL_DMC_PATH                 DMC_PATH(mtl)
> +MODULE_FIRMWARE(MTL_DMC_PATH);
> +
>  #define DG2_DMC_PATH                 DMC_LEGACY_PATH(dg2, 2, 08)
>  MODULE_FIRMWARE(DG2_DMC_PATH);
>  
> @@ -979,7 +982,10 @@ void intel_dmc_init(struct drm_i915_private *i915)
>  
>       INIT_WORK(&dmc->work, dmc_load_work_fn);
>  
> -     if (IS_DG2(i915)) {
> +     if (IS_METEORLAKE(i915)) {
> +             dmc->fw_path = MTL_DMC_PATH;
> +             dmc->max_fw_size = XELPDP_DMC_MAX_FW_SIZE;
> +     } else if (IS_DG2(i915)) {
>               dmc->fw_path = DG2_DMC_PATH;
>               dmc->max_fw_size = DISPLAY_VER13_DMC_MAX_FW_SIZE;
>       } else if (IS_ALDERLAKE_P(i915)) {
> -- 
> 2.39.2
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation

Reply via email to