Merge "Cleanup RS logs Reduce the startup/shutdown info and format the logs in a consistent manner."
This commit is contained in:
@@ -219,7 +219,7 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) {
|
|||||||
|
|
||||||
|
|
||||||
int cpu = sysconf(_SC_NPROCESSORS_ONLN);
|
int cpu = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
LOGV("RS Launching thread(s), reported CPU count %i", cpu);
|
LOGV("%p Launching thread(s), CPUs %i", rsc, cpu);
|
||||||
if (cpu < 2) cpu = 0;
|
if (cpu < 2) cpu = 0;
|
||||||
|
|
||||||
dc->mWorkers.mCount = (uint32_t)cpu;
|
dc->mWorkers.mCount = (uint32_t)cpu;
|
||||||
|
|||||||
@@ -129,11 +129,8 @@ void rsdGLShutdown(const Context *rsc) {
|
|||||||
|
|
||||||
dc->gl.shaderCache->cleanupAll();
|
dc->gl.shaderCache->cleanupAll();
|
||||||
delete dc->gl.shaderCache;
|
delete dc->gl.shaderCache;
|
||||||
|
|
||||||
delete dc->gl.vertexArrayState;
|
delete dc->gl.vertexArrayState;
|
||||||
|
|
||||||
LOGV("%p, deinitEGL", rsc);
|
|
||||||
|
|
||||||
if (dc->gl.egl.context != EGL_NO_CONTEXT) {
|
if (dc->gl.egl.context != EGL_NO_CONTEXT) {
|
||||||
RSD_CALL_GL(eglMakeCurrent, dc->gl.egl.display,
|
RSD_CALL_GL(eglMakeCurrent, dc->gl.egl.display,
|
||||||
EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||||
@@ -363,7 +360,7 @@ bool rsdGLInit(const Context *rsc) {
|
|||||||
dc->gl.vertexArrayState->init(dc->gl.gl.maxVertexAttribs);
|
dc->gl.vertexArrayState->init(dc->gl.gl.maxVertexAttribs);
|
||||||
dc->gl.currentFrameBuffer = NULL;
|
dc->gl.currentFrameBuffer = NULL;
|
||||||
|
|
||||||
LOGV("initGLThread end %p", rsc);
|
LOGV("%p initGLThread end", rsc);
|
||||||
rsc->setWatchdogGL(NULL, 0, NULL);
|
rsc->setWatchdogGL(NULL, 0, NULL);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,11 +37,10 @@ pthread_mutex_t Context::gLibMutex = PTHREAD_MUTEX_INITIALIZER;
|
|||||||
|
|
||||||
bool Context::initGLThread() {
|
bool Context::initGLThread() {
|
||||||
pthread_mutex_lock(&gInitMutex);
|
pthread_mutex_lock(&gInitMutex);
|
||||||
LOGV("initGLThread start %p", this);
|
|
||||||
|
|
||||||
if (!mHal.funcs.initGraphics(this)) {
|
if (!mHal.funcs.initGraphics(this)) {
|
||||||
pthread_mutex_unlock(&gInitMutex);
|
pthread_mutex_unlock(&gInitMutex);
|
||||||
LOGE("%p, initGraphics failed", this);
|
LOGE("%p initGraphics failed", this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +49,6 @@ bool Context::initGLThread() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Context::deinitEGL() {
|
void Context::deinitEGL() {
|
||||||
LOGV("%p, deinitEGL", this);
|
|
||||||
mHal.funcs.shutdownGraphics(this);
|
mHal.funcs.shutdownGraphics(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,7 +282,7 @@ void * Context::threadProc(void *vrsc) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGV("%p, RS Thread exiting", rsc);
|
LOGV("%p RS Thread exiting", rsc);
|
||||||
|
|
||||||
if (rsc->mIsGraphicsContext) {
|
if (rsc->mIsGraphicsContext) {
|
||||||
pthread_mutex_lock(&gInitMutex);
|
pthread_mutex_lock(&gInitMutex);
|
||||||
@@ -292,7 +290,7 @@ void * Context::threadProc(void *vrsc) {
|
|||||||
pthread_mutex_unlock(&gInitMutex);
|
pthread_mutex_unlock(&gInitMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGV("%p, RS Thread exited", rsc);
|
LOGV("%p RS Thread exited", rsc);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,7 +424,7 @@ bool Context::initContext(Device *dev, const RsSurfaceConfig *sc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Context::~Context() {
|
Context::~Context() {
|
||||||
LOGV("Context::~Context");
|
LOGV("%p Context::~Context", this);
|
||||||
|
|
||||||
if (!mIsContextLite) {
|
if (!mIsContextLite) {
|
||||||
mIO.coreFlush();
|
mIO.coreFlush();
|
||||||
@@ -450,7 +448,7 @@ Context::~Context() {
|
|||||||
}
|
}
|
||||||
pthread_mutex_unlock(&gInitMutex);
|
pthread_mutex_unlock(&gInitMutex);
|
||||||
}
|
}
|
||||||
LOGV("Context::~Context done");
|
LOGV("%p Context::~Context done", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Context::setSurface(uint32_t w, uint32_t h, RsNativeWindow sur) {
|
void Context::setSurface(uint32_t w, uint32_t h, RsNativeWindow sur) {
|
||||||
@@ -667,10 +665,10 @@ void rsi_ContextDestroyWorker(Context *rsc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void rsi_ContextDestroy(Context *rsc) {
|
void rsi_ContextDestroy(Context *rsc) {
|
||||||
LOGV("rsContextDestroy %p", rsc);
|
LOGV("%p rsContextDestroy", rsc);
|
||||||
rsContextDestroyWorker(rsc);
|
rsContextDestroyWorker(rsc);
|
||||||
delete rsc;
|
delete rsc;
|
||||||
LOGV("rsContextDestroy 2 %p", rsc);
|
LOGV("%p rsContextDestroy done", rsc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -701,7 +699,7 @@ void rsi_ContextDeinitToClient(Context *rsc) {
|
|||||||
|
|
||||||
RsContext rsContextCreate(RsDevice vdev, uint32_t version,
|
RsContext rsContextCreate(RsDevice vdev, uint32_t version,
|
||||||
uint32_t sdkVersion) {
|
uint32_t sdkVersion) {
|
||||||
LOGV("rsContextCreate %p", vdev);
|
LOGV("rsContextCreate dev=%p", vdev);
|
||||||
Device * dev = static_cast<Device *>(vdev);
|
Device * dev = static_cast<Device *>(vdev);
|
||||||
Context *rsc = Context::createContext(dev, NULL);
|
Context *rsc = Context::createContext(dev, NULL);
|
||||||
if (rsc) {
|
if (rsc) {
|
||||||
@@ -713,14 +711,14 @@ RsContext rsContextCreate(RsDevice vdev, uint32_t version,
|
|||||||
RsContext rsContextCreateGL(RsDevice vdev, uint32_t version,
|
RsContext rsContextCreateGL(RsDevice vdev, uint32_t version,
|
||||||
uint32_t sdkVersion, RsSurfaceConfig sc,
|
uint32_t sdkVersion, RsSurfaceConfig sc,
|
||||||
uint32_t dpi) {
|
uint32_t dpi) {
|
||||||
LOGV("rsContextCreateGL %p", vdev);
|
LOGV("rsContextCreateGL dev=%p", vdev);
|
||||||
Device * dev = static_cast<Device *>(vdev);
|
Device * dev = static_cast<Device *>(vdev);
|
||||||
Context *rsc = Context::createContext(dev, &sc);
|
Context *rsc = Context::createContext(dev, &sc);
|
||||||
if (rsc) {
|
if (rsc) {
|
||||||
rsc->setTargetSdkVersion(sdkVersion);
|
rsc->setTargetSdkVersion(sdkVersion);
|
||||||
rsc->setDPI(dpi);
|
rsc->setDPI(dpi);
|
||||||
}
|
}
|
||||||
LOGV("rsContextCreateGL ret %p ", rsc);
|
LOGV("%p rsContextCreateGL ret", rsc);
|
||||||
return rsc;
|
return rsc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user