From: "Andy Yan" <andyshrk@163.com>
To: "Maxime Ripard" <mripard@kernel.org>
Cc: "Heiko Stübner" <heiko@sntech.de>,
"Alex Bee" <knaerzche@gmail.com>,
"Sandy Huang" <hjc@rock-chips.com>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re:Re: [PATCH 04/11] drm/rockchip: inno_hdmi: Correctly setup HDMI quantization range
Date: Thu, 14 Dec 2023 19:50:41 +0800 (CST) [thread overview]
Message-ID: <aba9149.493d.18c682a22bc.Coremail.andyshrk@163.com> (raw)
In-Reply-To: <qr7if2k76wdqgevdcwqxj2dkcbga72owjqlk3qaazujhejjloo@cnvmuq27qqns>
Hi:
在 2023-12-14 19:36:05,"Maxime Ripard" <mripard@kernel.org> 写道:
>On Thu, Dec 14, 2023 at 12:17:34PM +0100, Heiko Stübner wrote:
>> Am Donnerstag, 14. Dezember 2023, 12:12:08 CET schrieb Alex Bee:
>> > Hi Maxime
>> >
>> > Am 14.12.23 um 08:56 schrieb Maxime Ripard:
>> > > Hi Alex,
>> > >
>> > > Thanks for working on this!
>> > >
>> > > On Wed, Dec 13, 2023 at 08:51:18PM +0100, Alex Bee wrote:
>> > >> The display controller will always give full range RGB regardless of the
>> > >> mode set, but HDMI requires certain modes to be transmitted in limited
>> > >> range RGB. This is especially required for HDMI sinks which do not support
>> > >> non-standard quantization ranges.
>> > >>
>> > >> This enables color space conversion for those modes and sets the
>> > >> quantization range accordingly in the AVI infoframe.
>> > >>
>> > >> Fixes: 412d4ae6b7a5 ("drm/rockchip: hdmi: add Innosilicon HDMI support")
>> > >> Signed-off-by: Alex Bee <knaerzche@gmail.com>
>> > >> ---
>> > >> drivers/gpu/drm/rockchip/inno_hdmi.c | 40 ++++++++++++++++++++++------
>> > >> 1 file changed, 32 insertions(+), 8 deletions(-)
>> > >>
>> > >> diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
>> > >> index 345253e033c5..32626a75723c 100644
>> > >> --- a/drivers/gpu/drm/rockchip/inno_hdmi.c
>> > >> +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
>> > >> @@ -33,6 +33,7 @@ struct hdmi_data_info {
>> > >> unsigned int enc_in_format;
>> > >> unsigned int enc_out_format;
>> > >> unsigned int colorimetry;
>> > >> + bool rgb_limited_range;
>> > >> };
>> > >>
>> > >> struct inno_hdmi_i2c {
>> > >> @@ -308,6 +309,18 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi,
>> > >> else
>> > >> frame.avi.colorspace = HDMI_COLORSPACE_RGB;
>> > >>
>> > >> + if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_RGB) {
>> > >> + drm_hdmi_avi_infoframe_quant_range(&frame.avi,
>> > >> + &hdmi->connector, mode,
>> > >> + hdmi->hdmi_data.rgb_limited_range ?
>> > >> + HDMI_QUANTIZATION_RANGE_LIMITED :
>> > >> + HDMI_QUANTIZATION_RANGE_FULL);
>> > >> + } else {
>> > >> + frame.avi.quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT;
>> > >> + frame.avi.ycc_quantization_range =
>> > >> + HDMI_YCC_QUANTIZATION_RANGE_LIMITED;
>> > >> + }
>> > >> +
>> > >> return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_AVI, 0, 0, 0);
>> > >> }
>> > >>
>> > >> @@ -334,14 +347,22 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi)
>> > >> if (data->enc_in_format == data->enc_out_format) {
>> > >> if ((data->enc_in_format == HDMI_COLORSPACE_RGB) ||
>> > >> (data->enc_in_format >= HDMI_COLORSPACE_YUV444)) {
>> > >> - value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1);
>> > >> - hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value);
>> > >> -
>> > >> - hdmi_modb(hdmi, HDMI_VIDEO_CONTRL,
>> > >> - m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP,
>> > >> - v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) |
>> > >> - v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE));
>> > >> - return 0;
>> > >> + if (data->enc_in_format == HDMI_COLORSPACE_RGB &&
>> > >> + data->enc_out_format == HDMI_COLORSPACE_RGB &&
>> > >> + hdmi->hdmi_data.rgb_limited_range) {
>> > >> + csc_mode = CSC_RGB_0_255_TO_RGB_16_235_8BIT;
>> > >> + auto_csc = AUTO_CSC_DISABLE;
>> > >> + c0_c2_change = C0_C2_CHANGE_DISABLE;
>> > >> + csc_enable = v_CSC_ENABLE;
>> > >> + } else {
>> > >> + value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1);
>> > >> + hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value);
>> > >> + hdmi_modb(hdmi, HDMI_VIDEO_CONTRL,
>> > >> + m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP,
>> > >> + v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) |
>> > >> + v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE));
>> > >> + return 0;
>> > >> + }
>> > >> }
>> > >> }
>> > >>
>> > >> @@ -458,6 +479,9 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi,
>> > >> else
>> > >> hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709;
>> > >>
>> > >> + hdmi->hdmi_data.rgb_limited_range =
>> > >> + drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED;
>> > >> +
>> > > This patch conflicts heavily with my inno_hdmi patches here (patches 22 to 38):
>> > > https://lore.kernel.org/dri-devel/20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org/
>> > I'm aware of that and I mentioned it in the cover letter. Your series is
>> > not merged yet and it didn't get much feedback so far. What is the
>> > status there? Especially because you are removing things from inno-hdmi
>> > driver (which aren't really required to remove there) which will I have
>> > to reintroduce.
>>
>> Sadly I haven't found the time to look closer at Maxime's series so far,
>> but I got the impression that it separates into multiple cleanup steps
>> for a number of controllers.
>
>Yeah, one of the previous version comment was to support more
>controllers than vc4, which is fair. So I ended up reworking and
>converting multiple controllers, but most of the clean up changes can be
>applied outside of that series just fine.
>
>I just didn't find someone to test / review them yet :)
I will try to bring up my rk3036 kylin board whith mainline kernel this weekend, then I can do some tests.
>
>Maxime
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2023-12-14 11:51 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-13 19:51 [PATCH 00/11] Add HDMI support for RK3128 Alex Bee
2023-12-13 19:51 ` [PATCH 01/11] dt-bindings: display: rockchip,inno-hdmi: Document RK3128 compatible Alex Bee
2023-12-14 7:53 ` Krzysztof Kozlowski
2023-12-14 15:22 ` Alex Bee
2023-12-14 16:07 ` Krzysztof Kozlowski
2023-12-14 16:20 ` Heiko Stübner
2023-12-14 16:26 ` Krzysztof Kozlowski
2023-12-13 19:51 ` [PATCH 02/11] drm/rockchip: vop: Add output selection registers for RK312x Alex Bee
2023-12-13 19:51 ` [PATCH 03/11] drm/rockchip: inno_hdmi: Fix video timing Alex Bee
2023-12-13 19:51 ` [PATCH 04/11] drm/rockchip: inno_hdmi: Correctly setup HDMI quantization range Alex Bee
2023-12-14 7:56 ` Maxime Ripard
2023-12-14 11:12 ` Alex Bee
2023-12-14 11:17 ` Heiko Stübner
2023-12-14 11:36 ` Maxime Ripard
2023-12-14 11:50 ` Andy Yan [this message]
2023-12-14 16:34 ` Alex Bee
2023-12-15 12:29 ` Maxime Ripard
2023-12-14 11:33 ` Maxime Ripard
2023-12-14 14:05 ` Alex Bee
2023-12-15 12:27 ` Maxime Ripard
2023-12-13 19:51 ` [PATCH 05/11] drm/rockchip: inno_hdmi: Add variant support Alex Bee
2023-12-13 19:51 ` [PATCH 06/11] drm/rockchip: inno_hdmi: Add RK3128 support Alex Bee
2023-12-13 19:51 ` [PATCH 07/11] drm/rockchip: inno_hdmi: Add basic mode validation Alex Bee
2023-12-14 8:05 ` Maxime Ripard
2023-12-14 11:17 ` Alex Bee
2023-12-14 11:40 ` Maxime Ripard
2023-12-14 13:05 ` Alex Bee
2023-12-13 19:51 ` [PATCH 08/11] drm/rockchip: inno_hdmi: Drop custom fill_modes hook Alex Bee
2023-12-13 19:51 ` [PATCH 09/11] ARM: dts: rockchip: Add display subsystem for RK3128 Alex Bee
2023-12-13 19:51 ` [PATCH 10/11] ARM: dts rockchip: Add HDMI node " Alex Bee
2023-12-13 19:51 ` [PATCH 11/11] ARM: dts: rockchip: Enable HDMI output for XPI-3128 Alex Bee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aba9149.493d.18c682a22bc.Coremail.andyshrk@163.com \
--to=andyshrk@163.com \
--cc=airlied@gmail.com \
--cc=conor+dt@kernel.org \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=knaerzche@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=robh+dt@kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox