Bug 103013 - Qt rendering problems with Samsung SyncMaster P2470HD screen
Summary: Qt rendering problems with Samsung SyncMaster P2470HD screen
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Ext/RandR (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-27 17:31 UTC by Deposite Pirate
Modified: 2018-12-13 18:33 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Xfce start menu rendered wrong on the affected machine (4.98 KB, image/png)
2017-09-27 17:33 UTC, Deposite Pirate
no flags Details
Xfce start menu rendered right on one of my other machines (3.45 KB, image/png)
2017-09-27 17:34 UTC, Deposite Pirate
no flags Details
KeepassXC scaled wrong on the affected machine (22.51 KB, image/png)
2017-09-27 17:34 UTC, Deposite Pirate
no flags Details
KeepassXC scaled right on one of my other machines (23.92 KB, image/png)
2017-09-27 17:35 UTC, Deposite Pirate
no flags Details
qTox scaled wrong on the affected machine (36.58 KB, image/png)
2017-09-27 17:36 UTC, Deposite Pirate
no flags Details
Xorg log on the affected machine (111.51 KB, text/plain)
2017-09-28 11:12 UTC, Deposite Pirate
no flags Details
Xorg log of an unnaffected machine (53.26 KB, text/plain)
2017-09-28 11:13 UTC, Deposite Pirate
no flags Details
xrandr output on the affected machine (933 bytes, text/plain)
2017-09-28 11:13 UTC, Deposite Pirate
no flags Details
xrandr output on the same unaffected machine (948 bytes, text/plain)
2017-09-28 11:14 UTC, Deposite Pirate
no flags Details

Description Deposite Pirate 2017-09-27 17:31:24 UTC
I've had these rendering glitches (wrong rendering of the xfce start menu icon and wrong scaling of some Qt 5 apps, see attached screenshots) for years on an AMD Athlon 64 X2 + Radeon HD 6670 PC. I have two other newer AMD CPU+GPU PCs that don't have this problem. I have no special system wide config on any of my machines and I've tried a fresh config with another user account. So I'm thinking this must be a GPU rendering issue. On the affected system there is also a motherboard integrated radeon which I disabled in the BIOS.

The strange thing is that KeepassXC used to have this scaling problem, but it no longer has. The scaling problem never disappeared with qTox however.
Comment 1 Deposite Pirate 2017-09-27 17:33:03 UTC
Created attachment 134510 [details]
Xfce start menu rendered wrong on the affected machine
Comment 2 Deposite Pirate 2017-09-27 17:34:01 UTC
Created attachment 134511 [details]
Xfce start menu rendered right on one of my other machines
Comment 3 Deposite Pirate 2017-09-27 17:34:55 UTC
Created attachment 134512 [details]
KeepassXC scaled wrong on the affected machine
Comment 4 Deposite Pirate 2017-09-27 17:35:39 UTC
Created attachment 134513 [details]
KeepassXC scaled right on one of my other machines
Comment 5 Deposite Pirate 2017-09-27 17:36:11 UTC
Created attachment 134514 [details]
qTox scaled wrong on the affected machine
Comment 6 Olivier Fourdan 2017-09-28 06:27:16 UTC
I doubt this is a driver issue, have you tried adjusting the DPI setting in xfce settings tool?
Comment 7 Deposite Pirate 2017-09-28 07:10:10 UTC
Yes, I have. This is one of the first things I tried to fix the problem. But it makes no sense to me that this could be the problem as only qTox is affected now. KeepassXC used to be, but after a while it wasn't anymore, without me doing anything special.

I also thought some files might be corrupted. But I recently moved the arch linux install on the affected machine (all my machines are running up to date arch linux) to a new hard drive and the Qt, qTox and KeepassXC packages have all been upgraded a few times since so I'm pretty sure if somehow there were corrupted files they should all have been overwritten by now. I moved the install from a true hardware RAID-1 array that did not fail which makes it also pretty unlikely there were bad sectors or something anyway.
Comment 8 Deposite Pirate 2017-09-28 07:13:40 UTC
Yes, I have. This is one of the first things I tried to fix the problem. But it makes no sense to me that this could be the problem as only qTox is affected now. KeepassXC used to be, but after a while it wasn't anymore, without me doing anything special.

I also thought some files might be corrupted. But I recently moved the arch linux install on the affected machine (all my machines are running up to date arch linux) to a new hard drive and the Qt, qTox and KeepassXC packages have all been upgraded a few times since so I'm pretty sure if somehow there were corrupted files they should all have been overwritten by now. I moved the install from a true hardware RAID-1 array that did not fail which makes it also pretty unlikely there were bad sectors or something anyway.
Comment 9 Michel Dänzer 2017-09-28 10:34:39 UTC
Please attach the Xorg log file and the output of xrandr. At least from the affected machine, optionally also from an unaffected one.
Comment 10 Deposite Pirate 2017-09-28 11:12:36 UTC
Created attachment 134530 [details]
Xorg log on the affected machine
Comment 11 Deposite Pirate 2017-09-28 11:13:05 UTC
Created attachment 134531 [details]
Xorg log of an unnaffected machine
Comment 12 Deposite Pirate 2017-09-28 11:13:34 UTC
Created attachment 134532 [details]
xrandr output on the affected machine
Comment 13 Deposite Pirate 2017-09-28 11:14:09 UTC
Created attachment 134533 [details]
xrandr output on the same unaffected machine
Comment 14 Deposite Pirate 2017-09-28 11:34:54 UTC
I also tried to swap the system RAM modules in different slots on the motherboard in case there is something wrong with one of the RAM modules but that did not change anything. But maybe that does nothing anyway because of ASLR.
Comment 15 Olivier Fourdan 2017-09-28 14:02:27 UTC
attachment 134531 [details] (aka "unaffected machine")

[    25.049] (II) RADEON(0): Setting screen physical size to 869 x 285

attachment 134530 [details] (aka "affected machine")

[    29.662] (II) Quirked EDID physical size to 0x0 cm
                                                ^^^
That might affect DPI computation, no?
Comment 16 Michel Dänzer 2017-09-28 14:15:30 UTC
It looks like the monitor connected to the HDMI-0 output doesn't accurately report its display size, resulting in about ~300 DPI being reported via RandR. The Xorg radeon driver isn't actively involved in how clients / toolkits adjust their rendering according to this (or even in how it's reported to them).
Comment 17 Deposite Pirate 2017-09-28 14:35:46 UTC
I just plugged the affected machine on the monitor of the unaffected machine, and qTox is scaled like it should. So I guess the monitor (Samsung P2770HD) has issues with it's EDID. Should I go file a bug report somewhere so a workaround be added for this monitor? However the start menu icon is still rendered incorrectly, so it's a separate issue.
Comment 18 Michel Dänzer 2017-10-03 09:52:20 UTC
(In reply to Deposite Pirate from comment #17)
> So I guess the monitor (Samsung P2770HD) has issues with it's EDID. Should I go
> file a bug report somewhere so a workaround be added for this monitor?

I guess a quirk would have to be somewhere in the X server. Reassigning to RandR for now.


> However the start menu icon is still rendered incorrectly, so it's a separate
> issue.

Please file a separate report about that.
Comment 19 Deposite Pirate 2017-10-03 10:37:22 UTC
(In reply to Michel Dänzer from comment #18)
> I guess a quirk would have to be somewhere in the X server. Reassigning to
> RandR for now.

I saw the Linux kernel has some EDID quirks for various monitors defined in "drivers/gpu/drm/drm_edid.c" and it seems there's some monitors that have the same problem in there. The thing is, I don't know if the P2770HD just reports no physical size at all or if it reports it in a format that Xorg doesn't expect (i.e. cm instead of mm as there are quirks for that kind of thing in the aforementioned linux kernel source file). I downloaded some tools to read the EDID and it seems the DisplaySize is wrong as the P2770HD's manual says it's "597.89 mm (H) X 336.31 mm(V)"
 (https://www.manualslib.com/manual/201704/Samsung-Syncmaster-P2770hd.html?page=65#manual).

---
$ sudo parse-edid < edid 
Checksum Correct

Section "Monitor"
	Identifier "SyncMaster"
	ModelName "SyncMaster"
	VendorName "SAM"
	# Monitor Manufactured week 31 of 2009
	# EDID version 1.3
	# Digital Display
	DisplaySize 160 90
	Gamma 2.20
	Option "DPMS" "false"
	Horizsync 26-81
	VertRefresh 24-75
	# Maximum pixel clock is 230MHz
	#Not giving standard mode: 1152x864, 75Hz
	#Not giving standard mode: 1280x800, 60Hz
	#Not giving standard mode: 1280x960, 60Hz
	#Not giving standard mode: 1280x1024, 60Hz
	#Not giving standard mode: 1440x900, 60Hz
	#Not giving standard mode: 1440x900, 75Hz
	#Not giving standard mode: 1600x1200, 60Hz
	#Not giving standard mode: 1680x1050, 60Hz

	#Extension block found. Parsing...
I only know about extension blocks of type 02h. PLEASE email me!
Something strange happened. Please contact the author,
Matthew Kern at <pyrophobicman@gmail.com>
---
Comment 20 Deposite Pirate 2018-02-01 16:16:19 UTC
Having had no reply on the Linux kernel bug tracker about adding a quirk for my monitor I forgot about this for a while. But recently I stumbled on a tutorial that explains how to edit the EDID with a hex editor. The EDID for the VGA output reports the correct display size (but somehow even with the correct display size the scaling is still wrong). So I edited the HDMI EDID with the display size values of the VGA EDID and fixed the checksum. Then I used the new drm.edid_firmware= boot option in Linux 4.15 to load the edited HDMI EDID. Now Xorg reports:

[    38.005] (II) RADEON(0): Setting screen physical size to 508 x 285

But xrandr still reports

HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 160mm x 90mm

Unsurprisingly the scaling is still wrong. It seems like xrandr is bypassing the fixed HDMI EDID loaded by Linux and still using the bad one from the monitor. But what's even weirder is that the scaling shouldn't be wrong when using the VGA output since the VGA EDID reports the correct display size. Where is xrandr getting it's display size from?
Comment 21 Deposite Pirate 2018-06-01 00:06:00 UTC
I was hoping xorg-server 1.20 was going to fix this, but no such luck.
Comment 22 GitLab Migration User 2018-12-13 18:33:51 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/235.


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.