mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	kernel@collabora.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] drm/bridge-connector: Prioritize supported_formats over ycbcr_420_allowed
Date: Tue, 24 Dec 2024 20:37:37 +0200	[thread overview]
Message-ID: <4c4f157a-3c87-42e7-987d-cde15c1d8171@collabora.com> (raw)
In-Reply-To: <7ct4feznensmvubaflaorqlw7uiuafwo5da5etsivogccrwdeh@r6jsztj4dsnh>

On 12/20/24 3:05 AM, Dmitry Baryshkov wrote:
> On Tue, Dec 17, 2024 at 02:38:55AM +0200, Cristian Ciocaltea wrote:
>> On 12/17/24 1:27 AM, Dmitry Baryshkov wrote:
>>> On Tue, Dec 17, 2024 at 12:54:07AM +0200, Cristian Ciocaltea wrote:
>>>> Bridges having the DRM_BRIDGE_OP_HDMI flag set in drm_bridge->ops are
>>>> supposed to rely on drm_bridge->supported_formats bitmask to advertise
>>>> the supported colorspaces, including HDMI_COLORSPACE_YUV420.  Therefore,
>>>> the newly introduced drm_bridge->ycbcr_420_allowed flag becomes
>>>> redundant in this particular context.
>>>>
>>>> Moreover, when drm_bridge_connector gets initialised, only
>>>> drm_bridge->ycbcr_420_allowed is considered in the process of adjusting
>>>> the equivalent property of the base drm_connector, which effectively
>>>> discards the formats advertised by the HDMI bridge.
>>>>
>>>> Handle the inconsistency by overwriting drm_bridge->ycbcr_420_allowed
>>>> for HDMI bridges according to drm_bridge->supported_formats, before
>>>> adding them to the global bridge list.
>>>>
>>>> Additionally, ensure the YUV420 related bit is removed from the bitmask
>>>> passed to drmm_connector_hdmi_init() when the final ycbcr_420_allowed
>>>> flag for the connector ends up not being set (i.e. the case of having at
>>>> least one non-HDMI bridge in the pipeline that didn't enable it).
>>>>
>>>> Fixes: 3ced1c687512 ("drm/display: bridge_connector: handle ycbcr_420_allowed")
>>>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>>>> ---
>>>>  drivers/gpu/drm/display/drm_bridge_connector.c | 8 ++++++--
>>>>  drivers/gpu/drm/drm_bridge.c                   | 4 ++++
>>>>  2 files changed, 10 insertions(+), 2 deletions(-)
>>>
>>> I think the second patch in the series is enough, it ensures that
>>> connector's state is consistent, no matter if the drm_bridge_connector
>>> is being used or a normal drm_connector.
>>>
>>> Nevertheless, I'd leave the final decision to DRM maintainers.
>>
>> This patch has 2 parts, maybe I should have put them into separate patches
>> as they kind of relate to distinct problems.
>>
>> The 1st part makes sure that drm_bridge->ycbcr_420_allowed is automatically
>> set when HDMI_COLORSPACE_YUV420 is provided in drm_bridge->supported_formats, 
>> to avoid the need of requiring redundant information on HDMI bridges 
>> initialization.  This implicitly ensures the consistency needed to further 
>> allow relying on ->ycbcr_420_allowed internally.
>>
>> While the 1st part could be dropped (assuming redundancy & consistency is
>> not really something we want/need to handle), the 2nd part I think is
>> mandatory, i.e. we must adjust supported_formats before calling
>> drmm_connector_hdmi_init() to ensure the presence of HDMI_COLORSPACE_YUV420
>> reflects the status of the computed connector->ycbcr_420_allowed, which
>> might end up being different than what the HDMI bridge advertised, i.e. the
>> case of having an HDMI bridge in the pipeline advertising YUV420 via 
>> supported_formats and a non-HDMI one that didn't enable ycbcr_420_allowed.
> 
> Please split it into two patches. I don't have a strong opinion upon the
> first one (I'd change it to dev_warn() maybe), while the second one
> (removing HDMI_COLORSPACE_YUV420 if connector->ycbcr_420_allowed is
> false) is definitely a correct change.

Split done in v4:

https://lore.kernel.org/lkml/20241224-bridge-conn-fmt-prio-v4-2-a9ceb5671379@collabora.com/

Thanks,
Cristian

  reply	other threads:[~2024-12-24 18:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 22:54 [PATCH v3 0/2] Fix ycbcr_420_allowed inconsistency for HDMI bridges Cristian Ciocaltea
2024-12-16 22:54 ` [PATCH v3 1/2] drm/bridge-connector: Prioritize supported_formats over ycbcr_420_allowed Cristian Ciocaltea
2024-12-16 23:27   ` Dmitry Baryshkov
2024-12-17  0:38     ` Cristian Ciocaltea
2024-12-20  1:05       ` Dmitry Baryshkov
2024-12-24 18:37         ` Cristian Ciocaltea [this message]
2024-12-16 22:54 ` [PATCH v3 2/2] drm/connector: hdmi: Validate supported_formats matches ycbcr_420_allowed Cristian Ciocaltea
2024-12-16 23:26   ` Dmitry Baryshkov
2024-12-17 15:25   ` Maxime Ripard
2024-12-24 18:35     ` Cristian Ciocaltea

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=4c4f157a-3c87-42e7-987d-cde15c1d8171@collabora.com \
    --to=cristian.ciocaltea@collabora.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --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®