drm/i915: use DISPLAY_VER() instead of accessing match_info directly
authorJani Nikula <jani.nikula@intel.com>
Tue, 28 Jun 2022 14:10:05 +0000 (17:10 +0300)
committerJani Nikula <jani.nikula@intel.com>
Thu, 30 Jun 2022 10:09:06 +0000 (13:09 +0300)
We've just set up device info in i915_driver_create() so we can use
DISPLAY_VER() intead of looking at match_info directly.

Semantically we want to check the display version instead of the
graphics version, and for the earlier platforms they are always the
same.

v2: Use DISPLAY_VER() instead of GRAPHICS_VER() (Ville)

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

index 9d0187ee4c7e222be0350ed2363ae764b0c6c0bc..2bd45e51d3b0204f8b3e34f2b9cf7ac5b4f35c02 100644 (file)
@@ -833,8 +833,6 @@ i915_driver_create(struct pci_dev *pdev, const struct pci_device_id *ent)
  */
 int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-       const struct intel_device_info *match_info =
-               (struct intel_device_info *)ent->driver_data;
        struct drm_i915_private *i915;
        int ret;
 
@@ -843,7 +841,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                return PTR_ERR(i915);
 
        /* Disable nuclear pageflip by default on pre-ILK */
-       if (!i915->params.nuclear_pageflip && match_info->graphics.ver < 5)
+       if (!i915->params.nuclear_pageflip && DISPLAY_VER(i915) < 5)
                i915->drm.driver_features &= ~DRIVER_ATOMIC;
 
        ret = pci_enable_device(pdev);