On Wed, Mar 4, 2026 at 8:03 AM Thomas Zimmermann <[email protected]> wrote:
>
> Replace radeon's test for the fbdev GEM object with a call to the
> generic helper.
>
> Signed-off-by: Thomas Zimmermann <[email protected]>

Series is:
Reviewed-by: Alex Deucher <[email protected]>

Did you want me to pick these up or did you want to land them in drm-misc?

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_device.c |  7 ++++---
>  drivers/gpu/drm/radeon/radeon_fbdev.c  | 17 -----------------
>  drivers/gpu/drm/radeon/radeon_mode.h   |  5 -----
>  3 files changed, 4 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c 
> b/drivers/gpu/drm/radeon/radeon_device.c
> index 5d523d5dae88..705c012fcf9e 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -37,6 +37,7 @@
>  #include <drm/drm_client_event.h>
>  #include <drm/drm_crtc_helper.h>
>  #include <drm/drm_device.h>
> +#include <drm/drm_fb_helper.h>
>  #include <drm/drm_file.h>
>  #include <drm/drm_framebuffer.h>
>  #include <drm/drm_probe_helper.h>
> @@ -1574,7 +1575,6 @@ int radeon_suspend_kms(struct drm_device *dev, bool 
> suspend,
>         list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
>                 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
>                 struct drm_framebuffer *fb = crtc->primary->fb;
> -               struct radeon_bo *robj;
>
>                 if (radeon_crtc->cursor_bo) {
>                         struct radeon_bo *robj = 
> gem_to_radeon_bo(radeon_crtc->cursor_bo);
> @@ -1588,9 +1588,10 @@ int radeon_suspend_kms(struct drm_device *dev, bool 
> suspend,
>                 if (fb == NULL || fb->obj[0] == NULL) {
>                         continue;
>                 }
> -               robj = gem_to_radeon_bo(fb->obj[0]);
>                 /* don't unpin kernel fb objects */
> -               if (!radeon_fbdev_robj_is_fb(rdev, robj)) {
> +               if (!drm_fb_helper_gem_is_fb(dev->fb_helper, fb->obj[0])) {
> +                       struct radeon_bo *robj = gem_to_radeon_bo(fb->obj[0]);
> +
>                         r = radeon_bo_reserve(robj, false);
>                         if (r == 0) {
>                                 radeon_bo_unpin(robj);
> diff --git a/drivers/gpu/drm/radeon/radeon_fbdev.c 
> b/drivers/gpu/drm/radeon/radeon_fbdev.c
> index 18d61f3f7344..3e243f5e2f44 100644
> --- a/drivers/gpu/drm/radeon/radeon_fbdev.c
> +++ b/drivers/gpu/drm/radeon/radeon_fbdev.c
> @@ -274,20 +274,3 @@ int radeon_fbdev_driver_fbdev_probe(struct drm_fb_helper 
> *fb_helper,
>         radeon_fbdev_destroy_pinned_object(gobj);
>         return ret;
>  }
> -
> -bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo 
> *robj)
> -{
> -       struct drm_fb_helper *fb_helper = rdev_to_drm(rdev)->fb_helper;
> -       struct drm_gem_object *gobj;
> -
> -       if (!fb_helper)
> -               return false;
> -
> -       gobj = drm_gem_fb_get_obj(fb_helper->fb, 0);
> -       if (!gobj)
> -               return false;
> -       if (gobj != &robj->tbo.base)
> -               return false;
> -
> -       return true;
> -}
> diff --git a/drivers/gpu/drm/radeon/radeon_mode.h 
> b/drivers/gpu/drm/radeon/radeon_mode.h
> index 088af85902f7..ae1ecdc2e189 100644
> --- a/drivers/gpu/drm/radeon/radeon_mode.h
> +++ b/drivers/gpu/drm/radeon/radeon_mode.h
> @@ -936,14 +936,9 @@ int radeon_fbdev_driver_fbdev_probe(struct drm_fb_helper 
> *fb_helper,
>                                     struct drm_fb_helper_surface_size *sizes);
>  #define RADEON_FBDEV_DRIVER_OPS \
>         .fbdev_probe = radeon_fbdev_driver_fbdev_probe
> -bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo 
> *robj);
>  #else
>  #define RADEON_FBDEV_DRIVER_OPS \
>         .fbdev_probe = NULL
> -static inline bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, 
> struct radeon_bo *robj)
> -{
> -       return false;
> -}
>  #endif
>
>  void radeon_crtc_handle_vblank(struct radeon_device *rdev, int crtc_id);
> --
> 2.53.0
>

Reply via email to