diff mbox

drm/i915: Unhook legacy suspend/resume when KMS is enabled

Message ID 1440492670-2635-1-git-send-email-patrik.jakobsson@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Patrik Jakobsson Aug. 25, 2015, 8:51 a.m. UTC
It's not allowed to have legacy suspend/resume hooked up when
DRIVER_MODESET is set. Doing so results in a warning introduced by the
commit below.

commit e8b4855b5dd3e285d0ec18ed15468025abc1be9a
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date:   Thu Aug 13 17:06:39 2015 -0300

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

    Legacy s/r hooks are only used for shadow-attaching drivers, warn
    when a KMS driver tries to use them.

    Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Signed-off-by: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Daniel Vetter Aug. 25, 2015, 2:33 p.m. UTC | #1
On Tue, Aug 25, 2015 at 10:51:10AM +0200, Patrik Jakobsson wrote:
> It's not allowed to have legacy suspend/resume hooked up when
> DRIVER_MODESET is set. Doing so results in a warning introduced by the
> commit below.
> 
> commit e8b4855b5dd3e285d0ec18ed15468025abc1be9a
> Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> Date:   Thu Aug 13 17:06:39 2015 -0300
> 
>     drm: WARN_ON if a modeset driver uses legacy suspend/resume helpers
> 
>     Legacy s/r hooks are only used for shadow-attaching drivers, warn
>     when a KMS driver tries to use them.
> 
>     Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>     Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Signed-off-by: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>

There is no legacy KMS any more, please just kill the hooks entirely.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 1d88745..6e3391c 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1706,6 +1706,12 @@ static int __init i915_init(void)
>  	if (i915.modeset == 0)
>  		driver.driver_features &= ~DRIVER_MODESET;
>  
> +	/* Unhook legacy suspend and resume when KMS is enabled */
> +	if (driver.driver_features & DRIVER_MODESET) {
> +		driver.suspend = NULL;
> +		driver.resume = NULL;
> +	}
> +
>  #ifdef CONFIG_VGA_CONSOLE
>  	if (vgacon_text_force() && i915.modeset == -1)
>  		driver.driver_features &= ~DRIVER_MODESET;
> -- 
> 2.1.4
>
Jani Nikula Aug. 25, 2015, 4:41 p.m. UTC | #2
On Tue, 25 Aug 2015, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Tue, Aug 25, 2015 at 10:51:10AM +0200, Patrik Jakobsson wrote:
>> It's not allowed to have legacy suspend/resume hooked up when
>> DRIVER_MODESET is set. Doing so results in a warning introduced by the
>> commit below.
>> 
>> commit e8b4855b5dd3e285d0ec18ed15468025abc1be9a
>> Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>> Date:   Thu Aug 13 17:06:39 2015 -0300
>> 
>>     drm: WARN_ON if a modeset driver uses legacy suspend/resume helpers
>> 
>>     Legacy s/r hooks are only used for shadow-attaching drivers, warn
>>     when a KMS driver tries to use them.
>> 
>>     Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>>     Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> 
>> Signed-off-by: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
>
> There is no legacy KMS any more, please just kill the hooks entirely.

http://mid.gmane.org/55D1B0C6.3030906@linux.intel.com

BR,
Jani.

> -Daniel
>
>> ---
>>  drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>> 
>> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
>> index 1d88745..6e3391c 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.c
>> +++ b/drivers/gpu/drm/i915/i915_drv.c
>> @@ -1706,6 +1706,12 @@ static int __init i915_init(void)
>>  	if (i915.modeset == 0)
>>  		driver.driver_features &= ~DRIVER_MODESET;
>>  
>> +	/* Unhook legacy suspend and resume when KMS is enabled */
>> +	if (driver.driver_features & DRIVER_MODESET) {
>> +		driver.suspend = NULL;
>> +		driver.resume = NULL;
>> +	}
>> +
>>  #ifdef CONFIG_VGA_CONSOLE
>>  	if (vgacon_text_force() && i915.modeset == -1)
>>  		driver.driver_features &= ~DRIVER_MODESET;
>> -- 
>> 2.1.4
>> 
>
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patrik Jakobsson Aug. 25, 2015, 6:22 p.m. UTC | #3
On Tue, Aug 25, 2015 at 6:41 PM, Jani Nikula
<jani.nikula@linux.intel.com> wrote:
> On Tue, 25 Aug 2015, Daniel Vetter <daniel@ffwll.ch> wrote:
>> On Tue, Aug 25, 2015 at 10:51:10AM +0200, Patrik Jakobsson wrote:
>>> It's not allowed to have legacy suspend/resume hooked up when
>>> DRIVER_MODESET is set. Doing so results in a warning introduced by the
>>> commit below.
>>>
>>> commit e8b4855b5dd3e285d0ec18ed15468025abc1be9a
>>> Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>>> Date:   Thu Aug 13 17:06:39 2015 -0300
>>>
>>>     drm: WARN_ON if a modeset driver uses legacy suspend/resume helpers
>>>
>>>     Legacy s/r hooks are only used for shadow-attaching drivers, warn
>>>     when a KMS driver tries to use them.
>>>
>>>     Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>>>     Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>>>
>>> Signed-off-by: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
>>
>> There is no legacy KMS any more, please just kill the hooks entirely.
>
> http://mid.gmane.org/55D1B0C6.3030906@linux.intel.com
>
> BR,
> Jani.

Perfect, pick that one. Any reason why it's not merged yet?

-Patrik
Shuang He Aug. 29, 2015, 7 a.m. UTC | #4
Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 7249
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
ILK                 -1              302/302              301/302
SNB                                  315/315              315/315
IVB                                  336/336              336/336
BYT                                  283/283              283/283
HSW                                  378/378              378/378
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*ILK  igt@kms_flip@wf_vblank-vs-modeset-interruptible      PASS(1)      DMESG_WARN(1)
Note: You need to pay more attention to line start with '*'
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 1d88745..6e3391c 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1706,6 +1706,12 @@  static int __init i915_init(void)
 	if (i915.modeset == 0)
 		driver.driver_features &= ~DRIVER_MODESET;
 
+	/* Unhook legacy suspend and resume when KMS is enabled */
+	if (driver.driver_features & DRIVER_MODESET) {
+		driver.suspend = NULL;
+		driver.resume = NULL;
+	}
+
 #ifdef CONFIG_VGA_CONSOLE
 	if (vgacon_text_force() && i915.modeset == -1)
 		driver.driver_features &= ~DRIVER_MODESET;