Re: [PATCH libdrm 8/8] proptest: support plane properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Rob.

On 06/06/2012 03:06 AM, Rob Clark wrote:
From: Rob Clark<rob@xxxxxx>

Add support to display plane properties.

Do you not support to set property for plane?


Signed-off-by: Rob Clark<rob@xxxxxx>
---
  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) {

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux