Bug 22329

Summary: [KMS] Mode Setting not working properly on GM965
Product: DRI Reporter: Mike Kelly <pioto>
Component: DRM/IntelAssignee: Jesse Barnes <jbarnes>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: medium    
Version: XOrg git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Xorg.0.log w/ UXA/KMS
none
lspci -vxxx -s00:02
none
Some useful bits from dmesg when I try changing modes
none
reg dump in kms mode (where things don't work right)
none
reg dump in ums mode (where things do work) none

Description Mike Kelly 2009-06-16 20:59:41 UTC
Created attachment 26876 [details]
Xorg.0.log w/ UXA/KMS

As described on Bug #20801 (https://bugs.freedesktop.org/show_bug.cgi?id=20801#c21), I am running into a different KMS issue w/ my LVDS on my laptop.

I'm attaching the Xorg log when I start up w/ KMS and my lspci -vxxx output for my video devices.

I can't seem to get X11 to start w/o KMS anymore. I've tried appending i915.modeset=0 to my kernel parameters, and that stops it from setting a mode on boot, but startx fails with: "GARTInit: AGPIOC_INFO failed (Invalid argument)"

What other kernel settings do I need to change to make UMS work? For testing purposes, at least.

I also am unfamiliar with how I would get a dump of the video bios (don't see anything obvious under /proc/acpi/video/GFX0, at least, other than ROM, which just says <TODO>)

Uhh, as far as versions of things go...

 kernel - recent build from git, with the tuxonice patches.
 xorg-server - 1.6.1
 xf86-video-intel - 2.7.1, with those 3 patches on Bug #20801
Comment 1 Mike Kelly 2009-06-16 21:00:16 UTC
Created attachment 26877 [details]
lspci -vxxx -s00:02
Comment 2 Gordon Jin 2009-06-17 01:25:22 UTC
Please attach dmesg output.

Better elaborate the symptom of using KMS here.
Comment 3 Mike Kelly 2009-06-17 22:20:42 UTC
Created attachment 26909 [details]
Some useful bits from dmesg when I try changing modes

I get the above bits from doing:

randr --output LVDS1 --mode 1024x768 ; xrandr ; sleep 5 ; xrandr --output LVDS1 --auto

and also from doing alt-enter twice in dosbox (the 640x400 bit).

after the dosbox mode switch, i get:

xrandr: output LVDS1 cannot use rotation "normal" reflection "none"

until i do:

xrandr --output LVDS1 --reflect normal --rotate normal


and, the dosbox output is incorrect. it basically crops off the bottom and right parts of the image.

the call trace is triggered by the change to 1024x768 using the xrandr command.
Comment 4 Jesse Barnes 2009-06-23 18:30:41 UTC
Does KMS still fail with a newer kernel (ideally on from drm-intel next in the drm-intel.git tree from kernel.org?)
Comment 5 Mike Kelly 2009-06-30 16:47:40 UTC
(In reply to comment #4)
> Does KMS still fail with a newer kernel (ideally on from drm-intel next in the
> drm-intel.git tree from kernel.org?)

Using a current git kernel, including all the current patches from drm-intel-next, I still have these problems.
Comment 6 Jesse Barnes 2009-07-08 14:26:30 UTC
Those kernel messages should be gone now with recent xf86-video-intel bits.  I'm trying to figure out this report though; the initial description said that you couldn't disable KMS w/o something breaking (an AGP related error apparently), but later you said you were having mode setting issues...
Comment 7 Mike Kelly 2009-07-08 18:05:37 UTC
(In reply to comment #6)
> Those kernel messages should be gone now with recent xf86-video-intel bits. 

Recent as in what version? Recent git snapshot?

> I'm trying to figure out this report though; the initial description said that
> you couldn't disable KMS w/o something breaking (an AGP related error
> apparently), but later you said you were having mode setting issues...

I was attempting to disable KMS by passing i915.modeset=0 to the kernel. But, X wouldn't boot if I did that.

I have xf86-video-intel letting me do any changing of modes at all because of three patches I applied to it from bugzilla -- http://bugs.freedesktop.org/attachment.cgi?id=26567, http://bugs.freedesktop.org/attachment.cgi?id=26568, http://bugs.freedesktop.org/attachment.cgi?id=26569. Without those, xrandr only shows me my display's native resolution as an "option".

Sorry if my report was vague. If there's any more formal procedure I should be following, I'd appreciate a pointer. (I'm not used to debugging kernel or driver bugs)
Comment 8 Jesse Barnes 2009-07-09 09:39:59 UTC
(In reply to comment #7)
> Recent as in what version? Recent git snapshot?

I think the last 2.8-rc had the fix as well, but yeah git is best.

> I was attempting to disable KMS by passing i915.modeset=0 to the kernel. But, X
> wouldn't boot if I did that.
> 
> I have xf86-video-intel letting me do any changing of modes at all because of
> three patches I applied to it from bugzilla --
> http://bugs.freedesktop.org/attachment.cgi?id=26567,
> http://bugs.freedesktop.org/attachment.cgi?id=26568,
> http://bugs.freedesktop.org/attachment.cgi?id=26569. Without those, xrandr only
> shows me my display's native resolution as an "option".
> 
> Sorry if my report was vague. If there's any more formal procedure I should be
> following, I'd appreciate a pointer. (I'm not used to debugging kernel or
> driver bugs)

So this bug is just about trying to use your existing userland with KMS disabled?  Does it work if you also boot with 'nopat' on the command line?
Comment 9 Mike Kelly 2009-07-09 10:54:09 UTC
(In reply to comment #8)
> So this bug is just about trying to use your existing userland with KMS
> disabled?  Does it work if you also boot with 'nopat' on the command line?

No. The mention of KMS disabled was just part of my attempt to provide details. On other, similar, bugs, I've seen people mention "this works fine with KMS disabled". When I attempted to either confirm or deny that this was the case for my specific bug, I ran into other issues. So, I just meant to explain the lack of that information, not describe it as part of my actual "problem".

> I think the last 2.8-rc had the fix as well, but yeah git is best.

When I get home tonight I'll attempt to reproduce this with 2.7.99.901-55-g40e7c95.

Again, apologies for the confusion with my bug description -- guess that's what I get for filing a bug at midnight...
Comment 10 Mike Kelly 2009-07-09 19:51:59 UTC
(In reply to comment #9)
> When I get home tonight I'll attempt to reproduce this with
> 2.7.99.901-55-g40e7c95.

Yep, can reproduce this still.

Basic procedure:

1. Start dosbox.
2. Press Alt-Enter
3. Look at how part of my image is cropped (the bottom and right).

If I boot my kernel w/o KMS (by passing "i915.modeset=0 nopat" instead of "i915.modeset=1"), then dosbox mode changes work fine.

It should look like this:

  http://test.pioto.org/xcom-ideal-image.jpeg

But, it ends up looking like this:

  http://test.pioto.org/kms-dosbox-fail.jpeg

Setting the "scaling mode" doesn't seem to help matters.
Comment 11 Jesse Barnes 2009-07-10 09:43:27 UTC
Ooh, XCom.  Classic.

Can you adjust the panel fitting mode and have things work?  e.g. xrandr --output LVDS --set PANEL_FITTING full_aspect

Comment 12 Mike Kelly 2009-07-10 18:08:02 UTC
(In reply to comment #11)
> Can you adjust the panel fitting mode and have things work?  e.g. xrandr
> --output LVDS --set PANEL_FITTING full_aspect

As I said:

> Setting the "scaling mode" doesn't seem to help matters.

In KMS mode, I don't have a PANEL_FITTING option. Doing:

  $ xrandr --output LVDS1 --set "scaling mode" Aspect

Doesn't help.
Comment 13 Jesse Barnes 2009-07-11 08:33:13 UTC
Ah ok, sorry I missed that.  There have been changes to the LFP mode setting code in the kernel recently, but you filed your report before they landed (I think)...  I'll look through the changelogs and see if I can find anything.  In the meantime can you capture register dumps using intel_reg_dumper of the working and broken cases?
Comment 14 Mike Kelly 2009-07-11 08:55:33 UTC
Created attachment 27588 [details]
reg dump in kms mode (where things don't work right)
Comment 15 Mike Kelly 2009-07-11 09:04:41 UTC
Created attachment 27589 [details]
reg dump in ums mode (where things do work)
Comment 16 Mike Kelly 2009-08-23 19:25:07 UTC
Seems to work for me now, on linux 2.6.31-rc6-00223-g6c30c53, xf86-video-intel 2.8.0-35-g5dccd1b.

Well. It works as in my image is properly scaled for XCOM and such. However, afterwords, I still see this when I run xrandr:

$ xrandr
xrandr: output LVDS1 cannot use rotation "normal" reflection "none"

And this still fixes it.

$ xrandr --output LVDS1 --reflect normal --rotate normal

Granted, I reinstalled my system between the last time I checked and now, so there could be something else that I changed to fix this.

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.