linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Tarasikov <alexander.tarasikov@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: airlied@linux.ie
Subject: [PATCH] drivers:gpu:vga_switcheroo: Work around dramatic power drain
Date: Sun, 29 Apr 2012 00:45:27 +0400	[thread overview]
Message-ID: <1335645928-30993-1-git-send-email-alexander.tarasikov@gmail.com> (raw)


Hello! Many modern laptops featuring hybrid graphics show a huge raise in
power drain after a suspend/resume cycle which is caused by the discrete
adapter ignoring ACPI-issued power off call after a resume.

This behaviour (increase in power consumption) has been observed on several
machines by many users. This machines include Thinkpad X220, HP Elitebook and
Sony VAIO series, so this may apply to all laptops.

One of the workarounds is to do an ON/OFF cycle via switcheroo from userland
on each resume but this causes confusion in the VGA BIOS which thinks the card
is already ON and that leads to the GPU lockup and system slowdown for a minute
or so. This kind of behaviour is absolutely unacceptable.

I propose this patch as a workaround. It creates a new module parameter
(vga_switcheroo.resume_powercut). When it is set to 1, on resume the driver
will iterate over the list of registered cards and disable all inactive cards
ignoring their power state in switcheroo struct (ON/OFF).

I have tested this on my laptop (which is Sony VAIO SA3S9R with i5, HM67,
HD3000 and Radeon 6630M).
Without this patch, the idle power consumption is 7-9W. After a suspend/resume
cycle that jumps to 15-19W. With the patch, the consumption is always below
10W after numerous suspend/resume cycles.

I agree that the implementation may be far from clean, therefore I have
not enabled the parameter by default. I am welcome to any suggestions on
improving the implementation but I think that it would not hurt to include
it as-is so that users can test it and report their impressions/bugs. Please
review the patch and forward it to downstream projects if you are involved in
any that may be interested (i.e., ubuntu kernel team).

             reply	other threads:[~2012-04-28 20:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-28 20:45 Alexander Tarasikov [this message]
2012-04-28 20:45 ` [PATCH] drivers:gpu:vga_switcheroo: Work around dramatic power drain in laptops Alexander Tarasikov
2012-04-28 21:10   ` Alan Cox
2012-04-28 22:17     ` Alexander Tarasikov
2012-05-06 17:36       ` Uwe Bonnes
2012-07-03  1:55         ` Valery Pipin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335645928-30993-1-git-send-email-alexander.tarasikov@gmail.com \
    --to=alexander.tarasikov@gmail.com \
    --cc=airlied@linux.ie \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).