Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1400382ybg; Tue, 2 Jun 2020 08:58:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQfYgxp0degZsKQFRL/DCltaOUu6D14zpD1Y9MszNPF8kvD+wZziDOmczT9DTGlnplYosb X-Received: by 2002:a17:906:9397:: with SMTP id l23mr21693847ejx.79.1591113535835; Tue, 02 Jun 2020 08:58:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591113535; cv=none; d=google.com; s=arc-20160816; b=L0PDeVXz4nSbogrRh+F0RYVS3KgZF8dww1iYz5573wvq1AbFNelbCP7n5xMjlR7mdH QEvPbFAT4RLIHn2QeTO5ew8Dmt3BNoKzujhWlUz0aa76q53BbsBQCl3EjSqVfCBFR71X M2WuT5jx3leNafwqVF7tNJZiBhyrkm5jOn1sV83Y25izvVreMRrALva4P4I4vdoU1Kfd 2u9V3lcZxw6OYB4e5Odi9M2qmur+KI824wFQ0bFaPqySbjvzsaCndtSrOlBuqSmtBMSi IDVGBRKn2xrCfSfK6PtCGiABwsd+1hqiNhjS4eNpprtTGGdK7RpqGmualZZBwsGF+Oav FUCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=cdDGYcXym9L8clxXR7KCFX14lxpSPK3OttsaYL6SZMQ=; b=kt3r9ljgLudzQAC14+0eDahHRIftux8kMUi+1tnAK9J1i/bXoSPIoPraxr2Jd9EYmI q2tYP+71p1BXrVwwpD5hDDUDB9Gn5koABR+ikI8sau/on81Y6t6GMEZez/97u0jJ0CIJ xaJsZZ2lHdwPOquXnhIhp3067t3CUH/grj7n19S7vG4pxqVcXnukuEw4WBrz0Yo2cVEZ I9YpMqc2cL02l2Snx1r+Naxn9KqBeSL1wS1QOW3QqYymRLVMRVkZyYgD3oq9O74ScTsb RKe9G+wpTNGKooZ0cmzYNSPYgP1cDSFK72ufgqpfmUOWbms+9nWS7M2pP1nyOvEFQUOQ 60dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=Rkdjea0M; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=FG1fvapU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qh23si1637252ejb.351.2020.06.02.08.58.33; Tue, 02 Jun 2020 08:58:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=Rkdjea0M; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=FG1fvapU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726261AbgFBPy3 (ORCPT + 99 others); Tue, 2 Jun 2020 11:54:29 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:37131 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbgFBPy3 (ORCPT ); Tue, 2 Jun 2020 11:54:29 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AB6D25C0227; Tue, 2 Jun 2020 11:54:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 02 Jun 2020 11:54:27 -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=fm3; bh=cdDGYcXym9L8clxXR7KCFX14lxp SPK3OttsaYL6SZMQ=; b=Rkdjea0MH42CeGwamJbTWWfqpvMJsV2xK02vgbSF639 /oW/Ff3PEMIqdKlqXYKsesOY1H1c6n5qYaf7xIOt+yoSAwQ3acSmVhwhgHjN9cVV n/uySVAguavnJqPybHybYNDsAJlScinOT+e1vZP/owqo4c6l4Tb4pF45bxPDqIHe ZMY+2xDItJuGfDiqTlfpYcAqSfRDLjcgUfjPcIVWQlwm0ISAlVx/Haem82T8xhq4 z87xZbNSfyolr7jSgJa+xHN7SuYsjJAaZBMNsdhtRejMrVEUI7Gm+4DfawKZEQ2N tpatmLUiErXrKm7HFOwtm04zuOViX7jK7aEEhIMKs4g== 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=cdDGYc Xym9L8clxXR7KCFX14lxpSPK3OttsaYL6SZMQ=; b=FG1fvapUBdisWavPjmkg/O JzN0HnI76u3btB0Lt/yl8Nr27ZevaEaPaDipHkXmzVImPTcXCkwpy+N8xkpl4njH OvBuc+bcIynauF1EZxRx0Vy0kIgADC2Rh8Hj/70AcW2BqdptdFO+t26KIIghuBs9 99lYLLqwFlIdhrRNxKKEtSDpKRCof25CcIUUfTRb3FSr+GZfrPW8ssDVkpMSvRMv GldVQA6DlbouRt5Uu3iKQbw2+7nkvlBF9L1ezRRyZRwqE5l5ycbI2JMz8SCzlmx0 +rJWzkIv+4hjjdHInHrKAuoJBnFGUHlgZt1GnxdVP5oXRH8zdLRUvuYzrrGbQTMg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudefjedgjedvucetufdoteggodetrfdotf 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 50C1C3280060; Tue, 2 Jun 2020 11:54:23 -0400 (EDT) Date: Tue, 2 Jun 2020 17:54:21 +0200 From: Maxime Ripard To: Eric Anholt Cc: Nicolas Saenz Julienne , DRI Development , linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Stevenson , Tim Gover , Phil Elwell Subject: Re: [PATCH v3 070/105] drm/vc4: hdmi: rework connectors and encoders Message-ID: <20200602155421.niyvpwqc42xh5c7v@gilmour> References: <020de18840a1075b2671736c6cc2e451030fad74.1590594512.git-series.maxime@cerno.tech> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qxxigstfuc465wjv" Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qxxigstfuc465wjv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 27, 2020 at 11:41:24AM -0700, Eric Anholt wrote: > On Wed, May 27, 2020 at 8:51 AM Maxime Ripard wrote: > > > > the vc4_hdmi driver has some custom structures to hold the data it need= s to > > associate with the drm_encoder and drm_connector structures. > > > > However, it allocates them separately from the vc4_hdmi structure which > > makes it more complicated than it needs to be. > > > > Move those structures to be contained by vc4_hdmi and update the code > > accordingly. >=20 >=20 > > @@ -1220,7 +1219,7 @@ static int vc4_hdmi_bind(struct device *dev, stru= ct device *master, void *data) > > struct drm_device *drm =3D dev_get_drvdata(master); > > struct vc4_dev *vc4 =3D drm->dev_private; > > struct vc4_hdmi *hdmi; > > - struct vc4_hdmi_encoder *vc4_hdmi_encoder; > > + struct drm_encoder *encoder; > > struct device_node *ddc_node; > > u32 value; > > int ret; > > @@ -1229,14 +1228,10 @@ static int vc4_hdmi_bind(struct device *dev, st= ruct device *master, void *data) > > if (!hdmi) > > return -ENOMEM; > > > > - vc4_hdmi_encoder =3D devm_kzalloc(dev, sizeof(*vc4_hdmi_encoder= ), > > - GFP_KERNEL); > > - if (!vc4_hdmi_encoder) > > - return -ENOMEM; > > - vc4_hdmi_encoder->base.type =3D VC4_ENCODER_TYPE_HDMI0; > > - hdmi->encoder =3D &vc4_hdmi_encoder->base.base; > > - > > hdmi->pdev =3D pdev; > > + encoder =3D &hdmi->encoder.base.base; > > + encoder->base.type =3D VC4_ENCODER_TYPE_HDMI0; >=20 > Wait, does this patch build? All those patches were build tested, so yep > setting struct drm_encoder->base.type =3D VC4_* seems very wrong, when > previously we were setting struct vc4_hdmi_encoder->base.type (struct > vc4_encoder->type). So the structure layout now is that vc4_hdmi embeds vc4_hdmi_encoder as encoder. So &hdmi->encoder is a pointer to vc4_hdmi_encoder. vc4_hdmi_encoder's base is since that patch a struct vc4_encoder. and vc4_encoder's base is a drm_encoder. so encoder being a drm_encoder is correct there. However, drm_encoder's base is drm_mode_object that does have a type field, which is an uint32_t, which will accept a VC4_ENCODER_TYPE_* just fine... Now, drm_encoder_init will then kick in and call drm_mode_object_add which will override it to a proper value and since the clock select bit in the PV is the same for both HDMI0 and HDMI1, everything works just fine... Good catch, I'll fix it. And I guess it's a good indication we don't need a separate HDMI0 and HDMI1 encoder type. > Other than this, patch 68-78 r-b. Thanks for your review! Maxime --qxxigstfuc465wjv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXtZ2LQAKCRDj7w1vZxhR xfluAP43aoGu2OPb0dq0BcgQ5MBEsuDCQDD5MHgSVl0cRgWGjwD/aa+PuVsSgsR0 5+38Ljq0cbWaxeUJTzW8daGiUZDn8wM= =KM7l -----END PGP SIGNATURE----- --qxxigstfuc465wjv--