From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.171.202.116 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795692557; b=qehbVzaevSoafrjXyy4QlRkkNrSKRoUgHVvt7BVSp0lUNUWeiW+3pf3n2ee6BgWv6ntp jsKoADoGIRgMmXr/2nVI+Bv8S0crl/1M4sjoWHwoX0/hciOkY5Um/4nIKsoDHG1VtNq0F r15MNRbya5LmpNAXnUrqOMtUYgUJ0xefGmmGTrS4G2wdX9n3EspDVeeJvM3p0RQ2LfHQz gb1BHD4X+gxc5H4hyrejvMV9m5XUBy4s+o5rLS3VVsIFL6FIFnTDX4g1P+vXiFdfN4e+u muidibAHMWF9RkzGiIMMPB1ZgC6t/McihoTszBmzwW70OBeCRhlVEMg37f+DD0ghgXg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795692557; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Last-TLS-Session-Version; bh=BFIKFUWab4Sjfx2EQ/0cBkR7gJ169gRtNZjrQAwFB60=; b=lVZCYr4SxrwO/2zuGjCuQBkR8m8yT+OhBsCZVFXTB7bxSEOghf1RHp2zXuP2iffUZTwO /R5Tnb9fKEBpt0Yu8aj5DHm44cuga7hJzwd7EKfFzwNJ0aO9vYgCtY0RoxMG475/W0XKf K89ls4lXceMiFF406KQBWn+yC2XY29SPPdQvTvZtpUDQo+aXFn/uqJuo92bSelI7GhUok LkLvCaQXe7QrhwjmFELT78sxLQqDRlPDXA4OxqVdb9UqMCF3lByvQwHVE/2xvcJqNosqF w8RapX+aMBvw7KXrdy5dIZIOJGdzoMLIS1swnIwKzD7dX0LHtK8XIzcPxd8lfzKpNLA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=L0ime269; arc=none smtp.remote-ip=185.171.202.116 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99AD7606A31E for ; Thu, 26 Nov 2026 11:29:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 99AD7606A31E 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.a=rsa-sha256 header.s=dkim header.b=L0ime269 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 44FA5C2B9C9; Thu, 26 Nov 2026 11:29:23 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id F098260237; Thu, 26 Nov 2026 11:29:14 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 59FB811E6B363; Thu, 26 Nov 2026 12:29:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1795692552; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=BFIKFUWab4Sjfx2EQ/0cBkR7gJ169gRtNZjrQAwFB60=; b=L0ime269umiW5T3qOIKfHRepIX0dbq/dFdeufIPsNgo8xq+2HdSwV8War9UWyrLQ4ZZ259 3n1cIi0+V/pLgU9rFwDQk9KmiWXsksct2DBNTuc4jTg2bYmPaPuFjfa00Qs5qgVUayIGcx c6868ChKj6hLo3HPs4dVjh51S2M1b+T3nTOuM/ZJNXsujHesVwBAVgwl4mOQSnP/CjYnVI tnqp6ubiaqNk+5FLCay7izVhTsNYiimOXkGxXhro0a9q0tMLS42SZXK8ZOprlrLfXbcqIL gJ0QqqOZJaquRCAIOCa0jIU1lndeOw5UO0a6cesSWsUKqyGEGU6tVawL3qpJUA== From: Louis Chauvet Date: Thu, 26 Nov 2026 12:28:45 +0100 Subject: [PATCH v7 02/43] drm/drm_mode_config: Add helper to get plane type name X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20261126-vkms-all-config-v7-2-21194cda2468@bootlin.com> References: <20261126-vkms-all-config-v7-0-21194cda2468@bootlin.com> In-Reply-To: <20261126-vkms-all-config-v7-0-21194cda2468@bootlin.com> To: Haneen Mohammed , Simona Vetter , Melissa Wen , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , jose.exposito89@gmail.com, Jonathan Corbet , Oarora Etimis , Harry Wentland , Lucas De Marchi , =?utf-8?q?Ville_Syrj=C3=A4l=C3=A4?= , Randy Dunlap , Nick Desaulniers , Louis Chauvet , Shuah Khan , Miguel Ojeda , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: Luca Ceresoli , Kory Maincent , sebastian.wick@redhat.com, victoria@system76.com, thomas.petazzoni@bootlin.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, llvm@lists.linux.dev, =?utf-8?q?Jos=C3=A9_Exp=C3=B3sito?= X-Mailer: b4 0.17-dev X-Last-TLS-Session-Version: TLSv1.3 Create and export a helper to display plane type using the property string. This could be used to display debug information in VKMS. Reviewed-by: José Expósito Reviewed-by: Oarora Etimis 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 c1e993a78702..0d814424c698 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -419,6 +419,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 type 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 084517beb924..545a5b684acc 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; @@ -1011,4 +1012,6 @@ int drm_mode_config_create_initial_state(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.56.0