From: Marek Vasut <marex@denx.de>
To: Maxime Ripard <maxime@cerno.tech>
Cc: Jonas Karlman <jonas@kwiboo.se>,
Neil Armstrong <narmstrong@baylibre.com>,
dri-devel@lists.freedesktop.org,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH V2 04/11] drm/bridge: tc358767: Implement atomic_check callback
Date: Thu, 24 Feb 2022 20:03:10 +0100 [thread overview]
Message-ID: <48b35d14-4775-dde8-4eab-caa4872b7bae@denx.de> (raw)
In-Reply-To: <20220221090111.qk5nweyaeg7ptfuo@houat>
On 2/21/22 10:01, Maxime Ripard wrote:
> On Sat, Feb 19, 2022 at 03:26:40AM +0100, Marek Vasut wrote:
>> On 2/18/22 18:34, Lucas Stach wrote:
>>
>> Hi
>>
>> [...]
>>
>>>> drivers/gpu/drm/bridge/tc358767.c | 26 ++++++++++++++++++++++++++
>>>> 1 file changed, 26 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
>>>> index 522c2c4d8514f..01d11adee6c74 100644
>>>> --- a/drivers/gpu/drm/bridge/tc358767.c
>>>> +++ b/drivers/gpu/drm/bridge/tc358767.c
>>>> @@ -1289,6 +1289,31 @@ static bool tc_bridge_mode_fixup(struct drm_bridge *bridge,
>>>> return true;
>>>> }
>>>> +static int tc_edp_common_atomic_check(struct drm_bridge *bridge,
>>>
>>> Drop the edp in the name here? Later in the series you call this
>>> function from the DPI code, so this breaks the nice clean naming
>>> separation from patch 1.
>>>
>>>> + struct drm_bridge_state *bridge_state,
>>>> + struct drm_crtc_state *crtc_state,
>>>> + struct drm_connector_state *conn_state,
>>>> + const unsigned int max_khz)
>>>> +{
>>>> + tc_bridge_mode_fixup(bridge, &crtc_state->mode,
>>>> + &crtc_state->adjusted_mode);
>>>> +
>>>> + if (crtc_state->adjusted_mode.clock > max_khz)
>>>> + crtc_state->adjusted_mode.clock = max_khz;
>>>
>>> I don't think this is correct. The adjusted most is just for minor
>>> adjustments if the bridge can not fully match the mode. If userspace
>>> supplies a invalid high modeclock I think it would be better to fail
>>> the atomic check -> return -EINVAL
>>
>> Maxime was telling me that returning -EINVAL from atomic_check is weird, so
>> maybe we should also wait for his opinion on this part.
>
> That was in a completely different context?
>
> Our discussion was about how you would propagate clock constraints
> across a pipeline, and I was telling you that it would be weird to
> return -EINVAL for a mode that was reported on a connector as supported
> (or even preferred).
>
> My argument was for mode_valid to filter them out.
>
> If your clock is way above what you can support on your device, then
> returning an error in atomic_check is the right thing to do.
Ah OK
next prev parent reply other threads:[~2022-02-24 19:03 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-18 1:00 [PATCH V2 00/11] drm/bridge: tc358767: Add DSI-to-DPI mode support Marek Vasut
2022-02-18 1:00 ` [PATCH V2 01/11] dt-bindings: display: bridge: tc358867: Document DPI output support Marek Vasut
2022-02-18 1:00 ` [PATCH V2 02/11] drm/bridge: tc358767: Change tc_ prefix to tc_edp_ for (e)DP specific functions Marek Vasut
2022-02-18 17:24 ` Lucas Stach
2022-02-18 1:00 ` [PATCH V2 03/11] drm/bridge: tc358767: Convert to atomic ops Marek Vasut
2022-02-18 17:27 ` Lucas Stach
2022-02-18 1:00 ` [PATCH V2 04/11] drm/bridge: tc358767: Implement atomic_check callback Marek Vasut
2022-02-18 17:34 ` Lucas Stach
2022-02-19 2:26 ` Marek Vasut
2022-02-21 9:01 ` Maxime Ripard
2022-02-24 19:03 ` Marek Vasut [this message]
2022-02-18 1:00 ` [PATCH V2 05/11] drm/bridge: tc358767: Move hardware init to enable callback Marek Vasut
2022-02-18 17:49 ` Lucas Stach
2022-02-19 2:39 ` Marek Vasut
2022-02-21 9:12 ` Lucas Stach
2022-02-24 19:13 ` Marek Vasut
2022-02-18 1:00 ` [PATCH V2 06/11] drm/bridge: tc358767: Move (e)DP bridge endpoint parsing into dedicated function Marek Vasut
2022-02-18 17:51 ` Lucas Stach
2022-02-18 1:00 ` [PATCH V2 07/11] drm/bridge: tc358767: Wrap (e)DP aux I2C registration into tc_aux_link_setup() Marek Vasut
2022-02-18 17:57 ` Lucas Stach
2022-02-18 1:00 ` [PATCH V2 08/11] drm/bridge: tc358767: Move bridge ops setup into tc_probe_edp_bridge_endpoint() Marek Vasut
2022-02-18 18:01 ` Lucas Stach
2022-02-18 1:00 ` [PATCH V2 09/11] drm/bridge: tc358767: Detect bridge mode from connected endpoints in DT Marek Vasut
2022-02-18 18:04 ` Lucas Stach
2022-02-18 1:00 ` [PATCH V2 10/11] drm/bridge: tc358767: Split tc_set_video_mode() into common and (e)DP part Marek Vasut
2022-02-18 18:13 ` Lucas Stach
2022-02-18 1:00 ` [PATCH V2 11/11] drm/bridge: tc358767: Add DSI-to-DPI mode support Marek Vasut
2022-02-18 18:38 ` Lucas Stach
2022-02-19 4:44 ` Marek Vasut
2022-02-22 17:49 ` Lucas Stach
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=48b35d14-4775-dde8-4eab-caa4872b7bae@denx.de \
--to=marex@denx.de \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jonas@kwiboo.se \
--cc=maxime@cerno.tech \
--cc=narmstrong@baylibre.com \
--cc=sam@ravnborg.org \
/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