-
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
drm/vc4: Remove request for min clocks when hdmi output is disabled #6416
Conversation
We do call I would have expected the clock framework to ignore any min clock request for a disabled consumer. That may be a false expectation, but feels worth checking out. |
I put some logging in, and I don't believe |
Ah - printk without a Calling So, |
fa099e6
to
f8ea204
Compare
@mripard is it required for clients to call |
Yeah, there's no link between a rate boundary and a whether the clock is enabled or not. Both can happen independently. So you need to explicitly call clk_set_min_rate here indeed. |
It looks like vc4_hvs and vc4_v3d also have clocks that are left with uncleared min clock requests, so added those. rpivid_video, bcm2835-unicam also use clk_set_min_rate, but appear to cleat the request correctly anyway. (make this draft until I've done more testing on additional changes) |
f8ea204
to
279fc89
Compare
Typo in the comments of |
279fc89
to
057cec0
Compare
Updated comments, and tested on Pi3, Pi4 and Pi5 (with a range of hdmi hotplug/removes and v3d use). |
drivers/gpu/drm/vc4/vc4_hdmi.c
Outdated
clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock); | ||
clk_set_min_rate(vc4_hdmi->hsm_clock, 0); |
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.
Can you explain why the pairing of this line with the following line (which reference hsm_clock
and pixel_clock
) doesn't match other clk_set_min_rate
and clk_disable_unprepare
pairs - or at least say that it is expected and correct?
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.
Good point. vc4_hdmi->hsm_clock
and vc4_hdmi->pixel_bvb_clock
are the clocks that previously were used with clk_set_min_rate
, so the lines added are as intended.
But, when I moved them from disable
to destroy
I assumed they lined up with the clocks being disabled, but as you say that is not quite matching. Let me have a closer look.
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.
Thanks - I can believe that does what you want.
057cec0
to
473129f
Compare
Currently, booting with no hdmi connected has: pi@pi4:~ $ vcgencmd measure_clock hdmi pixel frequency(9)=120010256 frequency(29)=74988280 After connecting hdmi we get: pi@pi4:~ $ vcgencmd measure_clock hdmi pixel frequency(9)=300005856 frequency(29)=149989744 and that persists after disconnecting hdmi I can measure this on a power supply as [email protected] (52mW). We should always remove clk_set_min_rate requests when we no longer need them. Signed-off-by: Dom Cobley <[email protected]>
473129f
to
56d8fdf
Compare
I've moved the clearing of |
See: raspberrypi/linux#6412 kernel: dtoverlays: Fix up imx500 overlays to have unique clock nodes See: raspberrypi/linux#6415 kernel: configs: Enable HOTPLUG_CPU See: raspberrypi/linux#6409 kernel: dtoverlays: Add an overlay for Waveshare's 800x480 4.3" DSI screen See: raspberrypi/linux#6417 kernel: drm/vc4: Remove request for min clocks when hdmi output is disabled See: raspberrypi/linux#6416
See: raspberrypi/linux#6412 kernel: dtoverlays: Fix up imx500 overlays to have unique clock nodes See: raspberrypi/linux#6415 kernel: configs: Enable HOTPLUG_CPU See: raspberrypi/linux#6409 kernel: dtoverlays: Add an overlay for Waveshare's 800x480 4.3" DSI screen See: raspberrypi/linux#6417 kernel: drm/vc4: Remove request for min clocks when hdmi output is disabled See: raspberrypi/linux#6416
Currently, booting with no hdmi connected has:
pi@pi4:~ $ vcgencmd measure_clock hdmi pixel
frequency(9)=120010256
frequency(29)=74988280
After connecting hdmi we get:
pi@pi4:~ $ vcgencmd measure_clock hdmi pixel
frequency(9)=300005856
frequency(29)=149989744
and that persists after disconnecting hdmi
I can measure this on a power supply as [email protected] (52mW).
We should always remove clk_set_min_rate requests
when we no longer need them.