[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <67808818-ee34-4d04-ad90-cd5c6eb9bb26@tuxedocomputers.com>
Date: Wed, 10 Jan 2024 14:14:20 +0100
From: Werner Sembach <wse@...edocomputers.com>
To: Daniel Vetter <daniel@...ll.ch>, Andri Yngvason <andri@...vason.is>
Cc: Harry Wentland <harry.wentland@....com>, Leo Li <sunpeng.li@....com>,
Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
"Pan, Xinhui" <Xinhui.Pan@....com>, David Airlie <airlied@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, intel-gfx@...ts.freedesktop.org,
Simon Ser <contact@...rsion.fr>
Subject: Re: [PATCH 3/7] drm/amd/display: Add handling for new "active color
format" property
Hi,
Am 10.01.24 um 14:09 schrieb Daniel Vetter:
> On Wed, 10 Jan 2024 at 13:53, Andri Yngvason <andri@...vason.is> wrote:
>> mið., 10. jan. 2024 kl. 11:10 skrifaði Daniel Vetter <daniel@...ll.ch>:
>>> On Tue, Jan 09, 2024 at 06:11:00PM +0000, Andri Yngvason wrote:
>>>> + /* Extract information from crtc to communicate it to userspace as connector properties */
>>>> + for_each_new_connector_in_state(state, connector, new_con_state, i) {
>>>> + struct drm_crtc *crtc = new_con_state->crtc;
>>>> + struct dc_stream_state *stream;
>>>> +
>>>> + if (crtc) {
>>>> + new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
>>>> + dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
>>>> + stream = dm_new_crtc_state->stream;
>>>> +
>>>> + if (stream) {
>>>> + drm_connector_set_active_color_format_property(connector,
>>>> + convert_dc_pixel_encoding_into_drm_color_format(
>>>> + dm_new_crtc_state->stream->timing.pixel_encoding));
>>>> + }
>>>> + } else {
>>>> + drm_connector_set_active_color_format_property(connector, 0);
>>> Just realized an even bigger reason why your current design doesn't work:
>>> You don't have locking here.
>>>
>>> And you cannot grab the required lock, which is
>>> drm_dev->mode_config.mutex, because that would result in deadlocks. So
>>> this really needs to use the atomic state based design I've described.
>>>
>> Maybe we should just drop "actual color format" and instead fail the
>> modeset if the "preferred color format" property cannot be satisfied?
>> It seems like the simplest thing to do here, though it is perhaps less
>> convenient for userspace. In that case, the "preferred color format"
>> property should just be called "color format".
> Yeah that's more in line with how other atomic properties work. This
> way userspace can figure out what works with a TEST_ONLY commit too.
> And for this to work you probably want to have an "automatic" setting
> too.
> -Sima
The problem with TEST_ONLY probing is that color format settings are
interdependent: https://gitlab.freedesktop.org/drm/amd/-/issues/476#note_966634
So changing any other setting may require every color format to be TEST_ONLY
probed again.
Greetings
Werner
Powered by blists - more mailing lists