Let's support Gamma LUT configuration on RK3288 SoCs. In order to do so, this series adds a new and optional address resource. A separate address resource is required because on this RK3288, the LUT address is after the MMU address, which is requested by the iommu driver. This prevents the DRM driver from requesting an entire register space. The current implementation works for RGB 10-bit tables, as that is what seems to work on RK3288. This has been tested on a Rock2 Square board, using 'modetest' tool (modetest now supports GAMMA_LUT property), with legacy and atomic APIs. In addition, I've tested it with Jacopo's modified kmsxx [1], See the rcar-du color management series for more information [2]. [1] https://jmondi.org/cgit/kmsxx/ [2] https://lkml.org/lkml/2019/9/6/490 Thanks, Eze Changes from v2: * revert Sean Paul's patch, in order to use atomic_commit_tail hook. * add RFC/patch for color management on resume. Changes from v1: * drop explicit linear LUT after finding a proper way to disable gamma correction. * avoid setting gamma is the CRTC is not active. * s/int/unsigned int as suggested by Jacopo. * only enable color management and set gamma size if gamma LUT is supported, suggested by Doug. * drop the reg-names usage, and instead just use indexed reg specifiers, suggested by Doug. Changes from RFC: * Request (an optional) address resource for the LUT. * Add devicetree changes. * Drop support for RK3399, which doesn't seem to work out of the box and needs more research. * Support pass-thru setting when GAMMA_LUT is NULL. * Add a check for the gamma size, as suggested by Ilia. * Move gamma setting to atomic_commit_tail, as pointed out by Jacopo/Laurent, is the correct way. Ezequiel Garcia (5): Revert "drm/rockchip: Use drm_atomic_helper_commit_tail_rpm" dt-bindings: display: rockchip: document VOP gamma LUT address drm/rockchip: Add optional support for CRTC gamma LUT ARM: dts: rockchip: Add RK3288 VOP gamma LUT address RFC: drm/atomic-helper: Reapply color transformation after resume .../display/rockchip/rockchip-vop.txt | 6 +- arch/arm/boot/dts/rk3288.dtsi | 4 +- drivers/gpu/drm/drm_atomic_helper.c | 12 ++ drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 24 +++- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 114 ++++++++++++++++++ drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 7 ++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 + 7 files changed, 165 insertions(+), 4 deletions(-) -- 2.22.0 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel