Merge "Add comment to confusing commands." into graphics-dev
diff --git a/driver/rsdRuntimeMath.cpp b/driver/rsdRuntimeMath.cpp
index e315539..753ef73 100644
--- a/driver/rsdRuntimeMath.cpp
+++ b/driver/rsdRuntimeMath.cpp
@@ -329,6 +329,16 @@
return prev;
}
+static uint32_t SC_AtomicUMin(volatile uint32_t *ptr, uint32_t value) {
+ uint32_t prev, status;
+ do {
+ prev = *ptr;
+ uint32_t n = rsMin(value, prev);
+ status = android_atomic_release_cas((int32_t) prev, (int32_t)n, (volatile int32_t*) ptr);
+ } while (CC_UNLIKELY(status != 0));
+ return prev;
+}
+
static int32_t SC_AtomicMin(volatile int32_t *ptr, int32_t value) {
int32_t prev, status;
do {
@@ -339,6 +349,16 @@
return prev;
}
+static uint32_t SC_AtomicUMax(volatile uint32_t *ptr, uint32_t value) {
+ uint32_t prev, status;
+ do {
+ prev = *ptr;
+ uint32_t n = rsMax(value, prev);
+ status = android_atomic_release_cas((int32_t) prev, (int32_t) n, (volatile int32_t*) ptr);
+ } while (CC_UNLIKELY(status != 0));
+ return prev;
+}
+
static int32_t SC_AtomicMax(volatile int32_t *ptr, int32_t value) {
int32_t prev, status;
do {
@@ -524,9 +544,9 @@
{ "_Z11rsAtomicXorPVii", (void *)&SC_AtomicXor, true },
{ "_Z11rsAtomicXorPVjj", (void *)&SC_AtomicXor, true },
{ "_Z11rsAtomicMinPVii", (void *)&SC_AtomicMin, true },
- { "_Z11rsAtomicMinPVjj", (void *)&SC_AtomicMin, true },
+ { "_Z11rsAtomicMinPVjj", (void *)&SC_AtomicUMin, true },
{ "_Z11rsAtomicMaxPVii", (void *)&SC_AtomicMax, true },
- { "_Z11rsAtomicMaxPVjj", (void *)&SC_AtomicMax, true },
+ { "_Z11rsAtomicMaxPVjj", (void *)&SC_AtomicUMax, true },
{ "_Z11rsAtomicCasPViii", (void *)&SC_AtomicCas, true },
{ "_Z11rsAtomicCasPVjjj", (void *)&SC_AtomicCas, true },
diff --git a/rsThreadIO.cpp b/rsThreadIO.cpp
index 8ba1a0e..1917774 100644
--- a/rsThreadIO.cpp
+++ b/rsThreadIO.cpp
@@ -124,7 +124,6 @@
while (!mToCore.isEmpty() || waitForCommand) {
uint32_t cmdID = 0;
uint32_t cmdSize = 0;
- ret = true;
if (con->props.mLogTimes) {
con->timerSet(Context::RS_TIMER_IDLE);
}
@@ -136,11 +135,17 @@
delay = 0;
}
}
+
+ if (delay == 0 && timeToWait != 0 && mToCore.isEmpty()) {
+ break;
+ }
+
const void * data = mToCore.get(&cmdID, &cmdSize, delay);
if (!cmdSize) {
// exception or timeout occurred.
- return false;
+ break;
}
+ ret = true;
if (con->props.mLogTimes) {
con->timerSet(Context::RS_TIMER_INTERNAL);
}
diff --git a/scriptc/rs_allocation.rsh b/scriptc/rs_allocation.rsh
index 661d3e3..a2f69d9 100644
--- a/scriptc/rs_allocation.rsh
+++ b/scriptc/rs_allocation.rsh
@@ -28,13 +28,13 @@
*
* To use Renderscript, you need to utilize the Renderscript runtime APIs documented here
* as well as the Android framework APIs for Renderscript.
- * For documentation on the Android framework APIs, see the <a href=
+ * For documentation on the Android framework APIs, see the <a target="_parent" href=
* "http://developer.android.com/reference/android/renderscript/package-summary.html">
* android.renderscript</a> package reference.
* For more information on how to develop with Renderscript and how the runtime and
- * Android framework APIs interact, see the <a href=
+ * Android framework APIs interact, see the <a target="_parent" href=
* "http://developer.android.com/guide/topics/renderscript/index.html">Renderscript
- * developer guide</a> and the <a href=
+ * developer guide</a> and the <a target="_parent" href=
* "http://developer.android.com/resources/samples/RenderScript/index.html">
* Renderscript samples</a>.
*/
diff --git a/scriptc/rs_atomic.rsh b/scriptc/rs_atomic.rsh
index 87c6c02..a455edd 100644
--- a/scriptc/rs_atomic.rsh
+++ b/scriptc/rs_atomic.rsh
@@ -242,7 +242,7 @@
* @return old value
*/
extern uint32_t __attribute__((overloadable))
- rsAtomicCas(volatile uint32_t* addr, int32_t compareValue, int32_t newValue);
+ rsAtomicCas(volatile uint32_t* addr, uint32_t compareValue, uint32_t newValue);
#endif //defined(RS_VERSION) && (RS_VERSION >= 14)