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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F2AAC433FE for ; Thu, 23 Dec 2021 15:03:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244100AbhLWPDc (ORCPT ); Thu, 23 Dec 2021 10:03:32 -0500 Received: from mga02.intel.com ([134.134.136.20]:23071 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239868AbhLWPD1 (ORCPT ); Thu, 23 Dec 2021 10:03:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640271807; x=1671807807; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=aD1mewvXbqqunsX5Xqpz33bfhSDk3Xx9zQNCwf7UKxU=; b=j/ArrE0qthurwIM91GDQBKzDsT5QTfl5NOWGtq07g9TzIWDvQzn1NBdE 2PT0oR4+rBZHjwZr3j/fOZJOaooUHHAwsbMpHoNQLRFSGDPpsf3ze87NF O2RcAC0kQ1fea+3096DcqOfLM9iHmCqukwx2YUQ8svvEzHZW0+1wrLz+H 9I/HZQ3+3h/SqGdK6+gXwydDYEh3y91zmBdfh79c8sy3SrmeS98dPdIlf XlZKKDgjoWt5IpCKlW1XSEtcq0Etns1Zlw1iK7X+URHQO7ZGzJ9I/5Daj oK9O2pkNLBICtybAO/shlEMgBmr34iX8H3Hr9xbYpyrpKZ5KQPq8yR753 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10206"; a="228134927" X-IronPort-AV: E=Sophos;i="5.88,229,1635231600"; d="scan'208";a="228134927" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Dec 2021 07:03:26 -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-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Patchwork-Hint: comment Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 23, 2021 at 01:42:32PM +0000, Simon Ser wrote: > On Thursday, December 23rd, 2021 at 12:56, Ville Syrjälä wrote: > > > > - /* If we can't determine support, just bail */ > > > - if (!plane->funcs->format_mod_supported) > > > - goto done; > > > - > > > mod = modifiers_ptr(blob_data); > > > for (i = 0; i < plane->modifier_count; i++) { > > > for (j = 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älä Intel 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 F3EAEC433EF for ; Thu, 23 Dec 2021 15:03:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 42C1E10E269; Thu, 23 Dec 2021 15:03:27 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8DD5B10E269; Thu, 23 Dec 2021 15:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640271806; x=1671807806; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=aD1mewvXbqqunsX5Xqpz33bfhSDk3Xx9zQNCwf7UKxU=; b=VkPT64eCZRIBukFdLnd7Mkkw2a75nBt6RGWZ81l913E7RGGZzsbODtuE MmoLeNOEqo4pkhiszE8XkbfnLdQz5xFETHjedOL2dtGUGP14/0+YGiB+G jBdxgY8pYuMVZZ8h5MJeCJmhAlIVLH3wVNMx8OKjS36+ahx4wS/CV9VoZ jzyWuLivTfGq4CWv9d31tu/sTxn46Um5HwjzNN8YoTdfbW87hpGQnVkor U8XnGjoGJhCXmW/IiWfd4tbyg5lgKVib+zTRwl4V0NXO/ca/DPIrgkZVJ yplCOqVcprkR/jgFb1FfuVvcjyO/3ytjF4xsupFW/MidnBwcv1+RV3E7J g==; X-IronPort-AV: E=McAfee;i="6200,9189,10206"; a="221512496" X-IronPort-AV: E=Sophos;i="5.88,229,1635231600"; d="scan'208";a="221512496" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.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 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-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Patchwork-Hint: comment X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marex@denx.de, mcoquelin.stm32@gmail.com, kernel@pengutronix.de, s.hauer@pengutronix.de, tzimmermann@suse.de, airlied@linux.ie, intel-gfx@lists.freedesktop.org, alexandre.torgue@foss.st.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, yannick.fertre@foss.st.com, linux-imx@nxp.com, benjamin.gaignard@linaro.org, rodrigo.vivi@intel.com, dmitry.baryshkov@linaro.org, =?iso-8859-1?Q?Jos=E9_Exp=F3sito?= , shawnguo@kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, philippe.cornu@foss.st.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Dec 23, 2021 at 01:42:32PM +0000, Simon Ser wrote: > On Thursday, December 23rd, 2021 at 12:56, Ville Syrjälä wrote: > > > > - /* If we can't determine support, just bail */ > > > - if (!plane->funcs->format_mod_supported) > > > - goto done; > > > - > > > mod = modifiers_ptr(blob_data); > > > for (i = 0; i < plane->modifier_count; i++) { > > > for (j = 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älä Intel 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 22F67C433EF for ; Thu, 23 Dec 2021 15:03:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DB70410E28D; Thu, 23 Dec 2021 15:03:27 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8DD5B10E269; Thu, 23 Dec 2021 15:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640271806; x=1671807806; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=aD1mewvXbqqunsX5Xqpz33bfhSDk3Xx9zQNCwf7UKxU=; b=VkPT64eCZRIBukFdLnd7Mkkw2a75nBt6RGWZ81l913E7RGGZzsbODtuE MmoLeNOEqo4pkhiszE8XkbfnLdQz5xFETHjedOL2dtGUGP14/0+YGiB+G jBdxgY8pYuMVZZ8h5MJeCJmhAlIVLH3wVNMx8OKjS36+ahx4wS/CV9VoZ jzyWuLivTfGq4CWv9d31tu/sTxn46Um5HwjzNN8YoTdfbW87hpGQnVkor U8XnGjoGJhCXmW/IiWfd4tbyg5lgKVib+zTRwl4V0NXO/ca/DPIrgkZVJ yplCOqVcprkR/jgFb1FfuVvcjyO/3ytjF4xsupFW/MidnBwcv1+RV3E7J g==; X-IronPort-AV: E=McAfee;i="6200,9189,10206"; a="221512496" X-IronPort-AV: E=Sophos;i="5.88,229,1635231600"; d="scan'208";a="221512496" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.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 Message-ID: References: <20211222090552.25972-1-jose.exposito89@gmail.com> <20211222090552.25972-2-jose.exposito89@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Patchwork-Hint: comment Subject: Re: [Intel-gfx] =?iso-8859-1?q?=5BPATCH_v2_1/6=5D_drm/plane=3A_Make_?= =?iso-8859-1?q?format=5Fmod=5Fsupported_truly=A0optional?= X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marex@denx.de, mcoquelin.stm32@gmail.com, kernel@pengutronix.de, s.hauer@pengutronix.de, tzimmermann@suse.de, airlied@linux.ie, intel-gfx@lists.freedesktop.org, alexandre.torgue@foss.st.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, yannick.fertre@foss.st.com, linux-imx@nxp.com, benjamin.gaignard@linaro.org, dmitry.baryshkov@linaro.org, =?iso-8859-1?Q?Jos=E9_Exp=F3sito?= , shawnguo@kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, philippe.cornu@foss.st.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Thu, Dec 23, 2021 at 01:42:32PM +0000, Simon Ser wrote: > On Thursday, December 23rd, 2021 at 12:56, Ville Syrjälä wrote: > > > > - /* If we can't determine support, just bail */ > > > - if (!plane->funcs->format_mod_supported) > > > - goto done; > > > - > > > mod = modifiers_ptr(blob_data); > > > for (i = 0; i < plane->modifier_count; i++) { > > > for (j = 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älä Intel 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