* [PATCH 0/2] drm/bridge: tc358767: Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR case
@ 2023-10-31 13:26 Tomi Valkeinen
2023-10-31 13:26 ` [PATCH 1/2] drm/bridge: tc358767: Support input format negotiation hook Tomi Valkeinen
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Tomi Valkeinen @ 2023-10-31 13:26 UTC (permalink / raw)
To: Aradhya Bhatia, Jan Kiszka, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Daniel Vetter
Cc: dri-devel, linux-kernel, Tomi Valkeinen
These two patches are needed to make tc358767 work in the
DRM_BRIDGE_ATTACH_NO_CONNECTOR case, at least when using a DP connector.
The first patch, "drm/bridge: tc358767: Support input format negotiation
hook" was already sent separately, but I included it here for
completeness, as both are needed to get a working display.
I have tested this with TI AM654 EVM with a tc358767 add-on card.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
Aradhya Bhatia (1):
drm/bridge: tc358767: Support input format negotiation hook
Tomi Valkeinen (1):
drm/bridge: tc358767: Fix link properties discovery
drivers/gpu/drm/bridge/tc358767.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
---
base-commit: 79d94360d50fcd487edcfe118a47a2881534923f
change-id: 20231031-tc358767-58e3ebdf95f0
Best regards,
--
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] drm/bridge: tc358767: Support input format negotiation hook
2023-10-31 13:26 [PATCH 0/2] drm/bridge: tc358767: Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR case Tomi Valkeinen
@ 2023-10-31 13:26 ` Tomi Valkeinen
2023-10-31 13:26 ` [PATCH 2/2] drm/bridge: tc358767: Fix link properties discovery Tomi Valkeinen
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Tomi Valkeinen @ 2023-10-31 13:26 UTC (permalink / raw)
To: Aradhya Bhatia, Jan Kiszka, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Daniel Vetter
Cc: dri-devel, linux-kernel, Tomi Valkeinen
From: Aradhya Bhatia <a-bhatia1@ti.com>
With new connector model, tc358767 will not create the connector, when
DRM_BRIDGE_ATTACH_NO_CONNECTOR is set and display-controller driver will
rely on format negotiation to setup the encoder format.
Add the missing input-format negotiation hook in the
drm_bridge_funcs to complete DRM_BRIDGE_ATTACH_NO_CONNECTOR support.
Input format is selected to MEDIA_BUS_FMT_RGB888_1X24 as default, as is
the case with older model.
Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Closes: https://lore.kernel.org/all/24282420-b4dd-45b3-bb1c-fc37fe4a8205@siemens.com/
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
drivers/gpu/drm/bridge/tc358767.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index ef2e373606ba..0affcefdeb1c 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -1751,6 +1751,30 @@ tc_dpi_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
return input_fmts;
}
+static u32 *
+tc_edp_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(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts),
+ GFP_KERNEL);
+ if (!input_fmts)
+ return NULL;
+
+ /* This is the DSI/DPI-end bus format */
+ input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24;
+ *num_input_fmts = 1;
+
+ return input_fmts;
+}
+
static const struct drm_bridge_funcs tc_dpi_bridge_funcs = {
.attach = tc_dpi_bridge_attach,
.mode_valid = tc_dpi_mode_valid,
@@ -1777,6 +1801,7 @@ static const struct drm_bridge_funcs tc_edp_bridge_funcs = {
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
.atomic_reset = drm_atomic_helper_bridge_reset,
+ .atomic_get_input_bus_fmts = tc_edp_atomic_get_input_bus_fmts,
};
static bool tc_readable_reg(struct device *dev, unsigned int reg)
--
2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] drm/bridge: tc358767: Fix link properties discovery
2023-10-31 13:26 [PATCH 0/2] drm/bridge: tc358767: Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR case Tomi Valkeinen
2023-10-31 13:26 ` [PATCH 1/2] drm/bridge: tc358767: Support input format negotiation hook Tomi Valkeinen
@ 2023-10-31 13:26 ` Tomi Valkeinen
2023-10-31 16:02 ` Aradhya Bhatia
2023-10-31 17:59 ` [PATCH 0/2] drm/bridge: tc358767: Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR case Jan Kiszka
2023-12-15 13:33 ` Jan Kiszka
3 siblings, 1 reply; 7+ messages in thread
From: Tomi Valkeinen @ 2023-10-31 13:26 UTC (permalink / raw)
To: Aradhya Bhatia, Jan Kiszka, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Daniel Vetter
Cc: dri-devel, linux-kernel, Tomi Valkeinen
When a display controller driver uses DRM_BRIDGE_ATTACH_NO_CONNECTOR,
tc358767 will behave properly and skip the creation of the connector.
However, tc_get_display_props(), which is used to find out about the DP
monitor and link, is only called from two places: .atomic_enable() and
tc_connector_get_modes(). The latter is only used when tc358767 creates
its own connector, i.e. when DRM_BRIDGE_ATTACH_NO_CONNECTOR is _not_
set.
Thus, the driver never finds out the link properties before get_edid()
is called. With num_lanes of 0 and link_rate of 0 there are not many
valid modes...
Fix this by adding tc_connector_get_modes() call at the beginning of
get_edid(), so that we have up to date information before looking at the
modes.
Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Closes: https://lore.kernel.org/all/24282420-b4dd-45b3-bb1c-fc37fe4a8205@siemens.com/
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
drivers/gpu/drm/bridge/tc358767.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index 0affcefdeb1c..137a9f5e3cad 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -1579,6 +1579,13 @@ static struct edid *tc_get_edid(struct drm_bridge *bridge,
struct drm_connector *connector)
{
struct tc_data *tc = bridge_to_tc(bridge);
+ int ret;
+
+ ret = tc_get_display_props(tc);
+ if (ret < 0) {
+ dev_err(tc->dev, "failed to read display props: %d\n", ret);
+ return 0;
+ }
return drm_get_edid(connector, &tc->aux.ddc);
}
--
2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] drm/bridge: tc358767: Fix link properties discovery
2023-10-31 13:26 ` [PATCH 2/2] drm/bridge: tc358767: Fix link properties discovery Tomi Valkeinen
@ 2023-10-31 16:02 ` Aradhya Bhatia
0 siblings, 0 replies; 7+ messages in thread
From: Aradhya Bhatia @ 2023-10-31 16:02 UTC (permalink / raw)
To: Tomi Valkeinen, Jan Kiszka, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Daniel Vetter
Cc: dri-devel, linux-kernel
On 31-Oct-23 18:56, Tomi Valkeinen wrote:
> When a display controller driver uses DRM_BRIDGE_ATTACH_NO_CONNECTOR,
> tc358767 will behave properly and skip the creation of the connector.
>
> However, tc_get_display_props(), which is used to find out about the DP
> monitor and link, is only called from two places: .atomic_enable() and
> tc_connector_get_modes(). The latter is only used when tc358767 creates
> its own connector, i.e. when DRM_BRIDGE_ATTACH_NO_CONNECTOR is _not_
> set.
>
> Thus, the driver never finds out the link properties before get_edid()
> is called. With num_lanes of 0 and link_rate of 0 there are not many
> valid modes...
>
> Fix this by adding tc_connector_get_modes() call at the beginning of
> get_edid(), so that we have up to date information before looking at the
> modes.
>
> Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
> Closes: https://lore.kernel.org/all/24282420-b4dd-45b3-bb1c-fc37fe4a8205@siemens.com/
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> ---
Thank you, Tomi, for quickly debugging this!
Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>
Regards
Aradhya
> drivers/gpu/drm/bridge/tc358767.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> index 0affcefdeb1c..137a9f5e3cad 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -1579,6 +1579,13 @@ static struct edid *tc_get_edid(struct drm_bridge *bridge,
> struct drm_connector *connector)
> {
> struct tc_data *tc = bridge_to_tc(bridge);
> + int ret;
> +
> + ret = tc_get_display_props(tc);
> + if (ret < 0) {
> + dev_err(tc->dev, "failed to read display props: %d\n", ret);
> + return 0;
> + }
>
> return drm_get_edid(connector, &tc->aux.ddc);
> }
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] drm/bridge: tc358767: Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR case
2023-10-31 13:26 [PATCH 0/2] drm/bridge: tc358767: Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR case Tomi Valkeinen
2023-10-31 13:26 ` [PATCH 1/2] drm/bridge: tc358767: Support input format negotiation hook Tomi Valkeinen
2023-10-31 13:26 ` [PATCH 2/2] drm/bridge: tc358767: Fix link properties discovery Tomi Valkeinen
@ 2023-10-31 17:59 ` Jan Kiszka
2023-12-15 13:33 ` Jan Kiszka
3 siblings, 0 replies; 7+ messages in thread
From: Jan Kiszka @ 2023-10-31 17:59 UTC (permalink / raw)
To: Tomi Valkeinen, Aradhya Bhatia, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Daniel Vetter
Cc: dri-devel, linux-kernel
On 31.10.23 14:26, Tomi Valkeinen wrote:
> These two patches are needed to make tc358767 work in the
> DRM_BRIDGE_ATTACH_NO_CONNECTOR case, at least when using a DP connector.
> The first patch, "drm/bridge: tc358767: Support input format negotiation
> hook" was already sent separately, but I included it here for
> completeness, as both are needed to get a working display.
>
> I have tested this with TI AM654 EVM with a tc358767 add-on card.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> ---
> Aradhya Bhatia (1):
> drm/bridge: tc358767: Support input format negotiation hook
>
> Tomi Valkeinen (1):
> drm/bridge: tc358767: Fix link properties discovery
>
> drivers/gpu/drm/bridge/tc358767.c | 32 ++++++++++++++++++++++++++++++++
> 1 file changed, 32 insertions(+)
> ---
> base-commit: 79d94360d50fcd487edcfe118a47a2881534923f
> change-id: 20231031-tc358767-58e3ebdf95f0
>
> Best regards,
Tested-by: Jan Kiszka <jan.kiszka@siemens.com>
Would be good to have that in stable for 6.6 as well then.
Thanks,
Jan
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] drm/bridge: tc358767: Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR case
2023-10-31 13:26 [PATCH 0/2] drm/bridge: tc358767: Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR case Tomi Valkeinen
` (2 preceding siblings ...)
2023-10-31 17:59 ` [PATCH 0/2] drm/bridge: tc358767: Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR case Jan Kiszka
@ 2023-12-15 13:33 ` Jan Kiszka
2023-12-19 10:00 ` Tomi Valkeinen
3 siblings, 1 reply; 7+ messages in thread
From: Jan Kiszka @ 2023-12-15 13:33 UTC (permalink / raw)
To: Tomi Valkeinen, Aradhya Bhatia, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Daniel Vetter
Cc: dri-devel, linux-kernel
On 31.10.23 14:26, Tomi Valkeinen wrote:
> These two patches are needed to make tc358767 work in the
> DRM_BRIDGE_ATTACH_NO_CONNECTOR case, at least when using a DP connector.
> The first patch, "drm/bridge: tc358767: Support input format negotiation
> hook" was already sent separately, but I included it here for
> completeness, as both are needed to get a working display.
>
> I have tested this with TI AM654 EVM with a tc358767 add-on card.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> ---
> Aradhya Bhatia (1):
> drm/bridge: tc358767: Support input format negotiation hook
>
> Tomi Valkeinen (1):
> drm/bridge: tc358767: Fix link properties discovery
>
> drivers/gpu/drm/bridge/tc358767.c | 32 ++++++++++++++++++++++++++++++++
> 1 file changed, 32 insertions(+)
> ---
> base-commit: 79d94360d50fcd487edcfe118a47a2881534923f
> change-id: 20231031-tc358767-58e3ebdf95f0
>
> Best regards,
What's the plan for these fixes? I'm not yet seeing them in Linus' tree,
thus also not in stable.
Jan
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] drm/bridge: tc358767: Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR case
2023-12-15 13:33 ` Jan Kiszka
@ 2023-12-19 10:00 ` Tomi Valkeinen
0 siblings, 0 replies; 7+ messages in thread
From: Tomi Valkeinen @ 2023-12-19 10:00 UTC (permalink / raw)
To: Jan Kiszka
Cc: dri-devel, linux-kernel, Aradhya Bhatia, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter
On 15/12/2023 15:33, Jan Kiszka wrote:
> On 31.10.23 14:26, Tomi Valkeinen wrote:
>> These two patches are needed to make tc358767 work in the
>> DRM_BRIDGE_ATTACH_NO_CONNECTOR case, at least when using a DP connector.
>> The first patch, "drm/bridge: tc358767: Support input format negotiation
>> hook" was already sent separately, but I included it here for
>> completeness, as both are needed to get a working display.
>>
>> I have tested this with TI AM654 EVM with a tc358767 add-on card.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>> ---
>> Aradhya Bhatia (1):
>> drm/bridge: tc358767: Support input format negotiation hook
>>
>> Tomi Valkeinen (1):
>> drm/bridge: tc358767: Fix link properties discovery
>>
>> drivers/gpu/drm/bridge/tc358767.c | 32 ++++++++++++++++++++++++++++++++
>> 1 file changed, 32 insertions(+)
>> ---
>> base-commit: 79d94360d50fcd487edcfe118a47a2881534923f
>> change-id: 20231031-tc358767-58e3ebdf95f0
>>
>> Best regards,
>
> What's the plan for these fixes? I'm not yet seeing them in Linus' tree,
> thus also not in stable.
>
> Jan
>
The discussion continued in v2 of the series. There are some open
question in the tc358767 behavior.
Tomi
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-12-19 10:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-31 13:26 [PATCH 0/2] drm/bridge: tc358767: Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR case Tomi Valkeinen
2023-10-31 13:26 ` [PATCH 1/2] drm/bridge: tc358767: Support input format negotiation hook Tomi Valkeinen
2023-10-31 13:26 ` [PATCH 2/2] drm/bridge: tc358767: Fix link properties discovery Tomi Valkeinen
2023-10-31 16:02 ` Aradhya Bhatia
2023-10-31 17:59 ` [PATCH 0/2] drm/bridge: tc358767: Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR case Jan Kiszka
2023-12-15 13:33 ` Jan Kiszka
2023-12-19 10:00 ` Tomi Valkeinen
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®