]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/radeon: add helper rdev_to_drm(rdev)
authorWu Hoi Pok <wuhoipok@gmail.com>
Sun, 30 Jun 2024 16:59:20 +0000 (12:59 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Jul 2024 21:31:59 +0000 (17:31 -0400)
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.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Wu Hoi Pok <wuhoipok@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon.h

index 0999c8eaae94adf1eea943d75624dfd94f33ece4..ae35c102a487e1e04b9a57c566879dcac5780faa 100644 (file)
@@ -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
  */