summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/egl/common/native_helper.h
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2011-02-25 13:05:31 +0100
committerThomas Hellstrom <thellstrom@vmware.com>2011-03-01 10:36:19 +0100
commit8b145e23023927ddec7839a9e4498d5a42e3ca29 (patch)
tree98620a66dbbb2f9daec9064396bb69a2483b34de /src/gallium/state_trackers/egl/common/native_helper.h
parentc9febff31f1032065f96ad76fd31f31ac330fef9 (diff)
st/egl: Implement swapbuffer throttling
When doing copy swapbuffers using drm, throttle on outstanding copy operations. Introduces a new environment variable, EGL_THROTTLE_FENCES that the user can use to indicate the desired number of outstanding swapbuffers, or disable throttling using EGL_THROTTLE_FENCES=0. This can and perhaps should be extended to the pageflip case as well, since with some hardware pageflips can be pipelined. In case the pageflip syncs, the throttle operation will be a no-op anyway. Update copyright notices. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'src/gallium/state_trackers/egl/common/native_helper.h')
-rw-r--r--src/gallium/state_trackers/egl/common/native_helper.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/egl/common/native_helper.h b/src/gallium/state_trackers/egl/common/native_helper.h
index ad6827336a..39564a0436 100644
--- a/src/gallium/state_trackers/egl/common/native_helper.h
+++ b/src/gallium/state_trackers/egl/common/native_helper.h
@@ -3,6 +3,7 @@
* Version: 7.9
*
* Copyright (C) 2010 LunarG Inc.
+ * Copyright (C) 2011 VMware Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -24,6 +25,7 @@
*
* Authors:
* Chia-I Wu <olv@lunarg.com>
+ * Thomas Hellstrom <thellstrom@vmware.com>
*/
#include "native.h"
@@ -75,6 +77,31 @@ resource_surface_present(struct resource_surface *rsurf,
enum native_attachment which,
void *winsys_drawable_handle);
+/**
+ * Perform a gallium copy blit between the back left and front left
+ * surfaces. Needs to be followed by a call to resource_surface_flush.
+ */
boolean
resource_surface_copy_swap(struct resource_surface *rsurf,
struct native_display *ndpy);
+
+/**
+ * Throttle on outstanding rendering using the copy context. For example
+ * copy swaps.
+ */
+boolean
+resource_surface_throttle(struct resource_surface *rsurf);
+
+/**
+ * Flush pending rendering using the copy context. This function saves a
+ * marker for upcoming throttles.
+ */
+boolean
+resource_surface_flush(struct resource_surface *rsurf,
+ struct native_display *ndpy);
+/**
+ * Wait for all rendering using the copy context to be complete. Frees all
+ * throttle markers saved using resource_surface_flush.
+ */
+void
+resource_surface_wait(struct resource_surface *rsurf);