Xwindow graph display method and device, electronic equipment and medium

By adding VBLANK information and copy flags to the Xwindow system, the consistency between the rendering frequency and the display frequency is controlled, the problem of waste of rendering resources is solved, and the utilization rate of GPU resources and rendering effect is improved.

CN120234085AActive Publication Date: 2025-07-01KYLIN CORP
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510724184.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-07-01
Estimated Expiration
2045-06-03

AI Technical Summary

Technical Problem

In Linux systems, when the rendering frequency is higher than the display frequency, the rendering resource waste is caused. Especially in the high refresh rate and high resolution of 3D applications, the display frequency of the Xwindow window system is much lower than the rendering frequency, resulting in the rendered content that cannot be truly displayed on the screen.

Method used

By defining the vertical blanking interval VBLANK information and copy flag bits in the window structure, the VBLANK information is used to compare with the current MSC value of the system, a new display cycle is determined, and the value of the copy flag bit is updated, the consistency between the rendering frequency and the display frequency is controlled, and the copy operation is reduced.

Benefits of technology

The synchronization of rendering frequency and display frequency is achieved, reducing the waste of GPU rendering frequency and resource, improving the utilization rate of GPU resources, and improving the quality of rendering effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234085A_ABST
    Figure CN120234085A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an Xwindow graph display method and device, electronic equipment and a medium. The method comprises the steps that vertical blanking interval VBLANK information and a copy flag bit are defined in a window structural body; and rendering the window background cache, sending a display sending request to the X Server, updating the display sending delay queue according to the display sending request time, updating the value of the copy flag bit according to the display sending request time in the display sending delay queue, copying the window background cache to a root window, and displaying the window background cache on a screen. By adding the VBLANK information and the copy flag bit for identifying the window refreshing condition and controlling the copy operation and comparing the VBLANK information with the value of the current MSC of the system, the arrival of a new display period is determined, the value of the copy flag bit is updated, and the rendering frequency and the display frequency are kept consistent by reducing the copy operation, so that the GPU rendering frequency and the GPU resource waste are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of graphic display, and particularly to an Xwindow graphic display method, device, electronic device and medium. Background Art

[0002] With the wide application of the Linux system, the Xwindow window system can provide a graphical operation interface for the Linux system, facilitating user interaction. Under the display framework of the Linux kernel, when a 3D application is rendered using the GPU, the rendered image can be displayed on the screen through the Xwindow window system.

[0003] During the process of displaying the rendered image on the screen, the X Server will first copy the rendered content and then display it on the screen. The rendering frequency is related to the configuration of the 3D application and the performance of the GPU. With the progress of technology, the configuration of the 3D application and the performance of the GPU are gradually improved, and the rendering frequency also gradually increases. When the rendering frequency of the GPU for the 3D application is inconsistent with the display frequency of the Xwindow window system, especially when the 3D application is at a high refresh rate and high resolution, while the display frequency of the Xwindow window system is much lower than the rendering frequency, most of the rendered resources cannot be truly displayed on the screen, resulting in a large amount of GPU resource waste. Summary of the Invention

[0004] Embodiments of the present invention provide an Xwindow graphic display method, device, electronic device and medium to solve the technical problem of rendering resource waste caused by the inability to truly display the rendered content on the screen when the rendering frequency is higher than the display frequency.

[0005] In a first aspect, embodiments of the present invention provide an Xwindow graphic display method, including: S101, configure a window structure, and define vertical blanking interval (VBLANK) information and a copy flag bit in the window structure; S102, in response to a rendering operation of a 3D-X Client, perform a rendering operation on the window back buffer and send a display request to the X Server, and the X Server updates the display delay queue according to the display request time; S103, the X Server obtains the value of the copy flag bit by using a cache copy function according to the display request time in the display delay queue, and copies the window back buffer to under the root window according to the value of the copy flag bit; S104, send the window back buffer in the root window to the Linux kernel, display it on the screen, and respond to the rendering operation of the 3D-X Client again.

[0006] Further, S103 includes: The X Server compares the value of the display frame counter MSC of the system with the time of the display request, and determines that the display timing has arrived; According to the arrival of the display timing, set the value of the copy flag bit to true; According to the copy flag bit with a value of true, copy the window back buffer to under the root window.

[0007] Further, the method further includes: After copying the window back buffer to the root window, update the VBLANK information of the window structure.

[0008] Further, S102 includes: The 3D-X Client renders the window back buffer according to the rendering operation; After the rendering is completed, call the display function to send a display request to the X Server; The X Server puts the display request into the display delay queue according to the display request time; Update the display delay queue according to the display request time.

[0009] Further, the X Server puts the display request into the display delay queue according to the display request time, including: The X Server obtains the system MSC value, compares it with the MSC value of the display request, and puts the display request into the display delay queue according to the comparison result.

[0010] Further, updating the display delay queue according to the display request time includes: According to the MSC value of the display request, overwrite the display requests with the same MSC value in the display delay queue.

[0011] Further, S101 includes: Add an msc field and a copy_count field to the window structure. The msc field is used to record the MSC value of the window during the most recent VBLANK event, and the copy_count field is used to mark the number of times the window back buffer is copied during a single VBLANK period.

[0012] In a second aspect, an embodiment of the present invention provides an Xwindow graphics display device, including: A window structure configuration module, configured to define VBLANK information and a copy flag bit in the window structure; A 3D rendering module, configured to execute a response rendering operation and send a display request; A window background cache copy module, configured to copy the window background cache to the root window according to a copy flag bit; A display module, configured to send the window background cache in the root window to the Linux kernel and display it on the screen.

[0013] Thirdly, an embodiment of the present invention provides an electronic device, including: One or more processors; A storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned Xwindow graphics display method.

[0014] Fourthly, an embodiment of the present invention provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute the above-mentioned Xwindow graphics display method when executed by a computer processor.

[0015] An Xwindow graphics display method, device, electronic device and medium provided by an embodiment of the present invention. In the method, VBLANK information and a copy flag bit for identifying window refresh conditions and controlling copy operations are added to a window structure. By comparing the VBLANK information with the current MSC value of the system, it is determined whether a new display cycle arrives. When a new display cycle arrives, the content in the window background cache is copied to the root window by updating the value of the copy flag bit. By reducing copy operations, the rendering-copy process is controlled, so that a rendering cycle is consistent with a display cycle, thereby making the rendering frequency consistent with the display frequency, reducing the frequency of GPU rendering and waste of GPU resources, enabling more GPU resources to be used for improving the rendering effect quality, and improving the utilization rate of GPU resources. Description of the Drawings

[0016] The drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention. In the drawings: Figure 1 It is a flowchart of an Xwindow graphics display method according to Embodiment 1 of the present invention; Figure 2 It is a comparison chart of running score performance before and after optimization according to Embodiment 1 of the present invention; Figure 3 It is a flowchart of an Xwindow graphics display method according to Embodiment 2 of the present invention; Figure 4 It is a flowchart of an Xwindow graphics display method according to Embodiment 3 of the present invention; Figure 5 Schematic diagram of a structure of an Xwindow graphics display device according to Embodiment 4 of the present invention; Figure 6 Structural diagram of an electronic device according to Embodiment 5 of the present invention. Detailed implementation manners

[0017] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. Additionally, it should be noted that for the convenience of description, only parts related to the present invention rather than all structures are shown in the drawings.

[0018] The Xwindow (X Window System) adopts the Client / Server design concept. The server side is the X Server, and the client side is the X Client, also known as the Xorg graphics server, which can provide a basic graphical operation interface for the Linux system to facilitate user interaction. The 3D image display process based on Xwindow is that after the 3D-X Client (3D application, such as a 3D game) calls the GPU resources for rendering, it is then displayed on the screen by the X Server. With the development of technology, the performance of 3D applications and GPUs has gradually improved, the rendering ability for 3D images has been continuously enhanced, and the achieved rendering frequency has also been continuously increased. If the rendering frequency is higher than the display frequency, only a part of the multiple rendered frames can be displayed according to the display frequency, resulting in a waste of rendering resources. It is necessary to synchronize the display frequency of Xwindow with the VBLANK signal, that is, how many vertical blanking interval (VBLNAK) signals the screen can send in 1 second, and Xwindow will display that many frames of content. For example, for a screen with a refresh rate of 60HZ, 60 vertical blanking intervals (VBLANK) signals are generated per second, and 60 frames of content can be refreshed, so Xwindow displays 60 frames of content in 1 second. And during the rendering process, a trade-off or balance is bound to be made between the rendering frequency and the rendering effect quality. If the rendering frequency is high but cannot be displayed, the wasted rendering resources will instead cause the rendering effect quality to decline. It is also possible to limit the rendering frequency to use more rendering resources to improve the rendering quality effect and ensure the utilization rate of rendering resources.

[0019] Embodiment 1 Figure 1 Flowchart of an Xwindow graphics display method according to Embodiment 1 of the present invention. In this embodiment, by restricting the frequency of copying the background cache of the rendered window to be the same as the display frequency, the rendering frequency is thus made to be the same as the display frequency. The specific steps are as follows: S101, Configure the window structure, and define the vertical blanking interval (VBLANK) information and the copy flag bit in the window structure.

[0020] To synchronize the rendering frequency with the display frequency, the execution frequency of the rendering process can be restricted by limiting the frequency of the buffer copy after rendering is completed. Configure the window structure that describes the window, and add fields representing the vertical blanking interval (VBLANK) information and the copy flag bit to the window structure. The vertical blanking interval (VBLANK) means that after the scanning points of the display device scan a frame, they need to return from the lower right corner of the image to the upper left corner of the image to start a new frame of scanning. This time interval is called the vertical blanking interval, also known as the field blanking. The VBLANK information can record the most recent VBLANK event of the window structure, which is used to compare with the value of the system's display frame counter (MSC, Media Stream Counter, a monotonically increasing counter of the number of VBLANK frames since the system was powered on). The timing of sending the display can be determined through the comparison result. The copy flag bit is used to determine whether to copy the content in the buffer. Through the linkage of VBLANK and the copy flag bit, the copy timing of the buffer after rendering is completed is determined, so as to control the synchronization of the rendering frequency and the display frequency.

[0021] S102, In response to the rendering operation of the 3D-X Client, perform a rendering operation on the window back buffer and send a display request to the X Server. The X Server updates the display delay queue according to the display request time.

[0022] The 3D-X Client responds according to the rendering operation and calls the GPU to render the window back buffer (back buffer). The back buffer is a rendering method based on double buffer processing, which is divided into the front buffer (front buffer) and the back buffer. The front buffer is used for display, and the back buffer is used for rendering. By exchanging the front buffer and the back buffer, the effect of quickly updating the display screen is achieved, and problems such as display tearing and screen flickering are solved. After the rendering is completed, the X Server will call a function to initiate a display request. The display request time will be recorded according to the rendered content in the display request. The display request time is divided into immediate display and delayed display. If it is an immediate display, the subsequent copy - display process needs to be executed immediately. If it is a delayed display, it will be put into the display delay queue and the display delay queue will be updated.

[0023] S103, The X Server obtains the value of the copy flag bit by using the buffer copy function according to the display request time in the display delay queue, and copies the window back buffer under the root window according to the value of the copy flag bit.

[0024] The display delay queue sorts tasks according to the time in the queue and initiates a copy operation for tasks that reach the display request time. When the copy operation is initiated, the value of the copy flag bit is first judged. The value of the copy flag bit includes true and false. True indicates that copying is allowed, and false indicates that copying is not allowed. The value of the copy flag bit is updated by comparing the value of the system's display frame counter (MSC) with the VBLANK information of the window structure to determine whether a new VBLANK signal arrives, that is, whether the screen is ready to refresh the content of a new frame. If a new VBLANK signal arrives, it means that the screen is in the vertical blanking interval. At this time, after copying the content of the buffer, it can be displayed on the screen. If the new VBLANK signal does not arrive, it means that the screen is not in the state to be refreshed, and no copying is performed, and thus it does not enter the next rendering process, thereby restricting the rendering frequency.

[0025] S104, Send the window back buffer in the root window to the Linux kernel, display it on the screen, and respond to the rendering operation of the 3D-X Client again.

[0026] The X Server monitors the value of the copy flag bit. When it detects that the value of the copy flag bit is true, it performs a copy operation through the copy function, copies the content of the window back buffer to the root window (the root window is used to describe the operating system desktop, and the windows of all applications in the operating system desktop need to be mapped to the root window). Then, the Linux kernel performs display by sending the root window for display. Thus, an operation of rendering - copying - displaying is completed. At this time, the back buffer switches to the foreground, and the original foreground front buffer switches to the background to become the back buffer, and can respond and execute the next rendering process again.

[0027] In this embodiment, by adding VBLANK information and a copy flag bit that identify the window refresh situation and control the copy operation in the window structure, and comparing the VBLANK information with the current MSC value of the system to determine whether a new display cycle arrives. When a new display cycle arrives, the value of the copy flag bit is updated to control the copying of the content in the window back buffer to the root window. By reducing the copy operation, the control of the rendering - copying process is achieved, so that a rendering cycle is consistent with a display cycle, thereby making the rendering frequency consistent with the display frequency, reducing the rendering frequency of the GPU and the waste of GPU resources, enabling more GPU resources to be used in improving the rendering effect quality, and improving the utilization rate of GPU resources. As Figure 2The following is a comparison chart of the running scores before and after optimization using the method disclosed in the present invention. GLmark2 is used for running scores to test the GPU performance. The experimental environment is as follows: Operating system version: Kylin-Desktop-V10-SP1-General-RC1-2403-update1-Build02-20240527 (buildid: 55913) Processor: Hygon C86 3250 8-core Processor Memory: 8 GB UnilC 3200 MT / s As shown in Table 1, the GPU performance after optimization has been improved in most cases:

[0028] Table 1 Specifically, S101 includes: Add an msc field and a copy_count field to the window structure. The msc field is used to record the MSC value at the time of the window's most recent VBLANK event, and the copy_count field is used to mark the number of times the window's background cache is copied during a single VBLANK.

[0029] In order for the window structure to meet the judgment logic and execution basis in the rendering-copy process, corresponding fields and flag information need to be added to the window structure that describes the window. Exemplarily, in the window structure representing the window, add a uint64_t msc field to record the MSC value at the time of the window's most recent VBLANK time, and add a uint64_t copy_count field to mark the number of times the window's background cache is copied during a single VBLANK.

[0030] Embodiment 2 Figure 3 The following is a flowchart of an Xwindow graphics display method according to Embodiment 2 of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, S103 is specifically optimized as: The X Server compares the MSC value of the system's display frame counter with the display request time to determine that the display timing has arrived; According to the arrival of the display timing, set the value of the copy flag bit to true; According to the copy flag bit with a value of true, copy the window background cache under the root window.

[0031] Correspondingly, the Xwindow graphics display method provided in this embodiment specifically includes: S201, Configure the window structure, and define the vertical blanking interval (VBLANK) information and the copy flag bit in the window structure.

[0032] S202, In response to the rendering operation of the 3D-X Client, perform a rendering operation on the window back buffer and send a display request to the X Server. The X Server updates the display delay queue according to the display request time.

[0033] S203, The X Server compares the value of the system's display frame counter (MSC) with the display request time to determine that the display opportunity has arrived.

[0034] The X Server calls the libdrm interface function through the present_get_ust_msc() function to interact with the Linux kernel, obtains the current MSC value of the system, and compares the current MSC value with the VBLANK information of the window structure. If the current MSC value of the system is the same as the VBLANK information of the window structure, it indicates that the VBLANK count of the window structure is the same as the system MSC count. For example, if the current MSC value of the system is 1000, it means the current is the 1000th display cycle. At this time, if the VBLANK information of the window structure is also 1000, it indicates that the time when the window needs to be displayed is within the current display cycle, and the content to be displayed has been displayed. At this time, the screen does not need to be refreshed, and it can be determined that the display opportunity has not arrived, and no subsequent operations are performed. If the current MSC value of the system is different from the VBLANK information of the window structure, for example, if the current MSC value of the system is 1000, it means the current is the 1000th display cycle. At this time, if the VBLANK information in the window structure is 999, and the MSC value is greater than the value of the VBLANK information, it indicates that a new display cycle has come, that is, a new VBLANK signal has arrived. At this time, the screen is about to be refreshed, and it can be determined that the display opportunity has arrived.

[0035] S204, According to the arrival of the display opportunity, set the value of the copy flag bit to true.

[0036] After determining that the display opportunity has arrived, it indicates that the copy operation can be performed to copy and display the content in the window back buffer. At this time, set the value of the copy flag bit to true, indicating the state that can be copied.

[0037] S205, According to the copy flag bit with a value of true, copy the window back buffer under the root window.

[0038] When the X Server determines the value of the copy flag through the present_execute_copy() function, when it detects that the value of the copy flag is true, it performs a copy operation to copy the content in the window back buffer to under the root window of the X Server.

[0039] S206: Send the window back buffer in the root window to the Linux kernel, display it on the screen, and respond to the rendering operation of the 3D-X Client again.

[0040] In this embodiment, the X Server compares the system MSC value with the display request time to determine the display timing, and updates the copy flag according to the arrival of the display timing, controls the frequency of copying the window back buffer to the root window, and thus controls the process of this rendering cycle. By comparing the VBLANK information of the window structure with the current MSC value of the system, it is determined whether a new VBLANK signal arrives, and the arrival timing of the VBLANK signal is used to control the copy timing, and then control the execution cycle of the rendering process, so that the single rendering cycle is consistent with the single screen refresh cycle, and finally the rendering frequency and the display frequency are kept consistent, reducing the invalid rendering of the GPU and improving the utilization rate of GPU resources.

[0041] Optionally, the method further includes: After copying the window back buffer to the root window, update the VBLANK information of the window structure.

[0042] After the window back buffer is copied to the root window, it represents the completion of the rendering process, and the subsequent process is executed by the Linux kernel. At this time, the next rendering process can be entered, and the VBLANK information of the window structure is updated to mark the most recent VBLANK event, which is convenient for judging the rendering-copy timing in the subsequent rendering process, so as to execute the next rendering process.

[0043] Embodiment Three Figure 4 It is a flowchart of an Xwindow graphics display method according to Embodiment Three of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, S102 is specifically optimized as: The 3D-X Client renders the window back buffer according to the rendering operation; After the rendering is completed, call the display function to send a display request to the X Server; The X Server puts the display request into the display delay queue according to the display request time; Update the display delay queue according to the display request time.

[0044] Correspondingly, the Xwindow graphics display method provided in this embodiment specifically includes: S301, configure the window structure, and define the vertical blanking interval VBLANK information and the copy flag bit in the window structure.

[0045] S302, the 3D-X Client renders the window back buffer according to the rendering operation.

[0046] The 3D-X Client will, according to the responded rendering request, often be a 3D application such as a 3D game and other software. In the software, 3D rendering requests will be initiated according to different operations or processing procedures, and the window back buffer (back buffer) will be rendered by calling OpenGL functions.

[0047] S303, after the rendering is completed, call the display function to send a display request to the X Server.

[0048] After the 3D-X Client completes the rendering by calling GPU resources, it calls the xcb_present_pixmap() function to send a present_pixmap request to the X Server. The xcb_present_pixmap() function is a function of the XCB protocol and is used for interaction between the X Client and the X Server. The present_pixmap request function is the display interface provided by the X Server to the X Client, and the X Client can call this request interface to display the content (pixmap) of a window in the Xwindow system.

[0049] S304, the X Server places the display request into the display delay queue according to the display request time.

[0050] When the X Client calls xcb_present_pixmap() to send a display request, in the function parameters, the display request time is recorded through the target_msc parameter. The value of the target_msc parameter is the MSC value. The X Server judges the display request time in the target_msc parameter. According to whether the display request time is for immediate display, specifically, the display request time is compared with the current MSC value of the system. If they are the same, it is immediately displayed; if they are different, it is placed in the display delay queue.

[0051] S305, update the display delay queue according to the display request time.

[0052] After putting the delayed display request into the display delay queue, it is necessary to update the display delay queue, overwrite the original display request with the same display request as the new display request, and update the display delay queue to avoid conflicts caused by different display requests at the same time.

[0053] S306, the X Server obtains the value of the copy flag bit according to the display request time in the display delay queue, and copies the window background cache to under the root window according to the value of the copy flag bit by using the cache copy function.

[0054] S307, send the window background cache in the root window to the Linux kernel, display it on the screen, and respond to the rendering operation of the 3D-X Client again.

[0055] In this embodiment, the display function is called to send a display request for the rendered window background cache to the X Server. The X Server puts the display request into the delay queue according to the display request time and updates the delay queue, completing the interaction process between the C end and the S end. It fits with the display process of the S end and the Linux system, and then controls the flow cycle of the C end using GPU resources for rendering, reducing the waste of GPU resources.

[0056] Specifically, the X Server puts the display request into the display delay queue according to the display request time, including: The X Server obtains the system MSC value, compares it with the MSC value of the display request, and puts the display request into the display delay queue according to the comparison result.

[0057] The X Server judges whether the current display request is immediate display or delayed display according to the display request time. If it is immediate display, the subsequent copy - display process is executed. If it is delayed display, it is put into the display delay queue. Exemplarily, the X Server can call the present_get_ust_msc() function to obtain the current MSC value of the system, and judge whether the MSC value in the display request is the same as the obtained MSC value. If they are the same, it is immediate display. If they are different, it is delayed display. Exemplarily, first call the present_get_ust_msc() function to obtain the current MSC value of the system. If the acquisition is successful, judge whether the MSC value in the display request is the same as the obtained current MSC value of the system. If they are the same, it indicates immediate display. At this time, the value of the copy flag bit can be set to 0, indicating that there is no display execution in the current display cycle and display is required, for the XServer to detect and reference. If they are different, it is delayed display.

[0058] Specifically, updating the display delay queue according to the display request time includes: According to the MSC value of the display request, overwrite the display requests with the same MSC value in the display delay queue.

[0059] After putting a new display request into the delay queue, it is necessary to update the delay queue to avoid conflicts between display requests with the same display implementation. By traversing the delay queue, if there are other display requests in the delay queue with the same time as the current display request, then overwrite that request and only keep the latest display request. Exemplarily, first traverse the delay queue through the for_each_present_entry function, and then make the judgment if (vblank->target_msc != target_msc). If there are other display requests in the delay queue with the same time as the current display request, then vblank->pixmap = NULL, overwrite that request, and only keep the latest display request; otherwise, continue without any processing.

[0060] Embodiment Four Figure 5 The following is a schematic structural diagram of an Xwindow graphics display device according to Embodiment Four of the present invention. In this embodiment, the Xwindow graphics display device includes: A window structure configuration module 810, which is used to define VBLANK information and a copy flag bit in the window structure; A 3D rendering module 820, which is used to perform a response rendering operation and issue a display request; A window background cache copy module 830, which is used to copy the window background cache to the root window according to the copy flag bit; A display module 840, which is used to send the window background cache in the root window to the Linux kernel and display it on the screen.

[0061] In this embodiment, the window structure configuration module configures the window structure, defines VBLANK information and copy flag bits in the window structure; the 3D rendering module responds to the rendering operation of the 3D-X Client and sends a display request to the X Server; the window background cache copy module copies the window background cache to under the root window according to the copy flag bit and updates the VBLANK information; the display module sends the window background cache in the root window to the Linux kernel and displays it on the screen. By adding VBLANK information and copy flag bits for identifying window refresh conditions and controlling copy operations in the window structure, comparing the VBLANK information with the current MSC value of the system to determine whether a new display cycle arrives, when a new display cycle arrives, controlling the content in the window background cache to be copied to the root window by updating the value of the copy flag bit, controlling the rendering-copy process by reducing copy operations, making a rendering cycle consistent with a display cycle, so that the rendering frequency is consistent with the display frequency, reducing the frequency of GPU rendering and waste of GPU resources, enabling more GPU resources to be utilized for improving the rendering effect quality, and improving the utilization rate of GPU resources.

[0062] The Xwindow graphics display device provided by the embodiment of the present invention can execute the Xwindow graphics display method provided by any embodiment of the present invention, and has function modules and beneficial effects corresponding to the execution of the method.

[0063] Embodiment 5 Figure 6 It is a structural diagram of an electronic device according to Embodiment 5 of the present invention, Figure 6 showing a block diagram of an exemplary electronic device 12 suitable for implementing the embodiment of the present invention. Figure 6 The shown electronic device 12 is only an example and should not bring any limitation to the functions and usage scope of the embodiment of the present invention.

[0064] As Figure 6 shown, the electronic device 12 is presented in the form of a general-purpose computing device. The components of the electronic device 12 may include but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).

[0065] Bus 18 represents one or more of several types of bus architectures, including a memory bus or memory controller, a peripheral bus, an Accelerated Graphics Port, a processor bus, or a local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0066] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including both volatile and nonvolatile media, removable and non-removable media.

[0067] System memory 28 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 may further include other removable / non-removable, volatile / nonvolatile computer system storage media. By way of example only, storage system 34 can be used for reading and writing on non-removable, nonvolatile magnetic media ( Figure 6 not shown, and typically called a "hard disk drive"). Although Figure 6 not shown in the figure, a disk drive for reading and writing on removable nonvolatile disks (such as a "floppy disk"), and an optical disk drive for reading and writing on removable nonvolatile optical disks (such as a CD-ROM, DVD-ROM, or other optical media) can be provided. In these cases, each drive can be connected to bus 18 by one or more data media interfaces. System memory 28 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of the embodiments of the present invention.

[0068] A program / utility 40 having a set (at least one) of program modules 42 can be stored, for example, in system memory 28, and such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may include an implementation of a network environment. Program modules 42 typically carry out the functions and / or methods of the embodiments described herein.

[0069] The electronic device 12 can also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 12 / server / computer, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 22. Moreover, the electronic device 12 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the electronic device 12 through the bus 18. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0070] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing the Xwindow graphic display method provided by the embodiments of the present invention.

[0071] Embodiment Seven Embodiment Seven of the present invention also provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute the Xwindow graphic display method provided by the above embodiments when executed by a computer processor.

[0072] The computer storage medium of the embodiments of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device.

[0073] A computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.

[0074] The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including - but not limited to - wireless, wire, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0075] The computer program code for performing the operations of the present invention can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages - such as Java, Smalltalk, C++, and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN) - or, alternatively, can be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet).

[0076] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, it can also include more other equivalent embodiments, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. An Xwindow graphics display method, characterized in that, including: S101, configure the window structure, and define the vertical blanking interval (VBLANK) information and the copy flag bit in the window structure; S102, in response to the rendering operation of the 3D-X Client, perform a rendering operation on the window back buffer and send a display request to the X Server, and the X Server updates the display delay queue according to the display request time; S103, the X Server obtains the value of the copy flag bit by using the cache copy function according to the display request time in the display delay queue, and copies the window back buffer under the root window according to the value of the copy flag bit; S104, send the window back buffer in the root window to the Linux kernel, display it on the screen, and respond to the rendering operation of the 3D-X Client again.

2. The method according to claim 1, characterized in that, The S103 includes: The X Server compares the value of the system's display frame counter (MSC) with the display request time to determine that the display timing arrives; According to the arrival of the display timing, set the value of the copy flag bit to true; According to the copy flag bit with a value of true, copy the window back buffer under the root window.

3. The method according to claim 2, characterized in that, The method further includes: After copying the window back buffer to the root window, update the VBLANK information of the window structure.

4. The method according to claim 1, characterized in that The S102 includes: The 3D-X Client renders the window back buffer according to the rendering operation; After the rendering is completed, call the display function to send a display request to the X Server; The X Server puts the display request into the display delay queue according to the display request time; Update the display delay queue according to the display request time.

5. The method according to claim 4, characterized in that, The X Server puts the display request into the display delay queue according to the display request time, including: The X Server obtains the system MSC value, compares it with the MSC value of the display request, and puts the display request into the display delay queue according to the comparison result.

6. The method according to claim 4, wherein The updating the display delay queue according to the display request time includes: According to the MSC value of the display request, overwrite the display requests with the same MSC value in the display delay queue.

7. The method according to claim 1, characterized in that The S101 includes: Add an msc field and a copy_count field to the window structure. The msc field is used to record the MSC value when the window has the most recent VBLANK event, and the copy_count field is used to mark the number of times the window back buffer is copied during a single VBLANK period.

8. An Xwindow graphic display device, characterized in that, including: A window structure configuration module, used to define VBLANK information and a copy flag bit in the window structure; A 3D rendering module, used to perform a response rendering operation and send a display request; A window back buffer copy module, used to copy the window back buffer to the root window according to the copy flag bit; A display module, used to send the window back buffer in the root window to the Linux kernel and display it on the screen.

9. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device, used to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the Xwindow graphics display method according to any one of claims 1-7.

10. A storage medium containing computer-executable instructions, the computer-executable instructions being used to execute the Xwindow graphics display method according to any one of claims 1-7 when executed by a computer processor.

Citation Information

Patent Citations

  • Live flow sending display control method and device

    CN103873828A

  • Memory management method and device

    CN109144714A

  • Multi-screen synchronous display control method and device, electronic equipment and storage medium

    CN114217752A

  • Data transmission method and device for accelerating image display and medium

    CN114972607A

  • Video memory switching method and electronic equipment

    CN117058291A