diff mbox series

[v2] drm/i915: use DISPLAY_VER() instead of accessing match_info directly

Message ID 20220628141005.226252-1-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series [v2] drm/i915: use DISPLAY_VER() instead of accessing match_info directly | expand

Commit Message

Jani Nikula June 28, 2022, 2:10 p.m. UTC
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>
---
 drivers/gpu/drm/i915/i915_driver.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jani Nikula June 30, 2022, 12:02 p.m. UTC | #1
On Tue, 28 Jun 2022, Jani Nikula <jani.nikula@intel.com> wrote:
> 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>

Pushed to din, thanks for the review.

BR,
Jani.


> ---
>  drivers/gpu/drm/i915/i915_driver.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index 6e5849c1086f..b2e14cd76d7e 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -847,8 +847,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;
>  
> @@ -857,7 +855,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);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index 6e5849c1086f..b2e14cd76d7e 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -847,8 +847,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;
 
@@ -857,7 +855,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);