Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8670960rwi; Tue, 25 Oct 2022 09:23:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6TuQ34H8DIR83PRWfu6kFt2k56DHn5+8rjNfIH2EuHljMytbsF1B6H1K8vmsOjk3tc/xVI X-Received: by 2002:a17:907:2be9:b0:7a1:11a9:1334 with SMTP id gv41-20020a1709072be900b007a111a91334mr5172917ejc.131.1666715007689; Tue, 25 Oct 2022 09:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666715007; cv=none; d=google.com; s=arc-20160816; b=U/c7vufIeGJtKSE1ag0R6kSbFL01BUNif48KY2YslXkbPOzwWj8M3dpdCJy3P+Nd1F FAVcIYRgpdbh8MkdrNDO/7vH1iUQ8KI6sxvv4S+11Yb+K4svStLs5Yd+fWwi8TzwZJGK k6TmI4Qzimp3sVwnuRj5piMzBxh50Ms2iTB5yDq4i1J/oLF+KEe3y1r73RaOifqCgd15 9b6Z2OIZK4X+KUWV8Y5kan3feDapj/FVYT7YWQIV20tqIrMTdWjcgHbBldJuFXWJxIsP MtsFqMxyu5bBfXaTfgFNTOYh1GZzxhbhYXQoDXloMjs0JdEQ51wsY3+1dqgnP6cYPmwp PLkg== 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; bh=gljpnoLdjIj8FbPBucJH+YyBjAPYhwcjGzRd/+2JJQw=; b=wKQnB2ocwgYyiPNL6/wkKVCVEtnmZJHX711IIgXoBrMLVQn3R3hbIbfnHJxgEsz1M5 886RRm1VQAcsqtOG/dMqs13M0tmEcrQ5NakkiO6WGG7ETsv7teIQe7FlldnbsowNCvEm rOd/bwmi7gldJFrXaDFosWt5jzh/CgN35B1+M1lzcIkHDIQnlnTZn5OT0Q0qj2SiapAG YTjL40ynlkbiE3lMUE/JvoaizUOwZ+5nnTaQhoaqW1s0N6cZeKxquPDvriGGb7WyT/4U 8jFQ2q+acEUCE8WZuJLREB2eJn+OY5iMFt7ipAj5G2GqWyt285zAA9CAnQmjk3md9vYi S6Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="T/k+AbuL"; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji21-20020a170907981500b0078badb3816dsi3278924ejc.952.2022.10.25.09.23.02; Tue, 25 Oct 2022 09:23:27 -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=@bootlin.com header.s=gm1 header.b="T/k+AbuL"; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233244AbiJYPfv (ORCPT + 99 others); Tue, 25 Oct 2022 11:35:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232351AbiJYPfs (ORCPT ); Tue, 25 Oct 2022 11:35:48 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22060C896D; Tue, 25 Oct 2022 08:35:44 -0700 (PDT) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 49DEE40005; Tue, 25 Oct 2022 15:35:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1666712142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gljpnoLdjIj8FbPBucJH+YyBjAPYhwcjGzRd/+2JJQw=; b=T/k+AbuL8LIp52QrJAzo2LJ42AWkOjjNgtqUWu+ZMYuYLjkK3uHkRY6euDkBQnKVI9swFN eOjXRCVBfx+yazWvnC1AOhcEucXdZPWFju49HXACZIR7D8mRxKNbKpg2QSWDYTFqQcN+sy Y9dbhiVyXdoXaKIevjkUq5tefS2e1VC/T0JcLSt121Yo+11tj33qPc+MJ9qoZXqHrqlxsh LaeJFQJii+k3kuHzbDgEGFsl7CBdrnzDqbo8UQiKjF+WDjbqNrpzUy/QaH5Q30BWBwLU+M 7IIibejt4/ltjZ2XrdJXEMLVK0j6ygPsAAzFrlKNc44EqHWs2/T30qqRGGzQzA== Date: Tue, 25 Oct 2022 17:35:33 +0200 From: Paul Kocialkowski To: Jernej =?utf-8?Q?=C5=A0krabec?= Cc: Dan Carpenter , mripard@kernel.org, mchehab@kernel.org, gregkh@linuxfoundation.org, wens@csie.org, samuel@sholland.org, hverkuil-cisco@xs4all.nl, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/11] media: cedrus: Add helper for checking capabilities Message-ID: References: <20221024201515.34129-1-jernej.skrabec@gmail.com> <13124586.uLZWGnKmhe@jernej-laptop> <8131177.T7Z3S40VBb@jernej-laptop> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0MKLJJwphdxhPi/7" Content-Disposition: inline In-Reply-To: <8131177.T7Z3S40VBb@jernej-laptop> 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,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 --0MKLJJwphdxhPi/7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue 25 Oct 22, 17:28, Jernej =C5=A0krabec wrote: > Dne torek, 25. oktober 2022 ob 17:22:59 CEST je Paul Kocialkowski napisal= (a): > > Hi Jernej, > >=20 > > On Tue 25 Oct 22, 17:17, Jernej =C5=A0krabec wrote: > > > Dne torek, 25. oktober 2022 ob 08:30:28 CEST je Dan Carpenter napisal= (a): > > > > On Mon, Oct 24, 2022 at 10:15:08PM +0200, Jernej Skrabec wrote: > > > > > There is several different Cedrus cores with varying capabilities= , so > > > > > some operations like listing formats depends on checks if feature= is > > > > > supported or not. > > > > >=20 > > > > > Currently check for capabilities is only in format enumeration he= lper, > > > > > but it will be used also elsewhere later. Let's convert this chec= k to > > > > > helper and while at it, also simplify it. There is no need to che= ck if > > > > > capability mask is zero, condition will still work properly. > > > >=20 > > > > Sure. That's true. Out of curiousity, can > > > > cedrus_formats[i].capabilities > > > > be zero? Because it feels like that's what should be checked. > > >=20 > > > Yes, it can be. It's the case for V4L2_PIX_FMT_NV12_32L32. All varian= ts > > > supports it, so there is no special capability needed in order to be > > > listed. What would you check in such case? Condition still works for = this > > > case. > > I think the problem is that (bits & 0) =3D=3D 0 is always true. > > So if the input caps are 0, we need to make sure to return false. >=20 > No. If format (or any other) capabilities are 0, means they are supported= by=20 > all variants and it's expected from cedrus_is_capable() to return true. Mhh, yeah. Not sure what I was thinking. Sorry for the noise. Paul --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --0MKLJJwphdxhPi/7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmNYAkUACgkQ3cLmz3+f v9ExOgf+JjLX4UvV2q9WgfaedsDfvk8XQ59souVqoWl11kJGfLC74ip19V7R5ttI wo4Vl3QiaxHTpEYnd+v2TEMNDQwJtDsiGk5q3WseMkq+43RNU2CVO7+CUHSZOx6P YYoAxWRCHLdXReHCGlfLsTc2UrarJpwXrHZmb/90czDBLoLJ2vmlmKPUbGq1lLyx EfYgbipaDMydKh5EVaQ8/1cGzDhZ37eUiISHtz/0yppi87pkLPK27AHMKtwSlThU GSqVolVkhfnSqDZGFoMsjQ+SiWA+4ff1WSOZeJcEfr0mNoFi0rh0ZWz0mkpZoRfd XzMOHG4IkTS/kHaQ9Th2p3x+9ANCXw== =8Pgc -----END PGP SIGNATURE----- --0MKLJJwphdxhPi/7--