[PATCH v2 1/5] drm/i915/display: Make intel_dp_aux_fw_sync_len available for PSR code

Jani Nikula jani.nikula at linux.intel.com
Mon Feb 26 17:51:43 UTC 2024


On Thu, 22 Feb 2024, Jouni Högander <jouni.hogander at intel.com> wrote:
> ALPM AUX-Wake fast wake sync pulse count is needed by PSR to calculate IO
> wake and fast wake lines. Convert intel_dp_aux_fw_sync_len as non-static
> to make it available for PSR code. u8 is enough for fw sync pulse length.

"u8 is enough" is not a good enough reason to use u8. Or any unsigned
type.

Please use int unless you have a reason not to.

BR,
Jani.

>
> Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp_aux.c | 6 +++---
>  drivers/gpu/drm/i915/display/intel_dp_aux.h | 1 +
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> index 4f4a0e3b3114..7a5cfd77d43b 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_aux.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> @@ -143,10 +143,10 @@ static int intel_dp_aux_sync_len(void)
>  	return precharge + preamble;
>  }
>  
> -static int intel_dp_aux_fw_sync_len(void)
> +u8 intel_dp_aux_fw_sync_len(void)
>  {
> -	int precharge = 10; /* 10-16 */
> -	int preamble = 8;
> +	u8 precharge = 10; /* 10-16 */
> +	u8 preamble = 8;
>  
>  	return precharge + preamble;
>  }
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.h b/drivers/gpu/drm/i915/display/intel_dp_aux.h
> index 8447f3e601fe..8e6a62abf01a 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_aux.h
> +++ b/drivers/gpu/drm/i915/display/intel_dp_aux.h
> @@ -20,5 +20,6 @@ enum aux_ch intel_dp_aux_ch(struct intel_encoder *encoder);
>  
>  void intel_dp_aux_irq_handler(struct drm_i915_private *i915);
>  u32 intel_dp_aux_pack(const u8 *src, int src_bytes);
> +u8 intel_dp_aux_fw_sync_len(void);
>  
>  #endif /* __INTEL_DP_AUX_H__ */

-- 
Jani Nikula, Intel


More information about the Intel-gfx mailing list