diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2023-03-16 12:37:33 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-03-31 18:18:42 +0300 |
commit | b4bbe4761ee2d4127eb751737dcbf47a310a9f86 (patch) | |
tree | 074e923409ca1e15bf0327c1199c5b43417cf505 /drivers/gpu/drm/radeon/radeon_fb.c | |
parent | 11b6005865e47c4cba862678936628175acfa16e (diff) | |
download | linux-b4bbe4761ee2d4127eb751737dcbf47a310a9f86.tar.xz |
drm/radeon: Move fbdev object helpers before struct fb_ops et al
Move the helpers for creating and destroying fbdev GEM objects
to the top of the source file. Makes them available to fb_ops
functions. This will allow to implement framebuffer cleanup in
fb_destroy. No functional changes.
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>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_fb.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fb.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index 7af038ed0d2d..152563c6e55a 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c @@ -40,44 +40,6 @@ #include "radeon.h" -static int -radeonfb_open(struct fb_info *info, int user) -{ - struct drm_fb_helper *fb_helper = info->par; - struct radeon_device *rdev = fb_helper->dev->dev_private; - int ret = pm_runtime_get_sync(rdev->ddev->dev); - - if (ret < 0 && ret != -EACCES) { - pm_runtime_mark_last_busy(rdev->ddev->dev); - pm_runtime_put_autosuspend(rdev->ddev->dev); - return ret; - } - return 0; -} - -static int -radeonfb_release(struct fb_info *info, int user) -{ - struct drm_fb_helper *fb_helper = info->par; - struct radeon_device *rdev = fb_helper->dev->dev_private; - - pm_runtime_mark_last_busy(rdev->ddev->dev); - pm_runtime_put_autosuspend(rdev->ddev->dev); - return 0; -} - -static const struct fb_ops radeonfb_ops = { - .owner = THIS_MODULE, - DRM_FB_HELPER_DEFAULT_OPS, - .fb_open = radeonfb_open, - .fb_release = radeonfb_release, - .fb_read = drm_fb_helper_cfb_read, - .fb_write = drm_fb_helper_cfb_write, - .fb_fillrect = drm_fb_helper_cfb_fillrect, - .fb_copyarea = drm_fb_helper_cfb_copyarea, - .fb_imageblit = drm_fb_helper_cfb_imageblit, -}; - static void radeonfb_destroy_pinned_object(struct drm_gem_object *gobj) { struct radeon_bo *rbo = gem_to_radeon_bo(gobj); @@ -178,6 +140,44 @@ out_unref: return ret; } +static int +radeonfb_open(struct fb_info *info, int user) +{ + struct drm_fb_helper *fb_helper = info->par; + struct radeon_device *rdev = fb_helper->dev->dev_private; + int ret = pm_runtime_get_sync(rdev->ddev->dev); + + if (ret < 0 && ret != -EACCES) { + pm_runtime_mark_last_busy(rdev->ddev->dev); + pm_runtime_put_autosuspend(rdev->ddev->dev); + return ret; + } + return 0; +} + +static int +radeonfb_release(struct fb_info *info, int user) +{ + struct drm_fb_helper *fb_helper = info->par; + struct radeon_device *rdev = fb_helper->dev->dev_private; + + pm_runtime_mark_last_busy(rdev->ddev->dev); + pm_runtime_put_autosuspend(rdev->ddev->dev); + return 0; +} + +static const struct fb_ops radeonfb_ops = { + .owner = THIS_MODULE, + DRM_FB_HELPER_DEFAULT_OPS, + .fb_open = radeonfb_open, + .fb_release = radeonfb_release, + .fb_read = drm_fb_helper_cfb_read, + .fb_write = drm_fb_helper_cfb_write, + .fb_fillrect = drm_fb_helper_cfb_fillrect, + .fb_copyarea = drm_fb_helper_cfb_copyarea, + .fb_imageblit = drm_fb_helper_cfb_imageblit, +}; + static int radeonfb_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { |