summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Parr <jon.parr@imgtec.com>2015-06-11 14:27:51 +0100
committerStephen Hines <srhines@google.com>2015-06-23 09:44:57 -0700
commitea2e4d37418c6ada5d3c8cd08b8e60348dd46790 (patch)
treeb1e506bbfbf2734cf14f7d8985da5a6d9c83d4a1
parenta999049af32c9f2e2989685a86843eaeff312f0b (diff)
downloadandroid_frameworks_rs-ea2e4d37418c6ada5d3c8cd08b8e60348dd46790.tar.gz
android_frameworks_rs-ea2e4d37418c6ada5d3c8cd08b8e60348dd46790.tar.bz2
android_frameworks_rs-ea2e4d37418c6ada5d3c8cd08b8e60348dd46790.zip
Allow drivers to alter the default driver name on rsdHalInit
Bug: 20894432 Permit partner drivers via Context::setDriverName to choose their own mDriverName rather than the default OVERRIDE_RS_DRIVER string. This can only be done once from within rsdHalInit otherwise it will be ignored and the default behaviour will apply. Change-Id: I49b81e60f7983a81f0e71fbef4b46f9bfc834849 (cherry picked from commit b268abd5528936d13a85b03f44458fe3a55cafad)
-rw-r--r--rsContext.h8
-rw-r--r--rsDriverLoader.cpp2
2 files changed, 9 insertions, 1 deletions
diff --git a/rsContext.h b/rsContext.h
index 918e5e3f..09b7483f 100644
--- a/rsContext.h
+++ b/rsContext.h
@@ -290,6 +290,14 @@ public:
return mDriverName;
}
+ // Set a new driver name, should be called from within
+ // rsdHalInit in order to alter default behaviour.
+ void setDriverName(const char * name) {
+ if (!mDriverName) {
+ mDriverName = name;
+ }
+ }
+
protected:
diff --git a/rsDriverLoader.cpp b/rsDriverLoader.cpp
index 5bfb8e5c..7b728b62 100644
--- a/rsDriverLoader.cpp
+++ b/rsDriverLoader.cpp
@@ -207,7 +207,7 @@ bool Context::loadRuntime(const char* filename) {
}
// Only map in the actual driver name if we successfully load the runtime.
- mDriverName = filename;
+ setDriverName(filename);
return true;