Commit fd84aab9 authored by Egbert Eich's avatar Egbert Eich Committed by Jiri Slaby

drm/ast: Initialized data needed to map fbdev memory

commit 28fb4cb7 upstream.

Due to a missing initialization there was no way to map fbdev memory.
Thus for example using the Xserver with the fbdev driver failed.
This fix adds initialization for fix.smem_start and fix.smem_len
in the fb_info structure, which fixes this problem.
Requested-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarEgbert Eich <eich@suse.de>
[pulled from SuSE tree by me - airlied]
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent b22889fe
...@@ -296,6 +296,7 @@ int ast_framebuffer_init(struct drm_device *dev, ...@@ -296,6 +296,7 @@ int ast_framebuffer_init(struct drm_device *dev,
int ast_fbdev_init(struct drm_device *dev); int ast_fbdev_init(struct drm_device *dev);
void ast_fbdev_fini(struct drm_device *dev); void ast_fbdev_fini(struct drm_device *dev);
void ast_fbdev_set_suspend(struct drm_device *dev, int state); void ast_fbdev_set_suspend(struct drm_device *dev, int state);
void ast_fbdev_set_base(struct ast_private *ast, unsigned long gpu_addr);
struct ast_bo { struct ast_bo {
struct ttm_buffer_object bo; struct ttm_buffer_object bo;
......
...@@ -367,3 +367,10 @@ void ast_fbdev_set_suspend(struct drm_device *dev, int state) ...@@ -367,3 +367,10 @@ void ast_fbdev_set_suspend(struct drm_device *dev, int state)
fb_set_suspend(ast->fbdev->helper.fbdev, state); fb_set_suspend(ast->fbdev->helper.fbdev, state);
} }
void ast_fbdev_set_base(struct ast_private *ast, unsigned long gpu_addr)
{
ast->fbdev->helper.fbdev->fix.smem_start =
ast->fbdev->helper.fbdev->apertures->ranges[0].base + gpu_addr;
ast->fbdev->helper.fbdev->fix.smem_len = ast->vram_size - gpu_addr;
}
...@@ -359,6 +359,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -359,6 +359,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
dev->mode_config.min_height = 0; dev->mode_config.min_height = 0;
dev->mode_config.preferred_depth = 24; dev->mode_config.preferred_depth = 24;
dev->mode_config.prefer_shadow = 1; dev->mode_config.prefer_shadow = 1;
dev->mode_config.fb_base = pci_resource_start(ast->dev->pdev, 0);
if (ast->chip == AST2100 || if (ast->chip == AST2100 ||
ast->chip == AST2200 || ast->chip == AST2200 ||
......
...@@ -509,6 +509,8 @@ static int ast_crtc_do_set_base(struct drm_crtc *crtc, ...@@ -509,6 +509,8 @@ static int ast_crtc_do_set_base(struct drm_crtc *crtc,
ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &bo->kmap); ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &bo->kmap);
if (ret) if (ret)
DRM_ERROR("failed to kmap fbcon\n"); DRM_ERROR("failed to kmap fbcon\n");
else
ast_fbdev_set_base(ast, gpu_addr);
} }
ast_bo_unreserve(bo); ast_bo_unreserve(bo);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment