Bug 14703

Summary: On NV17 on laptop screen: certain resolutions are scrambled
Product: xorg Reporter: Phillip Ezolt <phillipezolt>
Component: Driver/nouveauAssignee: Nouveau Project <nouveau>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: sb476
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 14405    
Attachments:
Description Flags
Working 1024x768 (with no randr)
none
regdump::Working 1152x864 (with no randr)
none
regdump::broken 1152x864 (with randr 1.2)
none
regdump::broken 1024x768 (with randr 1.2)
none
regdump: Working 800x600 w/randr 1.2 (Default scaling...Aspect?)
none
Some corrections to the noscale scaling mode none

Description Phillip Ezolt 2008-02-27 11:06:35 UTC
With git, I am able to use xrandr 1.2 on most of the modes that my laptop screen
supports. 

However, these resolutions are corrupted when I switch to them: 1152x864
and1024x768.  It is as if the flat panel isn't reading out enough
columns to put on the display.

(For example, if the display is 1024x768, the flat panel might be
showing 1020, and as a result, each line wraps around to the next.)

In 1024x768, my screen kinda looks like the following:
111111111111111111111111111111
111222222222222222222222222222
222223333333333333333333333333
333333333444444444444444444444
444444444444

Notice how it is shifted over more and more as you go down the screen.
...
However, once you get to the middle, the pattern appears to go in the
other direction, but that might just be random garbage.
The upper part of the screen has my gnome-panel, but is just shifted.

I hope that is clear...
...
The rest of the resolutions work.  Here is my xrandr output for reference:

Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 1680 x 1680
VGA-0 disconnected (normal left inverted right x axis y axis)
LVDS-0 connected 1680x1050+0+0 (normal left inverted right x axis y
axis) 331mm x 207mm
  1680x1050      59.9*+   60.0
  1360x768       59.8     60.0
  1280x800       60.0
  1152x864       60.0
  1280x768       60.0
  1280x720       60.0
  1024x768       60.0
  800x600        60.3
  640x480        59.9
....


See bug 14403 for more details about my config.
Comment 1 Phillip Ezolt 2008-02-27 11:07:29 UTC
Created attachment 14617 [details]
Working 1024x768 (with no randr)
Comment 2 Phillip Ezolt 2008-02-27 11:08:09 UTC
Created attachment 14618 [details]
regdump::Working 1152x864 (with no randr)
Comment 3 Phillip Ezolt 2008-02-27 11:08:45 UTC
Created attachment 14619 [details]
regdump::broken 1152x864 (with randr 1.2)
Comment 4 Phillip Ezolt 2008-02-27 11:09:24 UTC
Created attachment 14620 [details]
regdump::broken 1024x768 (with randr 1.2)
Comment 5 Stuart Bennett 2008-02-28 06:45:37 UTC
Hi, comparative dumps for a working scaled resolution (say 800x600) would be useful. Also, please state which randr12 scaling modes the problem occurs with --
different scaling modes can be set with 'xrandr --output LVDS-0 --set
SCALING_MODE <mode>', where <mode> is one of aspect, noscale, and fullscreen
Comment 6 Phillip Ezolt 2008-02-29 05:41:43 UTC
Created attachment 14714 [details]
regdump: Working 800x600 w/randr 1.2 (Default scaling...Aspect?)

This reg dump is from the 800x600 res in randr 1.2 mode.  It uses the default scaling mode, which from my other experiments, appears to be 'aspect'.

More info to follow later today.
Comment 7 Phillip Ezolt 2008-02-29 08:11:58 UTC
Alright I've run the battery of scaling options on all of the resolutions that randr 1.2 reports. 

            Aspect        No Scale       Fullscreen
1360x768     Works         Corrupt            Works
1280x800     Works         Corrupt            Works 
1152x864     Corrupt       Corrupt            Works
1280x768     Works         Corrupt            Works
1280x720     Works         Corrupt            Works
1024x724     Corrupt       Corrupt            SquiggleFont
800x600      Works         Clipped            SquiggleFont
640x480      Works         Clipped            SquiggleFont


'Corrupt' means the screen is corrupted and the lines are shifted as described above. 

'Clipped' means the screen is looks correct, but it has been (significantly) clipped.  Like I am looking into a small window in the screen. (Centered, btw)

'SquiggleFont' means that I can see the screen as it should be. (everything is aligned properly), but the fonts seem to have pixels shifted around.

So, in other words, it is readable, there are definite corruptions. 
Comment 8 Maarten Maathuis 2008-02-29 13:12:45 UTC
Did you ever use the blob and noticed what scaling options nvidia-settings offered?

Could you make a picture of the SquiggleFont?

Could you check the broken aspect ratio modes, and see if they have some kind of message like: "scaling resolution for widescreen/portrait something"
Comment 9 Maarten Maathuis 2008-02-29 13:19:04 UTC
I forgot to add, the message may appear in xorg log, about half way the output modeset, if that means anything to you.
Comment 10 Phillip Ezolt 2008-03-01 10:43:18 UTC
>Did you ever use the blob and noticed what scaling options nvidia-settings
> offered?

I used the blob long, long ago. I THINK that it (unlike nv) used something like aspect.  I remember liking the nv driver better because every mode was fullscreen. 

> Could you make a picture of the SquiggleFont?

If I try to do a screen shot, it shows up just fine, so it seems like it is definitely a display problem.  I'll take a picture with my digital camera. 

>Could you check the broken aspect ratio modes, and see if they have some kind
> of message like: "scaling resolution for widescreen/portrait something"

Yes.  "Scaling resolution on a widescreen panel" is present in both of the broken modes (1152x864, 1024x768). I did notice something that I missed before. One of the modes is clipped on the bottom. (And it says: Scaling resolution on a portrait panel)

(BTW.  The panel is natively 1680x1050, but I left that resolution of all of the tests.)

Here's my exhaustive test results:

                 Result              Scaling_String
   1360x768      Clipped on Bottom   "Scaling resolution on a portrait panel"    
   1280x800      Works               None
   1152x864      Corrupt             "Scaling resolution on a widescreen panel"
   1280x768      Works               None  
   1280x720      Clipped on Bottom   "Scaling resolution on a portrait panel"
   1024x768      Corrupt             "Scaling resolution on a widescreen panel" 
   800x600       Clipped on Right    "Scaling resolution on a widescreen panel"
                  (~100 pixels)
   640x480       Clipped on Right    "Scaling resolution on a widescreen panel"
                  (~100 pixels)
Comment 11 Stuart Bennett 2008-03-04 07:35:20 UTC
Created attachment 14808 [details] [review]
Some corrections to the noscale scaling mode

See if this patch helps any with corruption of the noscale modes. If it does, it's worth seeing if "aspect" works better when regp->fp_hvalid_start and regp->fp_hvalid_end do not get set at nv_crtc.c lines ~1380 and ~1400.
Comment 12 Phillip Ezolt 2008-03-06 06:23:38 UTC
Alright, I've tried the patch.  It completely fixes all of the "non-scaled" resolutions. (None of them are corrupt.) 

I still have to:
1) Take a Picture of squiggle font
2) Try the other fix you suggested for aspect. 

Here's my status with head+your patch: 

            Aspect        No Scale       Fullscreen
1360x768     Bottom Clip    Works             Works
1280x800     Works          Works             Works 
1152x864     Corrupt        Works             Works
1280x768     Works          Works             Works
1280x720     Bottom Clip    Works             Works
1024x768     Corrupt        Works             SquiggleFont
800x600      Right Clip     Works             SquiggleFont
640x480      Right Clip     Works             SquiggleFont

Comment 13 Stuart Bennett 2008-03-13 19:16:58 UTC
Hi, have you had any time to look at these remaining issues? I'd be very interested in the outcome of 2) especially
Comment 14 Phillip Ezolt 2008-03-16 04:09:33 UTC
(In reply to comment #13)
> Hi, have you had any time to look at these remaining issues? I'd be very
> interested in the outcome of 2) especially
> 

Sorry. Didn't mean to fall off the face of the Earth.  Real life got in the way.  I'll give it a try later today. 

Cheers,
--Phil
Comment 15 Phillip Ezolt 2008-03-16 16:24:42 UTC
Ok.  I tried the suggested change and it did make things better.

The output of "aspect" resolutions exactly matched those of the "fullscreen" resolutions.  So, for every resolution, none were clipped. 

This is definitely a step in the right direction.  However, since the output filled up the entire screen, it DIDN'T maintain the aspect ratio (like the mode's name implies...)   Maybe that's the best we can do...

BTW.  I have pictures of the "squiggle font" which I'll be uploading shortly. 
Comment 16 Phillip Ezolt 2008-03-16 16:44:41 UTC
Alright, bugzilla won't let me attach these images... Too big.

Squiggle font @ 1024x768:
http://www.mediafire.com/?nnb7tmxl22f

Squiggle font @ 800x600:
(Notice that the screen also looks shifted to the right)
http://www.mediafire.com/?di1t3xwtwxh

Squiggle font @640x480:
(The screen looks rotated here, too..)
http://www.mediafire.com/?xui1mzwmc2f
Comment 17 Stuart Bennett 2008-03-16 18:45:49 UTC
Ok, I've merged up the noscale fix for now. Perhaps aspect is too much to hope for (do you have the binary blob installed -- if so, does nvidia-settings let you choose aspect scaling?), but fullscreen should work, since it does in non-randr.

So:
1) verify that non-randr scaling works at the problematic resolutions *after* randr12 has been used (i.e. no reboot between)
2) add to this bug the output of "radeontool regmatch $reg", for $reg of 0x680884, 0x682884, 0x680888, 0x682888
Comment 18 Pekka Paalanen 2009-08-09 01:13:50 UTC
Randr 1.2 is now mandatory. Any news on this bug? How about KMS?
Comment 19 Pekka Paalanen 2009-11-19 13:38:51 UTC
No reply from the reporter or the bug. Assuming one of them is dead. Closing 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.