From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8610648BD4C for ; Wed, 17 Jun 2026 15:02:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781708568; cv=none; b=gf9s98f3/uG6Ryj+6Xis2PWvRDqq1i9ZTsUqRmVZfliY6+du+e+Iau86FUInJvzVO2KdRCScGP2UxCmfT7kQvLbsUqFYj9ZoyRu5HH2MzexyOAmyoniawl1qBI7wOUH0lQ0PXcCYKWsGo7tbViHgaN89Jw8QBs3k+fSIdzYJU+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781708568; c=relaxed/simple; bh=DNdKDgHLt7eV5CPwMxr0aJwKqQGASqB5sKINx5OsMF4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IJKpKT48/rMEvgcjrmE0Al/EUkZgdLW36chEMaFMuXhnk0Mu11f2pH2atpc+En+CNOMA4ZO8+x+CERo+yQQJ1imm70IlO2hSwcROSvy9WcYTqMQPPmHUbQkjoVneHWOSsx61IOJryb2cUbN4mrJcymNwEaej6+kUPQMKiy8PNIM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fireburn.co.uk; spf=none smtp.mailfrom=fireburn.co.uk; dkim=pass (2048-bit key) header.d=fireburn-co-uk.20251104.gappssmtp.com header.i=@fireburn-co-uk.20251104.gappssmtp.com header.b=DL35pcnp; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fireburn.co.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=fireburn.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fireburn-co-uk.20251104.gappssmtp.com header.i=@fireburn-co-uk.20251104.gappssmtp.com header.b="DL35pcnp" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-4629324e170so855070f8f.0 for ; Wed, 17 Jun 2026 08:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fireburn-co-uk.20251104.gappssmtp.com; s=20251104; t=1781708564; x=1782313364; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ok+RjE4+w5Tv/U34IMQhdlbVd3kP3wRLvfnVhKYPL2M=; b=DL35pcnp2gj5xGKPDNBJh1OHfu7UBp0+A4FMNFhEzfjkbi3u2zQlANjF+Wy8FA/sAT lJLQLFDKGaAlwBLJk4uoSKr+mrahX7tfuVd3O7v3o8g2lCrV2HYEQukgrFHn9rnc/lNa 3oXiO20yRB8m7eRLnHnnypkLgElAfAqBcrGvayYxwDxDfWhk+bld5Ztl4WOJtuGmIeBX 0gg00zTi+HBQu4mHQUEOII92zQUQ9hN7O/api5hH8ZhUPonR55opBnUAkEx/I8REWbKP inu1AleEFXg2xkMvI43JoiQjdWA95IhPr/yK47sUhkTdGl1zHp60SFItEI6Vd8XwGNRB LW+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781708564; x=1782313364; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ok+RjE4+w5Tv/U34IMQhdlbVd3kP3wRLvfnVhKYPL2M=; b=oZL5SLd/EOYktpmRCrAf/fDpbrxIiX6Jj8spW6l7ixkGzpxOQuvAwCIfqIn9A1bJ58 aypPJT5LYgbWZwpYMfdeq7slKI2yFFowkbWvo6js3uslw6KNjxgdR6GGgq8W2lAGSSFM BuTLD800FhxhXw3l6a8T4UnM2X7dlClS0uO5IxXEQt+KutnbGXpfyUwSoPZOc4qdsMt4 5ghm8FeoCY8AFNzBwnlQiLta5Uyu6KN4FChy+jRu++T+fjVRGXJX0LrJv8ZPwWZecB4L 3y/siORlq2pA80qi5dxZnacY2eBwB/XdDWdzEbuW0/sYKXwKM+5JLMHDgLA0jl4nlfhN vMjg== X-Forwarded-Encrypted: i=1; AFNElJ+T0cXHlBXLAgQtS0Cn/1YrhGz6KYTG0KR3yL2Wynh/1pg52oKsufZXXB5rpb17pU3Th6kxDQTl/rkjA3Y=@vger.kernel.org X-Gm-Message-State: AOJu0Ywpuh2StmKYPUjTm3ZiwsZPwbrrdOFgVq+fsbOqCSaqripNO12q mL9cu2XZMsAbH0KAWgqOjU3fH6XxEhh7y+25ctvrb1Z9UAU2+vE/8f+ux+APpvgMuQ== X-Gm-Gg: Acq92OEK+z3Zs6l/INnViYam86JM74Rw+E0CTaa9exWFSieY3h3zWkBaGidm1OPrNAP wFsONaa+vqaksgm+BUTPvOpEnmsCro4J91RahdXWZaYD+OYhxG8Ea+875AX7nFG7ilS47Br4NRi jyWNQfPTldBJuTgvrIVxvKKBS5mIEycPqjYNvL4vL4diC62dpX9LozsSQEp/NFCt4JqhXuEWkGC lTNV+iwK1vc2xYsGghFLi/YD18AXT41wo9gGmXvVuiqQoR6LxUINU3VvlKJvupj188MxL5CJ35v RyXKOlygMubIdCHm+KNwF37ioMfY4OKCGvznhB0FKy/hgbqKUmB4aoWpvYINWW79nfDMrN9V12h avKj686vaz+3euSAvCiO/L1uWIOlQ/Ca1PiirbI/+/tg9+IC4riyXWPT+KOxubvsnXg5qXJhrry 8cmIAsMPV2YLzHk+n3t5OM5lx6Fmc7nBKSLfJ2cusRvKpdaIR8nYzLDHZy X-Received: by 2002:a05:600c:8189:b0:490:b355:9c70 with SMTP id 5b1f17b1804b1-492333aaa9emr69289915e9.11.1781708563939; Wed, 17 Jun 2026 08:02:43 -0700 (PDT) Received: from axion.fireburn.co.uk ([137.220.119.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4606f26f1cdsm57264311f8f.11.2026.06.17.08.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2026 08:02:43 -0700 (PDT) From: Mike Lothian To: dri-devel@lists.freedesktop.org Cc: Mike Lothian , rust-for-linux@vger.kernel.org, Miguel Ojeda , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , David Airlie , Simona Vetter , Daniel Almeida , Greg Kroah-Hartman , Alexandre Courbot , Asahi Lina , Lorenzo Stoakes , Joel Fernandes , linux-kernel@vger.kernel.org Subject: [RFC PATCH 4/4] rust: drm: expose drm_blend.h and the atomic new-CRTC-state accessor Date: Wed, 17 Jun 2026 16:02:26 +0100 Message-ID: <20260617150232.2210-5-mike@fireburn.co.uk> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260617150232.2210-1-mike@fireburn.co.uk> References: <20260617150232.2210-1-mike@fireburn.co.uk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Two further KMS binding prerequisites used by the in-tree DisplayLink DL3 (vino) driver, beyond the simple-display-pipe header set: - drm_blend.h, for drm_plane_create_rotation_property() and the DRM_MODE_ROTATE_* / DRM_MODE_REFLECT_* constants, so a driver can attach the standard atomic plane rotation property. - a rust_helper for drm_atomic_get_new_crtc_state(): it is static inline in and so is not callable from Rust directly. It returns a CRTC's new state within an atomic commit (NULL when the CRTC is not part of the commit), letting a driver inspect the proposed configuration from its mode_config atomic_check(). vino uses it to sum the pixel clocks of all heads and reject a modeset that would exceed the dock's USB bandwidth. Signed-off-by: Mike Lothian Assisted-by: Claude:claude-opus-4-8 [Claude-Code] --- rust/bindings/bindings_helper.h | 1 + rust/helpers/drm.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h index 5b311944cc14..5ff21c33385e 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/rust/helpers/drm.c b/rust/helpers/drm.c index 65f3f22b0e1d..5087daa23ed8 100644 --- a/rust/helpers/drm.c +++ b/rust/helpers/drm.c @@ -1,11 +1,23 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include #ifdef CONFIG_DRM +/* Read-only accessor for a CRTC's *new* state within an atomic commit (returns NULL if the CRTC + * is not part of the commit). It is static-inline in , so Rust cannot call it + * directly; the vino driver uses it in its combined-bandwidth atomic_check. + */ +__rust_helper struct drm_crtc_state * +rust_helper_drm_atomic_get_new_crtc_state(const struct drm_atomic_commit *state, + struct drm_crtc *crtc) +{ + return drm_atomic_get_new_crtc_state(state, crtc); +} + __rust_helper void rust_helper_drm_gem_object_get(struct drm_gem_object *obj) { drm_gem_object_get(obj); -- 2.54.0