From patchwork Wed May 18 16:40:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 9121321 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EC8249F37F for ; Wed, 18 May 2016 16:45:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 44BD52034E for ; Wed, 18 May 2016 16:45:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 747932034B for ; Wed, 18 May 2016 16:45:32 +0000 (UTC) Received: from localhost ([::1]:46069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b34bD-0008LA-CH for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 May 2016 12:45:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b34Wr-0004V4-IE for qemu-devel@nongnu.org; Wed, 18 May 2016 12:41:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b34Wk-0001lE-Et for qemu-devel@nongnu.org; Wed, 18 May 2016 12:41:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b34Wk-0001l3-6g for qemu-devel@nongnu.org; Wed, 18 May 2016 12:40:54 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 BE6BB486A1 for ; Wed, 18 May 2016 16:40:53 +0000 (UTC) Received: from colepc.redhat.com (ovpn-116-31.phx2.redhat.com [10.3.116.31]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4IGeqja018070; Wed, 18 May 2016 12:40:53 -0400 From: Cole Robinson To: qemu-devel@nongnu.org Date: Wed, 18 May 2016 12:40:49 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 18 May 2016 16:40:53 +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] [PATCH 1/3] 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Cole Robinson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Cole Robinson Reviewed-by: Eric Blake Reviewed-by: Marc-André Lureau --- ui/egl-helpers.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 558edfd..6555f5f 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; @@ -77,13 +78,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; } @@ -91,18 +92,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; } @@ -159,13 +160,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; } @@ -207,21 +208,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; } @@ -230,7 +231,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; } @@ -255,13 +256,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; }