aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-03-31 21:57:53 +0200
committerGerd Hoffmann <kraxel@redhat.com>2016-03-31 21:57:53 +0200
commitd780332c4b2fae4bbbb19c5d170e3810bc3184ac (patch)
tree624d17999ba32a2c8e8d7305b941ad746e0c7a06
parent677fee9d0277c990e19760e1543ed07ed5115a07 (diff)
downloadfbida-d780332c4b2fae4bbbb19c5d170e3810bc3184ac.tar.gz
fbpdf: add pageflip option, misc
-rw-r--r--drmtools-egl.c3
-rw-r--r--fbiconfig.c12
-rw-r--r--fbiconfig.h2
-rw-r--r--fbpdf.c14
4 files changed, 25 insertions, 6 deletions
diff --git a/drmtools-egl.c b/drmtools-egl.c
index 8c91c0f..01cbab9 100644
--- a/drmtools-egl.c
+++ b/drmtools-egl.c
@@ -176,6 +176,9 @@ gfxstate *drm_init_egl(const char *device, const char *output)
if (drm_setup_egl() < 0)
return NULL;
+ fprintf(stderr, "%s: %s\n",
+ glGetString(GL_VENDOR), glGetString(GL_RENDERER));
+
/* prepare gfx */
gfx = malloc(sizeof(*gfx));
memset(gfx, 0, sizeof(*gfx));
diff --git a/fbiconfig.c b/fbiconfig.c
index 39da0bc..565a21b 100644
--- a/fbiconfig.c
+++ b/fbiconfig.c
@@ -205,6 +205,11 @@ struct cfg_cmdline fbpdf_cmd[] = {
.value = "1",
.desc = "print device info",
},{
+ .cmdline = "store",
+ .option = { O_WRITECONF },
+ .value = "1",
+ .desc = "write cmd line args to config file",
+ },{
/* end of list */
}
};
@@ -229,11 +234,16 @@ struct cfg_cmdline fbpdf_cfg[] = {
.needsarg = 1,
.desc = "use drm output <arg> (try -info for a list)",
},{
+ .cmdline = "pageflip",
+ .option = { O_PAGEFLIP },
+ .yesno = 1,
+ .desc = "use pageflip (drm only)",
+ },{
.letter = 'g',
.cmdline = "opengl",
.option = { O_OPENGL },
.yesno = 1,
- .desc = "use opengl",
+ .desc = "use opengl (drm only)",
},{
.letter = 'm',
.cmdline = "mode",
diff --git a/fbiconfig.h b/fbiconfig.h
index 3cd5d7d..2e3a0a1 100644
--- a/fbiconfig.h
+++ b/fbiconfig.h
@@ -34,6 +34,7 @@
#define O_DEVICE O_OPTIONS, "device"
#define O_OUTPUT O_OPTIONS, "output"
#define O_OPENGL O_OPTIONS, "opengl"
+#define O_PAGEFLIP O_OPTIONS, "pageflip"
#define O_FONT O_OPTIONS, "font"
#define O_VIDEO_MODE O_OPTIONS, "video-mode"
@@ -65,6 +66,7 @@
#define GET_PCD_RES() cfg_get_int(O_PCD_RES, 3)
#define GET_OPENGL() cfg_get_bool(O_OPENGL, 0)
+#define GET_PAGEFLIP() cfg_get_bool(O_PAGEFLIP, 1)
/* -------------------------------------------------------------------------- */
diff --git a/fbpdf.c b/fbpdf.c
index c97edc1..0bc39ff 100644
--- a/fbpdf.c
+++ b/fbpdf.c
@@ -246,7 +246,7 @@ int main(int argc, char *argv[])
{
GError *err = NULL;
bool framebuffer = false;
- bool quit, newpage;
+ bool quit, newpage, opengl, pageflip;
char cwd[1024];
char uri[1024];
char key[32];
@@ -271,6 +271,8 @@ int main(int argc, char *argv[])
drm_info(cfg_get_str(O_DEVICE));
exit(0);
}
+ if (GET_WRITECONF())
+ fbi_write_config();
if (optind+1 != argc ) {
usage(stderr, argv[0]);
@@ -300,15 +302,17 @@ int main(int argc, char *argv[])
output = cfg_get_str(O_OUTPUT);
mode = cfg_get_str(O_VIDEO_MODE);
fitwidth = GET_FIT_WIDTH();
+ opengl = GET_OPENGL();
+ pageflip = GET_PAGEFLIP();
if (device) {
/* device specified */
if (strncmp(device, "/dev/d", 6) == 0) {
- if (GET_OPENGL()) {
+ if (opengl) {
gfx = drm_init_egl(device, output);
}
if (!gfx) {
- gfx = drm_init(device, output, true);
+ gfx = drm_init(device, output, pageflip);
}
} else {
framebuffer = true;
@@ -316,11 +320,11 @@ int main(int argc, char *argv[])
}
} else {
/* try drm first, failing that fb */
- if (GET_OPENGL()) {
+ if (opengl) {
gfx = drm_init_egl(NULL, output);
}
if (!gfx) {
- gfx = drm_init(NULL, output, true);
+ gfx = drm_init(NULL, output, pageflip);
}
if (!gfx) {
framebuffer = true;