Re: [PATCH 10/25] vmwgfx: Refactor common display unit functions to shared file

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

 



On Mon, Oct 03, 2011 at 03:12:17AM +0200, Jakob Bornecrantz wrote:
> On Thu, Sep 29, 2011 at 11:50 PM, Konrad Rzeszutek Wilk
> <konrad.wilk@xxxxxxxxxx> wrote:
> > On Wed, Sep 28, 2011 at 04:10:06PM +0200, Thomas Hellstrom wrote:
> >> From: Jakob Bornecrantz <jakob@xxxxxxxxxx>
> >>
> >> More preparation for Screen Object support.
> >>
> >> Signed-off-by: Jakob Bornecrantz <jakob@xxxxxxxxxx>
> >> Signed-off-by: Thomas Hellstrom <thellstrom@xxxxxxxxxx>
> >> ---
> >>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c |  238 +++++++++++++++++++++++++++++++
> >>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.h |   31 ++++-
> >>  drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c |  268 ++---------------------------------
> >>  3 files changed, 282 insertions(+), 255 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> >> index 68c6351..0c4179b 100644
> >> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> >> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> >> @@ -1152,3 +1152,241 @@ u32 vmw_get_vblank_counter(struct drm_device *dev, int crtc)
> >>  {
> >>       return 0;
> >>  }
> >> +
> >> +
> >> +/*
> >> + * Small shared kms functions.
> >> + */
> >> +
> >> +int vmw_du_update_layout(struct vmw_private *dev_priv, unsigned num,
> >> +                      struct drm_vmw_rect *rects)
> >> +{
> >> +     struct drm_device *dev = dev_priv->dev;
> >> +     struct vmw_display_unit *du;
> >> +     struct drm_connector *con;
> >> +     int i;
> >> +
> >> +     mutex_lock(&dev->mode_config.mutex);
> >> +
> >> +#if 0
> >> +     DRM_INFO("%s: new layout ", __func__);
> >> +     for (i = 0; i < (int)num; i++)
> >
> > Would it be easier to make 'i' be 'unsigned int' ?
> >
> >> +             DRM_INFO("(%i, %i %ux%u) ", rects[i].x, rects[i].y,
> >> +                      rects[i].w, rects[i].h);
> >> +     DRM_INFO("\n");
> >> +#else
> >> +     (void)i;
> >
> > ?
> > What does that do?
> >
> > [edit: Ah, you are moving the code, so the patch looks fine then.
> > Thought I am still confused by this invocation - perhaps it makes sense
> > to clean this part of the code in another patch?]
> 
> The "i" variable is only used in the commented code, and the (void)i; statement
> hides the "unused variable error".

Why not just #ifdef the 'i' variable then? Or perhaps insert {}:

#if 0
{
	int i;
	DRM_INFO("%s: new layout ", __func__);
	for (i = 0; i < (int)num; i++)
	        DRM_INFO("(%i, %i %ux%u) ", rects[i].x, rects[i].y,
	                 rects[i].w, rects[i].h);
	DRM_INFO("\n");
}
#endif
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://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