public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Deborah Brouwer <deborah.brouwer@collabora.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
	daniel.almeida@collabora.com, aliceryhl@google.com,
	boris.brezillon@collabora.com,
	dri-devel <dri-devel-bounces@lists.freedesktop.org>
Subject: Re: [PATCH v2] drm/tyr: Clarify driver/device type names
Date: Mon, 23 Feb 2026 16:01:18 -0800	[thread overview]
Message-ID: <aZzqTv0IHGUfiLVN@um790> (raw)
In-Reply-To: <DGMO1YUKS8WK.H2FG6YL1ROC3@kernel.org>

On Mon, Feb 23, 2026 at 10:41:04PM +0100, Danilo Krummrich wrote:
> On Mon Feb 23, 2026 at 9:46 PM CET, Deborah Brouwer wrote:
> > Currently the `TyrDriver` struct implements both `platform::Driver` and
> > `drm::Driver`. For clarity, split up these two roles:
> >  - Introduce `TyrPlatformDeviceData` to implement `platform::Driver`, and
> 
> I think this should be TyrPlatformDriverData instead, i.e. it is the driver's
> private data that happens to be stored in (and owned by) the platform device.
> 
> The corresponding C setter is also called platform_set_drvdata() and not
> platform_set_devdata().

Yeah, I think you’re right, since we use this struct for
platform::Driver. I’ll rename it and send a v3.

> 
> >  - Introduce `TyrDrmDriver` to implement `drm::Driver`.
> >
> > Also rename other variables to reflect their roles in the DRM context:
> > - Rename `TyrDevice` to `TyrDrmDevice`
> > - Rename `TyrData` to `TyrDrmDeviceData`
> 
> Although it might sound contradictory at first, I think for a drm::Device it is
> OK to name it TyrDrmDeviceData as opposed to TyrDrmDriverData (although that
> would make sense as well and I'd probably prefer that).
> 
> The reason is that a platform::Device being a bus device may store different
> *driver specific* data types thoughout its whole lifetime, i.e. a platform
> device may be bound to multiple different drivers throughout its lifetime.
> 
> But a drm::Device being a class device is always *statically* typed over it's
> private data type, i.e. drm::Device<TyrDrmDeviceData>.

I'd definitely like to keep TyrDrmDeviceData for this struct because of
its relationship to the drm::Device.

Thanks for your review.

> 
> > - Rename `File` to `TyrDrmFileData`
> > - Rename `DrmFile` to `TyrDrmFile`
> >
> > No functional changes are intended.
> >
> > Co-developed-by: Boris Brezillon <boris.brezillon@collabora.com>
> > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> > Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
> 
> Otherwise LGTM.

      reply	other threads:[~2026-02-24  0:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 20:46 [PATCH v2] drm/tyr: Clarify driver/device type names Deborah Brouwer
2026-02-23 21:41 ` Danilo Krummrich
2026-02-24  0:01   ` Deborah Brouwer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aZzqTv0IHGUfiLVN@um790 \
    --to=deborah.brouwer@collabora.com \
    --cc=aliceryhl@google.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=dri-devel-bounces@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=rust-for-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox