From: Aradhya Bhatia <a-bhatia1@ti.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Tomi Valkeinen <tomba@kernel.org>, Jyri Sarha <jyri.sarha@iki.fi>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>, Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Swapnil Jakhade <sjakhade@cadence.com>,
Boris Brezillon <boris.brezillon@collabora.com>,
Francesco Dolcini <francesco@dolcini.it>,
Nishanth Menon <nm@ti.com>, Jayesh Choudhary <j-choudhary@ti.com>,
Rahul T R <r-ravikumar@ti.com>, Devarsh Thakkar <devarsht@ti.com>,
Linux Kernel List <linux-kernel@vger.kernel.org>,
DRI Development List <dri-devel@lists.freedesktop.org>,
Vignesh Raghavendra <vigneshr@ti.com>,
Javier Martinez Canillas <javierm@redhat.com>
Subject: Re: [PATCH v7 5/8] drm/bridge: sii902x: Support format negotiation hooks
Date: Fri, 14 Jul 2023 10:49:33 +0530 [thread overview]
Message-ID: <5bf5e4d1-546f-19fc-1647-7ece567d52f1@ti.com> (raw)
In-Reply-To: <20230710150822.GA5237@ravnborg.org>
Hi Sam,
On 10-Jul-23 20:38, Sam Ravnborg wrote:
> Hi Aradhya,
>
> On Tue, Jun 06, 2023 at 01:51:39PM +0530, Aradhya Bhatia wrote:
>> With new connector model, sii902x will not create the connector, when
>> DRM_BRIDGE_ATTACH_NO_CONNECTOR is set and SoC driver will rely on format
>> negotiation to setup the encoder format.
>>
>> Support format negotiations hooks in the drm_bridge_funcs.
>> Use helper functions for state management.
>>
>> Input format is selected to MEDIA_BUS_FMT_RGB888_1X24 as default, as is
>> the case with older model.
>>
>> Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
>> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
>
> As noted by Javier, this patch-set was forgotten, so sorry for not
> providing timely feedback.
Thank you for reviewing my patch nevertheless! =)
>
>
>> ---
>>
>> Notes:
>>
>> changes from v6:
>> * Add Neil Armstrong's R-b tag.
>>
>> drivers/gpu/drm/bridge/sii902x.c | 25 +++++++++++++++++++++++++
>> 1 file changed, 25 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
>> index ef66461e7f7c..70aeb04b7f77 100644
>> --- a/drivers/gpu/drm/bridge/sii902x.c
>> +++ b/drivers/gpu/drm/bridge/sii902x.c
>> @@ -473,6 +473,27 @@ static struct edid *sii902x_bridge_get_edid(struct drm_bridge *bridge,
>> return sii902x_get_edid(sii902x, connector);
>> }
>>
>> +static u32 *sii902x_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
>> + struct drm_bridge_state *bridge_state,
>> + struct drm_crtc_state *crtc_state,
>> + struct drm_connector_state *conn_state,
>> + u32 output_fmt,
>> + unsigned int *num_input_fmts)
>> +{
>> + u32 *input_fmts;
>> +
>> + *num_input_fmts = 0;
>> +
>> + input_fmts = kcalloc(1, sizeof(*input_fmts), GFP_KERNEL);
>> + if (!input_fmts)
>> + return NULL;
>> +
>> + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24;
>> + *num_input_fmts = 1;
>> +
>> + return input_fmts;
>> +}
>
> An alternative implementation of the above is:
> {
> switch (output_fmt) {
> case MEDIA_BUS_FMT_RGB888_1X24:
> break;
>
> default:
> /* Fail for any other formats */
> *num_input_fmts = 0;
> return NULL;
> }
>
> return drm_atomic_helper_bridge_propagate_bus_fmt(bridge, bridge_state,
> crtc_state, conn_state,
> output_fmt,
> num_input_fmts);
> }
>
> If you agree and have the time to do it it would be nice to use this
> simpler variant.
> Mostly so we avoid more open coded variants like you already did, and
> which we have plenty of already.
I agree with the idea that these hooks should get streamlined.
However, this particular approach will break things when the output_fmt
is defaulted to MEDIA_BUS_FMT_FIXED. Even if we add this format as a
fall-through case along with MEDIA_BUS_FMT_RGB888_1X24, tidss driver
will too then receive MEDIA_BUS_FMT_FIXED as an expected output format
and will throw an error.
The possibility of an equivalent if-check was discussed in the previous
version[1].
>
> It would be even better to walk through other implementations of
> get_input_bus_fmts and update them accordingly.
>
> Again, sorry for being late here. Feel free to ignore if you already
> moved on with something else.
>
I am working on adding OLDI support for tidss, but if we can resolve the
above concern, and Javier agrees, I will be happy to add an incremental
fix for this! =)
Regards
Aradhya
[1]: https://patchwork.freedesktop.org/patch/536008/?series=82765&rev=6
next prev parent reply other threads:[~2023-07-14 5:20 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 8:21 [PATCH v7 0/8] drm/tidss: Use new connector model for tidss Aradhya Bhatia
2023-06-06 8:21 ` [PATCH v7 1/8] drm/bridge: tfp410: Support format negotiation hooks Aradhya Bhatia
2023-06-06 9:05 ` Neil Armstrong
2023-06-06 8:21 ` [PATCH v7 2/8] drm/bridge: tfp410: Set input_bus_flags in atomic_check Aradhya Bhatia
2023-06-06 8:21 ` [PATCH v7 3/8] drm/bridge: mhdp8546: Add minimal format negotiation Aradhya Bhatia
2023-06-06 9:05 ` Neil Armstrong
2023-06-06 8:21 ` [PATCH v7 4/8] drm/bridge: mhdp8546: Set input_bus_flags from atomic_check Aradhya Bhatia
2023-06-06 8:21 ` [PATCH v7 5/8] drm/bridge: sii902x: Support format negotiation hooks Aradhya Bhatia
2023-07-10 15:08 ` Sam Ravnborg
2023-07-14 5:19 ` Aradhya Bhatia [this message]
2023-07-14 7:52 ` Javier Martinez Canillas
2023-06-06 8:21 ` [PATCH v7 6/8] drm/bridge: sii902x: Set input_bus_flags in atomic_check Aradhya Bhatia
2023-06-06 8:21 ` [PATCH v7 7/8] drm/tidss: Update encoder/bridge chain connect model Aradhya Bhatia
2023-10-30 9:25 ` Jan Kiszka
2023-10-30 19:38 ` Aradhya Bhatia
2023-06-06 8:21 ` [PATCH v7 8/8] drm/bridge: cdns-mhdp8546: Fix the interrupt enable/disable Aradhya Bhatia
2023-06-06 9:07 ` [PATCH v7 0/8] drm/tidss: Use new connector model for tidss Neil Armstrong
2023-06-06 9:46 ` Aradhya Bhatia
2023-06-06 9:48 ` neil.armstrong
2023-06-08 7:29 ` Tomi Valkeinen
2023-07-10 12:24 ` Javier Martinez Canillas
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=5bf5e4d1-546f-19fc-1647-7ece567d52f1@ti.com \
--to=a-bhatia1@ti.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=boris.brezillon@collabora.com \
--cc=daniel@ffwll.ch \
--cc=devarsht@ti.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=francesco@dolcini.it \
--cc=j-choudhary@ti.com \
--cc=javierm@redhat.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=jyri.sarha@iki.fi \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=nm@ti.com \
--cc=r-ravikumar@ti.com \
--cc=rfoss@kernel.org \
--cc=sam@ravnborg.org \
--cc=sjakhade@cadence.com \
--cc=tomba@kernel.org \
--cc=vigneshr@ti.com \
/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®