From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32174C433B4 for ; Fri, 9 Apr 2021 12:36:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A75E4610CA for ; Fri, 9 Apr 2021 12:36:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A75E4610CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DB8E16EC1B; Fri, 9 Apr 2021 12:36:06 +0000 (UTC) Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by gabe.freedesktop.org (Postfix) with ESMTPS id ACF826EC17 for ; Fri, 9 Apr 2021 12:36:05 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 3710058081B; Fri, 9 Apr 2021 08:36:02 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 09 Apr 2021 08:36:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=AxKg28k+Bhno+lHlmUgJgZy6Ery s0s4jciFtZr4IS78=; b=Di7+1EhuuEF57Qbvez+PQQAMIleMlw+o1nYu56zW2I3 6Va/JrQ261ACPyBPcM2f0uWs092SoLTyyYCraLCbcIXaDHq2QOYSE36/f68oNJXu C5ldpQZc4fXVO97d2R2hPRjisSKAiCWSeiNNEioWHE1YUTRj7FH+OlUkdAKiJMUH Tk6RFGSadhhWwhzkFARkNbbXB63oIBtVtmVbdD0OUZIfY63Tx5SaQvL2+j/tZ3oP z0wf0jt6lebuc11SeXh9C3R5Vz8fC2yVJtEJqEgL3VqszoJKkAg9PMCKZqP5VVQM Ao+BGoRogsnDcAEhYxqAx2q+BXFWjHoBK/IywrcRjTw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=AxKg28 k+Bhno+lHlmUgJgZy6Erys0s4jciFtZr4IS78=; b=au1YDea7GBsWs7Ea5hFyvF bwMbJYoYvxFpOPQefXkHM9zR7y0jr+AVqsU7Jiw1CZpSmJ73KT5Qvz1AXyqlWKs9 XddRO4uBuQpWJ/oFMm1ltKIFPe28odtR1fz3d7KaztuC4pa4NYGwnwa6WlCWza9E QSylgEe9TkWRaABVxv0VTglcqeZ6I7p6ai1JeV+u9z6QYzliCx6ca1wh3wc5hcqB 0BdYYyYRd5rQsbdypBsnx+RDyQ89dEj/oXv0V7AKiz7iSo0LlA8jjAnLlTiXvoT0 rIuXsxIg86ctdrKDzMGVmmyEEeGE4Xlo5583jrF5jwWPqiAz78ouXBXzSlqKX5mQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekuddgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 736A01080054; Fri, 9 Apr 2021 08:36:00 -0400 (EDT) Date: Fri, 9 Apr 2021 14:35:57 +0200 From: Maxime Ripard To: Dave Stevenson Subject: Re: [PATCH v2 4/5] drm/vc4: hdmi: Enable the scrambler Message-ID: <20210409123557.jjntmcuyfadjnv7g@gilmour> References: <20210318092917.831995-1-maxime@cerno.tech> <20210318092917.831995-5-maxime@cerno.tech> MIME-Version: 1.0 In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tim Gover , David Airlie , DRI Development , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Thomas Zimmermann , Daniel Vetter , Phil Elwell , Nicolas Saenz Julienne Content-Type: multipart/mixed; boundary="===============1120865597==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --===============1120865597== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="p5kdmielrydh3wjk" Content-Disposition: inline --p5kdmielrydh3wjk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Dave, On Thu, Apr 01, 2021 at 12:30:45PM +0100, Dave Stevenson wrote: > > Signed-off-by: Maxime Ripard > > --- > > 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_h= dmi.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 > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -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_MAS= K(10, 8) > > > > @@ -457,6 +460,56 @@ static void vc4_hdmi_set_infoframes(struct drm_enc= oder *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 =3D to_vc4_hdmi_encoder(en= coder); > > + struct vc4_hdmi *vc4_hdmi =3D encoder_to_vc4_hdmi(encoder); > > + struct drm_display_info *display =3D &vc4_hdmi->connector.displ= ay_info; > > + > > + if (!vc4_encoder->hdmi_monitor) > > + return false; > > + > > + if (!display->hdmi.scdc.supported || > > + !display->hdmi.scdc.scrambling.supported) > > + return false; > > + >=20 > 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=3DHDMI-1:1920x1080 in the kernel command line and you'll have a > mess with scrambling enabled but not signalled. >=20 > 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? Maxime --p5kdmielrydh3wjk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYHBKLQAKCRDj7w1vZxhR xSzmAP9PefViBjhClPsKihqsziXF4zQs1JRxZevinaun/3GD5wEAx4l+PPNhuhei hOuzD0GT8qnD4c8qzre1syC3bkLl6g0= =OaFr -----END PGP SIGNATURE----- --p5kdmielrydh3wjk-- --===============1120865597== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1120865597==--