CN111796939B - Processing method and device and electronic equipment - Google Patents

Processing method and device and electronic equipment Download PDF

Info

Publication number
CN111796939B
CN111796939B CN202010623298.7A CN202010623298A CN111796939B CN 111796939 B CN111796939 B CN 111796939B CN 202010623298 A CN202010623298 A CN 202010623298A CN 111796939 B CN111796939 B CN 111796939B
Authority
CN
China
Prior art keywords
processor
mode
system resource
resource
target
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.)
Active
Application number
CN202010623298.7A
Other languages
Chinese (zh)
Other versions
CN111796939A (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN202010623298.7A priority Critical patent/CN111796939B/en
Publication of CN111796939A publication Critical patent/CN111796939A/en
Application granted granted Critical
Publication of CN111796939B publication Critical patent/CN111796939B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • 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
    • 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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User 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, which comprises 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 pattern processor is subjected to pattern switching, updating a target system resource configured by a system firmware or a basic input/output system for the pattern processor to an operating system so that the pattern processor runs in an updated system resource environment; 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

Processing method and device and electronic equipment
Technical Field
The present application relates to data processing technologies, and in particular, to a processing method, an apparatus, and an electronic device.
Background
With the increasing programmability of graphics processors (GPUs, graphics Processing Unit), the application capabilities of GPUs have far exceeded graphics rendering tasks, where General-purpose graphics processors (GPGPUs, general-Purpose computing on Graphics Processing Units) are a type of GPU that utilizes graphics tasks to compute General-purpose computing tasks that were otherwise handled by central processing units (CPUs, central Processing Unit), making the use of GPUs for General-purpose computing in areas other than graphics rendering more and more active.
Because the requirements of the GPU on the system resources in different modes are different, however, in the prior art, when a user selects a required GPU mode according to different applications, the basic input output system (BIOS, basic Input Output System) needs to restart the machine to configure the resource information of the GPU in different modes, so that the resource configuration time of the GPU in different modes is long, and the working efficiency and the use experience of the user are affected.
Disclosure of Invention
In order to solve the problems, the technical scheme of the application is realized as follows:
According to an aspect of the present application, there is provided a processing method 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 pattern processor is subjected to pattern switching, updating a target system resource configured by a system firmware or a basic input/output system for the pattern processor to an operating system so that the pattern processor runs in an updated system resource environment;
the target system resource is a system resource required when the image processor is switched to a target mode.
In the above solution, the configuring system resources for the graphics processor includes:
determining attribute information of the graphic processor in the process of initializing the graphic processor;
When the graphic processor supports multiple modes 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 different modes of the graphic processor.
In the above scheme, the method further comprises:
And determining the system resource requirements of the graphic processor in different modes, and integrating the system resource requirements of the graphic processor in each mode to obtain the resource parameter requirement table.
In the above 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 includes:
Acquiring a current mode parameter value of the graphic processor through a mode switching interface of the graphic processor;
a current mode of the graphics processor is determined based on the mode parameter value.
In the above solution, when the graphics processor performs mode switching, updating a system firmware or a target system resource configured by a basic input/output system for the graphics processor to an operating system includes:
the method comprises the steps that a mode switching condition is met, a system management interrupt event is triggered, and a central processing unit enters a system management mode;
And in the system management mode, updating the target system resources allocated to the graphic processor to an operating system of the electronic equipment.
In the above scheme, the method further comprises: configuring target system resources for a graphics processor;
the configuring the target system resource for the graphics processor comprises the following steps:
Triggering a system management interrupt event when the graphics processor is switched from a computing mode to a graphics mode, wherein the system firmware or a basic input/output system configures a first target system resource for the graphics processor; or alternatively, the first and second heat exchangers may be,
Triggering a system management interrupt event when the graphic processor is switched from a graphic mode to a computing mode, wherein the system firmware or the basic input/output system configures a second target system resource for the graphic processor;
Wherein the first target system resource is at least partially different from the second target system resource.
In the above 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 graphic 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 device, so that the operating system can access the graphic 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 graphic processor in the current mode to an operating system of the electronic device, so that the operating system can at least use the system resources in the current mode after the mode is switched.
According to another aspect of the present application, there is provided a processing apparatus including:
The configuration unit is used for configuring system resources for the graphic processor, and the system resources can meet the system resource requirements of the graphic processor in different modes;
the sending unit is used for updating the system firmware or the target system resources configured by the basic input/output system for the graphic processor to an operating system when the graphic processor performs mode switching, so that the graphic processor operates in an updated system resource environment; 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 execute the steps of the above method when running the computer program.
According to the processing method, the processing device and the electronic equipment, the system resources are configured for the graphic processor, and the system resources can meet the system resource requirements of the graphic processor in different modes; when the pattern processor is subjected to pattern switching, updating a target system resource configured by a system firmware or a basic input/output system for the pattern processor to an operating system so that the pattern processor runs in an updated system resource environment; 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 configured for the graphic processor to meet the system resource requirements of the graphic processor in different modes, when a user switches the current mode of the graphic processor, the system resource configuration of the current mode of the graphic processor can be completed without restarting the equipment, thereby saving the resource configuration time of the graphic processor in different modes and improving the working efficiency of the user.
Drawings
FIG. 1 is a schematic diagram of a process implementation of the treatment method of the present application;
FIG. 2 is a schematic diagram showing a second implementation of the processing method according to the present application;
FIG. 3 is a schematic diagram showing the structural components of the treatment device according to the present application;
fig. 4 is a schematic diagram showing the structural composition of an electronic device in the present application.
Detailed Description
The technical scheme of the application is further elaborated below by referring to the drawings in the specification and the specific embodiments.
Fig. 1 is a schematic diagram of a process implementation of a processing method according to the present application, as shown in fig. 1, where the method includes:
step 101, configuring system resources for a graphic processor, wherein the system resources can meet the system resource requirements of the graphic processor in different modes;
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, or the like. A graphic processor, namely a GPU chip, is arranged on a main board of the electronic equipment, and the GPU chip can process image and graphic related operation work.
In the application, the system firmware or the basic input/output system on the electronic equipment can acquire the attribute information of the graphic processor in the process of powering on and initializing the graphic processor, and can determine whether the graphic 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 demand table.
Here, the system Firmware (FW) or Basic Input Output System (BIOS) configures system resources for the graphics processor, so as to satisfy the 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 satisfy both the system resource requirements of the graphics processor in the graphics mode and the system resource requirements in the computing mode. Therefore, by configuring the system resources for the graphic processor, the system resources which can meet the system resource requirements of the graphic processor in different modes can be conveniently used for target system resources without re-powering on initialization of the graphic processor when the graphic processor is switched in modes, so that the working efficiency of the electronic equipment can be improved.
Before configuring system resources for the graphic processor, the electronic device can also determine the system resource requirements of the graphic processor in different modes according to the system resource information input by a developer for the graphic processor, and the resource parameter requirement table can be obtained by integrating the system resource requirements of the graphic processor in each mode. Here, the resource parameter demand table stores therein system resource demand information satisfying different modes of the graphics processor.
In the application, in order to avoid the waste of system resources, if the preset resource parameter table has overlapped resources, the electronic equipment can also perform de-duplication processing on the overlapped resources, so that the configured system resources cannot be overlapped when the electronic equipment configures the system resources for the graphic processor. Thus, the graphics processor can be ensured to have enough system resource usage, and the waste of the system resource can not be caused.
And 102, updating the system firmware or the target system resources configured by the basic input/output system for the graphic processor to an operating system when the graphic processor performs mode switching, so that the graphic processor operates in an updated system resource environment.
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 image processor is switched from the graphics mode to the computing mode, the FW or BIOS updates the system resources required by the image processor in the computing mode to the operating system so that the operating system accesses the image processor based on the system resources, and the image processor can operate in the updated system resource environment.
In the present application, the mode switching is typically performed on the graphics processor when the graphics processor satisfies the mode switching condition.
For example, when a user performs a mode switch operation with respect to the graphics processor, a system management Interrupt event (SMI, system Management Interrupt) is triggered, and when the electronic device detects the SMI event, the graphics processor is characterized as meeting a mode switch condition. Or when the electronic device starts a certain application program, the electronic device can acquire the hardware resource and/or the software resource required by the application program, if the hardware resource and/or the software resource fails to be matched with the system resource in the current mode of the graphic processor and is successfully matched with the performance parameter in the other mode of the graphic processor, an SMI event can be triggered, and when the electronic device detects the SMI event, the graphic processor is characterized to meet the mode switching condition.
For example, current electronic devices enable a game application that matches the resources required by the game application with system resources that can be invoked in the current mode of the graphics processor (e.g., graphics mode), and if the match fails, indicating that the game application requires more general purpose computing power or rendering power, such as supporting collision detection, near physical simulation, etc., a SIM event is triggered, and the electronic device detects the SIM event and then mode switches the graphics processor.
In the application, when the SMI event is triggered, the CPU enters a system management Mode (SMM, system Management Mode), 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 a target system resource for the image processor in the target mode in the SMM mode, and at the same time, the mode switching program corresponding to the BIOS updates the target system resource allocated by the BIOS for the graphics processor to FW or BIOS, and reports the target system resource allocated by the graphics 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 resource. The CPU then exits the SMM mode, at which point the mode switch operation characterizing the image processor is complete.
Before the mode switching of the graphic processor, the electronic equipment can also acquire the current mode parameter value of the graphic processor through the mode switching interface of the graphic 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 FW or BIOS, and when the graphics processor needs to be mode switched, the FW or BIOS may be notified through the mode switching interface that the graphics processor needs to be mode switched.
For example, when the current mode parameter value of the graphics processor is "1" acquired through the mode switching interface of the graphics processor, the current mode of the graphics processor is characterized as a graphics mode. When the current mode parameter value of the graphics processor is '0' through the mode switching interface of the graphics processor, the current mode of the graphics processor is characterized as a calculation mode.
In the application, when the electronic equipment determines the current mode (the mode before mode switching) of the graphic processor, the system resources used by the graphic processor in the current mode can be reported to the operating system of the electronic equipment, so that the operating system can at least use the system resources in the current mode after the mode switching.
For example, the graphics processor uses an input/output (I/O) interface in a current mode (e.g., graphics mode), and after the graphics processor performs mode switching, the graphics processor also uses the I/O interface in a switched mode (e.g., computing mode), so that the operating system can directly use the system resource, I/O interface, of the graphics processor in the graphics mode when the graphics processor performs mode switching.
Or the image processor uses the camera function in the current mode (such as the image mode), and after the image processor performs the mode switching, the image processor also uses the camera function in the switched mode (such as the calculation mode), so that the operating system can not shut down the system resource of the camera function of the image processor in the image mode when the image processor performs the mode switching, and the response speed of the electronic equipment can be further improved.
In the application, the electronic equipment can also configure target system resources for the graphic processor.
For example, during a transition of the graphics processor from a computing mode to a graphics mode, a system management interrupt event may be triggered, at which time a central processor on the electronic device may enter a SMM mode in which system firmware or a basic input output system 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 to enable the operating system to access the graphics processor or update system resource information in a current system resource table that is different from the first target system resource based on the first target system resource.
Or during the process of the graphics processor switching from the graphics mode to the computing mode, a system management interrupt event may be triggered, at which time the central processor on the electronic device may enter the SMM mode, in which system firmware or a basic input output system on the electronic device may configure a second target system resource for the graphics processor. And after configuring the second target system resource for the graphics processor, the second target system resource may also be updated to an operating system of the electronic device to enable the operating system to access the graphics processor or update system resource information in a current system resource table that is different from the second target system resource 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 of memory, VGA controller, I/O interface. Wherein the same system resource for the compute mode and the graphics mode is an "I/O interface" and the different system resources are "memory and controller". When the BIOS sends system resources in computing mode to the operating system, the operating system may only update the memory and controller resources in the current system resource table because the "I/O interface" resources in computing mode and graphics mode are the same. Thus, not only the mode switching speed of the graphics processor but also the response speed of the operating system can be improved.
Fig. 2 is a schematic diagram of a second implementation of the flow of the processing method in the present application, as shown in fig. 2, including:
Step 201, initializing a system;
in step 202, BIOS configures system resources for the GPU.
Here, the BIOS configures the system resource for the GPU to be capable of meeting the system resource requirement of the GPU in different modes. Therefore, the GPU can conveniently acquire the target system resources without re-powering up initialization during mode switching.
Step 203, determining the current working mode of the GPU, and reporting the system resources used by the GPU in the current mode to the OS.
Here, the electronic device may obtain, through a mode switching interface predetermined by the GPU and the BIOS, a current mode parameter value of the GPU, and if the mode parameter value is "1", characterize that a current working mode of the GPU is a computing mode, configure system resources for the GPU in the computing mode, and report the system resources configured by the GPU in the computing mode to the OS, so that the OS accesses the GPU in the computing mode after updating a current system resource list based on the system resources. Therefore, the GPU can be normally used in a resource environment in a computing mode. If the mode parameter value is 0, the current working mode of the GPU is represented as a graphic mode, system resources are configured for the GPU in the graphic mode, and the system resources configured by the GPU 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. Therefore, the GPU can be normally used in a resource environment in a graphics mode.
In step 204, when the gpu mode is switched, the SMI is triggered.
Here, when the user performs mode switching on the GPU, the SMI may be triggered through the mode switching interface defined by the GPU and FW/BIOS to inform 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 the specific operating system, and is entirely controlled by firmware. The SMM mode can only be entered by system management interrupt SMI instructions and can only be exited by execution of RSM instructions. When the CPU detects an SMI event or instruction, the SMM mode is entered because in the SMM mode the BIOS has the highest authority to manage system resources.
In step 206, the BIOS performs mode switching on the GPU, and updates the target system resources configured by the GPU after mode switching into the resource list of the OS.
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 the mode switching, updating the target system resources allocated to the GPU to FW/BIOS and reporting to a resource list of the OS through a mode switching program corresponding to the BIOS, so that the OS can access the GPU after the mode switching based on the target system resources to enable the GPU to reach an optimal state in a resource environment after the mode switching.
In step 207, the cpu exits the SMM mode and the GPU mode switching is completed.
Here, after the BIOS finishes configuring the target system resource for the GPU after the mode switching, and reports the target system resource configured for the GPU after the mode switching to the OS, the CPU detects a system resume instruction (RSM) to exit the SMM mode, and at this time, characterizes that the GPU mode switching is completed.
Under the condition of no hardware cost increase, the system resources of the GPU in different modes can be met by configuring the GPU for the BIOS or FW when the GPU is electrified and initialized, so that the GPU can be freely switched among various modes, a user can also freely shuttle among different application programs, the machine is not required to be restarted for realizing the mode switching of the GPU each time, and the resource configuration is carried out on the GPU after the mode switching based on the system resources reserved by the BIOS for the GPU, thereby not only improving the product competitiveness, but also greatly improving the working efficiency of the user and the mode switching efficiency of the GPU.
FIG. 3 is a schematic diagram showing the structural components of the processing apparatus of the present application, as shown in FIG. 3 blush with shame, which includes:
A configuration unit 301, configured to configure a system resource for a graphics processor, where the system resource can meet a system resource requirement of the graphics processor in different modes;
A sending unit 302, configured to update, when the graphics processor performs mode switching, a system firmware or a target system resource configured by a basic input/output system for the graphics processor to an operating system, so that the graphics processor operates in an updated system resource environment; 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 during an initialization process of the graphics processor;
The configuration unit 301 is specifically configured to configure system resources for the graphics processor based on a preset resource parameter demand table when determining that the graphics processor supports multiple modes based on the attribute information, where the resource parameter demand table stores system resource demand information meeting different modes of the graphics processor.
In a preferred embodiment, the apparatus further comprises: an integration unit 304;
specifically, the determining unit 303 is further configured to determine a system resource requirement of the graphics processor in different modes;
The integrating unit 304 is configured to integrate the 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, through a mode switching interface of the graphics processor, a current mode parameter value 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 a preferred scheme, when the GPU meets a mode switching condition, triggering a system management interrupt event so that the central processor enters a system management mode; the sending unit 302 is specifically configured to update, in the system management mode, the target system resource allocated to the graphics processor to an operating system of the electronic device.
In a preferred embodiment, when the graphics processor switches from the computing mode to the graphics mode, a system management interrupt event is triggered, and the configuration unit 301 is specifically configured to configure, through the system firmware or the bios, a first target system resource for the graphics processor;
Or, when the graphics processor is switched from the graphics mode to the computing mode, triggering a system management interrupt event, where the configuration unit 301 is specifically configured to configure, by using the system firmware or the bios, 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 a preferred embodiment, the sending unit 302 is specifically configured to update a first target system resource to an operating system of the electronic device after configuring the first target system resource for the graphics processor, 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; 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 the mode is switched.
It should be noted that: in the processing device provided in the above embodiment, when the GPU is switched in mode, only the division of each program module is used for illustration, in practical application, 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, so as to complete all or part of the processing described above. In addition, the processing device and the processing method provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the processing device and the processing method are detailed in the method embodiments and are not described herein again.
The embodiment of the application also provides electronic equipment, which comprises: a processor and a memory for storing a computer program capable of running on the processor,
Wherein the processor, when executing the computer program, 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 pattern processor is subjected to pattern switching, updating a target system resource configured by a system firmware or a basic input/output system for the pattern processor to an operating system so that the pattern processor runs in an updated system resource environment; 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 execute, when the computer program is executed: determining attribute information of the graphic processor in the process of initializing the graphic processor; when the graphic processor supports multiple modes 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 different modes of the graphic processor.
The processor is further configured to execute, when the computer program is executed: and determining the system resource requirements of the graphic processor in different modes, and integrating the system resource requirements of the graphic processor in each mode to obtain the resource parameter requirement table.
The processor is further configured to execute, when the computer program is executed: acquiring a current mode parameter value of the graphic processor through a mode switching interface of the graphic processor; a current mode of the graphics processor is determined based on the mode parameter value.
The processor is further configured to execute, when the computer program is executed: triggering a system management interrupt event when the GPU meets a mode switching condition so that the central processing unit enters a system management mode; and in the system management mode, updating the target system resources allocated to the graphic processor to an operating system of the electronic equipment.
The processor is further configured to execute, when the computer program is executed: triggering a system management interrupt event when the graphics processor is switched from a computing mode to a graphics mode, wherein the system firmware or a basic input/output system configures a first target system resource for the graphics processor; or when the graphic processor is switched from the graphic mode to the computing mode, triggering a system management interrupt event, and configuring a second target system resource for the graphic processor by the system firmware or the basic input output system; wherein the first target system resource is at least partially different from the second target system resource.
The processor is further configured to execute, when the computer program is executed: after configuring a 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; 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 execute, when the computer program is executed: reporting the system resources used by the graphic processor in the current mode to an operating system of the electronic device, so that the operating system can at least use the system resources in the current mode after the mode is switched.
Fig. 4 is a schematic diagram showing the structural components of an electronic device 400 according to the present application, which may be a mobile phone, a computer, a digital broadcasting terminal, an information transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc. The electronic device 400 shown in fig. 4 includes: at least one processor 401, a memory 402, at least one network interface 404, and a user interface 403. The various components in electronic device 400 are coupled together by bus system 405. It is understood that the bus system 405 is used to enable connected communications 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. But for clarity of illustration the various buses are labeled as bus system 405 in fig. 4.
The user interface 403 may include, among other things, a display, keyboard, mouse, trackball, click wheel, keys, buttons, touch pad, or touch screen, etc.
It is to be appreciated that memory 402 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. The non-volatile Memory may be, among other things, a Read Only Memory (ROM), a programmable Read Only Memory (PROM, programmable Read-Only Memory), erasable programmable Read-Only Memory (EPROM, erasable Programmable Read-Only Memory), electrically erasable programmable Read-Only Memory (EEPROM, ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory), Magnetic random access Memory (FRAM, ferromagnetic random access Memory), flash Memory (Flash Memory), magnetic surface Memory, optical disk, or compact disk-Only (CD-ROM, compact Disc Read-Only Memory); the magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be random access memory (RAM, random Access Memory) which acts as external cache memory. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM, static Random Access Memory), synchronous static random access memory (SSRAM, synchronous Static Random Access Memory), dynamic random access memory (DRAM, dynamic Random Access Memory), synchronous dynamic random access memory (SDRAM, synchronous Dynamic Random Access Memory), and, Double data rate synchronous dynamic random access memory (DDRSDRAM, double Data Rate Synchronous Dynamic Random Access Memory), enhanced synchronous dynamic random access memory (ESDRAM, enhanced Synchronous Dynamic Random Access Memory), synchronous link dynamic random access memory (SLDRAM, syncLink Dynamic Random Access Memory), Direct memory bus random access memory (DRRAM, direct Rambus Random Access Memory). The memory 402 described in embodiments of the present application is intended to comprise, without being limited to, these and any other suitable types of memory.
The memory 402 in 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 operation on electronic device 400, such as 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, for implementing various basic services and processing hardware-based tasks. The application programs 4022 may include various application programs such as a media player (MEDIA PLAYER), a Browser (Browser), and the like for implementing various application services. A program for implementing the method of the embodiment of the present application may be included in the application program 4022.
The method disclosed in the above embodiment 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 in the processor 401 or by instructions in the form of software. The Processor 401 may be a general purpose Processor, a digital signal Processor (DSP, digital Signal Processor), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. Processor 401 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiment of the application can be directly embodied in the hardware of the decoding processor or can be implemented by combining hardware and software modules in the decoding processor. The software module may be located in a storage medium located in the memory 402, the processor 401 reading information in the memory 402, in combination with its hardware performing the steps of the method described above.
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, programmable Logic Device), complex Programmable logic devices (CPLDs, complex Programmable Logic Device), field-Programmable gate arrays (FPGAs), general purpose processors, controllers, microcontrollers (MCUs, micro Controller Unit), microprocessors (microprocessors), or other electronic elements for performing the aforementioned methods.
In an exemplary embodiment, the present application also provides a computer-readable storage medium, such as a memory 402, comprising a computer program executable by the processor 401 of the electronic device 400 to perform the steps of the aforementioned method. The computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash Memory, magnetic surface Memory, optical disk, or CD-ROM; but may be a variety of devices including one or any combination of the above-described memories, such as a mobile phone, computer, tablet device, personal digital assistant, or the like.
A computer readable storage medium having stored thereon a computer program 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 pattern processor is subjected to pattern switching, updating a target system resource configured by a system firmware or a basic input/output system for the pattern processor to an operating system so that the pattern processor runs in an updated system resource environment; 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 graphic processor in the process of initializing the graphic processor; when the graphic processor supports multiple modes 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 different modes of the graphic processor.
The computer program, when executed by the processor, further performs:
And determining the system resource requirements of the graphic processor in different modes, and integrating the system resource requirements of the graphic 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 graphic processor through a mode switching interface of the graphic processor; a current mode of the graphics processor is determined based on the mode parameter value.
The computer program, when executed by the processor, further performs:
triggering a system management interrupt event when the GPU meets a mode switching condition so that the central processing unit enters a system management mode; and in the system management mode, updating the target system resources allocated to the graphic processor to an operating system of the electronic equipment.
The computer program, when executed by the processor, further performs:
Triggering a system management interrupt event when the graphics processor is switched from a computing mode to a graphics mode, wherein the system firmware or a basic input/output system configures a first target system resource for the graphics processor; or when the graphic processor is switched from the graphic mode to the computing mode, triggering a system management interrupt event, and configuring a second target system resource for the graphic processor by the system firmware or the basic input output system; 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 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; 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 graphic processor in the current mode to an operating system of the electronic device, so that the operating system can at least use the system resources in the current mode after the mode is switched.
In the several embodiments provided by 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 only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The methods disclosed in the method embodiments provided by the application can be arbitrarily combined under the condition of no conflict to obtain a new method embodiment.
The features disclosed in the several product embodiments provided by the application can be combined arbitrarily under the condition of no conflict to obtain new product embodiments.
The features disclosed in the embodiments of the method or the apparatus provided by the application can be arbitrarily combined without conflict to obtain new embodiments of the method or the apparatus.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within 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 (9)

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; wherein the graphics processor supports the different modes, the different modes including a graphics mode and a computing mode;
when the pattern processor is subjected to pattern switching, updating a target system resource configured by a system firmware or a basic input/output system for the pattern processor to an operating system so that the pattern processor runs in an updated system resource environment;
Wherein the target system resource is a system resource required when the graphics processor switches to a target mode;
the configuring system resources for the graphics processor includes:
determining attribute information of the graphic processor in the process of initializing the graphic processor;
When the graphic processor supports multiple modes 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 different modes of the graphic processor.
2. The method of claim 1, further comprising:
And determining the system resource requirements of the graphic processor in different modes, and integrating the system resource requirements of the graphic processor in each mode to obtain the resource parameter requirement table.
3. The method of claim 1, further comprising, prior to the mode switching by the graphics processor: determining a current mode of the graphics processor;
The determining the current mode of the graphics processor includes:
Acquiring a current mode parameter value of the graphic processor through a mode switching interface of the graphic processor;
a current mode of the graphics processor is determined based on the mode parameter value.
4. The method according to claim 3, wherein updating the system firmware or the target system resource configured by the bios for the graphics processor to the operating system when the graphics processor performs mode switching, comprises:
the method comprises the steps that a mode switching condition is met, a system management interrupt event is triggered, and a central processing unit enters a system management mode;
And in the system management mode, updating the target system resources allocated to the graphic processor to an operating system of the electronic equipment.
5. The method of claim 3 or 4, further comprising: configuring target system resources for a graphics processor;
the configuring the target system resource for the graphics processor comprises the following steps:
Triggering a system management interrupt event when the graphics processor is switched from a computing mode to a graphics mode, wherein the system firmware or a basic input/output system configures a first target system resource for the graphics processor; or alternatively, the first and second heat exchangers may be,
Triggering a system management interrupt event when the graphic processor is switched from a graphic mode to a computing mode, wherein the system firmware or the basic input/output system configures a second target system resource for the graphic processor;
Wherein the first target system resource is at least partially different from the second target system resource.
6. The method of claim 5, wherein after configuring the first target system resource for the graphics processor, further comprising:
Updating the first target system resource to an operating system of the electronic device, so that the operating system can access the graphic 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 device, so that the operating system can access the graphic 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.
7. A method according to claim 3, further comprising:
Reporting the system resources used by the graphic processor in the current mode to an operating system of the electronic device, so that the operating system can at least use the system resources in the current mode after the mode is switched.
8. A processing apparatus, comprising:
The configuration unit is used for configuring system resources for the graphic processor, and the system resources can meet the system resource requirements of the graphic processor in different modes; wherein the graphics processor supports the different modes, the different modes including a graphics mode and a computing mode; wherein, the configuring the system resource for the graphics processor includes: determining attribute information of the graphic processor in the process of initializing the graphic processor; when the graphic processor is determined to support multiple modes 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 different modes of the graphic processor;
The sending unit is used for updating the system firmware or the target system resources configured by the basic input/output system for the graphic processor to an operating system when the graphic processor performs mode switching, so that the graphic processor operates in an updated system resource environment; wherein the target system resource is a system resource required when the graphics processor switches to a target mode.
9. 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 of claims 1 to 7 when the computer program is run.
CN202010623298.7A 2020-06-30 2020-06-30 Processing method and device and electronic equipment Active CN111796939B (en)

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 CN111796939A (en) 2020-10-20
CN111796939B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117331676B (en) * 2023-11-30 2024-03-19 上海兆芯集成电路股份有限公司 System management mode entry method, processor and computer system

Citations (6)

* Cited by examiner, † Cited by third party
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
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
CN104462953A (en) * 2013-09-16 2015-03-25 联想(北京)有限公司 Information processing method and electronic equipment
CN107680029A (en) * 2017-08-31 2018-02-09 深圳天珑无线科技有限公司 Image processing method, electronic equipment and the device with store function

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080040524A1 (en) * 2006-08-14 2008-02-14 Zimmer Vincent J System management mode using transactional memory
US8484647B2 (en) * 2009-07-24 2013-07-09 Apple Inc. Selectively adjusting CPU wait mode based on estimation of remaining work before task completion on GPU
CN104516760B (en) * 2014-12-12 2018-01-09 华为技术有限公司 A kind of method, device and mobile terminal of operating system hot-swap

Patent Citations (6)

* Cited by examiner, † Cited by third party
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
CN104462953A (en) * 2013-09-16 2015-03-25 联想(北京)有限公司 Information processing method and electronic equipment
CN107680029A (en) * 2017-08-31 2018-02-09 深圳天珑无线科技有限公司 Image processing method, electronic equipment and the device with store function

Also Published As

Publication number Publication date
CN111796939A (en) 2020-10-20

Similar Documents

Publication Publication Date Title
CN107430424B (en) Techniques for improved hybrid sleep power management
KR101343714B1 (en) Shared nonvolatile memory architecture
CN102236621B (en) Computer interface information configuration system and method
KR20180097674A (en) Memory reclaim method and apparatus
CN105190550A (en) Booting method for computer system with multiple central processing units
CN109313604B (en) Computing system, apparatus, and method for dynamic configuration of compressed virtual memory
US20180365425A1 (en) Systems and methods for securely booting a system on chip via a virtual collated internal memory pool
WO2019020107A1 (en) Method for recognizing a screen-off gesture, and storage medium and terminal thereof
CN111090521A (en) Memory allocation method and device, storage medium and electronic equipment
JP2017519294A (en) Multi-host power controller (MHPC) for flash memory-based storage devices
US20190227918A1 (en) Method for allocating memory resources, chip and non-transitory readable medium
CN111796939B (en) Processing method and device and electronic equipment
JP2011060225A (en) Operating system booting method
CN114647446A (en) Storage-level storage device, computer module and server system
KR102116984B1 (en) Method for controlling memory swap operation and data processing system adopting the same
CN111444117B (en) Method and device for realizing fragmentation of storage space, storage medium and electronic equipment
US20130166852A1 (en) Method for hibernation mechanism and computer system therefor
CN108121572B (en) Web application starting method and device
CN114153642A (en) System detection method and electronic equipment
CN113849494A (en) Data updating method and device
CN113032290A (en) Flash memory configuration method and device, electronic equipment and storage medium
CN117406845B (en) Reset method, reset device, computer equipment and storage medium
CN111177068A (en) Highly-configurable hardware acceleration method and device
CN116737488B (en) Parameter monitoring method and electronic equipment
CN110389705B (en) Computer device, server device, and method for controlling hybrid memory unit thereof

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