summarylogtreecommitdiffstats
path: root/0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch
diff options
context:
space:
mode:
authorAaron Plattner2016-06-06 15:40:33 -0700
committerAaron Plattner2016-06-06 15:43:38 -0700
commit527fba43a5628b8e2697ff253b162622e321b201 (patch)
tree38308204f797794fc0b30eb229b70550f340929b /0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch
parent57673850b273dcf3db6c85abe9bc1d45d090eaf4 (diff)
downloadaur-527fba43a5628b8e2697ff253b162622e321b201.tar.gz
Update to Weston 1.11.0
Fetched patches from the nvidia_r364 branch of git://people.freedesktop.org/~jjones/weston and then rebased on top of the 1.11.0 tag. Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Diffstat (limited to '0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch')
-rw-r--r--0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch84
1 files changed, 84 insertions, 0 deletions
diff --git a/0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch b/0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch
new file mode 100644
index 000000000000..b294073b9061
--- /dev/null
+++ b/0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch
@@ -0,0 +1,84 @@
+From 8e93cad203be5983ea01fdd4a1b044465c3b8ac0 Mon Sep 17 00:00:00 2001
+From: "Miguel A. Vico" <mvicomoya@nvidia.com>
+Date: Tue, 1 Mar 2016 22:19:14 +0100
+Subject: [PATCH 10/11] compositor-drm: Gracefully handle vblank and flip
+ invalid timestamps
+X-NVConfidentiality: public
+
+Instant query for vblank timestamp may always fail, resulting in
+never scheduling a full repaint in drm_output_start_repaint_loop().
+
+Additionally, timestamp provided in page_flip_handler() may also be
+invalid.
+
+This change makes both drm_output_start_repaint_loop() and
+page_flip_handler() to schedule a full repaint in any of the
+situations above.
+
+Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
+Reviewed-by: Andy Ritger <aritger@nvidia.com>
+---
+ src/compositor-drm.c | 26 +++++++++++++++++++++++---
+ 1 file changed, 23 insertions(+), 3 deletions(-)
+
+diff --git a/src/compositor-drm.c b/src/compositor-drm.c
+index dd545de1ccc0..51d90e1d6437 100644
+--- a/src/compositor-drm.c
++++ b/src/compositor-drm.c
+@@ -1,6 +1,7 @@
+ /*
+ * Copyright © 2008-2011 Kristian Høgsberg
+ * Copyright © 2011 Intel Corporation
++ * Copyright © 2016 NVIDIA Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+@@ -753,8 +754,16 @@ drm_output_start_repaint_loop(struct weston_output *output_base)
+ vbl.request.type |= drm_waitvblank_pipe(output);
+ ret = drmWaitVBlank(backend->drm.fd, &vbl);
+
+- /* Error ret or zero timestamp means failure to get valid timestamp */
+- if ((ret == 0) && (vbl.reply.tval_sec > 0 || vbl.reply.tval_usec > 0)) {
++ if (ret) {
++ /* Immediate query failed. It may always fail so we'll never get a valid
++ * timestamp to update msc and call into finish frame. Hence, jump to
++ * finish frame here.
++ */
++ goto finish_frame;
++ }
++
++ /* Zero timestamp means failure to get valid timestamp */
++ if (vbl.reply.tval_sec > 0 || vbl.reply.tval_usec > 0) {
+ ts.tv_sec = vbl.reply.tval_sec;
+ ts.tv_nsec = vbl.reply.tval_usec * 1000;
+
+@@ -775,7 +784,7 @@ drm_output_start_repaint_loop(struct weston_output *output_base)
+ }
+ }
+
+- /* Immediate query didn't provide valid timestamp.
++ /* Immediate query succeeded, but didn't provide valid timestamp.
+ * Use pageflip fallback.
+ */
+ fb_id = output->current->fb_id;
+@@ -861,6 +870,17 @@ page_flip_handler(int fd, unsigned int frame,
+ else if (!output->vblank_pending) {
+ ts.tv_sec = sec;
+ ts.tv_nsec = usec * 1000;
++
++ /* Zero timestamp means failure to get valid timestamp, so immediately
++ * finish frame
++ *
++ * FIXME: Driver should never return an invalid page flip timestamp */
++ if (ts.tv_sec == 0 && ts.tv_nsec == 0) {
++ weston_compositor_read_presentation_clock(output->base.compositor,
++ &ts);
++ flags = WP_PRESENTATION_FEEDBACK_INVALID;
++ }
++
+ weston_output_finish_frame(&output->base, &ts, flags);
+
+ /* We can't call this from frame_notify, because the output's
+--
+2.8.3
+