From patchwork Tue Sep 8 15:22:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Jakobi X-Patchwork-Id: 7141981 Return-Path: X-Original-To: patchwork-dri-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 32B129F1BF for ; Tue, 8 Sep 2015 15:24:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D4E2206E3 for ; Tue, 8 Sep 2015 15:24:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 49BE4206EE for ; Tue, 8 Sep 2015 15:24:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5EF147214E; Tue, 8 Sep 2015 08:24:46 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.math.uni-bielefeld.de (smtp.math.uni-bielefeld.de [129.70.45.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id BCC497214E for ; Tue, 8 Sep 2015 08:24:44 -0700 (PDT) Received: from chidori.math.uni-bielefeld.de (dhcp24-141.math.uni-bielefeld.de [129.70.24.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by smtp.math.uni-bielefeld.de (Postfix) with ESMTPSA id 066C660D3D; Tue, 8 Sep 2015 17:24:42 +0200 (CEST) From: Tobias Jakobi To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 8/9] exynos/fimg2d: add message prefix Date: Tue, 8 Sep 2015 17:22:33 +0200 Message-Id: <1441725754-27555-9-git-send-email-tjakobi@math.uni-bielefeld.de> X-Mailer: git-send-email 2.0.5 In-Reply-To: <1441725754-27555-1-git-send-email-tjakobi@math.uni-bielefeld.de> References: <1441725754-27555-1-git-send-email-tjakobi@math.uni-bielefeld.de> Cc: Tobias Jakobi , emil.l.velikov@gmail.com, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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 Add a prefix to the messages printed to the console via printf() and fprintf() so that one can easily see where the message comes from. Signed-off-by: Tobias Jakobi --- exynos/exynos_fimg2d.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c index 5873fe7..9746c21 100644 --- a/exynos/exynos_fimg2d.c +++ b/exynos/exynos_fimg2d.c @@ -42,6 +42,8 @@ #define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MSG_PREFIX "exynos/fimg2d: " + enum g2d_base_addr_reg { g2d_dst = 0, g2d_src @@ -255,7 +257,7 @@ static int g2d_flush(struct g2d_context *ctx) return 0; if (ctx->cmdlist_nr >= G2D_MAX_CMD_LIST_NR) { - fprintf(stderr, "Overflow cmdlist.\n"); + fprintf(stderr, MSG_PREFIX "command list overflow.\n"); return -EINVAL; } @@ -271,7 +273,7 @@ static int g2d_flush(struct g2d_context *ctx) ret = drmIoctl(ctx->fd, DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST, &cmdlist); if (ret < 0) { - fprintf(stderr, "failed to set cmdlist.\n"); + fprintf(stderr, MSG_PREFIX "failed to set cmdlist.\n"); return ret; } @@ -293,7 +295,7 @@ struct g2d_context *g2d_init(int fd) ctx = calloc(1, sizeof(*ctx)); if (!ctx) { - fprintf(stderr, "failed to allocate context.\n"); + fprintf(stderr, MSG_PREFIX "failed to allocate context.\n"); return NULL; } @@ -301,7 +303,7 @@ struct g2d_context *g2d_init(int fd) ret = drmIoctl(fd, DRM_IOCTL_EXYNOS_G2D_GET_VER, &ver); if (ret < 0) { - fprintf(stderr, "failed to get version.\n"); + fprintf(stderr, MSG_PREFIX "failed to get version.\n"); free(ctx); return NULL; } @@ -309,7 +311,7 @@ struct g2d_context *g2d_init(int fd) ctx->major = ver.major; ctx->minor = ver.minor; - printf("g2d version(%d.%d).\n", ctx->major, ctx->minor); + printf(MSG_PREFIX "G2D version (%d.%d).\n", ctx->major, ctx->minor); return ctx; } @@ -335,7 +337,7 @@ int g2d_exec(struct g2d_context *ctx) ret = drmIoctl(ctx->fd, DRM_IOCTL_EXYNOS_G2D_EXEC, &exec); if (ret < 0) { - fprintf(stderr, "failed to execute.\n"); + fprintf(stderr, MSG_PREFIX "failed to execute.\n"); return ret; } @@ -436,7 +438,7 @@ g2d_copy(struct g2d_context *ctx, struct g2d_image *src, h = MIN(src_h, dst_h); if (w <= 0 || h <= 0) { - fprintf(stderr, "invalid width or height.\n"); + fprintf(stderr, MSG_PREFIX "invalid width or height.\n"); return -EINVAL; } @@ -532,7 +534,7 @@ g2d_copy_with_scale(struct g2d_context *ctx, struct g2d_image *src, dst_h = dst->height - dst_y; if (src_w <= 0 || src_h <= 0 || dst_w <= 0 || dst_h <= 0) { - fprintf(stderr, "invalid width or height.\n"); + fprintf(stderr, MSG_PREFIX "invalid width or height.\n"); return -EINVAL; } @@ -633,17 +635,17 @@ g2d_blend(struct g2d_context *ctx, struct g2d_image *src, h = MIN(src_h, dst_h); if (w <= 0 || h <= 0) { - fprintf(stderr, "invalid width or height.\n"); + fprintf(stderr, MSG_PREFIX "invalid width or height.\n"); return -EINVAL; } if (!g2d_validate_select_mode(src->select_mode)) { - fprintf(stderr , "invalid select mode for source.\n"); + fprintf(stderr , MSG_PREFIX "invalid select mode for source.\n"); return -EINVAL; } if (!g2d_validate_blending_op(op)) { - fprintf(stderr , "unsupported blending operation.\n"); + fprintf(stderr , MSG_PREFIX "unsupported blending operation.\n"); return -EINVAL; } @@ -752,17 +754,17 @@ g2d_scale_and_blend(struct g2d_context *ctx, struct g2d_image *src, dst_h = dst->height - dst_y; if (src_w <= 0 || src_h <= 0 || dst_w <= 0 || dst_h <= 0) { - fprintf(stderr, "invalid width or height.\n"); + fprintf(stderr, MSG_PREFIX "invalid width or height.\n"); return -EINVAL; } if (!g2d_validate_select_mode(src->select_mode)) { - fprintf(stderr , "invalid select mode for source.\n"); + fprintf(stderr , MSG_PREFIX "invalid select mode for source.\n"); return -EINVAL; } if (!g2d_validate_blending_op(op)) { - fprintf(stderr , "unsupported blending operation.\n"); + fprintf(stderr , MSG_PREFIX "unsupported blending operation.\n"); return -EINVAL; }