-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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: Notify firmware when use of simple framebuffer is complete #4421
drm/vc4: Notify firmware when use of simple framebuffer is complete #4421
Conversation
The raspberrypi,firmware property has been documented as required in the binding but was never actually used in the final version of the binding. Remove it. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
The vc4 driver will need to tell the firmware that it takes over the display for the firmware to free its resources (lower the clock, free some memory, etc.) Let's add an optional phandle to our firmware node. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
@mripard this tested okay for me with LibreELEC on Pi3 and Pi4 with "ARM FB" allocation removed from |
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.
A few minor niggles...
Testing on LibreELEC / RPi4 was fine here as well, core clock boost and framebuffer allocations were removed as expected |
The RPI_FIRMWARE_NOTIFY_DISPLAY_DONE firmware call allows to tell the firmware the kernel is in charge of the display now and the firmware can free whatever resources it was using. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
The bind hooks will modify their controller registers, so simplefb is going to be unusable anyway. Let's avoid any transient state where it could still be in the system but no longer functionnal. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
04d5f7f
to
0805ea9
Compare
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.
Yes, that looks better. If you can remove that extra blank line I'll merge.
Once the call to drm_fb_helper_remove_conflicting_framebuffers() has been made, simplefb has been unregistered and the KMS driver is entirely in charge of the display. Thus, we can notify the firmware it can free whatever resource it was using to maintain simplefb functional. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Add the firmware phandle to the vc4 node so that we can send it the message that we're done with the firmware display. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
0805ea9
to
6ce13aa
Compare
Yep, it looks great, thanks! |
…mplete See: raspberrypi/linux#4421 kernel: Fix CPU hang when using CEC while HDMI output is disabled See: raspberrypi/linux#4418 kernel: drm/vc4: hdmi: Add missing clk_disable_unprepare on error path See: raspberrypi/linux#4426 kernel: staging: vc04_services: isp: Set the YUV420/YVU420 format stride to 64 bytes See: raspberrypi/linux#4419 kernel: media: i2c: imx477: Add support for imx378 as a compatible sensor See: raspberrypi/linux#4420
…mplete See: raspberrypi/linux#4421 kernel: Fix CPU hang when using CEC while HDMI output is disabled See: raspberrypi/linux#4418 kernel: drm/vc4: hdmi: Add missing clk_disable_unprepare on error path See: raspberrypi/linux#4426 kernel: staging: vc04_services: isp: Set the YUV420/YVU420 format stride to 64 bytes See: raspberrypi/linux#4419 kernel: media: i2c: imx477: Add support for imx378 as a compatible sensor See: raspberrypi/linux#4420
With latest firmware and this call, the firmware is able to free the memory allocation for the simple framebuffer that was used in initial booting. This can be up to 16MB of gpu memory when running with
hdmi_enable_4kp60=1
.It also allows the firmware to release the boost to the core clock that was necessary when driving that hdmi mode, and may no longer be required if kms choosing a lower resolution hdmi mode.