From patchwork Wed May 16 09:07:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 8674 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 1ED2723E61 for ; Wed, 16 May 2012 09:07:36 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id E285AA18395 for ; Wed, 16 May 2012 09:07:35 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so501394yhp.11 for ; Wed, 16 May 2012 02:07:35 -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=qdyLve02Bc7eFW5l4iyCLRG8LEU15Jsm5IXIvZNgDFM=; b=AMUESY7qFaByKhPeT25fv2jAtvzxDAnLIvIsn8iIWbgY5neswSpiBeyZcAgU9iBXqJ +ZaI781mWv1wRmskzuLE4IRrx/zqAKMZZybhMMZE9lI4SrZeQHzS5x5k79Z8wDR42FXM gQMsfm0fqt+9RwtrHyb89QwFxnhSPjiHHVWv0hWrqkeQHXfxbzLer0Qy0N07h+jHfPoE ugShvjbFPl99p32n35XUpTPDRJ/DRR/PhXlwXobLpBS8JNf51/ziUdUTDGarVAuFxoYs 1GWLGS+H3oZysajaRU7uM7mG6QlJf1P5zdL8TO0rmmloIaew8TKP9JukUbnTsxnWZ3Zk IrzQ== Received: by 10.50.185.233 with SMTP id ff9mr9248016igc.57.1337159255429; Wed, 16 May 2012 02:07:35 -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.35.72 with SMTP id o8csp479068ibd; Wed, 16 May 2012 02:07:35 -0700 (PDT) Received: by 10.182.131.7 with SMTP id oi7mr1969802obb.74.1337159254904; Wed, 16 May 2012 02:07:34 -0700 (PDT) Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) by mx.google.com with ESMTPS id k10si712655oeb.57.2012.05.16.02.07.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 May 2012 02:07:34 -0700 (PDT) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.214.178 as permitted sender) client-ip=209.85.214.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.214.178 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-ob0-f178.google.com with SMTP id eq6so1116990obc.37 for ; Wed, 16 May 2012 02:07:34 -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=qdyLve02Bc7eFW5l4iyCLRG8LEU15Jsm5IXIvZNgDFM=; b=YO+Osfl+HE0wA2UT6D1QZEV3RsoNGW4qf6QJaMEdpUUKWVm/xmTYUpnBqy6MSRJORp ycpLu2X8hHULOkTbq5Z2Yt3j/eleQd+Uuc4TGM3diAuJkp+h3d654mjNR4cbm4NP7E+o SEmu16fALktcI8opYavIvnxAhCuPR6HzbWUj3HXLKJxbpKN5uDi7mQMXuEJiL1UjAv4c Sr5jOwy5ApSaTRqEssc1iV0a9v2s3oGTwTxYcLtz6U6OUJVcaZF7nwZoPLUMYfqt6xX8 wAvV3/Qog+DDDGB+TkZLNy4mqIewcOHMaqVuyfo31grKKeie7xRANlbzurE9Oq+R1tb5 YiXw== Received: by 10.182.245.17 with SMTP id xk17mr1959296obc.66.1337159254781; Wed, 16 May 2012 02:07:34 -0700 (PDT) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id qb7sm1798098obc.13.2012.05.16.02.07.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 May 2012 02:07:34 -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 2/3] modetest: support bitmask properties Date: Wed, 16 May 2012 03:07:14 -0600 Message-Id: <1337159235-32741-3-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1337159235-32741-1-git-send-email-rob.clark@linaro.org> References: <1337159235-32741-1-git-send-email-rob.clark@linaro.org> X-Gm-Message-State: ALoCoQkA7Vqmj4fWe5VI5b3DHX4ZFyd/b6yR6AEgajzg7hlVWVExo8kibf4SPhtsjRp7EGOvxEMX From: Rob Clark Add support to display bitmask properties. Signed-off-by: Rob Clark --- tests/modetest/modetest.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index ce57e65..dea271a 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -207,6 +207,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"); @@ -224,6 +226,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); }