Re: [PATCH] drm/vmwgfx: Switch to mode_cmd2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 01, 2016 at 03:09:40PM -0800, Sinclair Yeh wrote:
> One defect below otherwise:  Reviewed-by: Sinclair Yeh <syeh@xxxxxxxxxx>
> 
> 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@xxxxxxxxxxxxxxx
> > Cc: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> > Cc: linux-graphics-maintainer@xxxxxxxxxx
> > Cc: Sinclair Yeh <syeh@xxxxxxxxxx>
> > Cc: Thomas Hellstrom <thellstrom@xxxxxxxxxx>
> > Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
> > ---
> >  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
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux