mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Werner Sembach <wse@tuxedocomputers.com>
To: Daniel Vetter <daniel@ffwll.ch>, Andri Yngvason <andri@yngvason.is>
Cc: "Harry Wentland" <harry.wentland@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Tvrtko Ursulin" <tvrtko.ursulin@linux.intel.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	"Simon Ser" <contact@emersion.fr>
Subject: Re: [PATCH 3/7] drm/amd/display: Add handling for new "active color format" property
Date: Wed, 10 Jan 2024 14:14:20 +0100	[thread overview]
Message-ID: <67808818-ee34-4d04-ad90-cd5c6eb9bb26@tuxedocomputers.com> (raw)
In-Reply-To: <CAKMK7uGhMCwbztGdEmG4gFgpyhw6j-JFow-AaprFxcX710=qXA@mail.gmail.com>

Hi,

Am 10.01.24 um 14:09 schrieb Daniel Vetter:
> On Wed, 10 Jan 2024 at 13:53, Andri Yngvason <andri@yngvason.is> wrote:
>> mið., 10. jan. 2024 kl. 11:10 skrifaði Daniel Vetter <daniel@ffwll.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


  reply	other threads:[~2024-01-10 13:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 18:10 [PATCH 0/7] New DRM properties for output color format Andri Yngvason
2024-01-09 18:10 ` [PATCH 1/7] drm/amd/display: Remove unnecessary SIGNAL_TYPE_HDMI_TYPE_A check Andri Yngvason
2024-01-09 18:10 ` [PATCH 2/7] drm/uAPI: Add "active color format" drm property as feedback for userspace Andri Yngvason
2024-01-09 22:32   ` Daniel Stone
     [not found]     ` <CAFNQBQwiqqSRqzXAnC035UWCGF3=GGFR5SpDd=biPTOEA+cWbQ@mail.gmail.com>
2024-01-09 23:21       ` Andri Yngvason
2024-01-10 10:44       ` Daniel Vetter
2024-01-10 13:26         ` Daniel Stone
2024-01-11 17:17           ` Andri Yngvason
2024-01-15 15:01             ` Sebastian Wick
2024-01-10 13:39   ` Werner Sembach
2024-01-09 18:11 ` [PATCH 3/7] drm/amd/display: Add handling for new "active color format" property Andri Yngvason
2024-01-10 11:10   ` Daniel Vetter
2024-01-10 12:52     ` Andri Yngvason
2024-01-10 13:09       ` Daniel Vetter
2024-01-10 13:14         ` Werner Sembach [this message]
2024-01-10 17:15           ` Andri Yngvason
2024-01-11 23:54             ` Werner Sembach
2024-01-09 18:11 ` [PATCH 4/7] drm/i915/display: " Andri Yngvason
2024-01-09 18:11 ` [PATCH 5/7] drm/uAPI: Add "preferred color format" drm property as setting for userspace Andri Yngvason
2024-01-10  9:27   ` Maxime Ripard
2024-01-10 10:11     ` Andri Yngvason
2024-01-10 13:09       ` Werner Sembach
2024-01-10 13:42         ` Andri Yngvason
2024-01-10 14:54           ` Werner Sembach
2024-01-09 18:11 ` [PATCH 6/7] drm/amd/display: Add handling for new "preferred color format" property Andri Yngvason
2024-01-09 18:11 ` [PATCH 7/7] drm/i915/display: " Andri Yngvason

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=67808818-ee34-4d04-ad90-cd5c6eb9bb26@tuxedocomputers.com \
    --to=wse@tuxedocomputers.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andri@yngvason.is \
    --cc=christian.koenig@amd.com \
    --cc=contact@emersion.fr \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=sunpeng.li@amd.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®