diff options
Diffstat (limited to 'drminfo.c')
-rw-r--r-- | drminfo.c | 64 |
1 files changed, 22 insertions, 42 deletions
@@ -14,6 +14,8 @@ #include <xf86drm.h> #include <xf86drmMode.h> +#include <cairo.h> + #include "drmtools.h" /* ------------------------------------------------------------------ */ @@ -102,49 +104,23 @@ static void drm_info(int devnr) fprintf(stdout, "\n"); } - fprintf(stdout, "legacy formats\n"); - drm_probe_format(fd, 32, 24, 0, true); - drm_probe_format(fd, 32, 30, 0, true); - drm_probe_format(fd, 24, 24, 0, true); - drm_probe_format(fd, 16, 16, 0, true); - drm_probe_format(fd, 16, 15, 0, true); + fprintf(stdout, "framebuffer formats\n"); + for (i = 0; i < fmtcnt; i++) { + if (!drm_probe_format(fd, &fmts[i])) + continue; + drm_print_format(stdout, &fmts[i]); + } fprintf(stdout, "\n"); +} - fprintf(stdout, "fourcc formats\n"); - drm_probe_format(fd, 32, 0, DRM_FORMAT_XRGB8888, true); - drm_probe_format(fd, 32, 0, DRM_FORMAT_XBGR8888, true); - drm_probe_format(fd, 32, 0, DRM_FORMAT_RGBX8888, true); - drm_probe_format(fd, 32, 0, DRM_FORMAT_BGRX8888, true); - drm_probe_format(fd, 32, 0, DRM_FORMAT_ARGB8888, true); - drm_probe_format(fd, 32, 0, DRM_FORMAT_ABGR8888, true); - drm_probe_format(fd, 32, 0, DRM_FORMAT_RGBA8888, true); - drm_probe_format(fd, 32, 0, DRM_FORMAT_BGRA8888, true); - drm_probe_format(fd, 32, 0, DRM_FORMAT_XRGB2101010, true); - drm_probe_format(fd, 32, 0, DRM_FORMAT_XBGR2101010, true); - drm_probe_format(fd, 32, 0, DRM_FORMAT_RGBX1010102, true); - drm_probe_format(fd, 32, 0, DRM_FORMAT_BGRX1010102, true); - - drm_probe_format(fd, 24, 0, DRM_FORMAT_RGB888, true); - drm_probe_format(fd, 24, 0, DRM_FORMAT_BGR888, true); - - drm_probe_format(fd, 16, 0, DRM_FORMAT_XRGB4444, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_XBGR4444, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_RGBX4444, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_BGRX4444, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_ARGB4444, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_ABGR4444, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_RGBA4444, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_BGRA4444, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_XRGB1555, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_XBGR1555, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_RGBX5551, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_BGRX5551, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_ARGB1555, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_ABGR1555, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_RGBA5551, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_BGRA5551, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_RGB565, true); - drm_probe_format(fd, 16, 0, DRM_FORMAT_BGR565, true); +static void list_formats(FILE *fp) +{ + int i; + + fprintf(stdout, "all known framebuffer formats (rgb + packed yuv)\n"); + for (i = 0; i < fmtcnt; i++) { + drm_print_format(stdout, &fmts[i]); + } fprintf(stdout, "\n"); } @@ -159,6 +135,7 @@ static void usage(FILE *fp) "options:\n" " -h print this\n" " -c <nr> pick card\n" + " -l print all known formats\n" "\n"); } @@ -168,13 +145,16 @@ int main(int argc, char **argv) int c; for (;;) { - c = getopt(argc, argv, "hc:"); + c = getopt(argc, argv, "hlc:"); if (c == -1) break; switch (c) { case 'c': card = atoi(optarg); break; + case 'l': + list_formats(stdout); + exit(0); case 'h': usage(stdout); exit(0); |