diff mbox

drm/i915: Fix module initialisation.

Message ID 55D1B0C6.3030906@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maarten Lankhorst Aug. 17, 2015, 10 a.m. UTC
Set DRIVER_MODESET and DRIVER_ATOMIC by default. The driver is fully atomic.
Remove the legacy suspend/resume, to fix a warning introduced by:

"drm: WARN_ON if a modeset driver uses legacy suspend/resume helpers"

and removing the .get_vblank_timestamp reset to NULL. It's a noop without UMS.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---

Comments

Chris Wilson Aug. 17, 2015, 10:09 a.m. UTC | #1
On Mon, Aug 17, 2015 at 12:00:38PM +0200, Maarten Lankhorst wrote:
> Set DRIVER_MODESET and DRIVER_ATOMIC by default. The driver is fully atomic.
> Remove the legacy suspend/resume, to fix a warning introduced by:
> 
> "drm: WARN_ON if a modeset driver uses legacy suspend/resume helpers"
> 
> and removing the .get_vblank_timestamp reset to NULL. It's a noop without UMS.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Daniel Vetter Aug. 26, 2015, 7:51 a.m. UTC | #2
On Mon, Aug 17, 2015 at 12:00:38PM +0200, Maarten Lankhorst wrote:
> Set DRIVER_MODESET and DRIVER_ATOMIC by default. The driver is fully atomic.
> Remove the legacy suspend/resume, to fix a warning introduced by:
> 
> "drm: WARN_ON if a modeset driver uses legacy suspend/resume helpers"
> 
> and removing the .get_vblank_timestamp reset to NULL. It's a noop without UMS.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 1d887459e37f..411ba8ccecca 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1646,7 +1646,7 @@ static struct drm_driver driver = {
>  	 */
>  	.driver_features =
>  	    DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | DRIVER_PRIME |
> -	    DRIVER_RENDER,
> +	    DRIVER_RENDER | DRIVER_MODESET | DRIVER_ATOMIC,

Nah, DRIVER_ATOMIC isn't quite there yet ...

>  	.load = i915_driver_load,
>  	.unload = i915_driver_unload,
>  	.open = i915_driver_open,
> @@ -1655,10 +1655,6 @@ static struct drm_driver driver = {
>  	.postclose = i915_driver_postclose,
>  	.set_busid = drm_pci_set_busid,
>  
> -	/* Used in place of i915_pm_ops for non-DRIVER_MODESET */
> -	.suspend = i915_suspend_legacy,
> -	.resume = i915_resume_legacy,

Can't we nuke the functions themselves now too?
-Daniel

> -
>  #if defined(CONFIG_DEBUG_FS)
>  	.debugfs_init = i915_debugfs_init,
>  	.debugfs_cleanup = i915_debugfs_cleanup,
> @@ -1701,7 +1697,6 @@ static int __init i915_init(void)
>  	 * either the i915.modeset prarameter or by the
>  	 * vga_text_mode_force boot option.
>  	 */
> -	driver.driver_features |= DRIVER_MODESET;
>  
>  	if (i915.modeset == 0)
>  		driver.driver_features &= ~DRIVER_MODESET;
> @@ -1712,20 +1707,11 @@ static int __init i915_init(void)
>  #endif
>  
>  	if (!(driver.driver_features & DRIVER_MODESET)) {
> -		driver.get_vblank_timestamp = NULL;
>  		/* Silently fail loading to not upset userspace. */
>  		DRM_DEBUG_DRIVER("KMS and UMS disabled.\n");
>  		return 0;
>  	}
>  
> -	/*
> -	 * FIXME: Note that we're lying to the DRM core here so that we can get access
> -	 * to the atomic ioctl and the atomic properties.  Only plane operations on
> -	 * a single CRTC will actually work.
> -	 */
> -	if (driver.driver_features & DRIVER_MODESET)
> -		driver.driver_features |= DRIVER_ATOMIC;
> -
>  	return drm_pci_init(&driver, &i915_pci_driver);
>  }
>  
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst Aug. 26, 2015, 7:57 a.m. UTC | #3
Op 26-08-15 om 09:51 schreef Daniel Vetter:
> On Mon, Aug 17, 2015 at 12:00:38PM +0200, Maarten Lankhorst wrote:
>> Set DRIVER_MODESET and DRIVER_ATOMIC by default. The driver is fully atomic.
>> Remove the legacy suspend/resume, to fix a warning introduced by:
>>
>> "drm: WARN_ON if a modeset driver uses legacy suspend/resume helpers"
>>
>> and removing the .get_vblank_timestamp reset to NULL. It's a noop without UMS.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> ---
>> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
>> index 1d887459e37f..411ba8ccecca 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.c
>> +++ b/drivers/gpu/drm/i915/i915_drv.c
>> @@ -1646,7 +1646,7 @@ static struct drm_driver driver = {
>>  	 */
>>  	.driver_features =
>>  	    DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | DRIVER_PRIME |
>> -	    DRIVER_RENDER,
>> +	    DRIVER_RENDER | DRIVER_MODESET | DRIVER_ATOMIC,
> Nah, DRIVER_ATOMIC isn't quite there yet ...
Indeed..
>>  	.load = i915_driver_load,
>>  	.unload = i915_driver_unload,
>>  	.open = i915_driver_open,
>> @@ -1655,10 +1655,6 @@ static struct drm_driver driver = {
>>  	.postclose = i915_driver_postclose,
>>  	.set_busid = drm_pci_set_busid,
>>  
>> -	/* Used in place of i915_pm_ops for non-DRIVER_MODESET */
>> -	.suspend = i915_suspend_legacy,
>> -	.resume = i915_resume_legacy,
> Can't we nuke the functions themselves now too?
>
vga switcheroo uses them.
Daniel Vetter Aug. 26, 2015, 8:12 a.m. UTC | #4
On Wed, Aug 26, 2015 at 09:57:45AM +0200, Maarten Lankhorst wrote:
> Op 26-08-15 om 09:51 schreef Daniel Vetter:
> > On Mon, Aug 17, 2015 at 12:00:38PM +0200, Maarten Lankhorst wrote:
> >>  	.load = i915_driver_load,
> >>  	.unload = i915_driver_unload,
> >>  	.open = i915_driver_open,
> >> @@ -1655,10 +1655,6 @@ static struct drm_driver driver = {
> >>  	.postclose = i915_driver_postclose,
> >>  	.set_busid = drm_pci_set_busid,
> >>  
> >> -	/* Used in place of i915_pm_ops for non-DRIVER_MODESET */
> >> -	.suspend = i915_suspend_legacy,
> >> -	.resume = i915_resume_legacy,
> > Can't we nuke the functions themselves now too?
> >
> vga switcheroo uses them.

Oh, missed that. In that case maybe rename it to _switcheroo or something?
That should probably have been done in fc49b3da0e1f2, yay for not renaming
functions when they're meaning changes ...
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 1d887459e37f..411ba8ccecca 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1646,7 +1646,7 @@  static struct drm_driver driver = {
 	 */
 	.driver_features =
 	    DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | DRIVER_PRIME |
-	    DRIVER_RENDER,
+	    DRIVER_RENDER | DRIVER_MODESET | DRIVER_ATOMIC,
 	.load = i915_driver_load,
 	.unload = i915_driver_unload,
 	.open = i915_driver_open,
@@ -1655,10 +1655,6 @@  static struct drm_driver driver = {
 	.postclose = i915_driver_postclose,
 	.set_busid = drm_pci_set_busid,
 
-	/* Used in place of i915_pm_ops for non-DRIVER_MODESET */
-	.suspend = i915_suspend_legacy,
-	.resume = i915_resume_legacy,
-
 #if defined(CONFIG_DEBUG_FS)
 	.debugfs_init = i915_debugfs_init,
 	.debugfs_cleanup = i915_debugfs_cleanup,
@@ -1701,7 +1697,6 @@  static int __init i915_init(void)
 	 * either the i915.modeset prarameter or by the
 	 * vga_text_mode_force boot option.
 	 */
-	driver.driver_features |= DRIVER_MODESET;
 
 	if (i915.modeset == 0)
 		driver.driver_features &= ~DRIVER_MODESET;
@@ -1712,20 +1707,11 @@  static int __init i915_init(void)
 #endif
 
 	if (!(driver.driver_features & DRIVER_MODESET)) {
-		driver.get_vblank_timestamp = NULL;
 		/* Silently fail loading to not upset userspace. */
 		DRM_DEBUG_DRIVER("KMS and UMS disabled.\n");
 		return 0;
 	}
 
-	/*
-	 * FIXME: Note that we're lying to the DRM core here so that we can get access
-	 * to the atomic ioctl and the atomic properties.  Only plane operations on
-	 * a single CRTC will actually work.
-	 */
-	if (driver.driver_features & DRIVER_MODESET)
-		driver.driver_features |= DRIVER_ATOMIC;
-
 	return drm_pci_init(&driver, &i915_pci_driver);
 }