From patchwork Tue Apr 18 12:56:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ilia Mirkin X-Patchwork-Id: 9685501 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B9DDB602C2 for ; Tue, 18 Apr 2017 12:56:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB54E28375 for ; Tue, 18 Apr 2017 12:56:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FB722838E; Tue, 18 Apr 2017 12:56:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7AD3B28375 for ; Tue, 18 Apr 2017 12:56:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 58D5088FF9; Tue, 18 Apr 2017 12:56:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 667E488FF9 for ; Tue, 18 Apr 2017 12:56:20 +0000 (UTC) Received: by mail-qt0-x243.google.com with SMTP id y33so8609143qta.1 for ; Tue, 18 Apr 2017 05:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=6rFTlrn38ITyaqfNMu0bvKpjcG2KnDeq8c4+IKXSV58=; b=LkLpLudajDSFrzVHvCIjKWR7iQ8ESPLm+mqMvIbIMZAWlgOPmRqv12pzsnp2vs1UQx E3UmHEpKFD9foz5VPVnnYRiSNq0xe+Upbn5M7FPfRkMIUWI4m/d2ICmoDsvPi7OUblig kev2kNkLk+GV0NJEqboHHG1yH40/qCGR2xZWU47U6F5XF4YdTJz15a7gmKEjyQXEBuWh tF3T4VWukU+iJRgzKitLJIxAKHXlODQJ7NW+It110M2c4smZx8YyiZvneHGvRvwgpSMz pNdbva/VQFQkm1epIgNqAmkTlmDn5nRVZvfK7kpUZyeI3JwqnKeOPSpY3gP9MHl0Nf2r AsGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=6rFTlrn38ITyaqfNMu0bvKpjcG2KnDeq8c4+IKXSV58=; b=GoJQ4CSQiBbvZ89PvkjESgAah/nJ6XweHLyt1J627Oa/tcdw4oQTOxE3tvn7OcIgs1 XiF81CoXgq1zg2dwALl9zyEYj7xCWtKt0/zSZKWZ/kqr5Z5YXzi4DmFIWLj+BN/4EhO9 cJRBCKzwkkHFLPQWkH0BgmEwOZIw1A5srrzs4ZFTP83J0sG9yka+9uesh4kU8XN5OBWO wIQCadsJA047DpHoaw7yGvxMJniIL+n9hrjBmhQyvtoH8AjDyU/h6hce5pdIFT7vN2Zp 6j0xQqffc3B1q2am8lhx7wTZo64cwNCxgsVyaUSGSs5yOedYfx4wGCDNzDZRUtgZqbFO /eDw== X-Gm-Message-State: AN3rC/64oPxLIS6dlbVgG0Tv0XaJHnSwIJFh1ZYV9D+OuEH0/iEcygIY qF1Cz2P6L1226Ms3 X-Received: by 10.237.53.124 with SMTP id b57mr13058540qte.240.1492520179549; Tue, 18 Apr 2017 05:56:19 -0700 (PDT) Received: from athos.hellosponsor.com ([2604:2000:e348:9900:260:b0ff:fe36:560c]) by smtp.gmail.com with ESMTPSA id v11sm9454572qtg.33.2017.04.18.05.56.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Apr 2017 05:56:19 -0700 (PDT) From: Ilia Mirkin To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm] modetest: fix printing of fourcc on BE machines Date: Tue, 18 Apr 2017 08:56:11 -0400 Message-Id: <20170418125611.26350-1-imirkin@alum.mit.edu> X-Mailer: git-send-email 2.10.2 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-Virus-Scanned: ClamAV using ClamSMTP fourcc is not a string, it's a packed integer. This happens to work out on LE, but gets reversed on BE. Signed-off-by: Ilia Mirkin Reviewed-by: Michel Dänzer --- tests/modetest/modetest.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index c390d87..b8891ff 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -174,6 +174,15 @@ static const char *mode_flag_names[] = { static bit_name_fn(mode_flag) +static void dump_fourcc(uint32_t fourcc) +{ + printf(" %c%c%c%c", + fourcc, + fourcc >> 8, + fourcc >> 16, + fourcc >> 24); +} + static void dump_encoders(struct device *dev) { drmModeEncoder *encoder; @@ -443,7 +452,7 @@ static void dump_planes(struct device *dev) printf(" formats:"); for (j = 0; j < ovr->count_formats; j++) - printf(" %4.4s", (char *)&ovr->formats[j]); + dump_fourcc(ovr->formats[j]); printf("\n"); if (plane->props) {