mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: "Jordan Crouse" <jordan.crouse@amd.com>
Cc: linux-kernel@vger.kernel.org, alan@lxorguk.ukuu.org.uk,
	info-linux@ldcmail.amd.com
Subject: Re: [PATCH 3/3] APM Screen Blanking fix
Date: Thu, 15 Dec 2005 13:45:08 -0800	[thread overview]
Message-ID: <20051215134508.21487ccf.akpm@osdl.org> (raw)
In-Reply-To: <20051215211601.GG11054@cosmic.amd.com>

"Jordan Crouse" <jordan.crouse@amd.com> wrote:
>
> A simple patch to fix APM assisted screen blanking (this at least fixes
> a issue with the Geode LX BIOS).  Reposted from before with no changes.
> 
> APM screen blanking fix.
> 
> This patch fixes screen blanking on BIOSes that return
> APM_NOT_ENGAGED when APM enabled screen blanking is not
> turned on.

Well actually it does a whole bunch of cleanup, no?

> Signed off by: Jordan Crouse <jordan.crouse@amd.com>
> ---
> 
>  arch/i386/kernel/apm.c |   27 ++++++++++++++-------------
>  1 files changed, 14 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
> index 1e60acb..03e9d84 100644
> --- a/arch/i386/kernel/apm.c
> +++ b/arch/i386/kernel/apm.c
> @@ -1075,22 +1075,23 @@ static int apm_engage_power_management(u
>   
>  static int apm_console_blank(int blank)
>  {
> -	int	error;
> -	u_short	state;
> +	int error, i;
> +	u_short state;
> +	u_short dev[3] = { 0x100, 0x1FF, 0x101 };

I'll make dev[] `static const'.  That'll save a scrap of kernel text.

>  	state = blank ? APM_STATE_STANDBY : APM_STATE_READY;
> -	/* Blank the first display device */
> -	error = set_power_state(0x100, state);
> -	if ((error != APM_SUCCESS) && (error != APM_NO_ERROR)) {
> -		/* try to blank them all instead */
> -		error = set_power_state(0x1ff, state);
> -		if ((error != APM_SUCCESS) && (error != APM_NO_ERROR))
> -			/* try to blank device one instead */
> -			error = set_power_state(0x101, state);
> +
> +	for (i = 0; i < 3; i++) {
> +		error = set_power_state(dev[i], state);
> +
> +		if ((error == APM_SUCCESS) || (error == APM_NO_ERROR))
> +			return 1;
> +
> +		if (error == APM_NOT_ENGAGED)
> +			break;
>  	}
> -	if ((error == APM_SUCCESS) || (error == APM_NO_ERROR))
> -		return 1;

All the above doesn't actually have any functional changes does it?

It's a decent-looking cleanup, but it should have been separately
changelogged.

> -	if (error == APM_NOT_ENGAGED) {
> +	if (error == APM_NOT_ENGAGED && state != APM_STATE_READY) {

And this is the actual fix/workaround?


  reply	other threads:[~2005-12-15 21:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-15 21:12 [PATCH 1/3] Base support for AMD Geode GX/LX processors Jordan Crouse
2005-12-15 21:14 ` [PATCH 2/3] Geode LX HW RNG Support Jordan Crouse
2005-12-15 21:16   ` [PATCH 3/3] APM Screen Blanking fix Jordan Crouse
2005-12-15 21:45     ` Andrew Morton [this message]
     [not found]     ` <LYRIS-4270-4193-2005.12.15-14.45.16--jordan.crouse#amd.com@whitestar.amd.com>
2005-12-15 21:56       ` Jordan Crouse
2005-12-15 21:39   ` [PATCH 2/3] Geode LX HW RNG Support Andrew Morton
2005-12-15 21:44     ` Jordan Crouse
2005-12-15 22:06       ` Andrew Morton
2005-12-15 22:07         ` Jeff Garzik
2005-12-15 22:47           ` Andrew Morton
2005-12-15 22:48           ` Deepak Saxena
2005-12-15 21:36 ` [PATCH 1/3] Base support for AMD Geode GX/LX processors Andrew Morton

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=20051215134508.21487ccf.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=info-linux@ldcmail.amd.com \
    --cc=jordan.crouse@amd.com \
    --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

Powered by JetHome