Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp4475384pxb; Wed, 20 Apr 2022 04:08:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEL//liYuCMNvJnj5rMVkT2PsT0DqQagqiIbMEsFUTtgDI90DGbCZyN9DtsukuNZ0ocjJx X-Received: by 2002:a17:907:9708:b0:6e8:d95e:273b with SMTP id jg8-20020a170907970800b006e8d95e273bmr2321540ejc.421.1650452884278; Wed, 20 Apr 2022 04:08:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650452884; cv=none; d=google.com; s=arc-20160816; b=Rov1EERtI8ILRbQP0ra+cpyrmxQM7qVI2h0bcDzVsvzVnE86X92N8lkZNajqQ45AYe NNwhlEwq4uF8W9xf4et707+qZoNBixOzVe3YFdjoGI3NRiQt+k9R7We8smQzKsrphRNK jy4kvLGlOc6LhC4VKZWmsiCHPl1CnlgH0AKxh4T+LRF7mjZmtT9HJP64mqKBrDH4l/p5 w/6K37K6/j+pIYySVigR2vFYGjOQJb+pS9wbAs0ZrBs6ixNQ8pKHKdMKvlIX4eOhgbu7 AXXM4wlRKeXPqpt71Mv7P0b1Unryi72zMxyu4qerj9eDJIuWiwKMQQazzoIHUXN2EVlG Gfuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=2CW91igEwePZegpDjL9foZp6k13ppbUBF40Tcqf+HVQ=; b=m+V4aul8/XAgeUfprKigyJ5ZxwKFu4sGCTXJQ7J2L2GJ64mfSqo0cQiR6E6TXQzEmT gQj33GJlsCtBLW0+GR+M2tCcrFvamq5oLXMsmyQsJDDQnh7RJUEpOhr6UCLpKYAgdvtd yNnj5ziDsR6chvNMlq7fy1bS3ylm/g03DYo59OyXyB8l1YwJHNbjYoqyCL0/JS0JA3WZ RP3YT2V21ASDblcAHAGJm1oLKuCrZJLWh4Ycq43kFnTsoUy9vzVugolgH8loEPyzZ9jg iQRUK9SOWcfg7fbPyDHu84kvMLhUw2BwJ81ZSeSj0HZBuRhedzX36w/z9SuOxwIllzho MIww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=BOiHcyv2; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=OJAR5Wkl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a056402520700b00418c2b5befdsi1349101edd.479.2022.04.20.04.07.39; Wed, 20 Apr 2022 04:08:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=BOiHcyv2; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=OJAR5Wkl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243351AbiDSMov (ORCPT + 99 others); Tue, 19 Apr 2022 08:44:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239819AbiDSMot (ORCPT ); Tue, 19 Apr 2022 08:44:49 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3576936337 for ; Tue, 19 Apr 2022 05:42:06 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9E1765C0116; Tue, 19 Apr 2022 08:42:03 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 19 Apr 2022 08:42:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1650372123; x=1650458523; bh=2CW91igEwe PZegpDjL9foZp6k13ppbUBF40Tcqf+HVQ=; b=BOiHcyv2jJej6NpzNAjMwylAoo ZICE9iXbu8c3L+1t1WwuFdRwupaoBuSsj2dM56aXt7etOKRmOFN04XQjodC996lG nGwrTZvpEM/DArKXcVIREpjLWDw9b40O3EkVeW4wBU0Yk3dUUp/9Jy9uOq/LuWt8 Gg+/4My4WNkClh3UMEVtWv44ihQYqZLGsKW8jONCCmGsuMHjLlFSL8Chf8Q+S8NO zEewGCwaGw2ct8dTBMsTQeGrMtc3KhQbcwlWzFKNLaKVg3qYhdTGOrvW94swIvSo k7xHZuqLCovoIersC8ypsGxnm578xSHd0Ck0CQTVL338q5ZuxNJrD9H5HP0g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1650372123; x= 1650458523; bh=2CW91igEwePZegpDjL9foZp6k13ppbUBF40Tcqf+HVQ=; b=O JAR5WklXjDWJmAoYHjaTV+6Jf0iRSd4Xu5ghdjjl/ahAh9ZSTHHhSfl/nR+fK5HZ SesihjpeexQ2SdDo5qlG+wB0Znmex/0RUf1A5LA4PRbAFqYnVuGW0dYC6+7VuJIS iDHIE9O/0mRsivsivm4/BUDWdLB4hY+L3tiaiA2xSgJIXItZ6rltMrWFKcbZTOzB URLEjPOUEXlJ6jnBD8f0vMTuA9C481Y25hXCWZUrhnK48ybu0m+3tQ5UjfNB2Y64 kdbyKEeJvCW/t75UQYJ7l/+hpWpGNuvFeRfy34ovfvKonTCulufreAlOLTPFUddg YU94oH5GEoya5eE7AUb2g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvddtfedgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddunecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepuddvudfhkeekhefgffetffelgffftdehffduffegveetffehueeivddvjedv gfevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Apr 2022 08:42:02 -0400 (EDT) Date: Tue, 19 Apr 2022 14:41:59 +0200 From: Maxime Ripard To: =?utf-8?B?Sm9zw6kgRXhww7NzaXRv?= Cc: emma@anholt.net, laurent.pinchart@ideasonboard.com, airlied@linux.ie, daniel@ffwll.ch, p.zabel@pengutronix.de, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] drm/vc4: hdmi: Remove vc4_hdmi_encoder.hdmi_monitor Message-ID: <20220419124159.2fjadxdornszocrk@houat> References: <20220415154745.170597-1-jose.exposito89@gmail.com> <20220415154745.170597-3-jose.exposito89@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tlaqz3cdfyvvwz3z" Content-Disposition: inline In-Reply-To: <20220415154745.170597-3-jose.exposito89@gmail.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --tlaqz3cdfyvvwz3z Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Apr 15, 2022 at 05:47:45PM +0200, Jos=E9 Exp=F3sito wrote: > The vc4_hdmi_encoder.hdmi_monitor field was used to cache the value > returned by drm_detect_hdmi_monitor() in order to avoid calling it > multiple times. >=20 > Now that drm_detect_hdmi_monitor() has been replaced with > drm_display_info.is_hdmi, there is no need to cache it in the driver > encoder struct. >=20 > Remove vc4_hdmi_encoder.hdmi_monitor and use drm_display_info.is_hdmi > instead. >=20 > Signed-off-by: Jos=E9 Exp=F3sito > --- > drivers/gpu/drm/vc4/vc4_hdmi.c | 17 ++++++----------- > drivers/gpu/drm/vc4/vc4_hdmi.h | 1 - > 2 files changed, 6 insertions(+), 12 deletions(-) >=20 > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdm= i.c > index ecdb1ffc2023..9c73a211ae80 100644 > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c > @@ -107,9 +107,9 @@ static bool vc4_hdmi_mode_needs_scrambling(const stru= ct drm_display_mode *mode) > static bool vc4_hdmi_is_full_range_rgb(struct vc4_hdmi *vc4_hdmi, > const struct drm_display_mode *mode) > { > - struct vc4_hdmi_encoder *vc4_encoder =3D &vc4_hdmi->encoder; > + struct drm_display_info *display =3D &vc4_hdmi->connector.display_info; > =20 > - return !vc4_encoder->hdmi_monitor || > + return !display->is_hdmi || > drm_default_rgb_quant_range(mode) =3D=3D HDMI_QUANTIZATION_RANGE_FULL; > } > =20 > @@ -216,7 +216,6 @@ vc4_hdmi_connector_detect(struct drm_connector *conne= ctor, bool force) > =20 > if (edid) { > cec_s_phys_addr_from_edid(vc4_hdmi->cec_adap, edid); > - vc4_hdmi->encoder.hdmi_monitor =3D connector->display_info.is_hdmi; I think the first patch could be squashed into this one > kfree(edid); > } > } > @@ -242,7 +241,6 @@ static void vc4_hdmi_connector_destroy(struct drm_con= nector *connector) > static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) > { > struct vc4_hdmi *vc4_hdmi =3D connector_to_vc4_hdmi(connector); > - struct vc4_hdmi_encoder *vc4_encoder =3D &vc4_hdmi->encoder; > int ret =3D 0; > struct edid *edid; > =20 > @@ -255,8 +253,6 @@ static int vc4_hdmi_connector_get_modes(struct drm_co= nnector *connector) > goto out; > } > =20 > - vc4_encoder->hdmi_monitor =3D connector->display_info.is_hdmi; > - > drm_connector_update_edid_property(connector, edid); > ret =3D drm_add_edid_modes(connector, edid); > kfree(edid); > @@ -578,13 +574,12 @@ static void vc4_hdmi_set_infoframes(struct drm_enco= der *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(encoder); > struct vc4_hdmi *vc4_hdmi =3D encoder_to_vc4_hdmi(encoder); > struct drm_display_info *display =3D &vc4_hdmi->connector.display_info; > =20 > lockdep_assert_held(&vc4_hdmi->mutex); > =20 > - if (!vc4_encoder->hdmi_monitor) > + if (!display->is_hdmi) > return false; > =20 > if (!display->hdmi.scdc.supported || > @@ -1147,7 +1142,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struc= t drm_encoder *encoder, > { > struct vc4_hdmi *vc4_hdmi =3D encoder_to_vc4_hdmi(encoder); > struct drm_display_mode *mode =3D &vc4_hdmi->saved_adjusted_mode; > - struct vc4_hdmi_encoder *vc4_encoder =3D to_vc4_hdmi_encoder(encoder); > + struct drm_display_info *display =3D &vc4_hdmi->connector.display_info; > bool hsync_pos =3D mode->flags & DRM_MODE_FLAG_PHSYNC; > bool vsync_pos =3D mode->flags & DRM_MODE_FLAG_PVSYNC; > unsigned long flags; > @@ -1168,7 +1163,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struc= t drm_encoder *encoder, > HDMI_WRITE(HDMI_VID_CTL, > HDMI_READ(HDMI_VID_CTL) & ~VC4_HD_VID_CTL_BLANKPIX); > =20 > - if (vc4_encoder->hdmi_monitor) { > + if (display->is_hdmi) { > HDMI_WRITE(HDMI_SCHEDULER_CONTROL, > HDMI_READ(HDMI_SCHEDULER_CONTROL) | > VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); > @@ -1195,7 +1190,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struc= t drm_encoder *encoder, > "!VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE\n"); > } > =20 > - if (vc4_encoder->hdmi_monitor) { > + if (display->is_hdmi) { > spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); > =20 > WARN_ON(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) & > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdm= i.h > index 1076faeab616..44977002445f 100644 > --- a/drivers/gpu/drm/vc4/vc4_hdmi.h > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h > @@ -11,7 +11,6 @@ > /* VC4 HDMI encoder KMS struct */ > struct vc4_hdmi_encoder { > struct vc4_encoder base; > - bool hdmi_monitor; > }; And vc4_hdmi_encoder doesn't hold anything anymore now, so it can be removed as well. Doing it in a subsequent patch would probably be the most readable. Thanks! Maxime --tlaqz3cdfyvvwz3z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYl6uDAAKCRDj7w1vZxhR xb26AP4qmTCMJsoyhGfRmeNGezGrZz1LlSEaEoWXWFeq84ErQQD+LCu2JVg40UH6 fqYdsSAZzRKTG0er8f0DZNdc6f4DWw4= =hGU/ -----END PGP SIGNATURE----- --tlaqz3cdfyvvwz3z--