This patch starts to use the information in var for modesetting for
CRT and DVI devices. This is the right thing as it allows us to use
more generic modes than the ones predefined by VIA. We do not yet
allow more generic modes as check_var still limits them to the
predefined ones but with this patch applied it would be really easy
to do so. A problem was VIAs SAMM mode as it has 2 different modes
but just one frame buffer device. This is solved by creating a
pseudo var which contains enough information to use it for
modesetting. Hopefully one day we can use information in var for all
modes that do not involve hardware scaling.
Well I'd like to say that the chance of regressions is low but it is
quite likely that the behaviour in some cases changed especially
when SAMM is involved. I hope we made it better than before in
particular the DVI frequency check was probably broken before and
hopefully works better now.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
There are a lot of init functions which are not marked as such.
Fix this.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Joseph Chan <JosephChan@via.com.tw>
Remove some unused variables, move some dvi code around and store the
detected maximum resolution for later use. The vertical resolution is
handled as the old code did it but I hope it can be read from the hardware
some day.
No runtime change expected.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Joseph Chan <JosephChan@via.com.tw>
Cc: Scott Fang <ScottFang@viatech.com.cn>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is the first step to remove an artificial global index that was used
in two ways:
1. As a pseudo index in the mode table. Pseudo as you had to search
through the table to find the referenced entry. This was replaced by
using a pointer to the entry.
2. As a shortcut to compare a combination of horizontal and vertical
resolution at the same time.
This was replaced by a "(hres<<16) | vres" which is good enough for
now and the near future. If vres or hres become greater than 2^16 this
might indeed cause problems but this solution allows to split this
indexing mess up without the requirement to do even more code changes.
This is a big change that will allow more clean ups. It should be a bit
faster but that is probably not relevant for normal operation. No
regressions expected but as this is a relatively big step heavy testing is
appreciated.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Joseph Chan <JosephChan@via.com.tw>
Cc: Scott Fang <ScottFang@viatech.com.cn>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
dvi.c, dvi.h: TMDS generic process and setting.
global.c, global.h: define global variabls.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Joseph Chan <josephchan@via.com.tw>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>