vc4/hdmi: Always enable GCP with AVMUTE cleared
authorDom Cobley <popcornmix@gmail.com>
Wed, 11 Jan 2023 17:30:58 +0000 (17:30 +0000)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Tue, 24 Jan 2023 08:49:14 +0000 (08:49 +0000)
commit56950b317678e7a05f9440b812a7fdda9d5378e8
treed490f79f6b6fbb427aecf82e8e78c132b3eee531
parent7ed8668983f073d6b6fb0bd10cc7a0a5bb7dfb1b
vc4/hdmi: Always enable GCP with AVMUTE cleared

See: https://forum.libreelec.tv/thread/24780-le-10-0-1-rpi4-no-picture-after-update-from-le-10-0-0

Issue is some displays go blank at the point of firmware to kms handover.
Plugging/unplugging hdmi cable, power cycling display, or switching standby off/on
typically resolve this case.

Finally managed to find a display that suffers from this, and track down the issue.

The firmware uses AVMUTE in normal operation. It will set AVMUTE before disabling hdmi
clocks and phy. It will clear AVMUTE after clocks and phy are set up for a new hdmi mode.

But with the hdmi handover from firmware to kms, AVMUTE will be set by firmware.

kms driver typically has no GCP packet (except for deep colour modes).
The spec isn't clear on whether to consider the AVMUTE as continuing indefinitely
in the absense of a GCP packet, or to consider that state to have ended.

Most displays behave as we want, but there are a number (from mutiple manufacturers)
which need to see AVMUTE cleared before displaying a picture.

Lets just always enable GCP packet with AVMUTE cleared. That resolves the issue on
problematic displays.

From HDMI 1.4 spec:
A CD field of zero (Color Depth not indicated) shall be used whenever the Sink does
not indicate support for Deep Color. This value may also be used in Deep Color mode
to transmit a GCP indicating only non-Deep Color information (e.g. AVMUTE).

So use CD=0 where we were previously not enabling a GCP.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
drivers/gpu/drm/vc4/vc4_hdmi.c