Loading services/surfaceflinger/DisplayHardware/HWComposer.cpp +2 −12 Original line number Original line Diff line number Diff line Loading @@ -39,8 +39,6 @@ #include <cutils/log.h> #include <cutils/log.h> #include <cutils/properties.h> #include <cutils/properties.h> #include <EGL/egl.h> #include "Layer.h" // needed only for debugging #include "Layer.h" // needed only for debugging #include "LayerBase.h" #include "LayerBase.h" #include "HWComposer.h" #include "HWComposer.h" Loading Loading @@ -108,7 +106,6 @@ HWComposer::HWComposer( : mFlinger(flinger), : mFlinger(flinger), mModule(0), mHwc(0), mList(0), mCapacity(0), mModule(0), mHwc(0), mList(0), mCapacity(0), mNumOVLayers(0), mNumFBLayers(0), mNumOVLayers(0), mNumFBLayers(0), mDpy(EGL_NO_DISPLAY), mSur(EGL_NO_SURFACE), mCBContext(new cb_context), mCBContext(new cb_context), mEventHandler(handler), mEventHandler(handler), mRefreshPeriod(refreshPeriod), mRefreshPeriod(refreshPeriod), Loading Loading @@ -207,11 +204,6 @@ void HWComposer::eventControl(int event, int enabled) { } } } } void HWComposer::setFrameBuffer(EGLDisplay dpy, EGLSurface sur) { mDpy = (hwc_display_t)dpy; mSur = (hwc_surface_t)sur; } status_t HWComposer::createWorkList(size_t numLayers) { status_t HWComposer::createWorkList(size_t numLayers) { if (mHwc) { if (mHwc) { if (!mList || mCapacity < numLayers) { if (!mList || mCapacity < numLayers) { Loading Loading @@ -270,15 +262,13 @@ size_t HWComposer::getLayerCount(int type) const { return 0; return 0; } } status_t HWComposer::commit() const { status_t HWComposer::commit(void* fbDisplay, void* fbSurface) const { int err = NO_ERROR; int err = NO_ERROR; if (mHwc) { if (mHwc) { err = mHwc->set(mHwc, mDpy, mSur, mList); err = mHwc->set(mHwc, fbDisplay, fbSurface, mList); if (mList) { if (mList) { mList->flags &= ~HWC_GEOMETRY_CHANGED; mList->flags &= ~HWC_GEOMETRY_CHANGED; } } } else { eglSwapBuffers(mDpy, mSur); } } return (status_t)err; return (status_t)err; } } Loading services/surfaceflinger/DisplayHardware/HWComposer.h +1 −8 Original line number Original line Diff line number Diff line Loading @@ -20,8 +20,6 @@ #include <stdint.h> #include <stdint.h> #include <sys/types.h> #include <sys/types.h> #include <EGL/egl.h> #include <hardware/hwcomposer_defs.h> #include <hardware/hwcomposer_defs.h> #include <utils/Condition.h> #include <utils/Condition.h> Loading Loading @@ -63,9 +61,6 @@ public: status_t initCheck() const; status_t initCheck() const; // tells the HAL what the framebuffer is void setFrameBuffer(EGLDisplay dpy, EGLSurface sur); // Asks the HAL what it can do // Asks the HAL what it can do status_t prepare() const; status_t prepare() const; Loading @@ -73,7 +68,7 @@ public: status_t disable(); status_t disable(); // commits the list // commits the list status_t commit() const; status_t commit(void* fbDisplay, void* fbSurface) const; // release hardware resources and blank screen // release hardware resources and blank screen status_t release() const; status_t release() const; Loading Loading @@ -234,8 +229,6 @@ private: size_t mCapacity; size_t mCapacity; mutable size_t mNumOVLayers; mutable size_t mNumOVLayers; mutable size_t mNumFBLayers; mutable size_t mNumFBLayers; EGLDisplay mDpy; EGLSurface mSur; cb_context* mCBContext; cb_context* mCBContext; EventHandler& mEventHandler; EventHandler& mEventHandler; nsecs_t mRefreshPeriod; nsecs_t mRefreshPeriod; Loading services/surfaceflinger/SurfaceFlinger.cpp +7 −9 Original line number Original line Diff line number Diff line Loading @@ -363,8 +363,8 @@ status_t SurfaceFlinger::readyToRun() "Initializing graphics H/W..."); "Initializing graphics H/W..."); // initialize EGL // initialize EGL EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); mEGLDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(display, NULL, NULL); eglInitialize(mEGLDisplay, NULL, NULL); // Initialize the main display // Initialize the main display // create native window to main display // create native window to main display Loading @@ -378,8 +378,8 @@ status_t SurfaceFlinger::readyToRun() // initialize the config and context // initialize the config and context int format; int format; window->query(window, NATIVE_WINDOW_FORMAT, &format); window->query(window, NATIVE_WINDOW_FORMAT, &format); mEGLConfig = selectEGLConfig(display, format); mEGLConfig = selectEGLConfig(mEGLDisplay, format); mEGLContext = createGLContext(display, mEGLConfig); mEGLContext = createGLContext(mEGLDisplay, mEGLConfig); // initialize our main display hardware // initialize our main display hardware DisplayHardware* const hw = new DisplayHardware(this, 0, anw, mEGLConfig); DisplayHardware* const hw = new DisplayHardware(this, 0, anw, mEGLConfig); Loading @@ -387,7 +387,7 @@ status_t SurfaceFlinger::readyToRun() // initialize OpenGL ES // initialize OpenGL ES EGLSurface surface = hw->getEGLSurface(); EGLSurface surface = hw->getEGLSurface(); initializeGL(display, surface); initializeGL(mEGLDisplay, surface); // start the EventThread // start the EventThread mEventThread = new EventThread(this); mEventThread = new EventThread(this); Loading @@ -397,9 +397,6 @@ status_t SurfaceFlinger::readyToRun() mHwc = new HWComposer(this, mHwc = new HWComposer(this, *static_cast<HWComposer::EventHandler *>(this), *static_cast<HWComposer::EventHandler *>(this), hw->getRefreshPeriod()); hw->getRefreshPeriod()); if (mHwc->initCheck() == NO_ERROR) { mHwc->setFrameBuffer(display, surface); } // We're now ready to accept clients... // We're now ready to accept clients... mReadyToRunBarrier.open(); mReadyToRunBarrier.open(); Loading Loading @@ -733,15 +730,16 @@ void SurfaceFlinger::postFramebuffer() } } hw.flip(mSwapRegion); hw.flip(mSwapRegion); hwc.commit(); if (hwc.initCheck() == NO_ERROR) { if (hwc.initCheck() == NO_ERROR) { hwc.commit(mEGLDisplay, hw.getEGLSurface()); HWComposer::LayerListIterator cur = hwc.begin(); HWComposer::LayerListIterator cur = hwc.begin(); const HWComposer::LayerListIterator end = hwc.end(); const HWComposer::LayerListIterator end = hwc.end(); for (size_t i = 0; cur != end && i < numLayers; ++i, ++cur) { for (size_t i = 0; cur != end && i < numLayers; ++i, ++cur) { layers[i]->onLayerDisplayed(&*cur); layers[i]->onLayerDisplayed(&*cur); } } } else { } else { eglSwapBuffers(mEGLDisplay, hw.getEGLSurface()); for (size_t i = 0; i < numLayers; i++) { for (size_t i = 0; i < numLayers; i++) { layers[i]->onLayerDisplayed(NULL); layers[i]->onLayerDisplayed(NULL); } } Loading services/surfaceflinger/SurfaceFlinger.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -390,6 +390,7 @@ private: GLint mMaxTextureSize; GLint mMaxTextureSize; EGLContext mEGLContext; EGLContext mEGLContext; EGLConfig mEGLConfig; EGLConfig mEGLConfig; EGLDisplay mEGLDisplay; // Can only accessed from the main thread, these members // Can only accessed from the main thread, these members // don't need synchronization // don't need synchronization Loading Loading
services/surfaceflinger/DisplayHardware/HWComposer.cpp +2 −12 Original line number Original line Diff line number Diff line Loading @@ -39,8 +39,6 @@ #include <cutils/log.h> #include <cutils/log.h> #include <cutils/properties.h> #include <cutils/properties.h> #include <EGL/egl.h> #include "Layer.h" // needed only for debugging #include "Layer.h" // needed only for debugging #include "LayerBase.h" #include "LayerBase.h" #include "HWComposer.h" #include "HWComposer.h" Loading Loading @@ -108,7 +106,6 @@ HWComposer::HWComposer( : mFlinger(flinger), : mFlinger(flinger), mModule(0), mHwc(0), mList(0), mCapacity(0), mModule(0), mHwc(0), mList(0), mCapacity(0), mNumOVLayers(0), mNumFBLayers(0), mNumOVLayers(0), mNumFBLayers(0), mDpy(EGL_NO_DISPLAY), mSur(EGL_NO_SURFACE), mCBContext(new cb_context), mCBContext(new cb_context), mEventHandler(handler), mEventHandler(handler), mRefreshPeriod(refreshPeriod), mRefreshPeriod(refreshPeriod), Loading Loading @@ -207,11 +204,6 @@ void HWComposer::eventControl(int event, int enabled) { } } } } void HWComposer::setFrameBuffer(EGLDisplay dpy, EGLSurface sur) { mDpy = (hwc_display_t)dpy; mSur = (hwc_surface_t)sur; } status_t HWComposer::createWorkList(size_t numLayers) { status_t HWComposer::createWorkList(size_t numLayers) { if (mHwc) { if (mHwc) { if (!mList || mCapacity < numLayers) { if (!mList || mCapacity < numLayers) { Loading Loading @@ -270,15 +262,13 @@ size_t HWComposer::getLayerCount(int type) const { return 0; return 0; } } status_t HWComposer::commit() const { status_t HWComposer::commit(void* fbDisplay, void* fbSurface) const { int err = NO_ERROR; int err = NO_ERROR; if (mHwc) { if (mHwc) { err = mHwc->set(mHwc, mDpy, mSur, mList); err = mHwc->set(mHwc, fbDisplay, fbSurface, mList); if (mList) { if (mList) { mList->flags &= ~HWC_GEOMETRY_CHANGED; mList->flags &= ~HWC_GEOMETRY_CHANGED; } } } else { eglSwapBuffers(mDpy, mSur); } } return (status_t)err; return (status_t)err; } } Loading
services/surfaceflinger/DisplayHardware/HWComposer.h +1 −8 Original line number Original line Diff line number Diff line Loading @@ -20,8 +20,6 @@ #include <stdint.h> #include <stdint.h> #include <sys/types.h> #include <sys/types.h> #include <EGL/egl.h> #include <hardware/hwcomposer_defs.h> #include <hardware/hwcomposer_defs.h> #include <utils/Condition.h> #include <utils/Condition.h> Loading Loading @@ -63,9 +61,6 @@ public: status_t initCheck() const; status_t initCheck() const; // tells the HAL what the framebuffer is void setFrameBuffer(EGLDisplay dpy, EGLSurface sur); // Asks the HAL what it can do // Asks the HAL what it can do status_t prepare() const; status_t prepare() const; Loading @@ -73,7 +68,7 @@ public: status_t disable(); status_t disable(); // commits the list // commits the list status_t commit() const; status_t commit(void* fbDisplay, void* fbSurface) const; // release hardware resources and blank screen // release hardware resources and blank screen status_t release() const; status_t release() const; Loading Loading @@ -234,8 +229,6 @@ private: size_t mCapacity; size_t mCapacity; mutable size_t mNumOVLayers; mutable size_t mNumOVLayers; mutable size_t mNumFBLayers; mutable size_t mNumFBLayers; EGLDisplay mDpy; EGLSurface mSur; cb_context* mCBContext; cb_context* mCBContext; EventHandler& mEventHandler; EventHandler& mEventHandler; nsecs_t mRefreshPeriod; nsecs_t mRefreshPeriod; Loading
services/surfaceflinger/SurfaceFlinger.cpp +7 −9 Original line number Original line Diff line number Diff line Loading @@ -363,8 +363,8 @@ status_t SurfaceFlinger::readyToRun() "Initializing graphics H/W..."); "Initializing graphics H/W..."); // initialize EGL // initialize EGL EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); mEGLDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(display, NULL, NULL); eglInitialize(mEGLDisplay, NULL, NULL); // Initialize the main display // Initialize the main display // create native window to main display // create native window to main display Loading @@ -378,8 +378,8 @@ status_t SurfaceFlinger::readyToRun() // initialize the config and context // initialize the config and context int format; int format; window->query(window, NATIVE_WINDOW_FORMAT, &format); window->query(window, NATIVE_WINDOW_FORMAT, &format); mEGLConfig = selectEGLConfig(display, format); mEGLConfig = selectEGLConfig(mEGLDisplay, format); mEGLContext = createGLContext(display, mEGLConfig); mEGLContext = createGLContext(mEGLDisplay, mEGLConfig); // initialize our main display hardware // initialize our main display hardware DisplayHardware* const hw = new DisplayHardware(this, 0, anw, mEGLConfig); DisplayHardware* const hw = new DisplayHardware(this, 0, anw, mEGLConfig); Loading @@ -387,7 +387,7 @@ status_t SurfaceFlinger::readyToRun() // initialize OpenGL ES // initialize OpenGL ES EGLSurface surface = hw->getEGLSurface(); EGLSurface surface = hw->getEGLSurface(); initializeGL(display, surface); initializeGL(mEGLDisplay, surface); // start the EventThread // start the EventThread mEventThread = new EventThread(this); mEventThread = new EventThread(this); Loading @@ -397,9 +397,6 @@ status_t SurfaceFlinger::readyToRun() mHwc = new HWComposer(this, mHwc = new HWComposer(this, *static_cast<HWComposer::EventHandler *>(this), *static_cast<HWComposer::EventHandler *>(this), hw->getRefreshPeriod()); hw->getRefreshPeriod()); if (mHwc->initCheck() == NO_ERROR) { mHwc->setFrameBuffer(display, surface); } // We're now ready to accept clients... // We're now ready to accept clients... mReadyToRunBarrier.open(); mReadyToRunBarrier.open(); Loading Loading @@ -733,15 +730,16 @@ void SurfaceFlinger::postFramebuffer() } } hw.flip(mSwapRegion); hw.flip(mSwapRegion); hwc.commit(); if (hwc.initCheck() == NO_ERROR) { if (hwc.initCheck() == NO_ERROR) { hwc.commit(mEGLDisplay, hw.getEGLSurface()); HWComposer::LayerListIterator cur = hwc.begin(); HWComposer::LayerListIterator cur = hwc.begin(); const HWComposer::LayerListIterator end = hwc.end(); const HWComposer::LayerListIterator end = hwc.end(); for (size_t i = 0; cur != end && i < numLayers; ++i, ++cur) { for (size_t i = 0; cur != end && i < numLayers; ++i, ++cur) { layers[i]->onLayerDisplayed(&*cur); layers[i]->onLayerDisplayed(&*cur); } } } else { } else { eglSwapBuffers(mEGLDisplay, hw.getEGLSurface()); for (size_t i = 0; i < numLayers; i++) { for (size_t i = 0; i < numLayers; i++) { layers[i]->onLayerDisplayed(NULL); layers[i]->onLayerDisplayed(NULL); } } Loading
services/surfaceflinger/SurfaceFlinger.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -390,6 +390,7 @@ private: GLint mMaxTextureSize; GLint mMaxTextureSize; EGLContext mEGLContext; EGLContext mEGLContext; EGLConfig mEGLConfig; EGLConfig mEGLConfig; EGLDisplay mEGLDisplay; // Can only accessed from the main thread, these members // Can only accessed from the main thread, these members // don't need synchronization // don't need synchronization Loading