On Sun, Oct 19, 2025 at 12:06:32PM +0200, Federico Amedeo Izzo via B4 Relay wrote: > From: Federico Amedeo Izzo <[email protected]> > > Add support for DSPP GC block in DPU driver for Qualcomm SoCs. > Expose the GAMMA_LUT DRM property, which is needed to enable > night light and basic screen color calibration. > > I used LineageOS downstream kernel as a reference and found the LUT > format by trial-and-error on OnePlus 6. > > Tested on oneplus-enchilada (sdm845-mainline 6.16-dev) and xiaomi-tissot > (msm8953-mainline 6.12/main). > > Tested-by: David Heidelberg <[email protected]> # Pixel 3 (next-20251018) > Tested-by: Guido Günther <[email protected]> # on sdm845-shift-axolotl > Signed-off-by: Federico Amedeo Izzo <[email protected]> > --- > DRM GAMMA_LUT support was missing on sdm845 and other Qualcomm SoCs using > DPU for CRTC. This is needed in userspace to enable features like Night > Light or basic color calibration. > > I wrote this driver to enable Night Light on OnePlus 6, and after the > driver was working I found out it applies to the 29 different Qualcomm SoCs > that use the DPU display engine, including X1E for laptops. > > I used the LineageOS downstream kernel as reference and found the correct > LUT format by trial-and-error on OnePlus 6. > > This was my first Linux driver and it's been a great learning > experience. > > The patch was reviewed by postmarketOS contributors here: > https://gitlab.com/sdm845-mainline/linux/-/merge_requests/137 > During review the patch was tested successfully on hamoa (X1E). > --- > Changes in v3: > - Remove memset() after kzalloc() in dpu_crtc.c > - Simplify error messages in dpu_crtc.c and dpu_hw_dspp.c > - Use 0 for DPU_REG_WRITE() instead of reg = 0 in dpu_hw_dspp.c > - Link to v2: > https://lore.kernel.org/r/[email protected] > > Changes in v2: > - Fix gc register .len and .version in dpu_hw_catalog.c > - Apply coding style suggestions > - Link to v1: > https://lore.kernel.org/r/[email protected] > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 86 > +++++++++++++++++++++----- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 4 ++ > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 4 ++ > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 3 + > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c | 54 ++++++++++++++++ > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.h | 26 ++++++++ > 6 files changed, 163 insertions(+), 14 deletions(-) >
Reviewed-by: Dmitry Baryshkov <[email protected]> -- With best wishes Dmitry
