CN-121979418-A - Multi-window rendering optimization method for containerized hong Monte-go application
Abstract
The invention discloses a multi-window rendering optimization method for containerized HongMonte application, which is characterized in that a host side builds a window adaptation layer to realize instruction conversion from the container side to the host side, when a HongMonte application Ability is started, the container side analyzes a rendering mode to generate a structural body containing window full-quantity attributes and sends the structural body to the host side, the adaptation layer builds a mapping between a HongMonte window and the host window corresponding to a native window, a MSA compatible buffer pool is initialized for the window according to the rendering mode, when an application initiates a frame buffer creation request, the host side distributes an idle buffer from the corresponding buffer pool, the container side builds a mapping between a virtual frame buffer object and the host side buffer, when the HongMonte application submits display, a cross-container shared handle of the rendering buffer is exported from the container side to send buffer data to the host side, after the host side imports the shared handle, the GPU buffer is bound to the target window surface to submit a refreshing request, and synthesizer application rendering content and the native window decoration are synthesized and sent to display equipment to finish screen display.
Inventors
- WEN YAN
- YAN HUA
Assignees
- 北京麟卓信息科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260409
Claims (10)
- 1. A multi-window rendering optimization method for containerized Hongmon application is characterized by comprising the following steps: the host side establishes a window adaptation layer for converting window instructions of the container side and the host side; The method comprises the steps of starting page capacity of a container side HongMong application, acquiring a rendering mode creation window by the container, wherein an encapsulation window attribute is a first structure body, and transmitting the rendering mode and the first structure body to a host side; When the application creates the frame buffer, the container obtains the rendering context, the hong-Meng window ID and the rendering mode, and sends a frame buffer creation request containing the hong-Meng window ID, the rendering mode and the request time stamp to the host side; the window adaptation layer determines a corresponding Mesa compatible buffer pool and allocates a target buffer, associates the target buffer with the rendering surface and DRM frame buffer, and sends a rendering surface handle, DRM frame buffer ID and target buffer handle to the container side; When the application submits and displays, the container converts the first DRM handle into a global sharing handle, sends a third structure body containing the hong-Monte window ID, the global sharing handle, the width and the height of the buffer zone and the rendering completion time stamp to the host side, the window adaptation layer converts the first DRM handle into the host window ID and the second DRM handle, binds the GPU buffer zone pointed by the second DRM handle to submit a refreshing request, the host side synthesizer maps the GPU buffer zone pointed by the second DRM handle to a user-state memory, reads the rendering data of the application, adds window decoration according to the first mapping, combines the rendering content and the window decoration and sends the window decoration to the display equipment to complete screen surfing.
- 2. The method for optimizing multi-window rendering according to claim 1, wherein the window adaptation layer determines the corresponding Mesa-compatible buffer pool and allocates the target buffer in such a way that if there is an empty buffer in the Mesa-compatible buffer pool, the buffer is obtained therefrom as the target buffer, otherwise, the buffer is obtained therefrom as the target buffer after multiplexing the Mesa-compatible buffer pool with the same format and size parameters.
- 3. The method of optimizing multi-window rendering according to claim 1, wherein the DRM texture format list supported by the container side and the host side is queried respectively, formats supported by both sides are selected as shared formats, and for formats which are unique to hong Mongolian and have no intersection on both sides, the DRM texture format on the container side is converted into the format supported by the host side by using GPU hardware acceleration format conversion.
- 4. The method according to claim 1, wherein the host side acquires a vertical synchronization signal and a vertical synchronization time stamp from the display controller and transmits the vertical synchronization signal and the vertical synchronization time stamp to the container side, the container side injects the vertical synchronization signal into the Hongmon synthesizer, sets a refresh reference of the synthesizer to make a rendering trigger timing of the Hongmon application coincide with that of the host side, and when a plurality of Hongmon applications are concurrently rendered, the window adaptation layer sorts a plurality of current windows according to a Z-axis hierarchy, counts rendering time consumption of each host window, calculates and sets average time consumption in the sliding window, reduces a Mesa compatible buffer pool corresponding to the window when the average time consumption of the host window is greater than an upper threshold, and transmits a frame rate adjustment message notifying an application to reduce a target frame rate to the container side, and transmits a frame rate adjustment message notifying the Hongmon application to increase the target frame rate when the average time consumption of the host window is less than a lower threshold.
- 5. The method of claim 1, wherein the method of converting the first DRM handle into the global sharing handle by the container when the application submits the display is that the width and the height of the buffer area are verified by the container, the window size in the first structure is consistent with the window size, the support of the DRM texture format of the buffer area by the host side is verified, the first DRM handle is converted into the global sharing handle which can be accessed across the container when the verification passes, and the log is recorded and the CPU copy path is switched to when the verification fails.
- 6. The multi-window rendering optimization method of claim 1, wherein when the destroying window is applied, the container side sends a window destroying message containing a hong window ID to the host side, and the window adaptation layer destroys the host side window according to the first mapping; when the window size of the hong application is changed, the container side updates the first structure body and sends a synchronous message containing the hong window ID to the host side, and the window adaptation layer calculates a window scaling factor according to the updated parameters of the first structure body in the first mapping, and updates the host side window and the second structure body; When the user minimizes the window, the window adaptation layer sends a window minimization message containing the hong window ID to the container side, and the container side pauses application rendering after receiving the message.
- 7. The method according to claim 1, wherein when the host side adopts an independent GPU, the global sharing handle is converted into a file descriptor, and then the file descriptor is transferred to the independent GPU, and the independent GPU converts the file descriptor into a local handle, so as to realize the sharing across GPU buffers.
- 8. The method for optimizing multi-window rendering according to claim 4, wherein the window adaptation layer orders the current plurality of windows according to the Z-axis hierarchy in such a way that a top-level window preferentially obtains a vertical synchronization signal response, preferentially submits a refresh request in each vertical synchronization period, and a middle-level window delays refreshing after M vertical synchronization periods, and a bottom-level window delays refreshing after N vertical synchronization periods, wherein N is greater than M.
- 9. The method of claim 1, wherein if the application does not request the buffer within a set time, the Mesa compatible buffer pool is reduced to release the DRM resource.
- 10. The multi-window rendering optimization method according to claim 1, wherein the window adaptation layer is established based on Wayland protocols.
Description
Multi-window rendering optimization method for containerized hong Monte-go application Technical Field The invention belongs to the technical field of computer software development, and particularly relates to a multi-window rendering optimization method for containerized hong Monte applications. Background The display scheme of the current containerized HongMong application on the Linux side has obvious limitations that firstly, a global texture summarizing mode is adopted, namely, all application rendering results are required to be uniformly on screen after being copied by a CPU, single-frame transmission delay exceeds 100ms, independent interaction of windows cannot be realized, secondly, the underlying commonality of the display scheme based on the Mesa construction is not deeply utilized OpenHarmony and the Linux system graphic drive, redundant data conversion and transmission consume a large amount of GPU and CPU resources, thirdly, the synergy among all modules (window management, input events and synthetic refreshing) of a graphic stack lacks of a specific design, and the problems of frame rate fluctuation, event response disorder and the like are easy to occur during multi-window concurrency. Disclosure of Invention In view of the above, the invention provides a multi-window rendering optimization method for containerized hong Monte application, which realizes low-delay mapping and accurate interaction between OpenHarmony application and Linux independent window based on the underlying commonality of a graphics system between OpenHarmony system and Linux system. The invention provides a multi-window rendering optimization method for containerized HongMonte application, which specifically comprises the following steps: the host side establishes a window adaptation layer for converting window instructions of the container side and the host side; The method comprises the steps of starting page capacity of a container side HongMong application, acquiring a rendering mode creation window by the container, wherein an encapsulation window attribute is a first structure body, and transmitting the rendering mode and the first structure body to a host side; When the application creates the frame buffer, the container obtains the rendering context, the hong-Meng window ID and the rendering mode, and sends a frame buffer creation request containing the hong-Meng window ID, the rendering mode and the request time stamp to the host side; the window adaptation layer determines a corresponding Mesa compatible buffer pool and allocates a target buffer, associates the target buffer with the rendering surface and DRM frame buffer, and sends a rendering surface handle, DRM frame buffer ID and target buffer handle to the container side; When the application submits and displays, the container converts the first DRM handle into a global sharing handle, sends a third structure body containing the hong-Monte window ID, the global sharing handle, the width and the height of the buffer zone and the rendering completion time stamp to the host side, the window adaptation layer converts the first DRM handle into the host window ID and the second DRM handle, binds the GPU buffer zone pointed by the second DRM handle to submit a refreshing request, the host side synthesizer maps the GPU buffer zone pointed by the second DRM handle to a user-state memory, reads the rendering data of the application, adds window decoration according to the first mapping, combines the rendering content and the window decoration and sends the window decoration to the display equipment to complete screen surfing. Further, the window adaptation layer determines a corresponding Mesa compatible buffer pool and allocates a target buffer in such a way that if an idle buffer exists in the Mesa compatible buffer pool, the buffer is obtained as the target buffer, otherwise, the Mesa compatible buffer pool with the same format and size parameters is multiplexed, and then the buffer is obtained as the target buffer. Further, respectively inquiring DRM texture format lists supported by the container side and the host side, selecting formats supported by both sides together as shared formats, and converting the DRM texture format of the container side into the format supported by the host side by adopting GPU hardware acceleration format conversion for formats which are unique to hong and have no intersection on both sides. Further, the host side acquires a vertical synchronous signal and a vertical synchronous timestamp from the display controller and sends the vertical synchronous signal to the container side, the container side injects the vertical synchronous signal into a hong-Monte synthesizer, a refreshing reference of the synthesizer is set to enable rendering trigger time of the hong-Monte application to be consistent with that of the host side, when a plurality of hong-Monte applications are concurrently rendered, a window adaptation layer orders a pl