CN115131488B - Method and system for managing display cache in wayland graphic display environment - Google Patents
Method and system for managing display cache in wayland graphic display environment Download PDFInfo
- Publication number
- CN115131488B CN115131488B CN202211058228.7A CN202211058228A CN115131488B CN 115131488 B CN115131488 B CN 115131488B CN 202211058228 A CN202211058228 A CN 202211058228A CN 115131488 B CN115131488 B CN 115131488B
- Authority
- CN
- China
- Prior art keywords
- display
- cache
- server
- client
- display cache
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/005—General purpose rendering architectures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/20—Processor architectures; Processor configuration, e.g. pipelining
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/60—Memory management
Abstract
The invention discloses a method and a system for managing display cache in a wayland graphic display environment, wherein the method comprises the following steps: s1: the client renders the display content of the current frame, submits corresponding rendering data to a display cache and informs the server; s2: the server side obtains the control right of the display cache and starts a synthesizer; s3: the synthesizer locks the display cache to prohibit the client from accessing the display cache; s4: the synthesizer extracts rendering data of the display content of the current frame from the display cache, and unlocks the display cache after the extraction is finished; s5: and the server releases the control right of the display cache, and returns to the step S1 until the client finishes rendering. The invention does not need to wait for exchanging the buffer signals, thereby fully playing the GPU performance and improving the graphic display performance.
Description
Technical Field
The invention relates to the field of computer graphics, in particular to a method and a system for managing display cache in a wayland graphic display environment.
Background
The wayland is a graphic display Protocol (Protocol) that divides a graphic system into a client (client) and a compositor (compositor). clients and compounders communicate via the wayland protocol.
As shown in fig. 1, in the current kwin integrated environment, after rendering of the client in wayland is completed and the display buffer is submitted during the process of acquiring display data, the next frame can be rendered only by waiting for the exchange of buffer signals. Due to the fact that after GPU rendering is completed, the GPU needs to wait for exchanging cache signals, and the exchanging cache signals are blocked frequently, the GPU becomes a bottleneck of graphics rendering in a high GPU load scene and during graphics display performance testing, the GPU is not operated at full load, large load is idle, GPU performance is not fully exerted, and user experience and graphics display performance data indexes under high GPU load are seriously influenced. Therefore, how to optimize the user experience and the performance index of the graphic display under the high GPU load is an important issue facing the present.
Patent CN113448662a provides a window image display method, device and storage medium, which are applied to a client and a server created based on the wayland protocol, and the method includes: the client generates a window object in response to a received input event for requesting image display; the client generates a window surface corresponding to the window object, wherein the window surface is a frame model containing an image to be rendered; based on the window surface, the client renders the image to be rendered and caches the image in a preset memory; and the server reads the rendered images from the preset memory, synthesizes the rendered images, and sends the synthesized images to the terminal for display. The problem that the rendering and displaying speed of the window image is slow in the prior art cannot be solved is solved, and therefore user experience is improved. However, the method is still based on the existing wayland graphics display mechanism, that is, after the GPU is rendered, the GPU needs to wait for exchanging the buffer signals, so that the GPU is idle in load, and the performance of the GPU is not fully exerted, so that the graphics display performance cannot be improved.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: aiming at the problems in the prior art, the method and the system for managing the display cache in the wayland graphic display environment are provided, and the GPU is ensured to be always in a high-load state without waiting for exchanging cache signals after the GPU is rendered, so that the performance of the GPU is fully exerted, and the graphic display performance is improved.
In order to solve the technical problems, the invention adopts the technical scheme that:
a method of managing display caching in a wayland graphical display environment, comprising the steps of:
s1: the client renders the display content of the current frame, submits corresponding rendering data to a display cache and informs the server;
s2: the server side obtains the control right of the display cache and starts a synthesizer;
s3: the synthesizer locks the display cache to prohibit the client from accessing the display cache;
s4: the synthesizer extracts rendering data of the display content of the current frame from the display cache, and after the extraction is finished, the locking is released;
s5: and the server releases the control right of the display cache, informs the client, and returns to the step S1 until the client finishes rendering.
Further, in step S1, the notification server is specifically: and the client calls the target function to inform the server that the display cache content is updated.
Further, the objective function is a wl _ display _ dispatch function.
Further, in step S2, before the server obtains the control right of the display cache, the method further includes: and the server side sends a commit signal request to the display cache and waits until the commit signal of the display cache is acquired, and then the server side acquires the control right of the display cache.
Further, before the commit signal of the display cache is acquired, if the time is out, the server sends the commit signal request to the display cache again, records the retransmission times, and prompts error reporting and quitting if the retransmission times reach a preset threshold.
Further, the step S3 of locking the display cache specifically includes: and locking the display cache to limit the access right of the client.
The invention also provides a graphic system, which comprises a client and a server, wherein the client and the server communicate through the WAYLAND protocol, and the graphic system comprises:
the client is used for rendering the display content of the current frame, submitting corresponding rendering data to a display cache and informing the server;
the server is used for obtaining the control right of the display cache, starting a synthesizer, locking the display cache by using the synthesizer to forbid the client to access the display cache, then extracting the rendering data of the current frame display content from the display cache by using the synthesizer, and after the extraction is finished, unlocking and releasing the control right of the display cache.
Further, when the server is notified, the client calls the target function to notify the server that the display cache content is updated.
Further, before acquiring the control right of the display cache, the server sends a commit signal request to the display cache and waits until acquiring the commit signal of the display cache.
Further, when the display cache is locked, the server side uses a synthesizer to lock the display cache, and the access right of the client side is limited.
Compared with the prior art, the invention has the following advantages:
in the time period of extracting the data in the display cache by the synthesizer, the display cache is locked and the client is prohibited from accessing the display cache, after the data is extracted, the locking is released, the client can directly continue to render the next frame without continuously waiting for exchanging cache signals after the data is extracted, so that the load vacancy in the GPU rendering process is avoided, the GPU is ensured to be always in a high-load state, the performance of the GPU is fully exerted, the graphic display performance is improved, and the user experience is optimized.
Drawings
FIG. 1 is a flow chart of managing a display cache in a current wayland graphics display environment.
FIG. 2 is a flowchart of a method according to an embodiment of the present invention.
FIG. 3 is a graph comparing the performance of the method of the present invention with a prior art method.
Detailed Description
The invention is further described below with reference to the drawings and specific preferred embodiments of the description, without thereby limiting the scope of protection of the invention.
In the prior art, because the display buffer does not have a write protection mechanism, the original content in the display buffer is damaged, which may cause a phenomenon of image tearing, and in order to avoid the above situation, the server releases the control right of the display buffer, so that the client waits for the exchange buffer signal before rendering the display content of the next frame, but the exchange buffer signal often has a blocking situation, which may cause a long waiting time.
According to the above concept, as shown in fig. 2, the present embodiment provides a method for managing display buffer in a wayland graphics display environment, comprising the following steps:
s1: the client renders the current frame display content, submits the corresponding rendering data to a display cache, and informs the server, wherein the rendering data of the current frame display content is the image texture drawn by the client;
s2: the server side obtains the control right of the display cache and starts a synthesizer;
s3: the synthesizer locks the display cache to prohibit the client from accessing the display cache;
s4: the synthesizer extracts rendering data of the display content of the current frame from the display cache, and after the extraction is finished, the locking is released;
s5: and the server releases the control right of the display cache, informs the client, and returns to the step S1 until the client finishes rendering.
Through the steps, in the time period of extracting the data in the display cache by the synthesizer, the display cache is locked to prohibit the client from accessing the display cache, after the data is extracted, the locking is released, the client can directly continue to render the next frame without continuously waiting for exchanging cache signals after the data is extracted, so that the phenomenon that the load is idle in the GPU rendering process is avoided, the GPU is ensured to be always in a high-load state, the performance of the GPU is fully exerted, and the display performance of the graph is improved, so that the user experience is optimized.
In step S1 of this embodiment, the notification server is specifically: the client calls a wl _ display _ dispatch function to inform the server that the display cache content is updated so as to prepare the data to be drawn.
In step S2 of this embodiment, after the server receives the commit signal of the display buffer, the synthesizer starts to prepare for the synthesis operation. Therefore, before the server obtains the control right of the display cache, the method further includes: and the server side sends a commit signal request to the display cache and waits until the commit signal of the display cache is acquired, and then the server side acquires the control right of the display cache.
In an actual situation, there may be a communication failure, and therefore in this embodiment, before obtaining a commit signal of a display cache, if the time is out, the server re-sends a commit signal request to the display cache, and records the number of times of retransmission, and if the number of times of retransmission reaches a preset threshold, it prompts to report an error and exit.
In step S3 in this embodiment, the locking the display cache specifically includes: and locking the display cache, limiting the access right of the client, and waiting for the release interface of the wl _ buffer by the client.
In step S4 of this embodiment, the compositor extracts rendering data of the display content of the current frame from the display buffer to provide a data source for subsequent compositing work, and after the extraction is completed, the compositor invokes the release interface of the wl _ buffer to release the lock on the display buffer, that is, the display buffer is locked in a time period when the compositor extracts a texture, so that the client cannot access the display buffer, and image tearing caused by the damage of the data in the display buffer is avoided.
In step S5 of this embodiment, when the server releases the lock on the display buffer, the server releases the control right of the display buffer, and notifies the client through a release interface of wl _ buffer, and then the client can immediately render the next frame of display content, which significantly speeds up the rendering of the next frame of display content compared to waiting for the exchange of the buffer signal.
In summary, in the method of this embodiment, by changing the manner of taking over the display cache, the display cache is locked together in the process of extracting data by the synthesizer, and after the synthesizer has extracted data from the display cache, the locking is released and the display cache is released, so that the client can immediately render the display content of the next frame without waiting for exchanging cache signals, thereby accelerating the drawing of the display content of the next frame, and greatly improving the rendering efficiency of the client on the display content. Through verification, in a high-GPU load application scene of the same platform, a performance improvement comparison result obtained by testing on a certain display card and a certain system is shown in fig. 3, and a vertical coordinate in the diagram represents a test score of graphic test software, so that on the premise of ensuring compatibility, when the method of the embodiment is adopted, the test result obtained by graphic performance test tools such as glmark2/unixbench 2D is higher than that obtained by the existing method by more than 50%.
Based on the method of this embodiment, this embodiment further provides a graphics system, which includes a client and a server, where the client and the server communicate via the wayland protocol, where:
the client is used for rendering the display content of the current frame, submitting corresponding rendering data to a display cache and informing the server;
the server is used for obtaining the control right of the display cache, starting a synthesizer, locking the display cache by using the synthesizer to forbid the client to access the display cache, then extracting the rendering data of the current frame display content from the display cache by using the synthesizer, and after the extraction is finished, unlocking and releasing the control right of the display cache.
In this embodiment, when notifying the server, the client calls the target function to notify the server that the display cache content has been updated.
In this embodiment, before obtaining the control right of the display cache, the server sends a commit signal request to the display cache and waits until obtaining the commit signal of the display cache.
In this embodiment, when the display cache is locked, the server performs locking operation on the display cache by using a synthesizer, so as to limit the access right of the client.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments, and all technical solutions belonging to the idea of the present invention belong to the protection scope of the present invention. It should be noted that modifications and embellishments within the scope of the invention may occur to those skilled in the art without departing from the principle of the invention, and are considered to be within the scope of the invention.
Claims (10)
1. A method for managing display caching in a wayland graphical display environment, comprising the steps of:
s1: the client renders the display content of the current frame, submits corresponding rendering data to a display cache and informs the server;
s2: the server side obtains the control right of the display cache and starts a synthesizer;
s3: the synthesizer locks the display cache to prohibit the client from accessing the display cache;
s4: the synthesizer extracts rendering data of the display content of the current frame from the display cache, and after the extraction is finished, the locking is released;
s5: and the server releases the control right of the display cache, informs the client, and returns to the step S1 until the client finishes rendering.
2. The method for managing display cache in the environment of wayland graphics display according to claim 1, wherein in step S1, the notification server is specifically: and the client calls the target function to inform the server that the display cache content is updated.
3. The method for managing display cache in the context of wayland graphics display of claim 2, wherein said objective function is a wl _ display _ dispatch function.
4. The method for managing a display cache in a wayland graphic display environment of claim 1, wherein in step S2, before the server obtains the control right of the display cache, the method further comprises: and the server side sends a commit signal request to the display cache and waits until the commit signal of the display cache is acquired, and then the server side acquires the control right of the display cache.
5. The method for managing a display buffer in a wayland graphic display environment of claim 4, wherein before the commit signal of the display buffer is acquired, if the timeout is waited for, the server re-sends the commit signal request to the display buffer, records the number of retransmissions, and if the number of retransmissions reaches a preset threshold, prompts an error report and exits.
6. The method for managing a display cache in a wayland graphic display environment of claim 1, wherein the step S3 locking the display cache specifically comprises: and locking the display cache to limit the access right of the client.
7. A graphics system comprising a client and a server, the client and the server communicating via a wayland protocol, wherein:
the client is used for rendering the display content of the current frame, submitting corresponding rendering data to a display cache and informing the server;
the server is used for obtaining the control right of the display cache, starting a synthesizer, locking the display cache by the synthesizer to forbid the client from accessing the display cache, then extracting the rendering data of the display content of the current frame from the display cache by the synthesizer, and after the extraction is finished, unlocking and releasing the control right of the display cache.
8. The graphics system of claim 7, wherein when notifying the server, the client calls a target function to notify the server that the display cache has been updated.
9. The graphics system of claim 7, wherein before obtaining control of the display buffer, the server sends a commit signal request to the display buffer and waits until a commit signal of the display buffer is obtained.
10. The graphics system of claim 7, wherein when the display cache is locked, the server uses the compositor to lock the display cache to restrict the access rights of the client.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211058228.7A CN115131488B (en) | 2022-08-31 | 2022-08-31 | Method and system for managing display cache in wayland graphic display environment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211058228.7A CN115131488B (en) | 2022-08-31 | 2022-08-31 | Method and system for managing display cache in wayland graphic display environment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115131488A CN115131488A (en) | 2022-09-30 |
CN115131488B true CN115131488B (en) | 2022-11-29 |
Family
ID=83387659
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211058228.7A Active CN115131488B (en) | 2022-08-31 | 2022-08-31 | Method and system for managing display cache in wayland graphic display environment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115131488B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115309315B (en) * | 2022-10-11 | 2023-01-20 | 麒麟软件有限公司 | Screenshot method, system and medium for X application in Wayland environment |
CN115686727B (en) * | 2023-01-04 | 2023-04-14 | 麒麟软件有限公司 | Method for realizing synthesis rendering based on wlroots |
CN115934383B (en) * | 2023-02-01 | 2023-06-02 | 麒麟软件有限公司 | Multi-graphics card rendering method under Wayland synthesizer |
CN117369936B (en) * | 2023-12-04 | 2024-03-08 | 武汉凌久微电子有限公司 | Display content rendering method and rendering system |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107567713A (en) * | 2015-03-11 | 2018-01-09 | Lg 电子株式会社 | Display device and its control method |
CN110058905A (en) * | 2018-01-18 | 2019-07-26 | 阿里巴巴集团控股有限公司 | Event handling and operating system management method, apparatus, equipment and storage medium |
CN111611040A (en) * | 2020-05-19 | 2020-09-01 | 延锋伟世通电子科技(上海)有限公司 | Display control method, system, medium and terminal of low-configuration vehicle-mounted system |
CN112527219A (en) * | 2019-09-17 | 2021-03-19 | 中兴通讯股份有限公司 | Graphics synthesis method, device and system based on WAYLAND protocol |
CN113448662A (en) * | 2020-03-27 | 2021-09-28 | 海信电子科技(武汉)有限公司 | Window image display method, device and storage medium |
CN113918366A (en) * | 2021-12-14 | 2022-01-11 | 北京鲸鲮信息系统技术有限公司 | Information processing method, information processing device, electronic equipment and storage medium |
CN114116227A (en) * | 2021-11-29 | 2022-03-01 | 元心信息科技集团有限公司 | Display method, device and equipment based on Wayland protocol without GPU support |
CN114237532A (en) * | 2021-11-30 | 2022-03-25 | 珠海全志科技股份有限公司 | Multi-window implementation method, device and medium based on Linux embedded system |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150161754A1 (en) * | 2013-12-10 | 2015-06-11 | Joel Solomon Isaacson | System and method for remote graphics using non-pixel rendering interfaces |
DE112018007902T5 (en) * | 2018-09-11 | 2021-04-29 | Lg Electronics Inc. | DISPLAY DEVICE AND METHOD OF CONTROLLING THESE |
US11132973B2 (en) * | 2019-02-01 | 2021-09-28 | Forcepoint, LLC | System for capturing images from applications rendering video to a native platform with a graphics rendering library |
-
2022
- 2022-08-31 CN CN202211058228.7A patent/CN115131488B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107567713A (en) * | 2015-03-11 | 2018-01-09 | Lg 电子株式会社 | Display device and its control method |
CN110058905A (en) * | 2018-01-18 | 2019-07-26 | 阿里巴巴集团控股有限公司 | Event handling and operating system management method, apparatus, equipment and storage medium |
CN112527219A (en) * | 2019-09-17 | 2021-03-19 | 中兴通讯股份有限公司 | Graphics synthesis method, device and system based on WAYLAND protocol |
CN113448662A (en) * | 2020-03-27 | 2021-09-28 | 海信电子科技(武汉)有限公司 | Window image display method, device and storage medium |
CN111611040A (en) * | 2020-05-19 | 2020-09-01 | 延锋伟世通电子科技(上海)有限公司 | Display control method, system, medium and terminal of low-configuration vehicle-mounted system |
CN114116227A (en) * | 2021-11-29 | 2022-03-01 | 元心信息科技集团有限公司 | Display method, device and equipment based on Wayland protocol without GPU support |
CN114237532A (en) * | 2021-11-30 | 2022-03-25 | 珠海全志科技股份有限公司 | Multi-window implementation method, device and medium based on Linux embedded system |
CN113918366A (en) * | 2021-12-14 | 2022-01-11 | 北京鲸鲮信息系统技术有限公司 | Information processing method, information processing device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN115131488A (en) | 2022-09-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115131488B (en) | Method and system for managing display cache in wayland graphic display environment | |
US20220139352A1 (en) | Method and Device for Image Composition, Electronic Device and Storage Medium | |
US5896141A (en) | System and method for virtual device access in a computer system | |
DE112014001397T5 (en) | Flux-based low-latency network operation | |
CN114020406A (en) | Method, device and system for accelerating I/O of virtual machine by cloud platform | |
CN107273080B (en) | Multithreading-based mobile terminal picture rendering method and device | |
CN106599323B (en) | Method and device for realizing distributed pipeline in distributed file system | |
CN111459673A (en) | Secure memory expansion and release method and device and electronic equipment | |
CN114281484A (en) | Data transmission method, device, equipment and storage medium | |
CN106878282B (en) | Method and device for preventing gateway from attacking | |
CN112182606A (en) | Access request processing method and device, electronic equipment and readable storage medium | |
WO2023138306A1 (en) | Cache method and apparatus applied to all-flash storage, device, and medium | |
CN115309315B (en) | Screenshot method, system and medium for X application in Wayland environment | |
CN115373878A (en) | Anti-screenshot extended protocol implementation system based on X framework | |
CN115599268A (en) | Screen capture method, computing device and storage medium | |
US11868620B2 (en) | Read-write method and apparatus, electronic device, and readable memory medium | |
CN114595084A (en) | Method for sharing video between system-level processes on Linux operating system | |
WO2021036909A1 (en) | Picture write-in method and apparatus | |
US8095784B2 (en) | Computer system and method for activating basic program therein | |
CN114820272A (en) | Data interaction method and device, storage medium and electronic equipment | |
CN110347517B (en) | Dual-system communication method and computer-readable storage medium | |
CN112003860B (en) | Memory management method, system and medium suitable for remote direct memory access | |
KR101698484B1 (en) | Method and apparatus for performing JAVA application | |
CN112162855B (en) | GPU (graphics processing Unit) page missing processing method, system and medium based on page locking memory | |
CN115599574B (en) | Graphic processing system, electronic component, electronic device, and information processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |