From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 10/25] vmwgfx: Refactor common display unit functions to shared file Date: Mon, 3 Oct 2011 13:40:27 -0400 Message-ID: <20111003174027.GA13271@phenom.oracle.com> References: <1317219021-4155-1-git-send-email-thellstrom@vmware.com> <1317219021-4155-11-git-send-email-thellstrom@vmware.com> <20110929215053.GC9091@phenom.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by gabe.freedesktop.org (Postfix) with ESMTP id F3FD59E9F7 for ; Mon, 3 Oct 2011 10:40:45 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Jakob Bornecrantz Cc: Thomas Hellstrom , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org 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 > wrote: > > On Wed, Sep 28, 2011 at 04:10:06PM +0200, Thomas Hellstrom wrote: > >> From: Jakob Bornecrantz > >> > >> More preparation for Screen Object support. > >> > >> Signed-off-by: Jakob Bornecrantz > >> Signed-off-by: Thomas Hellstrom > >> --- > >> =A0drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | =A0238 ++++++++++++++++++++++= +++++++++ > >> =A0drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | =A0 31 ++++- > >> =A0drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | =A0268 ++--------------------= ------------- > >> =A03 files changed, 282 insertions(+), 255 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmw= gfx/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) > >> =A0{ > >> =A0 =A0 =A0 return 0; > >> =A0} > >> + > >> + > >> +/* > >> + * Small shared kms functions. > >> + */ > >> + > >> +int vmw_du_update_layout(struct vmw_private *dev_priv, unsigned num, > >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct drm_vmw_rect *rect= s) > >> +{ > >> + =A0 =A0 struct drm_device *dev =3D dev_priv->dev; > >> + =A0 =A0 struct vmw_display_unit *du; > >> + =A0 =A0 struct drm_connector *con; > >> + =A0 =A0 int i; > >> + > >> + =A0 =A0 mutex_lock(&dev->mode_config.mutex); > >> + > >> +#if 0 > >> + =A0 =A0 DRM_INFO("%s: new layout ", __func__); > >> + =A0 =A0 for (i =3D 0; i < (int)num; i++) > > > > Would it be easier to make 'i' be 'unsigned int' ? > > > >> + =A0 =A0 =A0 =A0 =A0 =A0 DRM_INFO("(%i, %i %ux%u) ", rects[i].x, rect= s[i].y, > >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rects[i].w, rects[i].h); > >> + =A0 =A0 DRM_INFO("\n"); > >> +#else > >> + =A0 =A0 (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; sta= tement > 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 =3D 0; i < (int)num; i++) =A0 =A0 =A0 =A0 DRM_INFO("(%i, %i %ux%u) ", rects[i].x, rects[i].y, =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rects[i].w, rects[i].h); DRM_INFO("\n"); } #endif