From patchwork Fri Jan 13 16:59:17 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: 13101176 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 782FEC54EBE for ; Fri, 13 Jan 2023 17:00:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 52E1110EA68; Fri, 13 Jan 2023 17:00:50 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0319910EA70; Fri, 13 Jan 2023 17:00:45 +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: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: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=DrZc8MSzrHVHBgJa18wvhWOqlyQHor/Els1DuHpffTk=; b=AF1L9pxnYrH5CkcpGl1zPyEksX XCW9YXyIfpo2mz0JvtbYlzmoPNiqmLXaxzrUUcsX+Niq4KDFG9Je/G6jhZhgcBYSISFoTCoTG9mDS np+NKLS9PNX9B7JGd2LJ1VMl+mG4eDQIO5L1t1yy5C7obh/38htyYyOXhVp4DgEfUGrDgwtj/xB8T 0BI7IN88jHVAW7SRfEIqq+GhapRbyY/XAUZ95Q5xByb8AK2xu4KGVENQx8Jg8/dPTNoh+IK/TLOGK 96y93S+PkE1kEUjXL12FKQYWcG3dH7jFmkUIvUHaQvXBwK4qiCe7wxABJlOsM9axUmBK14Kj+3BNF sksMsIhA==; 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 1pGNPg-007Hoz-Mk; Fri, 13 Jan 2023 18:00:21 +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 v3 0/3] Check for valid framebuffer's format Date: Fri, 13 Jan 2023 13:59:17 -0300 Message-Id: <20230113165919.580210-1-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 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" This series is a follow-up of the [1] in which I introduced a check for valid formats on drm_gem_fb_create(). During the discussion, I realized that would be a better idea to put the check inside framebuffer_check() so that it wouldn't be needed to hit any driver-specific code path when the check fails. Therefore, add the valid format check inside framebuffer_check() and remove the same check from the drivers, except from i915, because this doesn't work for the legacy tiling->modifier path. Adding the check to framebuffer_check() will guarantee that the igt@kms_addfb_basic@addfb25-bad-modifier IGT test passes, showing the correct behavior of the check. This patchset was tested on amdgpu and vc4 with the IGT tests. [1] https://lore.kernel.org/dri-devel/20230103125322.855089-1-mcanal@igalia.com/T/ --- v1 -> v2: https://lore.kernel.org/dri-devel/20230109105807.18172-1-mcanal@igalia.com/T/ - Don't remove check from i915 driver (Ville Syrjälä). - Don't unexport drm_any_plane_has_format(). v2 -> v3: https://lore.kernel.org/dri-devel/20230113112743.188486-1-mcanal@igalia.com/T/ - Check if r->modifier[0] != 0 (Ville Syrjälä). --- Best Regards, - Maíra Canal Maíra Canal (3): drm/framebuffer: Check for valid formats drm/amdgpu: Remove redundant framebuffer format check drm/vmwgfx: Remove redundant framebuffer format check Documentation/gpu/todo.rst | 9 ++++----- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 10 ---------- drivers/gpu/drm/drm_framebuffer.c | 8 ++++++++ drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 18 ------------------ 4 files changed, 12 insertions(+), 33 deletions(-)