aboutsummaryrefslogtreecommitdiffstats
path: root/drmtest.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-06-14 10:05:50 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-06-14 10:05:50 +0200
commitac3a01bfe9520e61f44e7f9893145d82b53522ae (patch)
tree821b1f519438e1f486dfae5045070e7d7983e1c5 /drmtest.c
parente7580760b355347220993ae485d3e8962e14e77e (diff)
downloaddrminfo-ac3a01bfe9520e61f44e7f9893145d82b53522ae.tar.gz
add drm lease support to drmtest
Diffstat (limited to 'drmtest.c')
-rw-r--r--drmtest.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/drmtest.c b/drmtest.c
index a8ab9a3..6c5b20b 100644
--- a/drmtest.c
+++ b/drmtest.c
@@ -24,6 +24,7 @@
#include "ttytools.h"
#include "logind.h"
#include "drmtools.h"
+#include "drm-lease.h"
#include "render.h"
#include "image.h"
@@ -183,15 +184,16 @@ static void usage(FILE *fp)
"usage: drmtest [ options ]\n"
"\n"
"options:\n"
- " -h print this\n"
- " -p pixman mode\n"
- " -a autotest mode (don't print hardware info)\n"
- " -c <nr> pick card\n"
- " -o <name> pick output\n"
- " -s <secs> set sleep time (default: 60)\n"
- " -i <file> load and display image <file>\n"
- " -f <fmt> pick framebuffer format\n"
- " -m <mode> pick video mode format\n"
+ " -h print this\n"
+ " -p pixman mode\n"
+ " -a autotest mode (don't print hardware info)\n"
+ " -c <nr> pick card\n"
+ " -o <name> pick output\n"
+ " -s <secs> set sleep time (default: 60)\n"
+ " -i <file> load and display image <file>\n"
+ " -f <fmt> pick framebuffer format\n"
+ " -m <mode> pick video mode format\n"
+ " -L <output> get a drm lease for output\n"
"\n");
}
@@ -199,6 +201,7 @@ int main(int argc, char **argv)
{
int card = 0;
int secs = 60;
+ int lease_fd = -1;
char *output = NULL;
char *format = NULL;
char *modename = NULL;
@@ -208,7 +211,7 @@ int main(int argc, char **argv)
int c,i;
for (;;) {
- c = getopt(argc, argv, "hpac:s:o:i:f:m:");
+ c = getopt(argc, argv, "hpaL:c:s:o:i:f:m:");
if (c == -1)
break;
switch (c) {
@@ -236,6 +239,9 @@ int main(int argc, char **argv)
case 'm':
modename = optarg;
break;
+ case 'L':
+ lease_fd = drm_lease(optarg);
+ break;
case 'h':
usage(stdout);
exit(0);
@@ -268,7 +274,7 @@ int main(int argc, char **argv)
}
logind_init();
- drm_init_dev(card, output, modename, false);
+ drm_init_dev(card, output, modename, false, lease_fd);
if (!fmt) {
/* find first supported in list */