From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 09/16] drm/i915: Store current watermark state in dev_priv->wm Date: Tue, 15 Oct 2013 10:24:33 +0200 Message-ID: <20131015082433.GA4830@phenom.ffwll.local> References: <1381335490-4906-1-git-send-email-ville.syrjala@linux.intel.com> <1381335490-4906-10-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com [209.85.215.171]) by gabe.freedesktop.org (Postfix) with ESMTP id C692FE6A1B for ; Tue, 15 Oct 2013 01:24:21 -0700 (PDT) Received: by mail-ea0-f171.google.com with SMTP id n15so3899865ead.16 for ; Tue, 15 Oct 2013 01:24:19 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Paulo Zanoni Cc: Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Fri, Oct 11, 2013 at 11:21:04AM -0300, Paulo Zanoni wrote: > 2013/10/9 : [snip] > > + previous.enable_fbc_wm = !(I915_READ(DISP_ARB_CTL) & DISP_FBC_WM_DIS); > > + > > + if (memcmp(results, &previous, sizeof(*results)) == 0) > > This may cause problems since we're also comparing the structure > paddings. It seems "results" is already zero-initialized, so if you > also zero-initialize "previous" we'll probably be fine with the > memcmp(). But my fear is that future code changes will break this, so > if you stick with the new memcmp please add a comment remembering us > that we rely on zero-initializing stuff. Or maybe keep the > old-big-ugly code. I've added a comment about this and then smashed your presumed r-b onto the patch. Please scream if the patch as merged isn't good enough. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch