From b730d866a0f4f56c103420f818f7f5ec6b8fd618 Mon Sep 17 00:00:00 2001 From: Tim Murray Date: Mon, 18 Aug 2014 16:14:24 -0700 Subject: [PATCH] Fix IO_INPUT with 64-bit. bug 16846318 bug 17006933 Change-Id: Ic13ef26875d8a6fab1ffb542d62038b768a536ff --- rs/java/android/renderscript/Allocation.java | 2 +- rs/java/android/renderscript/RenderScript.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java index 7db85f26bdedb..3cda6de14ff55 100644 --- a/rs/java/android/renderscript/Allocation.java +++ b/rs/java/android/renderscript/Allocation.java @@ -1868,7 +1868,7 @@ public class Allocation extends BaseObj { } } - static void sendBufferNotification(int id) { + static void sendBufferNotification(long id) { synchronized(mAllocationMap) { Allocation a = mAllocationMap.get(new Long(id)); diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java index 340efef875a3a..6c5c5083edcab 100644 --- a/rs/java/android/renderscript/RenderScript.java +++ b/rs/java/android/renderscript/RenderScript.java @@ -1156,7 +1156,12 @@ public class RenderScript { } if (msg == RS_MESSAGE_TO_CLIENT_NEW_BUFFER) { - Allocation.sendBufferNotification(subID); + if (mRS.nContextGetUserMessage(mRS.mContext, rbuf) != + RS_MESSAGE_TO_CLIENT_NEW_BUFFER) { + throw new RSDriverException("Error processing message from RenderScript."); + } + long bufferID = ((long)rbuf[1] << 32L) + ((long)rbuf[0] & 0xffffffffL); + Allocation.sendBufferNotification(bufferID); continue; }