mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Dave Airlie <airlied@gmail.com>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>,
	Eric Anholt <eric@anholt.net>, mailing54 <mailing54@plzk.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Dave Airlie <airlied@redhat.com>,
	dri-devel@lists.sourceforge.net, Ma Ling <ling.ma@intel.com>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	"Zhao, Yakui" <yakui.zhao@intel.com>
Subject: Re: Linux 2.6.31-rc7
Date: Tue, 25 Aug 2009 21:13:58 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0908252056170.3218@localhost.localdomain> (raw)
In-Reply-To: <21d7e9970908252047g6db2fb2aj69280efa5eebe681@mail.gmail.com>



On Wed, 26 Aug 2009, Dave Airlie wrote:
> >
> > If you actually detected things _right_, none of this would be an issue.
> > But you don't. And you seem to have a really hard time even admitting
> > that. You try to re-detect things, and you SCREW UP.
> 
> This isn't anything to do with redetection, and in the Mac case there isn't
> even a BIOS table that you can really rely on since Apple hard coded all
> this stuff into their EFI and Mac OSX drivers.

That's really my point.

There _is_ one sort of detection you could do: look at the actual state of 
the graphics chip.

In other words, exactly the case you mention: don't trust any BIOS tables 
(they may not exist, and they _are_ broken in many cases) or silly EFI 
information (I guarantee that any firmware info will eventually be buggy: 
EFI is in no way going to be magically less buggy than BIOS tables have 
been).

So what's left? You can still look at how the chip was programmed. If it's 
driving the VGA port, you can be pretty sure that there's a monitor 
attached. Sure, there might be something _else_ attached too, and I'm not 
saying that you cannot try to probe other things, but right now it seems 
that KMS totally throws away a free - and fairly reliable - piece of 
information. And replaces it with very unreliable information that 
definitely doesn't work.

I'm all for looking at many different places to find 'the truth', but I'm 
very unhappy with KMS looks into BIOS tables, decides that there's a LVDS 
panel attached (there isn't), and then disables the VGA port that drives 
the monitor.

That doesn't help _anybody_. It just results in a black screen. And I 
guarantee that this happens on several pieces of hardware, and no, it's 
not all just "crap Apple and EFI". One of the pieces of hardware it 
happens on is an Intel-only machine. Intel hardware, Intel firmware, Intel 
motherboard, Intel _everything_. And yes, KMS decides to drive a 
nonexistent LVDS display, rather than the one that the BIOS correctly 
booted up with.

> Just because the BIOS manages to light up an output in now way effects
> whether the driver can do the same.

.. but if the BIOS drives one output, that should be a damn big hint that 
you shouldn't then just randomly pick another one!

It sure as hell is a bigger hint than the ones you're using right now. 
Which is kind of my point here. Why are you arguing against a known bug? 

> I'm not sure why the mac-mini hack hasn't been merged I asked for it a
> few times,
> I'd rather the proper solution was merged but that seems to not have
> happened either.

I want to repeat: it's not just Mac Mini. 

> You have two special cases here,
> a) mac mini - apple hw, needs hacks to workaround the fact that they do 
> something nobody else does with the hw and then don't tell you about it 
> in the hw. the hack from userspace should have been ported to the kernel 
> but I keep not seeing it.

The thing is, the BIOS _does_ report it to the hardware: you could just 
read the hardware registers.

But no. Instead the Intel KMS code discards the hardware registers, and 
reads the BIOS tables instead, finds a LVDS entry there, and uses that - 
and disconnects the entry that _was_ driving the monitor.

Really. Do you seriously believe that because you found some random tables 
in the BIOS memory, it's more reliable than "oh, the BIOS set the hardware 
up to drive the SVDO output"?

That's what I find irritating. We _know_ BIOS tables are random crap. We 
_know_ they are way less reliable than just asking the hardware where it 
is. But KMS still trusts the VBT data more than the fact that the chip has 
been programmed to output DVI/SVDO output.

> b) pre-production SDV hardware for a mobile chipset without LVDS, here's 
> both pieces you get to keep them. LVDS isn't detectable on any hw, the 
> sanity assumption so far are you have a mobile chipset you must have 
> LVDS, you have an ACPI lid button you might have LVDS.

Again, you say that, but you have absolutely nothing to back it up with.

Here's a counter-argument: we _know_ that it's not detectable whether 
there's an LVDS panel is attached or not. So what should we do? Should we 
turn off the VGA1 connection that we can see that the BIOS programmed, and 
set things up for LVDS instead?

That's f*cking _stupid_. Go ahead and program the LVDS panel *too*, but 
don't turn off the SDVO (or whatever) output that was also active!

And quite frankly, if the BIOS didn't turn on the panel, then maybe the 
kernel shouldn't either. At least not until it gets a "lid open" event. So 
even the "go ahead and program LVDS too" part is quite debatable.

In other words: it would be a lot saner to just keep whatever output mode 
that the machine booted with. Then, change it ONLY IF YOU DETECT SOMETHING 
ACTUALLY CHANGING.

			Linus

  reply	other threads:[~2009-08-26  4:14 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-22  1:26 Linus Torvalds
2009-08-22  3:09 ` Regression: Linux 2.6.31-rc7 lost sensors on asus mobo Gene Heskett
2009-08-22  3:47   ` Linus Torvalds
2009-08-22 12:56     ` Gene Heskett
2009-08-22  6:12   ` Robert Hancock
2009-08-22 10:54     ` Stefan Richter
2009-08-22 13:48       ` Gene Heskett
2009-08-22 14:38         ` Stefan Richter
2009-08-22 19:55           ` Gene Heskett
2009-08-22 13:40     ` Gene Heskett
2009-08-23 10:56 ` Linux 2.6.31-rc7 Geert Uytterhoeven
2009-08-26  5:06   ` KOSAKI Motohiro
2009-08-25 17:25 ` mailing54
2009-08-25 18:11   ` Linus Torvalds
2009-08-25 21:37     ` mailing54
2009-08-25 22:07       ` Linus Torvalds
     [not found]         ` <1251239637.26348.20.camel@gaiman.anholt.net>
2009-08-26  1:51           ` Zhenyu Wang
2009-08-26  3:33             ` Linus Torvalds
2009-08-26  3:47               ` Dave Airlie
2009-08-26  4:13                 ` Linus Torvalds [this message]
2009-08-26  4:58                   ` Dave Airlie
2009-08-26 17:12                     ` Linus Torvalds
2009-08-26 17:18                       ` Jesse Barnes
2009-08-26  6:26                 ` Eric Anholt
2009-08-26  6:35                   ` Dave Airlie
2009-08-26  3:58               ` Zhenyu Wang
2009-08-26  4:20                 ` Linus Torvalds
2009-09-10  5:47                   ` Zhenyu Wang
2009-08-26 10:09                 ` ykzhao
2009-08-30 22:01         ` Tino Keitel

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=alpine.LFD.2.01.0908252056170.3218@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=eric@anholt.net \
    --cc=jbarnes@virtuousgeek.org \
    --cc=ling.ma@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailing54@plzk.org \
    --cc=yakui.zhao@intel.com \
    --cc=zhenyuw@linux.intel.com \
    /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