aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2017-04-23 23:03:38 +0200
committerGerd Hoffmann <kraxel@redhat.com>2017-04-23 23:03:38 +0200
commit34cd7ded2cf9ffe5ce90f1c15b804bf3bf53dcd5 (patch)
tree19ce80a75094353701b6d653fd4dac411928ee93
parent3b6b800d67164e86201d5b3a7cba17e8dbbb01fb (diff)
downloaddrminfo-34cd7ded2cf9ffe5ce90f1c15b804bf3bf53dcd5.tar.gz
dump planes
-rw-r--r--drminfo.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drminfo.c b/drminfo.c
index 83a7678..218baf9 100644
--- a/drminfo.c
+++ b/drminfo.c
@@ -74,6 +74,23 @@ static void drm_info_conn(int fd, drmModeConnector *conn)
}
}
+static void drm_info_plane(int fd, drmModePlane *plane)
+{
+ int i;
+
+ fprintf(stdout, "plane: %d, crtc: %d, fb: %d\n",
+ plane->plane_id, plane->crtc_id, plane->fb_id);
+
+ fprintf(stdout, " formats:");
+ for (i = 0; i < plane->count_formats; i++)
+ fprintf(stdout, " %c%c%c%c",
+ (plane->formats[i] >> 0) & 0xff,
+ (plane->formats[i] >> 8) & 0xff,
+ (plane->formats[i] >> 16) & 0xff,
+ (plane->formats[i] >> 24) & 0xff);
+ fprintf(stdout, "\n");
+}
+
static void drm_info_fmts(int fd)
{
int i;
@@ -90,6 +107,8 @@ static void drm_info_fmts(int fd)
static void drm_info(int devnr)
{
drmModeConnector *conn;
+ drmModePlaneRes *pres;
+ drmModePlane *plane;
drmModeRes *res;
char dev[64], *busid;
int fd, i;
@@ -123,6 +142,23 @@ static void drm_info(int devnr)
fprintf(stdout, "\n");
}
+ drmSetClientCap(fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
+ pres = drmModeGetPlaneResources(fd);
+ if (pres == NULL) {
+ fprintf(stderr, "drmModeGetPlaneResources() failed\n");
+ exit(1);
+ }
+
+ for (i = 0; i < pres->count_planes; i++) {
+ plane = drmModeGetPlane(fd, pres->planes[i]);
+ if (!plane)
+ continue;
+
+ drm_info_plane(fd, plane);
+ drmModeFreePlane(plane);
+ fprintf(stdout, "\n");
+ }
+
drm_info_fmts(fd);
}