From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
To: Maxime Ripard <mripard@kernel.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>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
kernel@collabora.com, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] drm/connector: hdmi: Validate supported_formats matches ycbcr_420_allowed
Date: Tue, 24 Dec 2024 20:35:49 +0200 [thread overview]
Message-ID: <646893af-fea8-473f-ba1a-0980d770d81e@collabora.com> (raw)
In-Reply-To: <20241217-positive-elephant-of-resistance-f4b0ee@houat>
On 12/17/24 5:25 PM, Maxime Ripard wrote:
> On Tue, Dec 17, 2024 at 12:54:08AM +0200, Cristian Ciocaltea wrote:
>> Ensure HDMI connector initialization fails when the presence of
>> HDMI_COLORSPACE_YUV420 in the given supported_formats bitmask doesn't
>> match the value of drm_connector->ycbcr_420_allowed.
>>
>> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>> drivers/gpu/drm/drm_connector.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
>> index fc35f47e2849ed6786d6223ac9c69e1c359fc648..ca7f43c8d6f1b31ef9d3a1ee05f4df930ecffac4 100644
>> --- a/drivers/gpu/drm/drm_connector.c
>> +++ b/drivers/gpu/drm/drm_connector.c
>> @@ -507,6 +507,9 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
>> if (!supported_formats || !(supported_formats & BIT(HDMI_COLORSPACE_RGB)))
>> return -EINVAL;
>>
>> + if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(HDMI_COLORSPACE_YUV420)))
>> + return -EINVAL;
>> +
>> if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12))
>> return -EINVAL;
>
> The patch looks fine to me, but we need to have unit tests to cover this case.
Unit tests added in v4:
https://lore.kernel.org/lkml/20241224-bridge-conn-fmt-prio-v4-4-a9ceb5671379@collabora.com/
Thanks,
Cristian
prev parent reply other threads:[~2024-12-24 18:35 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
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 [this message]
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=646893af-fea8-473f-ba1a-0980d770d81e@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®