From patchwork Tue Dec 1 20:38:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 11945035 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF949C83012 for ; Wed, 2 Dec 2020 08:20:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9025322242 for ; Wed, 2 Dec 2020 08:20:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9025322242 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=v3.sk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 38B1C6EA3A; Wed, 2 Dec 2020 08:20:00 +0000 (UTC) Received: from shell.v3.sk (mail.v3.sk [167.172.186.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 479756E02B; Tue, 1 Dec 2020 20:38:41 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id CF024E0718; Tue, 1 Dec 2020 20:35:43 +0000 (UTC) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id UupzO_AEa56m; Tue, 1 Dec 2020 20:35:43 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 1E575DF932; Tue, 1 Dec 2020 20:35:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id F16q-sWhVsli; Tue, 1 Dec 2020 20:35:42 +0000 (UTC) Received: from localhost (unknown [109.183.109.54]) by zimbra.v3.sk (Postfix) with ESMTPSA id B6EE5E0711; Tue, 1 Dec 2020 20:35:42 +0000 (UTC) From: Lubomir Rintel To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 1/3] tests/etnaviv_2d_test: explain the errors Date: Tue, 1 Dec 2020 21:38:27 +0100 Message-Id: <20201201203829.1735559-2-lkundrak@v3.sk> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201201203829.1735559-1-lkundrak@v3.sk> References: <20201201203829.1735559-1-lkundrak@v3.sk> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 02 Dec 2020 08:19:47 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lubomir Rintel , etnaviv@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Just so that it's obvious what failed and why. Signed-off-by: Lubomir Rintel Reviewed-by: Christian Gmeiner --- tests/etnaviv/etnaviv_2d_test.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/etnaviv/etnaviv_2d_test.c b/tests/etnaviv/etnaviv_2d_test.c index 8dd77b66..eb9dfa59 100644 --- a/tests/etnaviv/etnaviv_2d_test.c +++ b/tests/etnaviv/etnaviv_2d_test.c @@ -162,9 +162,16 @@ int main(int argc, char *argv[]) drmVersionPtr version; int fd, ret = 0; - fd = open(argv[1], O_RDWR); - if (fd < 0) + if (argc < 2) { + fprintf(stderr, "Usage: %s /dev/dri/\n", argv[0]); return 1; + } + + fd = open(argv[1], O_RDWR); + if (fd < 0) { + perror(argv[1]); + return 1; + } version = drmGetVersion(fd); if (version) { @@ -178,6 +185,7 @@ int main(int argc, char *argv[]) dev = etna_device_new(fd); if (!dev) { + perror("etna_device_new"); ret = 2; goto out; } @@ -185,18 +193,21 @@ int main(int argc, char *argv[]) /* TODO: we assume that core 0 is a 2D capable one */ gpu = etna_gpu_new(dev, 0); if (!gpu) { + perror("etna_gpu_new"); ret = 3; goto out_device; } pipe = etna_pipe_new(gpu, ETNA_PIPE_2D); if (!pipe) { + perror("etna_pipe_new"); ret = 4; goto out_gpu; } bmp = etna_bo_new(dev, bmp_size, ETNA_BO_UNCACHED); if (!bmp) { + perror("etna_bo_new"); ret = 5; goto out_pipe; } @@ -204,6 +215,7 @@ int main(int argc, char *argv[]) stream = etna_cmd_stream_new(pipe, 0x300, NULL, NULL); if (!stream) { + perror("etna_cmd_stream_new"); ret = 6; goto out_bo; }