CN112328198A - Control method and device for graphic processor, display method and device for graphic processor, storage medium and electronic device - Google Patents

Control method and device for graphic processor, display method and device for graphic processor, storage medium and electronic device Download PDF

Info

Publication number
CN112328198A
CN112328198A CN202011202049.7A CN202011202049A CN112328198A CN 112328198 A CN112328198 A CN 112328198A CN 202011202049 A CN202011202049 A CN 202011202049A CN 112328198 A CN112328198 A CN 112328198A
Authority
CN
China
Prior art keywords
function
graphics processor
display
image
processing unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011202049.7A
Other languages
Chinese (zh)
Other versions
CN112328198B (en
Inventor
刚煜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changsha Jingmei Integrated Circuit Design Co ltd
Changsha Jingjia Microelectronics Co ltd
Original Assignee
Changsha Jingmei Integrated Circuit Design Co ltd
Changsha Jingjia Microelectronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Changsha Jingmei Integrated Circuit Design Co ltd, Changsha Jingjia Microelectronics Co ltd filed Critical Changsha Jingmei Integrated Circuit Design Co ltd
Priority to CN202011202049.7A priority Critical patent/CN112328198B/en
Publication of CN112328198A publication Critical patent/CN112328198A/en
Application granted granted Critical
Publication of CN112328198B publication Critical patent/CN112328198B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Human Computer Interaction (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The embodiment of the application provides a control method, a display method, a device, a storage medium and an electronic device of a graphic processor, wherein the control method comprises the steps of powering on the graphic processor; the method comprises the steps that a central processing unit sets preset transaction conversion for PCI equipment in a graphics processor to obtain a target storage address of the PCI equipment in the graphics processor; under the condition that the UEFI system is operated, the central processing unit accesses a register of the graphics processor according to the target storage address; and the register of the graphics processor receives a control instruction of the central processing unit. By adopting the scheme in the application, the graphics processor receives the 2D graphics and the control instruction of the CPU at the UEFI stage of the PC, so that the compatibility of the display card equipment is improved.

Description

Control method and device for graphic processor, display method and device for graphic processor, storage medium and electronic device
Technical Field
The present application relates to a graphics card device technology, and in particular, to a method and an apparatus for controlling and displaying a graphics processor, a storage medium, and an electronic apparatus.
Background
After the PC is powered on and before the operating system is started, the display card driver of the desktop is not loaded at the moment, and at the moment, after the display function of the display is that a 2D (two-dimensional) graph is calculated by the CPU, the 2D graph is transmitted to the GPU (graphics processing unit) for displaying through VGA graph interrupt service.
However, the VGA graphics interrupt service is a common display method of the current BIOS, and the compatibility is poor, specifically:
1) because of the limitation of BIOS, the storage memory space of the driver code is limited, i.e. the driver is limited to 128KB, so the functions performed are also limited. Therefore, the services provided by the BIOS driver can only be used by an operating system boot program or an MS-DOS type operating system.
2) The driver code of the BIOS is read in an option rom mode of the PCI, and if the driver code is written into the display card firmware, the driver can be updated only by updating the firmware, so that the compatibility is poor and the dynamic loading cannot be realized.
Aiming at the problems of insufficient compatibility of a graphic driver and limited memory storage space in the related art, no effective solution exists at present.
Disclosure of Invention
The embodiment of the application provides a control method and a display method of a graphic processor, a device, a storage medium and an electronic device, so as to at least solve the problems of insufficient compatibility of a graphic driver and limited storage memory space in the related art.
According to a first aspect of embodiments of the present application, there is provided a method for controlling a graphics processor, including powering on the graphics processor; the method comprises the steps that a central processing unit sets preset transaction conversion for PCI equipment in a graphics processor to obtain a target storage address of the PCI equipment in the graphics processor; under the condition that the UEFI system is operated, the central processing unit accesses a register of the graphics processor according to the target storage address; and the register of the graphics processor receives a control instruction of the central processing unit.
Optionally, the method further comprises: the central processing unit sets an inbound transaction conversion of the PCIE according to a display requirement of the device, where the inbound transaction conversion at least includes one of the following: BAR space length, BAR space function.
Optionally, comprising: and under the condition that the UEFI system passes through the PCI device, allocating a corresponding BAR space address to the PCI device in the storage space of the graphics processor.
Optionally, after the graphics processor is powered on, the method further includes: initializing internal DDR and/or PEIC devices of the graphics processor.
According to a second aspect of the embodiments of the present application, there is provided a display method of a graphics processor, including: under the condition that the UEFI system operates, the central processing unit accesses a register of the graphics processor according to a target storage address; calling a first function in a driver program, and executing an operation instruction for setting a video output mode, wherein the first function comprises: a function for setting a display mode of the graphics card device; in the case that the UEFI system queries the image driver for a currently supported video output mode through a second function in the driver, selecting a video output mode of the image, the second function including: a function for querying a display mode of the display card device; the UEFI system transmits the drawn image to a graphics processor by calling a third function in a driver and displays the drawn image on the graphics processor, wherein the third function comprises: a function for outputting an image to a screen.
Optionally, the method further comprises: pre-registering a callable function for graphical display with a graphical output instance of the UEFI system, wherein the callable function includes at least one of: the function is used for setting the display mode of the display card equipment, inquiring the display mode of the display card equipment and outputting the image to the screen.
Optionally, before the calling the first function and executing the operation instruction for setting the video output mode, the method further includes: registering an initialization function with an image file of the UEFI system through a driver, wherein the initialization function at least comprises one of the following functions: detecting whether a device controller supports a first initialization function driven by a graphic processor; installing a graphics processor driver onto the device and starting a second initialization function of a hardware device of the graphics processor; stopping the hardware device of the graphics processor and uninstalling a third initialization function of the graphics processor.
Optionally, before the calling the first function and executing the operation instruction for setting the video output mode, the method further includes: the image output protocol software stack is started to validate the registered functions in the driver.
According to a third aspect of the embodiments of the present application, there is provided a control apparatus for a graphics processor, comprising: the power-on module is used for powering on the graphics processor; the conversion module is used for setting preset transaction conversion for the PCI equipment in the graphics processor by the central processing unit to obtain a target storage address of the PCI equipment in the graphics processor; the storage module is used for accessing the register of the graphics processor by the central processing unit according to the target storage address under the condition that the UEFI system is operated; and the receiving module is used for receiving the control instruction of the central processing unit by the register of the graphics processor.
According to a fourth aspect of the embodiments of the present application, there is provided a display device of a graphics processor, comprising: the storage module is used for accessing a register of the graphic processor by the central processing unit according to the target storage address under the condition that the UEFI system is operated; the calling module is used for calling a first function and executing an operation instruction for setting a video output mode, wherein the first function comprises: the display mode setting module is used for setting the display mode of the display card equipment; a query module, configured to select a video mode of an image when the UEFI system queries an image driver for a currently supported video output mode through a second function, where the second function includes: a function for querying a display mode of the display card device; an output module, configured to transmit the drawn image to a graphics processor and display the image on the graphics processor by invoking a third function by the UEFI system, where the third function includes: a function for outputting an image to a screen.
According to a fifth aspect of embodiments of the present application, there is provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
According to a sixth aspect of embodiments of the present application, there is provided an electronic apparatus, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps of any of the above method embodiments.
The control and display method of the graphics processor provided by the embodiment of the application is used as a new graphics driver and runs in the UEFI stage of the PC, so that the graphics processor receives the 2D graphics and the control instruction of the CPU, and the compatibility of the display card equipment is improved. The technical effect of displaying and controlling the display card at the UEFI stage is achieved through the method and the device.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic diagram of a hardware configuration block diagram of a computer device of a control method of a graphics processor in an embodiment of the present application;
FIG. 2 is a flowchart illustrating a control method of a graphics processor according to an embodiment of the present disclosure;
FIG. 3 is a diagram illustrating an exemplary control device of a graphics processor;
FIG. 4 is a flowchart illustrating a control method of a graphics processor according to an embodiment of the present disclosure;
FIG. 5 is a diagram illustrating an exemplary control device of a graphics processor;
FIG. 6 is a schematic diagram of a control flow of a GPU in the embodiment of the present application;
fig. 7 is a schematic diagram of a GPU display flow in the embodiment of the present application.
Detailed Description
In the process of implementing the present application, the inventor finds that, in the GPU display function in the BIOS phase, the code of the driver must be placed in a fixed memory area (RAM) of 0x000c0000 to 0x000DFFFF, and when the initialization part of the code is run, the VGA graphics interrupt service (10H) agreed in the mounted real mode needs to be loaded to implement the graphics transmission.
Due to the limitation of the BIOS, the storage memory space of the driver code is limited, the driver is limited to 128KB, and the function performed by the driver is limited. Therefore, the services provided by the BIOS driver can only be used by an operating system boot program or an MS-DOS type operating system. In addition, the drive code of the BIOS is read in an option rom manner of the PCI, and if the drive can be updated only by updating the firmware when the drive code is written into the graphics card firmware, the compatibility is poor, and the drive code cannot be dynamically loaded.
In view of the foregoing problems, an embodiment of the present application provides a method for controlling a graphics processor, including: powering on a graphics processor; the method comprises the steps that a central processing unit sets preset transaction conversion for PCI equipment in a graphics processor to obtain a target storage address of the PCI equipment in the graphics processor; under the condition that the UEFI system is operated, the central processing unit accesses a register of the graphics processor according to the target storage address; and the register of the graphics processor receives a control instruction of the central processing unit.
In order to make the technical solutions and advantages of the embodiments of the present application more apparent, the following further detailed description of the exemplary embodiments of the present application with reference to the accompanying drawings makes it clear that the described embodiments are only a part of the embodiments of the present application, and are not exhaustive of all embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Example one
The method provided by the first embodiment of the present application may be executed in a computer PC terminal or a similar computing device. Taking the example of the present invention running on a computer device, fig. 1 is a block diagram of a hardware structure of a computer device according to a control method of a graphics processor according to an embodiment of the present invention.
As shown in fig. 1, includes: the graphic processor 100 receives the graphic of the central processing unit 200 and the corresponding control instruction.
In this embodiment, a flowchart of a control method of a graphics processor is provided, and as shown in fig. 2, the flowchart includes the following steps:
step S201, powering on a graphics processor;
step S202, a central processing unit sets preset transaction conversion for PCI equipment in a graphics processor to obtain a target storage address of the PCI equipment in the graphics processor;
step S203, under the condition that the UEFI system is operated, the central processing unit accesses a register of the graphics processor according to the target storage address;
step S204, the register of the graphic processor receives the control instruction of the central processing unit.
The steps are used as a new implementation form of a graphic driver and run in a UEFI stage of a Personal Computer (PC), so that the graphic processor receives a 2D graphic and a control instruction of a Central Processing Unit (CPU), and the compatibility of the display card equipment is improved. The technical effect of displaying and controlling the display card at the UEFI stage is achieved through the method and the device.
In the step S201, the graphics processor needs to be powered on, and the personal computer PC supports the UEFI system.
In a preferred embodiment, after the graphics processor is powered on, the method further includes: initializing internal DDR and/or PEIC devices of the graphics processor.
In step S202, a preset transaction conversion is set for the PCI device in the graphics processor by the central processing unit, so as to obtain a target storage address of the PCI device in the graphics processor.
In a specific embodiment, the central processing unit sets an inbound transaction conversion of the PCIE according to a display requirement of the device, where the inbound transaction conversion at least includes one of the following: BAR space length, BAR space function.
In a preferred embodiment, the graphics processor will do the inbound transaction translation for PCI.
In the step S203, in the case that the UEFI system is operating, the central processing unit will usually access the register of the graphics processor according to the target storage address.
In one embodiment, in the case that the UEFI system passes through the PCI device, the PCI device is allocated a corresponding BAR space address in the memory space of the graphics processor.
In a preferred embodiment, the UEFI system allocates a Bar space address corresponding to the PCI device of the graphics processor in the memory space while traversing the PCI device.
In step S204, the register of the graphics processor receives a control instruction of the central processing unit.
In a preferred embodiment, the CPU may access the register of the GPU by accessing the memory space, so as to achieve the purpose of controlling the GPU. Namely, when the UEFI system runs, the CPU accesses the GPU register by accessing the memory space, and then performs corresponding action on the set register at the GPU.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example two
The method provided by the first embodiment of the present application may be executed in a computer PC terminal or a similar computing device. Taking the example of the present invention running on a computer device, fig. 1 is a block diagram of a hardware structure of a computer device according to a control method of a graphics processor according to an embodiment of the present invention.
As shown in fig. 1, includes: the graphic processor 100 receives the graphic of the central processing unit 200 and the corresponding control instruction.
In this embodiment, a flowchart of a control method of a graphics processor is provided, and as shown in fig. 3, the flowchart includes the following steps:
step S301, under the condition that the UEFI system is operated, the central processing unit accesses a register of the graphics processor according to a target storage address;
step S302, calling a first function in the driver, and executing an operation instruction for setting a video output mode, where the first function includes: a function for setting a display mode of the graphics card device;
step S303, when the UEFI system queries the currently supported video output mode from the image driver through a second function in the driver, selecting a video output mode of an image, where the second function includes: a function for querying a display mode of the display card device;
step S304, the UEFI system transmits the drawn image to the graphics processor by calling a third function in the driver and displays the image on the graphics processor, wherein the third function comprises: a function for outputting an image to a screen.
The implementation flow of the control method of the graphics processor is also included as the graphics driver.
In the step S302, an operation instruction for setting a video output mode is first executed by calling a first function in the driver. For example, calling the registered SetMode function performs the actual operation of setting the video output mode.
In one embodiment, the first function comprises: a function for setting a display mode of the graphics card device.
In a preferred embodiment, in a start initialization function of a device, a function related to graphic display of SetMode is registered with a graphic output instance of the UEFI system. The SetMode can be used for setting the display mode of the graphics card device.
In a preferred embodiment, before executing the operation instruction for setting the video output mode by calling the first function, the method further includes: registering an initialization function with an image file of the UEFI system through a driver, wherein the initialization function at least comprises one of the following functions: detecting whether a device controller supports a first initialization function driven by a graphic processor; installing a graphics processor driver onto the device and starting a second initialization function of a hardware device of the graphics processor; stopping the hardware device of the graphics processor and uninstalling a third initialization function of the graphics processor.
In another preferred embodiment, the method of displaying further comprises: pre-registering a callable function for graphical display with a graphical output instance of the UEFI system, wherein the callable function includes at least one of: the function is used for setting the display mode of the display card equipment, inquiring the display mode of the display card equipment and outputting the image to the screen.
In another preferred embodiment, before the calling the first function and executing the operation instruction for setting the video output mode, the method further includes: the image output protocol software stack is started to validate the registered functions in the driver. Namely, the image output protocol software stack is started to enable the registered function to take effect.
In step S303, in the case that the UEFI system queries the image driver for the currently supported video output mode through the second function in the driver, a video output mode of an image is selected.
In one embodiment, the UEFI system queries the image drive for the currently supported video output mode, and the UEFI system selects and sets a video mode to be active based on the results of the query.
In one specific implementation, in a start initialization function of a device, a function related to graphical display of QueryMode is registered with a graphical output instance of the UEFI system. The QueryMode is a function for inquiring the display mode of the display card device.
In the step S304, the UEFI system transmits the rendered image to the graphics processor by calling a third function in the driver and displays the rendered image on the graphics processor.
In one embodiment, the UEFI system transmits the rendered 2D image to the graphics processor and is displayed at the graphics processor.
In a preferred embodiment, the graphical display related function of Blt is registered with the graphical output instance of the UEFI system in a start initialization function of the device. The Blt is a function for outputting an image to a screen.
Through the use of the graphic processor driver, the central processing unit can complete the control and display of the graphic processor under the similar operating system before the operating system is not started, and compared with the display mode of VGA BIOS in the related art, the graphic processor driver has good compatibility.
EXAMPLE III
In this embodiment, a device is further provided, and the device is used to implement the above embodiments and preferred embodiments, which have already been described and are not described again. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram of a control apparatus of a graphic processor according to an embodiment of the present invention, as shown in fig. 4, the apparatus including:
a power-on module 40 for powering on the graphics processor;
a conversion module 41, configured to set, by a central processing unit, a preset transaction conversion for a PCI device in a graphics processor, so as to obtain a target storage address of the PCI device in the graphics processor;
the storage module 42 is configured to, when the UEFI system is running, access, by the central processing unit, a register of the graphics processing unit according to the target storage address;
a receiving module 43, configured to receive a control instruction of the central processing unit from a register of the graphics processor.
The graphics processor driver supports more function extensions, such as accessing various registers and peripherals of the graphics processor, e.g., PWM, UART, IIC, etc., relative to the VGA BIOS of the related art, thereby providing a richer function and service to the BIOS.
The graphics processor in the power-on module 40 needs to be powered on, and the personal computer PC supports the UEFI system.
In a preferred embodiment, after the graphics processor is powered on, the method further includes: initializing internal DDR and/or PEIC devices of the graphics processor.
In the conversion module 41, preset transaction conversion is set for the PCI device in the graphics processor through the central processing unit, so as to obtain a target storage address of the PCI device in the graphics processor.
In a specific embodiment, the central processing unit sets an inbound transaction conversion of the PCIE according to a display requirement of the device, where the inbound transaction conversion at least includes one of the following: BAR space length, BAR space function.
In a preferred embodiment, the graphics processor will do the inbound transaction translation for PCI.
In the case of the UEFI system operating in the memory module 42, the central processing unit will typically access the registers of the graphics processor according to the target memory address.
In one embodiment, in the case that the UEFI system passes through the PCI device, the PCI device is allocated a corresponding BAR space address in the memory space of the graphics processor.
In a preferred embodiment, the UEFI system allocates a Bar space address corresponding to the PCI device of the graphics processor in the memory space while traversing the PCI device.
The registers of the graphics processor in the receiving module 43 receive the control instructions of the central processing unit.
In a preferred embodiment, the CPU may access the register of the GPU by accessing the memory space, so as to achieve the purpose of controlling the GPU. Namely: when the UEFI system runs, the CPU accesses the GPU register by accessing the memory space, and then corresponding action is carried out on the GPU according to the set register.
Example four
In this embodiment, a display device of a graphics processor is also provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and the description of which has been already made is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram of a display device of a graphic processor according to an embodiment of the present invention, as shown in fig. 5, the device including:
the storage module 42 is used for the central processing unit to access the register of the graphics processing unit according to the target storage address under the condition that the UEFI system is operated;
a calling module 50, configured to call a first function and execute an operation instruction for setting a video output mode, where the first function includes: the display mode setting module is used for setting the display mode of the display card equipment;
a query module 51, configured to select a video mode of an image when the UEFI system queries an image driver for a currently supported video output mode through a second function, where the second function includes: a function for querying a display mode of the display card device;
an output module 52, configured to transmit the drawn image to a graphics processor and display the drawn image on the graphics processor by invoking a third function by the UEFI system, where the third function includes: a function for outputting an image to a screen.
The calling module 50 first executes an operation instruction for setting a video output mode by calling a first function in the driver. For example, calling the registered SetMode function performs the actual operation of setting the video output mode.
In one embodiment, the first function comprises: a function for setting a display mode of the graphics card device.
In a preferred embodiment, in a start initialization function of a device, a function related to graphic display of SetMode is registered with a graphic output instance of the UEFI system. The SetMode can be used for setting the display mode of the graphics card device.
In a preferred embodiment, before executing the operation instruction for setting the video output mode by calling the first function, the method further includes: registering an initialization function with an image file of the UEFI system through a driver, wherein the initialization function at least comprises one of the following functions: detecting whether a device controller supports a first initialization function driven by a graphic processor; installing a graphics processor driver onto the device and starting a second initialization function of a hardware device of the graphics processor; stopping the hardware device of the graphics processor and uninstalling a third initialization function of the graphics processor.
In another preferred embodiment, the method of displaying further comprises: pre-registering a callable function for graphical display with a graphical output instance of the UEFI system, wherein the callable function includes at least one of: the function is used for setting the display mode of the display card equipment, inquiring the display mode of the display card equipment and outputting the image to the screen.
In another preferred embodiment, before the calling the first function and executing the operation instruction for setting the video output mode, the method further includes: the image output protocol software stack is started to validate the registered functions in the driver. Namely, the image output protocol software stack is started to enable the registered function to take effect.
The query module 51 then selects a video output mode for the image if the UEFI system queries the image driver for the currently supported video output mode through a second function in the driver.
In one embodiment, the UEFI system queries the image drive for the currently supported video output mode, and the UEFI system selects and sets a video mode to be active based on the results of the query.
In one specific implementation, in a start initialization function of a device, a function related to graphical display of QueryMode is registered with a graphical output instance of the UEFI system. The QueryMode is a function for inquiring the display mode of the display card device.
The UEFI system in the output module 52 transfers the rendered image to the graphics processor by calling a third function in the driver and displays the rendered image on the graphics processor.
In one embodiment, the UEFI system transmits the rendered 2D image to the graphics processor and is displayed at the graphics processor.
In a preferred embodiment, the graphical display related function of Blt is registered with the graphical output instance of the UEFI system in a start initialization function of the device. The Blt is a function for outputting an image to a screen.
In order to better understand the control and display processing flow of the graphics processor, the following explains the technical solutions with reference to the preferred embodiments, but the technical solutions of the embodiments of the present invention are not limited thereto.
By the method, the display and control of the domestic display card at the UEFI stage are realized, and particularly,
1) through the use of the graphic processor driver, the CPU can complete the control and display of the GPU processor under the similar operating system before the operating system is not started, has good compatibility compared with the display mode of the VGA BIOS, and can run under various CPU architectures, namely aarch64, mips64le and x64 at present.
2) The driver supports more function expansion compared with the traditional VGA BIOS, and mainly comprises the following steps: accessing various registers and peripherals of the GPU, such as PWM, UART, IIC, etc., may provide the BIOS with richer functionality and services.
The application realizes a GPU control and display mechanism at a UEFI stage, and particularly, a driver is written to register an initialization function to a mapping file handle of the UEFI through a GOP (group of picture) in a UFEI specification, wherein the core is as follows: support, start, stop:
wherein the content of the first and second substances,
and the Support is used for detecting whether the equipment controller supports GPU drive, and if the equipment controller supports GPU drive, the drive returns success to the CPU.
The Start is used to install a driver onto the device and Start the GPU hardware device.
The Stop is used to Stop the GPU hardware device and offload GPU drivers.
For the control implementation of the display device, when the UEFI system traverses the PCI devices, the corresponding Bar space address is allocated to the PCI devices of the GPU in the storage space, before that, the GPU performs PCI inbound transaction conversion, and the CPU can access the register of the GPU by accessing the storage space, so that the purpose of controlling the GPU is achieved.
For the display implementation of the display device: in the start initialization function of the device, three graphics display related functions of QueryMode, SetMode and Blt are registered with a graphics output instance of the UEFI system.
Wherein the content of the first and second substances,
the QueryMode: the method is used for inquiring the display mode of the display card equipment.
The SetMode: the display mode setting method is used for setting the display mode of the display card device.
The Blt is block transmission for the system to output the image to the screen.
Fig. 6 is a schematic diagram of a GPU control flow in the embodiment of the present application.
Step 1, the GPU is powered on, and devices such as DDR, PCIE and the like in the GPU are initialized.
The method comprises the following steps that after the graphics processor is powered on, the method further comprises the following steps: initializing internal DDR and/or PEIC devices of the graphics processor.
And step 2, the CPU sets the inbound transaction conversion of the PCIE according to the actual display requirement.
The central processing unit sets an inbound transaction conversion of the PCIE according to a display requirement of the device, where the inbound transaction conversion at least includes one of the following: BAR space length, BAR space function.
And under the condition that the UEFI system passes through the PCI device, allocating a corresponding BAR space address to the PCI device in the storage space of the graphics processor.
And 3, when the UEFI system runs, the CPU accesses the GPU register by accessing the memory space.
Under the condition that the UEFI system is operated, the central processing unit accesses a register of the graphics processor according to the target storage address;
and 4, the GPU performs corresponding actions according to the set register.
And the register of the graphics processor receives a control instruction of the central processing unit.
Fig. 7 is a schematic diagram of a GPU display flow in the embodiment of the present application.
Step 1, applying for a memory space required by the context of an image output protocol, and preparing for later calculation.
And 2, acquiring the path of the parent equipment and setting the path of the image output protocol equipment.
And 3, creating and setting a default video mode.
And 4, registering the functions of QueryMode, SetMode and Blt to the image instance for other drivers or UEFI main programs to call.
Pre-registering a callable function for graphical display with a graphical output instance of the UEFI system, wherein the callable function includes at least one of: the function is used for setting the display mode of the display card equipment, inquiring the display mode of the display card equipment and outputting the image to the screen.
And step 5, calling the SetMode function registered in the step 4 to execute actual operation of setting a video output mode according to the default video mode set in the step 3.
By calling the above function, before executing an operation instruction for setting a video output mode, the method further includes: registering an initialization function with an image file of the UEFI system through a driver, wherein the initialization function at least comprises one of the following functions: detecting whether a device controller supports a first initialization function driven by a graphic processor; installing a graphics processor driver onto the device and starting a second initialization function of a hardware device of the graphics processor; stopping the hardware device of the graphics processor and uninstalling a third initialization function of the graphics processor. The first function includes: a function for setting a display mode of the graphics card device; the second function includes: a function for querying a display mode of the display card device; the third function includes: a function for outputting an image to a screen.
And 6, starting an image output protocol software stack to enable the registered function to take effect.
The method for setting the video output mode comprises the following steps of calling a first function, and before executing an operation instruction for setting the video output mode: the image output protocol software stack is started to validate the registered functions in the driver.
And 7, inquiring a video output mode supported by the GPU by the CPU.
The UEFI system queries the image drive for the video output mode currently supported.
And step 8, the CPU sets a video output mode.
The UEFI system selects and sets a video mode to be effective based on the result of the query in step 7.
And 9, transmitting the drawn 2D image to the GPU.
And step 10, displaying the image by the GPU.
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, powering on the shape processor;
s2, the central processing unit sets a preset transaction conversion for the PCI equipment in the graphics processor to obtain the target storage address of the PCI equipment in the graphics processor;
s3, under the condition that the UEFI system is running, the central processing unit accesses a register of the graphics processor according to the target storage address;
and S4, the register of the graphics processor receives the control instruction of the central processing unit.
And/or the presence of a gas in the gas,
s1, under the condition that the UEFI system is running, the central processing unit accesses a register of the graphics processor according to the target storage address;
s2, calling a first function in the driver, and executing an operation instruction for setting a video output mode, wherein the first function includes: a function for setting a display mode of the graphics card device;
s3, in case that the UEFI system inquires about a currently supported video output mode to the image driver through a second function in the driver, selecting a video output mode of the image, where the second function includes: a function for querying a display mode of the display card device;
s4, the UEFI system transmits the drawn image to the graphics processor by calling a third function in the driver and displays the drawn image on the graphics processor, wherein the third function comprises: a function for outputting an image to a screen.
Optionally, the storage medium is further arranged to store a computer program for performing the steps of:
s31, the central processing unit sets an inbound transaction conversion of the PCIE according to a display requirement of the device, where the inbound transaction conversion at least includes one of the following: BAR space length, BAR space function.
Optionally, the storage medium is further arranged to store a computer program for performing the steps of:
and S32, under the condition that the UEFI system passes through the PCI equipment, allocating a corresponding BAR space address to the storage space of the graphics processor of the PCI equipment.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, powering on the shape processor;
s2, the central processing unit sets a preset transaction conversion for the PCI equipment in the graphics processor to obtain the target storage address of the PCI equipment in the graphics processor;
s3, under the condition that the UEFI system is running, the central processing unit accesses a register of the graphics processor according to the target storage address;
and S4, the register of the graphics processor receives the control instruction of the central processing unit.
And/or the presence of a gas in the gas,
s1, under the condition that the UEFI system is running, the central processing unit accesses a register of the graphics processor according to the target storage address;
s2, calling a first function in the driver, and executing an operation instruction for setting a video output mode, wherein the first function includes: a function for setting a display mode of the graphics card device;
s3, in case that the UEFI system inquires about a currently supported video output mode to the image driver through a second function in the driver, selecting a video output mode of the image, where the second function includes: a function for querying a display mode of the display card device;
s4, the UEFI system transmits the drawn image to the graphics processor by calling a third function in the driver and displays the drawn image on the graphics processor, wherein the third function comprises: a function for outputting an image to a screen.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (12)

1. A method for controlling a graphics processor, comprising:
powering on a graphics processor;
the method comprises the steps that a central processing unit sets preset transaction conversion for PCI equipment in a graphics processor to obtain a target storage address of the PCI equipment in the graphics processor;
under the condition that the UEFI system is operated, the central processing unit accesses a register of the graphics processor according to the target storage address;
and the register of the graphics processor receives a control instruction of the central processing unit.
2. The method of claim 1, further comprising:
the central processing unit sets an inbound transaction conversion of the PCIE according to a display requirement of the device, where the inbound transaction conversion at least includes one of the following: BAR space length, BAR space function.
3. The method of claim 2, wherein the setting, by the central processing unit, a predetermined transaction conversion for the PCI device in the graphics processor to obtain the target memory address of the PCI device in the graphics processor comprises:
and under the condition that the UEFI system passes through the PCI device, allocating a corresponding BAR space address to the PCI device in the storage space of the graphics processor.
4. The method of claim 1, wherein after the graphics processor is powered up, further comprising: initializing internal DDR and/or PEIC devices of the graphics processor.
5. A display method for a graphics processor, comprising:
under the condition that the UEFI system operates, the central processing unit accesses a register of the graphics processor according to a target storage address;
calling a first function in a driver program, and executing an operation instruction for setting a video output mode, wherein the first function comprises: a function for setting a display mode of the graphics card device;
in the case that the UEFI system queries the image driver for a currently supported video output mode through a second function in the driver, selecting a video output mode of the image, the second function including: a function for querying a display mode of the display card device;
the UEFI system transmits the drawn image to a graphics processor by calling a third function in a driver and displays the drawn image on the graphics processor, wherein the third function comprises: a function for outputting an image to a screen.
6. The method of claim 5, further comprising:
pre-registering a callable function for graphical display with a graphical output instance of the UEFI system, wherein the callable function includes at least one of: the function is used for setting the display mode of the display card equipment, inquiring the display mode of the display card equipment and outputting the image to the screen.
7. The method of claim 6, wherein invoking the first function further comprises, prior to executing the operation instruction to set the video output mode:
registering an initialization function with an image file of the UEFI system through a driver, wherein the initialization function at least comprises one of the following functions:
detecting whether a device controller supports a first initialization function driven by a graphic processor;
installing a graphics processor driver onto the device and starting a second initialization function of a hardware device of the graphics processor;
stopping the hardware device of the graphics processor and uninstalling a third initialization function of the graphics processor.
8. The method of claim 5, wherein invoking the first function further comprises, prior to executing the operation instruction to set the video output mode:
the image output protocol software stack is started to validate the registered functions in the driver.
9. A control apparatus of a graphic processor, comprising:
the power-on module is used for powering on the graphics processor;
the conversion module is used for setting preset transaction conversion for the PCI equipment in the graphics processor by the central processing unit to obtain a target storage address of the PCI equipment in the graphics processor;
the storage module is used for accessing the register of the graphics processor by the central processing unit according to the target storage address under the condition that the UEFI system is operated;
and the receiving module is used for receiving the control instruction of the central processing unit by the register of the graphics processor.
10. A display device for a graphics processor, comprising:
the storage module is used for accessing a register of the graphic processor by the central processing unit according to the target storage address under the condition that the UEFI system is operated;
the calling module is used for calling a first function and executing an operation instruction for setting a video output mode, wherein the first function comprises: the display mode setting module is used for setting the display mode of the display card equipment;
a query module, configured to select a video mode of an image when the UEFI system queries an image driver for a currently supported video output mode through a second function, where the second function includes: a function for querying a display mode of the display card device;
an output module, configured to transmit the drawn image to a graphics processor and display the image on the graphics processor by invoking a third function by the UEFI system, where the third function includes: a function for outputting an image to a screen.
11. A storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the method of any of claims 1 to 4, and/or the method of any of claims 5 to 8 when executed.
12. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 4, and/or the method of any of claims 5 to 8.
CN202011202049.7A 2020-11-02 2020-11-02 Control method and device for graphic processor, display method and device for graphic processor, storage medium and electronic device Active CN112328198B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011202049.7A CN112328198B (en) 2020-11-02 2020-11-02 Control method and device for graphic processor, display method and device for graphic processor, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011202049.7A CN112328198B (en) 2020-11-02 2020-11-02 Control method and device for graphic processor, display method and device for graphic processor, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN112328198A true CN112328198A (en) 2021-02-05
CN112328198B CN112328198B (en) 2022-08-26

Family

ID=74323998

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011202049.7A Active CN112328198B (en) 2020-11-02 2020-11-02 Control method and device for graphic processor, display method and device for graphic processor, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112328198B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117971584A (en) * 2024-03-29 2024-05-03 苏州元脑智能科技有限公司 Method and device for testing graphics processor, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160314758A1 (en) * 2015-04-27 2016-10-27 Dell Products, Lp UEFI Virtual Video Controller
US20170255567A1 (en) * 2016-03-02 2017-09-07 Sumanth Vidyadhara Systems And Methods For Secure Multi-Access Of System Firmware During Pre-Boot
CN109656630A (en) * 2018-12-27 2019-04-19 龙芯中科技术有限公司 Access method, device, framework and the storage medium of configuration space
CN109936716A (en) * 2019-03-25 2019-06-25 龙芯中科技术有限公司 A kind of realization method and system of display driving
CN110415161A (en) * 2019-07-19 2019-11-05 龙芯中科技术有限公司 Graphic processing method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160314758A1 (en) * 2015-04-27 2016-10-27 Dell Products, Lp UEFI Virtual Video Controller
US20170255567A1 (en) * 2016-03-02 2017-09-07 Sumanth Vidyadhara Systems And Methods For Secure Multi-Access Of System Firmware During Pre-Boot
CN109656630A (en) * 2018-12-27 2019-04-19 龙芯中科技术有限公司 Access method, device, framework and the storage medium of configuration space
CN109936716A (en) * 2019-03-25 2019-06-25 龙芯中科技术有限公司 A kind of realization method and system of display driving
CN110415161A (en) * 2019-07-19 2019-11-05 龙芯中科技术有限公司 Graphic processing method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WEIXIN_472238387: "UEFI基础知识", 《CSDN》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117971584A (en) * 2024-03-29 2024-05-03 苏州元脑智能科技有限公司 Method and device for testing graphics processor, electronic equipment and storage medium
CN117971584B (en) * 2024-03-29 2024-06-07 苏州元脑智能科技有限公司 Method and device for testing graphics processor, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112328198B (en) 2022-08-26

Similar Documents

Publication Publication Date Title
KR101050582B1 (en) Dynamic content display devices, methods, computer readable storage media and systems
US8362971B1 (en) Independent views generated for multiple display devices by a software application
RU2662402C2 (en) Method of processing data for several operating systems and terminal equipment
US20170004808A1 (en) Method and system for capturing a frame buffer of a virtual machine in a gpu pass-through environment
CN111314799A (en) Terminal system architecture, communication system, communication method, and storage medium
US9201660B2 (en) Method and mobile terminal for controlling display of waiting information during program startup
CN111488196A (en) Rendering method and device, storage medium and processor
CN110557624A (en) Data transmission method and device and server
KR20100037012A (en) Methods and systems to display platform graphics during operating system initialization
US7944421B2 (en) Image display system, image display method, image display device, image data processor, program, storage medium, and image processing program distribution server
US8502827B1 (en) System, method, and computer program product for outputting content during a boot-up period
JP2007264079A (en) Communication between image supply device and image display device
KR20150080567A (en) Multi-platform mobile and other computing devices and methods
WO2014089793A1 (en) Method, device, and system for video redirection and computer readable medium
CN107911700B (en) Virtualization-based hardware decoding method, decoding equipment and storage medium
US11750749B1 (en) Method to use native scanning properties dialog to scan in scanner redirection
CN112328198B (en) Control method and device for graphic processor, display method and device for graphic processor, storage medium and electronic device
CN102446341A (en) Server and image processing method thereof
CN113419845A (en) Calculation acceleration method and device, calculation system, electronic equipment and computer readable storage medium
US20110066836A1 (en) Operating system booting method, computer, and computer program product
CN110545415A (en) Data transmission method and device and server
CN112015476A (en) Display card driving method and device, electronic equipment and storage medium
CN114003225A (en) Window display method and device, computer equipment and storage medium
CN112468574B (en) Processing method, device and system for application service publishing and subscribing mechanism
US20150227383A1 (en) Application program virtualization system and method of virtualizing application program of user terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant