From: Neil Armstrong <narmstrong@baylibre.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: jernej.skrabec@siol.net, jonas@kwiboo.se,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
a.hajda@samsung.com, boris.brezillon@collabora.com,
linux-amlogic@lists.infradead.org
Subject: Re: [PATCH v4 01/11] drm/bridge: dw-hdmi: set mtmdsclock for deep color
Date: Mon, 2 Mar 2020 10:21:22 +0100 [thread overview]
Message-ID: <58c2bfed-d082-d8e6-de4f-6161d5f4fec3@baylibre.com> (raw)
In-Reply-To: <20200302090527.GB11960@pendragon.ideasonboard.com>
On 02/03/2020 10:05, Laurent Pinchart wrote:
> Hi Neil and Jonas,
>
> Thank you for the patch.
>
> On Thu, Feb 06, 2020 at 08:18:24PM +0100, Neil Armstrong wrote:
>> From: Jonas Karlman <jonas@kwiboo.se>
>>
>> Configure the correct mtmdsclock for deep colors to prepare support
>> for 10, 12 & 16bit output.
>>
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
>> ---
>> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 17 +++++++++++++++++
>> 1 file changed, 17 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> index 67fca439bbfb..9e0927d22db6 100644
>> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> @@ -1818,9 +1818,26 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
>>
>> dev_dbg(hdmi->dev, "final pixclk = %d\n", vmode->mpixelclock);
>
> Nitpicking a bit, I would change
>
> - vmode->mtmdsclock = vmode->mpixelclock = mode->clock * 1000;
> + vmode->mpixelclock = mode->clock * 1000;
>
> above, and here add
>
> vmode->mtmdsclock = vmode->mpixelclock;
>
> to keep all mtmdsclock calculation in a single place.
>
>> + if (!hdmi_bus_fmt_is_yuv422(hdmi->hdmi_data.enc_out_bus_format)) {
>> + switch (hdmi_bus_fmt_color_depth(
>> + hdmi->hdmi_data.enc_out_bus_format)) {
>> + case 16:
>> + vmode->mtmdsclock = (u64)vmode->mpixelclock * 2;
>
> Both mpixelclock and mtmdsclock are unsigned int. Is the cast to u64
> needed ?
Good question, should probably be removed.
>
> On a separate but related note, what does the 'm' in tmdsclock stand for
> ? It seems to originate from the 'm' prefix for mpixelclock, which has
> been there from the start. Unless there's a good reason for the prefix,
> renaming mtmdsclock to tmds_clock (and handling the other fields in the
> hdmi_vmode structure similarly) would increase clarity I think.
The mode->clock is is KHz, thus it seems the m was added to express it's in Hz,
so yeah we could drop the m in tmdsclock.
>
>> + break;
>> + case 12:
>> + vmode->mtmdsclock = (u64)vmode->mpixelclock * 3 / 2;
>> + break;
>> + case 10:
>> + vmode->mtmdsclock = (u64)vmode->mpixelclock * 5 / 4;
>> + break;
>> + }
>> + }
>> +
>> if (hdmi_bus_fmt_is_yuv420(hdmi->hdmi_data.enc_out_bus_format))
>> vmode->mtmdsclock /= 2;
>>
>> + dev_dbg(hdmi->dev, "final tmdsclk = %d\n", vmode->mtmdsclock);
>
> s/tmdsclk/tmdsclock/ to match the field name ?
yep
>
>> +
>> /* Set up HDMI_FC_INVIDCONF */
>> inv_val = (hdmi->hdmi_data.hdcp_enable ||
>> (dw_hdmi_support_scdc(hdmi) &&
>
Neil
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2020-03-02 9:21 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 19:18 [PATCH v4 00/11] drm/bridge: dw-hdmi: implement bus-format negotiation and YUV420 support Neil Armstrong
2020-02-06 19:18 ` [PATCH v4 01/11] drm/bridge: dw-hdmi: set mtmdsclock for deep color Neil Armstrong
2020-03-02 9:05 ` Laurent Pinchart
2020-03-02 9:21 ` Neil Armstrong [this message]
2020-03-02 15:54 ` Neil Armstrong
2020-03-02 16:01 ` Laurent Pinchart
2020-02-06 19:18 ` [PATCH v4 02/11] drm/bridge: dw-hdmi: add max bpc connector property Neil Armstrong
2020-02-17 6:38 ` Jernej Škrabec
2020-02-21 8:50 ` Neil Armstrong
2020-03-02 9:18 ` Laurent Pinchart
2020-03-02 15:55 ` Neil Armstrong
2020-02-06 19:18 ` [PATCH v4 03/11] drm/bridge: dw-hdmi: Plug atomic state hooks to the default implementation Neil Armstrong
2020-02-07 10:57 ` Boris Brezillon
2020-03-02 9:56 ` Laurent Pinchart
2020-03-02 15:55 ` Neil Armstrong
2020-02-06 19:18 ` [PATCH v4 04/11] drm/bridge: synopsys: dw-hdmi: add bus format negociation Neil Armstrong
2020-02-07 11:02 ` Boris Brezillon
2020-02-07 13:36 ` Neil Armstrong
2020-02-29 7:42 ` Jernej Škrabec
2020-02-29 10:09 ` Jonas Karlman
2020-02-29 11:07 ` Jernej Škrabec
2020-02-29 12:15 ` Jonas Karlman
2020-02-29 14:42 ` Jernej Škrabec
2020-03-02 8:08 ` Neil Armstrong
2020-03-02 8:04 ` Neil Armstrong
2020-03-02 10:18 ` Laurent Pinchart
2020-03-02 15:57 ` Neil Armstrong
2020-02-06 19:18 ` [PATCH v4 05/11] drm/bridge: synopsys: dw-hdmi: allow ycbcr420 modes for >= 0x200a Neil Armstrong
2020-02-07 13:38 ` Neil Armstrong
2020-03-02 10:03 ` Laurent Pinchart
2020-03-02 15:58 ` Neil Armstrong
2020-02-06 19:18 ` [PATCH v4 06/11] drm/meson: venc: make drm_display_mode const Neil Armstrong
2020-02-07 13:39 ` Neil Armstrong
2020-03-02 9:59 ` Laurent Pinchart
2020-02-06 19:18 ` [PATCH v4 07/11] drm/meson: meson_dw_hdmi: add bridge and switch to drm_bridge_funcs Neil Armstrong
2020-02-07 14:57 ` Boris Brezillon
2020-02-07 15:36 ` Neil Armstrong
2020-02-06 19:18 ` [PATCH v4 08/11] drm/meson: dw-hdmi: stop enforcing input_bus_format Neil Armstrong
2020-02-06 19:18 ` [PATCH v4 09/11] drm/meson: venc: add support for YUV420 setup Neil Armstrong
2020-02-06 19:18 ` [PATCH v4 10/11] drm/meson: vclk: " Neil Armstrong
2020-02-06 19:18 ` [PATCH v4 11/11] drm/meson: Add YUV420 output support Neil Armstrong
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=58c2bfed-d082-d8e6-de4f-6161d5f4fec3@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=a.hajda@samsung.com \
--cc=boris.brezillon@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@siol.net \
--cc=jonas@kwiboo.se \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).