Loading include/input/InputEventLabels.h +5 −6 Original line number Diff line number Diff line Loading @@ -405,13 +405,12 @@ static const InputEventLabel LEDS[] = { { nullptr, 0 } }; static const InputEventLabel FLAGS[] = { DEFINE_FLAG(VIRTUAL), static const InputEventLabel FLAGS[] = {DEFINE_FLAG(VIRTUAL), DEFINE_FLAG(FUNCTION), DEFINE_FLAG(GESTURE), DEFINE_FLAG(WAKE), { nullptr, 0 } }; {nullptr, 0}}; static int lookupValueByLabel(const char* literal, const InputEventLabel *list) { while (list->literal) { Loading libs/gui/ISurfaceComposer.cpp +151 −0 Original line number Diff line number Diff line Loading @@ -525,6 +525,88 @@ public: return static_cast<status_t>(reply.readInt32()); } virtual status_t getAutoLowLatencyModeSupport(const sp<IBinder>& display, bool* outSupport) const { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); status_t result = data.writeStrongBinder(display); if (result != NO_ERROR) { ALOGE("getAutoLowLatencyModeSupport failed to writeStrongBinder: %d", result); return result; } result = remote()->transact(BnSurfaceComposer::GET_AUTO_LOW_LATENCY_MODE_SUPPORT, data, &reply); if (result != NO_ERROR) { ALOGE("getAutoLowLatencyModeSupport failed to transact: %d", result); return result; } return reply.readBool(outSupport); } virtual void setAutoLowLatencyMode(const sp<IBinder>& display, bool on) { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { ALOGE("setAutoLowLatencyMode failed to writeInterfaceToken: %d", result); return; } result = data.writeStrongBinder(display); if (result != NO_ERROR) { ALOGE("setAutoLowLatencyMode failed to writeStrongBinder: %d", result); return; } result = data.writeBool(on); if (result != NO_ERROR) { ALOGE("setAutoLowLatencyMode failed to writeBool: %d", result); return; } result = remote()->transact(BnSurfaceComposer::SET_AUTO_LOW_LATENCY_MODE, data, &reply); if (result != NO_ERROR) { ALOGE("setAutoLowLatencyMode failed to transact: %d", result); return; } } virtual status_t getGameContentTypeSupport(const sp<IBinder>& display, bool* outSupport) const { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); status_t result = data.writeStrongBinder(display); if (result != NO_ERROR) { ALOGE("getGameContentTypeSupport failed to writeStrongBinder: %d", result); return result; } result = remote()->transact(BnSurfaceComposer::GET_GAME_CONTENT_TYPE_SUPPORT, data, &reply); if (result != NO_ERROR) { ALOGE("getGameContentTypeSupport failed to transact: %d", result); return result; } return reply.readBool(outSupport); } virtual void setGameContentType(const sp<IBinder>& display, bool on) { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { ALOGE("setGameContentType failed to writeInterfaceToken: %d", result); return; } result = data.writeStrongBinder(display); if (result != NO_ERROR) { ALOGE("setGameContentType failed to writeStrongBinder: %d", result); return; } result = data.writeBool(on); if (result != NO_ERROR) { ALOGE("setGameContentType failed to writeBool: %d", result); return; } result = remote()->transact(BnSurfaceComposer::SET_GAME_CONTENT_TYPE, data, &reply); if (result != NO_ERROR) { ALOGE("setGameContentType failed to transact: %d", result); } } virtual status_t clearAnimationFrameStats() { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); Loading Loading @@ -1407,6 +1489,75 @@ status_t BnSurfaceComposer::onTransact( result = reply->writeInt32(result); return result; } case GET_AUTO_LOW_LATENCY_MODE_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> display = nullptr; status_t result = data.readStrongBinder(&display); if (result != NO_ERROR) { ALOGE("getAutoLowLatencyModeSupport failed to readStrongBinder: %d", result); return result; } bool supported = false; result = getAutoLowLatencyModeSupport(display, &supported); if (result == NO_ERROR) { result = reply->writeBool(supported); } return result; } case SET_AUTO_LOW_LATENCY_MODE: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> display = nullptr; status_t result = data.readStrongBinder(&display); if (result != NO_ERROR) { ALOGE("setAutoLowLatencyMode failed to readStrongBinder: %d", result); return result; } bool setAllm = false; result = data.readBool(&setAllm); if (result != NO_ERROR) { ALOGE("setAutoLowLatencyMode failed to readBool: %d", result); return result; } setAutoLowLatencyMode(display, setAllm); return result; } case GET_GAME_CONTENT_TYPE_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> display = nullptr; status_t result = data.readStrongBinder(&display); if (result != NO_ERROR) { ALOGE("getGameContentTypeSupport failed to readStrongBinder: %d", result); return result; } bool supported = false; result = getGameContentTypeSupport(display, &supported); if (result == NO_ERROR) { result = reply->writeBool(supported); } return result; } case SET_GAME_CONTENT_TYPE: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> display = nullptr; status_t result = data.readStrongBinder(&display); if (result != NO_ERROR) { ALOGE("setGameContentType failed to readStrongBinder: %d", result); return result; } bool setGameContentTypeOn = false; result = data.readBool(&setGameContentTypeOn); if (result != NO_ERROR) { ALOGE("setGameContentType failed to readBool: %d", result); return result; } setGameContentType(display, setGameContentTypeOn); return result; } case CLEAR_ANIMATION_FRAME_STATS: { CHECK_INTERFACE(ISurfaceComposer, data, reply); status_t result = clearAnimationFrameStats(); Loading libs/gui/SurfaceComposerClient.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -1656,6 +1656,26 @@ status_t SurfaceComposerClient::setActiveColorMode(const sp<IBinder>& display, return ComposerService::getComposerService()->setActiveColorMode(display, colorMode); } bool SurfaceComposerClient::getAutoLowLatencyModeSupport(const sp<IBinder>& display) { bool supported = false; ComposerService::getComposerService()->getAutoLowLatencyModeSupport(display, &supported); return supported; } void SurfaceComposerClient::setAutoLowLatencyMode(const sp<IBinder>& display, bool on) { ComposerService::getComposerService()->setAutoLowLatencyMode(display, on); } bool SurfaceComposerClient::getGameContentTypeSupport(const sp<IBinder>& display) { bool supported = false; ComposerService::getComposerService()->getGameContentTypeSupport(display, &supported); return supported; } void SurfaceComposerClient::setGameContentType(const sp<IBinder>& display, bool on) { ComposerService::getComposerService()->setGameContentType(display, on); } void SurfaceComposerClient::setDisplayPowerMode(const sp<IBinder>& token, int mode) { ComposerService::getComposerService()->setPowerMode(token, mode); Loading libs/gui/include/gui/IGraphicBufferProducer.h +29 −30 Original line number Diff line number Diff line Loading @@ -286,36 +286,6 @@ public: virtual status_t attachBuffer(int* outSlot, const sp<GraphicBuffer>& buffer) = 0; // queueBuffer indicates that the client has finished filling in the // contents of the buffer associated with slot and transfers ownership of // that slot back to the server. // // It is not valid to call queueBuffer on a slot that is not owned // by the client or one for which a buffer associated via requestBuffer // (an attempt to do so will fail with a return value of BAD_VALUE). // // In addition, the input must be described by the client (as documented // below). Any other properties (zero point, etc) // are client-dependent, and should be documented by the client. // // The slot must be in the range of [0, NUM_BUFFER_SLOTS). // // Upon success, the output will be filled with meaningful values // (refer to the documentation below). // // Return of a value other than NO_ERROR means an error has occurred: // * NO_INIT - the buffer queue has been abandoned or the producer is not // connected. // * BAD_VALUE - one of the below conditions occurred: // * fence was NULL // * scaling mode was unknown // * both in async mode and buffer count was less than the // max numbers of buffers that can be allocated at once // * slot index was out of range (see above). // * the slot was not in the dequeued state // * the slot was enqueued without requesting a buffer // * crop rect is out of bounds of the buffer dimensions struct QueueBufferInput : public Flattenable<QueueBufferInput> { friend class Flattenable<QueueBufferInput>; explicit inline QueueBufferInput(const Parcel& parcel); Loading Loading @@ -415,6 +385,35 @@ public: int maxBufferCount{0}; }; // queueBuffer indicates that the client has finished filling in the // contents of the buffer associated with slot and transfers ownership of // that slot back to the server. // // It is not valid to call queueBuffer on a slot that is not owned // by the client or one for which a buffer associated via requestBuffer // (an attempt to do so will fail with a return value of BAD_VALUE). // // In addition, the input must be described by the client (as documented // below). Any other properties (zero point, etc) // are client-dependent, and should be documented by the client. // // The slot must be in the range of [0, NUM_BUFFER_SLOTS). // // Upon success, the output will be filled with meaningful values // (refer to the documentation below). // // Return of a value other than NO_ERROR means an error has occurred: // * NO_INIT - the buffer queue has been abandoned or the producer is not // connected. // * BAD_VALUE - one of the below conditions occurred: // * fence was NULL // * scaling mode was unknown // * both in async mode and buffer count was less than the // max numbers of buffers that can be allocated at once // * slot index was out of range (see above). // * the slot was not in the dequeued state // * the slot was enqueued without requesting a buffer // * crop rect is out of bounds of the buffer dimensions virtual status_t queueBuffer(int slot, const QueueBufferInput& input, QueueBufferOutput* output) = 0; Loading libs/gui/include/gui/ISurfaceComposer.h +35 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,37 @@ public: virtual status_t setActiveColorMode(const sp<IBinder>& display, ui::ColorMode colorMode) = 0; /** * Returns true if the connected display reports support for HDMI 2.1 Auto * Low Latency Mode. * For more information, see the HDMI 2.1 specification. */ virtual status_t getAutoLowLatencyModeSupport(const sp<IBinder>& display, bool* outSupport) const = 0; /** * Switches Auto Low Latency Mode on/off on the connected display, if it is * available. This should only be called if #getAutoLowLatencyMode returns * true. * For more information, see the HDMI 2.1 specification. */ virtual void setAutoLowLatencyMode(const sp<IBinder>& display, bool on) = 0; /** * Returns true if the connected display reports support for Game Content Type. * For more information, see the HDMI 1.4 specification. */ virtual status_t getGameContentTypeSupport(const sp<IBinder>& display, bool* outSupport) const = 0; /** * This will start sending infoframes to the connected display with * ContentType=Game (if on=true). This will switch the disply to Game mode. * This should only be called if #getGameContentTypeSupport returns true. * For more information, see the HDMI 1.4 specification. */ virtual void setGameContentType(const sp<IBinder>& display, bool on) = 0; /** * Capture the specified screen. This requires READ_FRAME_BUFFER * permission. This function will fail if there is a secure window on Loading Loading @@ -532,6 +563,10 @@ public: CAPTURE_SCREEN_BY_ID, NOTIFY_POWER_HINT, SET_GLOBAL_SHADOW_SETTINGS, GET_AUTO_LOW_LATENCY_MODE_SUPPORT, SET_AUTO_LOW_LATENCY_MODE, GET_GAME_CONTENT_TYPE_SUPPORT, SET_GAME_CONTENT_TYPE, // Always append new enum to the end. }; Loading Loading
include/input/InputEventLabels.h +5 −6 Original line number Diff line number Diff line Loading @@ -405,13 +405,12 @@ static const InputEventLabel LEDS[] = { { nullptr, 0 } }; static const InputEventLabel FLAGS[] = { DEFINE_FLAG(VIRTUAL), static const InputEventLabel FLAGS[] = {DEFINE_FLAG(VIRTUAL), DEFINE_FLAG(FUNCTION), DEFINE_FLAG(GESTURE), DEFINE_FLAG(WAKE), { nullptr, 0 } }; {nullptr, 0}}; static int lookupValueByLabel(const char* literal, const InputEventLabel *list) { while (list->literal) { Loading
libs/gui/ISurfaceComposer.cpp +151 −0 Original line number Diff line number Diff line Loading @@ -525,6 +525,88 @@ public: return static_cast<status_t>(reply.readInt32()); } virtual status_t getAutoLowLatencyModeSupport(const sp<IBinder>& display, bool* outSupport) const { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); status_t result = data.writeStrongBinder(display); if (result != NO_ERROR) { ALOGE("getAutoLowLatencyModeSupport failed to writeStrongBinder: %d", result); return result; } result = remote()->transact(BnSurfaceComposer::GET_AUTO_LOW_LATENCY_MODE_SUPPORT, data, &reply); if (result != NO_ERROR) { ALOGE("getAutoLowLatencyModeSupport failed to transact: %d", result); return result; } return reply.readBool(outSupport); } virtual void setAutoLowLatencyMode(const sp<IBinder>& display, bool on) { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { ALOGE("setAutoLowLatencyMode failed to writeInterfaceToken: %d", result); return; } result = data.writeStrongBinder(display); if (result != NO_ERROR) { ALOGE("setAutoLowLatencyMode failed to writeStrongBinder: %d", result); return; } result = data.writeBool(on); if (result != NO_ERROR) { ALOGE("setAutoLowLatencyMode failed to writeBool: %d", result); return; } result = remote()->transact(BnSurfaceComposer::SET_AUTO_LOW_LATENCY_MODE, data, &reply); if (result != NO_ERROR) { ALOGE("setAutoLowLatencyMode failed to transact: %d", result); return; } } virtual status_t getGameContentTypeSupport(const sp<IBinder>& display, bool* outSupport) const { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); status_t result = data.writeStrongBinder(display); if (result != NO_ERROR) { ALOGE("getGameContentTypeSupport failed to writeStrongBinder: %d", result); return result; } result = remote()->transact(BnSurfaceComposer::GET_GAME_CONTENT_TYPE_SUPPORT, data, &reply); if (result != NO_ERROR) { ALOGE("getGameContentTypeSupport failed to transact: %d", result); return result; } return reply.readBool(outSupport); } virtual void setGameContentType(const sp<IBinder>& display, bool on) { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { ALOGE("setGameContentType failed to writeInterfaceToken: %d", result); return; } result = data.writeStrongBinder(display); if (result != NO_ERROR) { ALOGE("setGameContentType failed to writeStrongBinder: %d", result); return; } result = data.writeBool(on); if (result != NO_ERROR) { ALOGE("setGameContentType failed to writeBool: %d", result); return; } result = remote()->transact(BnSurfaceComposer::SET_GAME_CONTENT_TYPE, data, &reply); if (result != NO_ERROR) { ALOGE("setGameContentType failed to transact: %d", result); } } virtual status_t clearAnimationFrameStats() { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); Loading Loading @@ -1407,6 +1489,75 @@ status_t BnSurfaceComposer::onTransact( result = reply->writeInt32(result); return result; } case GET_AUTO_LOW_LATENCY_MODE_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> display = nullptr; status_t result = data.readStrongBinder(&display); if (result != NO_ERROR) { ALOGE("getAutoLowLatencyModeSupport failed to readStrongBinder: %d", result); return result; } bool supported = false; result = getAutoLowLatencyModeSupport(display, &supported); if (result == NO_ERROR) { result = reply->writeBool(supported); } return result; } case SET_AUTO_LOW_LATENCY_MODE: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> display = nullptr; status_t result = data.readStrongBinder(&display); if (result != NO_ERROR) { ALOGE("setAutoLowLatencyMode failed to readStrongBinder: %d", result); return result; } bool setAllm = false; result = data.readBool(&setAllm); if (result != NO_ERROR) { ALOGE("setAutoLowLatencyMode failed to readBool: %d", result); return result; } setAutoLowLatencyMode(display, setAllm); return result; } case GET_GAME_CONTENT_TYPE_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> display = nullptr; status_t result = data.readStrongBinder(&display); if (result != NO_ERROR) { ALOGE("getGameContentTypeSupport failed to readStrongBinder: %d", result); return result; } bool supported = false; result = getGameContentTypeSupport(display, &supported); if (result == NO_ERROR) { result = reply->writeBool(supported); } return result; } case SET_GAME_CONTENT_TYPE: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> display = nullptr; status_t result = data.readStrongBinder(&display); if (result != NO_ERROR) { ALOGE("setGameContentType failed to readStrongBinder: %d", result); return result; } bool setGameContentTypeOn = false; result = data.readBool(&setGameContentTypeOn); if (result != NO_ERROR) { ALOGE("setGameContentType failed to readBool: %d", result); return result; } setGameContentType(display, setGameContentTypeOn); return result; } case CLEAR_ANIMATION_FRAME_STATS: { CHECK_INTERFACE(ISurfaceComposer, data, reply); status_t result = clearAnimationFrameStats(); Loading
libs/gui/SurfaceComposerClient.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -1656,6 +1656,26 @@ status_t SurfaceComposerClient::setActiveColorMode(const sp<IBinder>& display, return ComposerService::getComposerService()->setActiveColorMode(display, colorMode); } bool SurfaceComposerClient::getAutoLowLatencyModeSupport(const sp<IBinder>& display) { bool supported = false; ComposerService::getComposerService()->getAutoLowLatencyModeSupport(display, &supported); return supported; } void SurfaceComposerClient::setAutoLowLatencyMode(const sp<IBinder>& display, bool on) { ComposerService::getComposerService()->setAutoLowLatencyMode(display, on); } bool SurfaceComposerClient::getGameContentTypeSupport(const sp<IBinder>& display) { bool supported = false; ComposerService::getComposerService()->getGameContentTypeSupport(display, &supported); return supported; } void SurfaceComposerClient::setGameContentType(const sp<IBinder>& display, bool on) { ComposerService::getComposerService()->setGameContentType(display, on); } void SurfaceComposerClient::setDisplayPowerMode(const sp<IBinder>& token, int mode) { ComposerService::getComposerService()->setPowerMode(token, mode); Loading
libs/gui/include/gui/IGraphicBufferProducer.h +29 −30 Original line number Diff line number Diff line Loading @@ -286,36 +286,6 @@ public: virtual status_t attachBuffer(int* outSlot, const sp<GraphicBuffer>& buffer) = 0; // queueBuffer indicates that the client has finished filling in the // contents of the buffer associated with slot and transfers ownership of // that slot back to the server. // // It is not valid to call queueBuffer on a slot that is not owned // by the client or one for which a buffer associated via requestBuffer // (an attempt to do so will fail with a return value of BAD_VALUE). // // In addition, the input must be described by the client (as documented // below). Any other properties (zero point, etc) // are client-dependent, and should be documented by the client. // // The slot must be in the range of [0, NUM_BUFFER_SLOTS). // // Upon success, the output will be filled with meaningful values // (refer to the documentation below). // // Return of a value other than NO_ERROR means an error has occurred: // * NO_INIT - the buffer queue has been abandoned or the producer is not // connected. // * BAD_VALUE - one of the below conditions occurred: // * fence was NULL // * scaling mode was unknown // * both in async mode and buffer count was less than the // max numbers of buffers that can be allocated at once // * slot index was out of range (see above). // * the slot was not in the dequeued state // * the slot was enqueued without requesting a buffer // * crop rect is out of bounds of the buffer dimensions struct QueueBufferInput : public Flattenable<QueueBufferInput> { friend class Flattenable<QueueBufferInput>; explicit inline QueueBufferInput(const Parcel& parcel); Loading Loading @@ -415,6 +385,35 @@ public: int maxBufferCount{0}; }; // queueBuffer indicates that the client has finished filling in the // contents of the buffer associated with slot and transfers ownership of // that slot back to the server. // // It is not valid to call queueBuffer on a slot that is not owned // by the client or one for which a buffer associated via requestBuffer // (an attempt to do so will fail with a return value of BAD_VALUE). // // In addition, the input must be described by the client (as documented // below). Any other properties (zero point, etc) // are client-dependent, and should be documented by the client. // // The slot must be in the range of [0, NUM_BUFFER_SLOTS). // // Upon success, the output will be filled with meaningful values // (refer to the documentation below). // // Return of a value other than NO_ERROR means an error has occurred: // * NO_INIT - the buffer queue has been abandoned or the producer is not // connected. // * BAD_VALUE - one of the below conditions occurred: // * fence was NULL // * scaling mode was unknown // * both in async mode and buffer count was less than the // max numbers of buffers that can be allocated at once // * slot index was out of range (see above). // * the slot was not in the dequeued state // * the slot was enqueued without requesting a buffer // * crop rect is out of bounds of the buffer dimensions virtual status_t queueBuffer(int slot, const QueueBufferInput& input, QueueBufferOutput* output) = 0; Loading
libs/gui/include/gui/ISurfaceComposer.h +35 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,37 @@ public: virtual status_t setActiveColorMode(const sp<IBinder>& display, ui::ColorMode colorMode) = 0; /** * Returns true if the connected display reports support for HDMI 2.1 Auto * Low Latency Mode. * For more information, see the HDMI 2.1 specification. */ virtual status_t getAutoLowLatencyModeSupport(const sp<IBinder>& display, bool* outSupport) const = 0; /** * Switches Auto Low Latency Mode on/off on the connected display, if it is * available. This should only be called if #getAutoLowLatencyMode returns * true. * For more information, see the HDMI 2.1 specification. */ virtual void setAutoLowLatencyMode(const sp<IBinder>& display, bool on) = 0; /** * Returns true if the connected display reports support for Game Content Type. * For more information, see the HDMI 1.4 specification. */ virtual status_t getGameContentTypeSupport(const sp<IBinder>& display, bool* outSupport) const = 0; /** * This will start sending infoframes to the connected display with * ContentType=Game (if on=true). This will switch the disply to Game mode. * This should only be called if #getGameContentTypeSupport returns true. * For more information, see the HDMI 1.4 specification. */ virtual void setGameContentType(const sp<IBinder>& display, bool on) = 0; /** * Capture the specified screen. This requires READ_FRAME_BUFFER * permission. This function will fail if there is a secure window on Loading Loading @@ -532,6 +563,10 @@ public: CAPTURE_SCREEN_BY_ID, NOTIFY_POWER_HINT, SET_GLOBAL_SHADOW_SETTINGS, GET_AUTO_LOW_LATENCY_MODE_SUPPORT, SET_AUTO_LOW_LATENCY_MODE, GET_GAME_CONTENT_TYPE_SUPPORT, SET_GAME_CONTENT_TYPE, // Always append new enum to the end. }; Loading