From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78CFB37D11B for ; Wed, 22 Apr 2026 16:48:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776876535; cv=none; b=s4VDlKrNTxaJRicm8KRCX8xO8OiqiuF2Q0ajPCG8b0tFYlvxDdMmcQ5kVGBWA/2AdAwmRAY7Ri2+TKwS9K9B/+0PYM9iGzBj3RYfkZ/5hhFxMLPekBQwazUxhxHECeqOa3XaaueWZ9g7RbXcHlFG4sQmET6HJlrOZ+rsMNrz2xg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776876535; c=relaxed/simple; bh=hrZpRGWu4LNZeNdHRz/ol6Ax5lsWTUrl8gemjwFLDRU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mHsR2gPEUdfJ+4N3JX/w5IOhuFu40B72BVC/EPmCUqrNn5WcLjmwcelT5FuqQljvsLsnoL2aGuhFU9V0qzw+cPElxm+JGtPFneZSxeu2cdnjVzdR//FyrrwK7IRLhyii8K0uqQNiPcV9acEmu71JESG5JO6dbg+1IizcB8R6+VQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=SeJbKyaf; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="SeJbKyaf" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 0C944C5C1A5; Wed, 22 Apr 2026 16:49:34 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2A46F5FA8F; Wed, 22 Apr 2026 16:48:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C804E104608C5; Wed, 22 Apr 2026 18:48:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1776876532; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=gf9mF48VXHnP1N09HZxt9nMhSHMdo9IElWOjBUOr0+Q=; b=SeJbKyaf0hR5oTLzdYmgOiprU/NYV71OXYDkHxq2eEDthGVirfi/G+LyuVuxBwooK8Qb52 KTHTWvVfDfm80HlQvtXKDYImoOe2+VrGJ+ahifvnison89qkEtx2XPPgCkxUCxo9gT9eUy wRsvEKZkA/qxJpgJ8h1ssfTCNUYlA0oEjrukwoVFyXOuPP0k+kyfl2LNJyPmnIIiV7LrdK rcr9NIX8rmM/SgmNRGsA69ZH/MplgkvwGpLXRAPEyt09uUsTvY6POBrQvQgTM7BsOpBfuc 0Tkdyp6Mv7nn9OnBguHgZEnQToxhjeHotr3GDxrNvbMmjTMleYnc2CtLZVWA8w== From: Louis Chauvet Date: Wed, 22 Apr 2026 18:47:58 +0200 Subject: [PATCH v4 01/37] drm/drm_mode_config: Add helper to get plane type name Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20260422-vkms-all-config-v4-1-dbb52e9aadc3@bootlin.com> References: <20260422-vkms-all-config-v4-0-dbb52e9aadc3@bootlin.com> In-Reply-To: <20260422-vkms-all-config-v4-0-dbb52e9aadc3@bootlin.com> To: Haneen Mohammed , Simona Vetter , Melissa Wen , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , jose.exposito89@gmail.com, Jonathan Corbet , Shuah Khan , Miguel Ojeda , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: victoria@system76.com, sebastian.wick@redhat.com, victoria@system76.com, airlied@gmail.com, thomas.petazzoni@bootlin.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Louis Chauvet , llvm@lists.linux.dev, =?utf-8?q?Jos=C3=A9_Exp=C3=B3sito?= X-Mailer: b4 0.16-dev X-Last-TLS-Session-Version: TLSv1.3 Create and export an helper to display plane type using the property string. This could be used to display debug information in VKMS. Reviewed-by: José Expósito Signed-off-by: Louis Chauvet --- drivers/gpu/drm/drm_mode_config.c | 16 ++++++++++++++++ include/drm/drm_mode_config.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index 66f7dc37b597..2855a0262972 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -231,6 +231,22 @@ static const struct drm_prop_enum_list drm_plane_type_enum_list[] = { { DRM_PLANE_TYPE_CURSOR, "Cursor" }, }; +/** + * drm_get_plane_type_name - return a string for plane name + * @type: plane type to compute name of + * + * Returns: The name of the plane type. "(unknown)" if type is not a known + * plane type. + */ +const char *drm_get_plane_type_name(enum drm_plane_type type) +{ + if (type >= 0 && type < ARRAY_SIZE(drm_plane_type_enum_list)) + return drm_plane_type_enum_list[type].name; + else + return "(unknown)"; +} +EXPORT_SYMBOL(drm_get_plane_type_name); + static int drm_mode_create_standard_properties(struct drm_device *dev) { struct drm_property *prop; diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 687c0ee163d2..2df7c0be17fc 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -30,6 +30,7 @@ #include #include +#include struct drm_file; struct drm_device; @@ -1010,4 +1011,6 @@ static inline int drm_mode_config_init(struct drm_device *dev) void drm_mode_config_reset(struct drm_device *dev); void drm_mode_config_cleanup(struct drm_device *dev); +const char *drm_get_plane_type_name(enum drm_plane_type type); + #endif -- 2.54.0