From patchwork Mon Jan 9 10:58:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 13093284 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 CF9CCC5479D for ; Mon, 9 Jan 2023 11:01:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 97E1710E3D1; Mon, 9 Jan 2023 11:00:54 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4F88710E3D1; Mon, 9 Jan 2023 11:00:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=o4/GAvUPZ8JyReLwXLAtNiGfcLFGj5BmLx5PJZsZOdI=; b=BWCGlFG5f8mAyuWcqAsjd10bok yhdDvORYlP3Fs3F1XWCQGqjR+rhhu3rCoLoZ9jxbg6nMj1vs4eDOBK0ho/Y2MCLUAd6HJxvIgDkjJ cG+pR5L/pl+qkp8TrFRLWS418irL8hilxZPKzj38iNuinurNlfpkxbs6E4rcd0lWLI42ZYJlNkcQl s9n9EDr4F+Mm+iPv/GlUIwbMAX1lesAFSodflQ4PjUbIpqmWB84YPkWDZxP1xAd9hl/Jm3Wurjonn KCDfG5iA5PXaHDIyY32KTNiSsqXQ2KiLDaHZofzzgqkCJd4bdmE9Zmh2wath4VtAlIxT4p2vGuJtA Hy6ORsMw==; Received: from [187.36.234.139] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pEptC-003J8T-M6; Mon, 09 Jan 2023 12:00:27 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Clark , Simon Ser , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Zack Rusin Subject: [PATCH 1/5] drm/framebuffer: Check for valid formats Date: Mon, 9 Jan 2023 07:58:04 -0300 Message-Id: <20230109105807.18172-2-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230109105807.18172-1-mcanal@igalia.com> References: <20230109105807.18172-1-mcanal@igalia.com> MIME-Version: 1.0 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: =?utf-8?q?Andr=C3=A9_Almeida?= , intel-gfx@lists.freedesktop.org, =?utf-8?q?Ma=C3=ADra_Canal?= , dri-devel@lists.freedesktop.org, Melissa Wen , VMware Graphics Reviewers Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently, framebuffer_check() doesn't check if the pixel format is supported, which can lead to the acceptance of invalid pixel formats e.g. the acceptance of invalid modifiers. Therefore, add a check for valid formats on framebuffer_check(), so that the ADDFB2 IOCTL rejects calls with invalid formats. Moreover, note that this check is only valid for atomic drivers, because, for non-atomic drivers, checking drm_any_plane_has_format() is not possible since the format list for the primary plane is fake, and we'd therefore reject valid formats. Signed-off-by: Maíra Canal Reviewed-by: Daniel Vetter --- Documentation/gpu/todo.rst | 9 ++++----- drivers/gpu/drm/drm_framebuffer.c | 8 ++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 1f8a5ebe188e..3a79c26c5cc7 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -276,11 +276,10 @@ Various hold-ups: - Need to switch to drm_fbdev_generic_setup(), otherwise a lot of the custom fb setup code can't be deleted. -- Many drivers wrap drm_gem_fb_create() only to check for valid formats. For - atomic drivers we could check for valid formats by calling - drm_plane_check_pixel_format() against all planes, and pass if any plane - supports the format. For non-atomic that's not possible since like the format - list for the primary plane is fake and we'd therefor reject valid formats. +- Need to switch to drm_gem_fb_create(), as now framebuffer_check() checks for + valid formats for atomic drivers. + +- Add an addfb format validation for non-atomic drivers. - Many drivers subclass drm_framebuffer, we'd need a embedding compatible version of the varios drm_gem_fb_create functions. Maybe called diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index aff3746dedfb..605642bf3650 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -280,6 +280,14 @@ static int framebuffer_check(struct drm_device *dev, } } + /* Verify that the modifier is supported. */ + if (drm_drv_uses_atomic_modeset(dev) && + !drm_any_plane_has_format(dev, r->pixel_format, r->modifier[0])) { + drm_dbg_kms(dev, "Unsupported pixel format %p4cc / modifier 0x%llx\n", + &r->pixel_format, r->modifier[0]); + return -EINVAL; + } + return 0; } From patchwork Mon Jan 9 10:58:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 13093285 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 126FCC5479D for ; Mon, 9 Jan 2023 11:01:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E01A710E3DB; Mon, 9 Jan 2023 11:00:58 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8252210E3D1; Mon, 9 Jan 2023 11:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=hNATKjY7XIVBDuQWtFGcMf6VN0Mc5hffvyNLA+S25AI=; b=lkQA09gx55BwZIa6HfGjDaNnje i+gJgAFm5bGYjH2siDAMMZJ7h1qvdvgxnYMazDhouX5PJftkxCCT38lkvaVnV9cOP1nAd6xQ3uy1B KGCRMqz80CI43ICzPA3kXZVZz+FtmivNVs0a7Kn1aEpgaCai0IyLoBcGRbGwiHaSKNqKqhe+ozqtA BUVSDQJ+eI6qQEJYKzb7le80oNcUcMjTaBuRLxHSdDfKN5ZsUsJb0b1uW3Ovo+ELOdnsubvchLtEZ jJ67I306F+Jm0f2TSxKfQeds42To2iFFHp4dqT59hMEB2L/PflTLVuoYoY+Szn+P7YIDRvXm/XbAQ HweRZuow==; Received: from [187.36.234.139] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pEptJ-003J8T-Up; Mon, 09 Jan 2023 12:00:34 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Clark , Simon Ser , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Zack Rusin Subject: [PATCH 2/5] drm/amdgpu: Remove redundant framebuffer format check Date: Mon, 9 Jan 2023 07:58:05 -0300 Message-Id: <20230109105807.18172-3-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230109105807.18172-1-mcanal@igalia.com> References: <20230109105807.18172-1-mcanal@igalia.com> MIME-Version: 1.0 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: =?utf-8?q?Andr=C3=A9_Almeida?= , intel-gfx@lists.freedesktop.org, =?utf-8?q?Ma=C3=ADra_Canal?= , dri-devel@lists.freedesktop.org, Melissa Wen , VMware Graphics Reviewers Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Now that framebuffer_check() verifies that the format is properly supported, there is no need to check it again on amdgpu's inside helpers. Therefore, remove the redundant framebuffer format check from the amdgpu_display_gem_fb_verify_and_init() function, letting framebuffer_check() perform the framebuffer validation. Signed-off-by: Maíra Canal Reviewed-by: Simon Ser --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index b22471b3bd63..611b7a4b086c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -1120,16 +1120,6 @@ static int amdgpu_display_gem_fb_verify_and_init(struct drm_device *dev, rfb->base.obj[0] = obj; drm_helper_mode_fill_fb_struct(dev, &rfb->base, mode_cmd); - /* Verify that the modifier is supported. */ - if (!drm_any_plane_has_format(dev, mode_cmd->pixel_format, - mode_cmd->modifier[0])) { - drm_dbg_kms(dev, - "unsupported pixel format %p4cc / modifier 0x%llx\n", - &mode_cmd->pixel_format, mode_cmd->modifier[0]); - - ret = -EINVAL; - goto err; - } ret = amdgpu_display_framebuffer_init(dev, rfb, mode_cmd, obj); if (ret) From patchwork Mon Jan 9 10:58:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 13093286 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 18493C5479D for ; Mon, 9 Jan 2023 11:01:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8337010E3DC; Mon, 9 Jan 2023 11:01:02 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0F87D10E3D9; Mon, 9 Jan 2023 11:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Vf959UezHF2Cel3AL88HjjvfaoBXBtvA5RmAJ1bMWl4=; b=BKx99E2Ufl5aAxjfNkjN4lC5ir seuES+8BGKih1XrmJTveKMZ97TlJRLJ6dE4IHEomfeFovOdiSvUGclXV/qKYOHq7I3TiX8rs14chE +OdfJt6tUUUSTlg26fapAD/9ZHDYj9HZyCoslAonetE3OBVq4F4E23Wyb7VtXfdFEuuewA/NlXsfM X2cRDCtKy9biCtgTClP0hQV3FBca8StE3ZDgg7ph0LNBrvfHAdSwh08rNpn4FY25Hw/bvvBtuQgJF 9cTlbwzTr/fqPlfinB7c7MUdN4SftUjkyWLvMrL+fxLp/l5zbfhLgcKTSR8Dtkuh0BWos+K61pAl9 tKRHMz6w==; Received: from [187.36.234.139] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pEptR-003J8T-3v; Mon, 09 Jan 2023 12:00:41 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Clark , Simon Ser , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Zack Rusin Subject: [PATCH 3/5] drm/i915: Remove redundant framebuffer format check Date: Mon, 9 Jan 2023 07:58:06 -0300 Message-Id: <20230109105807.18172-4-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230109105807.18172-1-mcanal@igalia.com> References: <20230109105807.18172-1-mcanal@igalia.com> MIME-Version: 1.0 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: =?utf-8?q?Andr=C3=A9_Almeida?= , intel-gfx@lists.freedesktop.org, =?utf-8?q?Ma=C3=ADra_Canal?= , dri-devel@lists.freedesktop.org, Melissa Wen , VMware Graphics Reviewers Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Now that framebuffer_check() verifies that the format is properly supported, there is no need to check it again on i915's inside helpers. Therefore, remove the redundant framebuffer format check from the intel_framebuffer_init() function, letting framebuffer_check() perform the framebuffer validation. Signed-off-by: Maíra Canal Reviewed-by: Simon Ser --- drivers/gpu/drm/i915/display/intel_fb.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index 63137ae5ab21..230b729e42d6 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -1914,15 +1914,6 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb, } } - if (!drm_any_plane_has_format(&dev_priv->drm, - mode_cmd->pixel_format, - mode_cmd->modifier[0])) { - drm_dbg_kms(&dev_priv->drm, - "unsupported pixel format %p4cc / modifier 0x%llx\n", - &mode_cmd->pixel_format, mode_cmd->modifier[0]); - goto err; - } - /* * gen2/3 display engine uses the fence if present, * so the tiling mode must match the fb modifier exactly. From patchwork Mon Jan 9 10:58:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 13093287 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 7F7DFC54EBE for ; Mon, 9 Jan 2023 11:01:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A34010E3D9; Mon, 9 Jan 2023 11:01:09 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 92E1B10E3D9; Mon, 9 Jan 2023 11:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=V5/qx31Umdj7qyI/DYqiwcwccn1rAZXUVGviGuCPWcU=; b=S925dcg/iB3k3CKo2aYIvXpI7U wWROTkjnhBu0Ek6JuqvDhBT6x2pcL0UEhwGyU5EiOZ0PM7eqkz2ZvOQpL1X6xpSOs1/nYoqkvO/A0 MQHQLcGDxBSjFjUDWRLAMjtjR2Bt4AJCyqtfmT0hvMZJ2jSA53MKqLnq58/1d7PK7SZU0FdY2rrdn eobyBDRiJnOpWt0SlU3X/VJSKpn5xpoF0bIADlQld4X/Uh/y3zbsP+lTgddBc28W8lIEMYH8VN/WP RIFmlAlVRfi593VgdyLlHJii+bEuX4y2ODPl6z70pbbouRX1qKsknMqOrl+CSCRUsmXs39X7z5pvR Xq9XxOsw==; Received: from [187.36.234.139] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pEptY-003J8T-9X; Mon, 09 Jan 2023 12:00:48 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Clark , Simon Ser , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Zack Rusin Subject: [PATCH 4/5] drm/vmwgfx: Remove redundant framebuffer format check Date: Mon, 9 Jan 2023 07:58:07 -0300 Message-Id: <20230109105807.18172-5-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230109105807.18172-1-mcanal@igalia.com> References: <20230109105807.18172-1-mcanal@igalia.com> MIME-Version: 1.0 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: =?utf-8?q?Andr=C3=A9_Almeida?= , intel-gfx@lists.freedesktop.org, =?utf-8?q?Ma=C3=ADra_Canal?= , dri-devel@lists.freedesktop.org, Melissa Wen , VMware Graphics Reviewers Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Now that framebuffer_check() verifies that the format is properly supported, there is no need to check it again on vmwgfx's inside helpers. Therefore, remove the redundant framebuffer format check from the vmw_kms_new_framebuffer_surface() and vmw_kms_new_framebuffer_bo() functions, letting framebuffer_check() perform the framebuffer validation. Signed-off-by: Maíra Canal Reviewed-by: Zack Rusin --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 257f090071f1..05b8d8f912bf 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -1317,15 +1317,6 @@ static int vmw_kms_new_framebuffer_surface(struct vmw_private *dev_priv, * Sanity checks. */ - if (!drm_any_plane_has_format(&dev_priv->drm, - mode_cmd->pixel_format, - mode_cmd->modifier[0])) { - drm_dbg(&dev_priv->drm, - "unsupported pixel format %p4cc / modifier 0x%llx\n", - &mode_cmd->pixel_format, mode_cmd->modifier[0]); - return -EINVAL; - } - /* Surface must be marked as a scanout. */ if (unlikely(!surface->metadata.scanout)) return -EINVAL; @@ -1648,15 +1639,6 @@ static int vmw_kms_new_framebuffer_bo(struct vmw_private *dev_priv, return -EINVAL; } - if (!drm_any_plane_has_format(&dev_priv->drm, - mode_cmd->pixel_format, - mode_cmd->modifier[0])) { - drm_dbg(&dev_priv->drm, - "unsupported pixel format %p4cc / modifier 0x%llx\n", - &mode_cmd->pixel_format, mode_cmd->modifier[0]); - return -EINVAL; - } - vfbd = kzalloc(sizeof(*vfbd), GFP_KERNEL); if (!vfbd) { ret = -ENOMEM; From patchwork Mon Jan 9 10:58:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 13093288 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 946A8C63797 for ; Mon, 9 Jan 2023 11:01:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 553F410E3DE; Mon, 9 Jan 2023 11:01:18 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2179C10E3DE; Mon, 9 Jan 2023 11:01:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=eGjSqlvIIXPbc0RBsmGw1UndYXOvIzaz2I1V/JEHNg0=; b=pb9AVQWlLjGRLoVwv4yZcI1Y+J V7pMzuOiV+C/ENKnQGIoVGwx5HyzzYD6LR0DaQAaF2Aop1q0hKXtsbREo3i8hBwNkR31mvYoYsxHT TTOVhN1cqrvmAE7sLF4nvrkjDdt749bn3aFG8SxLmTR4PGHmOlJtzKV3gwlrGpm4zeMQfeMSpwTLk CCbhlTgd/WtidYc1SFiQG4wV1rvzANFlUPI+W83xMS5KGvEPRrXOSoHTaQg/OQWaiGFBEBQ2q4uwN XLacQ0w9q+zzkbExnQ2Eri5GRUyw01wbvKojAxoXzQ1MfCEpefrefmGFGGS/C5ahQO+XwdI77c0Dh 6yuZ+pmQ==; Received: from [187.36.234.139] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pEpte-003J8T-Hf; Mon, 09 Jan 2023 12:00:55 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Clark , Simon Ser , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Zack Rusin Subject: [PATCH 5/5] drm/plane: Unexport drm_any_plane_has_format() Date: Mon, 9 Jan 2023 07:58:08 -0300 Message-Id: <20230109105807.18172-6-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230109105807.18172-1-mcanal@igalia.com> References: <20230109105807.18172-1-mcanal@igalia.com> MIME-Version: 1.0 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: =?utf-8?q?Andr=C3=A9_Almeida?= , intel-gfx@lists.freedesktop.org, =?utf-8?q?Ma=C3=ADra_Canal?= , dri-devel@lists.freedesktop.org, Melissa Wen , VMware Graphics Reviewers Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" As the format validation is being dealt with exclusively inside framebuffer_check(), there is no need to export the drm_any_plane_has_format() symbol. Therefore, unexport the drm_any_plane_has_format() symbol, reinforcing that format validation is being dealt with by the DRM API. Signed-off-by: Maíra Canal Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_plane.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 24e7998d1731..67c0ab60c7b6 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -837,7 +837,6 @@ bool drm_any_plane_has_format(struct drm_device *dev, return false; } -EXPORT_SYMBOL(drm_any_plane_has_format); /* * __setplane_internal - setplane handler for internal callers