linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Werner Sembach <wse@tuxedocomputers.com>
Cc: Simon Ser <contact@emersion.fr>,
	sunpeng.li@amd.com, intel-gfx@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	airlied@linux.ie, amd-gfx@lists.freedesktop.org,
	tzimmermann@suse.de, rodrigo.vivi@intel.com,
	alexander.deucher@amd.com, christian.koenig@amd.com
Subject: Re: [PATCH v4 12/17] drm/uAPI: Add "preferred color format" drm property as setting for userspace
Date: Wed, 30 Jun 2021 11:41:33 +0300	[thread overview]
Message-ID: <20210630114133.47397e2f@eldfell> (raw)
In-Reply-To: <6d8716e0-e68a-e7b7-a341-a7471c413e9c@tuxedocomputers.com>

[-- Attachment #1: Type: text/plain, Size: 5119 bytes --]

On Tue, 29 Jun 2021 13:39:18 +0200
Werner Sembach <wse@tuxedocomputers.com> wrote:

> Am 29.06.21 um 13:17 schrieb Pekka Paalanen:
> > On Tue, 29 Jun 2021 08:12:54 +0000
> > Simon Ser <contact@emersion.fr> wrote:
> >  
> >> On Tuesday, June 22nd, 2021 at 09:15, Pekka Paalanen <ppaalanen@gmail.com> wrote:
> >>  
> >>> yes, I think this makes sense, even if it is a property that one can't
> >>> tell for sure what it does before hand.
> >>>
> >>> Using a pair of properties, preference and active, to ask for something
> >>> and then check what actually worked is good for reducing the
> >>> combinatorial explosion caused by needing to "atomic TEST_ONLY commit"
> >>> test different KMS configurations. Userspace has a better chance of
> >>> finding a configuration that is possible.
> >>>
> >>> OTOH, this has the problem than in UI one cannot tell the user in
> >>> advance which options are truly possible. Given that KMS properties are
> >>> rarely completely independent, and in this case known to depend on
> >>> several other KMS properties, I think it is good enough to know after
> >>> the fact.
> >>>
> >>> If a driver does not use what userspace prefers, there is no way to
> >>> understand why, or what else to change to make it happen. That problem
> >>> exists anyway, because TEST_ONLY commits do not give useful feedback
> >>> but only a yes/no.    
> >> By submitting incremental atomic reqs with TEST_ONLY (i.e. only changing one
> >> property at a time), user-space can discover which property makes the atomic
> >> commit fail.  
> > That works if the properties are independent of each other. Color
> > range, color format, bpc and more may all be interconnected,
> > allowing only certain combinations to work.
> >
> > If all these properties have "auto" setting too, then it would be
> > possible to probe each property individually, but that still does not
> > tell which combinations are valid.
> >
> > If you probe towards a certain configuration by setting the properties
> > one by one, then depending on the order you pick the properties, you
> > may come to a different conclusion on which property breaks the
> > configuration.  
> 
> My mind crossed another point that must be considered: When plugin in
> a Monitor a list of possible Resolutions+Framerate combinations is
> created for xrandr and other userspace (I guess by atomic checks? but
> I don't know).

Hi,

I would not think so, but I hope to be corrected if I'm wrong.

My belief is that the driver collects a list of modes from EDID, some
standard modes, and maybe some other hardcoded modes, and then
validates each entry against all the known limitations like vertical
and horizontal frequency limits, discarding modes that do not fit.

Not all limitations are known during that phase, which is why KMS
property "link-status" exists. When userspace actually programs a mode
(not a TEST_ONLY commit), the link training may fail. The kernel prunes
the mode from the list and sets the link status property to signal
failure, and sends a hotplug uevent. Userspace needs to re-check the
mode list and try again.

That is a generic escape hatch for when TEST_ONLY commit succeeds, but
in reality the hardware cannot do it, you just cannot know until you
actually try for real. It causes end user visible flicker if it happens
on an already running connector, but since it usually happens when
turning a connector on to begin with, there is no flicker to be seen,
just a small delay in finding a mode that works.

> During this drm
> properties are already considered, which is no problem atm because as
> far as i can tell there is currently no drm property that would make
> a certain Resolutions+Framerate combination unreachable that would be
> possible with everything on default.

I would not expect KMS properties to be considered at all. It would
reject modes that are actually possible if the some KMS properties were
changed. So at least going forward, current KMS property values cannot
factor in.

> However for example forcing YCbCr420 encoding would limit the
> available resolutions (my screen for example only supports YCbCr420
> on 4k@60 and @50Hz and on no other resolution or frequency (native is
> 2560x1440@144Hz).
> 
> So would a "force color format" that does not get resetted on
> repluging/reenabling a monitor break the output, for example, of an
> not updated xrandr, unaware of this new property?

Yes, not because the mode list would be missing the mode, but because
actually setting the mode would fail.

RandR in particular is problematic, because it does not actually
understand any KMS properties, it is merely a relay. So anything
that *uses* RandR protocol or xrandr command would also need to be
patched to understand the new properties.

The kernel automatically resetting *some* properties in *some*
occasions seems really fragile and complicated to me, which is why I'm
a lot more keen to see a "reset everything to sensible defaults"
generic mechanism added to KMS.


Thanks,
pq

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-06-30  8:41 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18  9:10 [PATCH v4 00/17] New uAPI drm properties for color management Werner Sembach
2021-06-18  9:11 ` [PATCH v4 01/17] drm/amd/display: Remove unnecessary SIGNAL_TYPE_HDMI_TYPE_A check Werner Sembach
2021-06-18  9:11 ` [PATCH v4 02/17] drm/amd/display: Add missing cases convert_dc_color_depth_into_bpc Werner Sembach
2021-06-18  9:11 ` [PATCH v4 03/17] drm/uAPI: Add "active bpc" as feedback channel for "max bpc" drm property Werner Sembach
2021-06-22  6:46   ` Pekka Paalanen
2021-06-28 17:03   ` Werner Sembach
2021-06-29 11:02     ` Werner Sembach
2021-06-30  8:21       ` Pekka Paalanen
2021-06-30  9:42         ` Werner Sembach
2021-07-01  7:42           ` Pekka Paalanen
2021-07-01 11:30             ` Werner Sembach
2021-07-14 18:18               ` Werner Sembach
2021-07-15  9:10                 ` Pekka Paalanen
2021-06-18  9:11 ` [PATCH v4 04/17] drm/amd/display: Add handling for new "active bpc" property Werner Sembach
2021-06-18  9:11 ` [PATCH v4 05/17] drm/i915/display: " Werner Sembach
2021-06-18  9:11 ` [PATCH v4 06/17] drm/uAPI: Add "active color format" drm property as feedback for userspace Werner Sembach
2021-06-22  6:48   ` Pekka Paalanen
2021-06-18  9:11 ` [PATCH v4 07/17] drm/amd/display: Add handling for new "active color format" property Werner Sembach
2021-06-18  9:11 ` [PATCH v4 08/17] drm/i915/display: " Werner Sembach
2021-06-18  9:11 ` [PATCH v4 09/17] drm/uAPI: Add "active color range" drm property as feedback for userspace Werner Sembach
2021-06-22  7:00   ` Pekka Paalanen
2021-06-22  9:50     ` Werner Sembach
2021-06-22 11:48       ` Simon Ser
2021-06-23  7:32         ` Pekka Paalanen
2021-06-23 10:17           ` Werner Sembach
2021-06-23 11:14             ` Pekka Paalanen
2021-06-23 11:19               ` Werner Sembach
2021-06-18  9:11 ` [PATCH v4 10/17] drm/amd/display: Add handling for new "active color range" property Werner Sembach
2021-06-18  9:11 ` [PATCH v4 11/17] drm/i915/display: " Werner Sembach
2021-06-18  9:11 ` [PATCH v4 12/17] drm/uAPI: Add "preferred color format" drm property as setting for userspace Werner Sembach
2021-06-22  7:15   ` Pekka Paalanen
2021-06-29  8:12     ` Simon Ser
2021-06-29 11:17       ` Pekka Paalanen
2021-06-29 11:39         ` Werner Sembach
2021-06-30  8:41           ` Pekka Paalanen [this message]
2021-06-30  9:20             ` Werner Sembach
2021-07-01  8:07               ` Pekka Paalanen
2021-07-01 12:50                 ` Werner Sembach
2021-07-01 13:24                   ` Pekka Paalanen
2021-07-05 15:49                     ` Werner Sembach
2021-07-06  7:09                       ` Pekka Paalanen
2021-07-14 17:59                         ` Werner Sembach
2021-06-18  9:11 ` [PATCH v4 13/17] drm/amd/display: Add handling for new "preferred color format" property Werner Sembach
2021-06-18  9:11 ` [PATCH v4 14/17] drm/i915/display: " Werner Sembach
2021-06-18  9:11 ` [PATCH v4 15/17] drm/uAPI: Move "Broadcast RGB" property from driver specific to general context Werner Sembach
2021-06-22  7:25   ` Pekka Paalanen
2021-06-22  9:57     ` Werner Sembach
2021-06-23  7:48       ` Pekka Paalanen
2021-06-23 10:10         ` Werner Sembach
2021-06-23 11:26           ` Pekka Paalanen
2021-06-25  8:48             ` Werner Sembach
2021-06-18  9:11 ` [PATCH v4 16/17] drm/i915/display: Use the general "Broadcast RGB" implementation Werner Sembach
2021-06-18  9:11 ` [PATCH v4 17/17] drm/amd/display: Add handling for new "Broadcast RGB" property Werner Sembach
2021-06-22  7:29   ` Pekka Paalanen
2021-06-22  9:28     ` Werner Sembach
2021-06-23  8:01       ` Pekka Paalanen
2021-06-23  9:58         ` Werner Sembach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210630114133.47397e2f@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=contact@emersion.fr \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=sunpeng.li@amd.com \
    --cc=tzimmermann@suse.de \
    --cc=wse@tuxedocomputers.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).