Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Use drm_fb_helper_fill_info

Should not cause any changes.

v2: Rebase

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Samuel Li <Samuel.Li@amd.com>
Cc: "Michel Dänzer" <michel.daenzer@amd.com>
Cc: Huang Rui <ray.huang@amd.com>
Cc: Junwei Zhang <Jerry.Zhang@amd.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Stone <daniels@collabora.com>
Cc: Shirish S <shirish.s@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-4-daniel.vetter@ffwll.ch

+8 -16
+8 -16
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
··· 49 49 static int 50 50 amdgpufb_open(struct fb_info *info, int user) 51 51 { 52 - struct amdgpu_fbdev *rfbdev = info->par; 53 - struct amdgpu_device *adev = rfbdev->adev; 54 - int ret = pm_runtime_get_sync(adev->ddev->dev); 52 + struct drm_fb_helper *fb_helper = info->par; 53 + int ret = pm_runtime_get_sync(fb_helper->dev->dev); 55 54 if (ret < 0 && ret != -EACCES) { 56 - pm_runtime_mark_last_busy(adev->ddev->dev); 57 - pm_runtime_put_autosuspend(adev->ddev->dev); 55 + pm_runtime_mark_last_busy(fb_helper->dev->dev); 56 + pm_runtime_put_autosuspend(fb_helper->dev->dev); 58 57 return ret; 59 58 } 60 59 return 0; ··· 62 63 static int 63 64 amdgpufb_release(struct fb_info *info, int user) 64 65 { 65 - struct amdgpu_fbdev *rfbdev = info->par; 66 - struct amdgpu_device *adev = rfbdev->adev; 66 + struct drm_fb_helper *fb_helper = info->par; 67 67 68 - pm_runtime_mark_last_busy(adev->ddev->dev); 69 - pm_runtime_put_autosuspend(adev->ddev->dev); 68 + pm_runtime_mark_last_busy(fb_helper->dev->dev); 69 + pm_runtime_put_autosuspend(fb_helper->dev->dev); 70 70 return 0; 71 71 } 72 72 ··· 231 233 goto out; 232 234 } 233 235 234 - info->par = rfbdev; 235 - 236 236 ret = amdgpu_display_framebuffer_init(adev->ddev, &rfbdev->rfb, 237 237 &mode_cmd, gobj); 238 238 if (ret) { ··· 243 247 /* setup helper */ 244 248 rfbdev->helper.fb = fb; 245 249 246 - strcpy(info->fix.id, "amdgpudrmfb"); 247 - 248 - drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth); 249 - 250 250 info->fbops = &amdgpufb_ops; 251 251 252 252 tmp = amdgpu_bo_gpu_offset(abo) - adev->gmc.vram_start; ··· 251 259 info->screen_base = amdgpu_bo_kptr(abo); 252 260 info->screen_size = amdgpu_bo_size(abo); 253 261 254 - drm_fb_helper_fill_var(info, &rfbdev->helper, sizes->fb_width, sizes->fb_height); 262 + drm_fb_helper_fill_info(info, &rfbdev->helper, sizes); 255 263 256 264 /* setup aperture base/size for vesafb takeover */ 257 265 info->apertures->ranges[0].base = adev->ddev->mode_config.fb_base;