drm/i915: Do the DRIVER_ATOMIC feature disable later
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 7 Oct 2022 21:11:07 +0000 (00:11 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 10 Oct 2022 17:24:19 +0000 (20:24 +0300)
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.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221007211108.3883-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_driver.c
drivers/gpu/drm/i915/intel_device_info.c

index f1e06758db19c3cf5f9dfaec2bdf96899b93c4a4..764026d1c5c81aa57c929bca0ee7b18b301349db 100644 (file)
@@ -861,10 +861,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;
index 908ec241fe714562cb9397a8e4e14ee9fdf798ac..b691b7c8c254a649634538d72b95863bee8723c6 100644 (file)
@@ -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,