From mboxrd@z Thu Jan 1 00:00:00 1970 From: Damien Lespiau Subject: Re: [PATCH 3/3] lib: make igt_pipe_crc_start never fail Date: Fri, 6 Dec 2013 12:52:34 +0000 Message-ID: <20131206125234.GA16277@strange.amr.corp.intel.com> References: <1386323324-19196-1-git-send-email-daniel.vetter@ffwll.ch> <1386323324-19196-3-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 4DE01FBC3F for ; Fri, 6 Dec 2013 04:52:36 -0800 (PST) Content-Disposition: inline In-Reply-To: <1386323324-19196-3-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Daniel Vetter Cc: Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Fri, Dec 06, 2013 at 10:48:44AM +0100, Daniel Vetter wrote: > It's what callers expect - pipe_crc_new is the function where > we pass a potential failure back to callers. > > Signed-off-by: Daniel Vetter Oh, yes, initially ono had to specify the point at _start() time, but I moved it to _new() mid-development and forgot to remove the return value. Reviewed-by: Damien Lespiau > --- > lib/igt_debugfs.c | 7 ++----- > lib/igt_debugfs.h | 2 +- > tests/kms_pipe_crc_basic.c | 2 +- > 3 files changed, 4 insertions(+), 7 deletions(-) > > diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c > index 139be893f75b..4b96521331af 100644 > --- a/lib/igt_debugfs.c > +++ b/lib/igt_debugfs.c > @@ -269,12 +269,11 @@ void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc) > free(pipe_crc); > } > > -bool igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc) > +void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc) > { > igt_crc_t *crcs = NULL; > > - if (!igt_pipe_crc_do_start(pipe_crc)) > - return false; > + igt_assert(igt_pipe_crc_do_start(pipe_crc)); > > /* > * For some no yet identified reason, the first CRC is bonkers. So > @@ -282,8 +281,6 @@ bool igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc) > */ > igt_pipe_crc_get_crcs(pipe_crc, 1, &crcs); > free(crcs); > - > - return true; > } > > void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc) > diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h > index 393b5767adbe..075e44625213 100644 > --- a/lib/igt_debugfs.h > +++ b/lib/igt_debugfs.h > @@ -75,7 +75,7 @@ igt_pipe_crc_t * > igt_pipe_crc_new(igt_debugfs_t *debugfs, int drm_fd, enum pipe pipe, > enum intel_pipe_crc_source source); > void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc); > -bool igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc); > +void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc); > void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc); > void igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs, > igt_crc_t **out_crcs); > diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c > index 90d9b9404877..3fc59344d90d 100644 > --- a/tests/kms_pipe_crc_basic.c > +++ b/tests/kms_pipe_crc_basic.c > @@ -180,7 +180,7 @@ static void test_read_crc(data_t *data, int pipe, unsigned flags) > continue; > valid_connectors++; > > - igt_assert(igt_pipe_crc_start(pipe_crc)); > + igt_pipe_crc_start(pipe_crc); > > /* wait for 3 vblanks and the corresponding 3 CRCs */ > igt_pipe_crc_get_crcs(pipe_crc, 3, &crcs); > -- > 1.8.4.3 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx