diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-04 07:14:54 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-04 07:14:54 +0000 |
commit | cfc366534c0bc31a50172142d0ef75242b2e5c13 (patch) | |
tree | 1e3982f2a48e974c2f4e387af2a578a340774c36 | |
parent | a553ac7a9d8383dd2405282dffbe5a6a2619c9c8 (diff) | |
parent | 871b18c89d347c8726f7350dee0e3fdb3705fb16 (diff) | |
download | rs-oreo-r2-release.tar.gz |
release-request-777c0f47-a42e-446a-b45c-0bb1aaa9612e-for-git_oc-release-4066915 snap-temp-L92300000070444114android-security-8.0.0_r54android-security-8.0.0_r53android-security-8.0.0_r52android-cts-8.0_r9android-cts-8.0_r8android-cts-8.0_r7android-cts-8.0_r6android-cts-8.0_r5android-cts-8.0_r4android-cts-8.0_r3android-cts-8.0_r26android-cts-8.0_r25android-cts-8.0_r24android-cts-8.0_r23android-cts-8.0_r22android-cts-8.0_r21android-cts-8.0_r20android-cts-8.0_r2android-cts-8.0_r19android-cts-8.0_r18android-cts-8.0_r17android-cts-8.0_r16android-cts-8.0_r15android-cts-8.0_r14android-cts-8.0_r13android-cts-8.0_r12android-cts-8.0_r11android-cts-8.0_r10android-cts-8.0_r1android-8.0.0_r9android-8.0.0_r7android-8.0.0_r51android-8.0.0_r50android-8.0.0_r49android-8.0.0_r48android-8.0.0_r47android-8.0.0_r46android-8.0.0_r45android-8.0.0_r44android-8.0.0_r43android-8.0.0_r42android-8.0.0_r41android-8.0.0_r40android-8.0.0_r4android-8.0.0_r39android-8.0.0_r38android-8.0.0_r37android-8.0.0_r36android-8.0.0_r35android-8.0.0_r32android-8.0.0_r31android-8.0.0_r30android-8.0.0_r3android-8.0.0_r29android-8.0.0_r28android-8.0.0_r2android-8.0.0_r17android-8.0.0_r16android-8.0.0_r15android-8.0.0_r13android-8.0.0_r12android-8.0.0_r11android-8.0.0_r10android-8.0.0_r1security-oc-releaseoreo-security-releaseoreo-releaseoreo-r6-releaseoreo-r5-releaseoreo-r4-releaseoreo-r3-releaseoreo-r2-releaseoreo-cts-release
Change-Id: I43cfe70848f39de298e8ae197533bfb5b70035a9
-rw-r--r-- | cpp/rsDispatch.h | 2 | ||||
-rw-r--r-- | rsApiContext.cpp | 12 | ||||
-rw-r--r-- | rsContext.cpp | 4 | ||||
-rw-r--r-- | rsContext.h | 4 | ||||
-rw-r--r-- | rsDriverLoader.cpp | 15 |
5 files changed, 21 insertions, 16 deletions
diff --git a/cpp/rsDispatch.h b/cpp/rsDispatch.h index ab579361..1bcd954b 100644 --- a/cpp/rsDispatch.h +++ b/cpp/rsDispatch.h @@ -29,6 +29,7 @@ typedef RsDevice (*DeviceCreateFnPtr) (); typedef void (*DeviceDestroyFnPtr) (RsDevice dev); typedef void (*DeviceSetConfigFnPtr) (RsDevice dev, RsDeviceParam p, int32_t value); typedef RsContext (*ContextCreateFnPtr)(RsDevice vdev, uint32_t version, uint32_t sdkVersion, RsContextType ct, uint32_t flags); +typedef RsContext (*ContextCreateVendorFnPtr)(RsDevice vdev, uint32_t version, uint32_t sdkVersion, RsContextType ct, uint32_t flags, const char* vendorDriverName); typedef void (*GetNameFnPtr)(RsContext, void * obj, const char **name); typedef RsClosure (*ClosureCreateFnPtr)(RsContext, RsScriptKernelID, RsAllocation, RsScriptFieldID*, size_t, int64_t*, size_t, int*, size_t, RsClosure*, size_t, RsScriptFieldID*, size_t); typedef RsClosure (*InvokeClosureCreateFnPtr)(RsContext, RsScriptInvokeID, const void*, const size_t, const RsScriptFieldID*, const size_t, const int64_t*, const size_t, const int*, const size_t); @@ -177,6 +178,7 @@ struct dispatchTable { ClosureSetArgFnPtr ClosureSetArg; ClosureSetGlobalFnPtr ClosureSetGlobal; ContextCreateFnPtr ContextCreate; + ContextCreateVendorFnPtr ContextCreateVendor; ContextDeinitToClientFnPtr ContextDeinitToClient; ContextDestroyFnPtr ContextDestroy; ContextDumpFnPtr ContextDump; diff --git a/rsApiContext.cpp b/rsApiContext.cpp index 11609851..53d9e4a7 100644 --- a/rsApiContext.cpp +++ b/rsApiContext.cpp @@ -25,16 +25,22 @@ using android::renderscript::Context; using android::renderscript::Device; using android::renderscript::ObjectBase; -extern "C" RsContext rsContextCreate(RsDevice vdev, uint32_t version, uint32_t sdkVersion, - RsContextType ct, uint32_t flags) { +extern "C" RsContext rsContextCreateVendor(RsDevice vdev, uint32_t version, uint32_t sdkVersion, + RsContextType ct, uint32_t flags, + const char* vendorDriverName) { Device * dev = static_cast<Device *>(vdev); - Context *rsc = Context::createContext(dev, nullptr, ct, flags); + Context *rsc = Context::createContext(dev, nullptr, ct, flags, vendorDriverName); if (rsc) { rsc->setTargetSdkVersion(sdkVersion); } return rsc; } +extern "C" RsContext rsContextCreate(RsDevice vdev, uint32_t version, uint32_t sdkVersion, + RsContextType ct, uint32_t flags) { + return rsContextCreateVendor(vdev, version, sdkVersion, ct, flags, nullptr); +} + extern "C" void rsaContextSetNativeLibDir(RsContext con, char *libDir, size_t length) { #ifdef RS_COMPATIBILITY_LIB Context *rsc = static_cast<Context *>(con); diff --git a/rsContext.cpp b/rsContext.cpp index f6686a92..f69f5ee1 100644 --- a/rsContext.cpp +++ b/rsContext.cpp @@ -460,7 +460,8 @@ void Context::setCacheDir(const char * cacheDir_arg, uint32_t length) { } Context * Context::createContext(Device *dev, const RsSurfaceConfig *sc, - RsContextType ct, uint32_t flags) { + RsContextType ct, uint32_t flags, + const char* vendorDriverName) { Context * rsc = new Context(); if (flags & RS_CONTEXT_LOW_LATENCY) { @@ -471,6 +472,7 @@ Context * Context::createContext(Device *dev, const RsSurfaceConfig *sc, } rsc->mContextType = ct; rsc->mHal.flags = flags; + rsc->mVendorDriverName = vendorDriverName; if (!rsc->initContext(dev, sc)) { delete rsc; diff --git a/rsContext.h b/rsContext.h index 10574ded..17a890bf 100644 --- a/rsContext.h +++ b/rsContext.h @@ -81,7 +81,8 @@ public: static Context * createContext(Device *, const RsSurfaceConfig *sc, RsContextType ct = RS_CONTEXT_TYPE_NORMAL, - uint32_t flags = 0); + uint32_t flags = 0, + const char* vendorDriverName = nullptr); static Context * createContextLite(); ~Context(); @@ -352,6 +353,7 @@ private: // Since this is always just a static string, we don't have to // allocate, copy, or free any memory here. const char* mDriverName; + const char* mVendorDriverName; std::vector<ObjectBase *> mNames; diff --git a/rsDriverLoader.cpp b/rsDriverLoader.cpp index 48ff9907..e432a4f9 100644 --- a/rsDriverLoader.cpp +++ b/rsDriverLoader.cpp @@ -240,21 +240,14 @@ bool Context::loadDriver(bool forceDefault, bool forceRSoV) { ALOGE("Failed to load the RSoV driver!"); } -#ifdef OVERRIDE_RS_DRIVER -#define XSTR(S) #S -#define STR(S) XSTR(S) -#define OVERRIDE_RS_DRIVER_STRING STR(OVERRIDE_RS_DRIVER) - if (!forceDefault) { - if (loadRuntime(OVERRIDE_RS_DRIVER_STRING)) { - ALOGV("Successfully loaded runtime: %s", OVERRIDE_RS_DRIVER_STRING); + if (!forceDefault && mVendorDriverName != nullptr) { + if (loadRuntime(mVendorDriverName)) { + ALOGV("Successfully loaded runtime: %s", mVendorDriverName); loadDefault = false; } else { - ALOGE("Failed to load runtime %s, loading default", OVERRIDE_RS_DRIVER_STRING); + ALOGE("Failed to load runtime %s, loading default", mVendorDriverName); } } -#undef XSTR -#undef STR -#endif // OVERRIDE_RS_DRIVER if (loadDefault) { if (!loadRuntime("libRSDriver.so")) { |