New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lipstick[ Implement basic hardware compositor support in lipstick. #233
Conversation
On the rendering thread in lipstick, we install a custom scene graph rendering stage. In this stage, we look through the scene graph for hardware compatible nodes and put these into their own block. We're currently only supporting in-process images (for background images) without rotation (for now) and no scaling. The custom render stage will look at the transform of these images and decide if it can be sent to the hwc or not. We can talk to the hwc using an abstraction API called HwcInterface which we can query from the QPA plugin. The API is located in 'hwcinterface.h' and is a direct copy of the same file inside the QPA plugin. It has been done like this to have some API while keeping this out of the public API. There is a version name string to prevent mismatches between the plugin and the hwc. Once we've identified buffers to draw using the hwc we create a HwcInterface::LayerList which contains the buffer handles. The layer list can also include GL rendering which will stack on top. We schedule this to the hwc and will be notified some time later if it is accepted or not. Until it is, we render all GL as normal. Once accepted, we switch to swapping the layer list instead of using eglSwapBuffers(). The feature is enabled by setting LIPSTICK_HARDWARE_COMPOSITOR=1 in the environment.
| // | ||
| // This file is a copy from the one in the hwcomposer platform plugin | ||
| // Make sure it is up to date, failing to do so will result in the | ||
| // hardware compositor not working or at worst, binary incompatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint32 version; field at the start of the structs, maybe? (and an qFatal if they mismatch)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't think HWC_INTERFACE_NAME which we use when querying the nativeResource is enough?
| eglHybrisReleaseNativeBuffer = (_eglHybrisReleaseNativeBuffer) eglGetProcAddress("eglHybrisReleaseNativeBuffer"); | ||
| } | ||
|
|
||
| QSGTexture *HwcImageTexture::create(const QImage &image) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On phone I've had this instantiate a seemingly blank texture. It may have been size related as it did work for some application backgrounds but not home backgrounds.
[lipstick[ Implement basic hardware compositor support in lipstick.
On the rendering thread in lipstick, we install a custom scene graph
rendering stage. In this stage, we look through the scene graph for
hardware compatible nodes and put these into their own block.
We're currently only supporting in-process images (for background
images) without rotation (for now) and no scaling. The custom render
stage will look at the transform of these images and decide if it can
be sent to the hwc or not.
We can talk to the hwc using an abstraction API called HwcInterface
which we can query from the QPA plugin. The API is located in
'hwcinterface.h' and is a direct copy of the same file inside
the QPA plugin. It has been done like this to have some API
while keeping this out of the public API. There is a version
name string to prevent mismatches between the plugin and the
hwc.
Once we've identified buffers to draw using the hwc we create a
HwcInterface::LayerList which contains the buffer handles. The layer
list can also include GL rendering which will stack on top. We
schedule this to the hwc and will be notified some time later if it is
accepted or not. Until it is, we render all GL as normal. Once
accepted, we switch to swapping the layer list instead of using
eglSwapBuffers().
The feature is enabled by setting LIPSTICK_HARDWARE_COMPOSITOR=1
in the environment.