From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (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 7BE98433E90 for ; Fri, 3 Jul 2026 07:33:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.112 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783063999; cv=pass; b=tG+InRwXCYoaARPjSnI47d4uRjMQX4qKOLt3Z/2eDSvRyd1v3qThspr8FXRkVHTzVCxhfLAo4f8Xs7i7wkFkMuPHSzw7lpH1rj9jOs6qXmRiZo2mlZx6OtOfky1udaSqO/8UxLyNNdFQngj9LmQQNqReemxxwgICEjfZuPErHy0= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783063999; c=relaxed/simple; bh=wI2TZ0WFSFDwpF7qqCwBPniuNr37VzDqM8rj/n9d2DM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VA/IiKLF4JZvCdFXMcKpNqIcwJydQ0Im30mqW9IAghXaAaokg907FdslEkfSHfsqqGOIxTi3aM+ngX0WRgGnTKX/6RfIp4hrKlUhkFd4HLI0uGhiYQKOzHvn31YbZrRCIbgC2Q4lkYPhDZ7gE72N0j3BOSUk3M3ZCYdpsDZEEwU= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (1024-bit key) header.d=collabora.com header.i=robert.mader@collabora.com header.b=G+YS6hGx; arc=pass smtp.client-ip=136.143.188.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=robert.mader@collabora.com header.b="G+YS6hGx" ARC-Seal: i=1; a=rsa-sha256; t=1783063970; cv=none; d=zohomail.com; s=zohoarc; b=cjiKBcRJ2FcfJtGgLDm2hbDOXuOzDEnA24oOaPihvz6qIPbq9wEKxbb3M0feRtvHBVG60El62ZZLHx8zffZhHOXTKl2SdPUKMez3SwxvPlJ8tvewbgcn8rUAyL5SumQBTKZNyo5khjCxoQiXFig5BbYsuN+YK9ntAf/0LFh8OBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783063970; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZYbUgCJ3ExixzrmVpyLYUCTsn1F7Y7J8nLL7GxXpIYs=; b=JO+ESHHtQJksuVG6yAiK5+GCGF4sT7bkLIFTmDQBoCFSc35ozTiejfVA6lGXyPHEncdnpG8gCIpNhyRx72PWt+vhAfGGKJkLZaKn045OvtlfxCyLC4UgUzJR/kgs2z+x+/ZUpdpJCDoTBrc5VmsZVIDwBNqbGKeEUFeXKlwf64Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=robert.mader@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1783063970; s=zohomail; d=collabora.com; i=robert.mader@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=ZYbUgCJ3ExixzrmVpyLYUCTsn1F7Y7J8nLL7GxXpIYs=; b=G+YS6hGx1beU1SmsTlsKvXRZGgG6QuBlxYqowKWcvbO20A3qEvUsmoCJLcOS7FXq kHShIcWj3WttwZYHofQna6PIYhBU1PJhXVXog/GPoJEV5tDR7iLWVkA/6+gNvjERu5Z aaiYeAEnQg6U4tTrBHbmAsce/6DyJLT/gNdJQHkE= Received: by mx.zohomail.com with SMTPS id 1783063968273443.120155012085; Fri, 3 Jul 2026 00:32:48 -0700 (PDT) From: Robert Mader To: dri-devel@lists.freedesktop.org Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Harry Wentland , Daniel Stone , Chaitanya Kumar Borah , Uma Shankar , Louis Chauvet , Melissa Wen , Simon Ser , Pekka Paalanen , Leandro Ribeiro , Robert Mader Subject: [PATCH v3] drm: Guard DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE Date: Fri, 3 Jul 2026 09:32:30 +0200 Message-ID: <20260703073230.19982-1-robert.mader@collabora.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The client cap is currently advertised unconditionally, even for drivers that do not support plane color pipelines. If clients supporting the later, like Wayland compositors or tools like drm_info, enable the client cap on such drivers they will be left without both color pipeline and the legacy properties COLOR_ENCODING and COLOR_RANGE, effectively breaking YUV->RGB conversion support. Prevent that by only marking the cap supported if there are actually planes with color pipelines. Note: while the color pipeline replacement for the legacy properties is still under review (1), we can assume that it will work as a drop-in replacement. That means any plane on any hardware currently supporting the legacy properties will be able to offer a functionally equal color pipeline and there will be no technical reason keep using the legacy properties if both the driver and the client support the new API. 1: https://lore.kernel.org/dri-devel/20260623164812.81110-1-harry.wentland@amd.com/ Signed-off-by: Robert Mader --- Changes in v3: - Move the new check behind the existing EINVAL ones - Rebase on latest drm-misc-next Changes in v2: - Replace the driver feature with a simple check (suggested by Maarten Lankhorst ) - Expand the commit message slightly and change the title --- drivers/gpu/drm/drm_ioctl.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index e2df4becce62..9039a39c4324 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -373,13 +373,25 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv) return -EINVAL; file_priv->supports_virtualized_cursor_plane = req->value; break; - case DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE: + case DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE: { + struct drm_plane *plane; + bool has_plane_with_color_pipeline = false; + if (!file_priv->atomic) return -EINVAL; if (req->value > 1) return -EINVAL; + drm_for_each_plane(plane, dev) { + if (plane->color_pipeline_property) { + has_plane_with_color_pipeline = true; + break; + } + } + if (!has_plane_with_color_pipeline) + return -EOPNOTSUPP; file_priv->plane_color_pipeline = req->value; break; + } default: return -EINVAL; } -- 2.55.0