Intel i915 driver wrong resolution

Hi Forum,
I need advice on how to get the i915 driver to display a 1920x1080 resolution on a View Sonic VX2270Smh-LED screen.
I am on a fanless Shuttle PC with integrated intel graphics and OS Opensuse 13.1 -64 with KDE 4.11.5.
The monitor is connected with VGA and the PC has no other monitor outputs.
The KDE screen control module only offers 1024x768, 848x480, 800x600 and 640x480 as available resolutions

I wonder if it is possible to manually edit the entries in etc/X11/xorg.conf.d to force the right resolution, but i am rather afraid to do this, since my last attempt just gave me a black screen and no way to get back to the old (but wrong) situation.
All the entries in etc/X11/xorg.conf.d are generic, so the monitor has not been recognized.

CODE:


lspci -nnk | grep VGA -A2

 00:02.0 VGA compatible controller [0300]: Intel Corporation Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller [8086:a001] (rev 02)
         Subsystem: Intel Corporation Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller [8086:a001]
         Kernel driver in use: i915

I hope someone has made this work or have an idea on what I can do to test and make it work.

Rgds Tarp

HiHo.

It’s been a while since I had to do this but you could try (this won’t create anything permanent, it’s just a test) do this, in X open a terminal and type these in;

First let’s generate you something sensible, a 60Hz 1920x1080 resolution;
cvt 1920 1080

xrandr --newmode “1920x1080_60.00” <insert the result of previous command here>
xrandr --addmode VGA-0 1920x1080_60.00

And finally we’re going to test it:
xrandr --output VGA-0 --mode 1920x1080_60.00

You may need to adjust VGA-0 to suit your xrandr output since the device may vary, although I think in this case it’ll be VGA-0.

Does that give you a better resolution or does it blow up mysteriously or black screen? Note, this will not save anything so on a reboot it’ll return to normal.

Yes, it is.
Add a custom modeline to the monitor.conf, see also here:
https://en.opensuse.org/SDB:Configuring_graphics_cards_and_monitor_settings

First of all I would rather have a look why the correct resolution is not detected though.
Please post the file /var/log/Xorg.0.log .

All the entries in etc/X11/xorg.conf.d are generic, so the monitor has not been recognized.

Wrong.
Those entries are always generic. The recognized monitor is not stored there.
X automatically detects the monitor on startup, dynamically.

Wow - Thanks for very quick responses!

@Miuku
I am not sure which part of the “cvt” command output I should paste into the

xrandr --newmode “1920x1080_60.00” <insert the result of previous command here>

command. I get errors saying some characters are not recognized
I get this result from the cvt command:

1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz

Modeline “1920x1080_60.00” 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync

@wolfi323
the /var/log/Xorg.0.log:

https://dl.dropboxusercontent.com/u/2434539/Xorg.0.log

I was thinking of composing a 50-monitor.conf like this (out of the cvt command result):

Section “Monitor”
Identifier “Monitor1”

VendorName “unknown”
ModelName “ViewSonic VX2270Smh”
HorizSync 28-85
VertRefresh 50-100

Modeline “1920x1080_60.00” 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync

EndSection

but I am too chicken to try it out, since I do not know how to restore the generic file…I am not a pro.

Hm. There is not even any detected monitor/EDID mentioned in there.
Is the monitor connected directly or via a KVM?

Sometimes if something goes wrong with the detection, it can help to completely unplug/unpower the monitor.

but I am too chicken to try it out, since I do not know how to restore the generic file…I am not a pro.

You do not need the generic file, it is only a template and only contains comments.
So you might just as well delete it to get back the defaults…
OTOH, if you append your lines to the end, you should be able to easily remove them again. (as I said, the original content is just comments, no need to remove anything there)

And, you don’t have to even change 50-monitor.conf.
Use a different file name, e.g. 50-mymonitor.conf, then you can just delete it if it causes problems.
The file names in /etc/X11/xorg.conf.d/ don’t really matter at all, all of them are read in in alphabetical order.

You would have to take the part marked in red, see also the bottom of the page I linked to.
So this should work:

xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync

Then run this to test it:


xrandr --addmode VGA-0 "1920x1080"

xrandr --output VGA-0 --mode "1920x1080"


(you may have to change “VGA-0” accordingly, run “xrandr” with no parameters to see all available outputs)

It might be a good idea to try out the modeline with xrandr, before you add it to the config files anyway.
This way you don’t really risk anything.
If it works, add it to the config.

Sorry I was not clear enough on what to copy paste - thankfully Wolfi was here to save the day :slight_smile:

Thanks a lot!

I tried the commands in this order as root.

CODE
|xrandr --newmode “1920x1080_60.00” 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
|
xrandr --addmode VGA1 “1920x1080”
xrandr --output VGA1 --mode “1920x1080”

|

(VGA-0 modified to VGA1 according to xrandr output), but the box complaints:

“xrandr: cannot find mode 1920x1080”

So I am lost… :wink:

PS: Sorry I can not figure out how to quote code in boxes

and by the way - the monitor is connected directly to the SVGA port at the Shuttle PC.

If you name it “1920x1080_60.00”, you also need to use that in the other commands between the quotes. The newmode is like “Hey, this is what I want to name my cool new resolution!”

Like
xrandr --addmode VGA1 “1920x1080_60.00”
xrandr --output VGA1 --mode “1920x1080_60.00”

Hurrah! It works now!rotfl!
Now I need to make the changes persistent.I tried to add the lines to the xinitrc script as suggested here: https://forums.opensuse.org/showthread.php/477883-Making-xrandr-settings-permanent
but without success.
But thanks anyway - now I can at least run the commands manually after login.
Tarp

Try to put the xrandr lines (all three) into a file called .xinitrc (notice the ‘.’) in your user’s home directory.

Btw, you need to run xrandr as (the currently logged in) user, not root. Unless you are logged in as root of course, but that’s not necessary for testing this and shouldn’t really be done… :wink:

Or add it to the Xorg configuration (via a “ModeLine” statement in 50-monitor.conf) like already described.

As Wolfi said, it’s a good idea to make the adjustments to the 50-monitor.conf.

Also this is only an issue because you are using VGA, if this was DVI the auto-detection etc. would work great :frowning:

Well, normally the auto-detection should work great on VGA as well. It does on all my systems.

But some monitors don’t support it, a broken/not completely wired cable can cause this, or e.g. a KVM switch that doesn’t correctly pass through the EDID information or even replaces it with its own.

Hello again,

I am unfortunately not done yet.
I have tried 3 different solutions:

  1. Putting the parameters in the ModeLine in the 50-monitor.conf file. This causes the Xserver to fail completely.
  2. Creating a specific .xinitrc file with the xrandr lines that works in my home directory. No changes in resolution.
  3. Adding the lines in the xinitrc script at /etc/X11/xinit directory like this:

CODE:
|#!/bin/bash
|

Sample .xinitrc for SuSE Linux

This script is called from ‘startx’ when you start an X session

In case everything goes wrong, we at least fall back to a plain xterm

failsafe=“xterm -ls -T Failsafe -geometry 80x24-0-0”
trap “exec $failsafe” EXIT SIGHUP SIGINT SIGPIPE SIGTERM SIGIO

Some bash (1 and 2) settings to avoid trouble on a

failed program call.

set +e > /dev/null 2>&1
set +u > /dev/null 2>&1
set +o posix > /dev/null 2>&1
if type shopt > /dev/null 2>&1 ; then
shopt -s execfail
else
no_exit_on_failed_exec=1
fi

Source common code shared between the

X session and X init scripts

. /etc/X11/xinit/xinitrc.common

Special for twm

case “$WINDOWMANAGER” in
*twm) xsetroot -solid darkslateblue
esac

Uncomment next lines to activate asking for ssh passphrase

if test -S “$SSH_AUTH_SOCK” -a -x “$SSH_ASKPASS”; then

ssh-add < /dev/null

fi

xrandr --newmode “1920x1080_60.00” 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VGA1 “1920x1080_60.00”
xrandr --output VGA1 --mode “1920x1080_60.00”

day planer deamon

pland &

finally start the window manager

unset WINDOW_MANAGER STARTUP
exec $WINDOWMANAGER ${1+"$@"}

call failsafe

exit 0
|

but i will not work as normal user. As root I had a short glipse of the right resolution, before the Xserver was falling back to a very low resolution.
So I am close - but still not quite there…

One idea was to make a startup script that simply runs the xrandr commands at the right time. But I am not sure where to put it.

Well now it works with adding the lines in the xinitrc script at /etc/X11/xinit directory!
So fine and beautiful OpenSuse!
Thanks for helping me!

Then you did something wrong.
What exactly did you put in there?
You need to uncomment/add the “Section “Monitor””, “Identifier “Default Monitor”” (or whatever) and “EndSection” as well of course.
And just to be sure: you need to put the whole output of “cvt” in there, between “Section “Monitor”” and “EndSection”.
Something like this:

Section "Monitor"
  Identifier "Default Monitor"
  ## If your monitor doesn't support DDC you may override the
  ## defaults here
  #HorizSync 28-85
  #VertRefresh 50-100

  ## Add your mode lines here, use e.g the cvt tool
  # 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
  Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
EndSection

(I left in the original comments from this file. Those, i.e. the lines starting with ‘#’ are not necessary and can be omitted)

Some notes:

  • In my experience you need a corresponding 50-screen.conf (or 50-myscreen.conf or whatever :wink: ) as well that references that Monitor section. I.e. with the above 50-monitor.conf, this should work

Section "Screen"
  Identifier "Default Screen"

  Device "Default Device"

  ## Doesn't help for radeon/radeonhd drivers; use magic in
  ## 50-device.conf instead
  Monitor "Default Monitor"

EndSection

(which is the default one with all lines uncommented)
Not doing this will not make Xorg failing to start though. Your resolution will just not be added.

  • This will only add a new mode. You still will have to select it in KDE’s settings then. I’m not sure whether it will be the default for a new user, a “PreferredMode” option might help.

  • The new mode will show up as “1920x1080_60.00” in the settings and in xrandr’s output. Personally I would prefer to omit the “_60.00”. The part in the quotes is just a name anyway, so you could theoretically change it to anything you like I think.

  1. Creating a specific .xinitrc file with the xrandr lines that works in my home directory. No changes in resolution.

Did you mark the file as “executable”?
Btw, there should be a file “.xinitrc.template” in your home directory.
You could rename/copy that to ~/.xinitrc as a starting point.

  1. Adding the lines in the xinitrc script at /etc/X11/xinit directory like this:

You shouldn’t change this file.
Better create a new one in /etc/X11/xinitrc.d/. This way you can easily revert your changes by just deleting the file, and you can be sure that you don’t get problems when installing updates.

but i will not work as normal user. As root I had a short glipse of the right resolution, before the Xserver was falling back to a very low resolution.
So I am close - but still not quite there…

This might be caused by KScreen, i.e. KDE’s screen resolution settings.
Try to disable it in “Configure Desktop”->“Startup and Shutdown”->“Service Management”.

Or you should be able to select the higher resolution in “Configure Desktop”->Display and Monitor" now, this might help as well.

One idea was to make a startup script that simply runs the xrandr commands at the right time. But I am not sure where to put it.

When using KDE, you can just drop it into ~/.kde4/env/. Or use “Configure Desktop”->“Startup and Shutdown”->Autostart to tell KDE to run it during login.
Or create a .desktop file in ~/.config/autostart/ to call the script, this would apply to all (well, most at least) desktops.

You could of course even put it into /usr/share/kde4/env/ or /usr/share/autostart/ resp. for system-wide effect.

@Tarp**

FYI **
When posting you must click on the #hash tag icon while in the editor. So your code appears as:

xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync 
xrandr --addmode VGA1 "1920x1080" 
xrandr --output VGA1 --mode "1920x1080"

If you don’t see the hash tag code icon, click on the Go Advanced button.

@Romanator: Thanks - You can see below that I learn;)

@Wolfi323: Thanks - I will try to get the 50-monitor.conf solution to work, so that the changes stays persistent, thus making the file as follows (If I understand You right)

Section "Monitor"
 Identifier "Default Monitor"
 ModeLine "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
EndSection

and makin the 50-screen.conf identical.

The Modeline output from the cvt tool is as follows:

# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync

Am I getting it right?

Looks ok.
As I said, you may want to add this as well to make the new resolution the default:

PreferredMode "1920x1080_60.00"

I’m not sure whether this is necessary though.

It would look something like this then:

Section "Monitor"
 Identifier "Default Monitor"
 PreferredMode "1920x1080_60.00"
 ModeLine "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
EndSection

and makin the 50-screen.conf identical.

Identical to what? :wink:

It basically should look like this:

Section "Screen"
  Identifier "Default Screen"
  Device "Default Device"
  Monitor "Default Monitor"
EndSection

(you actually only have to remove the ‘#’ at the beginning of each line)