Re: [PATCH 2/4] drm/i915/opregion: Register opreg func only for disp parts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 06 Feb 2022, Anshuman Gupta <anshuman.gupta@xxxxxxxxx> wrote:
> It need to register opregion_func only for graphics sku
> which has display. Use HAS_DISPLAY() to register
> opregion_func.
>
> Cc: Badal Nilawar <badal.nilawar@xxxxxxxxx>
> Cc: Jani Nikula <jani.nikula@xxxxxxxxx>
> Cc: Uma Shankar <uma.shankar@xxxxxxxxx>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/display/intel_opregion.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c
> index 19f0558c0fbf..c1b558cdb99e 100644
> --- a/drivers/gpu/drm/i915/display/intel_opregion.c
> +++ b/drivers/gpu/drm/i915/display/intel_opregion.c
> @@ -860,6 +860,9 @@ static int intel_opregion_setup(struct drm_i915_private *dev_priv)
>  	BUILD_BUG_ON(sizeof(struct opregion_asle) != 0x100);
>  	BUILD_BUG_ON(sizeof(struct opregion_asle_ext) != 0x400);
>  
> +	if (!opregion->opregion_func)
> +		return 0;
> +
>  	INIT_WORK(&opregion->asle_work, asle_work);
>  
>  	base = opregion->opregion_func->alloc_opregion(dev_priv);
> @@ -1296,9 +1299,9 @@ int intel_opregion_init(struct drm_i915_private *i915)
>  {
>  	struct intel_opregion *opregion = &i915->opregion;
>  
> -	if (IS_DGFX(i915))
> +	if (IS_DGFX(i915) && HAS_DISPLAY(i915))
>  		opregion->opregion_func = &dgfx_opregion_func;
> -	else
> +	else if (!IS_DGFX(i915))
>  		opregion->opregion_func = &igfx_opregion_func;

This does not match the commit message. I don't know whether the code or
the commit message is right.

BR,
Jani.

>  
>  	return intel_opregion_setup(i915);

-- 
Jani Nikula, Intel Open Source Graphics Center



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux