DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 23rd March 2024
gustaf gustaf is offline
Fdisk Soldier
 
Join Date: Dec 2016
Posts: 69
Default xrandr(1) scaling problems with external monitor

After a hiatus of several years, I recently returned to OpenBSD with a clean install onto my Lenovo Thinkpad X220t laptop, upgraded to a -current snapshot, then carefully restored all my files from backup (including customized configuration files in /etc). Along the way, something happened to X. When I attach an external monitor to the laptop, the fonts in the window title bars, jwm task bar and menu, xterm windows, and some other applications are HUGE. It doesn't matter if the laptop monitor is on (splitting the screen between the LVDS laptop and external VGA monitors) or off (giving me a single external monitor screen).

I tried switching to a different window manager; the problem persisted. I installed an identical system onto an old Compaq Presario. Same X display issues, so it's probably not the hardware. I checked for missing files and didn't find anything obvious.

Tweaking /etc/X11/xenodm/Xsetup_0 didn't help and I couldn't find anything in xrandr(1) that looked useful. Searching these forums and the OpenBSD misc mailing list didn't shed any more light on the problem.

A second upgrade to the most recent snapshot didn't make any difference.

I last used this same configuration (Lenovo Thinkpad, LG flatscreen monitor, and /etc/X11/xenodm/Xsetup_0 script) with OpenBSD 6.8 -current. Before I acquired a flatscreen, I was using a Viewsonic CRT. The monitor output was always properly scaled. As far as I can tell, the only difference is the upgrade from 6.8 -current to 7.4/7.5 -current.

I have attached some screenshots, and posted my /etc/X11/xenodm/Xsetup_0 script, the relevant lines of dmesg(8), and the entire /var/log/xenodm.log below. The external monitor (VGA) screenshots should look like the laptop-only (LVDS) screenshots scaled to fit properly on the larger screen. The text output is from the external VGA monitor with the laptop screen turned off.

The output of /var/log/Xorg.0.log and $ xrandr -q --verbose is massive. I can post this info, if it's helpful.

Any advice, suggestions, or ideas would be gratefully accepted.

=============================================

/etc/X11/xenodm/Xsetup_0:
Code:
#!/bin/sh
# $OpenBSD: Xsetup_0,v 1.6 2019/06/29 13:33:06 espie Exp
# Modified by gustaf, 2023/10/03 

xprefix=/usr/X11R6/bin

## "${xprefix}/xconsole" -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail

# Set root window color for login screen
"${xprefix}/xsetroot" -solid sienna

if [ "$DISPLAY" = ":0" -o "$DISPLAY" = ":0.0" ]
then

  # If external monitor is attached to laptop
  if xrandr | grep 'VGA-1' > /dev/null
  then

    # fix output to VGA CRT external monitor (leftover code from old CRT)
    ## xrandr --output VGA-1 --same-as LVDS-1

    # turn off laptop monitor
    xrandr --output LVDS-1 --off
  fi
fi

Code:
$ dmesg

OpenBSD 7.5 (GENERIC.MP) #78: Sun Mar 17 21:55:24 MDT 2024
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 12746092544 (12155MB)
avail mem = 12338692096 (11767MB)
random: good seed from bootblocks
...
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xdae9c000 (67 entries)
bios0: vendor LENOVO version "8DET58WW (1.28 )" date 02/14/2012
bios0: LENOVO 4299HB4
acpi0 at bios0: ACPI 4.0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SLIC SSDT SSDT SSDT HPET APIC MCFG ECDT ASF! TCPA SSDT S
SDT UEFI UEFI UEFI
acpi0: wakeup devices LID_(S3) SLPB(S3) IGBE(S4) EXP4(S4) EXP7(S4) EHC1(S3) EHC2
(S3) HDEF(S4)
...
"PNP0C14" at acpi0 not configured
"PNP0C14" at acpi0 not configured
...
acpivideo0 at acpi0: VID_
acpivout0 at acpivideo0: LCD0
acpivideo1 at acpi0: VID_
pci0 at mainbus0 bus 0
...
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics 3000" rev 0x09
drm0 at inteldrm0
inteldrm0: msi, SANDYBRIDGE, gen 6
"Intel 6 Series MEI" rev 0x04 at pci0 dev 22 function 0 not configured
...
inteldrm0: 1366x768, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation), using wskbd0
wskbd1: connecting to wsdisplay0
wsdisplay0: screen 1-5 added (std, vt100 emulation)

/var/log/xenodm.log:
Code:
xenodm info (pid 51523): Starting
xenodm info (pid 51523): Starting X server on :0

X.Org X Server 1.21.1.11
X Protocol Version 11, Revision 0
Current Operating System: OpenBSD thinkpadX220t..home.arpa 7.5 GENERIC.MP#78 amd64
 
Current version of pixman: 0.42.2
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Wed Mar 20 17:17:52 2024
(==) Using system config directory "/usr/X11R6/share/X11/xorg.conf.d"
Failed to create /var/empty/.cache for shader cache (Permission denied)---disabling.
WARNING: Kernel has no file descriptor comparison support: No such file or directory
Failed to create /var/empty/.cache for shader cache (Permission denied)---disabling.
xenodm info (pid 27911): consolePath: ttyC4
xenodm info (pid 27911): sourcing /etc/X11/xenodm/Xsetup_0
xenodm info (pid 27911): sourcing /etc/X11/xenodm/GiveConsole
xenodm info (pid 94312): executing session /etc/X11/xenodm/Xsession
(II) AIGLX: Suspending AIGLX clients for VT switch
[dix] couldn't enable device 8
[dix] couldn't enable device 9
[dix] couldn't enable device 10
[dix] couldn't enable device 11
(II) AIGLX: Suspending AIGLX clients for VT switch
Attached Images
File Type: png LVDS-jwm-menu.png (39.3 KB, 7 views)
File Type: png VGA-jwm-menu.png (55.5 KB, 7 views)
File Type: png LVDS-xterm.png (54.6 KB, 8 views)
File Type: png VGA-xterm.png (74.9 KB, 5 views)
Reply With Quote
  #2   (View Single Post)  
Old 23rd March 2024
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,985
Default

Before getting too deep in the weeds, I recommend trying with a clean installation, that doesn't have all of your historical adaptations applied. As one example, your Xsetup_0 and one from a recent snapshot have vast differences. If that doesn't work, then posting your xorg.0.log would be helpful.
Code:
--- Xsetup_0_snapshot    Wed Mar 20 18:13:03 2024
+++ Xsetup_0_gustaf    Sat Mar 23 08:59:59 2024
@@ -1,19 +1,25 @@
 #!/bin/sh
-# $OpenBSD: Xsetup_0.in,v 1.1 2021/08/30 15:38:27 matthieu Exp $
+# $OpenBSD: Xsetup_0,v 1.6 2019/06/29 13:33:06 espie Exp
+# Modified by gustaf, 2023/10/03 
 
-prefix="/usr/X11R6"
-exec_prefix="${prefix}"
+xprefix=/usr/X11R6/bin
 
-${exec_prefix}/bin/xsetroot -fg \#6f6f6f -bg \#bfbfbf -bitmap ${prefix}/include/X11/bitmaps/root_weave
+## "${xprefix}/xconsole" -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail
 
-${exec_prefix}/bin/xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail
+# Set root window color for login screen
+"${xprefix}/xsetroot" -solid sienna
 
-#  install package openbsd-backgrounds
-#  then uncomment:
-#
-# if test -x /usr/local/bin/openbsd-wallpaper
-# then
-#     /usr/local/bin/openbsd-wallpaper
-# fi
+if [ "$DISPLAY" = ":0" -o "$DISPLAY" = ":0.0" ]
+then
 
-# sxpm OpenBSD.xpm &
+  # If external monitor is attached to laptop
+  if xrandr | grep 'VGA-1' > /dev/null
+  then
+
+    # fix output to VGA CRT external monitor (leftover code from old CRT)
+    ## xrandr --output VGA-1 --same-as LVDS-1
+
+    # turn off laptop monitor
+    xrandr --output LVDS-1 --off
+  fi
+fi
Reply With Quote
  #3   (View Single Post)  
Old 23rd March 2024
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bitchy Nerd Elitist
 
Join Date: Dec 2015
Location: London
Posts: 467
Default

Also check the DPI on each screen: https://wiki.archlinux.org/title/Xor...y_size_and_DPI
__________________
Are you infected with Wetiko?
Reply With Quote
  #4   (View Single Post)  
Old 3 Weeks Ago
thinman thinman is offline
New User
 
Join Date: Jul 2019
Posts: 3
Default

I had a problem with QT apps displaying at the wrong resolution and found this. It might apply to your monitor issue, as well: https://marc.info/?l=openbsd-tech&m=163674121630769&w=2
Reply With Quote
  #5   (View Single Post)  
Old 3 Weeks Ago
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bitchy Nerd Elitist
 
Join Date: Dec 2015
Location: London
Posts: 467
Default

That change was reverted after it broke everybody's setups.
__________________
Are you infected with Wetiko?
Reply With Quote
  #6   (View Single Post)  
Old 3 Weeks Ago
thinman thinman is offline
New User
 
Join Date: Jul 2019
Posts: 3
Default

I see. I still require the fix described there on 7.4 to make my QT apps (Nextcloud and Keepassxc) display at the right resolution so I thought I'd chuck it out there. I'm new to OpenBSD so I'm definitely no expert. :^)
Reply With Quote
  #7   (View Single Post)  
Old 1 Week Ago
gustaf gustaf is offline
Fdisk Soldier
 
Join Date: Dec 2016
Posts: 69
Default

Adding the following lines to /etc/X11/xenodm/Xsetup_0 solved the problem:
Code:
# Workaround to correct display resolution
## xrandr --dpi 96  # Recommended setting
xrandr --dpi 115  # Usable setting
96 dpi was too small. For some unknown reason, I had to bump the setting to 115 dpi to get everything to look right.

Thanks to everyone who provided suggestions. They were all helpful in working toward a solution.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NetBSD 9.3 External Monitor Panic jmccue NetBSD General 3 25th March 2023 05:14 PM
Does Xorg use xrandr to set the screen resolution? Prevet OpenBSD General 6 8th June 2018 04:07 PM
Powerbook G4 12" external monitor Lastic OpenBSD General 1 16th April 2016 04:25 PM
In which config file in $HOME I could set xrandr ? NaWi OpenBSD General 3 20th October 2015 05:11 PM
NetBSD 6.0 xrandr gpatrick NetBSD General 2 24th December 2012 02:17 PM


All times are GMT. The time now is 03:40 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick