-
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
HVS Gamma LUT support for the RPi4 #4435
Conversation
d34c788
to
7ee54bf
Compare
I've changed the authorship to have @6by9 and you as the main author, and removed the register write retries. |
I have tested this patchset successfully on top of the current rpi-5.10.y branch (commit 03ab887). I also verified that LUT register rewrites are indeed no longer necessary and writes always seem to stick. What's a little concerning though is that the screen blanks for ~2 secs for each update of the LUT (96 register writes). FWIW, doing 100 subsequent LUT updates blanks the screen for ~7 secs. I don't know how GNOME or other tools implement the nightlight feature and how many LUT updates at what intervals are performed but it could result in a significant disturbance. As I understand it, this is a HW limitation and IMO it will trigger bug reports. |
Sorry, I totally missed @mripard's update. Slightly weird wording in commit 3's commit text
Missing the word "changed", or "halted"? Other than that, the patches look fine.
It is a hardware limitation, so it's the choice of either blanking, or not supporting the gamma controls. |
Ok. Then I'd rather have support and let the user choose (and deal with the consequences :-)). |
BCM2711 changes from a 256 entry lookup table to a 16 point piecewise linear function as the pipeline bitdepth has increased to make a LUT unwieldy. Implement a simple conversion from a 256 entry LUT that userspace is likely to expect to 16 evenly spread points in the PWL. This could be improved with curve fitting at a later date. Co-developed-by: Juerg Haefliger <[email protected]> Signed-off-by: Juerg Haefliger <[email protected]> Signed-off-by: Dave Stevenson <[email protected]> Signed-off-by: Maxime Ripard <[email protected]>
This helps with debugging the conversion from a 256 point gamma LUT to 16 point PWL entries as used by the BCM2711. Co-developed-by: Juerg Haefliger <[email protected]> Signed-off-by: Juerg Haefliger <[email protected]> Signed-off-by: Dave Stevenson <[email protected]> Signed-off-by: Maxime Ripard <[email protected]>
The HVS Gamma block can only be updated when idle, so we need to disable the HVS channel when the gamma property is set in an atomic commit. Since the pixelvalve cannot have its assigned channel halted without stalling unless it's disabled as well, in our case that means forcing a full disable / enable cycle on the pipeline. Signed-off-by: Maxime Ripard <[email protected]>
7ee54bf
to
583454a
Compare
I've just pushed a new version with the commit log changed like you suggested (and rebased on the current branch) |
LGTM @mripard can I ask you to upstream that if you're happy with it? |
Yep, sure |
kernel: clk: Move vec clock to clk-raspberrypi See: raspberrypi/linux#4639 kernel: ARM: v7: get rid of boot time mini stack See: raspberrypi/linux#4591 kernel: HVS Gamma LUT support for the RPi4 See: raspberrypi/linux#4435 kernel: ARM: dts: Add Pi Zero 2 support firmware: arm_loader: Allow VEC clock to be controlled by arm
kernel: clk: Move vec clock to clk-raspberrypi See: raspberrypi/linux#4639 kernel: ARM: v7: get rid of boot time mini stack See: raspberrypi/linux#4591 kernel: HVS Gamma LUT support for the RPi4 See: raspberrypi/linux#4435 kernel: ARM: dts: Add Pi Zero 2 support firmware: arm_loader: Allow VEC clock to be controlled by arm
So X seems to throw a load of calls through drm_crtc_legacy_gamma_set which always replaces the gamma property blob. I'm just seeing if there is a quick way to do a memcmp before the replace. |
Hi,
Here's a PR to implement the gamma lut property on the rpi4. This is work that has mostly been done by @6by9 and Juerg Haefliger from Canonical.
Maxime