linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: adaplas@pol.net
Cc: adaplas@hotpop.com, aragorn@tiscali.nl,
	debian-sparc@lists.debian.org, sparclinux@vger.kernel.org,
	linux-fbdev-devel@lists.sourceforge.net
Subject: Re: [atyfb] No display on Sparc Ultra 10 with kernel 2.6.10-rc2 or later
Date: Tue, 15 Feb 2005 08:49:58 -0800	[thread overview]
Message-ID: <20050215084958.1f68b39b.davem@davemloft.net> (raw)
In-Reply-To: <200502152010.22880.adaplas@hotpop.com>

On Tue, 15 Feb 2005 20:10:21 +0800
"Antonino A. Daplas" <adaplas@hotpop.com> wrote:

> Okay.  It seems that in the working kernel, the default mode, 1152x900, was
> taken from the prom (since there is no 1152x900 in the mode database) if you
> did not specify any boot mode option.
> 
> In the non-working version, without the boot mode option, the default_var
> was used (which is only 640x480) or taken from the mode database if you
> specified a boot mode.

I think the bug is in the changes made to the fb_find_mode() calls
in the !CONFIG_PPC case.  That looked suspicious to me the first time
I scanned the atyfb driver diffs in 2.6.11

First of all, a file global declared as "static char *mode" is asking for
all sorts of trouble.  It's very easy to use such a simple name as
a function local variable, thus making the global one invisible.

I reviewed the driver and there are no cases of local variables named
"mode" right now, but this is still asking for trouble in the future.
It should be thus renamed.

Now let's get back to the fb_find_mode() call in aty_init().  The old
code for the non-CONFIG_PPC case did this:

#ifdef __sparc__
	if (mode_option) {
		if (!fb_find_mode(...))
			var = default_var;
	} else
		var = default_var;
#else
	if (!fb_find_mode(...))
		var = default_var;
#endif

The new code calls fb_find_mode() always, this is wrong for Sparc's
desired behavior:

	if (!fb_find_mode(...))
		var = default_var;

On sparc, when "mode" is NULL, we should always use default_var as
setup by PROM probed values.

Here is the fix:

===== drivers/video/aty/atyfb_base.c 1.82 vs edited =====
--- 1.82/drivers/video/aty/atyfb_base.c	2005-01-04 18:48:32 -08:00
+++ edited/drivers/video/aty/atyfb_base.c	2005-02-15 08:19:00 -08:00
@@ -2511,7 +2511,15 @@
 		}
 	} else
 #endif /* !CONFIG_PPC */
-	if (!fb_find_mode(&var, info, mode, NULL, 0, &defmode, 8))
+	if (
+#if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64)
+	   /* On Sparc, unless the user gave a specific mode
+	    * specification, use the PROM probed values in
+	    * default_var.
+	    */
+	    !mode ||
+#endif
+	    !fb_find_mode(&var, info, mode, NULL, 0, &defmode, 8))
 		var = default_var;
 
 	if (noaccel)

  reply	other threads:[~2005-02-15 16:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200502140251.00645.aragorn@tiscali.nl>
     [not found] ` <200502150059.12789.adaplas@hotpop.com>
     [not found]   ` <200502141855.29202.aragorn@tiscali.nl>
2005-02-14 23:40     ` [atyfb] No display on Sparc Ultra 10 with kernel 2.6.10-rc2 or later Antonino A. Daplas
2005-02-15  0:31       ` David S. Miller
2005-02-15  6:22       ` Frans Pop
2005-02-15 10:03         ` [Linux-fbdev-devel] " Geert Uytterhoeven
2005-02-15 12:10         ` Antonino A. Daplas
2005-02-15 16:49           ` David S. Miller [this message]
2005-02-16  2:27             ` Frans Pop
2005-02-16  3:20               ` David S. Miller
2005-02-16 11:30                 ` Antonino A. Daplas
2005-02-16  2:27           ` Frans Pop
2005-02-16 11:27             ` Antonino A. Daplas
2005-02-16 15:51               ` David S. Miller
2005-02-16 22:10                 ` Frans Pop
2005-02-16 23:02                   ` Antonino A. Daplas
2005-02-16 23:18                     ` [Linux-fbdev-devel] " Antonino A. Daplas
2005-02-16 23:24                     ` Antonino A. Daplas
2005-02-17 14:16                       ` Frans Pop
2005-02-17 21:30                         ` Antonino A. Daplas

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=20050215084958.1f68b39b.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=adaplas@hotpop.com \
    --cc=adaplas@pol.net \
    --cc=aragorn@tiscali.nl \
    --cc=debian-sparc@lists.debian.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=sparclinux@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).