dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: Tim Gover <tim.gover@raspberrypi.com>,
	David Airlie <airlied@linux.ie>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	bcm-kernel-feedback-list@broadcom.com,
	linux-rpi-kernel@lists.infradead.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Phil Elwell <phil@raspberrypi.com>,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Subject: Re: [PATCH v2 4/5] drm/vc4: hdmi: Enable the scrambler
Date: Mon, 12 Apr 2021 10:43:42 +0100	[thread overview]
Message-ID: <CAPY8ntBC2ctar-LH-HVyQHdmzZYpqxKcEZpBLq8J3vUQiA-_uA@mail.gmail.com> (raw)
In-Reply-To: <20210409123557.jjntmcuyfadjnv7g@gilmour>

Hi Maxime

On Fri, 9 Apr 2021 at 13:36, Maxime Ripard <maxime@cerno.tech> wrote:
>
> Hi Dave,
>
> On Thu, Apr 01, 2021 at 12:30:45PM +0100, Dave Stevenson wrote:
> > > Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> > > ---
> > >  drivers/gpu/drm/vc4/vc4_hdmi.c      | 56 +++++++++++++++++++++++++++++
> > >  drivers/gpu/drm/vc4/vc4_hdmi_regs.h |  3 ++
> > >  2 files changed, 59 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
> > > index 0924a1b9e186..530c83097b1a 100644
> > > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> > > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> > > @@ -35,6 +35,7 @@
> > >  #include <drm/drm_edid.h>
> > >  #include <drm/drm_probe_helper.h>
> > >  #include <drm/drm_simple_kms_helper.h>
> > > +#include <drm/drm_scdc_helper.h>
> > >  #include <linux/clk.h>
> > >  #include <linux/component.h>
> > >  #include <linux/i2c.h>
> > > @@ -76,6 +77,8 @@
> > >  #define VC5_HDMI_VERTB_VSPO_SHIFT              16
> > >  #define VC5_HDMI_VERTB_VSPO_MASK               VC4_MASK(29, 16)
> > >
> > > +#define VC5_HDMI_SCRAMBLER_CTL_ENABLE          BIT(0)
> > > +
> > >  #define VC5_HDMI_DEEP_COLOR_CONFIG_1_INIT_PACK_PHASE_SHIFT     8
> > >  #define VC5_HDMI_DEEP_COLOR_CONFIG_1_INIT_PACK_PHASE_MASK      VC4_MASK(10, 8)
> > >
> > > @@ -457,6 +460,56 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder)
> > >                 vc4_hdmi_set_audio_infoframe(encoder);
> > >  }
> > >
> > > +static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder,
> > > +                                        struct drm_display_mode *mode)
> > > +{
> > > +       struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder);
> > > +       struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
> > > +       struct drm_display_info *display = &vc4_hdmi->connector.display_info;
> > > +
> > > +       if (!vc4_encoder->hdmi_monitor)
> > > +               return false;
> > > +
> > > +       if (!display->hdmi.scdc.supported ||
> > > +           !display->hdmi.scdc.scrambling.supported)
> > > +               return false;
> > > +
> >
> > I think I made this comment last time, but possibly not very clearly.
>
> I must have missed it then, sorry :/
>
> > Up to this point in the function is whether the display/hdmi interface
> > *supports* scrambling. The bit after is whether it is *required* to be
> > enabled by the mode.
>
> Thomas made a suggestion to move the mode clock check to a helper, so
> we'll end up with essentially a helper about whether we support
> scrambling or not and if the mode requires it.
>
> > At the moment, if the display/interface supports scrambling but the
> > mode doesn't need it, then the scrambling setup is never touched. That
> > makes a few assumptions about the default settings.
> > Boot with the firmware selecting 4k60 (ie scrambling on), but
> > video=HDMI-1:1920x1080 in the kernel command line and you'll have a
> > mess with scrambling enabled but not signalled.
> >
> > I'd be happier if the display/interface says scrambling is supported
> > then we always call drm_scdc_set_high_tmds_clock_ratio,
> > drm_scdc_set_scrambling and set the VC5_HDMI_SCRAMBLER_CTL_ENABLE
> > register bit appropriately for the mode. Feel free to disagree with me
> > though.
>
> I think part of it is due to our custom helpers never being called
> currently during the boot process. Once that is fixed, the disable
> helpers will be called and will disable the scrambling so we should be
> good there.
>
> This creates another issue though. That function takes the mode as the
> argument and at boot time the mode pointer will be null. I think we can
> work around it by assuming that we need to disable it at boot all the
> time (and thus ignore the test if our pointer is null).
>
> Would that work for you?

Yes, that all sounds reasonable to me.

  Dave
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-04-12  9:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18  9:29 [PATCH v2 0/5] drm/vc4: hdmi: Support the 4k @ 60Hz modes Maxime Ripard
2021-03-18  9:29 ` [PATCH v2 1/5] drm/vc4: hvs: Make the HVS bind first Maxime Ripard
2021-03-18  9:29 ` [PATCH v2 2/5] drm/vc4: hdmi: Properly compute the BVB clock rate Maxime Ripard
2021-04-01 11:09   ` Dave Stevenson
2021-03-18  9:29 ` [PATCH v2 3/5] drm/vc4: hdmi: Check and warn if we can't reach 4kp60 frequencies Maxime Ripard
2021-04-01 11:12   ` Dave Stevenson
2021-03-18  9:29 ` [PATCH v2 4/5] drm/vc4: hdmi: Enable the scrambler Maxime Ripard
2021-04-01 11:30   ` Dave Stevenson
2021-04-09 12:35     ` Maxime Ripard
2021-04-12  9:43       ` Dave Stevenson [this message]
2021-03-18  9:29 ` [PATCH v2 5/5] drm/vc4: hdmi: Raise the maximum clock rate Maxime Ripard
2021-03-19  8:24 ` [PATCH v2 0/5] drm/vc4: hdmi: Support the 4k @ 60Hz modes Thomas Zimmermann

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=CAPY8ntBC2ctar-LH-HVyQHdmzZYpqxKcEZpBLq8J3vUQiA-_uA@mail.gmail.com \
    --to=dave.stevenson@raspberrypi.com \
    --cc=airlied@linux.ie \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=maxime@cerno.tech \
    --cc=nsaenzjulienne@suse.de \
    --cc=phil@raspberrypi.com \
    --cc=tim.gover@raspberrypi.com \
    --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;
as well as URLs for NNTP newsgroup(s).