From: 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> References: <1338919594-25392-1-git-send-email-rob.clark@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-yw0-f49.google.com (mail-yw0-f49.google.com [209.85.213.49]) by gabe.freedesktop.org (Postfix) with ESMTP id D581CA0913 for ; Tue, 5 Jun 2012 11:07:06 -0700 (PDT) Received: by mail-yw0-f49.google.com with SMTP id j52so4576708yhj.36 for ; Tue, 05 Jun 2012 11:07:06 -0700 (PDT) In-Reply-To: <1338919594-25392-1-git-send-email-rob.clark@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org Cc: Rob Clark , Paulo Zanoni , patches@linaro.org List-Id: dri-devel@lists.freedesktop.org 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) { -- 1.7.9.5