Xwindow graphics display method, device, electronic device and medium

By introducing VBLANK information and copy flag bits in 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 is improved.

CN120234085BActive Publication Date: 2025-08-29KYLIN CORP
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When the rendering frequency of 3D applications is higher than the display frequency of the Xwindow window system, it leads to waste of rendering resources.

Method used

By defining the vertical blanking interval VBLANK information and copy flag bits in the window structure, the consistency between the rendering frequency and display frequency is controlled, and the VBLANK information is compared with the current MSC value of the system, the display timing is determined, and the copy operation of the window background cache is controlled through the copy flag bits.

Benefits of technology

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

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234085B_ABST
    Figure CN120234085B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention disclose an Xwindow graphics display method, apparatus, electronic device, and medium. The method comprises: defining vertical blanking interval (VBLANK) information and a copy flag in a window structure; rendering the window's background buffer and issuing a display request to an X Server; updating a display delay queue based on the display request time; and updating the copy flag value based on the display request time in the display delay queue; copying the window's background buffer to a root window and displaying it on the screen. By adding VBLANK information and a copy flag to identify window refresh status and control copy operations, the VBLANK information is compared with the system's current MSC value to determine the arrival of a new display cycle and update the copy flag value. By reducing copy operations, the rendering frequency is kept consistent with the display frequency, thereby reducing GPU rendering frequency and GPU resource waste.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the widespread application of Linux systems, the Xwindow window system can provide a graphical operating interface for Linux systems to facilitate user interaction. Under the display framework of the Linux kernel, when 3D applications use the GPU for rendering, the rendered images can be displayed on the screen through the Xwindow window system.

[0003] When displaying the rendered image on the screen, the X Server first copies the rendered content and then displays it on the screen. The rendering frequency is related to the configuration of the 3D application and the performance of the GPU. With technological advancements, the configuration of 3D applications and the performance of GPUs have gradually improved, and the rendering frequency has also gradually increased. When the GPU rendering frequency of 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, and the display frequency of the XWindow window system is much lower than the rendering frequency, most of the rendered resources cannot be actually displayed on the screen, resulting in a large amount of GPU resources being wasted. Summary of the Invention

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

[0005] In a first aspect, an embodiment of the present invention provides an Xwindow graphics display method, comprising:

[0006] S101, configure a window structure, define vertical blanking interval VBLANK information and a copy flag in the window structure;

[0007] S102, in response to the rendering operation of the 3D-X Client, performing a rendering operation on the window background cache and sending a display request to the X Server, and the X Server updates the display delay queue according to the display request time;

[0008] S103, the X Server obtains the value of the copy flag using a cache copy function according to the display delivery request time in the display delivery delay queue, and copies the window background cache to the root window according to the value of the copy flag;

[0009] 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.

[0010] Furthermore, the S103 includes:

[0011] The X Server compares the display frame counter MSC value of the system with the display request time to determine that the display transmission time has arrived;

[0012] According to the arrival of the display sending opportunity, the value of the copy flag is set to true;

[0013] According to the copy flag value is true, the window background buffer is copied to the root window.

[0014] Furthermore, the method further comprises:

[0015] After copying the window back buffer to the root window, update the VBLANK information of the window structure.

[0016] Furthermore, the S102 includes:

[0017] The 3D-X Client renders the window background buffer according to the rendering operation;

[0018] After rendering is completed, the display sending function is called to send a display request to the X Server;

[0019] The X Server places the display request into the display delay queue based on the display request time.

[0020] Update the display delay queue according to the display request time.

[0021] Furthermore, the X Server places the display sending request into a display sending delay queue according to the display sending request time, including:

[0022] The X Server obtains the system MSC value, compares it with the MSC value of the display sending request, and puts the display sending request into the display sending delay queue according to the comparison result.

[0023] Furthermore, the updating of the display transmission delay queue according to the display transmission request time includes:

[0024] According to the MSC value of the display sending request, the display sending request with the same MSC value in the display sending delay queue is overwritten.

[0025] Furthermore, the S101 includes:

[0026] Add the msc field and 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. The copy_count field is used to mark the number of window background cache copies during a single VBLANK.

[0027] In a second aspect, an embodiment of the present invention provides an Xwindow graphics display device, comprising:

[0028] Window structure configuration module, used to define VBLANK information and copy flag in the window structure;

[0029] 3D rendering module, used to perform response rendering operations and issue display requests;

[0030] The window back buffer copy module is used to copy the window back buffer to the root window according to the copy flag;

[0031] The display module is used to send the window back buffer in the root window to the Linux kernel and display it on the screen.

[0032] In a third aspect, an embodiment of the present invention provides an electronic device, including:

[0033] one or more processors;

[0034] a storage device for storing one or more programs,

[0035] 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.

[0036] In a fourth aspect, an embodiment of the present invention provides a storage medium comprising computer-executable instructions, wherein the computer-executable instructions are used to execute the above-mentioned Xwindow graphics display method when executed by a computer processor.

[0037] An embodiment of the present invention provides an Xwindow graphics display method, device, electronic device, and medium. The method adds VBLANK information and a copy flag to a window structure to identify window refresh status and control copy operations. The method compares the VBLANK information with the value of the current MSC of the system to determine whether a new display cycle has arrived. When a new display cycle has arrived, the value of the copy flag is updated to control the copying of content in the window background cache to the root window. By reducing copy operations, the rendering-copying process is controlled, so that a rendering cycle is consistent with a display cycle, thereby keeping the rendering frequency consistent with the display frequency, reducing the frequency of GPU rendering and the waste of GPU resources, allowing GPU resources to be more utilized to improve the quality of rendering effects, and improving the utilization rate of GPU resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings, which constitute part of the present invention, are provided to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are provided to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:

[0039] Figure 1 This is a flowchart of an Xwindow graphics display method according to the first embodiment of the present invention;

[0040] Figure 2 This is a comparison chart of running score performance before and after optimization according to the first embodiment of the present invention;

[0041] Figure 3 This is a flowchart of an Xwindow graphics display method according to the second embodiment of the present invention;

[0042] Figure 4 This is a flowchart of an Xwindow graphics display method according to embodiment 3 of the present invention;

[0043] Figure 5 This is a structural diagram of an Xwindow graphics display device according to a fourth embodiment of the present invention;

[0044] Figure 6 This is a structural diagram of an electronic device according to a fifth embodiment of the present invention. DETAILED DESCRIPTION

[0045] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.

[0046] XWindow (X Window System) utilizes a client / server design, with the server being the X Server and the client being the X Client, also known as the Xorg graphics server. It provides a basic graphical interface for Linux systems, facilitating user interaction. The 3D image display process based on XWindow involves a 3D-X Client (a 3D application, such as a 3D game) utilizing GPU resources for rendering, which is then displayed on the screen by the X Server. With technological advancements, the performance of 3D applications and GPUs has steadily improved, increasing rendering capabilities and the achievable rendering frequency. If the rendering frequency exceeds the display frequency, only a portion of the rendered frames can be displayed based on the display frequency, resulting in a waste of rendering resources. Therefore, the XWindow display frequency must be synchronized with the VBLANK signal. Specifically, the XWindow displays the same number of frames as the number of vertical blanking interval (VBLNAK) signals sent per second by the screen. For example, a screen with a 60Hz refresh rate generates 60 vertical blanking interval (VBLANK) signals per second, allowing it to refresh 60 frames of content. Therefore, XWindow displays 60 frames of content within 1 second. During the rendering process, there's a trade-off or balance between rendering frequency and rendering quality. If the rendering frequency is too high but the display isn't working, the wasted rendering resources will actually degrade the quality of the rendering. Limiting the rendering frequency can also improve rendering quality and ensure resource utilization.

[0047] Example 1

[0048] Figure 1 This is a flowchart of an Xwindow graphics display method according to a first embodiment of the present invention. This embodiment limits the frequency of back-end cache copies of rendered windows to be consistent with the display frequency, thereby making the rendering frequency consistent with the display frequency. The method specifically includes the following steps:

[0049] S101, configuring a window structure, defining vertical blanking interval VBLANK information and a copy flag in the window structure.

[0050] To synchronize the rendering frequency with the display frequency, the rendering process can be limited by limiting the frequency of copying the rendered buffer. To do this, configure the window structure that describes the window and add fields for the vertical blanking interval (VBLANK) and the copy flag. The vertical blanking interval (VBLANK) indicates when the display device's scanning point returns from the lower right corner of the image to the upper left corner to begin scanning a new frame after completing a frame scan. This interval is called the vertical blanking interval, also known as field blanking. The VBLANK information records the most recent VBLANK event in the window structure and is compared with the system's display frame counter (MSC, a monotonically increasing counter of the number of VBLANK frames since power-up). The comparison result determines when to display the content. The copy flag determines whether to copy the buffered content. By linking VBLANK with the copy flag, the timing of copying the rendered buffer is determined, thereby synchronizing the rendering frequency with the display frequency.

[0051] S102: In response to the rendering operation of the 3D-X Client, a rendering operation is performed on the window background buffer and a display sending request is sent to the X Server. The X Server updates the display sending delay queue according to the display sending request time.

[0052] The 3D-X Client responds to the rendering operation and calls the GPU to render the window's back buffer. The back buffer is a rendering method based on double buffering, divided into a front buffer and a back buffer. The front buffer is used for display, and the back buffer is used for rendering. By exchanging the front and back buffers, the display can be quickly updated, solving problems such as display tearing and screen distortion. After rendering is complete, the XServer calls a function to initiate a display request. The display request time is recorded in the display request based on the rendered content. The display request time is divided into immediate display and delayed display. If the display is immediate, the subsequent copy-display process must be executed immediately. If the display is delayed, the display is placed in the display delay queue and the display delay queue is updated.

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

[0054] The display delay queue will be sorted according to the time in the queue, and a copy operation will be initiated for the task that reaches the display request time. When the copy operation is initiated, the value of the copy flag will be judged first. The value of the copy flag includes true and false. True means that copying is allowed, and false means that copying is not allowed. The value of the copy flag will be compared with the value of the system's display frame counter (MSC) and the VBLANK information of the window structure to determine whether a new VBLANK signal has arrived, that is, whether the screen is ready to refresh the content of a new frame, to update the copy flag. If a new VBLANK signal arrives, it means that the screen is in the vertical blanking interval. At this time, the contents of the buffer area can be copied and displayed on the screen. If a new VBLANK signal does not arrive, it means that the screen is not in a state to be refreshed, and no copying will be performed, and the next rendering process will not be entered, thereby limiting the rendering frequency.

[0055] 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.

[0056] The X Server monitors the value of the copy flag. When it detects that the copy flag is true, it executes a copy operation through the copy function to copy the contents of the window's back buffer to the root window (the root window is used to describe the operating system desktop. All application windows on the operating system desktop need to be mapped to the root window). The Linux kernel then displays the root window by sending it to the display, thus completing a rendering-copy-display operation. At this time, the back buffer is switched to the foreground, and the original front buffer is switched to the background and becomes the back buffer, which can respond again and execute the next rendering process.

[0057] This embodiment adds VBLANK information and a copy flag to the window structure to identify the window refresh status and control the copy operation. By comparing the VBLANK information with the value of the current MSC of the system, it is determined whether a new display cycle has arrived. When a new display cycle arrives, the value of the copy flag is updated to control the copying of the content in the window background cache 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 keeping the rendering frequency consistent with the display frequency, reducing the frequency of GPU rendering and the waste of GPU resources, so that GPU resources can be used more to improve the quality of rendering effects, thereby improving the utilization rate of GPU resources. Figure 2The following is a comparison of the performance before and after optimization using the method disclosed in the present invention. GLmark2 was used to test the GPU performance. The experimental environment is:

[0058] Operating System Version:

[0059] Kylin-Desktop-V10-SP1-General-RC1-2403-update1-Build02-20240527(buildid:55913)

[0060] Processor: Hygon C86 3250 8-core Processor

[0061] Memory: 8 GB UnilC 3200 MT / s

[0062] As shown in Table 1, the optimized GPU performance is improved in most cases:

[0063]

[0064] Table 1

[0065] Specifically, the S101 includes:

[0066] Add the msc field and 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. The copy_count field is used to mark the number of window background cache copies during a single VBLANK.

[0067] In order to make the window structure meet the judgment logic and execution basis in the rendering-copying process, it is necessary to add corresponding fields and flag information to the window structure describing the window. For example, in the window structure, add the uint64_t msc field to record the MSC value of the window at the last VBLANK time, and add the uint64_t copy_count field to mark the number of window background cache copies during a single VBLANK.

[0068] Example 2

[0069] Figure 3 This is a flow chart of an Xwindow graphics display method according to the second embodiment of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, S103 is specifically optimized as follows:

[0070] The X Server compares the display frame counter MSC value of the system with the display request time to determine that the display transmission time has arrived;

[0071] According to the arrival of the display sending opportunity, the value of the copy flag is set to true;

[0072] According to the copy flag value is true, the window background buffer is copied to the root window.

[0073] Accordingly, the Xwindow graphics display method provided in this embodiment specifically includes:

[0074] S201, configure a window structure, and define vertical blanking interval VBLANK information and a copy flag in the window structure.

[0075] S202: In response to the rendering operation of the 3D-X Client, a rendering operation is performed on the window background buffer and a display sending request is sent to the X Server. The X Server updates the display sending delay queue according to the display sending request time.

[0076] S203: The X Server compares the display frame counter MSC value of the system with the display sending request time to determine that the display sending time has arrived.

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

[0078] S204: according to the arrival of the display sending opportunity, the value of the copy flag is set to true.

[0079] After determining that the time for displaying has arrived, it indicates that the copy operation can be performed to copy the contents in the window background buffer and display them. At this time, the value of the copy flag is set to true, indicating that the copying is possible.

[0080] S205: According to the copy flag whose value is true, the window background buffer is copied to the root window.

[0081] When the X Server uses the present_execute_copy() function to determine the value of the copy flag, if it detects that the copy flag is true, it executes the copy operation to copy the contents of the window back buffer to the root window of the X Server.

[0082] 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.

[0083] This embodiment compares the system MSC value with the display request time through the X Server to determine the display timing. Based on the arrival of the display timing, the copy flag is updated to control the frequency of copying the window's background buffer to the root window, thereby controlling the flow of this rendering cycle. By comparing the VBLANK information in the window structure with the current system MSC value, it is determined whether a new VBLANK signal has arrived. The arrival of the VBLANK signal is used to control the copy timing, thereby controlling the execution cycle of the rendering process. This ensures that a single rendering cycle is consistent with a single screen refresh cycle. Ultimately, this ensures that the rendering frequency is consistent with the display frequency, reducing ineffective GPU rendering and improving GPU resource utilization.

[0084] Optionally, the method further includes:

[0085] After copying the window back buffer to the root window, update the VBLANK information of the window structure.

[0086] After the window background cache is copied to the root window, the rendering process is completed. The subsequent process is executed by the Linux kernel. At this time, the next rendering process can be entered, the VBLANK information of the window structure is updated, and the most recent VBLANK event is marked to facilitate the judgment of the rendering-copying timing in the subsequent rendering process, thereby executing the next rendering process.

[0087] Example 3

[0088] Figure 4 This is a flow chart of an Xwindow graphics display method according to Embodiment 3 of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, S102 is specifically optimized as follows:

[0089] The 3D-X Client renders the window background buffer according to the rendering operation;

[0090] After rendering is completed, the display sending function is called to send a display request to the X Server;

[0091] The X Server places the display request into the display delay queue based on the display request time.

[0092] Update the display delay queue according to the display request time.

[0093] Accordingly, the Xwindow graphics display method provided in this embodiment specifically includes:

[0094] S301, configuring a window structure, defining vertical blanking interval VBLANK information and a copy flag in the window structure.

[0095] S302: The 3D-X Client renders the window background buffer according to the rendering operation.

[0096] The 3D-X Client responds to the rendering request. The 3D-X Client is often a 3D application, such as a 3D game. In the software, 3D rendering requests are initiated according to different operations or processing processes. The rendering operation is performed on the window back buffer by calling OpenGL functions.

[0097] S303: After the rendering is completed, the display sending function is called to send a display sending request to the X Server.

[0098] After the 3D-X client completes rendering by invoking 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 an XCB protocol function 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. The X Client can call this request interface to display the contents (pixmap) of a window in the XWindow system.

[0099] S304: The X Server places the display sending request into a display sending delay queue according to the display sending request time.

[0100] When the X Client calls xcb_present_pixmap() to request a display, the target_msc parameter is used in the function parameters to record the display request time. The target_msc parameter's value is the MSC value. The X Server determines whether the display request time in the target_msc parameter is for immediate display by comparing it with the system's current MSC value. If they match, the display is displayed immediately. If not, the display is placed in the display delay queue.

[0101] S305: Update the display transmission delay queue according to the display transmission request time.

[0102] After the delayed display sending request is placed in the display sending delay queue, the display sending delay queue needs to be updated, and the new display sending request overwrites the original display sending request with the same display sending request, and the display sending delay queue is updated to avoid conflicts caused by different display sending requests at the same time.

[0103] S306: X Server obtains the value of the copy flag using a cache copy function according to the display sending request time in the display sending delay queue, and copies the window background cache to the root window according to the value of the copy flag.

[0104] S307: 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.

[0105] This embodiment calls the display sending function to send a display sending request from the background cache of the rendered window to the X Server. The X Server places the display sending request into a delay queue and updates the delay queue based on the display sending request time. This completes the interaction between the client and the server. The server coordinates the display process of the S end with that of the Linux system, thereby controlling the rendering process cycle of the GPU resources used by the client, thereby reducing GPU resource waste.

[0106] Specifically, the X Server places the display request into the display delay queue based on the display request time, including:

[0107] The X Server obtains the system MSC value, compares it with the MSC value of the display sending request, and puts the display sending request into the display sending delay queue according to the comparison result.

[0108] Based on the display request time, the X Server determines whether the current display request is for immediate or delayed display. If it is for immediate display, the subsequent copy-display process is executed. If it is for delayed display, the display is placed in the display delay queue. For example, the X Server can call the present_get_ust_msc() function to obtain the system's current MSC value and determine whether the MSC value in the display request is consistent with the obtained MSC value. If they are consistent, the display is immediate; if not, the display is delayed. For example, the present_get_ust_msc() function is first called to obtain the system's current MSC value. If the acquisition is successful, the MSC value in the display request is determined to be consistent with the obtained system's current MSC value. If they are consistent, the display is immediate. At this time, the copy flag can be set to 0, indicating that display is not being executed in the current display cycle and needs to be executed. This is used as a reference for XServer detection. If they are inconsistent, the display is delayed.

[0109] Specifically, updating the display delay queue according to the display request time includes:

[0110] According to the MSC value of the display sending request, the display sending request with the same MSC value in the display sending delay queue is overwritten.

[0111] After placing the new display request into the delay queue, the delay queue needs to be updated to avoid conflicts between display requests for the same display implementation. By traversing the delay queue, if there are other display requests with the same time as the current display request in the delay queue, the request will be overwritten, and only the latest display request will be retained. For example, first traverse the delay queue through the for_each_present_entry function, and then perform the if (vblank->target_msc !=target_msc) judgment. If there are other display requests with the same time as the current display request in the delay queue, then vblank->pixmap = NULL, the request will be overwritten, and only the latest display request will be retained. Otherwise, continue without processing.

[0112] Example 4

[0113] Figure 5 This is a schematic diagram of the structure of an Xwindow graphic display device according to a fourth embodiment of the present invention. In this embodiment, the Xwindow graphic display device includes:

[0114] The window structure configuration module 810 is used to define VBLANK information and a copy flag in the window structure;

[0115] 3D rendering module 820, used to perform response rendering operations and issue display requests;

[0116] The window backend buffer copy module 830 is used to copy the window backend buffer to the root window according to the copy flag;

[0117] The display module 840 is used to send the window background buffer in the root window to the Linux kernel and display it on the screen.

[0118] This embodiment configures the window structure through a window structure configuration module, defining VBLANK information and a copy flag in the window structure. The 3D rendering module responds to the 3D-X client's rendering operations and sends a display request to the X server. The window back buffer copy module copies the window back buffer to the root window based on the copy flag and updates the VBLANK information. The display module sends the window back buffer in the root window to the Linux kernel for display on the screen. By adding VBLANK information and a copy flag to the window structure to indicate window refresh status and control copy operations, the VBLANK information is compared with the current system MSC value to determine whether a new display cycle has arrived. When a new display cycle arrives, the copy flag value is updated to control the copying of the contents of the window back buffer to the root window. By reducing copy operations, the rendering-copying process is controlled, ensuring consistency between a rendering cycle and a display cycle, thereby aligning the rendering frequency with the display frequency. This reduces GPU rendering frequency and GPU resource waste, allowing more GPU resources to be used to improve rendering quality and improve GPU resource utilization.

[0119] The Xwindow graphic display device provided in the embodiment of the present invention can execute the Xwindow graphic display method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0120] Example 5

[0121] Figure 6 This is a structural diagram of an electronic device according to a fifth embodiment of the present invention. Figure 6 A block diagram of an exemplary electronic device 12 suitable for implementing embodiments of the present invention is shown. Figure 6 The electronic device 12 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present invention.

[0122] like Figure 6 As shown, electronic device 12 is implemented as a general-purpose computing device. Components of electronic device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 that connects various system components (including system memory 28 and processing unit 16).

[0123] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

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

[0125] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 6 Not shown, usually called a "hard drive"). Although Figure 6 Although not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), as well as an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.

[0126] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. 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, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally implement the functions and / or methodologies of the embodiments described herein.

[0127] The electronic device 12 can also communicate with one or more external devices 14 (e.g., a keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the electronic device 12 / server / computer, and / or any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). This communication can occur via an input / output (I / O) interface 22. Furthermore, the electronic device 12 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction 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.

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

[0129] Example 7

[0130] The seventh embodiment of the present invention further provides a storage medium containing computer executable instructions, which, when executed by a computer processor, is used to execute the Xwindow graphic display method provided in the above embodiment.

[0131] The computer storage medium of the embodiments of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media 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 thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

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

[0133] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0134] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, 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 cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0135] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. 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: include: S101, configure a window structure, define vertical blanking interval VBLANK information and a copy flag in the window structure; S102, in response to the rendering operation of the 3D-X Client, performing a rendering operation on the window background cache and sending a display request to the X Server, and the X Server updating the display delay queue according to the display request time; S103, the X Server obtains the value of the copy flag using a cache copy function according to the display delivery request time in the display delivery delay queue, and copies the window background cache to the root window according to the value of the copy flag; 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-XClient again.

2. The method according to claim 1, characterized in that The S103 includes: The X Server compares the display frame counter MSC value of the system with the display request time to determine that the display transmission time has arrived; According to the arrival of the display sending opportunity, the value of the copy flag is set to true; According to the copy flag value is true, the window background buffer is copied to the root window.

3. The method according to claim 2, characterized in that The method further comprises: 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, wherein The S102 includes: The 3D-X Client renders the window background buffer according to the rendering operation; After rendering is completed, the display sending function is called to send a display request to the X Server; The X Server places the display request into the display delay queue based on 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 places the display sending request into a display sending delay queue according to the display sending request time, including: The X Server obtains the system MSC value, compares it with the MSC value of the display sending request, and puts the display sending request into the display sending delay queue according to the comparison result.

6. The method according to claim 4, characterized in that The updating of the display transmission delay queue according to the display transmission request time includes: According to the MSC value of the display sending request, the display sending request with the same MSC value in the display sending delay queue is overwritten.

7. The method according to claim 1, characterized in that The S101 includes: Add the msc field and 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. The copy_count field is used to mark the number of window background cache copies during a single VBLANK.

8. An Xwindow graphic display device, characterized in that: include: Window structure configuration module, used to define VBLANK information and copy flag in the window structure; The 3D rendering module is used to respond to the rendering operation of the 3D-X Client, perform rendering operations on the window background cache, and send a display request to the XServer, so that the XServer updates the display delay queue according to the display request time; The window backend cache copy module is used to enable the X Server to obtain the value of the copy flag using the cache copy function according to the display sending request time in the display sending delay queue, and copy the window backend cache to the root window according to the value of the copy flag; The display module is used to send the window back buffer in the root window to the Linux kernel and display it on the screen, and respond to the rendering operation of the 3D-X Client again.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing 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 to 7.

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

Citation Information

Patent Citations

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

    CN114217752A

  • Video memory switching method and electronic equipment

    CN117058291A