drm: xlnx: zynqmp_dpsub: also call drm_helper_hpd_irq_event
Subsystems (4)
PATCH 1/1 drm: xlnx: zynqmp_dpsub: also call drm_helper_hpd_irq_event
From: Steffen Dirkwinkel <[email protected]>
With hpd going through the bridge as of commit eb2d64bfcc17 ("drm: xlnx: zynqmp_dpsub: Report HPD through the bridge") we don't get hotplug events in userspace on zynqmp hardware. Also sending hotplug events with drm_helper_hpd_irq_event works.
--- drivers/gpu/drm/xlnx/zynqmp_dp.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/xlnx/zynqmp_dp.c +4 -0
@@ -17,6 +17,7 @@#include <drm/drm_fourcc.h> #include <drm/drm_modes.h> #include <drm/drm_of.h> +#include <drm/drm_probe_helper.h> #include <linux/clk.h> #include <linux/delay.h>
@@ -1614,6 +1615,9 @@ static void zynqmp_dp_hpd_work_func(struct work_struct *work) hpd_work.work);enum drm_connector_status status; +if (dp->bridge.dev) +drm_helper_hpd_irq_event (dp->bridge.dev); + status =zynqmp_dp_bridge_detect (&dp->bridge);drm_bridge_hpd_notify (&dp->bridge, status); }
Signature · 1 line
2.46.1
Laurent Pinchart
maintainerHi Steffen,
Thank you for the patch.
Quoted 6 lines · On Mon, Sep 23, 2024 at 09:48:03AM +0200, [email protected] wrote:
From: Steffen Dirkwinkel <[email protected]>
With hpd going through the bridge as of commit
eb2d64bfcc17("drm: xlnx:zynqmp_dpsub: Report HPD through the bridge") we don't get hotplug events in userspace on zynqmp hardware. Also sending hotplug events withdrm_helper_hpd_irq_eventworks.
Why does the driver need to call both drm_helper_hpd_irq_event() and drm_bridge_hpd_notify() ? The latter should end up calling drm_kms_helper_connector_hotplug_event(), which is the same function that drm_helper_hpd_irq_event() calls.
Quoted 28 lines
Fixes eb2d64bfcc17 ("drm: xlnx: zynqmp_dpsub: Report HPD through the bridge")Signed-off-by Steffen Dirkwinkel <[email protected]>--- drivers/gpu/drm/xlnx/zynqmp_dp.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/gpu/drm/xlnx/zynqmp_dp.c +4
-0@@ -17,6 +17,7 @@#include <drm/drm_fourcc.h> #include <drm/drm_modes.h> #include <drm/drm_of.h> +#include <drm/drm_probe_helper.h> #include <linux/clk.h> #include <linux/delay.h> @@ -1614,6 +1615,9 @@ static void zynqmp_dp_hpd_work_func(struct work_struct *work) hpd_work.work);enum drm_connector_status status; +if (dp->bridge.dev) +drm_helper_hpd_irq_event (dp->bridge.dev); + status =zynqmp_dp_bridge_detect (&dp->bridge);drm_bridge_hpd_notify (&dp->bridge, status); }
Signature · 3 lines
Regards, Laurent Pinchart
Hi Laurent,
Quoted 12 lines · Laurent Pinchart
Hi Steffen,
Thank you for the patch.
Quoted 6 lines · On Mon, Sep 23, 2024 at 09:48:03AM +0200, [email protected] wrote:
From: Steffen Dirkwinkel <[email protected]>
With hpd going through the bridge as of commit
eb2d64bfcc17("drm: xlnx:zynqmp_dpsub: Report HPD through the bridge") we don't get hotplug events in userspace on zynqmp hardware. Also sending hotplug events withdrm_helper_hpd_irq_eventworks.
Quoted 4 lines
Why does the driver need to call both
drm_helper_hpd_irq_event()anddrm_bridge_hpd_notify()? The latter should end up callingdrm_kms_helper_connector_hotplug_event(), which is the same function thatdrm_helper_hpd_irq_event()calls.
I don't know why we need drm_helper_hpd_irq_event. I'll try to trace what happens on hotplug.
Quoted 33 lines
Quoted 32 lines
Fixes eb2d64bfcc17 ("drm: xlnx: zynqmp_dpsub: Report HPD throughthe bridge")
Signed-off-by Steffen Dirkwinkel <[email protected]>---
drivers/gpu/drm/xlnx/zynqmp_dp.c | 4 ++++1 file changed, 4 insertions(+)drivers/gpu/drm/xlnx/zynqmp_dp.c +1
-0@@ -17,6 +17,7 @@ #include <drm/drm_fourcc.h> #include <drm/drm_modes.h> #include <drm/drm_of.h> +#include <drm/drm_probe_helper.h>
#include <linux/clk.h>
#include <linux/delay.h>drivers/gpu/drm/xlnx/zynqmp_dp.c +0
-0@@ -1614,6 +1615,9 @@ static void zynqmp_dp_hpd_work_func(struct work_struct *work) hpd_work.work); enum drm_connector_status status;drivers/gpu/drm/xlnx/zynqmp_dp.c +3
-0+if (dp->bridge.dev) +drm_helper_hpd_irq_event (dp->bridge.dev); +status =
zynqmp_dp_bridge_detect(&dp->bridge);drm_bridge_hpd_notify(&dp->bridge, status); }
Laurent Pinchart
maintainerHi Steffen,
Quoted 9 lines · Steffen Dirkwinkel
Quoted 8 lines · Laurent Pinchart
Quoted 6 lines · On Mon, Sep 23, 2024 at 09:48:03AM +0200, [email protected] wrote:
From: Steffen Dirkwinkel <[email protected]>
With hpd going through the bridge as of commit
eb2d64bfcc17("drm: xlnx:zynqmp_dpsub: Report HPD through the bridge") we don't get hotplug events in userspace on zynqmp hardware. Also sending hotplug events withdrm_helper_hpd_irq_eventworks.
Quoted 7 lines
Quoted 4 lines
Why does the driver need to call both
drm_helper_hpd_irq_event()anddrm_bridge_hpd_notify()? The latter should end up callingdrm_kms_helper_connector_hotplug_event(), which is the same function thatdrm_helper_hpd_irq_event()calls.I don't know why we need
drm_helper_hpd_irq_event. I'll try to trace what happens on hotplug.
Thank you. Let's try to find the best solution based on your findings.
Quoted 31 lines
Quoted 31 lines
Quoted 31 lines
Fixes eb2d64bfcc17 ("drm: xlnx: zynqmp_dpsub: Report HPD throughthe bridge")
Signed-off-by Steffen Dirkwinkel <[email protected]>---
drivers/gpu/drm/xlnx/zynqmp_dp.c | 4 ++++1 file changed, 4 insertions(+)drivers/gpu/drm/xlnx/zynqmp_dp.c +1
-0@@ -17,6 +17,7 @@ #include <drm/drm_fourcc.h> #include <drm/drm_modes.h> #include <drm/drm_of.h> +#include <drm/drm_probe_helper.h>
#include <linux/clk.h>
#include <linux/delay.h>drivers/gpu/drm/xlnx/zynqmp_dp.c +0
-0@@ -1614,6 +1615,9 @@ static void zynqmp_dp_hpd_work_func(struct work_struct *work) hpd_work.work); enum drm_connector_status status;drivers/gpu/drm/xlnx/zynqmp_dp.c +3
-0+if (dp->bridge.dev) +drm_helper_hpd_irq_event (dp->bridge.dev); +status =
zynqmp_dp_bridge_detect(&dp->bridge);drm_bridge_hpd_notify(&dp->bridge, status); }
Signature · 3 lines
Regards, Laurent Pinchart
Hi Laurent,
Quoted 20 lines · Laurent Pinchart
Hi Steffen,
Quoted 17 lines · Steffen Dirkwinkel
Quoted 15 lines · Laurent Pinchart
Quoted 7 lines · On Mon, Sep 23, 2024 at 09:48:03AM +0200, [email protected] wrote:
From: Steffen Dirkwinkel <[email protected]>
With hpd going through the bridge as of commit
eb2d64bfcc17("drm: xlnx:zynqmp_dpsub: Report HPD through the bridge") we don't get hotplug events in userspace on zynqmp hardware. Also sending hotplug events withdrm_helper_hpd_irq_eventworks.Why does the driver need to call both
drm_helper_hpd_irq_event()anddrm_bridge_hpd_notify()? The latter should end up callingdrm_kms_helper_connector_hotplug_event(), which is the same function
thatdrm_helper_hpd_irq_event()calls.
Quoted 5 lines
Quoted 2 lines
I don't know why we need
drm_helper_hpd_irq_event. I'll try to trace what happens on hotplug.Thank you. Let's try to find the best solution based on your findings.
There's just nothing registering for hpd with "drm_bridge_connector_enable_hpd" or "drm_bridge_hpd_enable". I'm not sure what the correct way to implement this is. In "drivers/gpu/drm/bridge/ti-tfp410.c" the driver registers for the callback and calls "drm_helper_hpd_irq_event" in the callback. I guess we could also do that, but then we might as well call drm_helper_hpd_irq_event directly? Some other drivers just call both like I did here. (drivers/gpu/drm/mediatek/mtk_hdmi.c for example) For "drivers/gpu/drm/msm/hdmi/hdmi_bridge.c" I also can't find the hpd enable call and it just calls drm_bridge_hpd_notify.
Quoted 35 lines
Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
Fixes eb2d64bfcc17 ("drm: xlnx: zynqmp_dpsub: Report HPDthrough
the bridge")Signed-off-by Steffen Dirkwinkel <[email protected]>---
drivers/gpu/drm/xlnx/zynqmp_dp.c | 4 ++++1 file changed, 4 insertions(+)drivers/gpu/drm/xlnx/zynqmp_dp.c +1
-0@@ -17,6 +17,7 @@ #include <drm/drm_fourcc.h> #include <drm/drm_modes.h> #include <drm/drm_of.h> +#include <drm/drm_probe_helper.h>
#include <linux/clk.h>
#include <linux/delay.h>drivers/gpu/drm/xlnx/zynqmp_dp.c +0
-0@@ -1614,6 +1615,9 @@ static voidzynqmp_dp_hpd_work_func(struct
work_struct*work)
hpd_work.work); enumdrm_connector_statusstatus;drivers/gpu/drm/xlnx/zynqmp_dp.c +3
-0+if (dp->bridge.dev) +drm_helper_hpd_irq_event (dp->bridge.dev); +status =
zynqmp_dp_bridge_detect(&dp->bridge);drm_bridge_hpd_notify(&dp->bridge, status); }
Quoted 30 lines · Steffen Dirkwinkel
Hi Laurent,
Quoted 20 lines · Laurent Pinchart
Hi Steffen,
Quoted 17 lines · Steffen Dirkwinkel
Quoted 15 lines · Laurent Pinchart
Quoted 7 lines · On Mon, Sep 23, 2024 at 09:48:03AM +0200, [email protected] wrote:
From: Steffen Dirkwinkel <[email protected]>
With hpd going through the bridge as of commit
eb2d64bfcc17("drm: xlnx:zynqmp_dpsub: Report HPD through the bridge") we don't get hotplug events in userspace on zynqmp hardware. Also sending hotplug events withdrm_helper_hpd_irq_eventworks.Why does the driver need to call both
drm_helper_hpd_irq_event()anddrm_bridge_hpd_notify()? The latter should end up callingdrm_kms_helper_connector_hotplug_event(), which is the same function
thatdrm_helper_hpd_irq_event()calls.Quoted 5 lines
Quoted 2 lines
I don't know why we need
drm_helper_hpd_irq_event. I'll try to trace what happens on hotplug.Thank you. Let's try to find the best solution based on your findings.
Quoted 10 lines
There's just nothing registering for hpd with "
drm_bridge_connector_enable_hpd" or "drm_bridge_hpd_enable". I'm not sure what the correct way to implement this is. In "drivers/gpu/drm/bridge/ti-tfp410.c" the driver registers for the callback and calls "drm_helper_hpd_irq_event" in the callback. I guess we could also do that, but then we might as well calldrm_helper_hpd_irq_eventdirectly? Some other drivers just call both like I did here. (drivers/gpu/drm/mediatek/mtk_hdmi.cfor example) For "drivers/gpu/drm/msm/hdmi/hdmi_bridge.c" I also can't find the hpd enable call and it just callsdrm_bridge_hpd_notify.
The drm_bridge_connector handles enabling it for you when the driver calls drm_kms_helper_poll_init() / drm_kms_helper_poll_enable(). It seems zynqmp_kms calls drm_kms_helper_poll_init() too early, before creating DP chain, so the HPD doesn't get enabled.
Quoted 37 lines
Quoted 36 lines
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Fixes eb2d64bfcc17 ("drm: xlnx: zynqmp_dpsub: Report HPDthrough
the bridge")Signed-off-by Steffen Dirkwinkel <[email protected]>---
drivers/gpu/drm/xlnx/zynqmp_dp.c | 4 ++++1 file changed, 4 insertions(+)drivers/gpu/drm/xlnx/zynqmp_dp.c +1
-0@@ -17,6 +17,7 @@ #include <drm/drm_fourcc.h> #include <drm/drm_modes.h> #include <drm/drm_of.h> +#include <drm/drm_probe_helper.h>
#include <linux/clk.h>
#include <linux/delay.h>drivers/gpu/drm/xlnx/zynqmp_dp.c +0
-0@@ -1614,6 +1615,9 @@ static voidzynqmp_dp_hpd_work_func(struct
work_struct*work)
hpd_work.work); enumdrm_connector_statusstatus;drivers/gpu/drm/xlnx/zynqmp_dp.c +3
-0+if (dp->bridge.dev) +drm_helper_hpd_irq_event (dp->bridge.dev); +status =
zynqmp_dp_bridge_detect(&dp->bridge);drm_bridge_hpd_notify(&dp->bridge, status); }
Signature · 2 lines
With best wishes Dmitry
Quoted 50 lines · Dmitry Baryshkov
Quoted 34 lines · Steffen Dirkwinkel
Hi Laurent,
Quoted 24 lines · Laurent Pinchart
Hi Steffen,
Quoted 20 lines · Steffen Dirkwinkel
Quoted 18 lines · Laurent Pinchart
Quoted 8 lines · On Mon, Sep 23, 2024 at 09:48:03AM +0200, [email protected] wrote:
From: Steffen Dirkwinkel <[email protected]>
With hpd going through the bridge as of commit
eb2d64bfcc17("drm: xlnx:zynqmp_dpsub: Report HPD through the bridge") we don't get hotplug events in userspace on zynqmp hardware.
Also sending hotplug events withdrm_helper_hpd_irq_eventworks.Why does the driver need to call both
drm_helper_hpd_irq_event()
anddrm_bridge_hpd_notify()? The latter should end up callingdrm_kms_helper_connector_hotplug_event(), which is the same function
thatdrm_helper_hpd_irq_event()calls.Quoted 5 lines
Quoted 2 lines
I don't know why we need
drm_helper_hpd_irq_event. I'll try to trace what happens on hotplug.Thank you. Let's try to find the best solution based on your findings.
Quoted 14 lines
There's just nothing registering for hpd with "
drm_bridge_connector_enable_hpd" or "drm_bridge_hpd_enable". I'm not
sure what the correct way to implement this is. In "drivers/gpu/drm/bridge/ti-tfp410.c" the driver registers for the callback and calls "drm_helper_hpd_irq_event" in the callback. I guess
we could also do that, but then we might as well calldrm_helper_hpd_irq_eventdirectly? Some other drivers just call both
like I did here. (drivers/gpu/drm/mediatek/mtk_hdmi.cfor example) For "drivers/gpu/drm/msm/hdmi/hdmi_bridge.c" I also can't find the hpd
enable call and it just callsdrm_bridge_hpd_notify.
Quoted 4 lines
The
drm_bridge_connectorhandles enabling it for you when the driver callsdrm_kms_helper_poll_init()/drm_kms_helper_poll_enable(). It seemszynqmp_kmscallsdrm_kms_helper_poll_init()too early, before creating DP chain, so the HPD doesn't get enabled.
Yes, that's it. Thank you
I'll send a patch for it.
Quoted 41 lines
Quoted 40 lines
Quoted 39 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Fixes eb2d64bfcc17 ("drm: xlnx: zynqmp_dpsub: Report HPDthrough
the bridge")
Signed-off-by: Steffen Dirkwinkel
<[email protected]>
---
drivers/gpu/drm/xlnx/zynqmp_dp.c | 4 ++++1 file changed, 4 insertions(+)drivers/gpu/drm/xlnx/zynqmp_dp.c +1
-0@@ -17,6 +17,7 @@ #include <drm/drm_fourcc.h> #include <drm/drm_modes.h> #include <drm/drm_of.h> +#include <drm/drm_probe_helper.h>
#include <linux/clk.h>
#include <linux/delay.h>drivers/gpu/drm/xlnx/zynqmp_dp.c +0
-0@@ -1614,6 +1615,9 @@ static voidzynqmp_dp_hpd_work_func(struct
work_struct*work)
hpd_work.work);
enumdrm_connector_statusstatus;drivers/gpu/drm/xlnx/zynqmp_dp.c +3
-0+if (dp->bridge.dev) +drm_helper_hpd_irq_event (dp->bridge.dev); +status =
zynqmp_dp_bridge_detect(&dp->bridge);drm_bridge_hpd_notify(&dp->bridge, status); }
Steffen Dirkwinkel
Quoted 50 lines · Dmitry Baryshkov
Quoted 34 lines · Steffen Dirkwinkel
Hi Laurent,
Quoted 24 lines · Laurent Pinchart
Hi Steffen,
Quoted 20 lines · Steffen Dirkwinkel
Quoted 18 lines · Laurent Pinchart
Quoted 8 lines · On Mon, Sep 23, 2024 at 09:48:03AM +0200, [email protected] wrote:
From: Steffen Dirkwinkel <[email protected]>
With hpd going through the bridge as of commit
eb2d64bfcc17("drm: xlnx:zynqmp_dpsub: Report HPD through the bridge") we don't get hotplug events in userspace on zynqmp hardware.
Also sending hotplug events withdrm_helper_hpd_irq_eventworks.Why does the driver need to call both
drm_helper_hpd_irq_event()
anddrm_bridge_hpd_notify()? The latter should end up callingdrm_kms_helper_connector_hotplug_event(), which is the same function
thatdrm_helper_hpd_irq_event()calls.Quoted 5 lines
Quoted 2 lines
I don't know why we need
drm_helper_hpd_irq_event. I'll try to trace what happens on hotplug.Thank you. Let's try to find the best solution based on your findings.
Quoted 14 lines
There's just nothing registering for hpd with "
drm_bridge_connector_enable_hpd" or "drm_bridge_hpd_enable". I'm not
sure what the correct way to implement this is. In "drivers/gpu/drm/bridge/ti-tfp410.c" the driver registers for the callback and calls "drm_helper_hpd_irq_event" in the callback. I guess
we could also do that, but then we might as well calldrm_helper_hpd_irq_eventdirectly? Some other drivers just call both
like I did here. (drivers/gpu/drm/mediatek/mtk_hdmi.cfor example) For "drivers/gpu/drm/msm/hdmi/hdmi_bridge.c" I also can't find the hpd
enable call and it just callsdrm_bridge_hpd_notify.
Quoted 4 lines
The
drm_bridge_connectorhandles enabling it for you when the driver callsdrm_kms_helper_poll_init()/drm_kms_helper_poll_enable(). It seemszynqmp_kmscallsdrm_kms_helper_poll_init()too early, before creating DP chain, so the HPD doesn't get enabled.
Yes, that's it. Thank you
I'll send a patch for it.
Quoted 41 lines
Quoted 40 lines
Quoted 39 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Fixes eb2d64bfcc17 ("drm: xlnx: zynqmp_dpsub: Report HPDthrough
the bridge")
Signed-off-by: Steffen Dirkwinkel
<[email protected]>
---
drivers/gpu/drm/xlnx/zynqmp_dp.c | 4 ++++1 file changed, 4 insertions(+)drivers/gpu/drm/xlnx/zynqmp_dp.c +1
-0@@ -17,6 +17,7 @@ #include <drm/drm_fourcc.h> #include <drm/drm_modes.h> #include <drm/drm_of.h> +#include <drm/drm_probe_helper.h>
#include <linux/clk.h>
#include <linux/delay.h>drivers/gpu/drm/xlnx/zynqmp_dp.c +0
-0@@ -1614,6 +1615,9 @@ static voidzynqmp_dp_hpd_work_func(struct
work_struct*work)
hpd_work.work);
enumdrm_connector_statusstatus;drivers/gpu/drm/xlnx/zynqmp_dp.c +3
-0+if (dp->bridge.dev) +drm_helper_hpd_irq_event (dp->bridge.dev); +status =
zynqmp_dp_bridge_detect(&dp->bridge);drm_bridge_hpd_notify(&dp->bridge, status); }