summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: deb56e3)
raw | patch | inline | side by side (parent: deb56e3)
author | Vincent Stehlé <v-stehle@ti.com> | |
Mon, 13 Aug 2012 12:37:09 +0000 (14:37 +0200) | ||
committer | Vincent Stehlé <v-stehle@ti.com> | |
Fri, 17 Aug 2012 14:56:32 +0000 (16:56 +0200) |
This allows to disable display updates from command line for benchmarking
purposes. This is done by overriding the display post_buffer() and
post_vid_buffer() functions with empty ones. Note that rate control does still
work.
Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
purposes. This is done by overriding the display post_buffer() and
post_vid_buffer() functions with empty ones. Note that rate control does still
work.
Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
util/util.c | patch | blob | history |
diff --git a/util/util.c b/util/util.c
index 3b3ca86b0812f1ea18dab2a19a1e8224db266332..fde68a34620046300045cc96bf7db70b6d27ab0f 100644 (file)
--- a/util/util.c
+++ b/util/util.c
{
MSG("Generic Display options:");
MSG("\t--fps <fps>\tforce playback rate (0 means \"do not force\")");
+ MSG("\t--no-post\tDo not post buffers (disables screen updates) for benchmarking. Rate can still be controlled.");
#ifdef HAVE_X11
disp_x11_usage();
disp_kms_usage();
}
+static int
+empty_post_buffer(struct display *disp, struct buffer *buf)
+{
+ return 0;
+}
+
+static int
+empty_post_vid_buffer(struct display *disp, struct buffer *buf,
+ uint32_t x, uint32_t y, uint32_t w, uint32_t h)
+{
+ return 0;
+}
+
struct display *
disp_open(int argc, char **argv)
{
struct display *disp;
- int i, fps = 0;
+ int i, fps = 0, no_post = 0;
for (i = 1; i < argc; i++) {
if (!argv[i]) {
MSG("Forcing playback rate at %d fps.", fps);
argv[i] = NULL;
+
+ } else if (!strcmp("--no-post", argv[i])) {
+ MSG("Disabling buffers posting.");
+ no_post = 1;
+ argv[i] = NULL;
}
}
out:
disp->rtctl.fps = fps;
+
+ /* If buffer posting is disabled from command line, override post
+ * functions with empty ones. */
+ if (no_post) {
+ disp->post_buffer = empty_post_buffer;
+ disp->post_vid_buffer = empty_post_vid_buffer;
+ }
+
return disp;
}