From patchwork Tue Jun 5 18:06:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 9121 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0703F23E1B for ; Tue, 5 Jun 2012 18:07:06 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id CA006A18357 for ; Tue, 5 Jun 2012 18:07:05 +0000 (UTC) Received: by mail-gh0-f180.google.com with SMTP id z12so4822633ghb.11 for ; Tue, 05 Jun 2012 11:07:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=vG7EEgZN4Wl+hES2Dc3STnycCNuLgYj15f+p7kv+trY=; b=d1qmoIwah7RQb/iZ7W+dTYZhY7+TO7RR7KLbFsHmhNHzXRWWbOorz2Eq5b0yut/e5V uaA6LBbA1g6cc92cqOJ9W2siHabLJ2RignmCtPaFBHGvgJDkonCR+NCbEjkhGNR5cpgB RjEqDiYsTQMN45PIyqpX1LaxGYr5ATGX6fOSvpw/tDyy1OBlNGhwQBxkowpdAJ438Pjy lSOII2xJPOnl2f0jT9pb5fB+E5f55KqMC9bobRLs4ikZLcGdOl//J289AUAIIezrMeND s47uTjxrlyxVMdsL9PNkI87vYnIE7VJkqdcu+c7bYzNeEA6gy/anj2pq71B1zZuxVNvk BRHQ== Received: by 10.50.40.193 with SMTP id z1mr3928924igk.0.1338919625281; Tue, 05 Jun 2012 11:07:05 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp39703ibb; Tue, 5 Jun 2012 11:07:04 -0700 (PDT) Received: by 10.236.78.39 with SMTP id f27mr12524386yhe.121.1338919624690; Tue, 05 Jun 2012 11:07:04 -0700 (PDT) Received: from mail-gg0-f178.google.com (mail-gg0-f178.google.com [209.85.161.178]) by mx.google.com with ESMTPS id v69si2053218yhl.34.2012.06.05.11.07.04 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jun 2012 11:07:04 -0700 (PDT) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.161.178 as permitted sender) client-ip=209.85.161.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.161.178 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-gg0-f178.google.com with SMTP id q6so4974645ggc.37 for ; Tue, 05 Jun 2012 11:07:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=vG7EEgZN4Wl+hES2Dc3STnycCNuLgYj15f+p7kv+trY=; b=IzRimn4q6ooFEVtC5oJ4g9tkkJZ0PH92qADRbRvv+90D+q/TEC8YelPQCJoNiDdVpQ NiZ/4teWXMmw3nxUYMGBBeaOoauH1EO0caAQoKS/nbgFIzV3LZEio8ldAsFb1OrbC0+L 1a4KivzNfzvD1d7DYPEp85y0wCsePjB1SH6wUhLe1EEOgNwR08CTJv3LghgIXGIb07QD szdP5bgn32gSHKCrIbJ8idFUK/k6Nv0FbEmNrcTDpVIZ/Up4S3lHNHfn6t6zNRSURV/j b0f6Ox7BhQt49zCYqHpfM8MFiajY4SIqzzZPUeQ6hY3VUPNGBHhA0RZGPsxIx2uJX+Zw up1Q== Received: by 10.60.172.50 with SMTP id az18mr17462124oec.21.1338919624254; Tue, 05 Jun 2012 11:07:04 -0700 (PDT) Received: from localhost (ppp-70-253-38-6.dsl.rcsntx.swbell.net. [70.253.38.6]) by mx.google.com with ESMTPS id u9sm1775720obl.20.2012.06.05.11.07.03 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jun 2012 11:07:03 -0700 (PDT) Sender: Rob Clark From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: patches@linaro.org, Paulo Zanoni , Rob Clark Subject: [PATCH libdrm 7/8] proptest: support bitmask properties Date: Tue, 5 Jun 2012 13:06:33 -0500 Message-Id: <1338919594-25392-8-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1338919594-25392-1-git-send-email-rob.clark@linaro.org> References: <1338919594-25392-1-git-send-email-rob.clark@linaro.org> X-Gm-Message-State: ALoCoQnOA9FqTl+29EzxoYwf+GZ8CmmE7nO8CalaLaqMdBF/N1GlvIuhiG4xK7wOuU+t9caKO/8B From: Rob Clark Add support to display bitmask properties. Signed-off-by: Rob Clark --- tests/proptest/proptest.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/proptest/proptest.c b/tests/proptest/proptest.c index 52896fe..fa34a48 100644 --- a/tests/proptest/proptest.c +++ b/tests/proptest/proptest.c @@ -127,6 +127,8 @@ dump_prop(uint32_t prop_id, uint64_t value) printf(" immutable"); if (prop->flags & DRM_MODE_PROP_ENUM) printf(" enum"); + if (prop->flags & DRM_MODE_PROP_BITMASK) + printf(" bitmask"); if (prop->flags & DRM_MODE_PROP_BLOB) printf(" blob"); printf("\n"); @@ -144,6 +146,12 @@ dump_prop(uint32_t prop_id, uint64_t value) printf(" %s=%llu", prop->enums[i].name, prop->enums[i].value); printf("\n"); + } else if (prop->flags & DRM_MODE_PROP_BITMASK) { + printf("\t\tvalues:"); + for (i = 0; i < prop->count_enums; i++) + printf(" %s=0x%llx", prop->enums[i].name, + (1LL << prop->enums[i].value)); + printf("\n"); } else { assert(prop->count_enums == 0); }