From: Pekka Paalanen <ppaalanen@gmail.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: "Sebastian Wick" <sebastian.wick@redhat.com>,
"Michel Dänzer" <michel.daenzer@mailbox.org>,
amd-gfx@lists.freedesktop.org,
"Uma Shankar" <uma.shankar@intel.com>,
dri-devel@lists.freedesktop.org,
"Joshua Ashton" <joshua@froggi.es>,
Vitaly.Prosyak@amd.com
Subject: Re: [PATCH 16/16] drm/amd/display: Don't restrict bpc to 8 bpc
Date: Thu, 15 Dec 2022 11:17:29 +0200 [thread overview]
Message-ID: <20221215111729.50ee7808@eldfell> (raw)
In-Reply-To: <CADnq5_M8Z2QRze60AFtmF6jTw8zpTpM-MPPmgejoUCb7Rv1ZrA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5488 bytes --]
On Wed, 14 Dec 2022 10:46:55 -0500
Alex Deucher <alexdeucher@gmail.com> wrote:
> On Wed, Dec 14, 2022 at 4:01 AM Pekka Paalanen <ppaalanen@gmail.com> wrote:
> >
> > On Tue, 13 Dec 2022 18:20:59 +0100
> > Michel Dänzer <michel.daenzer@mailbox.org> wrote:
> >
> > > On 12/12/22 19:21, Harry Wentland wrote:
> > > > This will let us pass kms_hdr.bpc_switch.
> > > >
> > > > I don't see any good reasons why we still need to
> > > > limit bpc to 8 bpc and doing so is problematic when
> > > > we enable HDR.
> > > >
> > > > If I remember correctly there might have been some
> > > > displays out there where the advertised link bandwidth
> > > > was not large enough to drive the default timing at
> > > > max bpc. This would leave to an atomic commit/check
> > > > failure which should really be handled in compositors
> > > > with some sort of fallback mechanism.
> > > >
> > > > If this somehow turns out to still be an issue I
> > > > suggest we add a module parameter to allow users to
> > > > limit the max_bpc to a desired value.
> > >
> > > While leaving the fallback for user space to handle makes some sense
> > > in theory, in practice most KMS display servers likely won't handle
> > > it.
> > >
> > > Another issue is that if mode validation is based on the maximum bpc
> > > value, it may reject modes which would work with lower bpc.
> > >
> > >
> > > What Ville (CC'd) suggested before instead (and what i915 seems to be
> > > doing already) is that the driver should do mode validation based on
> > > the *minimum* bpc, and automatically make the effective bpc lower
> > > than the maximum as needed to make the rest of the atomic state work.
> >
> > A driver is always allowed to choose a bpc lower than max_bpc, so it
> > very well should do so when necessary due to *known* hardware etc.
> > limitations.
> >
>
> In the amdgpu case, it's more of a preference thing. The driver would
> enable higher bpcs at the expense of refresh rate and it seemed most
> users want higher refresh rates than higher bpc.
Hi Alex,
we already have userspace in explicit control of the refresh rate.
Userspace picks the refresh rate first, then the driver silently checks
what bpc is possible. Userspace preference wins, so bpc is chosen to
produce the desired refresh rate.
In what cases does the driver really pick a refresh rate on its own?
Or is this about display latency more than throughput, to send a full
frame in shorter time while not actually increasing refresh rate?
Even for VRR, userspace already explicitly chooses the max refresh
rate, I believe.
I suppose optimising power consumption by choosing a lower bpc than
what would work is a use case, but that's a bit awkward currently
because there is no way for userspace to opt-out of that. OTOH,
userspace can already opt-in for that by lowering max_bpc.
> I guess the driver
> can select a lower bpc at its discretion to produce what it thinks is
> the best default, but what about users that don't want the default?
That's what we need explicit bpc control KMS properties for, e.g.
min_bpc to complement max_bpc (I recall old discussions about this).
Only userspace could know what a particular end user wants.
To ask this differently: in what cases would max_bpc become the wanted
bpc in a way that it overrides the explicitly set video mode (refresh
rate), or would cause a modeset to fail if a lower bpc would make the
modeset succeed?
The very definition of max_bpc is that it's the upper limit, and not the
desired bpc. The UAPI documentation says:
max bpc:
This range property is used by userspace to limit the bit depth.
When used the driver would limit the bpc in accordance with the
valid range supported by the hardware and sink. Drivers to use the
function drm_connector_attach_max_bpc_property() to create and
attach the property to the connector during initialization.
Git archaeology revealed that this property was first intended to work
around broken sinks and not for user preferences.
Thanks,
pq
>
> Alex
>
>
> > So things like mode validation cannot just look at a single max or min
> > bpc, but it needs to figure out if there is any usable bpc value that
> > makes the mode work.
> >
> > The max_bpc knob exists only for the cases where the sink undetectably
> > malfunctions unless the bpc is artificially limited more than seems
> > necessary. That malfunction requires a human to detect, and reconfigure
> > their system as we don't have a quirk database for this I think.
> >
> > The question of userspace wanting a specific bpc is a different matter
> > and an unsolved one. It also ties to userspace wanting to use the
> > current mode to avoid a mode switch between e.g. hand-off from firmware
> > boot splash to proper userspace. That's also unsolved AFAIK.
> >
> > OTOH, we have the discussion that concluded as
> > https://gitlab.freedesktop.org/wayland/weston/-/issues/612#note_1359898
> > which really puts userspace in charge of max_bpc, so the driver-chosen
> > default value does not have much impact as long as it makes the
> > firmware-chosen video mode to continue, as requested in
> > https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/995
> > given that userspace cannot know what the actual bpc currently is nor
> > set the exact bpc to keep it the same.
> >
> >
> > Thanks,
> > pq
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-12-15 9:17 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 18:21 [PATCH 00/16] Enable Colorspace connector property in amdgpu Harry Wentland
2022-12-12 18:21 ` [PATCH 01/16] drm/display: Don't block HDR_OUTPUT_METADATA on unknown EOTF Harry Wentland
2022-12-12 18:21 ` [PATCH 02/16] drm/connector: print max_requested_bpc in state debugfs Harry Wentland
2022-12-12 18:21 ` [PATCH 03/16] drm/connector: Drop COLORIMETRY_NO_DATA Harry Wentland
2022-12-12 18:21 ` [PATCH 04/16] drm/connector: Convert DRM_MODE_COLORIMETRY to enum Harry Wentland
2022-12-13 10:39 ` Pekka Paalanen
2022-12-13 16:41 ` Harry Wentland
2022-12-14 8:57 ` Pekka Paalanen
2022-12-12 18:21 ` [PATCH 05/16] drm/connector: Pull out common create_colorspace_property code Harry Wentland
2022-12-12 18:21 ` [PATCH 06/16] drm/connector: Allow drivers to pass list of supported colorspaces Harry Wentland
2022-12-13 10:20 ` Jani Nikula
2022-12-13 10:23 ` Pekka Paalanen
2022-12-13 16:32 ` Harry Wentland
2022-12-14 8:55 ` Pekka Paalanen
2022-12-14 19:07 ` Harry Wentland
2022-12-14 19:37 ` Alex Deucher
2022-12-13 10:34 ` Pekka Paalanen
2022-12-13 16:36 ` Harry Wentland
2022-12-12 18:21 ` [PATCH 07/16] drm/connector: Print connector colorspace in state debugfs Harry Wentland
2022-12-12 21:04 ` kernel test robot
2022-12-13 2:58 ` kernel test robot
2022-12-12 18:21 ` [PATCH 08/16] drm/amd/display: Always pass connector_state to stream validation Harry Wentland
2022-12-12 18:21 ` [PATCH 09/16] drm/amd/display: Register Colorspace property for DP and HDMI Harry Wentland
2022-12-12 18:21 ` [PATCH 10/16] drm/amd/display: Set colorspace for HDMI infoframe Harry Wentland
2022-12-12 18:21 ` [PATCH 11/16] drm/amd/display: Send correct DP colorspace infopacket Harry Wentland
2022-12-12 18:21 ` [PATCH 12/16] drm/amd/display: Always set crtcinfo from create_stream_for_sink Harry Wentland
2022-12-12 18:21 ` [PATCH 13/16] drm/amd/display: Add support for explicit BT601_YCC Harry Wentland
2022-12-12 18:21 ` [PATCH 14/16] drm/amd/display: Add debugfs for testing output colorspace Harry Wentland
2022-12-13 10:35 ` Pekka Paalanen
2022-12-12 18:21 ` [PATCH 15/16] drm/amd/display: Add default case for output_color_space switch Harry Wentland
2022-12-12 18:21 ` [PATCH 16/16] drm/amd/display: Don't restrict bpc to 8 bpc Harry Wentland
2022-12-13 10:48 ` Pekka Paalanen
2022-12-13 17:20 ` Michel Dänzer
2022-12-14 9:01 ` Pekka Paalanen
2022-12-14 15:46 ` Alex Deucher
2022-12-15 9:07 ` Michel Dänzer
2022-12-15 17:30 ` Alex Deucher
2022-12-16 11:01 ` Michel Dänzer
2022-12-15 9:17 ` Pekka Paalanen [this message]
2022-12-15 17:33 ` Alex Deucher
2022-12-15 17:42 ` Michel Dänzer
2022-12-15 17:46 ` Michel Dänzer
2022-12-23 19:10 ` Harry Wentland
2023-01-04 11:23 ` Michel Dänzer
2023-01-05 14:45 ` Sebastian Wick
2022-12-13 5:53 ` [PATCH 00/16] Enable Colorspace connector property in amdgpu Joshua Ashton
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=20221215111729.50ee7808@eldfell \
--to=ppaalanen@gmail.com \
--cc=Vitaly.Prosyak@amd.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=joshua@froggi.es \
--cc=michel.daenzer@mailbox.org \
--cc=sebastian.wick@redhat.com \
--cc=uma.shankar@intel.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