Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp363323ybg; Wed, 3 Jun 2020 02:46:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3cjOOAgNY0bb9K1SiH1GGibE4eMd3AK7saIVMyG2/5FEKAwQkQbHwNHmrLdhOW2M4R4ak X-Received: by 2002:a17:906:2656:: with SMTP id i22mr12707292ejc.397.1591177578724; Wed, 03 Jun 2020 02:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591177578; cv=none; d=google.com; s=arc-20160816; b=c1ZtZwVcb2oufw01Exg9/XlBa+RUA+NzYTQK1I9auscxvKLqEGHrWTOTA3bndasXrD gW9N8k5vb/WcKWg+E7ckm2kMtqbCAT3dG2a9FPA4kU1TSnzk6FwWqgMzc/Wvevf95Iyp 07i5+QYuboelm3MZTJhUaZToFOQK0CqhvN3z+6lkkj746FnKbchCPC07C6IeLfL0Vb6l UWC7VYqAMyjDyksYI33eW5FRkUao3HX/bqg0XIHWrHAhHHK+CwOsBA2CloyMBwfEY4nx f+gsmOouolszwgWHqRQpdw/SfAc8jBXx82FkHxCu1QQ4cSKKDQimEXUutJKYIxWNlXD9 DefQ== 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=/ZRtaUlz4PlaZqSMUd3N2FgMnKsn8HhEgU7Tp69UW18=; b=wooVYLecq2CVMyzn8y/+Tc5eO0FM9ces2cpSJE/BGugCMg7+c06b3ZKtrlz+Ndl5BE h44N4VFEBQzMqdsjnX6A4Sus1PUdfJGOvbD9siFiTrwktVKSJmoZr7v8txI5R/xztYEV NfCMIRsHB8txtpg4VSSlkgSN/RuZ+kpeQGJOFmy9HYyHnQiKl0viM00ceWiuzSpxzFn6 67eDPplXA6ChEbR0nk42Nx3WMIOR68LrHpd+GbT5YnPRhZkC71aLsCAfs3yqpANm+NxW 8DMORmlaeSeXPAL51XNM60DVlKfDV+GR37LIQy7OWJyrVK2Z/E4SP1uZ9me3ELMj9c+w FYfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=E8hZCBPl; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=SINOAoT4; 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 dg25si780262edb.451.2020.06.03.02.45.55; Wed, 03 Jun 2020 02:46:18 -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=E8hZCBPl; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=SINOAoT4; 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 S1726268AbgFCJns (ORCPT + 99 others); Wed, 3 Jun 2020 05:43:48 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:53761 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbgFCJnr (ORCPT ); Wed, 3 Jun 2020 05:43:47 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5337B5C00E8; Wed, 3 Jun 2020 05:43:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 03 Jun 2020 05:43:46 -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=/ZRtaUlz4PlaZqSMUd3N2FgMnKs n8HhEgU7Tp69UW18=; b=E8hZCBPlOVM6zLvOJoUSHEwlSgWCpO9ACGcIS5aNLG9 /gtndLVUDUV4275Lsyod8d6l2IsBXSEI+K+WPObDVPlPjq8A+CRMCub/3zHvLwrK dPJ41hMxKArfkw+4/cyfS0/rXLYwkuMfsMgKpTUL8Ezyrk7u4q6EHE+o4NRZHIWB CKGeqVajWdw95jJptBaUp81rzIsNKM2xI1TAqoPCGqJHVCZPUUWIbyqxxMpa8lO1 xq4IEAOr70FZt51l24SJcUZU00TP3dbBAkSmsljgbmn19ucBD0R7RkdcGhAbCTSB C488QEmVfKnjp8Z02W/3OzlPHFeUuc/V3ltOBkBzr8Q== 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=/ZRtaU lz4PlaZqSMUd3N2FgMnKsn8HhEgU7Tp69UW18=; b=SINOAoT4JazfhbsKagJ+zM d6URX6ZQpUZXzvGcmyqXfxZMAigbP+Yt1qyuPAFD+OB3SaMViqCgkC708lkLxz87 2lo5D2YVxOsH1ljgm0+REEuQQ2Y2qVnFBcKFX+1XhVfMt0mffA3KkFw+JK9qczQJ s4CoV6cyFtWXj8NcfuursB0TVb/OYE8MWIJKhNScpOQ5d8vSOFBilFGrN8JLRGTQ Rj795VyzyVoJvEGapA5l84sMzwHdxx/zC0b19mR+9p+1dka43RVxbaJ7KAbmT2SN 7gZuBubGFwRCiLWRx6Nw4AJmXXwp+liM9rgJLKUFtrWX4AVQ4xlXNoTpFHErMNvA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudefledgudegucetufdoteggodetrfdotf 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 38CBD328005D; Wed, 3 Jun 2020 05:43:45 -0400 (EDT) Date: Wed, 3 Jun 2020 11:43:43 +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 055/105] drm/vc4: hvs: Introduce a function to get the assigned FIFO Message-ID: <20200603094343.p3exkblfmse5mmcn@gilmour> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5n2cnfauefut5xjz" 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 --5n2cnfauefut5xjz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Eric, On Wed, May 27, 2020 at 12:40:02PM -0700, Eric Anholt wrote: > On Wed, May 27, 2020 at 8:50 AM Maxime Ripard wrote: > > > > At boot time, if we detect that a pixelvalve has been enabled, we need = to > > be able to retrieve the HVS channel it has been assigned to so that we = can > > disable that channel too. Let's create that function that returns the F= IFO > > or an error from a given output. > > > > Signed-off-by: Maxime Ripard > > --- >=20 > > +int vc4_hvs_get_fifo_from_output(struct drm_device *dev, unsigned int = output) > > +{ > > + struct vc4_dev *vc4 =3D to_vc4_dev(dev); > > + u32 reg; > > + int ret; > > + > > + switch (output) { > > + case 0: > > + return 0; > > + > > + case 1: > > + return 1; > > + > > + case 2: > > + reg =3D HVS_READ(SCALER_DISPECTRL); > > + ret =3D FIELD_GET(SCALER_DISPECTRL_DSP2_MUX_MASK, reg); > > + if (ret =3D=3D 0) > > + return 2; > > + > > + return 0; > > + > > + case 3: > > + reg =3D HVS_READ(SCALER_DISPCTRL); > > + ret =3D FIELD_GET(SCALER_DISPCTRL_DSP3_MUX_MASK, reg); > > + if (ret =3D=3D 3) > > + return -EPIPE; > > + > > + return ret; > > + > > + case 4: > > + reg =3D HVS_READ(SCALER_DISPEOLN); > > + ret =3D FIELD_GET(SCALER_DISPEOLN_DSP4_MUX_MASK, reg); > > + if (ret =3D=3D 3) > > + return -EPIPE; > > + > > + return ret; > > + > > + case 5: > > + reg =3D HVS_READ(SCALER_DISPDITHER); > > + ret =3D FIELD_GET(SCALER_DISPDITHER_DSP5_MUX_MASK, reg); > > + if (ret =3D=3D 3) > > + return -EPIPE; >=20 > Oh, FIELD_GET is new to me. Looks like we should replace > VC4_GET_FIELD usage with just using that header, and also > VC4_SET_FIELD with WARN_ON(!FIELD_FIT()); FIELD_PREP. > > Could you follow up with that? I will :) > Other than that, 54-67 r-b. Thanks! Maxime --5n2cnfauefut5xjz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXtdwzwAKCRDj7w1vZxhR xSigAP9SVbehxfj1alttR069S1VUOyKC5fYaX83YpNFbUoAeiwD9HUSzu+1SMdx5 MFPJEKUFVFrMkPNpooUcet+mJufu5g0= =QbRd -----END PGP SIGNATURE----- --5n2cnfauefut5xjz--