summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Hoi Pok <wuhoipok@gmail.com>2024-06-30 19:59:20 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-09 12:32:37 +0300
commit28f6a86a2f6613967e947dd116b20d3e8d97e23c (patch)
tree16d7b9c07df9600903a5269927813cc655d55a3b
parent95070c084e201dbdfa7b9d9241621ff099e1cb25 (diff)
downloadlinux-28f6a86a2f6613967e947dd116b20d3e8d97e23c.tar.xz
drm/radeon: add helper rdev_to_drm(rdev)
[ Upstream commit a6e23bec8ed184ed2a11080b28cdbd7a3024f0c0 ] 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> Stable-dep-of: 7037bb04265e ("drm/radeon: Fix spurious unplug event on radeon HDMI") Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/radeon/radeon.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 426a49851e34..e0a02b357ce7 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -2478,6 +2478,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
*/