diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2017-04-23 23:03:38 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2017-04-23 23:03:38 +0200 |
commit | 34cd7ded2cf9ffe5ce90f1c15b804bf3bf53dcd5 (patch) | |
tree | 19ce80a75094353701b6d653fd4dac411928ee93 | |
parent | 3b6b800d67164e86201d5b3a7cba17e8dbbb01fb (diff) | |
download | drminfo-34cd7ded2cf9ffe5ce90f1c15b804bf3bf53dcd5.tar.gz |
dump planes
-rw-r--r-- | drminfo.c | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -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); } |