lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZiZs94-ZP1n98RZu@pengutronix.de>
Date: Mon, 22 Apr 2024 15:58:15 +0200
From: Michael Olbrich <m.olbrich@...gutronix.de>
To: dri-devel@...ts.freedesktop.org, David Airlie <airlied@...il.com>,
	Daniel Vetter <daniel@...ll.ch>,
	Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
	Maxime Ripard <mripard@...nel.org>,
	Thomas Zimmermann <tzimmermann@...e.de>,
	Ville Syrjälä <ville.syrjala@...ux.intel.com>,
	Jani Nikula <jani.nikula@...ux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@...el.com>,
	Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
	Tvrtko Ursulin <tursulin@...ulin.net>,
	intel-gfx@...ts.freedesktop.org, intel-xe@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org
Cc: graphics@...gutronix.de
Subject: Reliably selecting non-CEA modes on Intel graphics (and maybe others)

Hi,

In short: I have a HDMI monitor attached to Intel graphics. I'm trying to
set a non-CEA mode but the driver always maps it to the corresponding CEA
mode.

More specifically, the monitor has two 1920x1080@60 modes in the EDID:
1. The CEA mode with VIC 16
2. A custom DTD mode with exactly the same timings (this is the preferred
   mode).

>From a userspace perspective, the two modes are mostly identical, except
for the 16:9 aspect ratio flag in the CEA mode and the preferred type in
the other.

I want to select the second (preferred) mode, but that does not seem
possible:
intel_hdmi_compute_avi_infoframe() tries to determine which VIC should be
added to the avi infoframe and if limited or full range is used.
It uses various DRM helpers here but in the end drm_match_cea_mode() is
called. And here lies the problem:
The mode provided by the userspace has explicitly no aspect ratio. But
here, it is interpreted as "the aspect ration is undefined". So matching
ignored the aspect ratio and the CEA mode with VIC 16 is found and limited
range is used.

The commit that introduces this fuzzy matching
357768cc9e3fdacf6551da0ae1483bc87dbcb4e8 ("drm/edid: Fix cea mode aspect
ratio handling") made sense at the time. The capability
DRM_CLIENT_CAP_ASPECT_RATIO that exposes aspect ratios to userspace was
introduced later in the same merge request, from what I can tell
7595bda2fb4378ccbb8db1d0e8de56d15ea7f7fa ("drm: Add DRM client cap for
aspect-ratio").

Am I missing something here, or is it just not possible to select the
non-CEA mode right now? In my specific example, the selected CEA mode is
actually supported by the monitor, but as far as I can tell, the CEA mode
is used even if the monitor does not support it at all.

I've only tested this on Intel, but I assume that other drivers that use
the same helpers have the same problem.

So how can this be fixed? I've considered matching the aspect ratio based
on the DRM_CLIENT_CAP_ASPECT_RATIO capability, but I'm not sure if that is
valid. The documentation is limited and I found nothing that describes what
the userspace should do here.
Or would a new capability make sense here? Or something entirely different?
I'm not sure how I should proceed here. Any help would be appreciated.

Regards,
Michael

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ