Loading include/private/surfaceflinger/SharedBufferStack.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -80,6 +80,7 @@ public: // file need to be updated. // file need to be updated. static const unsigned int NUM_LAYERS_MAX = 31; static const unsigned int NUM_LAYERS_MAX = 31; static const unsigned int NUM_BUFFER_MAX = 16; static const unsigned int NUM_BUFFER_MAX = 16; static const unsigned int NUM_BUFFER_MIN = 2; static const unsigned int NUM_DISPLAY_MAX = 4; static const unsigned int NUM_DISPLAY_MAX = 4; struct Statistics { // 4 longs struct Statistics { // 4 longs Loading include/surfaceflinger/Surface.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -212,6 +212,7 @@ private: int dispatch_connect(va_list args); int dispatch_connect(va_list args); int dispatch_disconnect(va_list args); int dispatch_disconnect(va_list args); int dispatch_crop(va_list args); int dispatch_crop(va_list args); int dispatch_set_buffer_count(va_list args); void setUsage(uint32_t reqUsage); void setUsage(uint32_t reqUsage); int connect(int api); int connect(int api); Loading include/ui/egl/android_natives.h +22 −8 Original line number Original line Diff line number Diff line Loading @@ -81,6 +81,7 @@ enum { NATIVE_WINDOW_CONNECT, NATIVE_WINDOW_CONNECT, NATIVE_WINDOW_DISCONNECT, NATIVE_WINDOW_DISCONNECT, NATIVE_WINDOW_SET_CROP, NATIVE_WINDOW_SET_CROP, NATIVE_WINDOW_SET_BUFFER_COUNT, }; }; /* parameter for NATIVE_WINDOW_[DIS]CONNECT */ /* parameter for NATIVE_WINDOW_[DIS]CONNECT */ Loading Loading @@ -190,6 +191,7 @@ typedef struct android_native_window_t * NATIVE_WINDOW_CONNECT * NATIVE_WINDOW_CONNECT * NATIVE_WINDOW_DISCONNECT * NATIVE_WINDOW_DISCONNECT * NATIVE_WINDOW_SET_CROP * NATIVE_WINDOW_SET_CROP * NATIVE_WINDOW_SET_BUFFER_COUNT * * */ */ Loading @@ -201,8 +203,9 @@ typedef struct android_native_window_t /* /* * native_window_set_usage() sets the intended usage flags for the next * native_window_set_usage(..., usage) * buffers acquired with (*lockBuffer)() and on. * Sets the intended usage flags for the next buffers * acquired with (*lockBuffer)() and on. * By default (if this function is never called), a usage of * By default (if this function is never called), a usage of * GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE * GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE * is assumed. * is assumed. Loading @@ -217,8 +220,8 @@ static inline int native_window_set_usage( } } /* /* * native_window_connect(..., NATIVE_WINDOW_API_EGL) must be called * native_window_connect(..., NATIVE_WINDOW_API_EGL) * by EGL when the window is made current. * Must be called by EGL when the window is made current. * Returns -EINVAL if for some reason the window cannot be connected, which * Returns -EINVAL if for some reason the window cannot be connected, which * can happen if it's connected to some other API. * can happen if it's connected to some other API. */ */ Loading @@ -229,8 +232,8 @@ static inline int native_window_connect( } } /* /* * native_window_disconnect(..., NATIVE_WINDOW_API_EGL) must be called * native_window_disconnect(..., NATIVE_WINDOW_API_EGL) * by EGL when the window is made not current. * Must be called by EGL when the window is made not current. * An error is returned if for instance the window wasn't connected in the * An error is returned if for instance the window wasn't connected in the * first place. * first place. */ */ Loading @@ -241,8 +244,8 @@ static inline int native_window_disconnect( } } /* /* * native_window_set_crop(..., crop) sets which region of the next queued * native_window_set_crop(..., crop) * buffers needs to be considered. * Sets which region of the next queued buffers needs to be considered. * A buffer's crop region is scaled to match the surface's size. * A buffer's crop region is scaled to match the surface's size. * * * The specified crop region applies to all buffers queued after it is called. * The specified crop region applies to all buffers queued after it is called. Loading @@ -259,6 +262,17 @@ static inline int native_window_set_crop( return window->perform(window, NATIVE_WINDOW_SET_CROP, crop); return window->perform(window, NATIVE_WINDOW_SET_CROP, crop); } } /* * native_window_set_buffer_count(..., count) * Sets the number of buffers associated with this native window. */ static inline int native_window_set_buffer_count( android_native_window_t* window, size_t bufferCount) { return window->perform(window, NATIVE_WINDOW_SET_BUFFER_COUNT, bufferCount); } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- /* FIXME: this is legacy for pixmaps */ /* FIXME: this is legacy for pixmaps */ Loading libs/surfaceflinger_client/SharedBufferStack.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -463,6 +463,9 @@ status_t SharedBufferClient::setBufferCount( if (uint32_t(bufferCount) >= SharedBufferStack::NUM_BUFFER_MAX) if (uint32_t(bufferCount) >= SharedBufferStack::NUM_BUFFER_MAX) return BAD_VALUE; return BAD_VALUE; if (uint32_t(bufferCount) < SharedBufferStack::NUM_BUFFER_MIN) return BAD_VALUE; RWLock::AutoWLock _wr(mLock); RWLock::AutoWLock _wr(mLock); status_t err = ipc(bufferCount); status_t err = ipc(bufferCount); Loading libs/surfaceflinger_client/Surface.cpp +8 −1 Original line number Original line Diff line number Diff line Loading @@ -584,6 +584,9 @@ int Surface::perform(int operation, va_list args) case NATIVE_WINDOW_SET_CROP: case NATIVE_WINDOW_SET_CROP: res = dispatch_crop( args ); res = dispatch_crop( args ); break; break; case NATIVE_WINDOW_SET_BUFFER_COUNT: res = dispatch_set_buffer_count( args ); break; default: default: res = NAME_NOT_FOUND; res = NAME_NOT_FOUND; break; break; Loading @@ -607,6 +610,10 @@ int Surface::dispatch_crop(va_list args) { android_native_rect_t const* rect = va_arg(args, android_native_rect_t*); android_native_rect_t const* rect = va_arg(args, android_native_rect_t*); return crop( reinterpret_cast<Rect const*>(rect) ); return crop( reinterpret_cast<Rect const*>(rect) ); } } int Surface::dispatch_set_buffer_count(va_list args) { size_t bufferCount = va_arg(args, size_t); return setBufferCount(bufferCount); } void Surface::setUsage(uint32_t reqUsage) void Surface::setUsage(uint32_t reqUsage) Loading Loading @@ -856,7 +863,7 @@ status_t Surface::getBufferLocked(int index, int usage) currentBuffer->setIndex(index); currentBuffer->setIndex(index); } } } else { } else { err = err<0 ? err : NO_MEMORY; err = err<0 ? err : status_t(NO_MEMORY); } } } } return err; return err; Loading Loading
include/private/surfaceflinger/SharedBufferStack.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -80,6 +80,7 @@ public: // file need to be updated. // file need to be updated. static const unsigned int NUM_LAYERS_MAX = 31; static const unsigned int NUM_LAYERS_MAX = 31; static const unsigned int NUM_BUFFER_MAX = 16; static const unsigned int NUM_BUFFER_MAX = 16; static const unsigned int NUM_BUFFER_MIN = 2; static const unsigned int NUM_DISPLAY_MAX = 4; static const unsigned int NUM_DISPLAY_MAX = 4; struct Statistics { // 4 longs struct Statistics { // 4 longs Loading
include/surfaceflinger/Surface.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -212,6 +212,7 @@ private: int dispatch_connect(va_list args); int dispatch_connect(va_list args); int dispatch_disconnect(va_list args); int dispatch_disconnect(va_list args); int dispatch_crop(va_list args); int dispatch_crop(va_list args); int dispatch_set_buffer_count(va_list args); void setUsage(uint32_t reqUsage); void setUsage(uint32_t reqUsage); int connect(int api); int connect(int api); Loading
include/ui/egl/android_natives.h +22 −8 Original line number Original line Diff line number Diff line Loading @@ -81,6 +81,7 @@ enum { NATIVE_WINDOW_CONNECT, NATIVE_WINDOW_CONNECT, NATIVE_WINDOW_DISCONNECT, NATIVE_WINDOW_DISCONNECT, NATIVE_WINDOW_SET_CROP, NATIVE_WINDOW_SET_CROP, NATIVE_WINDOW_SET_BUFFER_COUNT, }; }; /* parameter for NATIVE_WINDOW_[DIS]CONNECT */ /* parameter for NATIVE_WINDOW_[DIS]CONNECT */ Loading Loading @@ -190,6 +191,7 @@ typedef struct android_native_window_t * NATIVE_WINDOW_CONNECT * NATIVE_WINDOW_CONNECT * NATIVE_WINDOW_DISCONNECT * NATIVE_WINDOW_DISCONNECT * NATIVE_WINDOW_SET_CROP * NATIVE_WINDOW_SET_CROP * NATIVE_WINDOW_SET_BUFFER_COUNT * * */ */ Loading @@ -201,8 +203,9 @@ typedef struct android_native_window_t /* /* * native_window_set_usage() sets the intended usage flags for the next * native_window_set_usage(..., usage) * buffers acquired with (*lockBuffer)() and on. * Sets the intended usage flags for the next buffers * acquired with (*lockBuffer)() and on. * By default (if this function is never called), a usage of * By default (if this function is never called), a usage of * GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE * GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE * is assumed. * is assumed. Loading @@ -217,8 +220,8 @@ static inline int native_window_set_usage( } } /* /* * native_window_connect(..., NATIVE_WINDOW_API_EGL) must be called * native_window_connect(..., NATIVE_WINDOW_API_EGL) * by EGL when the window is made current. * Must be called by EGL when the window is made current. * Returns -EINVAL if for some reason the window cannot be connected, which * Returns -EINVAL if for some reason the window cannot be connected, which * can happen if it's connected to some other API. * can happen if it's connected to some other API. */ */ Loading @@ -229,8 +232,8 @@ static inline int native_window_connect( } } /* /* * native_window_disconnect(..., NATIVE_WINDOW_API_EGL) must be called * native_window_disconnect(..., NATIVE_WINDOW_API_EGL) * by EGL when the window is made not current. * Must be called by EGL when the window is made not current. * An error is returned if for instance the window wasn't connected in the * An error is returned if for instance the window wasn't connected in the * first place. * first place. */ */ Loading @@ -241,8 +244,8 @@ static inline int native_window_disconnect( } } /* /* * native_window_set_crop(..., crop) sets which region of the next queued * native_window_set_crop(..., crop) * buffers needs to be considered. * Sets which region of the next queued buffers needs to be considered. * A buffer's crop region is scaled to match the surface's size. * A buffer's crop region is scaled to match the surface's size. * * * The specified crop region applies to all buffers queued after it is called. * The specified crop region applies to all buffers queued after it is called. Loading @@ -259,6 +262,17 @@ static inline int native_window_set_crop( return window->perform(window, NATIVE_WINDOW_SET_CROP, crop); return window->perform(window, NATIVE_WINDOW_SET_CROP, crop); } } /* * native_window_set_buffer_count(..., count) * Sets the number of buffers associated with this native window. */ static inline int native_window_set_buffer_count( android_native_window_t* window, size_t bufferCount) { return window->perform(window, NATIVE_WINDOW_SET_BUFFER_COUNT, bufferCount); } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- /* FIXME: this is legacy for pixmaps */ /* FIXME: this is legacy for pixmaps */ Loading
libs/surfaceflinger_client/SharedBufferStack.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -463,6 +463,9 @@ status_t SharedBufferClient::setBufferCount( if (uint32_t(bufferCount) >= SharedBufferStack::NUM_BUFFER_MAX) if (uint32_t(bufferCount) >= SharedBufferStack::NUM_BUFFER_MAX) return BAD_VALUE; return BAD_VALUE; if (uint32_t(bufferCount) < SharedBufferStack::NUM_BUFFER_MIN) return BAD_VALUE; RWLock::AutoWLock _wr(mLock); RWLock::AutoWLock _wr(mLock); status_t err = ipc(bufferCount); status_t err = ipc(bufferCount); Loading
libs/surfaceflinger_client/Surface.cpp +8 −1 Original line number Original line Diff line number Diff line Loading @@ -584,6 +584,9 @@ int Surface::perform(int operation, va_list args) case NATIVE_WINDOW_SET_CROP: case NATIVE_WINDOW_SET_CROP: res = dispatch_crop( args ); res = dispatch_crop( args ); break; break; case NATIVE_WINDOW_SET_BUFFER_COUNT: res = dispatch_set_buffer_count( args ); break; default: default: res = NAME_NOT_FOUND; res = NAME_NOT_FOUND; break; break; Loading @@ -607,6 +610,10 @@ int Surface::dispatch_crop(va_list args) { android_native_rect_t const* rect = va_arg(args, android_native_rect_t*); android_native_rect_t const* rect = va_arg(args, android_native_rect_t*); return crop( reinterpret_cast<Rect const*>(rect) ); return crop( reinterpret_cast<Rect const*>(rect) ); } } int Surface::dispatch_set_buffer_count(va_list args) { size_t bufferCount = va_arg(args, size_t); return setBufferCount(bufferCount); } void Surface::setUsage(uint32_t reqUsage) void Surface::setUsage(uint32_t reqUsage) Loading Loading @@ -856,7 +863,7 @@ status_t Surface::getBufferLocked(int index, int usage) currentBuffer->setIndex(index); currentBuffer->setIndex(index); } } } else { } else { err = err<0 ? err : NO_MEMORY; err = err<0 ? err : status_t(NO_MEMORY); } } } } return err; return err; Loading