From mboxrd@z Thu Jan 1 00:00:00 1970 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 767FDC79F9F for ; Thu, 10 Sep 2026 10:08:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF57010F427; Thu, 10 Sep 2026 10:08:30 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PSSdoryc"; dkim-atps=neutral Received: from mail-lf2-f12.google.com (mail-lf2-f12.google.com [74.125.229.204]) by gabe.freedesktop.org (Postfix) with ESMTPS id B6BE610F217 for ; Wed, 9 Sep 2026 17:45:15 +0000 (UTC) Received: by mail-lf2-f12.google.com with SMTP id 2adb3069b0e04-5b76668f4ddso420415e87.1 for ; Wed, 09 Sep 2026 10:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788975914; x=1789580714; darn=lists.freedesktop.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=ZFJ8LJvBoSFpLXLWJCrf1H0OwBPOca5szWV2v59OKPs=; b=PSSdorycJR9/t0YpIXurj2tYwV4N7hyA2FuG3zOFR6+PT1t9m+xhHOJy4EclqMOJ24 2rGDH8RZfRej2wSN/AnRMnWT9h6EBNH/XsNI3C6qIlKqFX11TPOXyojlxn9lX75grqqZ Y/+GcqFCpyBGdihCzYoJyppOwDOp5s+TTxRPXg6dVMLjFihTS5SSWM/yzg+N1Wt7W3Sy qy23TOQLw6ChOZvCBY+nuku0l+xqDd0p6ClEAH23ql0MzzKggpDs402m6VQMYj+iDUGQ /F4VfkWjryEKlsWoofUWdLCgteRj4osM1GTBIQUh8ruAWGzxH+cUbcHXYklxSxLl8c5U d1mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788975914; x=1789580714; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=ZFJ8LJvBoSFpLXLWJCrf1H0OwBPOca5szWV2v59OKPs=; b=jfBU14VdffJkbMi1xnvFBsW3DOY1tHjdxpWVZCX8KifxdQQHFYKOST4ywKCs4yv3MU bw/f+IXONKTcgJ89NdO4d8B8RE2EM90hhk3NRrWuDsbvIlwWb5E98FewpArk96zjoaq9 tAszjjA/YkQuDIgODIxF8jGeMKaqsFho/SiOnTlMXFysDiMi9GvFr0iV/u5h1O5iX3S0 +8tC9jigyxoytA22Tq+ieo5pyzW8DsBIeyu48w+KGWOrpEkkYNANHWh6J4vj8l0kxuLo 8LQK9kbfdJjPdBRycT1yeGRPi5mNspgJvPZnXGxrjCMyafG2PAc5OUQCt9sITc3AsnWW SMlA== X-Forwarded-Encrypted: i=1; AKwUvBxKy0zp063jODc//bRrK0ztkp17Ly7lTjBfK6iIfzNuXfu3Xwgym8bYptwoRr6Yaj/XMm7ofdHs@lists.freedesktop.org X-Gm-Message-State: AFuF++mcYsAG9VOaFDm7sTvZOKzUKEFqZBtKRGN0xgd7Q2r+GaMRUOO8 HWkWHJBAMMNdf4RV81xayJAJ2Kw6nSZVYTdHf3aVSa8Ihp3ChdoW2JVV X-Gm-Gg: AYBFou0s1BA6LNbtFgddnK6h0XIj67XXWa4q8PMR+KbODQMFZKBMzVKH/29tDs7S759 6o79Q/df/xJXAVthw8vJxTGll8ElCMQulhn5O4M7q0dYf4M2nDPPYW3OZqJ8ZwL/ubmp1Y0x1WN fFAxWVASUW7sIcUIMtXQWxz3xydfeA85vcrhh45JWaWdEkopGIhqAIUl1n5yb3MryrG+fl0J2lB xEtJZZT0bQC21BTd3u00l9SdXbn8cySoMyLYRMH1jwDyCaMj5acBzjfoB3giz7VEBd5E8IyCQ2d YeK+fmtdopGX3fkgiW4fN8edPymGxSaXVFuQ6tLOl/SwdjArr59elHeJACYdFDrpNZxY7aaK8Vq XWZgQjOB7uCDP05abRvoIUorIK4XeVRbv6u5voldwgfenOrZ0jQzz4Sdwbk9bR4f3sJUDth0XAa 0rD8sLkoU/Xjz8aFBtALGt/8ZyAK2c0cAkmYjFC2a1lCjt1crGIGKyK1hPL0MqgP6BkCZVUCBmY efFbq/SXXTi/w== X-Received: by 2002:a05:6512:1590:b0:5b4:ac27:8f76 with SMTP id 2adb3069b0e04-5b89a2fb651mr67482e87.7.1788975913434; Wed, 09 Sep 2026 10:45:13 -0700 (PDT) Received: from localhost (soda.int.kasm.eu. [2001:678:a5c:1202:7b92:9ac1:b9ef:5287]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b6166ecf24sm4071183e87.16.2026.09.09.10.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 10:45:13 -0700 (PDT) Date: Wed, 9 Sep 2026 19:45:12 +0200 From: Klara Modin To: Mike Lothian Cc: Alex Deucher , Thomas Zimmermann , Thorsten Leemhuis , Gary Guo , dri-devel@lists.freedesktop.org, dakr@kernel.org, aliceryhl@google.com, alexander.deucher@amd.com, mukul.joshi@amd.com, rust-for-linux@vger.kernel.org, amd-gfx@lists.freedesktop.org Subject: Re: [PATCH] rust: drm: gem: add missing handle_free to the object vtables Message-ID: References: <20260909094729.1593-1-mike@fireburn.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailman-Approved-At: Thu, 10 Sep 2026 10:08:30 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On 2026-09-09 11:57:37 -0400, Alex Deucher wrote: > Adding a few people. Alternative patch at: > https://lists.freedesktop.org/archives/amd-gfx/2026-September/152673.html > > Alex > > On Wed, Sep 9, 2026 at 5:47 AM Mike Lothian wrote: > > > > Both OBJECT_FUNCS and the shmem VTABLE initialise every member of > > drm_gem_object_funcs explicitly, so adding a field to the C struct > > breaks the Rust build: > > > > error[E0063]: missing field `handle_free` in initializer of > > `drm_gem_object_funcs` > > > > The callback is optional and the Rust abstraction has no equivalent > > DriverObject method, so leave it unset. > > > > The shmem copy is only built with CONFIG_RUST_DRM_GEM_SHMEM_HELPER, > > which DRM_TYR selects. Sorry, I missed you when sending my v2. It's at https://lore.kernel.org/lkml/20260909173103.73656-1-klarasmodin@gmail.com/T/#u if you want to have a look. Regards, Klara Modin > > > > Fixes: b67d2d039f64 ("drm/gem: Add callback for when handle count goes to 0") > > Signed-off-by: Mike Lothian > > Assisted-by: Claude:Opus-5 [Claude Code] > > --- > > > > b67d2d039f64 is only in agd5f/drm-next, so this can be squashed into it > > instead if you would rather keep that branch bisectable. > > > > The shmem hunk is by inspection - CONFIG_RUST_DRM_GEM_SHMEM_HELPER is > > not set in my config, so only the mod.rs copy is compile-tested. > > > > rust/kernel/drm/gem/mod.rs | 1 + > > rust/kernel/drm/gem/shmem.rs | 1 + > > 2 files changed, 2 insertions(+) > > > > diff --git a/rust/kernel/drm/gem/mod.rs b/rust/kernel/drm/gem/mod.rs > > index 80d8f524f9d5..ae61ca7e1246 100644 > > --- a/rust/kernel/drm/gem/mod.rs > > +++ b/rust/kernel/drm/gem/mod.rs > > @@ -278,6 +278,7 @@ impl Object { > > vm_ops: core::ptr::null_mut(), > > evict: None, > > rss: None, > > + handle_free: None, > > }; > > > > /// Returns the `Device` that owns this GEM object. > > diff --git a/rust/kernel/drm/gem/shmem.rs b/rust/kernel/drm/gem/shmem.rs > > index a687d46d170d..d08a03cb7a13 100644 > > --- a/rust/kernel/drm/gem/shmem.rs > > +++ b/rust/kernel/drm/gem/shmem.rs > > @@ -145,6 +145,7 @@ impl Object { > > // SAFETY: `drm_gem_shmem_vm_ops` is a valid, static const on the C side. > > vm_ops: unsafe { &raw const bindings::drm_gem_shmem_vm_ops }, > > evict: None, > > + handle_free: None, > > }; > > > > /// Return a raw pointer to the embedded drm_gem_shmem_object. > > -- > > 2.55.0 > >