Loading libs/gui/include/gui/SurfaceControl.h +6 −3 Original line number Diff line number Diff line Loading @@ -84,9 +84,6 @@ public: explicit SurfaceControl(const sp<SurfaceControl>& other); SurfaceControl(const sp<SurfaceComposerClient>& client, const sp<IBinder>& handle, const sp<IGraphicBufferProducer>& gbp, bool owned); private: // can't be copied SurfaceControl& operator = (SurfaceControl& rhs); Loading @@ -95,6 +92,12 @@ private: friend class SurfaceComposerClient; friend class Surface; SurfaceControl( const sp<SurfaceComposerClient>& client, const sp<IBinder>& handle, const sp<IGraphicBufferProducer>& gbp, bool owned); ~SurfaceControl(); sp<Surface> generateSurfaceLocked() const; Loading opengl/libs/EGL/egl_display.cpp +0 −47 Original line number Diff line number Diff line Loading @@ -339,53 +339,6 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) { if ((cnx->major == 1) && (cnx->minor == 5)) { mVersionString = sVersionString15; cnx->driverVersion = EGL_MAKE_VERSION(1, 5, 0); } else if ((cnx->major == 1) && (cnx->minor == 4)) { /* Querying extension strings for type Client */ std::string typesExtString; static const char* clientExtensions = cnx->egl.eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); if (clientExtensions != nullptr && strlen(clientExtensions) > 0) { typesExtString.append(clientExtensions); typesExtString.append(" "); } /* Adding extension strings for type Display */ typesExtString.append(disp.queryString.extensions); mVersionString = sVersionString14; // Extensions needed for an EGL 1.4 implementation to be // able to support EGL 1.5 functionality std::vector<const char*> egl15extensions = { "EGL_EXT_client_extensions", // "EGL_EXT_platform_base", // implemented by EGL runtime "EGL_KHR_image_base", "EGL_KHR_fence_sync", "EGL_KHR_wait_sync", "EGL_KHR_create_context", "EGL_EXT_create_context_robustness", "EGL_KHR_gl_colorspace", "EGL_ANDROID_native_fence_sync", }; bool extensionsFound = true; for (const auto& name : egl15extensions) { extensionsFound &= findExtension(typesExtString.c_str(), name); ALOGV("Extension %s: %s", name, findExtension(typesExtString.c_str(), name) ? "Found" : "Missing"); } // NOTE: From the spec: // Creation of fence sync objects requires support from the bound // client API, and will not succeed unless the client API satisfies: // client API is OpenGL ES, and either the OpenGL ES version is 3.0 // or greater, or the GL_OES_EGL_sync extension is supported. // We don't have a way to check the GL_EXTENSIONS string at this // point in the code, assume that GL_OES_EGL_sync is supported // because EGL_KHR_fence_sync is supported (as verified above). if (extensionsFound) { // Have everything needed to emulate EGL 1.5 so report EGL 1.5 // to the application. mVersionString = sVersionString15; cnx->major = 1; cnx->minor = 5; } } if (mVersionString.empty()) { ALOGW("Unexpected driver version: %d.%d, want 1.4 or 1.5", cnx->major, cnx->minor); Loading services/sensorservice/SensorDevice.cpp +8 −4 Original line number Diff line number Diff line Loading @@ -579,8 +579,7 @@ status_t SensorDevice::activateLocked(void* ident, int handle, int enabled) { } if (info.batchParams.indexOfKey(ident) >= 0) { if (info.numActiveClients() == 1) { // This is the first connection, we need to activate the underlying h/w sensor. if (info.numActiveClients() > 0 && !info.isActive) { actuateHardware = true; } } else { Loading Loading @@ -631,6 +630,11 @@ status_t SensorDevice::activateLocked(void* ident, int handle, int enabled) { if (err != NO_ERROR && enabled) { // Failure when enabling the sensor. Clean up on failure. info.removeBatchParamsForIdent(ident); } else { // Update the isActive flag if there is no error. If there is an error when disabling a // sensor, still set the flag to false since the batch parameters have already been // removed. This ensures that everything remains in-sync. info.isActive = enabled; } } Loading services/sensorservice/SensorDevice.h +3 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,9 @@ private: // requested by the client. KeyedVector<void*, BatchParams> batchParams; // Flag to track if the sensor is active bool isActive = false; // Sets batch parameters for this ident. Returns error if this ident is not already present // in the KeyedVector above. status_t setBatchParamsForIdent(void* ident, int flags, int64_t samplingPeriodNs, Loading services/surfaceflinger/Client.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -76,9 +76,18 @@ status_t Client::createSurface(const String8& name, uint32_t w, uint32_t h, Pixe uint32_t flags, const sp<IBinder>& parentHandle, LayerMetadata metadata, sp<IBinder>* handle, sp<IGraphicBufferProducer>* gbp) { sp<Layer> parent = nullptr; if (parentHandle != nullptr) { auto layerHandle = reinterpret_cast<Layer::Handle*>(parentHandle.get()); parent = layerHandle->owner.promote(); if (parent == nullptr) { return NAME_NOT_FOUND; } } // We rely on createLayer to check permissions. return mFlinger->createLayer(name, this, w, h, format, flags, std::move(metadata), handle, gbp, parentHandle); &parent); } status_t Client::createWithSurfaceParent(const String8& name, uint32_t w, uint32_t h, Loading Loading
libs/gui/include/gui/SurfaceControl.h +6 −3 Original line number Diff line number Diff line Loading @@ -84,9 +84,6 @@ public: explicit SurfaceControl(const sp<SurfaceControl>& other); SurfaceControl(const sp<SurfaceComposerClient>& client, const sp<IBinder>& handle, const sp<IGraphicBufferProducer>& gbp, bool owned); private: // can't be copied SurfaceControl& operator = (SurfaceControl& rhs); Loading @@ -95,6 +92,12 @@ private: friend class SurfaceComposerClient; friend class Surface; SurfaceControl( const sp<SurfaceComposerClient>& client, const sp<IBinder>& handle, const sp<IGraphicBufferProducer>& gbp, bool owned); ~SurfaceControl(); sp<Surface> generateSurfaceLocked() const; Loading
opengl/libs/EGL/egl_display.cpp +0 −47 Original line number Diff line number Diff line Loading @@ -339,53 +339,6 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) { if ((cnx->major == 1) && (cnx->minor == 5)) { mVersionString = sVersionString15; cnx->driverVersion = EGL_MAKE_VERSION(1, 5, 0); } else if ((cnx->major == 1) && (cnx->minor == 4)) { /* Querying extension strings for type Client */ std::string typesExtString; static const char* clientExtensions = cnx->egl.eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); if (clientExtensions != nullptr && strlen(clientExtensions) > 0) { typesExtString.append(clientExtensions); typesExtString.append(" "); } /* Adding extension strings for type Display */ typesExtString.append(disp.queryString.extensions); mVersionString = sVersionString14; // Extensions needed for an EGL 1.4 implementation to be // able to support EGL 1.5 functionality std::vector<const char*> egl15extensions = { "EGL_EXT_client_extensions", // "EGL_EXT_platform_base", // implemented by EGL runtime "EGL_KHR_image_base", "EGL_KHR_fence_sync", "EGL_KHR_wait_sync", "EGL_KHR_create_context", "EGL_EXT_create_context_robustness", "EGL_KHR_gl_colorspace", "EGL_ANDROID_native_fence_sync", }; bool extensionsFound = true; for (const auto& name : egl15extensions) { extensionsFound &= findExtension(typesExtString.c_str(), name); ALOGV("Extension %s: %s", name, findExtension(typesExtString.c_str(), name) ? "Found" : "Missing"); } // NOTE: From the spec: // Creation of fence sync objects requires support from the bound // client API, and will not succeed unless the client API satisfies: // client API is OpenGL ES, and either the OpenGL ES version is 3.0 // or greater, or the GL_OES_EGL_sync extension is supported. // We don't have a way to check the GL_EXTENSIONS string at this // point in the code, assume that GL_OES_EGL_sync is supported // because EGL_KHR_fence_sync is supported (as verified above). if (extensionsFound) { // Have everything needed to emulate EGL 1.5 so report EGL 1.5 // to the application. mVersionString = sVersionString15; cnx->major = 1; cnx->minor = 5; } } if (mVersionString.empty()) { ALOGW("Unexpected driver version: %d.%d, want 1.4 or 1.5", cnx->major, cnx->minor); Loading
services/sensorservice/SensorDevice.cpp +8 −4 Original line number Diff line number Diff line Loading @@ -579,8 +579,7 @@ status_t SensorDevice::activateLocked(void* ident, int handle, int enabled) { } if (info.batchParams.indexOfKey(ident) >= 0) { if (info.numActiveClients() == 1) { // This is the first connection, we need to activate the underlying h/w sensor. if (info.numActiveClients() > 0 && !info.isActive) { actuateHardware = true; } } else { Loading Loading @@ -631,6 +630,11 @@ status_t SensorDevice::activateLocked(void* ident, int handle, int enabled) { if (err != NO_ERROR && enabled) { // Failure when enabling the sensor. Clean up on failure. info.removeBatchParamsForIdent(ident); } else { // Update the isActive flag if there is no error. If there is an error when disabling a // sensor, still set the flag to false since the batch parameters have already been // removed. This ensures that everything remains in-sync. info.isActive = enabled; } } Loading
services/sensorservice/SensorDevice.h +3 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,9 @@ private: // requested by the client. KeyedVector<void*, BatchParams> batchParams; // Flag to track if the sensor is active bool isActive = false; // Sets batch parameters for this ident. Returns error if this ident is not already present // in the KeyedVector above. status_t setBatchParamsForIdent(void* ident, int flags, int64_t samplingPeriodNs, Loading
services/surfaceflinger/Client.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -76,9 +76,18 @@ status_t Client::createSurface(const String8& name, uint32_t w, uint32_t h, Pixe uint32_t flags, const sp<IBinder>& parentHandle, LayerMetadata metadata, sp<IBinder>* handle, sp<IGraphicBufferProducer>* gbp) { sp<Layer> parent = nullptr; if (parentHandle != nullptr) { auto layerHandle = reinterpret_cast<Layer::Handle*>(parentHandle.get()); parent = layerHandle->owner.promote(); if (parent == nullptr) { return NAME_NOT_FOUND; } } // We rely on createLayer to check permissions. return mFlinger->createLayer(name, this, w, h, format, flags, std::move(metadata), handle, gbp, parentHandle); &parent); } status_t Client::createWithSurfaceParent(const String8& name, uint32_t w, uint32_t h, Loading