public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/tyr: Use DRM device type alias across driver
@ 2026-03-02 20:23 Deborah Brouwer
  2026-03-03  2:52 ` Claude review: " Claude Code Review Bot
  2026-03-03  2:52 ` Claude Code Review Bot
  0 siblings, 2 replies; 3+ messages in thread
From: Deborah Brouwer @ 2026-03-02 20:23 UTC (permalink / raw)
  To: dri-devel, rust-for-linux
  Cc: daniel.almeida, aliceryhl, boris.brezillon, Deborah Brouwer

Currently Tyr defines a convenience type alias for its DRM device type,
`TyrDrmDevice` but it does not use the alias outside of `tyr/driver.rs`.

Replace `drm::Device<TyrDrmDriver>` with the alias `TyrDrmDevice` across
the driver.

This change will ease future upstream Tyr development by reducing the
diffs when multiple series are touching these files.

No functional changes are intended.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
---
 drivers/gpu/drm/tyr/file.rs | 7 +++++--
 drivers/gpu/drm/tyr/gem.rs  | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/tyr/file.rs b/drivers/gpu/drm/tyr/file.rs
index 450be5ab9aaf..31411da203c5 100644
--- a/drivers/gpu/drm/tyr/file.rs
+++ b/drivers/gpu/drm/tyr/file.rs
@@ -7,7 +7,10 @@
     uapi, //
 };
 
-use crate::driver::TyrDrmDriver;
+use crate::driver::{
+    TyrDrmDevice,
+    TyrDrmDriver, //
+};
 
 #[pin_data]
 pub(crate) struct TyrDrmFileData {}
@@ -25,7 +28,7 @@ fn open(_dev: &drm::Device<Self::Driver>) -> Result<Pin<KBox<Self>>> {
 
 impl TyrDrmFileData {
     pub(crate) fn dev_query(
-        ddev: &drm::Device<TyrDrmDriver>,
+        ddev: &TyrDrmDevice,
         devquery: &mut uapi::drm_panthor_dev_query,
         _file: &TyrDrmFile,
     ) -> Result<u32> {
diff --git a/drivers/gpu/drm/tyr/gem.rs b/drivers/gpu/drm/tyr/gem.rs
index 514524ae07ef..5cd0cd9585e8 100644
--- a/drivers/gpu/drm/tyr/gem.rs
+++ b/drivers/gpu/drm/tyr/gem.rs
@@ -5,7 +5,10 @@
     prelude::*, //
 };
 
-use crate::driver::TyrDrmDriver;
+use crate::driver::{
+    TyrDrmDevice,
+    TyrDrmDriver, //
+};
 
 /// GEM Object inner driver data
 #[pin_data]
@@ -14,7 +17,7 @@ pub(crate) struct TyrObject {}
 impl gem::DriverObject for TyrObject {
     type Driver = TyrDrmDriver;
 
-    fn new(_dev: &kernel::drm::Device<TyrDrmDriver>, _size: usize) -> impl PinInit<Self, Error> {
+    fn new(_dev: &TyrDrmDevice, _size: usize) -> impl PinInit<Self, Error> {
         try_pin_init!(TyrObject {})
     }
 }

base-commit: 15da5bc9f3adab7242867db0251fe451ac3ddb72
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Claude review: drm/tyr: Use DRM device type alias across driver
  2026-03-02 20:23 [PATCH] drm/tyr: Use DRM device type alias across driver Deborah Brouwer
@ 2026-03-03  2:52 ` Claude Code Review Bot
  2026-03-03  2:52 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-03-03  2:52 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: drm/tyr: Use DRM device type alias across driver
Author: Deborah Brouwer <deborah.brouwer@collabora.com>
Patches: 1
Reviewed: 2026-03-03T12:52:31.199995

---

This is a single, straightforward cleanup patch for the Rust-based Tyr DRM driver. It replaces verbose fully-qualified `drm::Device<TyrDrmDriver>` types with the existing convenience alias `TyrDrmDevice` in `file.rs` and `gem.rs`. The change is purely mechanical with no functional impact.

**Notably, the drm-next tree already contains an equivalent (and more comprehensive) version of this change** — the types have been renamed from `TyrDrmDriver`/`TyrDrmDevice` to `TyrDriver`/`TyrDevice`, and both `file.rs` and `gem.rs` already use the alias. This patch appears to be based on an older branch where the renaming hasn't happened yet. The patch itself may already be superseded or need rebasing.

The patch is correct for the base it targets. No issues found.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Claude review: drm/tyr: Use DRM device type alias across driver
  2026-03-02 20:23 [PATCH] drm/tyr: Use DRM device type alias across driver Deborah Brouwer
  2026-03-03  2:52 ` Claude review: " Claude Code Review Bot
@ 2026-03-03  2:52 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-03-03  2:52 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Status: Correct, no issues**

The change is minimal and mechanical:

1. **`file.rs` import update** — Adds `TyrDrmDevice` to the import:
```rust
-use crate::driver::TyrDrmDriver;
+use crate::driver::{
+    TyrDrmDevice,
+    TyrDrmDriver, //
+};
```
`TyrDrmDriver` is still needed because the `DriverFile` impl uses `type Driver = TyrDrmDriver;`. The trailing `//` comment is a `rustfmt` trick to force one-item-per-line formatting — this is a common Rust style convention and matches the existing pattern at the top of the file (e.g., `uapi, //`).

2. **`file.rs` signature update** — `dev_query` uses the alias:
```rust
-        ddev: &drm::Device<TyrDrmDriver>,
+        ddev: &TyrDrmDevice,
```
Correct. Note that `fn open(_dev: &drm::Device<Self::Driver>)` is intentionally left unchanged since it uses the associated type `Self::Driver` through the trait, which is the idiomatic pattern there.

3. **`gem.rs` import and signature update** — Same pattern as `file.rs`:
```rust
-    fn new(_dev: &kernel::drm::Device<TyrDrmDriver>, _size: usize) -> impl PinInit<Self, Error> {
+    fn new(_dev: &TyrDrmDevice, _size: usize) -> impl PinInit<Self, Error> {
```
Correct. The `type Driver = TyrDrmDriver;` associated type is kept since it's required by the trait.

**Minor observation:** As mentioned above, the drm-next tree (`file.rs:3`, `file.rs:27`; `gem.rs:3`, `gem.rs:15`) already has this change applied with the shorter names `TyrDevice`/`TyrDriver`. This patch will not apply to drm-next and appears to target a different base branch. The commit message's rationale about "reducing diffs when multiple series are touching these files" supports this — it's likely a preparatory cleanup for a feature branch.

**Reviewed-by assessment:** The patch is trivially correct for its stated base. No functional concerns.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-03  2:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02 20:23 [PATCH] drm/tyr: Use DRM device type alias across driver Deborah Brouwer
2026-03-03  2:52 ` Claude review: " Claude Code Review Bot
2026-03-03  2:52 ` Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox