Bug 24996 (kampsun)

Summary: Wrong display resolution in X, "windowed" console. FX 5600 XT
Product: xorg Reporter: Hendrik <kampsuniahv>
Component: Driver/nouveauAssignee: Nouveau Project <nouveau>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: andyrtr, fabiduc, simon
Version: 7.5 (2009.10)   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Dmesg
none
xorg.0.log
none
nv31_tvdac_load.patch
none
nv43_tvdac_load.patch
none
dcb_gpio_tvdac_switching.patch
none
dcb_gpio_tvdac_switching2.patch
none
dcb_gpio_tvdac_switching3.patch
none
dmesg
none
dmesg
none
dmesg snip, obviously "DCB type 1 not known"
none
nv43_tvdac_load_2.patch
none
dmesg excerpt after sucessful run! none

Description Hendrik 2009-11-09 03:37:50 UTC
Created attachment 31062 [details]
Dmesg

I'm getting 1024x768 display resolution in X, even though my monitors native is 1248x1024. When using console, it doesn't fill the whole screen it is "windowed" in corner.
I'm using ArchLinux with latest git build of xf86-video-nouveau and this http://www.archlinux.org/packages/extra/i686/nouveau-drm/ nouveau-drm package. Using or not using fix_resolution_detection.patch doesn't change anything (superficially). I have enabled kms. Without it i had artifacts in different programs.
I'll add dmesg and xorg.log.
Comment 1 Hendrik 2009-11-09 03:38:34 UTC
Created attachment 31063 [details]
xorg.0.log
Comment 2 Francisco Jerez 2009-11-09 05:46:09 UTC
Created attachment 31065 [details] [review]
nv31_tvdac_load.patch

Does the attached patch help?
Comment 3 Hendrik 2009-11-09 08:12:43 UTC
Yes, that patch fixed it.
Comment 4 Francisco Jerez 2009-11-10 14:47:22 UTC
(In reply to comment #3)
> Yes, that patch fixed it.
> 

A BIOS dump from this card would be interesting. [1] describes several procedures you can follow (attaching it to the bug report is probably not a good idea though, I'd rather send it to mmio.dumps at gmail.com).

[1] http://nouveau.freedesktop.org/wiki/DumpingVideoBios
Comment 5 Simon Siemonsma 2009-11-11 12:18:01 UTC
(In reply to comment #0)
> Created an attachment (id=31062) [details]
> Dmesg
> 
> I'm getting 1024x768 display resolution in X, even though my monitors native is
> 1248x1024. When using console, it doesn't fill the whole screen it is
> "windowed" in corner.
> I'm using ArchLinux with latest git build of xf86-video-nouveau and this
> http://www.archlinux.org/packages/extra/i686/nouveau-drm/ nouveau-drm package.
> Using or not using fix_resolution_detection.patch doesn't change anything
> (superficially). I have enabled kms. Without it i had artifacts in different
> programs.
> I'll add dmesg and xorg.log.
> 

I have exactly the same problem. Only I have a NV43 video chip.
I'm using Gentoo amd64. Nouveau is compiled into the kernel.
without KMS set everything looks fine.
With KMS set as described by the original poster.
No other differences in the kernel configuration.
Comment 6 Francisco Jerez 2009-11-11 12:38:17 UTC
Created attachment 31117 [details] [review]
nv43_tvdac_load.patch

(In reply to comment #5)
> I have exactly the same problem. Only I have a NV43 video chip.
> I'm using Gentoo amd64. Nouveau is compiled into the kernel.
> without KMS set everything looks fine.
> With KMS set as described by the original poster.
> No other differences in the kernel configuration.
> 
 
Does the attached patch fix it for you?
Comment 7 Simon Siemonsma 2009-11-13 06:33:19 UTC
(In reply to comment #6)
> Created an attachment (id=31117) [details]
> nv43_tvdac_load.patch
> 
> 
> Does the attached patch fix it for you?
> 
I didn't manage to apply the patch.
I copied your patch in the directory ../drivers/gpu/drm/nouveau
I changed over to this directory.
I did: patch nv43_tvdac_load.patch

The cursor changed to the beginning of the next line and further nothing happened.

Apperently I do something wrong. checking the manpage I don't understand what.

What is the right way to apply the patch?

Simon
Comment 8 Johannes Obermayr 2009-11-13 06:58:01 UTC
(In reply to comment #7)
> I didn't manage to apply the patch.
> I copied your patch in the directory ../drivers/gpu/drm/nouveau
<snip>
> What is the right way to apply the patch?
> 
> Simon
>

1. copy/move the patch to your base directory (in your case .. directory from ../drivers/gpu/drm/nouveau)
2. then apply the patch with command "patch -p1 <nv43_tvdac_load.patch"
3. and last compile and install it...
Comment 9 Simon Siemonsma 2009-11-13 07:23:14 UTC
(In reply to comment #6)
> Created an attachment (id=31117) [details]
> nv43_tvdac_load.patch
> 
> > 
> 
> Does the attached patch fix it for you?
> 

The patch doesn't help.
Please let me now if you would like to receive more information or if can do some more tests.
Comment 10 Simon Siemonsma 2009-11-14 12:50:25 UTC
(In reply to comment #9)
> (In reply to comment #6)
> > Created an attachment (id=31117) [details] [details]
> > nv43_tvdac_load.patch
> > 
> > > 
> > 
> > Does the attached patch fix it for you?
> > 
> 
> The patch doesn't help.
> Please let me now if you would like to receive more information or if can do
> some more tests.
> 

I did some more test.
The console uses the right resolution: 1280x1024. Only the upper left is used to display the characters.
When running X the monitor is in the right resolution: 1280x1024. Only xrandr(In reply to comment #9)
> (In reply to comment #6)
> > Created an attachment (id=31117) [details] [details]
> > nv43_tvdac_load.patch
> > 
> > > 
> > 
> > Does the attached patch fix it for you?
> > 
> 
> The patch doesn't help.
> Please let me now if you would like to receive more information or if can do
> some more tests.
> 

(In reply to comment #9)
> (In reply to comment #6)
> > Created an attachment (id=31117) [details] [details]
> > nv43_tvdac_load.patch
> > 
> > > 
> > 
> > Does the attached patch fix it for you?
> > 
> 
> The patch doesn't help.
> Please let me now if you would like to receive more information or if can do
> some more tests.
> 

I did some test:
Pressing the menu button of my screen shows the resolution it is running at.
This is 1280x1024 which is as it should be.
In console only the upper left part of the screen is used for the framebuffer console.
In X the output of xrandr is:
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096
VGA-0 disconnected (normal left inverted right x axis y axis)
DVI-I-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 376mm x 301mm
   1280x1024      60.0 +
   1024x768       75.1*    70.1     60.0
   832x624        74.6
   800x600        72.2     75.0     60.3     56.2
   640x480        72.8     75.0     66.7     60.0
   720x400        70.1
TV-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   720x576        50.0 +
   1024x768       50.0*
   800x600        50.0
   720x480        50.0
   640x480        50.0
   400x300       100.0
   320x240       100.0
   320x200       100.0

I definitively have no TV attached to my system.
It seems xrandr is trying to run my monitor and non excistend tv at the same resolution.

My understanding is:
1. nouveau detects a tv which is not there.
2. the framebuffer doesn't use all screen real estate for some reason.
3. xrandr sets all available screens to the same resolution. There is already a bugreport about this.
4. as things are now I have to manually change the resolution of my screen.


Comment 11 Francisco Jerez 2009-11-17 04:37:28 UTC
Created attachment 31253 [details] [review]
dcb_gpio_tvdac_switching.patch

(In reply to comment #9)
> (In reply to comment #6)
> > Created an attachment (id=31117) [details] [details]
> > nv43_tvdac_load.patch
> > 
> > > 
> > 
> > Does the attached patch fix it for you?
> > 
> 
> The patch doesn't help.
> Please let me now if you would like to receive more information or if can do
> some more tests.
> 

Please, try again with this one.
Comment 12 Francisco Jerez 2009-11-17 19:02:40 UTC
Created attachment 31286 [details] [review]
dcb_gpio_tvdac_switching2.patch

The last patch is known not to work on some nv4x, could you try this one instead?
Comment 13 Francisco Jerez 2009-11-18 08:04:55 UTC
Created attachment 31294 [details] [review]
dcb_gpio_tvdac_switching3.patch

(In reply to comment #9)
> (In reply to comment #6)
> > Created an attachment (id=31117) [details] [details]
> > nv43_tvdac_load.patch
> > 
> > > 
> > 
> > Does the attached patch fix it for you?
> > 
> 
> The patch doesn't help.
> Please let me now if you would like to receive more information or if can do
> some more tests.
> 

dcb_gpio_tvdac_switching2.patch no longer applies cleanly over master. Please use the one I'm attaching now if you have updated your tree recently enough.
Comment 14 Simon Siemonsma 2009-11-18 11:37:18 UTC
(In reply to comment #13)
> Created an attachment (id=31294) [details]
> dcb_gpio_tvdac_switching3.patch
> 
> (In reply to comment #9)
> > (In reply to comment #6)
> > > Created an attachment (id=31117) [details] [details] [details]
> > > nv43_tvdac_load.patch
> > > 
> > > > 
> > > 
> > > Does the attached patch fix it for you?
> > > 
> > 
> > The patch doesn't help.
> > Please let me now if you would like to receive more information or if can do
> > some more tests.
> > 
> 
> dcb_gpio_tvdac_switching2.patch no longer applies cleanly over master. Please
> use the one I'm attaching now if you have updated your tree recently enough.
> 

(In reply to comment #13)
> Created an attachment (id=31294) [details]
> dcb_gpio_tvdac_switching3.patch
> 
> (In reply to comment #9)
> > (In reply to comment #6)
> > > Created an attachment (id=31117) [details] [details] [details]
> > > nv43_tvdac_load.patch
> > > 
> > > > 
> > > 
> > > Does the attached patch fix it for you?
> > > 
> > 
> > The patch doesn't help.
> > Please let me now if you would like to receive more information or if can do
> > some more tests.
> > 
> 
> dcb_gpio_tvdac_switching2.patch no longer applies cleanly over master. Please
> use the one I'm attaching now if you have updated your tree recently enough.
> 

(In reply to comment #13)
> Created an attachment (id=31294) [details]
> dcb_gpio_tvdac_switching3.patch
> 
> (In reply to comment #9)
> > (In reply to comment #6)
> > > Created an attachment (id=31117) [details] [details] [details]
> > > nv43_tvdac_load.patch
> > > 
> > > > 
> > > 
> > > Does the attached patch fix it for you?
> > > 
> > 
> > The patch doesn't help.
> > Please let me now if you would like to receive more information or if can do
> > some more tests.
> > 
> 
> dcb_gpio_tvdac_switching2.patch no longer applies cleanly over master. Please
> use the one I'm attaching now if you have updated your tree recently enough.
> 

Given your comments about ubdating my tree recently enough I downloaded the latest drm snapshot from http://people.freedesktop.org/~pq/nouveau-drm/

When applying the patch Chunk 1 & 2 didn't apply.
Before applying the patch the kernel did compile.
After applying the patch (except chunk 1 & 2 of course) the kernel didn't compile.
Comment 15 Xavier 2009-11-18 17:32:34 UTC
(In reply to comment #12)
> Created an attachment (id=31286) [details]
> dcb_gpio_tvdac_switching2.patch
> 
> The last patch is known not to work on some nv4x, could you try this one
> instead?
> 

This guy with a nv43 has tried that patch apparently without success :
http://bbs.archlinux.org/viewtopic.php?pid=658015#p658015

I will ask him to post here directly, it would be easier :)
Comment 16 Thomas Hoernes 2009-11-19 06:31:27 UTC
Created attachment 31307 [details]
dmesg
Comment 17 Thomas Hoernes 2009-11-19 06:37:00 UTC
Created attachment 31308 [details]
dmesg

Sorry for double post! I´ve tried dcb_gpio_tvdac_switching3.patch with today´s snapshot. Error still occurs.
Comment 18 Francisco Jerez 2009-11-19 09:50:31 UTC
Some mmiotraces from the cards TV load detection still fails may be useful. There are some instructions in the wiki pages [1], besides the docs in the kernel source tree.

The best would be to trace the blob with the TV output connected and any other outputs disconnected, no need to do anything special, just load nvidia.ko and start X up.

As it's going to be a very large file, I'd send it compressed to mmio.dumps at gmail.com instead of attaching it to the bug report.

[1] http://nouveau.freedesktop.org/wiki/MmioTrace
Comment 19 Simon Siemonsma 2009-11-23 12:25:43 UTC
(In reply to comment #18)
> Some mmiotraces from the cards TV load detection still fails may be useful.
> There are some instructions in the wiki pages [1], besides the docs in the
> kernel source tree.
> 
> The best would be to trace the blob with the TV output connected and any other
> outputs disconnected, no need to do anything special, just load nvidia.ko and
> start X up.
> 
> As it's going to be a very large file, I'd send it compressed to mmio.dumps at
> gmail.com instead of attaching it to the bug report.
> 
> [1] http://nouveau.freedesktop.org/wiki/MmioTrace
> 
mmio dump send.
It is without a tv attached ad with a monitor attached however.
I hope it is still usefull.
Comment 20 Francisco Jerez 2009-11-24 07:15:08 UTC
(In reply to comment #19)
> mmio dump send.
> It is without a tv attached ad with a monitor attached however.
> I hope it is still usefull.
> 

Hm, I'm afraid it isn't, as you have a monitor connected the blob doesn't even try to detect TV, but it probably would if you run it with no outputs connected at all.
Comment 21 ashtophet 2009-12-20 03:42:50 UTC
Created attachment 32204 [details]
dmesg snip, obviously "DCB type 1 not known"
Comment 22 ashtophet 2009-12-20 03:43:14 UTC
I'm just a plain user, no devel knowledge, so sorry if it's a stupid proposal, wouldn't it be possible, as a workaround, to make this TV-out thingy optional, either config time or load time?

I'm using kernel 2.6.33-rc1 (nv43), was suffering from the issue described here (I need proper resolution on fb), and simply commenting a few lines on nv04_display.c (OUTPUT_TV in case statements) made it work as I'm expecting. I know it's not a solution, I know it doesn't help the nouveau driver effort, but I'm not using TV-out (I've just used it once in eight yeras, just for the sake of trying...), I don't want to use it, I cannot contribute a MMIO dump (no TV here :P)... 

Thanks to you developers for hard working on nouveau!

Sorry for disturbing...
Comment 23 Francisco Jerez 2009-12-20 05:30:27 UTC
Created attachment 32206 [details] [review]
nv43_tvdac_load_2.patch

The patch I'm attaching will probably solve the load detection false positives you've been experiencing on nv43.
Comment 24 ashtophet 2009-12-20 06:08:19 UTC
Hi.
Cleanly compiled... init 6 and I'll report ;)

Thanks
Comment 25 ashtophet 2009-12-20 06:15:56 UTC
Created attachment 32207 [details]
dmesg excerpt after sucessful run!
Comment 26 ashtophet 2009-12-20 06:17:50 UTC
Booted fine, with no issues. Correct output detection, KMS working fine.

Thanks!!
Comment 27 Fabienne Ducroquet 2009-12-20 14:48:10 UTC
Hi,
I had the same issue with a NV42 chipset (Quadro FX Go1400), I applied the last patch (nv43_tvdac_load_2.patch) with "if (dev_priv->chipset == 0x42)" instead of "if (dev_priv->chipset == 0x43)" and that fixed it.
Comment 28 Maarten Maathuis 2009-12-21 12:00:45 UTC
nv43_tvdac_load_2.patch seems to work on a nv43, didn't test with tvout connected.
Comment 29 Francisco Jerez 2009-12-21 16:30:44 UTC
nv43_tvdac_load_2.patch is now in master (with some additional fixes for nv42), so I'm marking this as fixed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.