From patchwork Fri Jun 3 07:04:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 69225 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp121430qgf; Fri, 3 Jun 2016 00:10:54 -0700 (PDT) X-Received: by 10.55.117.71 with SMTP id q68mr1872418qkc.192.1464937854541; Fri, 03 Jun 2016 00:10:54 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 80si2682008qht.77.2016.06.03.00.10.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 03 Jun 2016 00:10:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:52421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8jFt-0000Rc-VI for patch@linaro.org; Fri, 03 Jun 2016 03:10:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8j9u-0003pR-J0 for qemu-devel@nongnu.org; Fri, 03 Jun 2016 03:04:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8j9n-0006Kt-D4 for qemu-devel@nongnu.org; Fri, 03 Jun 2016 03:04:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8j9n-0006K9-5E for qemu-devel@nongnu.org; Fri, 03 Jun 2016 03:04:35 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 601AF4DBA9 for ; Fri, 3 Jun 2016 07:04:34 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-36.ams2.redhat.com [10.36.116.36]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5374WE1013516; Fri, 3 Jun 2016 03:04:33 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 2C45A80978; Fri, 3 Jun 2016 09:04:30 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 3 Jun 2016 09:04:22 +0200 Message-Id: <1464937468-14816-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1464937468-14816-1-git-send-email-kraxel@redhat.com> References: <1464937468-14816-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 03 Jun 2016 07:04:34 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/7] ui: egl: Replace fprintf with error_report X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , Cole Robinson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Cole Robinson Signed-off-by: Cole Robinson Reviewed-by: Eric Blake Reviewed-by: Marc-André Lureau Message-id: c880920f6e40a506394d89dbbe1f67c63d359c17.1463588606.git.crobinso@redhat.com Signed-off-by: Gerd Hoffmann --- ui/egl-helpers.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) -- 1.8.3.1 diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 22835c0..79cee05 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -2,6 +2,7 @@ #include #include +#include "qemu/error-report.h" #include "ui/egl-helpers.h" EGLDisplay *qemu_egl_display; @@ -74,13 +75,13 @@ int egl_rendernode_init(void) qemu_egl_rn_fd = qemu_egl_rendernode_open(); if (qemu_egl_rn_fd == -1) { - fprintf(stderr, "egl: no drm render node available\n"); + error_report("egl: no drm render node available"); goto err; } qemu_egl_rn_gbm_dev = gbm_create_device(qemu_egl_rn_fd); if (!qemu_egl_rn_gbm_dev) { - fprintf(stderr, "egl: gbm_create_device failed\n"); + error_report("egl: gbm_create_device failed"); goto err; } @@ -88,18 +89,18 @@ int egl_rendernode_init(void) if (!epoxy_has_egl_extension(qemu_egl_display, "EGL_KHR_surfaceless_context")) { - fprintf(stderr, "egl: EGL_KHR_surfaceless_context not supported\n"); + error_report("egl: EGL_KHR_surfaceless_context not supported"); goto err; } if (!epoxy_has_egl_extension(qemu_egl_display, "EGL_MESA_image_dma_buf_export")) { - fprintf(stderr, "egl: EGL_MESA_image_dma_buf_export not supported\n"); + error_report("egl: EGL_MESA_image_dma_buf_export not supported"); goto err; } qemu_egl_rn_ctx = qemu_egl_init_ctx(); if (!qemu_egl_rn_ctx) { - fprintf(stderr, "egl: egl_init_ctx failed\n"); + error_report("egl: egl_init_ctx failed"); goto err; } @@ -156,13 +157,13 @@ EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, Window win) qemu_egl_config, (EGLNativeWindowType)win, NULL); if (esurface == EGL_NO_SURFACE) { - fprintf(stderr, "egl: eglCreateWindowSurface failed\n"); + error_report("egl: eglCreateWindowSurface failed"); return NULL; } b = eglMakeCurrent(qemu_egl_display, esurface, esurface, ectx); if (b == EGL_FALSE) { - fprintf(stderr, "egl: eglMakeCurrent failed\n"); + error_report("egl: eglMakeCurrent failed"); return NULL; } @@ -204,21 +205,21 @@ int qemu_egl_init_dpy(EGLNativeDisplayType dpy, bool gles, bool debug) egl_dbg("eglGetDisplay (dpy %p) ...\n", dpy); qemu_egl_display = eglGetDisplay(dpy); if (qemu_egl_display == EGL_NO_DISPLAY) { - fprintf(stderr, "egl: eglGetDisplay failed\n"); + error_report("egl: eglGetDisplay failed"); return -1; } egl_dbg("eglInitialize ...\n"); b = eglInitialize(qemu_egl_display, &major, &minor); if (b == EGL_FALSE) { - fprintf(stderr, "egl: eglInitialize failed\n"); + error_report("egl: eglInitialize failed"); return -1; } egl_dbg("eglBindAPI ...\n"); b = eglBindAPI(gles ? EGL_OPENGL_ES_API : EGL_OPENGL_API); if (b == EGL_FALSE) { - fprintf(stderr, "egl: eglBindAPI failed\n"); + error_report("egl: eglBindAPI failed"); return -1; } @@ -227,7 +228,7 @@ int qemu_egl_init_dpy(EGLNativeDisplayType dpy, bool gles, bool debug) gles ? conf_att_gles : conf_att_gl, &qemu_egl_config, 1, &n); if (b == EGL_FALSE || n != 1) { - fprintf(stderr, "egl: eglChooseConfig failed\n"); + error_report("egl: eglChooseConfig failed"); return -1; } @@ -252,13 +253,13 @@ EGLContext qemu_egl_init_ctx(void) ectx = eglCreateContext(qemu_egl_display, qemu_egl_config, EGL_NO_CONTEXT, egl_gles ? ctx_att_gles : ctx_att_gl); if (ectx == EGL_NO_CONTEXT) { - fprintf(stderr, "egl: eglCreateContext failed\n"); + error_report("egl: eglCreateContext failed"); return NULL; } b = eglMakeCurrent(qemu_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, ectx); if (b == EGL_FALSE) { - fprintf(stderr, "egl: eglMakeCurrent failed\n"); + error_report("egl: eglMakeCurrent failed"); return NULL; }