diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-12-02 10:07:40 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-12-02 19:15:20 +0300 |
commit | dabdcdc9822ae4e23cd7ff07090098d34f287b28 (patch) | |
tree | c55c3b9ac07726f1342f4ec0d6fb0acf24b15893 /drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | |
parent | ad1231080be5a5cb34bbecf08fa3fea50209ef94 (diff) | |
download | linux-dabdcdc9822ae4e23cd7ff07090098d34f287b28.tar.xz |
drm/vmwgfx: Switch to mode_cmd2
Surprisingly few changes needed to make it happen. Compile-tested
only. The idea is that this replaces the 2 patches from Ville's big
fb->format patch series as a prep patch. Only impact to later patches
should be the one instace added in this patch where we look at
fb->pixel_format (instead of fb->bpp and fb->depth), so minor
adjustements in the cocci-generated patches needed.
v2: Restore pitch computation in vmw_fb_kms_framebuffer (Sinclair).
Cc: ville.syrjala@linux.intel.com
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-graphics-maintainer@vmware.com
Cc: Sinclair Yeh <syeh@vmware.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161202070740.31689-1-daniel.vetter@ffwll.ch
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, |