mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wu Hoi Pok <wuhoipok@gmail.com>
Cc: "Thomas Zimmermann" <tzimmermann@suse.de>,
	"Wu Hoi Pok" <wuhoipok@gmail.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v3 4/6] drm/radeon: add helper rdev_to_drm(rdev)
Date: Sun, 30 Jun 2024 12:59:20 -0400	[thread overview]
Message-ID: <20240630165949.117634-5-wuhoipok@gmail.com> (raw)
In-Reply-To: <20240630165949.117634-1-wuhoipok@gmail.com>

Add helper rdev_to_drm(rdev), similar to amdgpu, most function should
access the "drm_device" with "rdev_to_drm(rdev)" instead, where amdgpu has
"adev_to_drm(adev)". It also makes changing from "*drm_device" to "drm_device"
in "radeon_devicce" later on easier.

Signed-off-by: Wu Hoi Pok <wuhoipok@gmail.com>
---
 drivers/gpu/drm/radeon/radeon.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 0999c8eaae94..ae35c102a487 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -2476,6 +2476,11 @@ void r100_io_wreg(struct radeon_device *rdev, u32 reg, u32 v);
 u32 cik_mm_rdoorbell(struct radeon_device *rdev, u32 index);
 void cik_mm_wdoorbell(struct radeon_device *rdev, u32 index, u32 v);
 
+static inline struct drm_device *rdev_to_drm(struct radeon_device *rdev)
+{
+	return rdev->ddev;
+}
+
 /*
  * Cast helper
  */
-- 
2.45.2


  parent reply	other threads:[~2024-06-30 17:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-30 16:59 [PATCH v3 0/6] drm/radeon: remove load callback & drm_dev_alloc Wu Hoi Pok
2024-06-30 16:59 ` [PATCH v3 1/6] drm/radeon: change variable name "dev" to "ddev" for consistency Wu Hoi Pok
2024-07-03  8:42   ` Thomas Zimmermann
2024-06-30 16:59 ` [PATCH v3 2/6] drm/radeon: remove load callback from kms_driver Wu Hoi Pok
2024-07-03  8:43   ` Thomas Zimmermann
2024-09-19 16:56   ` Arthur Marsh
2024-09-24  2:08     ` radeon ARUBA NULL pointer dereference Arthur Marsh
2024-09-24 12:20       ` Thomas Zimmermann
2024-09-24 12:42         ` Thomas Zimmermann
2024-09-24 14:22           ` Alex Deucher
2024-09-24 19:30             ` Ewan Milne
2024-09-25 18:13               ` Ewan Milne
2024-09-25  0:22             ` NULL pointer dereference after ib test on ring 7 succeeded Arthur Marsh
2024-09-25  8:02               ` Thomas Zimmermann
2024-09-30 15:25                 ` NULL pointer dereference with kernel 6.12.0-rc1 and ARUBA GPU Arthur Marsh
2024-09-30 17:54                   ` Christian König
2024-10-07 12:44                     ` Thomas Zimmermann
2024-06-30 16:59 ` [PATCH v3 3/6] drm/radeon: use variable flags as parameter Wu Hoi Pok
2024-07-03  8:44   ` Thomas Zimmermann
2024-06-30 16:59 ` Wu Hoi Pok [this message]
2024-07-03  8:44   ` [PATCH v3 4/6] drm/radeon: add helper rdev_to_drm(rdev) Thomas Zimmermann
2024-06-30 16:59 ` [PATCH v3 5/6] drm/radeon: change rdev->ddev to rdev_to_drm(rdev) Wu Hoi Pok
2024-07-03  8:46   ` Thomas Zimmermann
2024-06-30 16:59 ` [PATCH v3 6/6] drm/radeon: change drm_dev_alloc to devm_drm_dev_alloc Wu Hoi Pok
2024-07-03  8:47   ` Thomas Zimmermann
2024-07-08 20:04     ` Alex Deucher
2024-07-03  8:52 ` [PATCH v3 0/6] drm/radeon: remove load callback & drm_dev_alloc Thomas Zimmermann
2024-07-04  4:58   ` Hoi Pok Wu
2024-07-04 13:02     ` Christian König

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=20240630165949.117634-5-wuhoipok@gmail.com \
    --to=wuhoipok@gmail.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®