-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.10 hdmi cec rework #3999
5.10 hdmi cec rework #3999
Conversation
@pelwell I've attempted to disable by default and enable in the overlay but it's not working. |
e8ebd66
to
3eda551
Compare
Does the overlay now successfully enable the interrupt controllers? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably not merge 961cd2f, or introduce it back.
It was meant to ease the rebasing of my branch, but it still looks useful
Added "drm/vc4: Reading the hotplug register is only valid if no GPIO defined" back. Yes, overlay changes appear successful. |
8cb2e66
to
967d45b
Compare
b1f4757
to
31fbc18
Compare
b760960
to
7f8da0e
Compare
3eda551
to
e51c2f3
Compare
30400fd
to
7a903f9
Compare
3403b48
to
ab9e2a6
Compare
7a903f9
to
e2035e4
Compare
Updated to v2 of patches. cec now works on second hdmi port. Removed WIP. |
18f91b2
to
e9505f4
Compare
e2035e4
to
2dcbc59
Compare
9007908
to
c5f51df
Compare
2dcbc59
to
70c631f
Compare
The code prior to 311e305 ("drm/vc4: hdmi: Implement a register layout abstraction") was relying on the fact that the register offset was incremented by 4 for each readl call. That worked since the register width is 4 bytes. However, since that commit the HDMI_READ macro is now taking an enum, and the offset doesn't increment by 4 but 1 now. Divide the index by 4 to fix this. Fixes: 311e305 ("drm/vc4: hdmi: Implement a register layout abstraction") Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Dom Cobley <popcornmix@gmail.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
The commit 311e305 ("drm/vc4: hdmi: Implement a register layout abstraction") forgot one CEC register, and made a copy and paste mistake for another one. Fix those mistakes. Fixes: 311e305 ("drm/vc4: hdmi: Implement a register layout abstraction") Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Dom Cobley <popcornmix@gmail.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Currently we call cec_phys_addr_invalidate on a hotplug deassert. That may be due to a TV power cycling, or an AVR being switched on (and switching edid). This makes CEC unusable since our controller wouldn't have a physical address anymore. Set it back up again on the hotplug assert. Fixes: 15b4511 ("drm/vc4: add HDMI CEC support") Signed-off-by: Dom Cobley <popcornmix@gmail.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
The CEC clock divider needs to output a frequency of 40kHz from the HSM rate on the BCM2835. The driver used to have a fixed frequency for it, but that changed for the BCM2711 and we now need to compute it dynamically to maintain the proper rate. Fixes: cd4cb49 ("drm/vc4: hdmi: Adjust HSM clock rate depending on pixel rate") Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
As part of the enable sequence we might change the HSM clock rate if the pixel rate is different than the one we were already dealing with. On the BCM2835 however, the CEC clock derives from the HSM clock so any rate change will need to be reflected in the CEC clock divider to output 40kHz. Fixes: cd4cb49 ("drm/vc4: hdmi: Adjust HSM clock rate depending on pixel rate") Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
While the BCM2835 had the CEC clock derived from the HSM clock, the BCM2711 has a dedicated parent clock for it. Let's introduce a separate clock for it so that we can handle both cases. Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
The BCM2711 has two different interrupt sources to transmit and receive CEC messages, provided through an external interrupt chip shared between the two HDMI interrupt controllers. The rest of the CEC controller is identical though so we need to change a bit the code organisation to share the code as much as possible, yet still allowing to register independant handlers. Signed-off-by: Maxime Ripard <maxime@cerno.tech> Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
The HDMI controller found in the BCM2711 has an external interrupt controller for the CEC and hotplug interrupt shared between the two instances. Let's add a variant flag to register a single interrupt handler and deals with the interrupt handler setup, or two interrupt handlers relying on an external irqchip. Signed-off-by: Maxime Ripard <maxime@cerno.tech> Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Now that our HDMI controller supports CEC for the BCM2711, let's remove that flag. Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Dom Cobley <popcornmix@gmail.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
We introduced the BCM2711 support to the vc4 HDMI controller with 5.10, but this was lacking any of the interrupts of the CEC controller so we have to deal with the backward compatibility. Do so by simply ignoring the CEC setup if the DT doesn't have the interrupts property. Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
The CEC and hotplug interrupts were missing when that binding was introduced, let's add them in now that we've figured out how it works. Signed-off-by: Maxime Ripard <maxime@cerno.tech> Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
The BSC controllers used for the HDMI DDC have an interrupt controller shared between both instances. Let's add it to avoid polling. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
The CEC and hotplug interrupts go through an interrupt controller shared between the two HDMI controllers. Let's add that interrupt controller and the interrupts for both HDMI controllers Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Unlike the previous generations, the HSM clock limitation is way above what we can reach without scrambling, so let's move the maximum frequency we support to the maximum clock frequency without scrambling. Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Now handled through aon_intr Signed-off-by: Dom Cobley <popcornmix@gmail.com>
70c631f
to
4db4e1a
Compare
[edit] ignore that - I'm on an older firmware that doesn't disable its handling of cec interrupts |
I think this is good. I believe it's been accepted upstream and testing on Pi3 and Pi4 with kms worked. |
@pelwell okay to merge? |
kernel: media: i2c: imx290: Support V4L2_CID_ANALOGUE_GAIN as well as V4L2_CID_GAIN See: raspberrypi/linux#4119 kernel: i2c: bcm2835: Handle untimely DONE signal See: raspberrypi/linux#3064 kernel: 5.10 hdmi cec rework See: raspberrypi/linux#3999 kernel: w1: w1_therm: Fix conversion result for negative temperatures See: raspberrypi/linux#4124 kernel: staging:bcm2835-camera: Fix the cherry-pick of AWB Greyworld See: raspberrypi/linux#4131
kernel: media: i2c: imx290: Support V4L2_CID_ANALOGUE_GAIN as well as V4L2_CID_GAIN See: raspberrypi/linux#4119 kernel: i2c: bcm2835: Handle untimely DONE signal See: raspberrypi/linux#3064 kernel: 5.10 hdmi cec rework See: raspberrypi/linux#3999 kernel: w1: w1_therm: Fix conversion result for negative temperatures See: raspberrypi/linux#4124 kernel: staging:bcm2835-camera: Fix the cherry-pick of AWB Greyworld See: raspberrypi/linux#4131
I rebased my tree this morning (still 5.10.13) and I appear to not be able to enable i2c_vc or i2c_arm successfully
This is the main DT change going, but I can't immediately see any issue with it. I'm doing a quick roll-back to try and confirm. Whilst that's building I'll do an rpi-update to check 5.10.14 out. |
Sorry, I should add that it was when vc4-kms-v3d was loaded as well. |
5.10.14-v7l from rpi-update files also fail with |
98a2669 (with a couple of WIP patches on top) is good. |
This switches our CEC support to the version @mripard has cleaned up for upstreaming.
In testing it worked for me using kms on Pi3 and Pi4 in a range of HDMI modes.