Graphic display method based on multiple operating systems, and related apparatus

The client operating system directly accesses the rendering device and video memory for layer synthesis, which solves the problem of long image drawing time in a multi-operating system environment and achieves a high refresh rate user experience.

WO2024179406A1PCT designated stage expired Publication Date: 2024-09-06HUAWEI TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/078567
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-10
Filing Date
2024-02-26
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

In electronic devices with multiple operating systems, the guest operating system needs to send drawing data to the host operating system for rendering and synthesis when displaying the interface. As a result, it takes a long time for the electronic device to draw a frame of image, making it difficult to achieve a high refresh rate. .

Method used

The guest operating system can directly access the rendering device and video memory for rendering and layer synthesis, and submits the synthesized layer to the host operating system, reducing the number of rendering instructions sent to the host operating system and improving image drawing speed.

Benefits of technology

It enables client-side applications to support high refresh rates during runtime, which is close to the refresh rate of host-side applications, improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024078567_06092024_PF_FP
    Figure CN2024078567_06092024_PF_FP
Patent Text Reader

Abstract

Provided in the present application are a graphic display method based on multiple operating systems (OS), and a related apparatus. An electronic device may comprise a host OS and at least one client OS. The host OS can map a rendering device and a video memory to the client OS. The client OS can directly access the rendering device and the video memory to perform rendering and layer composition, and then submit a composed layer to the host OS, so as to complete the composition and display of application (APP) windows of a client-side APP and a host-side APP. By means of the method, a client-side APP can support a high refresh rate during running, such that a running effect of a host-side APP is achieved or approximately achieved, thereby improving the screen viewing experience of a user when the user uses the client-side APP.
Need to check novelty before this filing date? Find Prior Art

Description

Graphics display method and related device based on multiple operating systems

[0001] This application claims priority to the Chinese patent application with application number 202310216037.7 filed with the State Intellectual Property Office of China on February 28, 2023, and priority to the Chinese patent application with invention name “Graphic display method and related device based on multiple operating systems”, as well as priority to the Chinese patent application with application number 202310269901.X filed with the State Intellectual Property Office of China on March 10, 2023, and priority to the Chinese patent application with invention name “Graphic display method and related device based on multiple operating systems”, all contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminal technology, and in particular to a graphics display method and related devices based on multiple operating systems. Background Art

[0003] With the development of electronic devices, many electronic devices can run multiple operating systems on a single electronic device through virtualization technology. The above virtualization technology can abstract and convert various physical resources of electronic devices (such as processors, memories, disks, network adapters, etc.), and can be divided and combined into one or more computer configuration environments. Electronic devices equipped with multiple operating systems can facilitate users to use applications on electronic devices without being limited by the operating system. Users can use different applications with different operating systems on a single electronic device.

[0004] However, in electronic devices running multiple operating systems, when an application in a client operating system displays its interface, the client operating system can send various drawing data (such as window information, drawing instructions, layer hierarchy information, etc.) to the host operating system. The host operating system then renders, synthesizes, and displays the display content of the application window in the client operating system based on this drawing data. This process requires a long time for the electronic device to draw a single frame of image. Consequently, the time required for the electronic device's display to refresh a single frame of image is also long. Consequently, it is difficult for electronic devices to achieve high refresh rates when running applications in client operating systems.

[0005] Summary of the Invention

[0006] The present invention provides a multi-operating system-based graphics display method and related apparatus. The client OS in an electronic device can directly access the electronic device's rendering device and video memory for rendering and layer synthesis, and then submit the synthesized layers to the host OS to complete the synthesis and display of the application windows of the client-side app and the host-side app. This allows the client-side app to support high refresh rates during runtime, achieving or approaching the performance of the host-side app, improving the user's viewing experience when using the client-side app.

[0007] In a first aspect, the present application provides a graphics display method based on multiple operating systems. The method can be applied to an electronic device running multiple operating systems, wherein the multiple operating systems include a host operating system and at least one client operating system, the host operating system is a first operating system, and the at least one client operating system includes a second operating system. The second operating system can render one or more first layers according to the rendering instructions of the first application. The first application is an application in the second operating system, and the one or more first layers are layers contained in the first application window of the first application. The second operating system can synthesize one or more first layers to obtain a second layer. The first operating system can obtain the second layer and display the first application window on the display screen of the electronic device according to the second layer.

[0008] Specifically, the second operating system rendering one or more first layers may include rendering to obtain display data of the one or more first layers. Specifically, the second operating system synthesizing one or more first layers to obtain a second layer may include obtaining display data of the second layer. The first operating system may display the first application window based on the display data of the second layer. The display data may include pixel data.

[0009] It can be seen from the above method that in an electronic device where multiple operating systems are running simultaneously, the client OS can render and synthesize the layers contained in the application window of the client-side APP. The host OS can directly obtain the synthesized layer obtained after the client OS performs rendering and synthesis to realize the display of the application window of the client-side APP on the display screen. The client OS does not need to send a large number of rendering instructions to the host OS. This can increase the speed at which the electronic device draws a frame of image, so that the client-side APP in the electronic device can support a high refresh rate when running. The refresh rate of the client-side APP during operation can reach or approach the operating effect of the host-side APP, effectively improving the user's experience of viewing the screen when using the client-side APP.

[0010] In conjunction with the first aspect, in some embodiments, the first operating system may obtain first window information of the first application window and then display the first application window on the display screen of the electronic device based on the second layer and the first window information.

[0011] In some embodiments, the first window information includes first window position information, first window size information, and first window hierarchy information. The first window position information may be used to indicate the display position of the first application window on the display screen. The first window size information may be used to indicate the display size of the first application window on the display screen. The first window hierarchy information may be used to indicate the display hierarchy of the first application window among all application windows displayed on the display screen.

[0012] In conjunction with the first aspect, in some embodiments, an electronic device includes hardware resources: a rendering device and video memory. A first operating system and a second operating system may share the rendering device and video memory. The second operating system may use the rendering device to render one or more first layers according to rendering instructions from the first application, and the one or more first layers may be stored in the video memory.

[0013] In some embodiments, the first operating system may map the rendering device and video memory to the second operating system through virtualization technology, such as virtual machine-based virtualization technology or container-based virtualization technology, so that the second operating system can use the rendering device and video memory.

[0014] In conjunction with the first aspect, in some embodiments, the second operating system may determine a first storage area from the video memory and store the second layer in the first storage area. The second operating system sends first indication information of the first storage area to the first operating system, where the first indication information indicates the location of the first storage area in the video memory. For example, the first indication information may be a handle or a pointer.

[0015] The first operating system may obtain the second layer in the video memory according to the first instruction information.

[0016] It can be seen that when the client-side APP needs to display the application window, the client OS can use the rendering device and video memory for rendering and synthesis. The synthesized composite layer is stored in the video memory. In this way, the client OS can send the indication information (such as the handle) for indexing the composite layer to the host OS without sending a large number of rendering instructions to the host OS. The host OS can obtain the composite layer obtained by rendering and synthesis by the client OS in the video memory based on the received indication information. In this way, the host OS can obtain the display data of the application window to be displayed by the client-side APP more quickly, so that the application window of the client-side APP can be quickly displayed.

[0017] In conjunction with the first aspect, in some embodiments, the first operating system may determine a second storage area from the video memory and send second indication information of the second storage area to the second operating system, where the second indication information indicates a location of the second storage area in the video memory. The second operating system may store the second layer in the second storage area based on the second indication information.

[0018] After the second operating system stores the second layer in the second storage area, the first operating system may obtain the second layer in the video memory according to the second indication information.

[0019] As can be seen, the client OS can store the composite layer in the graphics memory allocated by the host OS. This eliminates the need for the client OS to send the host OS an indication (e.g., a handle) for indexing the composite layer when displaying the client-side app's application window. This reduces the time required by the host OS to retrieve the composite layer from the client OS, increasing the speed at which the electronic device can draw a frame containing the client-side app's application window.

[0020] In conjunction with the first aspect, in some embodiments, the first operating system may render one or more third layers based on rendering instructions of a second application, where the second application is an application in the first operating system, and the one or more third layers are layers contained in a second application window of the second application. The first operating system may synthesize the one or more third layers to obtain a fourth layer. The first operating system may synthesize the first application window and the second application window based on the second layer and the fourth layer, and display the synthesized first application window and the second application window on the display screen.

[0021] In some embodiments, the first operating system may obtain first window information of the first application window and second window information of the second application window. The first operating system may synthesize the first application window and the second application window based on the second layer, the first window information, the fourth layer, and the second window information.

[0022] In conjunction with the first aspect, in some embodiments, the second operating system may render one or more fifth layers based on rendering instructions of a third application, where the third application is an application in the second operating system, and the one or more fifth layers are layers contained in a third application window of the third application. The second operating system synthesizes the one or more fifth layers to obtain a sixth layer. The first operating system obtains the sixth layer. The first operating system synthesizes the first application window and the third application window based on the second layer and the sixth layer, and displays the synthesized first application window and third application window on the display screen.

[0023] In some embodiments, the first operating system may obtain first window information of the first application window and third window information of the third application window, and synthesize the first application window and the third application window according to the second layer, the first window information, the sixth layer, and the third window information.

[0024] It can be seen that in a scenario where multiple client-side apps are running and application windows need to be displayed, the client OS can render and synthesize the application windows of these multiple client-side apps separately to obtain multiple synthetic layers corresponding to the application windows of these multiple client-side apps. The client OS can send these multiple synthetic layers to the host OS. Then, the host OS can display the application windows of these multiple client-side apps based on these multiple synthetic layers. Among them, the synthetic layers of the application windows of the multiple client-side apps obtained by the host OS can be independent of each other. In this way, the user can arbitrarily adjust the display hierarchy order between the application windows of the host-side app and the client-side app on the display screen. The user experience of using the client-side app can be better consistent with the experience of using the host-side app.

[0025] In a second aspect, the present application provides an electronic device that may include a rendering device, a video memory, a storage device, and a processor. The rendering device may be configured to render according to rendering instructions to obtain display data. The video memory may be configured to store the display data. The storage device may be configured to store a computer program. The processor may run multiple operating systems, including a host operating system and at least one client operating system. The processor may be configured to invoke the computer program, causing the electronic device to execute any possible implementation method described in the first aspect.

[0026] In a third aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, enables the electronic device to execute any possible implementation method in the first aspect.

[0027] In a fourth aspect, the present application provides a computer program product, which may include computer instructions. When the computer instructions are run on an electronic device, the electronic device executes any possible implementation method as in the first aspect.

[0028] In a fifth aspect, the present application provides a chip, which is applied to an electronic device. The chip includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute any possible implementation method as in the first aspect.

[0029] It is understandable that the electronic device provided in the second aspect, the computer-readable storage medium provided in the third aspect, the computer program product provided in the fourth aspect, and the chip provided in the fifth aspect are all used to execute the methods provided in the embodiments of the present application. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] 1 to 3 are schematic structural diagrams of some electronic devices 100 provided in embodiments of the present application;

[0031] 4A to 4G are schematic diagrams of some graphic display scenarios provided in embodiments of the present application;

[0032] 5 to 7 are schematic structural diagrams of some electronic devices 100 provided in embodiments of the present application;

[0033] FIG8 is a flowchart of a graphic display method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] The technical solutions in the embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0035] References to "one embodiment" or "some embodiments" etc. described in this specification mean that the specific features, structures or characteristics described in conjunction with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in another way. The term "connected" includes direct and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0036] In the embodiments of this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.

[0037] The term "user interface (UI)" in the following embodiments of this application refers to a medium interface for interaction and information exchange between an application (APP) or an operating system (OS) and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device and finally presented as content that the user can recognize. The commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.

[0038] The present application provides a graphics display method based on multiple operating systems. The method can be applied to electronic devices that include multiple operating systems. The electronic device may include a host OS and at least one client OS. The host OS can map the rendering device and video memory in the hardware layer of the electronic device to the client OS. After the above mapping operation, the host OS and the client OS can share the rendering device and video memory. When the APP on the client side requests to display an application window, the client OS can use the rendering device in the electronic device to implement graphics rendering according to the rendering instructions of the APP, and synthesize the layers obtained by the graphics rendering. The client OS can store the display data obtained through the above rendering and synthesis in the video memory of the electronic device. Then, the client OS can send the window information (such as window size, window level, window position, etc.) of the application window to be displayed by the client-side APP, as well as the handle for indexing the above display data to the host OS. Furthermore, the host OS can determine the display content of the application window to be displayed by the client-side APP, synthesize the display content of the client-side APP with the display content of the host-side APP, and display it on the display screen of the electronic device.

[0039] It can be seen from the above method that since the host OS maps the rendering device and video memory to the client OS, the host OS and the client OS can share the rendering device and video memory. When the client-side APP needs to display the application window, the client OS can use the rendering device and video memory to render and synthesize independently. The client OS only needs to send the window information and the handle for indexing the synthesized display data to the host OS, without having to send a large number of rendering instructions to the host OS. The amount of data of the above-mentioned window information and handle to be sent is much smaller than the amount of data that the client OS sends to the host OS when rendering instructions are sent, which is conducive to improving the speed at which electronic devices draw a frame of image.

[0040] Furthermore, the client OS can independently render according to the app's rendering instructions within a single process. In contrast, in a solution where the client OS sends rendering instructions and other data to the host OS, which then renders, synthesizes, and displays the data, multiple processes are typically required within the client OS to complete the transmission of rendering instructions and other data. Therefore, in the graphics display method provided in this application, the host OS can more quickly obtain the display data for the client-side app's application window to be displayed, thereby quickly displaying the client-side app's application window.

[0041] As can be seen, in electronic devices running multiple operating systems simultaneously, the graphics display method provided by this application can increase the speed at which the electronic device draws a single frame of image, enabling client-side applications in the electronic device to support high refresh rates during operation. The refresh rate of the client-side application can reach or approach that of the host-side application. This method can effectively improve the user's screen viewing experience when using the client-side app.

[0042] To facilitate understanding, some concepts involved in this application are introduced below.

[0043] 1. Host OS and Guest OS

[0044] A host machine can refer to a physical electronic device. It can also be referred to as a host machine, among other names. A client machine can refer to a computer configuration environment created by abstracting, segmenting, and combining the physical resources of an electronic device through virtualization technology. A client machine can also be referred to as a guest machine, among other names. In other words, the host machine is the physical foundation of the client machine. The client machine exists within the host machine. The operation of the host machine is the prerequisite and foundation for the operation of the client machine.

[0045] The host OS can refer to the OS loaded in the host machine. The host OS is adapted to the hardware (such as processor, memory, etc.) in the host machine and can directly control the hardware in the host machine. The host OS can be, for example, And other operating systems.

[0046] The client OS may refer to the OS loaded in the client. The client OS may be, for example, And other operating systems.

[0047] The embodiments of the present application do not limit the types of the host OS and the client OS.

[0048] APPs can be installed in both the host and the client. The APP installed in the host (i.e., the host-side APP) can be an APP that is adapted to the host OS and can be run through the host OS. The APP installed in the client (i.e., the client-side APP) can be an APP that is adapted to the client OS and can be run through the client OS. In this way, users can install and use APPs adapted to different OSs in one electronic device. For example, the host OS is The client OS is If an APP cannot environment, but can The electronic device can install this APP in the client. The user can use this electronic device to use the APP, and can use the APP.

[0049] 2. Virtualization Technology

[0050] Virtualization technologies can include virtual machine (VM)-based virtualization technologies and container-based virtualization technologies. Based on virtualization technologies, the host operating system in an electronic device can map one or more hardware devices in the electronic device, such as rendering devices and video memory, to the client operating system. The host and client operating systems can share the mapped hardware devices.

[0051] 2.1 Virtual Machine-Based Virtualization Technology

[0052] A virtual machine (VM) is a complete computer system emulated through software, with full hardware functionality, running in a completely isolated environment. A VM simulates its own complete hardware, including processors, memory, network interfaces, and more. Users can operate the VM just as they would a physical machine.

[0053] FIG1 exemplarily shows a structural block diagram of an electronic device 100 when a virtualization technology based on a virtual machine is used.

[0054] As shown in FIG. 1 , the electronic device 100 may include a virtual machine 210 , a virtual machine 220 , a virtual machine manager 230 , a host operating system 240 , and physical hardware 250 .

[0055] The virtual machine 210 may include an application 211 and a client operating system 212. The application 211 may represent one or more APPs installed in the virtual machine 210.

[0056] The virtual machine 220 may include an application 221 and a client operating system 222. The application 221 may represent one or more apps installed in the virtual machine 220.

[0057] A virtual machine in the electronic device 100 may be a client.

[0058] Not limited to the virtual machine 210 and the virtual machine 220 , the electronic device 100 may further include more or fewer virtual machines.

[0059] The guest operating system 212 , the guest operating system 222 , and the host operating system 240 may be the same OS or different OSs.

[0060] The virtual machine manager (VMM) 230 can be used to separate and appropriately configure the resources and hardware of the electronic device 100 for use by the virtual machines (e.g., virtual machine 210 and virtual machine 220) in the electronic device 100. During the operation of the virtual machines in the electronic device 100, when the application in the virtual machine issues an instruction to obtain more resources from the physical environment, the virtual machine manager 230 can schedule the resources of the physical system so that the operating system and application in the virtual machine can access the shared physical hardware. The virtual machine manager 230 can also be called a hypervisor.

[0061] The physical hardware 250 may include a central processing unit (CPU), a graphics processing unit (GPU), a memory, and the like of the electronic device 100 .

[0062] As shown in the software structure diagram of FIG1 , the host operating system 240 can map hardware devices such as rendering devices and video memory to the guest operating systems (e.g., guest operating system 212 and guest operating system 222) through the virtual machine manager 230. The guest operating system can access the hardware devices shared with the host operating system 240 through the virtual machine manager.

[0063] 2.2 Container-based virtualization technology

[0064] A container is a software package that contains all the resources necessary for an application within the container to run in any environment. This package can include the application, the system libraries it requires, external third-party code packages, and other operating system-level applications. In other words, a container provides an isolated runtime space for applications within the container. Each container can contain a complete, dedicated user environment. Each container within an electronic device can be independent and non-interfering.

[0065] FIG2 exemplarily shows a structural block diagram of an electronic device 100 when using a container-based virtualization technology.

[0066] As shown in FIG. 2 , the electronic device 100 may include a container 310 , a container 320 , a container engine 330 , a host operating system 340 , and physical hardware 350 .

[0067] Container 310 may contain application 311 and application runtime-dependent resources 312. Application 311 may represent one or more apps installed in container 310. Application runtime-dependent resources 312 may represent all resources required by the apps in container 310 (i.e., application 311) at runtime, such as system libraries, external third-party code packages, and other operating system-level applications required for app runtime.

[0068] Container 320 may include application 321 and application runtime dependent resources 322. Application 321 may represent one or more apps installed in container 320. Application runtime dependent resources 322 may represent all resources required by the apps in container 320 (i.e., application 321) at runtime.

[0069] Among them, the electronic device 100 can package the application and all the resources required for the application to run in any environment to generate a container image. The electronic device 100 can create a container (such as container 310, container 320) based on the container image. Since the container contains the application and all the resources required for the application to run in any environment, the container can run on any type of electronic device and operating system. In other words, the application in the container of the electronic device 100 can run independently of the host operating system 340. Even if an APP is not compatible with the host operating system 340, the electronic device 100 can install and run this APP with the help of the above-mentioned container-based virtualization technology. The above-mentioned container image can be equivalent to the packaging of the application and the operating system on which it runs.

[0070] A container in the electronic device 100 can be understood as a client in this application. The operating system adapted by the application in a container can be a client OS in the electronic device 100. For example, the host operating system in the electronic device 100 is The operating system adapted by the application 311 in the container 310 is Then, the client OS corresponding to the container 310 can be

[0071] The adaptation of an application to an operating system may mean that the application can run directly in the operating system.

[0072] The electronic device 100 is not limited to the container 310 and the container 320 , and may further include more or fewer containers.

[0073] Container engine 330 can be a software program that creates containers based on container images. Container engine 330 can act as an intermediary agent between containers (such as container 310 and container 320) and host operating system 340, providing and managing the resources required by applications in the containers. Container engine 330 can also be called a container runtime.

[0074] The host operating system 340 may include a kernel 341. The kernel 341 may be used to manage the system's processes, memory, device drivers, files, and network systems, etc. The kernel 341 may include controllers or drivers for controlling the physical hardware 350 in the electronic device 100. For example, the kernel 341 may include a display driver, a disk driver, an audio driver, a sensor driver, a camera driver, etc.

[0075] The containers (e.g., container 310 and container 320) in the electronic device 100 can share the kernel 341 of the host operating system 340. Since the kernel 341 can be used to control the physical hardware in the electronic device 100, the client OS corresponding to the container in the electronic device 100 can share hardware devices such as rendering devices and video memory with the host operating system 340.

[0076] The physical hardware 350 may include a CPU, a GPU, a memory, and the like of the electronic device 100 .

[0077] As shown in the software structure diagram of FIG2 , the host operating system 340 can share a kernel 341 with the client OS corresponding to the container in the electronic device 100 through container-based virtualization technology, thereby enabling the host operating system 340 to map hardware devices such as rendering devices and video memory to the client OS. The client OS can access the hardware devices shared with the host operating system 340 through the kernel 341.

[0078] The structures of the electronic device 100 shown in Figures 1 and 2 are merely exemplary descriptions of the present application and should not be construed as limiting the present application. The electronic device 100 may further include more or fewer software or hardware structures.

[0079] Not limited to the above-mentioned virtual machine-based virtualization technology and container-based virtualization technology, the electronic device 100 may also adopt other virtualization technologies to enable the host OS and the client OS to share one or more hardware devices in the electronic device 100.

[0080] 3. Rendering device, video memory, and display device

[0081] The rendering device, video memory, and display device can all represent abstract descriptions of the actual physical hardware in the electronic device 100. For example, the rendering device can represent an abstract description of the GPU in the electronic device 100. The video memory can represent an abstract description of the video memory in the electronic device 100. The display device can represent an abstract description of the display screen in the electronic device 100.

[0082] A hardware device described abstractly based on a physical hardware may correspond to a corresponding device file. Applications and operating systems in the electronic device 100 may access the corresponding hardware device through the device file, thereby achieving control over the corresponding physical hardware.

[0083] For example, the path of the device file corresponding to the rendering device may be / dev / gpu0. Applications and the operating system in the electronic device 100 may access the GPU in the electronic device 100 through the device file " / dev / gpu0", thereby utilizing the GPU for graphics rendering.

[0084] For example, the path of the device file corresponding to the video memory may be / dev / dma_heap. Applications and the operating system in the electronic device 100 can access the video memory in the electronic device 100 through the device file " / dev / dma_heap", thereby using the video memory to store graphic data (such as data rendered by the GPU).

[0085] For example, the path of the device file corresponding to the display device may be / dev / fb0. The device file " / dev / fb0" may be used to control the pixels displayed at each point on the display screen. The device file " / dev / fb0" may contain pixel data for each point on the display screen. The application and operating system in the electronic device 100 may display the corresponding graphics on the display screen by writing the pixel data of the graphics to be displayed to the device file " / dev / fb0". The display device may also be referred to as a frame buffer.

[0086] It is understandable that the paths of the device files corresponding to the above-mentioned rendering device, video memory, and display device are only exemplary descriptions of this application. The embodiments of this application do not limit the device files corresponding to the above-mentioned rendering device, video memory, and display device.

[0087] 4. Frame rate and refresh rate

[0088] Frame rate can be defined as the number of frames a graphics rendering device (such as a GPU) sends to a display screen within one second. Alternatively, it can be defined as the rate at which a graphics rendering device renders images within one second. For example, a frame rate of 60 frames per second (FPS) indicates that the GPU can generate 60 frames per second.

[0089] Refresh rate refers to the rate at which a display refreshes its displayed image. For example, a refresh rate of 60 Hertz (Hz) means that the display can refresh its image 60 times per second.

[0090] If the frame rate is lower than the refresh rate, the display will display the same frame after multiple refreshes. For example, if the frame rate is 30 FPS and the refresh rate is 144 Hz, the GPU can only send 30 frames of images to the display in 1 second. However, the display refreshes 144 times in 1 second, and during these 144 refreshes, it displays the 30 frames sent by the GPU. This means that the display will show the same frame of image after multiple refreshes. In this case, because the GPU cannot generate images quickly and cannot provide enough frames for the display to refresh, even a display with a high refresh rate configuration will have difficulty producing high-refresh-rate images. Users will experience lag when viewing the display.

[0091] When the frame rate is greater than the refresh rate, the display screen will often discard part of the frame images sent by the GPU. For example, the frame rate is 120FPS and the refresh rate is 60Hz. Then, the GPU will send 120 frames of images to the display screen within 1 second. However, the display screen only refreshes 60 times within 1 second. The display screen can only display 60 frames of images out of the 120 frames sent by the GPU and discards the other 60 frames of images. In some embodiments, before the display screen has completed refreshing a frame of image, if the GPU overwrites the frame buffer with another frame of image that is about to be displayed, the display screen will simultaneously display part of one frame of image and part of another frame of image. The user will observe screen tearing on the display screen.

[0092] It's understandable that, when the frame rate and refresh rate match (i.e., they are the same or similar), the higher the refresh rate configured on a display, the more image frames the display can display in one second. This allows the display to present greater detail, smoother motion in the image, and a better viewing experience for users.

[0093] The graphics display method of the present application can shorten the time from when a client-side app issues a rendering instruction to when the corresponding pixel data is rendered according to the rendering instruction, thereby increasing the frame rate at which the electronic device 100 generates the application window of the client-side app. This allows the client-side app to support the high refresh rate of the display screen during operation. The client-side app can present smooth display content on the display screen, improving the user's viewing experience when using the client-side app.

[0094] FIG3 exemplarily shows a structural diagram of an electronic device 100 provided in an embodiment of the present application.

[0095] As shown in Figure 3, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0096] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0097] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0098] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0099] Processor 110 may also include a memory for storing instructions and data. In some examples, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces processor 110 latency, and thus improves system efficiency.

[0100] USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. USB interface 130 can be used to connect a charger to charge electronic device 100, transfer data between electronic device 100 and peripheral devices, or connect headphones to play audio.

[0101] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 can also power the electronic device through the power management module 141.

[0102] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160.

[0103] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0104] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0105] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low-noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via the antenna 1.

[0106] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0107] The electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.

[0108] The display screen 194 is used to display images, videos, etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.

[0109] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0110] The ISP is used to process data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then transmitted to the ISP for processing and converted into an image visible to the naked eye.

[0111] The camera 193 is used to capture still images or videos. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0112] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0113] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0114] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0115] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0116] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0117] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some examples, the audio module 170 can be set in the processor 110, or some functional modules of the audio module 170 can be set in the processor 110. The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. The microphone 170C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.

[0118] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0119] Buttons 190 include a power button, a volume button, etc. Motor 191 can generate vibration prompts. Indicator 192 can be an indicator light that can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0120] The SIM card interface 195 is used to connect a SIM card. A SIM card can be connected to and disconnected from the electronic device 100 by inserting or removing it from the SIM card interface 195. The electronic device 100 may support one or N SIM card interfaces, where N is a positive integer greater than 1. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some examples, the electronic device 100 uses an eSIM, or embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0121] The electronic device 100 may be a mobile phone, tablet computer, laptop computer, smart watch, smart bracelet, etc. The embodiment of the present application does not limit the specific type of the electronic device 100. The operating system (i.e., host OS) installed in the electronic device 100 may be Or other operating systems.

[0122] The following introduces the graphic display scenario provided by the embodiment of the present application based on the above-mentioned electronic device 100.

[0123] 4A to 4G exemplarily illustrate a graphic display scenario based on multiple operating systems.

[0124] 4A , the electronic device 100 may display a user interface 410. The user interface 410 may also be referred to as a desktop of the electronic device 100. The user interface 410 may include a display area 411 and a task bar 412.

[0125] The display area 411 may be used to display application icons, desktop wallpapers, and other content of the apps in the electronic device 100. The apps in the electronic device 100 may include host-side apps and client-side apps. For example, the display area 411 may display application icons for a note application icon 411A, a browser application icon 411B, a video application icon 411C, a game application icon, a gallery application icon, and the like. The application icons displayed in the display area 411 may include application icons for host-side apps and application icons for client-side apps.

[0126] In one possible implementation, the application icon of the client-side APP may have a client identifier so that the user can distinguish between the host-side APP and the client-side APP. The embodiment of the present application does not limit the display style of the above application icon.

[0127] Here, the note application is used as the host-side APP, and the browser application and video application are used as client-side APPs as examples for explanation.

[0128] The taskbar 412 may include a search box 412A, an application area 412B, and a system tray 412C. The search box 412A may be used to search for apps, files, and other information within the electronic device 100. The application area 412B may be used to display application icons. The application icons displayed in the application area 412B may include application icons pinned to the taskbar 412 and application icons for apps currently running within the electronic device 100. The system tray 412C may be used to display time information, notification messages, battery status, keyboard input management, and other content.

[0129] For example, the application area 412B may display a browser application icon, a note application icon, and a video application icon. This may indicate that the browser application, the note application, and the video application are currently running on the electronic device 100. In response to an operation (e.g., a click operation) on an application icon in the application area 412B, the electronic device 100 may display the application window of the APP corresponding to this application icon on the user interface 410 or minimize the application window of the APP corresponding to this application icon.

[0130] In a possible implementation, the user interface 410 may be displayed and managed by a desktop application, which may be a host-side APP.

[0131] As shown in FIG. 4B , the electronic device 100 may display an application window 431 of a note application and an application window 432 of a video application on a user interface 430 .

[0132] In one possible implementation, since the video application is a client-side APP in the electronic device 100 , the client OS can perform rendering and synthesis based on the rendering instructions of the video application to obtain display data of the video application window 432 .

[0133] As shown in Figure 4C, the video application may issue a rendering instruction during operation. The rendering instruction may be used to draw the video application window 432. The client OS may perform rendering according to the rendering instruction of the video application to generate one or more layers corresponding to the video application window 432.

[0134] For example, video application window 432 includes three layers: layer 441, layer 442, and layer 443. Layer 441 can be used to display a title bar to indicate information such as the name of the video application. Layer 442 can be used to display information such as the video application's video content and controls for controlling video playback. Layer 443 can be used to display information such as bullet comments during video playback. This embodiment of the application does not limit the layers included in video application window 432.

[0135] Furthermore, the client OS may perform layer synthesis based on the layer position information and layer level information of layers 441, 442, and 443 to obtain layer 444. Layer 444 may represent display data of video application window 432. This display data may include pixel data for each point in video application window 432.

[0136] The specific implementation of the rendering and synthesis performed by the client OS will be described in subsequent embodiments and will not be expanded here.

[0137] The client OS can send the handle corresponding to the synthesized layer 444 and the window information of the video application window 432 to the host OS so that the host OS can display the video application window 432 on the display screen. The layer 444 can be stored in the video memory of the electronic device 100. The handle corresponding to the layer 444 can be used to indicate the storage location of the layer 444 in the video memory. The host OS can retrieve the layer 444 from the video memory based on the handle corresponding to the layer 444. The window information of the video application window 432 can include the window position information, window size information, and window hierarchy information of the video application window 432 displayed on the display screen.

[0138] As shown in Figure 4D, when the layer and window information of the application window of the client-side APP are obtained, the host OS can synthesize the layer of the application window of the client-side APP with the layer of the application window of the APP running on the host side, and then send it to the display screen.

[0139] For example, since the note application is a host-side APP, the host OS can render and synthesize based on the rendering instructions of the note application to obtain the display data of the note application window 431. Similarly, since the desktop application is a host-side APP, the host OS can render and synthesize based on the rendering instructions of the desktop application to obtain the display data of the desktop. The layer 445 shown in Figure 4D can represent the display data of the note application window 431. The layer 446 shown in Figure 4D can represent the display data of the desktop. The layer 444 shown in Figure 4D can be obtained by the host OS from the video memory of the electronic device 100 according to the handle sent by the client OS.

[0140] Furthermore, the host OS can perform layer synthesis on layers 444, 445, and 446 based on the window information of the client-side app and the window information of the host-side app, resulting in layer 447 as shown in FIG4D . Layer 447 can represent the display data of the interface after the application window of the client-side app and the application window of the host-side app are synthesized. The host OS can display the display on the display screen based on the display data corresponding to layer 447. In this way, electronic device 100 can display the display content shown in FIG4B on the display screen.

[0141] In some embodiments, multiple client-side APPs are running, and all need to display application windows on the display screen. The client OS can render and synthesize according to the rendering instructions of these multiple client-side APPs to obtain display data of these multiple client-side APP application windows. The client OS can store the display data of these multiple client-side APP application windows in the video memory of the electronic device 100. The client OS can send the handle corresponding to the above display data to the host OS. Then, the host OS can obtain the display data of the above multiple client-side APP application windows from the video memory according to the received handle. The host OS can synthesize the application window of the APP running in the host machine and the application windows of the above multiple client-side APPs and send them for display.

[0142] As shown in Figure 4E, the electronic device 100 can display a note application window 431, a video application window 432, and a browser application window 451 on the user interface 450. Among them, the electronic device 100 is running a video application and a browser application in the client, and running a note application and a desktop application in the host. Based on the above-mentioned video application, the electronic device 100 can display a video application window 432. Based on the above-mentioned browser application, the electronic device 100 can display a browser application window 451. Based on the above-mentioned note application, the electronic device 100 can display a note application window 431. Based on the above-mentioned desktop application, the electronic device 100 can display a desktop, that is, a user interface 450 (the display content of the desktop can refer to the user interface 410 shown in Figure 4A above).

[0143] In one possible implementation, since the browser application is a client-side APP in the electronic device 100 , the client OS can render and synthesize based on the rendering instructions of the browser application to obtain display data of the browser application window 451 .

[0144] As shown in Figure 4F, the browser application may issue a rendering instruction during operation. The rendering instruction may be used to draw the browser application window 451. The client OS may render according to the rendering instruction of the browser application to generate one or more layers corresponding to the browser application window 451.

[0145] For example, browser application window 451 includes two layers: layer 461 and layer 462. Layer 461 can be used to display a title bar to indicate information such as the name of the browser application. Layer 462 can be used to display controls such as a website input box and a search box in the browser application. This embodiment of the application does not limit the layers included in browser application window 451.

[0146] The client OS may perform layer synthesis based on the layer position information and layer level information of layers 461 and 462 to obtain layer 463. Layer 463 may represent the display data of browser application window 451. The display data may include pixel data of each point in browser application window 451.

[0147] The client OS can send the handle corresponding to the synthesized layer 463 and the window information of the browser application window 451 to the host OS so that the host OS can display the browser application window 451 on the display screen. The layer 463 can be stored in the video memory of the electronic device 100. The handle corresponding to the layer 463 can be used to indicate the storage location of the layer 463 in the video memory. The host OS can retrieve the layer 463 from the video memory based on the handle corresponding to the layer 463. The window information of the browser application window 451 can include the window position information, window size information, and window hierarchy information of the browser application window 451 displayed on the display screen.

[0148] The client OS may also render according to the rendering instructions of the video application to generate a layer corresponding to the video application window 432 and composite the layers corresponding to the video application window 432. The method by which the client OS renders and composites based on the rendering instructions of the video application to obtain display data for the video application window 432 can be referred to the description of the embodiment shown in FIG. 4C .

[0149] As shown in Figure 4G, the host OS can obtain layer 444, layer 445, layer 446 and layer 463. The method for obtaining the above-mentioned layers 444, 445 and 446 can refer to the introduction of the embodiment shown in Figure 4D. Then, the host OS can synthesize layers 444, 445, 446 and 463 based on the window information of the client-side APP (such as browser application and video application) and the window information of the host-side APP (such as note application and desktop application) to obtain layer 464 shown in Figure 4G. Layer 464 can represent the display data of the interface after the application window of the client-side APP and the application window of the host-side APP are synthesized. The host OS can display on the display screen according to the display data corresponding to layer 464. In this way, the electronic device 100 can display the display content shown in Figure 4E on the display screen.

[0150] In some embodiments, after the client OS renders and synthesizes the composite layer of the video application window (refer to layer 444 shown in FIG. 4G ) and the composite layer of the browser application window (refer to layer 463 shown in FIG. 4G ) according to the rendering instructions of the video application and the browser application, the client OS can synthesize the above-mentioned layer 444 and layer 463. Then, the host OS can obtain the display data of the above-mentioned synthesized layer 444 and layer 463. The host OS can synthesize the composite layer of the application window in the host OS (layer 445 and layer 446 shown in FIG. 4G ) with the above-mentioned synthesized layer 444 and layer 463 to display the application window of the host-side APP and the application window of the client-side APP on the display screen.

[0151] Among them, the display content of the above-mentioned synthesized layer 444 and layer 463 can refer to the display content of the video application window 432 and the browser application window 451 shown in Figure 4E. Since the host OS obtains the synthesized layer 444 and layer 463 for display, the video application window 432 and the browser application window 451 can be located at the same display level on the display screen. For example, in Figure 4E, if the display level of the video application window 432 and the browser application window 451 is above the display level of the note application window 431, the video application window 432 and / or the browser application window 451 may block the note application window 431. If the display level of the note application window 431 is above the display level of the video application window 432 and the browser application window 451, the note application window 431 may block the video application window 432 and / or the browser application window 451.

[0152] As can be seen from the scenarios shown in Figures 4A to 4G above, in an electronic device 100 where multiple operating systems are running simultaneously, when the client-side APP needs to display an application window, the client OS can render and synthesize the display content of the application window based on the rendering instructions of the APP. The client only needs to send the window information and the handle for indexing the application window display data to the host OS, without sending a large number of rendering instructions to the host OS. The above embodiment can increase the speed at which the electronic device 100 draws a frame of image, so that the client-side APP in the electronic device 100 can support a high refresh rate when running. The refresh rate of the client-side APP during operation can reach or approach the operating effect of the host-side APP. This can effectively improve the user's experience of viewing the screen when using the client-side APP.

[0153] The following takes the client OS as Host OS The present application provides a method for rendering and synthesizing a client OS as an example.

[0154] FIG5 exemplarily shows a structural diagram of an electronic device 100 .

[0155] As shown in Figure 5, electronic device 100 may include a client OS and a host OS. Electronic device 100 may also include hardware such as / dev / gpu0, / dev / dma_heap, and / dev / fb0. / dev / gpu0 may represent the rendering device of electronic device 100. / dev / dma_heap may represent the video memory of electronic device 100. / dev / fb0 may represent the display device of electronic device 100. The client OS and host OS may share the rendering device and video memory of electronic device 100.

[0156] The client OS may include a client-side APP, FrameWork, libEGL, libGLES, SurfaceFlinger, Platform hostConn, Gralloc, and HWComposer. The client-side APP may belong to the application layer of the client OS. FrameWork may be the application framework layer of the client OS. LibEGL, libGLES, SurfaceFlinger, and Platform hostConn may belong to the system library of the client OS. Gralloc and HWComposer may belong to the hardware abstraction layer of the client OS. The various layers in the client OS may communicate with each other through a software structure. The client OS is not limited to the above-mentioned layered architecture and may also adopt its own software system architecture.

[0157] The client-side APP may include one or more APPs that can be run through the client OS. The embodiment of the present application does not limit the type of the client-side APP.

[0158] FrameWork can provide an application programming interface (API) and programming framework for client-side apps in the client OS. FrameWork can include some predefined functions.

[0159] As shown in FIG5 , FrameWork may include libui and a window manager (WindowManager).

[0160] libui can be Libui is a native framework for the graphics library. It provides a graphical interface framework, event processing framework, camera output, overlay display framework, and other frameworks, and is the core of the graphical user interaction system.

[0161] The WindowManager can be used to manage window programs. The WindowManager can obtain the size of the electronic device 100's display screen, determine whether there is a status bar, lock the screen, take screenshots, etc. The WindowManager can also determine the window information (such as window position information, window size information, window hierarchy information, etc.) of the application window that the app needs to display during runtime.

[0162] Not limited to libui and WindowManager, FrameWork can also include more modules, such as resource manager, notification manager, activity manager, etc.

[0163] libEGL can be an interface between a rendering API and a native windowing system. The rendering API can include a 3D graphics processing library (e.g., libGLES), a 2D graphics engine (e.g., SGL), and so on. libEGL can provide one or more of the following mechanisms: communicating with the native windowing system in the electronic device 100, querying available types and configurations of graphical surfaces, creating graphical surfaces, synchronizing rendering between rendering APIs, and managing rendering resources such as texture maps.

[0164] libGLES can be an API for specifying standards for 3D graphics processing hardware. The client OS can call libGLES to drive the GPU to perform graphics rendering. Specifically, libGLES can control the operating state of the graphics rendering pipeline state machine by driving the GPU (also known as the rendering device in this application) to perform graphics rendering. Besides libGLES, the client OS can also use other rendering APIs to perform graphics rendering.

[0165] In the present application, the rendering device can perform graphics rendering according to the rendering instructions from libGLES to obtain the display data of the layer in the application window. The display data of the layer can be stored in the video memory of the electronic device 100.

[0166] SurfaceFlinger is The system service in [ ] can be used to obtain the handle of each layer's display data in the video memory. The handle of a layer's display data can be used to indicate the location of the display data of this layer in the video memory. In other words, the handle can be used as the address information in the video memory.

[0167] SurfaceFlinger can also be used to send a handle to the display data of the layer contained in an application window to HWComposer to instruct HWComposer to synthesize the layer contained in this application window.

[0168] The hardware composer (HWComposer) can be used to perform layer synthesis. Among them, HWComposer can receive the layer synthesis instructions sent by SurfaceFlinger and the handle of the display data of the layer to be synthesized. HWComposer can obtain the display data of the synthesized layer from the video memory according to the handle of the display data of the layer to be synthesized, and perform layer synthesis. HWComposer can store the display data of the synthesized layer (i.e., the synthesized layer) in the video memory. HWComposer can send the handle of the display data of the synthesized layer to Platform hostConn.

[0169] Gralloc can be used to manage video memory. Gralloc can allocate storage space in video memory. For example, Gralloc can divide one or more graphics buffers (GraphicBuffer) from video memory. A GraphicBuffer can be used to store the display data of a layer. That is, the address information of a GraphicBuffer can be represented by a handle. Through the handle corresponding to a GraphicBuffer, the display data of the layer stored in this GraphicBuffer can be obtained. Gralloc can also release storage space in video memory. For example, when the display data of a layer in a GraphicBuffer is taken out and used to display on the display screen, Gralloc can release this GraphicBuffer (that is, delete the data stored in this GraphicBuffer).

[0170] Platform hostConn can be used for communication between the guest OS and the host OS.

[0171] The host OS may include host-side APP, UI FrameWork, Platform hostConn Server, Render Service, libEGL, and libGLES.

[0172] The host-side APP may include one or more APPs that can be run through the host OS. The embodiment of the present application does not limit the type of the host-side APP.

[0173] The UI FrameWork is the UI framework layer of the host operating system. The UI FrameWork provides methods related to graphics drawing. The UI FrameWork can include graphics controls, page layout, window management modules, and more.

[0174] Platform hostConn Server can be used for communication between the host OS and the guest OS.

[0175] The Render Service is the rendering module in the host OS. It provides rendering and drawing capabilities for the UI Framework. For example, the Render Service can convert ArkUI control descriptions into drawing tree information and perform optimal rendering based on the corresponding rendering strategy. The Render Service also provides the core underlying mechanisms for smooth multi-window operation and spatial UI sharing.

[0176] The Render Service may include Composer and BackStore. Composer can be used for layer composition. BackStore can be used to manage the video memory of the electronic device 100. The role of BackStore can be referred to in the above introduction to Gralloc in the client OS.

[0177] For the libEGL and libGLES in the host OS, please refer to the aforementioned introduction to libEGL and libGLES in the client OS, and will not be repeated here.

[0178] (1) The client OS performs graphics rendering.

[0179] In the electronic device 100 shown in Figure 5, client-side apps can send rendering instructions to libGLES via libEGL. In another possible implementation, the client-side app can call an interface in libUI to determine rendering instructions, and then send the rendering instructions to libGLES via libEGL. Apps such as gaming and video applications require extensive display content, and the screen content changes rapidly. These apps require a large number of rendering instructions to present the corresponding gaming and video playback effects. Therefore, apps such as gaming and video applications that require a large number of rendering instructions to draw their interfaces can pass their own rendering instructions to libGLES. Apps such as desktop and note-taking apps require relatively less display content, and the screen content changes little. These apps can display their corresponding user interfaces without requiring a large number of rendering instructions. libUI may contain interfaces corresponding to elements such as graphical controls and page layouts, which apps can reuse to generate the corresponding rendering instructions. Therefore, apps such as desktop and note-taking apps that do not require a large number of rendering instructions to draw their interfaces can call interfaces in libUI to determine rendering instructions, and then pass them to libGLES.

[0180] The embodiment of the present application does not limit the method by which the client-side APP calls libGLES and transmits rendering instructions.

[0181] When libEGL receives a rendering instruction, on the one hand, libEGL can send the rendering instruction to libGLES; on the other hand, libEGL can create a graphics interface (surface) according to the rendering instruction. Among them, surface can be a class used to provide a graphics buffer (GraphicBuffer) to a graphics producer (such as a rendering API such as libGLES). LibGLES can obtain the GraphicBuffer in the video memory (i.e., / dev / dma_heap) through surface. Specifically, since Gralloc is used to manage video memory, libGLES can call Gralloc through surface to obtain GraphicBuffer. What libGLES obtains can be the address information of the GraphicBuffer allocated by Gralloc in the video memory. The embodiment of the present application does not limit the specific implementation method of creating a surface and obtaining a GraphicBuffer.

[0182] libGLES can send the acquired rendering instructions and the address information of GraphicBuffer to the rendering device (i.e., / dev / gpu0), thereby instructing the rendering device to perform graphics rendering in the corresponding storage space in the video memory. In one possible implementation, libGLES can send rendering instructions to the driver for controlling the rendering device (e.g., display driver, GPU driver, etc.). The driver can translate the rendering instructions into instructions readable by the rendering device. The rendering device can then perform graphics rendering according to the rendering instructions translated by the driver, and store the rendered display data in the GraphicBuffer corresponding to the address information sent by libGLES. Among them, the application window of an APP can contain multiple layers. The rendering device can render the multiple layers contained in the application window of an APP according to the rendering instructions of the APP. The display data of a layer can be stored in a GraphicBuffer.

[0183] (2) The client OS performs layer synthesis.

[0184] When creating the above surface, the application can create a layer within SurfaceFlinger. A layer is a class that provides a GraphicBuffer containing display data to graphics consumers (such as SurfaceFlinger and HWComposer, which process display data rendered by the rendering device). SurfaceFlinger can use the layer to obtain the GraphicBuffer containing display data in video memory.

[0185] In one possible implementation, SurfaceFlinger can specifically obtain the address information of the GraphicBuffer in video memory to determine the handle corresponding to each GraphicBuffer. One GraphicBuffer can correspond to one handle. SurfaceFlinger can send the handle corresponding to the GraphicBuffer to be synthesized to HWComposer. The GraphicBuffer to be synthesized can represent a GraphicBuffer that stores the display data of a layer to be synthesized in an application window. Based on the received handle, HWComposer can find the corresponding GraphicBuffer in video memory to obtain the display data stored in these GraphicBuffers. HWComposer can then perform layer synthesis based on the obtained display data. The synthesized layer (i.e., the synthesized layer) can represent the display content of an application window. That is, the display data of the synthesized layer can be used to draw an application window on the display screen. HWComposer can store the display data of the synthesized layer in a GraphicBuffer in video memory and obtain the address information of the GraphicBuffer storing the display data of the synthesized layer to determine the handle corresponding to the GraphicBuffer of the synthesized layer. Gralloc can allocate a GraphicBuffer in video memory to store the display data of the synthesized layer. Alternatively, the GraphicBuffer storing the display data of the above-mentioned composite layer can be allocated by the host OS. For example, the BackStore in the host OS can allocate the GraphicBuffer of the application window for all APPs (including host-side APPs and client-side APPs) in the electronic device 100 in the video memory. The GraphicBuffer of an application window can be used to store the display data of the composite layer obtained by synthesizing the layers contained in this application window. The GraphicBuffer of an application window can correspond to a handle (also called a window memory handle). The host OS can send the window memory handle corresponding to the application window of the client-side APP to the client OS. Then, the client OS can store the composite layer of the corresponding application window in the GraphicBuffer corresponding to the window memory handle. In other words, the handle corresponding to the composite layer of the client-side APP application window can be the window memory handle corresponding to the client-side APP in the host OS.

[0186] The embodiment of the present application does not limit the specific implementation method of HWComposer storing the display data of the composite layer into GraphicBuffer.

[0187] For example, application window 1 contains layer 1, layer 2, and layer 3. The video memory includes three GraphicBuffers. These three GraphicBuffers store the display data of layer 1, layer 2, and layer 3 respectively. SurfaceFlinger can obtain the handles corresponding to these three GraphicBuffers and send them to HWComposer. In this way, HWComposer can obtain the display data of layer 1, layer 2, and layer 3 from the video memory based on the handles corresponding to these three GraphicBuffers, and then perform layer synthesis on layer 1, layer 2, and layer 3. The synthesized layer can represent the display content of application window 1.

[0188] It can be understood that the handle corresponding to the GraphicBuffer of the composite layer can also be called the handle corresponding to the composite layer, or the handle corresponding to the display data of the composite layer.

[0189] (3) The host OS displays the application window of the client-side APP.

[0190] The HWComposer in the client OS can send the handle corresponding to the composite layer to the Platform hostConn. The WindowManager in the client OS can determine the window information of the application window of the client-side APP. In one possible implementation, the host OS can detect operations on the application window of the client-side APP (such as drag operations, click operations, zoom operations, etc.). These operations can change one or more window information such as the position, size, and level of the application window of the client-side APP. The host OS can generate corresponding operation events based on the above operations, and send the operation events to the client OS through the Platform hostConn Server. The client-side APP can obtain the above operation events, and based on the above operation events, call the WindowManager to determine the window information of the application window of the client-side APP. The embodiment of the present application does not limit the method for the client OS to determine the window information of the application window of the client-side APP.

[0191] Among them, WindowManager can send the window information of the application window corresponding to the above-mentioned composite layer to Platform hostConn.

[0192] Platform hostConn can send the handle corresponding to the above-mentioned composite layer and the window information of the application window corresponding to the composite layer to the Platform hostConn Server in the host OS.

[0193] The host OS can display the application window of the client-side APP based on the handle corresponding to the composite layer in the client OS and the window information of the application window corresponding to the composite layer.

[0194] In a possible implementation, the Platform hostConn Server may send the handle corresponding to the composite layer in the client OS and the window information of the application window corresponding to the composite layer to the Composer in the host OS through the UI FrameWork.

[0195] In this way, the Composer in the host OS can obtain the handle corresponding to the composite layer in the client OS, as well as the window information of the application window corresponding to the composite layer.

[0196] In addition to client-side apps, electronic device 100 may also run host-side apps. Electronic device 100 can simultaneously display application windows of client-side apps and host-side apps on the display screen. All application windows displayed on the display screen of electronic device 100, whether client-side or host-side, may have a hierarchical relationship. Application windows at higher levels may obstruct application windows at lower levels. For example, browser application window 451 shown in FIG4E is at a higher level than video application window 432. Browser application window 451 partially obscures video application window 432. The window information of the application window corresponding to the composite layer in the client OS may include window level information, window position information, and window size information. The window level information may be used to indicate the display level of the application window corresponding to the composite layer in the client OS among all application windows displayed on the display screen. The window position information may be used to indicate the display position of the application window corresponding to the composite layer in the client OS on the display screen. The window size information may be used to indicate the display size of the application window corresponding to the composite layer in the client OS on the display screen.

[0197] Since the display screen also includes the application window of the host-side APP, the host OS can obtain the display data of the synthetic layer corresponding to the application window of the host-side APP and the window information of the application window of the host-side APP.

[0198] In one possible implementation, the host-side APP can send rendering instructions to libGLES through UI FrameWork and libEGL. The libGLES in the host OS can send rendering instructions to the rendering device (i.e., / dev / gpu0), thereby controlling the rendering device to perform graphics rendering. Among them, the BackStore in the Render Service can manage the video memory (i.e., / dev / dma_heap) and allocate a GraphicBuffer in the video memory for storing the display data of the host-side APP. After the rendering device performs graphics rendering according to the rendering instructions of the host-side APP, it can store the rendered display data in the GraphicBuffer of the video memory. Similar to the client OS, a GraphicBuffer in the video memory can store the display data of a layer contained in the application window of the host-side APP. Then, the Composer in the Render Service can obtain the display data of the layer contained in an application window of the host-side APP from the video memory and perform layer synthesis. The above-mentioned synthesized layer (i.e., the synthesized layer) can represent the display content of an application window of the host-side APP.

[0199] The UI Framework in the host OS can determine the window information of the host app's application window. The UI Framework can send this window information to Composer. This window information can include window hierarchy information, window position information, and window size information.

[0200] In this way, the Composer in the host OS can obtain the display data of the composite layer corresponding to the application window of the host-side APP, as well as the window information of the application window of the host-side APP.

[0201] Furthermore, Composer can synthesize the application window of the host-side APP and the application window of the client-side APP. The above-mentioned synthesizing of the application window can specifically mean synthesizing the synthesis layer corresponding to the application window.

[0202] Among them, according to the handle corresponding to the composite layer in the client OS, the Composer can obtain the display data of the composite layer in the client OS from the video memory. According to the display data of the composite layer in the client OS, the window information of the application window corresponding to the composite layer in the client OS, the display data of the composite layer corresponding to the application window of the host-side APP, and the window information of the application window of the host-side APP, the Composer can synthesize the application window of the host-side APP and the application window of the client-side APP, thereby obtaining a frame of image finally presented on the display screen. The display data of this frame of image may include pixel data of each point on the display screen. The Composer can send the display data of this frame of image to the display device (i.e., / dev / fb0) in the electronic device 100. The display device can display the display data of this frame of image on the display screen of the electronic device 100. In this way, the electronic device 100 realizes the display of the application window of the host-side APP and the application window of the client-side APP on the display screen.

[0203] In some embodiments, after the aforementioned frame of image is displayed on the display screen, the Composer can send the display data of the next frame of image, which is a composite of the application windows of the host-side app and the client-side app, to the display device. In this way, after the display screen completes refreshing one frame of image, it can begin refreshing the next frame of image based on the display data in the display device.

[0204] In some embodiments, when multiple client-side apps are running and their application windows need to be displayed, the client OS can render and composite the application windows of each of these client-side apps separately, obtaining multiple composite layers corresponding to the application windows of these client-side apps. The client OS can send these multiple composite layers to the host OS. The host OS can then display the application windows of these client-side apps based on these multiple composite layers. For example, the client OS can render and composite the layers contained in application window 1 of client-side app 1 to obtain composite layer 1. The client OS can render and composite the layers contained in application window 2 of client-side app 2 to obtain composite layer 2. The client OS can send the handles corresponding to composite layer 1 and composite layer 2 to the host OS. The client OS can also send the application window information of client-side app 1 and client-side app 2 to the host OS. The host OS can obtain the display data of composite layer 1 and composite layer 2 based on the handles corresponding to composite layer 1 and composite layer 2, respectively. The host OS can then display application window 1 and application window 2 on the display screen.

[0205] Among them, the host OS can determine the display levels of the client-side APP1, client-side APP2 and the application windows of one or more host-side APPs on the display screen based on the application window information of the client-side APP1, client-side APP2 and the application window information of one or more host-side APPs. For example, the application window 1 of the client-side APP1 may be located at the top layer. The application window 2 of the client-side APP2 may be located at the bottom layer. The layer corresponding to the application window 1 and the layer corresponding to the application window 2 may include layers corresponding to the application windows of one or more host-side APPs. It can be seen that the composite layers of the application windows of multiple client-side APPs obtained by the host OS can be independent of each other. In this way, the user can arbitrarily adjust the display level order between the application windows of the host-side APP and the client-side APP on the display screen. The user's experience of using the client-side APP can be better consistent with the experience of using the host-side APP.

[0206] In other embodiments, in scenarios where multiple client-side apps are running and their application windows need to be displayed, after obtaining multiple composite layers corresponding to these multiple client-side app windows, the client OS may composite these multiple composite layers to obtain a final composite layer. The HWComposer in the client OS may obtain window information, such as window position information, window size information, and local hierarchy information, for these multiple client-side app windows. The window position information of a client-side app window may indicate the display position of the window on the display screen. The window size information of a client-side app window may indicate the display size of the window on the display screen. The local hierarchy information of a client-side app window may indicate the display hierarchy of the window within these multiple client-side app windows. The HWComposer may composite these multiple composite layers based on the multiple composite layers corresponding to these multiple client-side app windows, as well as the window position information, window size information, and local hierarchy information. This final composite layer may represent the display data of these multiple application windows on the display screen. The client OS may store this final composite layer in video memory and send a handle to this final composite layer to the host OS. The host OS can obtain the final composite layer from the video memory according to the received handle and display the multiple client-side APP application windows on the display screen according to the final composite layer.

[0207] It is understandable that the client OS and host OS shown in Figure 5 may also include more or fewer modules, which is not limited in this embodiment of the present application.

[0208] As shown in Figure 5, when the client-side app is running, it can implement direct-drive graphics rendering within a single process via APP → libEGL → libGLES → / dev / gpu0 → / dev / dma_heap. The client OS can then composite the rendered layers and send the corresponding handles for the composited layers to the host OS, which then displays them. This embodiment avoids the client OS having to transmit a large number of rendering instructions to the host OS when running the client-side app, and then the host OS rendering, compositing, and displaying them based on the client-side app's rendering instructions. Because the amount of data transmitted by the client OS for the corresponding handles for the composited layers is much smaller than the amount of data transmitted for the rendering instructions, the host OS can more quickly obtain the display data for the composited layers of the client-side app's application window. This allows the electronic device to increase the speed at which a frame containing the client-side app's application window is drawn, enabling the client-side app to support a high refresh rate during runtime. The client-side app's refresh rate during runtime can reach or approach that of the host-side app, improving the user's screen viewing experience when using the client-side app.

[0209] The following takes the client OS as The host OS is The present application provides a method for rendering and synthesizing a client OS as an example.

[0210] FIG6 exemplarily shows a structural diagram of another electronic device 100 .

[0211] As shown in Figure 6, the electronic device 100 may include a client OS and a host OS. The electronic device 100 may also include hardware such as / dev / gpu0 (i.e., rendering device), / dev / dma_heap (i.e., video memory), and / dev / fb0 (i.e., display device). For details about / dev / gpu0, / dev / dma_heap, and / dev / fb0, please refer to the description of the previous embodiment. Detailed description will not be given here. The client OS and the host OS may share the rendering device and video memory of the electronic device 100.

[0212] The client OS can include Linux X11APP, Linux Wayland APP, Xwayland, Weston, Zink, libvulkan, libEGL, and libGLES.

[0213] The client OS can use two display server protocols simultaneously: X11 and Wayland. A display server is a program that coordinates input and output between apps and other parts of the OS, as well as between the hardware and the OS. Based on the display server, electronic devices can provide users with a graphical way to use the electronic device. The display server provides a graphical environment framework so that users can interact with apps using input devices such as a mouse and keyboard. The display server can communicate with apps using the display server protocol.

[0214] The display server protocol X11 describes how to exchange messages between the app and the display. These messages may include the app's rendering instructions.

[0215] The display server protocol Wayland specifies the communication method between the display server and the APP.

[0216] The differences between Wayland and X11 include: Wayland stipulates that the APP itself is responsible for drawing the application window borders and decorations, and the APP can directly calculate and draw its own buffers through libEGL and some Wayland-specific libEGL extension components.

[0217] The aforementioned Linux X11 app can refer to an app that uses X11 to run applications and render application windows. The aforementioned Linux Wayland app can refer to an app that uses Wayland to run applications and render application windows. Linux X11 apps and Linux Wayland apps can be collectively referred to as client-side apps. These apps are not limited to Linux X11 apps and Linux Wayland apps; client-side apps can also include other types of apps, such as apps that use other display server protocols such as Mir.

[0218] Xwayland can be used to provide window management services, layer synthesis services, and graphics buffer management services for Linux X11 apps. The above-mentioned window management services can be used to determine the window information of the Linux X11 app's application window, such as window position information, window size information, and window hierarchy information. The above-mentioned layer synthesis services can be used to obtain and synthesize the layers contained in the Linux X11 app's application window to obtain the synthesized layer corresponding to the Linux X11 app's application window. The above-mentioned graphics buffer management services can be used to allocate a graphics buffer for the Linux X11 app in the video memory of the electronic device 100. The graphics buffer can be used to store display data of the layers contained in the application window.

[0219] In some embodiments, Xwayland can provide an X server in Wayland so that Linux X11 apps can run seamlessly in Wayland.

[0220] Zink is a new virtual driver for OpenGL based on libvulkan, which can provide OpenGL support on top of libvulkan's hardware driver. Zink can provide an interface between Xwayland and libvulkan.

[0221] libvulkan is a cross-platform API for 2D and 3D graphics applications. The client operating system can call libvulkan to drive the GPU to perform graphics rendering. libGLES can drive rendering instructions to the GPU (also known as the rendering device in this application) to achieve graphics rendering.

[0222] Weston is an implementation of a Wayland compositor. A Wayland compositor can refer to a display server that implements the Wayland display server protocol. Besides Weston, a Wayland compositor can also be any of the following implementations: Mutter, KWin, and Enlightenment. The present embodiments do not limit the implementation of a Wayland compositor.

[0223] Weston includes WaylandServer, WindowManager, and Platform hostConn. WaylandServer can be used to communicate with Linux Wayland apps, such as receiving rendering instructions from them. WindowManager can be used to provide window management services for Linux Wayland apps. Platform hostConn can be used to provide communication services between the client OS and the host OS.

[0224] Weston can also include modules such as a layer composition module and a graphics buffer management module. The layer composition module can be used to provide layer composition services for Linux Wayland apps. The graphics buffer management module can be used to provide graphics buffer management services for Linux Wayland apps.

[0225] The libEGL and libGLES shown in FIG6 can refer to the introduction of libEGL and libGLES in the client OS, respectively, in the embodiment of FIG5 . The modules and their functions included in the host OS shown in FIG6 can refer to the introduction of the host OS in the embodiment of FIG5 . Detailed description is omitted here.

[0226] (1) The client OS performs graphics rendering.

[0227] In the electronic device 100 shown in Figure 6, Linux X11APP can send rendering instructions to libvulkan through Xwayland and Zink. In one possible implementation, when Xwayland receives the rendering instruction of Linux X11APP, in addition to transmitting the rendering instruction to Zink, Xwayland can also allocate a graphics buffer in the video memory for Linux X11APP according to the rendering instruction. The number of graphics buffers can be determined by the number of layers contained in the application window of Linux X11APP. For example, the application window of Linux X11APP contains n1 layers. n1 is a positive integer. Then Xwayland can allocate n1 graphics buffers for the Linux X11APP in the video memory. One graphics buffer can store the display data of one layer. Xwayland can send the address information of the graphics buffer allocated for Linux X11APP in the video memory to libvulkan through Zink.

[0228] Libvulkan can send the acquired rendering instructions and the address information of the graphics buffer to the rendering device, thereby instructing the rendering device to perform graphics rendering in the graphics buffer corresponding to the address information in the video memory. In one possible implementation, libvulkan can send the rendering instructions to the driver for controlling the rendering device (for example, a display driver, a GPU driver, etc.). The driver can translate the rendering instructions into instructions readable by the rendering device. The rendering device can then perform graphics rendering according to the rendering instructions translated by the driver, and store the rendered display data in the graphics buffer corresponding to the address information sent by libvulkan.

[0229] In the electronic device 100 shown in FIG6 , the Linux Wayland APP can send rendering instructions to libGLES through Weston and libEGL. Optionally, the Linux Wayland APP can also send rendering instructions directly to libGLES through libEGL. In one possible implementation, Weston can allocate a graphics buffer in the video memory for the Linux Wayland APP. Weston can send the address information of the graphics buffer allocated for the Linux Wayland APP in the video memory to libGLES through libEGL.

[0230] LibGLES can send the acquired rendering instructions and the address information of the graphics buffer to the rendering device, thereby instructing the rendering device to perform graphics rendering in the corresponding storage space in the video memory. In one possible implementation, libGLES can send the rendering instructions to the driver for controlling the rendering device (for example, a display driver, a GPU driver, etc.). The driver can translate the rendering instructions into instructions readable by the rendering device. The rendering device can then perform graphics rendering according to the rendering instructions translated by the driver, and store the rendered display data in the graphics buffer corresponding to the address information sent by libGLES. Among them, the application window of a Linux Wayland APP can contain multiple layers. The rendering device can render the multiple layers contained in the application window of this Linux Wayland APP respectively according to the rendering instructions of this Linux Wayland APP. The display data of a layer can be stored in a graphics buffer.

[0231] (2) The client OS performs graphics synthesis.

[0232] Xwayland can obtain the display data of the layers contained in a Linux X11APP application window from the video memory and perform layer synthesis based on the display data. Xwayland can store the display data of the synthesized layers (i.e., synthesized layers) in the video memory.

[0233] In one possible implementation, Xwayland can send the handle corresponding to the graphics buffer storing the composite layer display data to the host OS via the Platform hostConn in Weston. The handle can represent the address information of the graphics buffer in the video memory, so that the client OS can obtain the display data of the composite layer stored in the graphics buffer from the video memory.

[0234] Weston can obtain the display data of the layers contained in a Linux Wayland APP application window from the video memory and perform layer synthesis based on this display data. Weston can store the display data of the synthesized layer (i.e., the synthesized layer) in the video memory.

[0235] In one possible implementation, Weston can send the handle corresponding to the graphics buffer storing the composite layer display data to the host OS via Platform hostConn. The handle can represent the address information of the graphics buffer in video memory, so that the client OS can retrieve the composite layer display data stored in the graphics buffer from the video memory.

[0236] The handle corresponding to the graphics buffer storing the display data of the composite layer may be referred to as the handle corresponding to the composite layer.

[0237] (3) The host OS displays the application window of the client-side APP.

[0238] In one possible implementation, Xwayland can also determine the window information of the Linux X11 APP application window and send the window information to the host OS through the Platform hostConn in Weston. Weston can determine the window information of the Linux Wayland APP application window and send the window information to the host OS through the Platform hostConn.

[0239] The host OS can receive the handle corresponding to the composite layer in the client OS and the window information of the application window corresponding to the composite layer through the Platform hostConn Server. The host OS can obtain the display data of the composite layer from shared memory based on the handle corresponding to the composite layer in the client OS. The host OS can display the application window of the client-side app based on the display data of the composite layer in the client OS and the window information of the application window corresponding to the composite layer.

[0240] The host OS can also obtain the display data of the composite layer corresponding to the host-side app's application window, as well as the window information of the host-side app's application window. Furthermore, the host OS can synthesize the host-side app's application window with the client-side app's (Linux X11 app and / or Linux Wayland app) application window to obtain a final image frame presented on the display screen.

[0241] The specific implementation method of the host OS displaying the application window of the client-side APP can be referred to the introduction of displaying the application window of the client-side APP in Figure 5 above, which will not be repeated here.

[0242] As shown in Figure 6, when the client-side app is running, it can implement direct graphics rendering within a single process via Linux X11APP→Xwayland→Zink→libvulkan→ / dev / gpu0→ / dev / dma_heap or Linux WaylandAPP→Weston→libEGL→libGLES→ / dev / gpu0→ / dev / dma_heap. The client OS can then synthesize the rendered layers and send the handle corresponding to the synthesized layers to the host OS, which then displays them. The above embodiment can avoid the client OS transmitting a large number of rendering instructions to the host OS when running the client-side app, and then the host OS rendering, synthesizing, and displaying them according to the client-side app's rendering instructions. Because the amount of data transmitted by the client OS for the handle corresponding to the synthesized layers is much smaller than the amount of data transmitted for the rendering instructions, the host OS can obtain the display data of the synthesized layers of the client-side app application window more quickly. In this way, the electronic device can increase the speed at which a frame containing the client-side app application window is drawn, allowing the client-side app to support a high refresh rate during operation. The refresh rate of the client-side APP during operation can reach or approach the operating effect of the host-side APP, improving the user's screen viewing experience when using the client-side APP.

[0243] FIG7 exemplarily shows a structural diagram of another electronic device 100 provided in an embodiment of the present application.

[0244] 7 , the electronic device 100 may include a client OS 710 and a host OS 720. The electronic device 100 may also include hardware devices such as a rendering device 731, a video memory 732, and a display device 733.

[0245] The client OS 710 may include a client-side application 711 , an application framework service 712 , a rendering component 713 , a layer acquisition module 714 , a video memory management module 715 , a layer composition module 716 , and a system connection module 717 .

[0246] The client-side application 711 may include one or more APPs that can be run through the client OS 710 .

[0247] The application framework service 712 may be used to provide an API and programming framework for the client-side application 711. For example, the application framework service 712 may provide services such as window management services, resource management services, notification management services, and activity management services. The window management services may be used to determine window information (such as window position information, window size information, window hierarchy information, etc.) of the application window of the client-side application 711.

[0248] The rendering component 713 may include a rendering API (such as libGLES, libvulkan, etc.) to provide graphics rendering functionality. The rendering component 713 may instruct the rendering device 731 to perform graphics rendering according to the rendering instructions of the client-side application 711, thereby obtaining display data of the layers included in the application window of the client-side application 711.

[0249] The graphics memory management module 715 can be used to manage the graphics memory 732. In some embodiments, the graphics memory management module 715 can include the Gralloc module shown in FIG. 5 . When rendering is required for layers contained in the application window of the client-side application 711, the graphics memory management module 715 can allocate a graphics buffer in the graphics memory 732 for the client-side application 711. Each graphics buffer can be used to store display data for one layer.

[0250] The layer acquisition module 714 may be configured to obtain address information of graphics buffers in the video memory 732 that store display data for a layer, and send the address information of these graphics buffers to the layer composition module 716 to instruct the layer composition module 716 to composite the display data for the layer stored in these graphics buffers. In some embodiments, the layer acquisition module 714 may include SurfaceFlinger as shown in FIG. 5 .

[0251] The layer composition module 716 can be used to retrieve the display data of the layers stored in the graphics buffers from the video memory 732 based on the address information of the graphics buffers sent by the layer acquisition module 714. The layer composition module 716 can perform layer composition based on the retrieved display data of the layers. The layer composition module 716 can store the display data of the composited layers in the video memory 732. The graphics buffers in the video memory 732 used to store the display data of the composited layers can be allocated by the video memory management module 715.

[0252] The layer composition module 716 may send the handle corresponding to the composite layer to the system connection module 717. The handle corresponding to the composite layer may represent the address information of the graphics buffer storing the display data of the composite layer in the video memory 732, and may be used to find the display data of the composite layer in the video memory 732. In some embodiments, the layer composition module 716 may include the HWComposer shown in FIG. 5 .

[0253] The system connection module 717 may be used for communication between the client OS 710 and the host OS 720 .

[0254] The host OS 720 may include a host-side application 721 , an application framework service 722 , a rendering component 723 , a rendering module 724 , a system connection module 727 , a rendering device mapping module 728 , and a video memory mapping module 729 .

[0255] The rendering device mapping module 728 may be configured to map the rendering device 731 to the client OS 710 based on virtualization technology.

[0256] The video memory mapping module 729 may be configured to map the video memory 732 to the client OS 710 based on virtualization technology.

[0257] Not limited to the rendering device mapping module 728 and the video memory mapping module 729 , the host OS 720 may also include mapping modules for more hardware devices.

[0258] In some embodiments, the host OS 720 may include a hardware device mapping module that allows the host OS 720 to map one or more hardware devices (such as the rendering device 731 , the video memory 732 , etc.) in the electronic device 100 to the client OS 710 .

[0259] The embodiment of the present application does not limit the existence form of the rendering device mapping module 728 and the video memory mapping module 729.

[0260] When the host OS 720 maps the rendering device 731 and the video memory 732 to the client OS 710 , the client OS 710 and the host OS 720 can use the rendering device 731 and the video memory 732 together.

[0261] The host-side application program 721 may include one or more apps that can be run through the host OS 720 .

[0262] The application framework service 722 and the rendering component 723 can be respectively described in the aforementioned description of the application framework service 712 and the rendering component 713 in the client OS 710, which will not be described in detail here.

[0263] The rendering module 724 can be used to provide rendering and drawing capabilities. The rendering module 724 can determine the display data of each point on the display screen of the electronic device 100, thereby realizing the display of the application windows of the client-side application 711 and the host-side application 721 on the display screen.

[0264] The rendering module 724 may include a layer composition module 725 and a video memory management module 726. The video memory management module 726 may be used to manage video memory 732. In some embodiments, the video memory management module 726 may include the BackStore shown in FIG. 5 . When rendering is required for a layer contained in the application window of the host-side application 721, the video memory management module 726 may allocate a graphics buffer in the video memory 732 for the host-side application 721.

[0265] The layer composition module 725 can obtain the display data of the layers contained in the application window of the host-side application 721 from the video memory 732 and perform layer composition to obtain the display data of the composite layer corresponding to the application window of the host-side application 721. The layer composition module 725 can also composite the application windows of the host-side application 721 and the client-side application 711 based on the display data of the composite layer corresponding to the application window of the host-side application 721, the window information of the application window of the host-side application 721, the display data of the composite layer corresponding to the application window of the client-side application 711, and the window information of the application window of the client-side application 711, thereby obtaining a frame of image that is ultimately presented on the display screen.

[0266] In some embodiments, the rendering module 724 may include the Composer shown in FIG. 5 .

[0267] The layer synthesis module 725 may send the display data of the image synthesized from the application windows to the display device 733. Then, the electronic device 100 may refresh the image frame by frame on the display screen according to the display data in the display device 733.

[0268] In some embodiments, the client OS 710 is In this case, the above-mentioned application framework service 712, layer acquisition module 714, video memory management module 715, and layer synthesis module 716 can be located in Xwayland or Weston as shown in Figure 6 above.

[0269] It is understandable that the structure shown in FIG7 does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer modules than shown in FIG7, or combine or split some modules, or arrange the modules differently.

[0270] FIG8 exemplarily shows a flow chart of a graphic display method provided in an embodiment of the present application.

[0271] As shown in FIG. 8 , the graphic display method may be applied to an electronic device 100 including a client OS and a host OS, and may include steps S811 to S818 .

[0272] S811. The host OS maps the rendering device and video memory to the client OS.

[0273] For the above method of mapping the rendering device and the video memory to the client OS, reference may be made to the introduction of the virtualization technology in the above embodiment.

[0274] S812 : APP1 in the client OS requests to display application window 1 .

[0275] In response to the operation of starting APP1, electronic device 100 can run APP1. During the running process, APP1 can display application window 1 on the display screen. For example, APP1 is the video application shown in Figure 4A. Application window 1 can be the video application window 432 shown in Figure 4B.

[0276] S813: The client OS performs graphics rendering through a rendering device to obtain display data of the layers included in application window 1, and stores the display data of the layers included in application window 1 in a video memory.

[0277] For example, application window 1 is video application window 432 shown in Figure 4B . Application window 1 may include layers 441, 442, and 443 shown in Figure 4C . The client OS can perform graphics rendering via the direct rendering path shown in Figure 7 : client-side application 711 → rendering component 713 → rendering device 731 → video memory 732 , obtaining display data for layers 441, 442, and 443. The client OS can allocate multiple graphics buffers in the video memory. Each layer buffer can be used to store display data for a single layer.

[0278] S814: The client OS synthesizes the display data of the layers included in the application window 1, and stores the display data of the synthesized layers in the video memory.

[0279] Continuing with the example of application window 1 being video application window 432 shown in FIG. 4B , the client OS can use the display data of layers 441, 442, and 443 stored in video memory to composite layers 441, 442, and 443. The composited layer can be, for example, layer 444 described above in FIG. 4C . This composited layer can represent the display content of application window 1.

[0280] In a possible implementation, the client OS may allocate a graphics buffer in a video memory to store the display data of the composite layer corresponding to the application window 1 .

[0281] S815 . The client OS sends the window handle and window information of application window 1 to the host OS.

[0282] The window handle of application window 1 may represent address information of a graphics buffer storing display data of a composite layer corresponding to application window 1 in the video memory, and may be used to obtain display data of the composite layer corresponding to application window 1 in the video memory.

[0283] The window information of the application window 1 may include window position information, window level information, window size information, etc. of the application window 1 .

[0284] In some embodiments, the window handle and window information of application window 1 may be sent by the client OS to the host OS at different times. For example, after APP1 requests to display application window 1 (i.e., step S812), in addition to executing step S813, the client OS may also determine the window information of application window 1 and send the window information of application window 1 to the host OS. After obtaining the composite layer of application window 1, the client OS may then send the window handle of application window 1 to the host OS.

[0285] In some embodiments, the graphics buffer in the client OS's video memory that stores the display data for the composite layer may be allocated by the host OS. The host OS may send a handle to the graphics buffer to the client OS. After obtaining the display data for the composite layer, the client OS may store the display data for the composite layer in the graphics buffer corresponding to the handle sent by the host OS. The host OS may then retrieve the display data for the composite layer of application window 1 from the corresponding graphics buffer based on the handle sent to the client OS. In this way, the client OS need only send the window information of application window 1 to the host OS, without having to send the window handle of application window 1.

[0286] S816 . The host OS obtains the display data of the composite layer of the application window 1 from the video memory through the window handle.

[0287] S817: The host OS obtains the display data of the composite layer of the host-side APP application window and the window information of the host-side APP application window.

[0288] The host OS can determine the host-side APPs that are running and need to display application windows on the display screen, and obtain the display data of the composite layers of these host-side APP application windows and the window information of the host-side APP application windows.

[0289] For example, the host-side APP that is running and needs to display an application window on the display screen may include the note application and desktop application shown in Figure 4A above. The host OS can obtain the display data of the composite layer of the note application window 431 shown in Figure 4B above, the window information of the note application window 431, the display data of the composite layer of the desktop (such as the user interface 410 shown in Figure 4A above), and the window information of the desktop.

[0290] The implementation method of the host OS rendering and synthesizing the layers of the host-side APP application window can refer to the introduction of the embodiment shown in Figure 5 above.

[0291] S818. The host OS synthesizes the application window 1 and the application window of the host-side APP to obtain an image to be displayed, and sends the image to be displayed for display.

[0292] The host OS may synthesize the application window 1 and the synthetic layer corresponding to the application window of the host-side APP.

[0293] For example, application window 1 is the video application window 432 shown in FIG4B . The synthetic layer corresponding to application window 1 may be layer 444 shown in FIG4C . The host-side APP includes the note application and desktop shown in FIG4A . The synthetic layers corresponding to the application window of the host-side APP may include layers 445 and 446 shown in FIG4D . After the host OS synthesizes the application windows, the image to be displayed may be layer 447 shown in FIG4D . The host OS displays layer 447, which can realize the display of the above-mentioned application window 1 and the application window of the host-side APP on the display screen.

[0294] As shown in the method illustrated in FIG8 , since the host OS maps the rendering device and video memory to the client OS, the host OS and the client OS can share the rendering device and video memory. The client OS can independently render and composite using the rendering device and video memory, and then send the handle corresponding to the composite layer to the host OS, which then displays it. This method avoids the client OS transmitting a large number of rendering instructions to the host OS when running a client-side app, and then the host OS performs rendering, composite, and displays according to the client-side app's rendering instructions. Because the amount of data transmitted by the client OS for the composite layer handle is much smaller than the amount of data transmitted for the rendering instructions, the host OS can more quickly obtain the display data for the composite layer of the client-side app window. This allows the electronic device to increase the speed at which a frame containing the client-side app window is drawn, enabling the client-side app to support a high refresh rate during operation. The client-side app's refresh rate during operation can reach or approach that of the host-side app, improving the user's viewing experience when using the client-side app.

[0295] It is understood that the various user interfaces described in the embodiments of this application are merely exemplary interfaces and do not limit the scope of this application. In other embodiments, the user interface may adopt a different interface layout, include more or fewer controls, and add or remove other functional options. As long as they are based on the same inventive concept provided by this application, they are all within the scope of protection of this application.

[0296] It should be noted that, without causing any contradiction or conflict, any feature in any embodiment of the present application, or any part of any feature, can be combined, and the combined technical solution is also within the scope of the embodiments of the present application.

[0297] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A graphic display method based on multiple operating systems, characterized in that: The method is applied to an electronic device running multiple operating systems, the multiple operating systems include a host operating system and at least one client operating system, the host operating system is a first operating system, and the at least one client operating system includes a second operating system, and the method includes: The second operating system renders one or more first layers according to a rendering instruction of a first application, the first application is an application in the second operating system, and the one or more first layers are layers included in a first application window of the first application; The second operating system synthesizes the one or more first layers to obtain a second layer; The first operating system obtains the second layer, and displays the first application window on the display screen of the electronic device according to the second layer.

2. The method according to claim 1, characterized in that The method further comprises: The first operating system obtains first window information of the first application window; The displaying the first application window on the display screen of the electronic device according to the second layer specifically includes: The first operating system displays the first application window on a display screen of the electronic device according to the second layer and the first window information.

3. The method according to claim 2, characterized in that The first window information includes first window position information, first window size information and first window level information.

4. The method according to any one of claims 1 to 3, characterized in that The electronic device includes hardware resources: a rendering device and a video memory, The second operating system renders one or more first layers according to the rendering instruction of the first application, specifically including: The second operating system uses the rendering device to render the one or more first layers according to the rendering instruction of the first application, and the one or more first layers are stored in the video memory.

5. The method according to claim 4, characterized in that The method further comprises: The second operating system determines a first storage area from the video memory, and stores the second layer in the first storage area; The second operating system sends first indication information of the first storage area to the first operating system, where the first indication information is used to indicate a location of the first storage area in the video memory.

6. The method according to claim 5, characterized in that The first operating system obtains the second layer, specifically including: The first operating system obtains the second layer in the video memory according to the first indication information.

7. The method according to claim 4, characterized in that The method further comprises: The first operating system determines a second storage area from the video memory, and sends second indication information of the second storage area to the second operating system, where the second indication information is used to indicate a position of the second storage area in the video memory; The second operating system stores the second layer in the second storage area according to the second indication information.

8. The method according to claim 1, characterized in that The method further comprises: The first operating system renders one or more third layers according to a rendering instruction of a second application, the second application is an application in the first operating system, and the one or more third layers are layers included in a second application window of the second application; The first operating system synthesizes the one or more third layers to obtain a fourth layer; The displaying the first application window on the display screen of the electronic device according to the second layer specifically includes: The first operating system synthesizes the first application window and the second application window according to the second layer and the fourth layer, and displays the synthesized first application window and the second application window on the display screen.

9. The method according to claim 8, characterized in that The method further comprises: The first operating system obtains first window information of the first application window and second window information of the second application window; The first operating system synthesizes the first application window and the second application window according to the second layer and the fourth layer, specifically including: The first operating system synthesizes the first application window and the second application window according to the second layer, the first window information, the fourth layer and the second window information.

10. The method according to claim 1, characterized in that The method further comprises: The second operating system renders one or more fifth layers according to a rendering instruction of a third application, the third application is an application in the second operating system, and the one or more fifth layers are layers included in a third application window of the third application; The second operating system synthesizes the one or more fifth layers to obtain a sixth layer; The first operating system acquires the sixth layer; The displaying the first application window on the display screen of the electronic device according to the second layer specifically includes: The first operating system synthesizes the first application window and the third application window according to the second layer and the sixth layer, and displays the synthesized first application window and the third application window on the display screen.

11. The method according to claim 10, characterized in that The method further comprises: The first operating system obtains first window information of the first application window and third window information of the third application window; The first operating system synthesizes the first application window and the third application window according to the second layer and the sixth layer, specifically including: The first operating system synthesizes the first application window and the third application window according to the second layer, the first window information, the sixth layer and the third window information.

12. An electronic device, characterized in that: The electronic device includes a rendering device, a video memory, a storage device and a processor, wherein the rendering device is used to render according to a rendering instruction to obtain display data; the video memory is used to store the display data; the storage device is used to store a computer program; a plurality of operating systems run in the processor, the plurality of operating systems include a host operating system and at least one client operating system, and the processor is used to call the computer program so that the electronic device executes the method described in any one of claims 1-11.

13. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 11.

14. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are run on an electronic device, the electronic device executes the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Graph display method based on multiple operating systems and related device

    CN118567537A

  • Android container implementation method, system and equipment

    CN113110910A

  • Window display method and device, equipment and storage medium

    CN114168239A

  • Image processing method, device and system of virtual machine and electronic equipment

    CN114579255A

  • Methods for playing multimedia content at remote graphics display client

    US20100138744A1