From patchwork Tue Jun 5 18:06:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 9122 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 44E5F23E1B for ; Tue, 5 Jun 2012 18:07:18 +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 0E5BFA1811F for ; Tue, 5 Jun 2012 18:07:17 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so4648785yhp.11 for ; Tue, 05 Jun 2012 11:07:17 -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=71UTE+kJtS6/976uEwZlCS6AX6G9NI0dh/C7frEU7Ng=; b=WMtP/l4uN5YT47kHllnY+WBezGJ26cnmB8D6lP2NWi8elFpmmMZjHBr0k9snqt0p0X qLObSOfNjxeOzOdJVB2NIshiSRLxQtaUmhlrNXbZVuBaGp92K99XBjKTam/nRbGUz1rw Z0H2s9Wn/N89249g4CGVEfDE8c4SGJWKcMfnu8js/S3WVUE+Jy1gDfKGVxGhoZpDwI6D 49MAEjFjKPBwVfikOfw9+Gj03MaSFIzHCsAwhJ9K4PeWH8ZCawbycmEwWgsoojSRN1rl TC+fo4IUd9yp4SALDnXrZp4exNkWk2tb2HYBCRpx38J2RT861VUHUSHZXpjXy363ELUp rmFw== Received: by 10.50.195.234 with SMTP id ih10mr3920690igc.0.1338919637412; Tue, 05 Jun 2012 11:07:17 -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 v20csp39715ibb; Tue, 5 Jun 2012 11:07:16 -0700 (PDT) Received: by 10.236.76.9 with SMTP id a9mr12475576yhe.96.1338919627035; Tue, 05 Jun 2012 11:07:07 -0700 (PDT) Received: from mail-gh0-f178.google.com (mail-gh0-f178.google.com [209.85.160.178]) by mx.google.com with ESMTPS id l12si900166anm.53.2012.06.05.11.07.06 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jun 2012 11:07:07 -0700 (PDT) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.160.178 as permitted sender) client-ip=209.85.160.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.160.178 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-gh0-f178.google.com with SMTP id f1so5116173ghb.37 for ; Tue, 05 Jun 2012 11:07:06 -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=71UTE+kJtS6/976uEwZlCS6AX6G9NI0dh/C7frEU7Ng=; b=BL50/ALjWYKu9D+J95AA8G9x8qqCqC6oE0T/q+6CG7blLONmt1utKmWhXVeWBxhKzr RrqOUpZj6JbtHilKAVqL2WGtTT2KNIdfUPbR6y7nwtZwPuRtRTdyeHQHxMtoh1nyqyHQ dJO0uzLu+xeWrtUsP7eXmL++Fi6yeCX9EVf49J86c00/T5bj35saZ+Oc0Vrlqb7mZhps wW0HE7UMkMjDLjGGKGvPnq83daETK1sulCRlUa8ERbs6XS/6KK8n+qyzsSGgXi5+TDR9 RH8wExCPGcpq8jyeynURBGbmTCTeTAceGims79P/bCUwfeSfnV958ABRcolj4eLZHxcY YABA== Received: by 10.60.14.169 with SMTP id q9mr17815492oec.19.1338919626535; Tue, 05 Jun 2012 11:07:06 -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 a6sm1386924oeg.7.2012.06.05.11.07.05 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jun 2012 11:07:06 -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 8/8] proptest: support plane properties Date: Tue, 5 Jun 2012 13:06:34 -0500 Message-Id: <1338919594-25392-9-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: ALoCoQlY6sRINPgcmyk/ppiroGHsHLB0r2YtniMpo+GNBAMCok33cahc945C2TBD88nFbZ3mKzlE From: Rob Clark Add support to display plane properties. Signed-off-by: Rob Clark --- tests/proptest/proptest.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/proptest/proptest.c b/tests/proptest/proptest.c index fa34a48..aac6b8f 100644 --- a/tests/proptest/proptest.c +++ b/tests/proptest/proptest.c @@ -39,6 +39,7 @@ int fd; drmModeResPtr res = NULL; +drmModePlaneResPtr plane_res = NULL; const char *connector_type_str(uint32_t type) { @@ -239,10 +240,33 @@ static void listCrtcProperties(void) } } +static void listPlaneProperties(void) +{ + int i; + drmModePlanePtr p; + + for (i = 0; i < plane_res->count_planes; i++) { + p = drmModeGetPlane(fd, plane_res->planes[i]); + + if (!p) { + fprintf(stderr, "Could not get plane %u: %s\n", + plane_res->planes[i], strerror(errno)); + continue; + } + + printf("Plane %u\n", p->plane_id); + + listObjectProperties(p->plane_id, DRM_MODE_OBJECT_PLANE); + + drmModeFreePlane(p); + } +} + static void listAllProperties(void) { listConnectorProperties(); listCrtcProperties(); + listPlaneProperties(); } static int setProperty(char *argv[]) @@ -309,6 +333,14 @@ int main(int argc, char *argv[]) goto done; } + plane_res = drmModeGetPlaneResources(fd); + if (!plane_res) { + fprintf(stderr, "Failed to get plane resources: %s\n", + strerror(errno)); + ret = 1; + goto done; + } + if (argc < 2) { listAllProperties(); } else if (argc == 5) {