diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2019-07-03 09:58:27 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2019-07-09 10:25:12 +0200 |
commit | 8a99de3dc0dd417e1f46c8e27e63b1363ecfb969 (patch) | |
tree | 501dc273e7e642745241713ae68f9939e92fddab /drivers/gpu/drm/ast/ast_mode.c | |
parent | drm/fb-helper: Instanciate shadow FB if configured in device's mode_config (diff) | |
download | linux-8a99de3dc0dd417e1f46c8e27e63b1363ecfb969.tar.xz linux-8a99de3dc0dd417e1f46c8e27e63b1363ecfb969.zip |
drm/ast: Replace struct ast_fbdev with generic framebuffer emulation
This patch replaces ast's framebuffer console with DRM's generic
implememtation. All respective code is being removed from the driver.
The console is set up with a shadow buffer. The actual buffer object is
not permanently pinned in video ram, but just another buffer object that
the driver moves in and out of vram as necessary. The driver's function
ast_crtc_do_set_base() used to contain special handling for the framebuffer
console. With the new generic framebuffer, the driver does not need this
code an longer.
v2:
* use drm_fb_helper_set_suspend_unlocked() in ast_drm_{thaw,freeze}()
* dirty function no longer required
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/315835/
Diffstat (limited to '')
-rw-r--r-- | drivers/gpu/drm/ast/ast_mode.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index c48249df758e..3c0716891b29 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -525,18 +525,12 @@ static int ast_crtc_do_set_base(struct drm_crtc *crtc, struct drm_framebuffer *fb, int x, int y, int atomic) { - struct ast_private *ast = crtc->dev->dev_private; struct drm_gem_vram_object *gbo; int ret; s64 gpu_addr; - void *base; if (!atomic && fb) { gbo = drm_gem_vram_of_gem(fb->obj[0]); - - /* unmap if console */ - if (ast->fbdev->helper.fb == fb) - drm_gem_vram_kunmap(gbo); drm_gem_vram_unpin(gbo); } @@ -551,17 +545,6 @@ static int ast_crtc_do_set_base(struct drm_crtc *crtc, goto err_drm_gem_vram_unpin; } - if (ast->fbdev->helper.fb == crtc->primary->fb) { - /* if pushing console in kmap it */ - base = drm_gem_vram_kmap(gbo, true, NULL); - if (IS_ERR(base)) { - ret = PTR_ERR(base); - DRM_ERROR("failed to kmap fbcon\n"); - } else { - ast_fbdev_set_base(ast, gpu_addr); - } - } - ast_set_offset_reg(crtc); ast_set_start_address_crt1(crtc, (u32)gpu_addr); @@ -618,14 +601,10 @@ static void ast_crtc_disable(struct drm_crtc *crtc) DRM_DEBUG_KMS("\n"); ast_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); if (crtc->primary->fb) { - struct ast_private *ast = crtc->dev->dev_private; struct drm_framebuffer *fb = crtc->primary->fb; struct drm_gem_vram_object *gbo = drm_gem_vram_of_gem(fb->obj[0]); - /* unmap if console */ - if (ast->fbdev->helper.fb == fb) - drm_gem_vram_kunmap(gbo); drm_gem_vram_unpin(gbo); } crtc->primary->fb = NULL; |