From: Boris Brezillon <boris.brezillon@collabora.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: aliceryhl@google.com, daniel.almeida@collabora.com,
deborah.brouwer@collabora.com, gary@garyguo.net,
dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH 1/2] gpu: drm: tyr: separate driver type from driver data
Date: Tue, 26 May 2026 08:43:58 +0200 [thread overview]
Message-ID: <20260526084358.3fb40cff@fedora> (raw)
In-Reply-To: <20260525230152.277820-2-dakr@kernel.org>
On Tue, 26 May 2026 01:01:43 +0200
Danilo Krummrich <dakr@kernel.org> wrote:
> Introduce TyrPlatformDriver as a unit struct for the platform::Driver
> trait implementation and keep TyrPlatformDriverData for the private
> driver data.
>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
> drivers/gpu/drm/tyr/driver.rs | 10 ++++++----
> drivers/gpu/drm/tyr/tyr.rs | 4 ++--
> 2 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
> index 2224fdb20a51..5f4c484f671f 100644
> --- a/drivers/gpu/drm/tyr/driver.rs
> +++ b/drivers/gpu/drm/tyr/driver.rs
> @@ -51,6 +51,8 @@
> /// Convenience type alias for the DRM device type for this driver.
> pub(crate) type TyrDrmDevice = drm::Device<TyrDrmDriver>;
>
> +pub(crate) struct TyrPlatformDriver;
> +
> #[pin_data(PinnedDrop)]
> pub(crate) struct TyrPlatformDriverData {
> _device: ARef<TyrDrmDevice>,
> @@ -93,22 +95,22 @@ fn issue_soft_reset(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result {
> kernel::of_device_table!(
> OF_TABLE,
> MODULE_OF_TABLE,
> - <TyrPlatformDriverData as platform::Driver>::IdInfo,
> + <TyrPlatformDriver as platform::Driver>::IdInfo,
> [
> (of::DeviceId::new(c"rockchip,rk3588-mali"), ()),
> (of::DeviceId::new(c"arm,mali-valhall-csf"), ())
> ]
> );
>
> -impl platform::Driver for TyrPlatformDriverData {
> +impl platform::Driver for TyrPlatformDriver {
> type IdInfo = ();
> - type Data<'bound> = Self;
> + type Data<'bound> = TyrPlatformDriverData;
> const OF_ID_TABLE: Option<of::IdTable<Self::IdInfo>> = Some(&OF_TABLE);
>
> fn probe<'bound>(
> pdev: &'bound platform::Device<Core<'_>>,
> _info: Option<&'bound Self::IdInfo>,
> - ) -> impl PinInit<Self, Error> + 'bound {
> + ) -> impl PinInit<Self::Data<'bound>, Error> + 'bound {
> let core_clk = Clk::get(pdev.as_ref(), Some(c"core"))?;
> let stacks_clk = OptionalClk::get(pdev.as_ref(), Some(c"stacks"))?;
> let coregroup_clk = OptionalClk::get(pdev.as_ref(), Some(c"coregroup"))?;
> diff --git a/drivers/gpu/drm/tyr/tyr.rs b/drivers/gpu/drm/tyr/tyr.rs
> index 9432ddd6b5b8..95cda7b0962f 100644
> --- a/drivers/gpu/drm/tyr/tyr.rs
> +++ b/drivers/gpu/drm/tyr/tyr.rs
> @@ -5,7 +5,7 @@
> //! The name "Tyr" is inspired by Norse mythology, reflecting Arm's tradition of
> //! naming their GPUs after Nordic mythological figures and places.
>
> -use crate::driver::TyrPlatformDriverData;
> +use crate::driver::TyrPlatformDriver;
>
> mod driver;
> mod file;
> @@ -14,7 +14,7 @@
> mod regs;
>
> kernel::module_platform_driver! {
> - type: TyrPlatformDriverData,
> + type: TyrPlatformDriver,
> name: "tyr",
> authors: ["The Tyr driver authors"],
> description: "Arm Mali Tyr DRM driver",
next prev parent reply other threads:[~2026-05-26 6:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-25 23:01 [PATCH 0/2] drm: tyr: use lifetime-bound IoMem Danilo Krummrich
2026-05-25 23:01 ` [PATCH 1/2] gpu: drm: tyr: separate driver type from driver data Danilo Krummrich
2026-05-26 1:17 ` Eliot Courtney
2026-05-26 6:43 ` Boris Brezillon [this message]
2026-05-25 23:01 ` [PATCH 2/2] gpu: drm: tyr: use IoMem directly instead of Devres Danilo Krummrich
2026-05-26 1:30 ` Alexandre Courbot
2026-05-26 2:43 ` Eliot Courtney
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=20260526084358.3fb40cff@fedora \
--to=boris.brezillon@collabora.com \
--cc=aliceryhl@google.com \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=deborah.brouwer@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--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