diff mbox series

[2/2] drm/i915: Clear DRIVER_ATOMIC on a per-device basis

Message ID 20180913131622.17690-2-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm: Introduce per-device driver_features | expand

Commit Message

Ville Syrjälä Sept. 13, 2018, 1:16 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Currently we're clearing DRIVER_ATOMIC in driver.driver_features
for older platforms. This will not work correctly should we ever
have a system with and old and new GPU in it. While that is not
possible currently let's make the code more correct and use
the per-device driver_features instead.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Chris Wilson Sept. 13, 2018, 1:28 p.m. UTC | #1
Quoting Ville Syrjala (2018-09-13 14:16:22)
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Currently we're clearing DRIVER_ATOMIC in driver.driver_features
> for older platforms. This will not work correctly should we ever
> have a system with and old and new GPU in it. While that is not
> possible currently let's make the code more correct and use
> the per-device driver_features instead.
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

One day we will be able to have driver const again,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 5dd7fc582e6f..2ddf8538cb47 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1384,14 +1384,14 @@  int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct drm_i915_private *dev_priv;
 	int ret;
 
-	/* Enable nuclear pageflip on ILK+ */
-	if (!i915_modparams.nuclear_pageflip && match_info->gen < 5)
-		driver.driver_features &= ~DRIVER_ATOMIC;
-
 	dev_priv = i915_driver_create(pdev, ent);
 	if (!dev_priv)
 		return -ENOMEM;
 
+	/* Disable nuclear pageflip by default on pre-ILK */
+	if (!i915_modparams.nuclear_pageflip && match_info->gen < 5)
+		dev_priv->drm.driver_features &= ~DRIVER_ATOMIC;
+
 	ret = pci_enable_device(pdev);
 	if (ret)
 		goto out_fini;