Search

CN-116339667-B - Display server protocol switching method and device and computing equipment

CN116339667BCN 116339667 BCN116339667 BCN 116339667BCN-116339667-B

Abstract

The invention discloses a method, a device and a computing device for switching a display server protocol, relates to the technical field of display card rendering driving, and aims to solve the problem that a user needs to manually select an X11 protocol or Wayland protocol before a Linux system enters a GUI desktop. The method includes the steps of responding to starting of an operating system, judging whether a current computer system meets requirements of a Stable protocol, selecting an X11 protocol if the current computer system does not meet the requirements, otherwise judging whether a hardware graphic processor exists in the current computer system, selecting Wayland protocol if the current computer system exists, otherwise continuing judging whether data processing capacity of a central processor of the current computer system meets the requirements, selecting Wayland protocol if the data processing capacity of the central processor meets the requirements, and otherwise selecting the X11 protocol as a 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.

Inventors

  • ZHANG HAIDONG

Assignees

  • 统信软件技术有限公司

Dates

Publication Date
20260512
Application Date
20230328

Claims (10)

  1. 1. A method for switching display server protocols, comprising: responding to the starting of an operating system, judging whether the current computer system meets the requirements of an official protocol of Wayland protocols; If the current computer system does not meet the requirement of the official protocol of the Wayland protocol, selecting the X11 protocol as a display server protocol; if the current computer system meets the requirement of the official protocol of the Wayland protocol, judging whether a hardware graphic processor exists in the current computer system or not; If the hardware graphic processor exists in the current computer system, selecting Wayland protocol as display server protocol; if the current computer system does not have a hardware graphic processor, judging whether the data processing capacity of the central processing unit of the current computer system meets the requirement or not, and If the data processing capacity of the CPU meets the requirement, the Wayland protocol is selected as a display server protocol, otherwise, the X11 protocol is selected as the display server protocol.
  2. 2. The method of claim 1, wherein said determining whether the current computer system meets an official protocol requirement of Wayland's protocol comprises: judging whether the display card of the current computer system supports EGL or not and whether the EGL version number of the current computer system meets the requirement or not; if the EGL version number meets the requirement, judging whether the display card supports the binding of the shared cache plug-in of the graphic processor and the display window at the same time, and And if the display card supports the binding of the shared cache plug-in of the graphic processor and the display window, the current computer system is indicated to meet the requirement of the official protocol of the Wayland protocol.
  3. 3. The method of claim 2, wherein the determining whether the graphics card of the current computer system supports EGL comprises: Judging whether the current computer system has an EGL library, and if so, indicating that the display card supports EGL.
  4. 4. The method of claim 2, wherein the determining whether the graphics card supports graphics processor shared cache plugin and display window binding simultaneously comprises: and inquiring whether the display card supports the shared cache plug-in of the graphic processor and the binding of the display window through the library function of the EGL.
  5. 5. The method of any of claims 1-4, wherein the determining whether a hardware graphics processor is present for the current computer system comprises: Querying a graphics processor's in-core driver name, and And searching the out-of-core rendering drive name of the graphic processor according to the in-core drive name, and if the out-of-core rendering drive name is found, indicating that the hardware graphic processor exists in the current computer system.
  6. 6. The method of any of claims 1-4, wherein the determining whether the data processing capability of the central processor of the current computer system meets a requirement comprises: querying the main frequency and the core number of the CPU and And judging the main frequency and the core number, and if the main frequency reaches 3GHz and the core number reaches 4, indicating that the data processing capacity of the central processing unit meets the requirement.
  7. 7. A switching device for displaying a server protocol, comprising: The first judging unit is suitable for responding to the starting of the operating system and judging whether the current computer system meets the requirement of the official protocol of Wayland protocol; the second judging unit is suitable for judging whether the current computer system has a hardware graphic processor or not if the current computer system meets the requirement of an official protocol of Wayland protocols; A third judging unit, adapted to judge whether the data processing capability of the central processor of the current computer system meets the requirement if the current computer system does not have a hardware graphic processor; a first selecting unit adapted to select the X11 protocol as a display server protocol if the judging result of the first judging unit is that the current computer system does not meet the requirement of the official protocol of Wayland protocol or the judging result of the third judging unit is that the data processing capability of the CPU does not meet the requirement, and And the second selection unit is suitable for selecting Wayland protocols as display server protocols if the judging result of the second judging unit is that the hardware graphic processor exists in the current computer system or the judging result of the third judging unit is that the data processing capacity of the central processing unit meets the requirement.
  8. 8. The apparatus of claim 7, wherein the first judging unit comprises: A first judging subunit adapted to respond to the start of the operating system and judge whether the display card of the current computer system supports EGL and whether the EGL version number of the current computer system meets the requirement, and And the second judging subunit is used for judging whether the display card supports the shared cache plug-in of the graphic processor and the display window binding at the same time if the EGL version number meets the requirement, and indicating that the current computer system meets the requirement of the official protocol of Wayland protocol if the display card supports the shared cache plug-in of the graphic processor and the display window binding at the same time.
  9. 9. A computing device, comprising: At least one processor and a memory storing program instructions; the program instructions, when read and executed by the processor, cause the computing device to perform the display server protocol switching method of any one of claims 1-6.
  10. 10. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the display server protocol switching method of any one of claims 1-6.

Description

Display server protocol switching method and device and computing equipment Technical Field The invention relates to the technical field of rendering driving of display cards, in particular to a method and a device for switching display server protocols and computing equipment. Background X11, also known as the X Window System, is used primarily in Unix systems and Unix-like systems, is a standard toolkit and protocol for building graphical user interfaces, and is very widely used in modern operating systems. Wayland, also known as Wayland window system, is a new standard toolkit and protocol for building graphical user interfaces, with the goal of replacing not only the X window system entirely, but also the X11 protocol client with a Wayland protocol client. At present Wayland protocol is started by each Linux release due to the characteristics of advanced structure, high performance and the like, and is started by an operating system as a default protocol mode. However, in practice, the hardware supporting environment of Wayland is not perfect, and the supporting area is good for some graphics cards, but not for some graphics cards, especially domestic graphics cards. Therefore, at the operating system level, there is a problem of how to detect whether the current hardware environment can perfectly support Wayland protocols. In the linux system, a measa (a rendering library under linux, which can support an AMD graphics card and an Intel graphics card and also support CPU simulation) is generally used to load a rendering driver of the graphics card. Therefore, the conventional method of discriminating whether the operating system supports Wayland protocols is to check whether the system uses a soft graphics processor (Graphics Processing Unit, GPU), and if a soft GPU is used, the Wayland protocol cannot be used, but the X11 protocol is used. The method has the following problems that 1, no method is adopted for detecting hardware which does not use the measa as a rendering mode, such as driving of an Nvidia display card, or using mali (ARM architecture, a rendering library used in an integrated display card environment) as a rendering mode is an ARM platform, 2, a command glxinfo used for inquiring GPU hardware information actually belongs to the technology of X11, and if the driving configuration of the current X11 environment is wrong, a correct inquiring result cannot be obtained. Since the above method is still not mature enough, many linux release boards still adopt a mode of manually selecting a protocol by a user, as shown in fig. 1, after the operating system starts, before entering the GUI desktop, the system prompts the user to select a protocol from Ubuntu and Ubuntu on Xorg, where Ubuntu corresponds to Wayland and Ubuntu on Xorg is an implementation of X11. Most users are not aware of the distinction between X11 and Wayland and so it is difficult to make a reasonable choice. In summary, the above-mentioned conventional protocol selection method has a problem that it is difficult to make a reasonable selection due to lack of expertise of the user. Disclosure of Invention To this end, the present invention provides a method, apparatus and computing device for switching display server protocols in an effort to solve or at least alleviate at least one of the problems presented above. According to one aspect of the invention, a method for switching display server protocols is provided, which comprises the steps of responding to starting of an operating system, judging whether a current computer system meets the requirements of an official protocol of Wayland protocols, selecting an X11 protocol as a display server protocol if the current computer system does not meet the requirements of the official protocol of Wayland protocols, judging whether a hardware graphic processor exists in the current computer system if the current computer system meets the requirements of the official protocol of Wayland protocols, selecting Wayland protocols as the display server protocol if the hardware graphic processor exists in the current computer system, judging whether the data processing capacity of a central processor of the current computer system meets the requirements if the hardware graphic processor does not exist in the current computer system, and selecting Wayland protocols as the display server protocol if the data processing capacity of the central processor meets the requirements, otherwise, selecting the X11 protocol as the display server protocol. Optionally, in the display server protocol switching method according to the present invention, the determining whether the current computer system meets the requirements of the official protocol of Wayland protocol includes determining whether a display card of the current computer system supports EGL and whether an EGL version number of the current computer system meets the requirements, if the EGL version number meets the requirements, determining wh