From patchwork Fri Jan 13 11:27:44 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: 13100627 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 558BEC61DB3 for ; Fri, 13 Jan 2023 11:30:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 732C010E9ED; Fri, 13 Jan 2023 11:30:08 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 34B7610E9ED; Fri, 13 Jan 2023 11:29:59 +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=hMAR/fe4a+AqXAMEBm+JMkSSpKLeGsuHKZQINVwuouc=; b=LhaDe5mhl16sH5G5xPhH2DW2JR o4pEfB07Vv6iEMcqQkqTXykHllm+RF5SHwq15hsmCX3nhsI5oumo3Xtbt2/KwZwXetR7PrvKpQxFg xYdv9La38MLFjdjjbc3mVDtip/SAv0ZiqvxrTQ+Hiqyv/5mn6XUo1OOpFDpYN09zLYgtUfDb7ESoR E6i+dulb4jJE+7ggQz5H3VFheFn5pXAA1Maef5q0KqZZFXKWw3YzsXvKY42ziK+PIfOld+1oarUdw GtCZPoyCcw5UfkIETSJELwvh4cSawcFkzsQ5EW2B15b1qHkrbmJh2VFr7/mkqKcIj4erTUmNzKdol pL9rneYg==; 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 1pGIFk-0075dF-IM; Fri, 13 Jan 2023 12:29:45 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Clark , Simon Ser , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Zack Rusin Subject: [PATCH v2 3/3] drm/vmwgfx: Remove redundant framebuffer format check Date: Fri, 13 Jan 2023 08:27:44 -0300 Message-Id: <20230113112743.188486-4-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113112743.188486-1-mcanal@igalia.com> References: <20230113112743.188486-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?= , =?utf-8?q?Ma?= =?utf-8?q?=C3=ADra_Canal?= , amd-gfx@lists.freedesktop.org, Melissa Wen , VMware Graphics Reviewers , dri-devel@lists.freedesktop.org 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. Reviewed-by: Zack Rusin Signed-off-by: MaĆ­ra Canal --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 18 ------------------ 1 file changed, 18 deletions(-) -- 2.39.0 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;