You are not logged in.

#1 2008-03-31 03:09:57

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

[Sony Vaio TZ] Xorg mapping wrong resolution

I recently bought a Sony Vaio TZ - awesome piece of equipment cool - but noticed my actual Xorg resolution was higher than what the specs said (by 2 pixels). This is kinda annoying...

Xrandr output before I use xrandr to set the correct resolution:

[root@hermes stijn]# xrandr 
Screen 0: minimum 1024 x 768, current 1368 x 768, maximum 1368 x 768
default connected 1368x768+0+0 (normal left inverted right) 0mm x 0mm
   1366x768       60.0  
   1360x768       60.0  
   1024x768       60.0  
   1368x768       60.0*

As you can see it says it detects 1368x768 as maximum resolution but lists the correct resolution (1366x768) as a possibility too.  My first reaction was to generate a modeline that would make Xorg behave, but that does not have the desired effect (it returns a 1368x768 line!):

[root@hermes stijn]# gtf 1366 768 60

  # 1368x766 @ 60.00 Hz (GTF) hsync: 47.58 kHz; pclk: 85.64 MHz
  Modeline "1368x766_60.00"  85.64  1368 1440 1584 1800  766 767 770 793  -HSync +Vsync

I have tried setting a Modes line in xorg.conf like this:

Modes "1366x768"

but that gives me the following message in Xorg's log:

(II) I810(0): Not using mode "1366x768" (no mode of this name)

Adding a 'Virtual' line with the correct dimensions like this:

Virtual 1366 768

doesn't do the trick either.

Grepping Xorg's log for both X sizes returns the following:

[root@hermes stijn]# egrep "1366|1368" /var/log/Xorg.0.log
(II) I810(0): Display Info: LFP (local flat panel): attached: TRUE, present: TRUE, size: (1366,768)
(II) I810(0): Size of device LFP (local flat panel) is 1366 x 768
(II) I810(0): Lowest common panel size for pipe B is 1366 x 768
(II) I810(0): PanelID returned panel resolution : 1366x768
Mode: 60 (1366x768)
        XResolution: 1366
Mode: 61 (1366x768)
        XResolution: 1366
*Mode: 62 (1366x768)
        XResolution: 1366
(II) I810(0): Not using mode "1366x768" (no mode of this name)
(II) I810(0): Correcting stride (1368 -> 5504)
(**) I810(0): Virtual size is 1368x768 (pitch 2048)
(II) I810(0): [drm] init sarea width,height = 1368 x 768 (pitch 2048)

Why the heck does the i810 map to this resolution? Xorg recognises the 1366x766 correctly no? Is there a way to make Xorg use 1366x766 without having to resort to xrandr? For what it's worth, I had this issue also with the vesa driver.

Last edited by B (2008-03-31 03:20:54)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#2 2008-03-31 22:21:35

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

Bump big_smile

No Xorg wizards? roll


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2008-04-05 21:51:01

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

Okay then...

I patched the xf86-video-intel driver, which finally detects 1366x768 automatically (wanted to do 1024x768 only before). So I can ditch the i810 driver, have my native resolution without xrandr, and finally use xrandr so I can use external monitors without having to restart X.

Today was a good day cool.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#4 2008-04-06 17:17:54

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

Could you post the patch here and say what you did? I'm having the same issue though I can't get past 1064x600.

Offline

#5 2008-04-06 20:06:38

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

I googled for the sony vaio tz and its resolution in linux, and in the installation guides i found that xorg should automatically find and set the correct resolution.. maybe it didnt work for you since you were using a xorg.conf file instead of the autoconfigured settings.

Or maybe it was some ubuntu configuration that made it work for them.. im not sure..


The ultimate Archlinux release name: "I am your father"

Offline

#6 2008-04-06 20:23:34

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

Well after removing the settings in xorg it works.

Offline

#7 2008-04-07 22:09:17

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

jinn wrote:

I googled for the sony vaio tz and its resolution in linux, and in the installation guides i found that xorg should automatically find and set the correct resolution.. maybe it didnt work for you since you were using a xorg.conf file instead of the autoconfigured settings.

Or maybe it was some ubuntu configuration that made it work for them.. im not sure..

Xorg would autodetect it stubbornly at 1368x768, so that's 2 pixels too wide wink. Of course I initially tried without Xorg config, hoping it would all do it well, but even with telling X to use the correct resolution in its config it wouldn't listen. And yes, I've seen Ubuntu users that had it working out of the box, but I don't run Ubuntu for a reason tongue. Other than that, I pretty much do need a config since not everyone uses the standard en-US keyboard layout and stuff wink.

Here is the patch:

commit ae56eda40dd9289e1b3922ebc300f6fda8fe2072
Author: Eric Anholt <eric@anholt.net>
Date:   Thu Aug 9 14:47:14 2007 -0700

    i830_lvds.c: Use the BIOS mode instead of the probed one.

diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 18e5c2b..e4fca8b 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -584,13 +584,14 @@ i830_lvds_init(ScrnInfoPtr pScrn)
         {
         xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
                "BIOS panel mode data doesn't match probed data, "
-               "continuing with probed.\n");
+               "continuing with BIOS.\n");
         xf86DrvMsg(pScrn->scrnIndex, X_INFO, "BIOS mode:\n");
         xf86PrintModeline(pScrn->scrnIndex, bios_mode);
         xf86DrvMsg(pScrn->scrnIndex, X_INFO, "probed mode:\n");
         xf86PrintModeline(pScrn->scrnIndex, dev_priv->panel_fixed_mode);
-        xfree(bios_mode->name);
-        xfree(bios_mode);
+        xfree(dev_priv->panel_fixed_mode->name);
+        xfree(dev_priv->panel_fixed_mode);
+        dev_priv->panel_fixed_mode = bios_mode;
         }
     }  else {
         dev_priv->panel_fixed_mode = bios_mode;

Happy to see there are not only Ubuntu users running the Vaio TZ tongue (nofi, but since Ubuntu does most out of the box, success reports are of little or no use to people doing it themselves). I am currently in the process of putting together a minimal kernel (with support for all the presently supported hardware in the laptop of course) and I could use some help with the HD part, but I'll open another topic for that (my HD gets reset to UDMA33 and it seems you need a patch to fix that obnoxious behaviour too tongue).

Last edited by B (2008-04-07 22:11:29)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#8 2008-04-07 22:12:12

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

If you need any help, I'm here. I've had 3 vaios and get most to work 95% or so. Right now I'm having a few problems with suspend  (pm-suspend --quirk-s3-bios --quirk-s3-mode gets it correct but I need that for default), I got all the fn keys to work minus the wireless and scroll lock. Fingerprint scanner on Sony is always a no go. Webcam has me lost.

EDIT - I'll start help with your touchpad thread.

Last edited by Reasons (2008-04-07 22:14:25)

Offline

#9 2008-04-07 23:49:07

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

Thanks smile. Let me know how you implemented the Fn keys, I did it partially through ACPI & xmodmap but I understood it should be possible through HAL too. The quirks should go in the pm-utils configuration dir, This is how I did it on my old HP 6510b (wiki entry was started by me).

Last edited by B (2008-04-07 23:50:33)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#10 2008-04-08 02:43:58

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

I used acpi scripts for the FN keys. I can post all the scripts if you want them? I didn't need xmodmap at all.

Offline

#11 2008-04-08 06:43:02

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

Sure, would be nice smile. Thanks.

I used xmodmap since not all buttons report ACPI actions (well that is, the metallic multimedia keys on the front side of the chassis). Do you have those working?


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#12 2008-04-08 15:09:19

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

B wrote:

Sure, would be nice smile. Thanks.

I used xmodmap since not all buttons report ACPI actions (well that is, the metallic multimedia keys on the front side of the chassis). Do you have those working?

Xev reports those so I choose xbindkeys for those. For the fn, the all can technically mapped (so you'll have more than windows wink). Try acpi_listen when you use then. I'll give you SPIC outputs. For brightness I put this in /etc/acpi/events/sonybright-up

# /etc/acpi/events/sony-brightness-up

event=sony/hotkey SPIC 00000001 00000011
action=/etc/acpi/actions/sonybright.sh up

Down

# /etc/acpi/events/sony-brightness-down

event=sony/hotkey SPIC 00000001 00000010
action=/etc/acpi/actions/sonybright.sh down

/etc/acpi/actions/sonybright.sh

#!/bin/bash

BRIGHTNESS=$(cat /sys/class/backlight/sony/actual_brightness)

if [ "$BRIGHTNESS" -gt 8 ]; then
    BRIGHTNESS=1
fi

if [ "x$1" = "xdown" ]; then
   if [ "x$BRIGHTNESS" != "x1" ]; then
      BRIGHTNESS=$(( $BRIGHTNESS - 1 ))
      echo $BRIGHTNESS > /sys/class/backlight/sony/brightness
   else
      [ -x /usr/bin/spicctrl ] && /usr/bin/spicctrl -b 0   
   fi
   # Recent nvidia Sonys have ACPI methods that do nothing. Thanks, Sony.
   [ -x /usr/bin/smartdimmer ] && smartdimmer -d 2>/dev/null
elif [ "x$1" = "xup" ]; then
   if [ "x$BRIGHTNESS" != "x8" ]; then
      BRIGHTNESS=$(( $BRIGHTNESS + 1 ))
      echo $BRIGHTNESS > /sys/class/backlight/sony/brightness
   fi
   [ -x /usr/bin/smartdimmer ] && smartdimmer -i 2>/dev/null
else
   echo >&2 Unknown argument $1
fi

The last script might be reduntant as it was for my sz which had two cards. You can also use the SPICs to map the eject key on the bottom right as the actual eject key on the tray is so hard to find. wink

Offline

#13 2008-04-08 20:10:54

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

Ok. I went with xmodmap because xbindkeys basically does the same, only requiring you to install an extra package tongue.

I mapped the eject button to eject too (surprisingly, as I didn't know at first the slim drive had a button, I thought the whole thing was pressure sensitive...). I mapped the AV button to a fullscreen instance of VLC smile.

I fixed all Fn keys except for the zoom key (don't know how to map that to e.g. Opera's zoom functionality yet) and the external VGA connector which I should still write a script for.

Anyways, here's my handler.sh patch:

--- handler.sh.old      2008-04-04 22:59:23.000000000 +0200
+++ handler.sh  2008-04-04 22:59:12.000000000 +0200
@@ -7,6 +7,7 @@
 minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
 maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
 setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
+presbright=`cat /sys/class/backlight/sony/brightness`
 
 set $*
 
@@ -18,29 +19,34 @@
                        *)    logger "ACPI action undefined: $2" ;;
                esac
                ;;
+
        button/sleep)
                case "$2" in
                        SLPB) echo -n mem >/sys/power/state ;;
                        *)    logger "ACPI action undefined: $2" ;;
                esac
                ;;
+
        ac_adapter)
                case "$2" in
-                       AC)
+                       ACAD)
                                case "$4" in
                                        00000000)
                                                echo -n $minspeed >$setspeed
                         #/etc/laptop-mode/laptop-mode start
+                        echo 2 > /sys/class/backlight/sony/brightness
                     ;;
                     00000001)
                         echo -n $maxspeed >$setspeed
                         #/etc/laptop-mode/laptop-mode stop
+                        echo 6 > /sys/class/backlight/sony/brightness
                     ;;
                 esac
                 ;;
             *) logger "ACPI action undefined: $2" ;;
         esac
         ;;
+        
     battery)
         case "$2" in
             BAT0)
@@ -60,6 +66,32 @@
     button/lid)
         #echo "LID switched!">/dev/tty5
         ;;
+        
+    sony/hotkey)
+        case "$2" in
+            SPIC)
+                case "$4" in
+                    0000000c)
+                        [ -e /var/run/daemons/bluetooth ] && /etc/rc.d/bluetooth stop || /etc/rc.d/bluetooth start
+                    ;;
+                    00000010)
+                        echo $(( ${presbright}-1 )) > /sys/class/backlight/sony/brightness
+                    ;;
+                    00000011)
+                        echo $(( ${presbright}+1 )) > /sys/class/backlight/sony/brightness
+                    ;;
+                    00000017)
+                        /usr/sbin/pm-suspend
+                    ;;
+                    0000001b)
+                        eject -r 
+                    ;;
+                esac
+                ;;
+            *) logger "ACPI action undefined: $2" ;;
+        esac
+        ;;
+        
     *)
         logger "ACPI group/action undefined: $1 / $2"

;;

Xmodmap gives names to the Fn volume keys and the multimedia keys, and they are bound to the related actions through my Openbox rc.xml.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#14 2008-04-08 20:50:29

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

I don't want to sound noobish here, but how would I patch a file?

Offline

#15 2008-04-08 21:29:56

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

With patch... It would probably just replicate functionality you already have though (although this patch doesn't need any external scripts which, imho, is a big plus).

Just out of curiosity: where did you get your present tweaks?


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#16 2008-04-08 21:45:23

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Re: [Sony Vaio TZ] Xorg mapping wrong resolution

I don't really remember. It was a while ago. I made most of the scripts myself, just not the brightness one.

Offline

Board footer

Powered by FluxBB