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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02D58C433EF for ; Thu, 23 Dec 2021 15:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=coM4ubDKSn+G+CVt0fFUOJNyqgIgJ9+9Vmcx7Wavx3Q=; b=XHaNiY3jQ0eWqU J3umDDgknAfk4DVqK81BX9qdCkBJb+By/4U4qNTsL5RJ5XzMf8W9bEU6WlFEBhXNut6o8Z7/ABeVo 52T4cQbxAmipu28XrBSwtWQUKNeqGwbuLsAKwR/6+ECj5E9y6UitUDSf+tkEQkPL/CmthVPjTtVKy 8xjCTmSPfoC738vB3gkktvN8ZDQUZOHLya/6R2njbCt7XtO2Hs5KXyshaWT4bqbqdGvR/JZZEjoSA QLPlIQlGRIWpDuJwP8uaBp57zJXbfzGxbN8NzyEEt4wJ7z6wSwl1EgiCTF6f+OJkpTRDhyKTjhtt9 wndr5AacBHR/b4ButChA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Pcy-00Cwm4-0i; Thu, 23 Dec 2021 15:03:32 +0000 Received: from mga12.intel.com ([192.55.52.136]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Pcu-00Cwki-Nf for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 15:03:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640271808; x=1671807808; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=aD1mewvXbqqunsX5Xqpz33bfhSDk3Xx9zQNCwf7UKxU=; b=ebzepBVGKfuuWQvY7bb4HIoC6KbhWJuGQg5nbu3DV5pS2UFJCZMDShmX hoI461ZTa1CNSgVX3bneFoq1NL1/Lyu2wpU0/XIdOzFh3GOFn+HqOT48c EZN95OEDciNMvP/9G6ya5zKpd2+b2KSZd/Nrs80iHE6Neau8b7Kydm8/J CcaMZ+Yqu1sWpOYA8u3+owLGi6tpAucqGYNveCMqgThG+h4xW15gltiGW jvpaWK2KYqv3KTCerbGX+d9RxApFNZnuMN6zNwpFDKKZkO7xwsXWZQvC3 /bB3AMvRP+f70vyqij85A0mPWZsQ06eGb6w2HdM9u2zM2nSLrjZkUBgUl A==; X-IronPort-AV: E=McAfee;i="6200,9189,10206"; a="220846661" X-IronPort-AV: E=Sophos;i="5.88,229,1635231600"; d="scan'208";a="220846661" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Dec 2021 07:03:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,229,1635231600"; d="scan'208";a="614220192" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.147]) by fmsmga002.fm.intel.com with SMTP; 23 Dec 2021 07:03:19 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 23 Dec 2021 17:03:19 +0200 Date: Thu, 23 Dec 2021 17:03:19 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Simon Ser Cc: =?iso-8859-1?Q?Jos=E9_Exp=F3sito?= , airlied@linux.ie, alexandre.torgue@foss.st.com, benjamin.gaignard@linaro.org, linux-stm32@st-md-mailman.stormreply.com, marex@denx.de, linux-imx@nxp.com, intel-gfx@lists.freedesktop.org, tzimmermann@suse.de, s.hauer@pengutronix.de, rodrigo.vivi@intel.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, yannick.fertre@foss.st.com, linux-kernel@vger.kernel.org, philippe.cornu@foss.st.com, mcoquelin.stm32@gmail.com, dmitry.baryshkov@linaro.org, shawnguo@kernel.org Subject: Re: [PATCH v2 1/6] =?iso-8859-1?Q?drm=2Fpl?= =?iso-8859-1?Q?ane=3A_Make_format=5Fmod=5Fsupported_truly=A0optional?= Message-ID: References: <20211222090552.25972-1-jose.exposito89@gmail.com> <20211222090552.25972-2-jose.exposito89@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Patchwork-Hint: comment X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_070328_820985_F7090D22 X-CRM114-Status: GOOD ( 16.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Dec 23, 2021 at 01:42:32PM +0000, Simon Ser wrote: > On Thursday, December 23rd, 2021 at 12:56, Ville Syrj=E4l=E4 wrote: > = > > > - /* If we can't determine support, just bail */ > > > - if (!plane->funcs->format_mod_supported) > > > - goto done; > > > - > > > mod =3D modifiers_ptr(blob_data); > > > for (i =3D 0; i < plane->modifier_count; i++) { > > > for (j =3D 0; j < plane->format_count; j++) { > > > - if (plane->funcs->format_mod_supported(plane, > > > + if (!plane->funcs->format_mod_supported || > > > + plane->funcs->format_mod_supported(plane, > > > plane->format_types[j], > > > plane->modifiers[i])) { > > > > So instead of skipping the whole loop you just skip doing anything > > inside the loop? Can't see how that achieves anything at all. > = > No, the check is skipped when the function isn't populated by the driver. Ah right. So we advertise all modifiers in that case. Looks like drm_plane_check_pixel_format() does support that model, so seems OK. Another related thing that might be worth checking is whether drivers generally do anything to validate the modifiers in the addfb2 ioctl. Looks like i915 and amdgpu are the only ones to use drm_any_plane_has_format() for that, so all the other drivers must either be checking it manually (or they're just potentially broken when handed unexpected modifiers by evil userspace). -- = Ville Syrj=E4l=E4 Intel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel