From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH v2] igt/gem_workarounds: rework igt to test workaround registers Date: Tue, 2 Sep 2014 15:22:28 +0200 Message-ID: <20140902132228.GA15520@phenom.ffwll.local> References: <1409578187-2909-3-git-send-email-arun.siluvery@linux.intel.com> <1409649500-12327-1-git-send-email-arun.siluvery@linux.intel.com> <20140902095906.GJ1118@strange.amr.corp.intel.com> <20140902110434.GZ15520@phenom.ffwll.local> <20140902111228.GD25238@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B6BB89A0F for ; Tue, 2 Sep 2014 06:22:06 -0700 (PDT) Received: by mail-wg0-f43.google.com with SMTP id a1so6803449wgh.26 for ; Tue, 02 Sep 2014 06:22:05 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140902111228.GD25238@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , Daniel Vetter , Damien Lespiau , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Sep 02, 2014 at 12:12:28PM +0100, Chris Wilson wrote: > On Tue, Sep 02, 2014 at 01:04:34PM +0200, Daniel Vetter wrote: > > On Tue, Sep 02, 2014 at 10:59:06AM +0100, Damien Lespiau wrote: > > > On Tue, Sep 02, 2014 at 10:18:20AM +0100, Arun Siluvery wrote: > > > > - igt_assert(fd >= 0); > > > > + if (fd < 0) > > > > + igt_skip_on("No Workaround table available !!\n"); > > > > > > That's not quite a correct use of the API. The _on is there to signal > > > the first argument is an expression. This will work only because the > > > string is evaluated to true. You probably want to use igt_skip_on_f() > > > > > > http://people.freedesktop.org/~danvet/igt/intel-gpu-tools-i-g-t-core.html#igt-skip-on-f > > > > Or just igt_skip_on - we dump the expression that was tested, which should > > be fairly informational. At least when fd would have a better name ;-) > > Use igt_require(), it produces more natural phrasing in usage and > output. Yeah, for new code I second this - we have too many macros ;-) But my practice has been to use igt_skip_on when changing existing code since I seem to be too incompetent to reliably invert boolean conditions ... Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch