A switching method, device and computing equipment of a display server protocol

By automatically determining the capabilities of the graphics card and CPU, and selecting the appropriate display server protocol, the problem of users having difficulty choosing between X11 and Wayland is solved, and automatic protocol selection is achieved during operating system startup.

CN116339667BActive Publication Date: 2026-05-12UNIONTECH SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
UNIONTECH SOFTWARE TECH CO LTD
Filing Date
2023-03-28
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In the existing technology, users find it difficult to choose the right display server protocol (X11 or Wayland) in a Linux system due to a lack of professional knowledge, which leads to inappropriate selection.

Method used

A method for switching display server protocols is provided, which automatically determines whether the computer system complies with the official requirements of the Wayland protocol, including whether the graphics card supports EGL, and whether there is a hardware graphics processor and CPU processing capability, to select the appropriate display server protocol.

Benefits of technology

It enables the automatic selection of a suitable display server protocol before the operating system starts, eliminating the need for manual selection by the user, thus improving the accuracy of the selection and the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116339667B_ABST
    Figure CN116339667B_ABST
Patent Text Reader

Abstract

The application discloses a switching method, device and computing equipment of display server protocol, relates to the technical field of graphic card rendering driver, and aims to solve the problem that the user needs to manually select X11 protocol or Wayland protocol before the Linux system enters the GUI desktop. The method comprises the following steps: in response to the starting of the operating system, it is judged whether the current computer system meets the requirements of the Stable protocol; if not, the X11 protocol is selected, otherwise it is judged whether the current computer system exists a hardware graphic processor; if yes, the Wayland protocol is selected, otherwise it is continuously judged whether the data processing capacity of the central processing unit of the current computer system meets the requirements; if yes, the Wayland protocol is selected; otherwise, the X11 protocol is selected as the display server protocol. The device comprises a first judging unit, a second judging unit, a third judging unit, a first selecting unit and a second selecting unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of graphics card rendering driver technology, and in particular to a method, apparatus and computing device for switching display server protocols. Background Technology

[0002] X11, also known as the X Window System, is primarily used in Unix and Unix-like systems. It is a standard toolkit and protocol for building graphical user interfaces and is widely used in modern operating systems. Wayland, also known as the Wayland Window System, is a new standard toolkit and protocol for building graphical user interfaces. Its goal is not only to completely replace the X Window System but also to replace the X11 protocol client with the Wayland protocol client.

[0003] Currently, due to its advanced structure and high performance, the Wayland protocol is being used by various Linux distributions and is being adopted as the default boot protocol by operating systems. However, the hardware support environment for Wayland on graphics cards is not perfect. It supports some graphics cards very well, but not others, especially domestically produced graphics cards. Therefore, from the operating system level, there is a problem: how to determine whether the current hardware environment can perfectly support the Wayland protocol.

[0004] In Linux systems, the graphics card's rendering driver is typically loaded using Mesa (a Linux rendering library that supports AMD and Intel graphics cards, as well as CPU emulation). Therefore, the conventional method to determine if an operating system supports the Wayland protocol is to check if the system uses a software graphics processing unit (GPU). If a software GPU is used, the Wayland protocol cannot be used; instead, the X11 protocol must be used. This method has the following problems: 1. It cannot detect hardware that does not use Mesa as its rendering method, such as Nvidia graphics card drivers or Huawei Arm platforms that use Mali (an ARM architecture rendering library used in integrated graphics environments); 2. The command `glxinfo` used to query GPU hardware information is actually an X11 technology. If the driver configuration in the current X11 environment is incorrect, the correct query results will not be obtained.

[0005] Because the above methods are not yet mature, many Linux distributions still use the method of allowing users to manually select the protocol, such as... Figure 1As shown, after the operating system boots up, before entering the GUI desktop, the system prompts the user to choose a protocol from Ubuntu and Ubuntu on Xorg. Ubuntu is equivalent to Wayland, and Ubuntu on Xorg is an implementation of X11. However, most users are unaware of the differences between X11 and Wayland, making it difficult to make a reasonable choice.

[0006] In summary, the existing protocol selection methods mentioned above have the problem that users' lack of professional knowledge makes it difficult for them to make a reasonable choice. Summary of the Invention

[0007] Therefore, the present invention provides a method, apparatus and computing device for switching display server protocols, in an attempt to solve or at least alleviate at least one of the problems mentioned above.

[0008] According to one aspect of the present invention, a method for switching display server protocols is provided, comprising: in response to operating system startup, determining whether the current computer system conforms to the requirements of the official Wayland protocol; if the current computer system does not conform to the requirements of the official Wayland protocol, selecting the X11 protocol as the display server protocol; if the current computer system conforms to the requirements of the official Wayland protocol, determining whether the current computer system has a hardware graphics processor; if the current computer system has a hardware graphics processor, selecting the Wayland protocol as the display server protocol; if the current computer system does not have a hardware graphics processor, determining whether the data processing capability of the current computer system's central processing unit meets the requirements; and if the data processing capability of the central processing unit meets the requirements, selecting the Wayland protocol as the display server protocol; otherwise, selecting the X11 protocol as the display server protocol.

[0009] Optionally, in the method for switching display server protocols according to the present invention, determining whether the current computer system conforms to the requirements of the official Wayland protocol includes: determining whether the graphics card of the current computer system supports EGL, and whether the EGL version number of the current computer system meets the requirements; if the EGL version number meets the requirements, then determining whether the graphics card simultaneously supports the graphics processor shared cache plugin and display window binding; and if the graphics card simultaneously supports the graphics processor shared cache plugin and display window binding, then it indicates that the current computer system conforms to the requirements of the official Wayland protocol.

[0010] Optionally, in the switching method of the display server protocol according to the present invention, determining whether the graphics card of the current computer system supports EGL includes: determining whether the current computer system has an EGL library; if it does, it means that the graphics card supports EGL.

[0011] Optionally, in the switching method of the display server protocol according to the present invention, determining whether the graphics card simultaneously supports the graphics processor shared cache plugin and display window binding includes: querying whether the graphics card supports the graphics processor shared cache plugin and display window binding through EGL library functions.

[0012] Optionally, in the switching method of the display server protocol according to the present invention, determining whether the current computer system has a hardware graphics processor includes: querying the in-core driver name of the graphics processor; and searching for the out-of-core rendering driver name of the graphics processor based on the in-core driver name. If the out-of-core rendering driver name is found, it indicates that the current computer system has a hardware graphics processor.

[0013] Optionally, in the switching method of the display server protocol according to the present invention, determining whether the data processing capability of the central processing unit of the current computer system meets the requirements includes: querying the clock frequency and number of cores of the central processing unit; and determining the clock frequency and number of cores. If the clock frequency reaches 3 GHz and the number of cores reaches 4, it indicates that the data processing capability of the central processing unit meets the requirements.

[0014] According to another aspect of the present invention, a display server protocol switching device is also provided, comprising: a first determining unit, adapted to determine whether the current computer system conforms to the requirements of the Stable protocol in response to operating system startup; a second determining unit, adapted to determine whether the current computer system has a hardware graphics processor if the current computer system conforms to the requirements of the official Wayland protocol; a third determining unit, adapted to determine whether the data processing capability of the central processing unit of the current computer system meets the requirements if the current computer system does not have a hardware graphics processor; a first selecting unit, adapted to select the X11 protocol as the display server protocol if the determining result of the first determining unit is that the current computer system does not conform to the requirements of the official Wayland protocol, or the determining result of the third determining unit is that the data processing capability of the central processing unit does not meet the requirements; and a second selecting unit, adapted to select the Wayland protocol as the display server protocol if the determining result of the second determining unit is that the current computer system has a hardware graphics processor, or the determining result of the third determining unit is that the data processing capability of the central processing unit meets the requirements.

[0015] Optionally, in the display server protocol switching device according to the present invention, the first determining unit includes: a first determining subunit, adapted to determine whether the graphics card of the current computer system supports EGL and whether the EGL version number of the current computer system meets the requirements in response to the operating system startup; and a second determining subunit, adapted to determine whether the graphics card simultaneously supports the graphics processor shared cache plugin and display window binding if the EGL version number meets the requirements, and if the graphics card simultaneously supports the graphics processor shared cache plugin and display window binding, it indicates that the current computer system meets the requirements of the official Wayland protocol.

[0016] According to another aspect of the present invention, a computing device is also provided, comprising: at least one processor and a memory storing program instructions; when the program instructions are read and executed by the processor, the computing device causes the computing device to perform the display server protocol switching method described above.

[0017] According to another aspect of the present invention, a readable storage medium storing program instructions is also provided, which, when read and executed by a computing device, causes the computing device to perform the above-described display server protocol switching method.

[0018] The display server protocol switching method, apparatus, and computing device according to the present invention can achieve at least one of the following beneficial effects: taking into account the official Wayland protocol, GPU, and CPU, after the operating system starts but before entering the GUI desktop, it automatically determines whether the computer system meets the various conditions for stable operation of the Wayland protocol based on different graphics card hardware environments. If these conditions are met, it automatically enters the Wayland protocol environment; if these conditions are not met, it automatically enters the X11 protocol environment, without requiring the user to manually select the protocol. Attached Figure Description

[0019] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of this disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.

[0020] Figure 1 An interface for manually selecting a protocol according to the background section of the present invention is shown;

[0021] Figure 2 A schematic diagram of a computing device 200 according to an embodiment of the present invention is shown;

[0022] Figure 3 A flowchart of a display server protocol switching method 300 according to an embodiment of the present invention is shown;

[0023] Figure 4 A schematic diagram of a display server protocol switching device 400 according to an embodiment of the present invention is shown. Detailed Implementation

[0024] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0025] To address the problem that existing protocol selection methods often result in users lacking professional knowledge and thus struggling to make informed choices, this invention provides a method for switching display server protocols. This method automatically checks whether the current computer's graphics card supports the Wayland protocol and then automatically selects the appropriate protocol.

[0026] Figure 2 A schematic diagram of a computing device 200 according to an embodiment of the present invention is shown. It should be noted that... Figure 2 The computing device 200 shown is merely an example. In practice, the computing device used to implement the switching method of the display server protocol of this invention can be any type of device, and its hardware configuration can be similar to... Figure 2 The computing device 200 shown is the same as, and can also be with Figure 2 The computing device 200 shown is different. In practice, the computing device used to implement the display server protocol switching method of the present invention can be... Figure 2 The hardware components of the computing device 200 shown can be added or removed. This invention does not limit the specific hardware configuration of the computing device.

[0027] like Figure 2 As shown, computing device 200 typically includes memory 210, graphics card 220, central processing unit (CPU) 230, and graphics processing unit (GPU) 240.

[0028] Depending on the desired configuration, the central processing unit 230 can be any type of processor, including but not limited to: microprocessor (μP), microcontroller (μC), digital information processor (DSP), or any combination thereof.

[0029] Depending on the desired configuration, memory 210 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. Memory 210 may include an operating system and program instructions for executing switching methods of the display server protocol.

[0030] Depending on the desired configuration, the graphics card 220 should be a dedicated graphics card.

[0031] Depending on the desired configuration, the graphics processor 240 can be a hardware device independent of the central processing unit 230, or it can be software emulated by the central processing unit 230.

[0032] The computing device 200 can be implemented as a server, such as a file server, database server, application server, and web server, or as a personal computer including desktop and laptop computer configurations. Of course, the computing device 200 can also be implemented as part of a small-sized portable (or mobile) electronic device. In an embodiment of the present invention, the computing device 200 is configured to execute a switching method 300 according to the display server protocol of the present invention.

[0033] A display server protocol switching method 300 according to an embodiment of the present invention includes: in response to operating system startup, determining whether the current computer system conforms to the requirements of the official Wayland protocol; if the current computer system does not conform to the requirements of the official Wayland protocol, selecting the X11 protocol as the display server protocol; if the current computer system conforms to the requirements of the official Wayland protocol, determining whether the current computer system has a hardware graphics processor; if the current computer system has a hardware graphics processor, selecting the Wayland protocol as the display server protocol; if the current computer system does not have a hardware graphics processor, determining whether the data processing capability of the current computer system's central processing unit meets the requirements; and if the data processing capability of the central processing unit meets the requirements, selecting the Wayland protocol as the display server protocol; otherwise, selecting the X11 protocol as the display server protocol.

[0034] Figure 3 A flowchart of a display server protocol switching method 300 according to an embodiment of the present invention is shown. Method 300 is executed in a computing device (e.g., the aforementioned computing device 200) and is used to automatically determine whether the graphics card of the computing device 200 supports the Wayland protocol. Figure 3 As shown, method 300 begins with 310.

[0035] In 310, in response to operating system startup, it determines whether the current computer system complies with the requirements of the official Wayland protocol.

[0036] The official Wayland protocol refers to the Stable protocol within the Wayland protocol suite. The Stable protocol explicitly defines the programming language used for rendering, the underlying data transfer methods, and the display window binding plugins used to support the client. If a computer meets these three requirements of the Stable protocol, it is considered to comply with the Stable protocol.

[0037] EGL is an embedded system graphics library that serves as the interface between the OpenGL ES specification and the windowing system. EGL provides numerous interface functions that allow access to display devices, and it also manages rendering configurations. The Wayland protocol allows access to graphics card devices using EGL.

[0038] The latest version of the Stable protocol specifies the use of EGL for rendering and the EGL version number, the use of GPU shared cache (DMA-BUF) as the basic data transfer method, and the use of display window binding (EGL_WL_bind_Wayland_display) to support Wayland clients. For the above version of the Stable protocol, you can determine whether your computer meets the requirements of the Stable protocol in the following ways:

[0039] 1. Determine if the graphics card supports EGL and if the system's EGL version number meets the requirements. Specifically, the following code can be used to determine if the current computer system contains the EGL library:

[0040] static const char*NAMES[]={"libEGL.so.1","libEGL.so"};

[0041] handle=dlopen(NAMES,RTLD_LAZY|RTLD_LOCAL);

[0042] If handle is not empty, it means that the system has the EGL library. The following code will then be used to determine whether the version number of the EGL library in the system conforms to the requirements of the Stable protocol:

[0043] EGLint major, minor;

[0044] EGLDisplay eglDisplay=eglGetDisplay(EGL_DEFAULT_DISPLAY);

[0045] EGLBoolean eglInitialized=eglInitialize(eglDisplay,&major,&minor);

[0046] if(eglInitialized==EGL_TRUE){

[0047] Determine if the current version meets the constraints; if not, then...

[0048] }else{

[0049] printf("EGL initialization failed!");

[0050] }

[0051] For example, the constraint here could be that the version number is 3.0 or higher.

[0052] If EGL initialization is successful and the version meets the constraints, then the current computer system is considered to support EGL.

[0053] 2. If the current computer system supports EGL, use the following EGL library function to determine if the current computer system has the GPU shared cache plugin EGL_EXT_image_dma_buf_import:

[0054] eglQueryString(eglGetCurrentDisplay(),EGL_EXTENSIONS);

[0055] If EGL_EXT_image_dma_buf_import exists, it is assumed that the current computer system supports DMA-BUF.

[0056] 3. If the current computer supports EGL, use the following EGL library function to determine if the current computer system has a display window bound to EGL_WL_bind_Wayland_display:

[0057] eglQueryString(eglGetCurrentDisplay(),EGL_EXTENSIONS);

[0058] If EGL_WL_bind_Wayland_display exists, it means that the current computer system supports display window binding.

[0059] Based on the above judgment, it can be determined whether the current computer meets the requirements of the Stable protocol.

[0060] If the current computer meets the requirements of the Stable protocol, proceed to step 320. If the current computer does not meet the requirements of the Stable protocol, proceed to step 340.

[0061] Next, in step 320, we determine whether the computer has a hardware graphics processor.

[0062] GPU rendering types include software GPU rendering and hardware GPU rendering. Current mainstream Linux display driver architectures, such as Mesa, communicate with the graphics card's GPU and send rendering commands, with the hardware GPU handling the rendering. However, if the graphics card hardware does not support a GPU, a software GPU will be simulated by the CPU to complete the rendering process. Software GPU rendering is transparent to upper-layer applications, but it consumes significant CPU resources, and in most cases, it negatively impacts CPU performance.

[0063] In step 320, it is necessary to determine whether the current computer system environment has a hardware GPU. If a hardware GPU exists, then the current computer system can support the Wayland protocol, and the process will proceed to step 350; if no hardware GPU exists, the process will proceed to step 330.

[0064] The rendering type of a GPU (software GPU or hardware GPU) can be determined by its driver type. Currently, Linux system display drivers generally consist of an in-core driver and an out-of-core rendering driver. According to the definition in the Mesa architecture's driver model, the names of the in-core driver and the out-of-core rendering driver are in one-to-one correspondence. Therefore, in Mesa, the corresponding out-of-core rendering driver can be found by querying the name of the in-core driver. If a corresponding out-of-core rendering driver is found, it means that the current computer system environment has a hardware GPU; if no corresponding out-of-core rendering driver is found, it means that the current computer system environment does not have a hardware GPU, and software GPU rendering will be activated.

[0065] If your current computer system uses a software GPU, you will need to go to step 330.

[0066] In section 330, it's determined whether the computer's central processing unit (CPU) has sufficient data processing capabilities. If the computer doesn't have a hardware GPU but uses a software GPU, and the CPU's data processing power is also strong enough, then it can support the Wayland protocol.

[0067] In this application, the CPU's data processing capability is defined by its clock speed and the number of cores. The CPU's clock speed and the number of cores can be queried using the following command:

[0068] cat / proc / cpuinfo

[0069] Generally, a CPU with a clock speed of 3GHz and 4 cores is considered to have sufficient data processing capabilities to support the Wayland protocol, and we will proceed to step 350. If either the clock speed or the number of cores does not meet the requirements, it means that the CPU's data processing capabilities are insufficient, and we should proceed to step 340.

[0070] In 340, the X11 protocol is selected as the display server protocol.

[0071] In 350, the Wayland protocol is selected as the display server protocol.

[0072] Embodiments of the present invention also provide a display server protocol switching device 400, which is capable of performing the display server protocol switching method 300 as described above. Below, in conjunction with... Figure 4 The switching device 400 for the above-mentioned display server protocol is described.

[0073] like Figure 4 As shown, the server protocol switching device 400 includes a first judgment unit 410, a second judgment unit 420, a third judgment unit 430, a first selection unit 440, and a second selection unit 450.

[0074] The first judgment unit 410 is adapted to determine, in response to the operating system startup, whether the current computer system complies with the requirements of the official Wayland protocol.

[0075] The second determination unit 420 is adapted to determine whether the current computer system has a hardware graphics processor if the current computer system meets the requirements of the official protocol of the Wayland protocol.

[0076] The third judgment unit 430 is adapted to determine whether the data processing capability of the central processing unit of the current computer system meets the requirements if the current computer system does not have a hardware graphics processor.

[0077] The first selection unit 440 is adapted to select the X11 protocol as the display server protocol if the judgment result of the first judgment unit is that the current computer system does not meet the requirements of the official protocol of the Wayland protocol, or the judgment result of the third judgment unit is that the data processing capability of the central processing unit does not meet the requirements.

[0078] The second selection unit 450 is adapted to select the Wayland protocol as the display server protocol if the judgment result of the second judgment unit is that the current computer system has a hardware graphics processor, or the judgment result of the third judgment unit is that the data processing capability of the central processing unit meets the requirements.

[0079] According to one implementation of the present invention, the first judgment unit 410 includes: a first judgment subunit and a second judgment subunit.

[0080] The first judgment subunit is adapted to, in response to the operating system startup, determine whether the graphics card of the current computer system supports EGL, and whether the EGL version number of the current computer system meets the requirements.

[0081] The second judgment subunit is adapted to determine whether the graphics card simultaneously supports the graphics processor shared cache plugin and display window binding if the EGL version number meets the requirements. If the graphics card simultaneously supports the graphics processor shared cache plugin and display window binding, it means that the current computer system meets the requirements of the Stable protocol.

[0082] According to one implementation of the present invention, determining whether the graphics card of the current computer system supports EGL includes: determining whether the current computer system has an EGL library; if it does, it means that the graphics card supports EGL.

[0083] According to one implementation of the present invention, determining whether the graphics card simultaneously supports the graphics processor shared cache plugin and display window binding includes: querying whether the graphics card supports the graphics processor shared cache plugin and display window binding through EGL library functions.

[0084] According to one implementation of the present invention, the second determination unit includes: an in-core driver query unit and an out-of-core rendering driver query unit.

[0085] The kernel driver query unit is adapted to query the kernel driver name of the graphics processor if the current computer system conforms to the requirements of the official protocol of the Wayland protocol.

[0086] The off-core rendering driver query unit is adapted to search for the off-core rendering driver name of the graphics processor based on the on-core driver name. If the off-core rendering driver name is found, it indicates that the current computer system has a hardware graphics processor.

[0087] According to one implementation of the present invention, the third judgment unit includes a query unit and a main frequency core count judgment unit.

[0088] The query unit is adapted to query the clock speed and number of cores of the central processing unit if the current computer system does not have a hardware graphics processor.

[0089] The clock frequency and core count determination unit is adapted to determine the clock frequency and core count. If the clock frequency reaches 3GHz and the core count reaches 4, it indicates that the data processing capability of the central processing unit meets the requirements.

[0090] The various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing the present invention.

[0091] When the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store program code; the processor is configured to execute the switching method of the display server protocol of the present invention according to instructions in the program code stored in the memory.

[0092] By way of example, and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in the form of modulated data signals such as carrier waves or other transmission mechanisms, and includes any information delivery medium. Any combination of the above is also included within the scope of readable media.

[0093] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with the examples of this invention. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing preferred embodiments of the invention.

[0094] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0095] Similarly, it should be understood that, in order to simplify this disclosure and aid in understanding one or more aspects of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Those skilled in the art will understand that modules, units, or components of the devices in the examples disclosed herein can be arranged in the devices described in this embodiment, or alternatively, can be located in one or more devices different from the devices in this example. The modules in the foregoing examples can be combined into a single module or further divided into multiple sub-modules.

[0096] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0097] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments. Additionally, some of the embodiments described herein are described as methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the method or method elements forms means for implementing the method or method elements. Furthermore, the elements described herein in the device embodiments are examples of means for implementing the functions performed by elements for the purposes of carrying out the invention.

[0098] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.

[0099] Although the invention has been described with respect to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and edibility purposes, and not for the purpose of explaining or limiting the subject matter of the invention.

Claims

1. A method for switching display server protocols, comprising: In response to operating system startup, determine whether the current computer system complies with the requirements of the official Wayland protocol. If the current computer system does not meet the requirements of the official Wayland protocol, then the X11 protocol is selected as the display server protocol. If the current computer system meets the requirements of the official Wayland protocol, then determine whether the current computer system has a hardware graphics processor. If the current computer system has a hardware graphics processor, then the Wayland protocol is selected as the display server protocol; If the current computer system does not have a hardware graphics processor, then determine whether the data processing capability of the current computer system's central processing unit meets the requirements; as well as If the data processing capability of the central processing unit meets the requirements, then the Wayland protocol is selected as the display server protocol; Otherwise, select the X11 protocol as the display server protocol.

2. The method as described in claim 1, wherein, The determination of whether the current computer system complies with the official requirements of the Wayland Protocol includes: Determine whether the graphics card of the current computer system supports EGL, and whether the EGL version number of the current computer system meets the requirements; If the EGL version number meets the requirements, then determine whether the graphics card simultaneously supports the graphics processor shared cache plugin and display window binding; and If the graphics card supports both the graphics processor shared cache plugin and display window binding, it means that the current computer system complies with the requirements of the official Wayland protocol.

3. The method as described in claim 2, wherein, The step of determining whether the graphics card of the current computer system supports EGL includes: Determine whether the current computer system has the EGL library. If it does, it means that the graphics card supports EGL.

4. The method of claim 2, wherein, The step of determining whether the graphics card simultaneously supports the graphics processor shared cache plugin and display window binding includes: The EGL library functions are used to query whether the graphics card supports the graphics processor shared cache plugin and display window binding.

5. The method according to any one of claims 1 to 4, wherein, The step of determining whether the current computer system has a hardware graphics processor includes: Query the core driver name of the graphics processor; and The system searches for the external rendering driver name of the graphics processor based on the internal driver name. If the external rendering driver name is found, it indicates that the current computer system has a hardware graphics processor.

6. The method according to any one of claims 1 to 4, wherein, The step of determining whether the data processing capability of the central processing unit of the current computer system meets the requirements includes: Query the clock speed and number of cores of the central processing unit; and The clock speed and number of cores are judged. If the clock speed reaches 3GHz and the number of cores reaches 4, it means that the data processing capability of the central processing unit meets the requirements.

7. A display server protocol switching device, comprising: The first judgment unit is adapted to determine whether the current computer system complies with the requirements of the official Wayland protocol in response to the operating system startup. The second determination unit is adapted to determine whether the current computer system has a hardware graphics processor if the current computer system meets the requirements of the official Wayland protocol. The third judgment unit is adapted to determine whether the data processing capability of the central processing unit of the current computer system meets the requirements if the current computer system does not have a hardware graphics processor. The first selection unit is adapted to select the X11 protocol as the display server protocol if the judgment result of the first judgment unit is that the current computer system does not meet the requirements of the official protocol of the Wayland protocol, or the judgment result of the third judgment unit is that the data processing capability of the central processing unit does not meet the requirements. as well as The second selection unit is adapted to select the Wayland protocol as the display server protocol if the judgment result of the second judgment unit is that the current computer system has a hardware graphics processor, or the judgment result of the third judgment unit is that the data processing capability of the central processing unit meets the requirements.

8. The apparatus of claim 7, wherein, The first determination unit includes: The first judgment subunit is adapted to, in response to operating system startup, determine whether the graphics card of the current computer system supports EGL, and whether the EGL version number of the current computer system meets the requirements; and The second judgment subunit determines whether the graphics card supports both the graphics processor shared cache plugin and the display window binding if the EGL version number meets the requirements. If the graphics card supports both the graphics processor shared cache plugin and the display window binding, it means that the current computer system meets the requirements of the official Wayland protocol.

9. A computing device, comprising: At least one processor and a memory storing program instructions; When the program instructions are read and executed by the processor, the computing device performs the switching method of the display server protocol as described in any one of claims 1-6.

10. A readable storage medium storing program instructions, which, when read and executed by a computing device, cause the computing device to perform a switching method for a display server protocol as described in any one of claims 1-6.