diff options
Diffstat (limited to 'drivers/gpu/drm/bochs/bochs_fbdev.c')
-rw-r--r-- | drivers/gpu/drm/bochs/bochs_fbdev.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_fbdev.c b/drivers/gpu/drm/bochs/bochs_fbdev.c index fe95d31cd110..61dbf09dff5d 100644 --- a/drivers/gpu/drm/bochs/bochs_fbdev.c +++ b/drivers/gpu/drm/bochs/bochs_fbdev.c | |||
@@ -9,6 +9,17 @@ | |||
9 | 9 | ||
10 | /* ---------------------------------------------------------------------- */ | 10 | /* ---------------------------------------------------------------------- */ |
11 | 11 | ||
12 | static int bochsfb_mmap(struct fb_info *info, | ||
13 | struct vm_area_struct *vma) | ||
14 | { | ||
15 | struct drm_fb_helper *fb_helper = info->par; | ||
16 | struct bochs_device *bochs = | ||
17 | container_of(fb_helper, struct bochs_device, fb.helper); | ||
18 | struct bochs_bo *bo = gem_to_bochs_bo(bochs->fb.gfb.obj); | ||
19 | |||
20 | return ttm_fbdev_mmap(vma, &bo->bo); | ||
21 | } | ||
22 | |||
12 | static struct fb_ops bochsfb_ops = { | 23 | static struct fb_ops bochsfb_ops = { |
13 | .owner = THIS_MODULE, | 24 | .owner = THIS_MODULE, |
14 | .fb_check_var = drm_fb_helper_check_var, | 25 | .fb_check_var = drm_fb_helper_check_var, |
@@ -19,6 +30,7 @@ static struct fb_ops bochsfb_ops = { | |||
19 | .fb_pan_display = drm_fb_helper_pan_display, | 30 | .fb_pan_display = drm_fb_helper_pan_display, |
20 | .fb_blank = drm_fb_helper_blank, | 31 | .fb_blank = drm_fb_helper_blank, |
21 | .fb_setcmap = drm_fb_helper_setcmap, | 32 | .fb_setcmap = drm_fb_helper_setcmap, |
33 | .fb_mmap = bochsfb_mmap, | ||
22 | }; | 34 | }; |
23 | 35 | ||
24 | static int bochsfb_create_object(struct bochs_device *bochs, | 36 | static int bochsfb_create_object(struct bochs_device *bochs, |
@@ -123,11 +135,9 @@ static int bochsfb_create(struct drm_fb_helper *helper, | |||
123 | info->screen_base = bo->kmap.virtual; | 135 | info->screen_base = bo->kmap.virtual; |
124 | info->screen_size = size; | 136 | info->screen_size = size; |
125 | 137 | ||
126 | #if 0 | 138 | drm_vma_offset_remove(&bo->bo.bdev->vma_manager, &bo->bo.vma_node); |
127 | /* FIXME: get this right for mmap(/dev/fb0) */ | 139 | info->fix.smem_start = 0; |
128 | info->fix.smem_start = bochs_bo_mmap_offset(bo); | ||
129 | info->fix.smem_len = size; | 140 | info->fix.smem_len = size; |
130 | #endif | ||
131 | 141 | ||
132 | ret = fb_alloc_cmap(&info->cmap, 256, 0); | 142 | ret = fb_alloc_cmap(&info->cmap, 256, 0); |
133 | if (ret) { | 143 | if (ret) { |