vc4: no GAMMA_LUT or CTM on BCM2711 (Pi 4) CRTCs, so no hardware colour management

オープン
#7,821 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c, linux

調査の方向性

Start with vc4_crtc_init(), vc4_ctm_commit() and the cited HVS5 change, then trace the BCM2711 gamma and colour-matrix programming described in the issue. The issue asks whether HVS5 colour management or an HDMI CSC matrix approach is viable; done means a maintainer-reviewed design and implementation exposing usable colour-management properties on Pi 4 CRTCs.

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

I would like to use the built in video hardware for gamma, brightness & contrast adjustment, and late night tint-shifting on my Raspberry Pi 4. The previous Pis have this and the Pi4 hardware supports it, but is undocumented. (I think the Pi5 has the same issue, but I don't have one so I can't test it).

Thank you,

  • Josh

Below is my formal issue generated with AI:

Describe the bug

On a Pi 4, the vc4 CRTCs expose no colour-management properties: there is no GAMMA_LUT, GAMMA_LUT_SIZE, DEGAMMA_LUT or CTM. A KMS client can't do night-light tinting, colour-temperature or gamma adjustment, or colour-blindness filters in the display pipeline, and has to spend a GPU pass on them instead. On the Pi 3 and earlier (HVS4) the same driver offers GAMMA_LUT and a CTM.

From the source, this looks like support that was never written rather than something the hardware lacks:

  • vc4_crtc_init() calls drm_crtc_enable_color_mgmt() only when vc4->gen == VC4_GEN_4.
  • eb92bc72cd ("drm/vc4: crtc: Disable color management for HVS5", 2020) turned it off "for now", because "The HVS5 uses different color matrices".
  • 8d4cd940d5 ("drm/vc4: hvs: Don't write gamma luts on 2711", 2024) notes that "the gamma block has changed in 2711".
  • vc4_ctm_commit() still runs for gen <= VC4_GEN_5, but no property can reach it on a 2711.

The same is true in rpi-6.19.y. VC4_GEN_6 (Pi 5) seems to be left out by the same check, but I've only tried a Pi 4.

Is HVS5 colour management (its gamma block and colour matrix) something you'd consider adding? If the register layout can't be published, would a patch be welcome that exposes a CTM through the HDMI block's CSC matrix (the one vc5_hdmi_csc_setup() programs today for limited range and YUV)? That would give a colour matrix on HDMI outputs even without HVS gamma.

Steps to reproduce the behaviour
  1. Boot a Pi 4 with dtoverlay=vc4-kms-v3d-pi4 and a monitor on HDMI.
  2. List the vc4 CRTC properties, e.g. modetest -M vc4 -p or drm_info.
  3. Look for GAMMA_LUT, GAMMA_LUT_SIZE, DEGAMMA_LUT or CTM on the CRTCs.

Expected: GAMMA_LUT (with GAMMA_LUT_SIZE) and CTM, as on a Pi 3.
Actual: none of them. In /sys/kernel/debug/dri/1/state the CRTCs show color_mgmt_changed=0 and no gamma or CTM state.

Device (s)

Raspberry Pi 4 Mod. B

System
  • Kernel: 6.12.47-v8, Raspberry Pi tag stable_20250916, built with bcm2711_defconfig (custom Buildroot image, not Raspberry Pi OS)
  • Firmware: Raspberry Pi firmware matching that tag (start4.elf)
  • config.txt: dtoverlay=vc4-kms-v3d-pi4, hdmi_enable_4kp60=1, max_framebuffers=2, disable_overscan=1
  • Display: 3440x1440 @ 60 Hz on HDMI 1
Logs

None. Nothing fails: the properties just aren't created.

Additional context

The use case is a KMS compositor that wants night-light and colour filters at no per-frame cost, covering the hardware cursor and overlay planes too. A shader can only approximate that: it can't tint the cursor plane or direct-scanout video planes, and a gamma curve applied per layer isn't exact where translucent layers blend.

主要言語
C
スター
13.4k
フォーク
5.5k
平均マージ
1日 8時間
マージ済み PR(30日)
37

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

raspberrypi/linux のほかの issue

raspberrypi/linux の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。