[Intel-gfx] [PATCH 1/2] drm/i915: Do the DRIVER_ATOMIC feature disable later

Murthy, Arun R arun.r.murthy at intel.com
Tue Oct 11 06:58:25 UTC 2022


> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces at lists.freedesktop.org> On Behalf Of Ville
> Syrjala
> Sent: Saturday, October 8, 2022 2:41 AM
> To: intel-gfx at lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH 1/2] drm/i915: Do the DRIVER_ATOMIC feature
> disable later
> 
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Currently we do the DRIVER_ATOMIC disable as almost the first thing during
> pci probe. That involves the use of
> DISPLAY_VER() which is perhaps a bit sketchy now that we may need to read
> that out from the hardware itself.
> Looks like we do populate a default value for it anyway so the current does at
> least still work.
> 
> But let's make this safer anyway and move the code into
> intel_device_info_runtime_init() where we also handle the same thing for
> the !HAS_DISPLAY case.
This may be a safer place!
Looking at the function intel_device_info_runtime_init() where only hardware capabilities are handled and this alone is a drm feature DRM_ATOMIC that will be placed like a odd man.
Probably once we have the code to get the DISPLAY_VER from the hardware in place, having this at the same place might look cleaner.
Maybe driver_early_probe() where the reading of DISPLAY_VER code might come in future might look somewhat cleaner.

Thanks and Regards,
Arun R Murthy
--------------------
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_driver.c       | 4 ----
>  drivers/gpu/drm/i915/intel_device_info.c | 4 ++++
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_driver.c
> b/drivers/gpu/drm/i915/i915_driver.c
> index fb3826dabe8b..cebe347f424c 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -894,10 +894,6 @@ int i915_driver_probe(struct pci_dev *pdev, const
> struct pci_device_id *ent)
>  	if (IS_ERR(i915))
>  		return PTR_ERR(i915);
> 
> -	/* Disable nuclear pageflip by default on pre-ILK */
> -	if (!i915->params.nuclear_pageflip && DISPLAY_VER(i915) < 5)
> -		i915->drm.driver_features &= ~DRIVER_ATOMIC;
> -
>  	ret = pci_enable_device(pdev);
>  	if (ret)
>  		goto out_fini;
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c
> b/drivers/gpu/drm/i915/intel_device_info.c
> index 908ec241fe71..b691b7c8c254 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -507,6 +507,10 @@ void intel_device_info_runtime_init(struct
> drm_i915_private *dev_priv)
>  		runtime->has_dmc = false;
>  		runtime->has_dsc = false;
>  	}
> +
> +	/* Disable nuclear pageflip by default on pre-ILK */
> +	if (!dev_priv->params.nuclear_pageflip && DISPLAY_VER(dev_priv) <
> 5)
> +		dev_priv->drm.driver_features &= ~DRIVER_ATOMIC;
>  }
> 
>  void intel_driver_caps_print(const struct intel_driver_caps *caps,
> --
> 2.35.1



More information about the Intel-gfx mailing list