diff options
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_fb.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index d2d93959b119..723fd763da8e 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c @@ -465,33 +465,34 @@ static int vmw_fb_kms_detach(struct vmw_fb_par *par, static int vmw_fb_kms_framebuffer(struct fb_info *info) { - struct drm_mode_fb_cmd mode_cmd; + struct drm_mode_fb_cmd2 mode_cmd; struct vmw_fb_par *par = info->par; struct fb_var_screeninfo *var = &info->var; struct drm_framebuffer *cur_fb; struct vmw_framebuffer *vfb; - int ret = 0; + int ret = 0, depth; size_t new_bo_size; - ret = vmw_fb_compute_depth(var, &mode_cmd.depth); + ret = vmw_fb_compute_depth(var, &depth); if (ret) return ret; mode_cmd.width = var->xres; mode_cmd.height = var->yres; - mode_cmd.bpp = var->bits_per_pixel; - mode_cmd.pitch = ((mode_cmd.bpp + 7) / 8) * mode_cmd.width; + mode_cmd.pitches[0] = ((var->bits_per_pixel + 7) / 8) * mode_cmd.width; + mode_cmd.pixel_format = + drm_mode_legacy_fb_format(var->bits_per_pixel, + ((var->bits_per_pixel + 7) / 8) * mode_cmd.width); cur_fb = par->set_fb; if (cur_fb && cur_fb->width == mode_cmd.width && cur_fb->height == mode_cmd.height && - cur_fb->bits_per_pixel == mode_cmd.bpp && - cur_fb->depth == mode_cmd.depth && - cur_fb->pitches[0] == mode_cmd.pitch) + cur_fb->pixel_format == mode_cmd.pixel_format && + cur_fb->pitches[0] == mode_cmd.pitches[0]) return 0; /* Need new buffer object ? */ - new_bo_size = (size_t) mode_cmd.pitch * (size_t) mode_cmd.height; + new_bo_size = (size_t) mode_cmd.pitches[0] * (size_t) mode_cmd.height; ret = vmw_fb_kms_detach(par, par->bo_size < new_bo_size || par->bo_size > 2*new_bo_size, |