diff mbox series

[v3,4/6] drm/radeon: add helper rdev_to_drm(rdev)

Message ID 20240630165949.117634-5-wuhoipok@gmail.com (mailing list archive)
State New, archived
Headers show
Series drm/radeon: remove load callback & drm_dev_alloc | expand

Commit Message

Hoi Pok Wu June 30, 2024, 4:59 p.m. UTC
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(+)

Comments

Thomas Zimmermann July 3, 2024, 8:44 a.m. UTC | #1
Am 30.06.24 um 18:59 schrieb Wu Hoi Pok:
> 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>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>


> ---
>   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
>    */
diff mbox series

Patch

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
  */