drm/radeon: Test for fbdev GEM object with generic helper

Replace radeon's test for the fbdev GEM object with a call to the
generic helper.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Thomas Zimmermann
2026-03-04 13:58:39 +01:00
committed by Alex Deucher
parent 1837c76b78
commit 7ba5286aad
3 changed files with 4 additions and 25 deletions

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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);