[PATCH] drm/vmwgfx: Switch to mode_cmd2
Daniel Vetter
daniel at ffwll.ch
Fri Dec 2 07:00:22 UTC 2016
On Thu, Dec 01, 2016 at 03:09:40PM -0800, Sinclair Yeh wrote:
> One defect below otherwise: Reviewed-by: Sinclair Yeh <syeh at vmware.com>
>
> On Wed, Nov 30, 2016 at 06:00:04PM +0100, Daniel Vetter wrote:
> > 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.
> >
> > Cc: ville.syrjala at linux.intel.com
> > Cc: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> > Cc: linux-graphics-maintainer at vmware.com
> > Cc: Sinclair Yeh <syeh at vmware.com>
> > Cc: Thomas Hellstrom <thellstrom at vmware.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> > ---
> > drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 18 +++---
> > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 116 +++++++++++++-----------------------
> > drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 2 +-
> > 3 files changed, 52 insertions(+), 84 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> > index d2d93959b119..4b1defc7aa6d 100644
> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
> > @@ -465,33 +465,33 @@ 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] needs to be initialized before being used below.
>
> Maybe something like:
> mode_cmd.pitches[0] = ((var->bits_per_pixel + 7) / 8) * mode_cmd.width;
Oh right, I deleted a bit too much here. Once fixed, ok if I merge this
through drm-misc so that Ville can throw his fb->format conversion on top?
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the dri-devel
mailing list