CN111796939A - Processing method and device and electronic equipment - Google Patents
Processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN111796939A CN111796939A CN202010623298.7A CN202010623298A CN111796939A CN 111796939 A CN111796939 A CN 111796939A CN 202010623298 A CN202010623298 A CN 202010623298A CN 111796939 A CN111796939 A CN 111796939A
- Authority
- CN
- China
- Prior art keywords
- graphics processor
- mode
- system resource
- resource
- processor
- 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
Links
- 238000003672 processing method Methods 0.000 title abstract description 11
- 238000000034 method Methods 0.000 claims description 44
- 230000015654 memory Effects 0.000 claims description 34
- 238000004590 computer program Methods 0.000 claims description 23
- 230000001960 triggered effect Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000001360 synchronised effect Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000010354 integration Effects 0.000 description 3
- 238000009877 rendering Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
- G06F9/4451—User profiles; Roaming
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The application provides a processing method, comprising the following steps: configuring system resources for a graphics processor, wherein the system resources can meet the system resource requirements of the graphics processor in different modes; when the graphics processor is switched in mode, updating target system resources configured for the graphics processor by system firmware or a basic input/output system to an operating system so that the graphics processor runs in an updated system resource environment; and the target system resource is a system resource required when the image processor is switched to a target mode. Meanwhile, the application also provides a processing device and electronic equipment.
Description
Technical Field
The present disclosure relates to data processing technologies, and in particular, to a processing method and apparatus, and an electronic device.
Background
With the increasing programmability of a Graphics Processing Unit (GPU), the application capability of the GPU has far exceeded the Graphics rendering task, wherein a General-purpose Graphics Processing Unit (GPGPU) is a General-purpose computing task that is originally processed by a Central Processing Unit (CPU) by using the GPU for Processing the Graphics task, so that the research on the General-purpose computing for using the GPU in the fields other than the Graphics rendering is more and more active.
However, in the prior art, when a user selects a needed GPU mode according to different applications, a Basic Input Output System (BIOS) needs to restart a machine to configure resource information of the GPU in different modes, which results in a long resource configuration time of the GPU in different modes and affects working efficiency and use experience of the user.
Disclosure of Invention
In order to solve the above problems, the technical solution of the present application is implemented as follows:
according to an aspect of the present application, there is provided a processing method including:
configuring system resources for a graphics processor, wherein the system resources can meet the system resource requirements of the graphics processor in different modes;
when the graphics processor is switched in mode, updating target system resources configured for the graphics processor by system firmware or a basic input/output system to an operating system so that the graphics processor runs in an updated system resource environment;
and the target system resource is a system resource required when the image processor is switched to a target mode.
In the foregoing solution, the configuring system resources for a graphics processor includes:
determining attribute information of the graphics processor in the process of initializing the graphics processor;
and when the graphic processor is determined to support the multi-mode based on the attribute information, configuring system resources for the graphic processor based on a preset resource parameter demand table, wherein the resource parameter demand table stores system resource demand information meeting the requirements of the graphic processor under different modes.
In the above scheme, the method further comprises:
and determining system resource requirements of the graphics processor in different modes, and integrating the system resource requirements of the graphics processor in each mode to obtain the resource parameter requirement table.
In the foregoing solution, before the mode switching of the graphics processor, the method further includes: determining a current mode of the graphics processor;
the determining the current mode of the graphics processor comprises:
acquiring a current mode parameter value of the graphics processor through a mode switching interface of the graphics processor;
determining a current mode of the graphics processor based on the mode parameter value.
In the foregoing solution, the updating, when the graphics processor performs mode switching, target system resources configured for the graphics processor by system firmware or a bios, to an operating system includes:
when the mode switching condition is met, triggering a system management interrupt event to enable the central processing unit to enter a system management mode;
and updating the target system resource allocated to the graphic processor to an operating system of the electronic equipment in the system management mode.
In the above scheme, the method further comprises: configuring target system resources for the graphics processor;
the configuring target system resources for the graphics processor comprises:
triggering a system management interrupt event when the graphics processor switches from a compute mode to a graphics mode, the system firmware or BIOS configuring a first target system resource for the graphics processor; or the like, or, alternatively,
triggering a system management interrupt event when the graphics processor is switched from a graphics mode to a computing mode, wherein the system firmware or the basic input output system configures a second target system resource for the graphics processor;
wherein the first target system resource is at least partially different from the second target system resource.
In the foregoing solution, after configuring the first target system resource for the graphics processor, the method further includes:
updating the first target system resource to an operating system of the electronic device so that the operating system can access the graphics processor or update system resource information which is different from the first target system resource in a current system resource table based on the first target system resource;
or, after configuring the second target system resource for the graphics processor, further comprising:
and updating the second target system resource to an operating system of the electronic equipment so that the operating system can access the graphics processor or update system resource information which is different from the second target system resource in a current system resource table based on the second target system resource.
In the above scheme, the method further comprises:
reporting the system resources used by the graphics processor in the current mode to an operating system of the electronic device, so that the operating system can use the system resources in the current mode at least after mode switching.
According to another aspect of the present application, there is provided a processing apparatus comprising:
the system comprises a configuration unit, a processing unit and a processing unit, wherein the configuration unit is used for configuring system resources for a graphics processor, and the system resources can meet the system resource requirements of the graphics processor in different modes;
a sending unit, configured to update, to an operating system, a target system resource configured for the graphics processor by a system firmware or a basic input/output system when the graphics processor performs mode switching, so that the graphics processor runs in an updated system resource environment; and the target system resource is a system resource required when the image processor is switched to a target mode.
According to a third aspect of the present application, there is provided an electronic device comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of the above method when running the computer program.
According to the processing method, the processing device and the electronic equipment, system resources are configured for the graphics processor, and the system resources can meet system resource requirements of the graphics processor in different modes; when the graphics processor is switched in mode, updating target system resources configured for the graphics processor by system firmware or a basic input/output system to an operating system so that the graphics processor runs in an updated system resource environment; and the target system resource is a system resource required when the image processor is switched to a target mode. Because the basic input and output system is already configured for the graphics processor, the system resource requirements of the graphics processor under different modes can be met, and therefore, when a user switches the current mode of the graphics processor, the system resource configuration of the current mode of the graphics processor can be completed without restarting equipment, so that the resource configuration time of the graphics processor under different modes can be saved, and the working efficiency of the user is improved.
Drawings
FIG. 1 is a first schematic diagram illustrating a first process implementation of the processing method of the present application;
FIG. 2 is a second schematic diagram of a flow implementation of the processing method of the present application;
FIG. 3 is a schematic structural component diagram of a processing apparatus according to the present application;
fig. 4 is a schematic structural component diagram of an electronic device in the present application.
Detailed Description
The technical solution of the present application is further described in detail with reference to the drawings and specific embodiments of the specification.
Fig. 1 is a schematic view of a first flow implementation of the processing method in the present application, as shown in fig. 1, the method includes:
here, the method is mainly applied to an electronic device, which may be a personal computer, a workstation, a game machine, a tablet computer, a smart phone, and the like. A graphics processor, i.e., a GPU chip, is mounted on the motherboard of the electronic device, and the GPU chip can process image and graphics related arithmetic operations.
In this application, in the process of performing power-on initialization on the graphics processor, the system firmware or the bios on the electronic device may obtain attribute information of the graphics processor, and may determine whether the graphics processor supports a single mode or multiple modes according to the attribute information. When the system firmware or the basic input output system determines that the graphics processor supports multiple modes based on the attribute information of the graphics processor, system resources are configured for the graphics processor based on a preset resource parameter requirement table.
Here, the system Firmware (FW) or Basic Input Output System (BIOS) configures system resources for the graphics processor to meet system resource requirements of the graphics processor in different modes.
For example, when a graphics processor on an electronic device supports both a graphics mode and a computing mode, the system firmware or bios configures or reserves system resources for the graphics processor, which can meet system resource requirements of the graphics processor in the graphics mode and can also meet system resource requirements of the computing mode. Therefore, the system resources which can meet the system resource requirements of the graphics processor in different modes are configured for the graphics processor, so that the graphics processor can conveniently use the target system resources without electrifying and initializing the graphics processor again when the modes of the graphics processor are switched, and the working efficiency of the electronic equipment can be improved.
In this application, before configuring system resources for the graphics processor, the electronic device may further determine system resource requirements of the graphics processor in different modes according to system resource information input by a developer for the graphics processor, and may obtain the resource parameter requirement table by performing integration processing on the system resource requirements of the graphics processor in each mode. Here, the resource parameter requirement table stores information that satisfies system resource requirements of the graphics processor in different modes.
In this application, in order to avoid waste of system resources, if the preset resource parameter table has overlapping resources, the electronic device may further perform deduplication processing on the overlapping resources, so that the configured system resources are not overlapped when the electronic device configures the system resources for the graphics processor. Therefore, the graphics processor can be guaranteed to have enough system resources, and waste of the system resources can be avoided.
Here, the target system resource given to the operating system is specifically a system resource required when the image processor switches to the target mode.
For example, when the graphics processor is in graphics mode, when the graphics processor switches from graphics mode to compute mode, the FW or BIOS updates the system resources needed by the graphics processor in compute mode to the operating system so that the operating system accesses the graphics processor based on the system resources, and the graphics processor can operate in the updated system resources environment.
In this application, the mode of the graphics processor is usually switched only when the graphics processor satisfies the mode switching condition.
For example, when the user performs a mode switching operation on the graphics processor, a System Management Interrupt (SMI) event is triggered, and when the electronic device detects the SMI event, the graphics processor is characterized to satisfy a mode switching condition. Or, when the electronic device enables an application program, the electronic device may acquire hardware resources and/or software resources required by the application program, and if the hardware resources and/or software resources fail to match system resources in the current mode of the graphics processor and successfully match performance parameters in another mode of the graphics processor, an SMI event may be triggered, and when the electronic device detects the SMI event, it may indicate that the graphics processor satisfies a mode switching condition.
For example, a game application is enabled by the current electronic device, the electronic device matches the resources required by the game application with the system resources that can be invoked in the current mode (e.g., graphics mode) of the graphics processor, if the matching fails, indicating that the game application requires more powerful general-purpose computing power or rendering capability, such as supporting collision detection, approximate physical simulation, etc., a SIM event is triggered, and the electronic device detects the SIM event and performs mode switching on the graphics processor.
In the present application, when the SMI event is triggered, the CPU may enter a System Management Mode (SMM), and in the SMM mode, the BIOS has the highest authority to manage System resources. Therefore, after the CPU enters the SMM mode, the BIOS may configure target system resources for the image processor in the target mode in the SMM mode, and meanwhile, the mode switch program corresponding to the BIOS updates the target system resources allocated by the BIOS for the image processor to the FW or BIOS, and reports the target system resources allocated by the image processor to the operating system of the electronic device, so that the operating system updates the current system resource list based on the target system resources. The CPU then exits the SMM mode, at which point the mode switching operation characterizing the image processor is complete.
In this application, before the graphics processor performs mode switching, the electronic device may further obtain a current mode parameter value of the graphics processor through a mode switching interface of the graphics processor; based on the mode parameter value, a current mode of the graphics processor is determined.
Here, the mode switching interface may be an interface defined by an application corresponding to the current operating system and the FW or BIOS, and when the mode of the graphics processor needs to be switched, the FW or BIOS may be notified of the mode switching of the graphics processor through the mode switching interface.
For example, when the current mode parameter value of the graphics processor is "1" through the mode switching interface of the graphics processor, the current mode characterizing the graphics processor is the graphics mode. When the current mode parameter value of the graphics processor is acquired to be '0' through the mode switching interface of the graphics processor, the current mode representing the graphics processor is a calculation mode.
In this application, when the electronic device determines that the current mode of the graphics processor (referred to as a mode before mode switching) is set, the system resources used by the graphics processor in the current mode may also be reported to an operating system of the electronic device, so that the operating system can use the system resources in the current mode at least after mode switching.
For example, the graphics processor uses an input/output (I/O) interface in a current mode (e.g., graphics mode), and the I/O interface is also used in a switched mode (e.g., compute mode) after the graphics processor switches modes, so that the operating system can directly use the system resources of the I/O interface of the graphics processor in the graphics mode when the graphics processor switches modes.
Or, the graphics processor uses the camera function in the current mode (e.g., graphics mode), and the graphics processor uses the camera function in the switched mode (e.g., computing mode) after switching the modes, so that the operating system does not shut down the system resource, which is the camera function of the graphics processor in the graphics mode, when the graphics processor switches the modes, thereby further improving the response speed of the electronic device.
In this application, the electronic device may also configure target system resources for the graphics processor.
For example, a system management interrupt event may be triggered during the process of the graphics processor switching from a computing mode to a graphics mode, at which time a central processing unit on the electronic device may enter an SMM mode, in which system firmware or a bios on the electronic device may configure a first target system resource for the graphics processor; and after configuring the first target system resource for the graphics processor, updating the first target system resource to an operating system of the electronic device, so that the operating system can access the graphics processor or update system resource information different from the first target system resource in a current system resource table based on the first target system resource.
Alternatively, a system management interrupt event may be triggered during the process of the graphics processor switching from graphics mode to computing mode, at which point the central processing unit on the electronic device may enter SMM mode, in which the system firmware or bios on the electronic device may configure second target system resources for the graphics processor. And after configuring a second target system resource for the graphics processor, the second target system resource may be updated to an operating system of the electronic device, so that the operating system can access the graphics processor or update system resource information different from the second target system resource in a current system resource table based on the second target system resource.
Here, the first target system resource is at least partially different from the second target system resource.
For example, the system resources used in the computing mode include: 8GB memory, 3D controller, I/O interface; the system resources used in the graphics mode include: 256MB memory, VGA controller and I/O interface. The same system resource of the computing mode and the graphic mode is an I/O interface, and the different system resource is a memory and a controller. When the BIOS sends system resources in the compute mode to the operating system, the operating system may only update memory and controller resources in the current system resource table because the "I/O interface" resources in the compute mode and the graphics mode are the same. Thus, the mode switching speed of the graphics processor can be increased, and the response speed of the operating system can be increased.
Fig. 2 is a schematic view of a second implementation flow of the processing method in the present application, as shown in fig. 2, including:
in step 202, the BIOS configures system resources for the GPU.
Here, the system resources configured by the BIOS for the GPU can meet the system resource requirements of the GPU in different modes. Therefore, the GPU can conveniently acquire the target system resources without being powered on again and initialized during mode switching.
Here, the electronic device may obtain a current mode parameter value of the GPU through a mode switching interface predetermined by the GPU and the BIOS, and if the mode parameter value is "1", the current operating mode representing the GPU is a computing mode, configure a system resource for the GPU in the computing mode, and report the system resource configured by the GPU in the computing mode to the OS, so that the OS accesses the GPU in the computing mode after updating the current system resource list based on the system resource. Thereby enabling the GPU to be used normally in a resource environment in a compute mode. If the mode parameter value is "0", the current working mode of the GPU is characterized as the graphic mode, system resources are configured for the GPU in the graphic mode, and the system resources configured when the GPU is in the graphic mode are reported to the OS, so that the OS accesses the GPU in the graphic mode after updating the current system resource list based on the system resources. Thereby enabling the GPU to be used normally in a resource environment in graphics mode.
And step 204, triggering SMI when the GPU mode is switched.
Here, when the user performs mode switching on the GPU, the mode switching interface defined by the GPU and the FW/BIOS may trigger an SMI to notify the FW/BIOS that the GPU is to perform mode switching.
In step 205, the CPU enters SMM mode.
Here, SMM is a special mode of operation that is not dependent on a specific operating system, being controlled entirely by firmware. SMM mode can only be entered by a system management interrupt SMI instruction and can only be exited by the execution of an RSM instruction. When the CPU detects an SMI event or instruction, SMM mode is entered because the BIOS has the highest authority to manage system resources in SMM mode.
In step 206, the BIOS switches modes of the GPU, and updates the target system resources configured by the GPU after the mode switching to the resource list of the OS.
Here, after the CPU enters the SMM mode, the BIOS switches the current mode of the GPU in the SMM mode, and configures target system resources for the GPU after the mode switching based on the system resources reserved for the GPU. After the target system resources are configured for the GPU after mode switching, the target system resources allocated by the GPU are updated to FW/BIOS through a mode switching program corresponding to the BIOS and are reported to a resource list of the OS, and therefore the OS can access the GPU after mode switching based on the target system resources so as to enable the GPU to reach an optimal state in a resource environment after mode switching.
Here, after the BIOS configures the target system resource for the GPU after the mode switching and reports the target system resource configured by the GPU after the mode switching to the OS, the CPU detects a system resume instruction (RSM) to exit the SMM mode, at which point, it indicates that the GPU mode switching is completed.
Under the condition that hardware cost is not increased, when the GPU is electrified and initialized, system resources of the GPU in different modes can be met by configuring the GPU through the BIOS or the FW, so that the GPU can be freely switched among multiple modes, a user can shuttle among different application programs at will, the user does not need to restart a machine to realize mode switching every time the GPU is switched, but resource configuration is carried out on the GPU after mode switching based on system resources reserved for the GPU by the BIOS, product competitiveness is improved, and working efficiency of the user and mode switching efficiency of the GPU are greatly improved.
Fig. 3 is a schematic structural composition diagram of a treatment apparatus according to the present application, such as the one shown in fig. 3, the apparatus comprising:
a configuration unit 301, configured to configure system resources for a graphics processor, where the system resources can meet system resource requirements of the graphics processor in different modes;
a sending unit 302, configured to update, to an operating system, a target system resource configured for the graphics processor by a system firmware or a bios when the graphics processor performs mode switching, so that the graphics processor runs in an updated system resource environment; and the target system resource is a system resource required when the image processor is switched to a target mode.
In a preferred embodiment, the apparatus further comprises: a determination unit 303;
specifically, the determining unit 303 is configured to determine attribute information of the graphics processor in an initialization process of the graphics processor;
the configuration unit 301 is specifically configured to, when it is determined that the graphics processor supports multiple modes based on the attribute information, configure system resources for the graphics processor based on a preset resource parameter requirement table, where system resource requirement information that meets requirements of the graphics processor in different modes is stored in the resource parameter requirement table.
In a preferred embodiment, the apparatus further comprises: an integration unit 304;
specifically, the determining unit 303 is further configured to determine system resource requirements of the graphics processor in different modes;
the integration unit 304 is configured to integrate system resource requirements of the graphics processor in each mode to obtain the resource parameter requirement table.
In a preferred embodiment, the apparatus further comprises: an acquisition unit 305;
specifically, the obtaining unit 305 is specifically configured to obtain a current mode parameter value of the graphics processor through a mode switching interface of the graphics processor;
the determining unit 303 is further configured to determine a current mode of the graphics processor based on the mode parameter value.
In the preferred scheme, when the GPU meets the mode switching condition, triggering a system management interrupt event to enable the central processing unit to enter a system management mode; the sending unit 302 is specifically configured to update the target system resource allocated to the graphics processor to an operating system of the electronic device in the system management mode.
In a preferred embodiment, when the graphics processor switches from a computing mode to a graphics mode, a system management interrupt event is triggered, and the configuration unit 301 is specifically configured to configure a first target system resource for the graphics processor through the system firmware or the basic input output system;
or, when the graphics processor switches from the graphics mode to the computing mode, triggering a system management interrupt event, where the configuration unit 301 is specifically configured to configure a second target system resource for the graphics processor through the system firmware or the bios;
wherein the first target system resource is at least partially different from the second target system resource.
In a preferred embodiment, the sending unit 302 is specifically configured to, after configuring a first target system resource for the graphics processor, update the first target system resource to an operating system of an electronic device, so that the operating system can access the graphics processor based on the first target system resource or update system resource information different from the first target system resource in a current system resource table; or after configuring a second target system resource for the graphics processor, updating the second target system resource to an operating system of the electronic device, so that the operating system can access the graphics processor or update system resource information different from the second target system resource in a current system resource table based on the second target system resource.
In a preferred embodiment, the sending unit 302 is further specifically configured to report the system resources used by the graphics processor in the current mode to an operating system of the electronic device, so that the operating system can use the system resources in the current mode at least after mode switching.
It should be noted that: in the processing device provided in the above embodiment, when the mode of the GPU is switched, only the division of the program modules is exemplified, and in practical applications, the processing configuration may be completed by different program modules according to needs, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the processing apparatus and the processing method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments and are not described herein again.
An embodiment of the present application further provides an electronic device, including: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to execute, when running the computer program: configuring system resources for a graphics processor, wherein the system resources can meet the system resource requirements of the graphics processor in different modes; when the graphics processor is switched in mode, updating target system resources configured for the graphics processor by system firmware or a basic input/output system to an operating system so that the graphics processor runs in an updated system resource environment; and the target system resource is a system resource required when the image processor is switched to a target mode.
The processor is further configured to, when executing the computer program, perform: determining attribute information of the graphics processor in the process of initializing the graphics processor; and when the graphic processor is determined to support the multi-mode based on the attribute information, configuring system resources for the graphic processor based on a preset resource parameter demand table, wherein the resource parameter demand table stores system resource demand information meeting the requirements of the graphic processor under different modes.
The processor is further configured to, when executing the computer program, perform: and determining system resource requirements of the graphics processor in different modes, and integrating the system resource requirements of the graphics processor in each mode to obtain the resource parameter requirement table.
The processor is further configured to, when executing the computer program, perform: acquiring a current mode parameter value of the graphics processor through a mode switching interface of the graphics processor; determining a current mode of the graphics processor based on the mode parameter value.
The processor is further configured to, when executing the computer program, perform: when the GPU meets the mode switching condition, triggering a system management interrupt event to enable the central processing unit to enter a system management mode; and updating the target system resource allocated to the graphic processor to an operating system of the electronic equipment in the system management mode.
The processor is further configured to, when executing the computer program, perform: triggering a system management interrupt event when the graphics processor switches from a compute mode to a graphics mode, the system firmware or BIOS configuring a first target system resource for the graphics processor; or, when the graphics processor switches from graphics mode to computing mode, triggering a system management interrupt event, the system firmware or bios configuring a second target system resource for the graphics processor; wherein the first target system resource is at least partially different from the second target system resource.
The processor is further configured to, when executing the computer program, perform: after configuring a first target system resource for the graphics processor, updating the first target system resource to an operating system of an electronic device, so that the operating system can access the graphics processor or update system resource information which is different from the first target system resource in a current system resource table based on the first target system resource; or after configuring a second target system resource for the graphics processor, updating the second target system resource to an operating system of the electronic device, so that the operating system can access the graphics processor or update system resource information different from the second target system resource in a current system resource table based on the second target system resource.
The processor is further configured to, when executing the computer program, perform: reporting the system resources used by the graphics processor in the current mode to an operating system of the electronic device, so that the operating system can use the system resources in the current mode at least after mode switching.
Fig. 4 is a schematic structural component diagram of an electronic device 400 in the present application, which may be a mobile phone, a computer, a digital broadcast terminal, an information transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like. The electronic device 400 shown in fig. 4 includes: at least one processor 401, memory 402, at least one network interface 404, and a user interface 403. The various components in the electronic device 400 are coupled together by a bus system 405. It is understood that the bus system 405 is used to enable connection communication between these components. The bus system 405 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 405 in fig. 4.
The user interface 403 may include, among other things, a display, a keyboard, a mouse, a trackball, a click wheel, a key, a button, a touch pad, or a touch screen.
It will be appreciated that the memory 402 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 402 described in embodiments herein is intended to comprise, without being limited to, these and any other suitable types of memory.
The memory 402 in the embodiments of the present application is used to store various types of data to support the operation of the electronic device 400. Examples of such data include: any computer programs for operating on the electronic device 400, such as an operating system 4021 and application programs 4022; contact data; telephone book data; a message; a picture; video, etc. The operating system 4021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is configured to implement various basic services and process hardware-based tasks. The application 4022 may include various applications such as a Media Player (Media Player), a Browser (Browser), and the like for implementing various application services. A program for implementing the method according to the embodiment of the present application may be included in the application 4022.
The method disclosed in the embodiments of the present application may be applied to the processor 401, or implemented by the processor 401. The processor 401 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 401. The Processor 401 described above may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 401 may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 402, and the processor 401 reads the information in the memory 402 and performs the steps of the aforementioned methods in conjunction with its hardware.
In an exemplary embodiment, the electronic Device 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field-Programmable Gate arrays (FPGAs), general purpose processors, controllers, Micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components for performing the aforementioned methods.
In an exemplary embodiment, the present application further provides a computer readable storage medium, such as a memory 402, comprising a computer program, which is executable by a processor 401 of the electronic device 400 to perform the steps of the foregoing method. The computer readable storage medium can be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM; or may be a variety of devices including one or any combination of the above memories, such as a mobile phone, computer, tablet device, personal digital assistant, etc.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, performs: configuring system resources for a graphics processor, wherein the system resources can meet the system resource requirements of the graphics processor in different modes; when the graphics processor is switched in mode, updating target system resources configured for the graphics processor by system firmware or a basic input/output system to an operating system so that the graphics processor runs in an updated system resource environment; and the target system resource is a system resource required when the image processor is switched to a target mode.
The computer program, when executed by the processor, further performs: determining attribute information of the graphics processor in the process of initializing the graphics processor; and when the graphic processor is determined to support the multi-mode based on the attribute information, configuring system resources for the graphic processor based on a preset resource parameter demand table, wherein the resource parameter demand table stores system resource demand information meeting the requirements of the graphic processor under different modes.
The computer program, when executed by the processor, further performs:
and determining system resource requirements of the graphics processor in different modes, and integrating the system resource requirements of the graphics processor in each mode to obtain the resource parameter requirement table.
The computer program, when executed by the processor, further performs:
acquiring a current mode parameter value of the graphics processor through a mode switching interface of the graphics processor; determining a current mode of the graphics processor based on the mode parameter value.
The computer program, when executed by the processor, further performs:
when the GPU meets the mode switching condition, triggering a system management interrupt event to enable the central processing unit to enter a system management mode; and updating the target system resource allocated to the graphic processor to an operating system of the electronic equipment in the system management mode.
The computer program, when executed by the processor, further performs:
triggering a system management interrupt event when the graphics processor switches from a compute mode to a graphics mode, the system firmware or BIOS configuring a first target system resource for the graphics processor; or, when the graphics processor switches from graphics mode to computing mode, triggering a system management interrupt event, the system firmware or bios configuring a second target system resource for the graphics processor; wherein the first target system resource is at least partially different from the second target system resource.
The computer program, when executed by the processor, further performs:
after configuring a first target system resource for the graphics processor, updating the first target system resource to an operating system of an electronic device, so that the operating system can access the graphics processor or update system resource information which is different from the first target system resource in a current system resource table based on the first target system resource; or after configuring a second target system resource for the graphics processor, updating the second target system resource to an operating system of the electronic device, so that the operating system can access the graphics processor or update system resource information different from the second target system resource in a current system resource table based on the second target system resource.
The computer program, when executed by the processor, further performs:
reporting the system resources used by the graphics processor in the current mode to an operating system of the electronic device, so that the operating system can use the system resources in the current mode at least after mode switching.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The methods disclosed in the several method embodiments provided in the present application may be combined arbitrarily without conflict to obtain new method embodiments.
Features disclosed in several of the product embodiments provided in the present application may be combined in any combination to yield new product embodiments without conflict.
The features disclosed in the several method or apparatus embodiments provided in the present application may be combined arbitrarily, without conflict, to arrive at new method embodiments or apparatus embodiments.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (10)
1. A method of processing, comprising:
configuring system resources for a graphics processor, wherein the system resources can meet the system resource requirements of the graphics processor in different modes;
when the graphics processor is switched in mode, updating target system resources configured for the graphics processor by system firmware or a basic input/output system to an operating system so that the graphics processor runs in an updated system resource environment;
and the target system resource is a system resource required when the image processor is switched to a target mode.
2. The method of claim 1, the configuring system resources for a graphics processor, comprising:
determining attribute information of the graphics processor in the process of initializing the graphics processor;
and when the graphic processor is determined to support the multi-mode based on the attribute information, configuring system resources for the graphic processor based on a preset resource parameter demand table, wherein the resource parameter demand table stores system resource demand information meeting the requirements of the graphic processor under different modes.
3. The method of claim 2, further comprising:
and determining system resource requirements of the graphics processor in different modes, and integrating the system resource requirements of the graphics processor in each mode to obtain the resource parameter requirement table.
4. The method of claim 1, prior to the graphics processor performing a mode switch, further comprising: determining a current mode of the graphics processor;
the determining the current mode of the graphics processor comprises:
acquiring a current mode parameter value of the graphics processor through a mode switching interface of the graphics processor;
determining a current mode of the graphics processor based on the mode parameter value.
5. The method of claim 4, wherein updating, to an operating system, target system resources configured for the graphics processor by system firmware or a basic input output system when the graphics processor is switched from mode, comprises:
when the mode switching condition is met, triggering a system management interrupt event to enable the central processing unit to enter a system management mode;
and updating the target system resource allocated to the graphic processor to an operating system of the electronic equipment in the system management mode.
6. The method of claim 4 or 5, further comprising: configuring target system resources for the graphics processor;
the configuring target system resources for the graphics processor comprises:
triggering a system management interrupt event when the graphics processor switches from a compute mode to a graphics mode, the system firmware or BIOS configuring a first target system resource for the graphics processor; or the like, or, alternatively,
triggering a system management interrupt event when the graphics processor is switched from a graphics mode to a computing mode, wherein the system firmware or the basic input output system configures a second target system resource for the graphics processor;
wherein the first target system resource is at least partially different from the second target system resource.
7. The method of claim 6, wherein after configuring the graphics processor with the first target system resource, further comprising:
updating the first target system resource to an operating system of the electronic device so that the operating system can access the graphics processor or update system resource information which is different from the first target system resource in a current system resource table based on the first target system resource;
or, after configuring the second target system resource for the graphics processor, further comprising:
and updating the second target system resource to an operating system of the electronic equipment so that the operating system can access the graphics processor or update system resource information which is different from the second target system resource in a current system resource table based on the second target system resource.
8. The method of claim 4, further comprising:
reporting the system resources used by the graphics processor in the current mode to an operating system of the electronic device, so that the operating system can use the system resources in the current mode at least after mode switching.
9. A processing apparatus, comprising:
the system comprises a configuration unit, a processing unit and a processing unit, wherein the configuration unit is used for configuring system resources for a graphics processor, and the system resources can meet the system resource requirements of the graphics processor in different modes;
a sending unit, configured to update, to an operating system, a target system resource configured for the graphics processor by a system firmware or a basic input/output system when the graphics processor performs mode switching, so that the graphics processor runs in an updated system resource environment; and the target system resource is a system resource required when the image processor is switched to a target mode.
10. An electronic device, comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is adapted to perform the steps of the method of any one of claims 1 to 8 when running the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010623298.7A CN111796939B (en) | 2020-06-30 | 2020-06-30 | Processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010623298.7A CN111796939B (en) | 2020-06-30 | 2020-06-30 | Processing method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111796939A true CN111796939A (en) | 2020-10-20 |
CN111796939B CN111796939B (en) | 2024-05-24 |
Family
ID=72809959
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010623298.7A Active CN111796939B (en) | 2020-06-30 | 2020-06-30 | Processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111796939B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117331676A (en) * | 2023-11-30 | 2024-01-02 | 上海兆芯集成电路股份有限公司 | System management mode entry method, processor and computer system |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1711524A (en) * | 2002-11-18 | 2005-12-21 | Arm有限公司 | Switching between secure and non-secure processing modes |
CN1987793A (en) * | 2005-12-22 | 2007-06-27 | 国际商业机器公司 | Methods and arrangements for dynamically active processors |
US20080040524A1 (en) * | 2006-08-14 | 2008-02-14 | Zimmer Vincent J | System management mode using transactional memory |
US7454547B1 (en) * | 2006-05-16 | 2008-11-18 | American Megatrends, Inc. | Data exchange between a runtime environment and a computer firmware in a multi-processor computing system |
CN101685391A (en) * | 2002-01-04 | 2010-03-31 | 微软公司 | Methods and system for managing computational resources of a coprocessor in a computing system |
US20110023040A1 (en) * | 2009-07-24 | 2011-01-27 | Apple Inc. | Power-efficient interaction between multiple processors |
CN104462953A (en) * | 2013-09-16 | 2015-03-25 | 联想(北京)有限公司 | Information processing method and electronic equipment |
US20170277561A1 (en) * | 2014-12-12 | 2017-09-28 | Huawei Technologies Co., Ltd. | Operating System Hot-Switching Method and Apparatus and Mobile Terminal |
CN107680029A (en) * | 2017-08-31 | 2018-02-09 | 深圳天珑无线科技有限公司 | Image processing method, electronic equipment and the device with store function |
-
2020
- 2020-06-30 CN CN202010623298.7A patent/CN111796939B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101685391A (en) * | 2002-01-04 | 2010-03-31 | 微软公司 | Methods and system for managing computational resources of a coprocessor in a computing system |
CN1711524A (en) * | 2002-11-18 | 2005-12-21 | Arm有限公司 | Switching between secure and non-secure processing modes |
CN1987793A (en) * | 2005-12-22 | 2007-06-27 | 国际商业机器公司 | Methods and arrangements for dynamically active processors |
US7454547B1 (en) * | 2006-05-16 | 2008-11-18 | American Megatrends, Inc. | Data exchange between a runtime environment and a computer firmware in a multi-processor computing system |
US20080040524A1 (en) * | 2006-08-14 | 2008-02-14 | Zimmer Vincent J | System management mode using transactional memory |
US20110023040A1 (en) * | 2009-07-24 | 2011-01-27 | Apple Inc. | Power-efficient interaction between multiple processors |
CN104462953A (en) * | 2013-09-16 | 2015-03-25 | 联想(北京)有限公司 | Information processing method and electronic equipment |
US20170277561A1 (en) * | 2014-12-12 | 2017-09-28 | Huawei Technologies Co., Ltd. | Operating System Hot-Switching Method and Apparatus and Mobile Terminal |
CN107680029A (en) * | 2017-08-31 | 2018-02-09 | 深圳天珑无线科技有限公司 | Image processing method, electronic equipment and the device with store function |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117331676A (en) * | 2023-11-30 | 2024-01-02 | 上海兆芯集成电路股份有限公司 | System management mode entry method, processor and computer system |
CN117331676B (en) * | 2023-11-30 | 2024-03-19 | 上海兆芯集成电路股份有限公司 | System management mode entry method, processor and computer system |
Also Published As
Publication number | Publication date |
---|---|
CN111796939B (en) | 2024-05-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104360900B (en) | Method for operating multiple operating systems, corresponding system and mobile device | |
KR101861742B1 (en) | Data processing system and method for switching between heterogeneous accelerators | |
CN107430424B (en) | Techniques for improved hybrid sleep power management | |
CN113094111B (en) | Device and method for starting device | |
US20160048412A1 (en) | Method and apparatus for switching applications | |
CN105814541B (en) | The method of computer equipment and computer equipment internal storage starting | |
CN110515871B (en) | Interrupt method, interrupt device, FPGA (field programmable Gate array) and storage medium | |
CN105940375B (en) | Dynamic reassignment for multiple operating system devices | |
CN109313604B (en) | Computing system, apparatus, and method for dynamic configuration of compressed virtual memory | |
EP3435209A1 (en) | Method for recognizing a screen-off gesture, and storage medium and terminal thereof | |
JPH06100956B2 (en) | Device for pointer control | |
CN114153642A (en) | System detection method and electronic equipment | |
CN110008027B (en) | Process operation method, device, terminal and storage medium | |
CN116339836A (en) | Resource access method, device, readable storage medium and BMC chip | |
JP2011060225A (en) | Operating system booting method | |
CN111796939A (en) | Processing method and device and electronic equipment | |
CN115576645A (en) | Virtual processor scheduling method and device, storage medium and electronic equipment | |
WO2025123890A1 (en) | Virtualization system, working method, working device and readable storage medium | |
CN107395888B (en) | Processing method and device of black screen gesture, storage medium and mobile terminal | |
CN113648654A (en) | Game picture processing method, device, equipment, storage medium and program product | |
WO2024222606A1 (en) | Cache resource adjustment method and apparatus, and electronic device and readable storage medium | |
CN108121572B (en) | Web application starting method and device | |
CN116610370A (en) | Starting method, starting device, starting equipment and storage medium | |
CN104503773A (en) | Method and device for displaying basic input/output system menu | |
CN112860302B (en) | Application control method, device, electronic device and readable storage medium |
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 |