summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ast/ast_fb.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2019-05-08 10:26:19 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-05-15 16:17:07 +0200
commit5b3709793d151e6e12eb6a38a5da3f7fc2923d3a (patch)
tree0fce89aaa240ac79340c2dd7f062d307f677c0b1 /drivers/gpu/drm/ast/ast_fb.c
parent59f5989ad42b6edd089b47895986ef15259822dc (diff)
downloadlinux-5b3709793d151e6e12eb6a38a5da3f7fc2923d3a.tar.gz
linux-5b3709793d151e6e12eb6a38a5da3f7fc2923d3a.tar.bz2
linux-5b3709793d151e6e12eb6a38a5da3f7fc2923d3a.zip
drm/ast: Convert AST driver to |struct drm_gem_vram_object|
The data structure |struct drm_gem_vram_object| and its helpers replace |struct ast_bo|. It's the same implementation; except for the type names. v4: * cleanups from checkpatch.pl Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: http://patchwork.freedesktop.org/patch/msgid/20190508082630.15116-10-tzimmermann@suse.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/ast/ast_fb.c')
-rw-r--r--drivers/gpu/drm/ast/ast_fb.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c
index e718d0f60d6b..778423fcf352 100644
--- a/drivers/gpu/drm/ast/ast_fb.c
+++ b/drivers/gpu/drm/ast/ast_fb.c
@@ -49,7 +49,7 @@ static void ast_dirty_update(struct ast_fbdev *afbdev,
{
int i;
struct drm_gem_object *obj;
- struct ast_bo *bo;
+ struct drm_gem_vram_object *gbo;
int src_offset, dst_offset;
int bpp = afbdev->afb.base.format->cpp[0];
int ret = -EBUSY;
@@ -59,7 +59,7 @@ static void ast_dirty_update(struct ast_fbdev *afbdev,
unsigned long flags;
obj = afbdev->afb.obj;
- bo = gem_to_ast_bo(obj);
+ gbo = drm_gem_vram_of_gem(obj);
/*
* try and reserve the BO, if we fail with busy
@@ -67,7 +67,7 @@ static void ast_dirty_update(struct ast_fbdev *afbdev,
* store up the damage until later.
*/
if (drm_can_sleep())
- ret = ast_bo_reserve(bo, true);
+ ret = drm_gem_vram_reserve(gbo, true);
if (ret) {
if (ret != -EBUSY)
return;
@@ -101,25 +101,28 @@ static void ast_dirty_update(struct ast_fbdev *afbdev,
afbdev->x2 = afbdev->y2 = 0;
spin_unlock_irqrestore(&afbdev->dirty_lock, flags);
- if (!bo->kmap.virtual) {
- ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &bo->kmap);
+ if (!gbo->kmap.virtual) {
+ ret = ttm_bo_kmap(&gbo->bo, 0, gbo->bo.num_pages, &gbo->kmap);
if (ret) {
DRM_ERROR("failed to kmap fb updates\n");
- ast_bo_unreserve(bo);
+ drm_gem_vram_unreserve(gbo);
return;
}
unmap = true;
}
for (i = y; i <= y2; i++) {
/* assume equal stride for now */
- src_offset = dst_offset = i * afbdev->afb.base.pitches[0] + (x * bpp);
- memcpy_toio(bo->kmap.virtual + src_offset, afbdev->sysram + src_offset, (x2 - x + 1) * bpp);
+ src_offset = dst_offset =
+ i * afbdev->afb.base.pitches[0] + (x * bpp);
+ memcpy_toio(gbo->kmap.virtual + src_offset,
+ afbdev->sysram + dst_offset,
+ (x2 - x + 1) * bpp);
}
if (unmap)
- ttm_bo_kunmap(&bo->kmap);
+ ttm_bo_kunmap(&gbo->kmap);
- ast_bo_unreserve(bo);
+ drm_gem_vram_unreserve(gbo);
}
static void ast_fillrect(struct fb_info *info,