Frequency modulation method and electronic equipment
By dynamically adjusting the GPU frequency by detecting application conditions, the power consumption and heating problems of the entire machine caused by the increase in GPU frequency in the prior art are solved, and more efficient electronic device performance and power consumption management are achieved.
Patent Information
- Application Number
- CN202410554669.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-04-29
AI Technical Summary
After the prior art, after the GPU frequency is increased, the power consumption of the entire electronic device increases rapidly, resulting in a deterioration of heating phenomenon and affecting the performance of use.
By detecting the conditions of different applications, dynamically adjusting the GPU frequency, and increasing it to different frequency values for different applications, so as to control the power consumption and heating phenomenon of the entire machine and improve the performance of electronic devices. The specific method includes adjusting the frequency of the GPU based on the application's priority, display size and load conditions after launching different applications in the foreground, adjusting the frequency of the GPU to ensure the operational requirements of high-frequency applications, while reducing power consumption.
It effectively controls the power consumption and heating problems of the entire electronic device, improves the performance, and avoids waste of power consumption and performance degradation caused by excessive frequency.
Smart Images

Figure CN119271029A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a frequency modulation method and electronic device. Background Art
[0002] In electronic devices such as mobile phones and tablets, the graphics processor (Graphics Processing Unit, GPU) is an important device for completing image processing. Among them, image processing can include image rendering and image synthesis. Generally speaking, the higher the frequency of the GPU, the stronger the computing power it provides and the higher the efficiency of image processing. The higher the frequency of the GPU, the weaker the computing power provided by the GPU, and correspondingly, the lower the image processing efficiency. Therefore, electronic devices can meet the efficiency requirements of image processing by adjusting the frequency of the GPU.
[0003] However, in the prior art, after the frequency of the GPU of an electronic device is increased, the power consumption of the entire electronic device may increase rapidly, thereby causing the heating phenomenon of the entire device to worsen, affecting the use of the electronic device. Summary of the invention
[0004] The present application provides a frequency modulation method and an electronic device. When increasing the frequency of a GPU, the frequency can be increased to different values for different applications, thereby controlling the power consumption of the entire electronic device, thereby controlling the heating of the entire device and improving the performance of the electronic device.
[0005] In order to achieve the above purpose, this application adopts the following technical solutions:
[0006] In a first aspect, the present application provides a frequency modulation method, which is applied to an electronic device, and the electronic device includes a graphics processor GPU. The electronic device starts a first application in the foreground. In response to detecting that a frequency increase condition of the GPU is met, the electronic device increases the frequency of the GPU to a first frequency. That is, the upper frequency limit corresponding to the first application is the first frequency. The electronic device starts a second application in the foreground. In response to detecting that the frequency increase condition is met, the electronic device increases the frequency of the GPU to a second frequency. That is, the upper frequency limit corresponding to the second application is the second frequency. Among them, the first application is different from the second application, and the second frequency is different from the first frequency. For example, the first application and the second application can be any two of the A application-H application and the email mailbox mentioned below.
[0007] In summary, by adopting the present application, after the electronic device starts different applications in the foreground, when increasing the GPU frequency, it can be increased to different frequencies. Thus, it can be increased to the appropriate frequency for different applications, rather than uniformly increasing to the highest frequency, which is more conducive to controlling the overall power consumption of the electronic device, worsening the heating phenomenon, and improving the performance of the electronic device.
[0008] In a possible design of the first aspect, in response to detecting that the GPU frequency increase condition is met, the electronic device increases the frequency of the GPU to a second frequency, including: when the second application satisfies the first condition, in response to detecting that the GPU frequency increase condition is met, the electronic device increases the frequency of the GPU to the second frequency.
[0009] The first condition includes at least one of the following: (1) the second application is not an application in the blacklist. The blacklist records applications that do not require frequency modulation, and the second application is not an application in the blacklist, which indicates that the electronic device can use the frequency corresponding to the second application (hereinafter referred to as the upper frequency limit) for frequency modulation. In other words, by adopting (1), the electronic device can increase the frequency of the GPU based on the frequency corresponding to the application outside the blacklist.
[0010] (2) The second application is the application with the largest display size in the foreground. The second application has the largest display size, which means that the GPU processes the largest number of pixels for the second application and has a higher frequency requirement for the GPU. (3) The second application is the application with the highest priority among the applications running in the foreground. The priority matches the load of the application. The higher the application load, the higher the priority and the higher the frequency requirement for the GPU. In other words, by adopting (2) and / or (3), the electronic device can increase the frequency of the GPU based on the frequency corresponding to the application with a higher frequency requirement for the GPU, thereby ensuring the operation of the application with a higher frequency requirement for the GPU.
[0011] In a possible design of the first aspect, after the electronic device starts the second application in the foreground, the method further includes: the electronic device runs the first application and the second application in the foreground. That is, the electronic device can start the first application first, and then start the second application, and after both the first application and the second application are started, the electronic device runs the first application and the second application in the foreground at the same time. Exemplarily, the first application is the A application described below, and the second application is the email box described below; or, the first application is the C application described below, and the second application is the D application described below; or, the first application and the second application are a combination of the E application and the F application described below.
[0012] In the case where the second application does not meet the first condition, in response to detecting that the GPU frequency increase condition is met, the electronic device increases the GPU frequency to the first frequency. That is, when multiple applications are running simultaneously in the electronic device, if the currently launched application (i.e., the second application) does not meet the first condition, the GPU frequency can also be increased based on the frequency corresponding to the previously launched application (i.e., the first application) that is still running in the foreground.
[0013] It should be noted that, since the electronic device increases the GPU frequency based on the first frequency corresponding to the first application before starting the second application, it can be seen that the GPU frequency can be increased using the frequency corresponding to the first application. Therefore, if the second application does not meet the first condition, the GPU frequency can be increased to the first frequency after the frequency increase condition is detected. Conversely, if the first application does not meet the first condition, the GPU frequency cannot be increased to the first frequency if the second application does not meet the first condition.
[0014] It should be noted that in the above two specific design methods, only the second application is introduced. In practice, the first application is also the same, and will not be described here.
[0015] In a possible design of the first aspect, after the electronic device starts the second application in the foreground, the above method also includes: the electronic device runs the second application in the foreground and ends running the first application in the foreground. That is to say, after the electronic device starts the second application in the foreground, the first application is no longer running in the foreground. For example, the first application is a desktop application, and the second application is an application corresponding to an application icon on the desktop, and the application icon on the desktop can trigger entry from the desktop to a certain application. For another example, the first application is application A, application B, application C, etc., and the second application is a desktop application. You can enter the desktop by swiping up from the bottom of the application interface of application A, application B, application C, etc.
[0016] When the second application does not meet the first condition, and the current first application has also exited the foreground, it indicates that the mobile phone is adjusting the GPU frequency based on the frequency corresponding to the first application that has retreated to the background or has been closed, and an application that has retreated to the background or has been closed usually has no image processing requirements, so there is no need to continue to adjust the GPU frequency based on the frequency corresponding to the application that has exited the background or has been closed. At this time, the electronic device can turn off the first switch. After turning off the first switch, the electronic device does not adjust the GPU frequency.
[0017] By adopting this design method, when there is no need for frequency modulation, the frequency modulation of the electronic device can be turned off in time, thereby reducing the power consumption of the electronic device.
[0018] In a possible design of the first aspect, after the electronic device starts the second application in the foreground, the method further includes: the electronic device runs the second application in full screen in the foreground and runs the first application in a floating window in the foreground. That is, at this time, the display size of the second application is the largest, and in response to detecting that the frequency increase condition is met, the electronic device can increase the frequency of the GPU to the second frequency to ensure the operation of the second application that has a higher demand for the GPU frequency.
[0019] After the electronic device increases the frequency of the GPU to the second frequency in response to detecting that the frequency increase condition is met, the method further includes: in response to a first trigger operation (i.e., a switching operation hereinafter), the electronic device runs the first application in full screen in the foreground and runs the second application in a floating window in the foreground. That is, the display size of the first application is switched to the largest. In this case, in response to detecting that the frequency increase condition is met, the electronic device increases the frequency of the GPU to the first frequency.
[0020] In a possible design of the first aspect, after the electronic device starts the second application in the foreground, the method further includes: the electronic device runs the first application and the second application in split screen in the foreground. At this time, if the split screen size of the second application is larger, or the split screen sizes of the first application and the second application are the same, in response to detecting that the frequency increase condition is met, the electronic device can increase the frequency of the GPU to the first frequency. After the electronic device increases the frequency of the GPU to the second frequency in response to detecting that the frequency increase condition is met, the method further includes: in response to a second trigger operation (i.e., an adjustment operation hereinafter), the electronic device adjusts the split screen size of the first application to the first size, and adjusts the split screen size of the second application to the second size, the first size being larger than the second size. That is, after the adjustment, the split screen size of the first application is larger. In this case, in response to detecting that the frequency increase condition is met, the electronic device increases the frequency of the GPU to the first frequency.
[0021] With the above two designs, when the electronic device runs multiple applications in the foreground at the same time, after the application with the largest display size is switched, the electronic device will also switch the frequency upper limit when increasing the GPU frequency, so that the frequency upper limit is consistent with the current largest application, thereby ensuring the operation of applications with higher GPU frequency requirements.
[0022] In a possible design of the first aspect, after the electronic device starts the second application in the foreground, the method further includes: the electronic device runs the first application and the second application in the foreground. In response to detecting that the frequency increase condition is met, the electronic device increases the frequency of the GPU to the second frequency, and the method further includes: in response to a third trigger operation (i.e., triggering an operation to exit the foreground running application), the electronic device ends running the second application in the foreground. In response to detecting that the frequency increase condition is met, the electronic device increases the frequency of the GPU to the first frequency.
[0023] With this design, when multiple applications are running simultaneously in an electronic device, if a second application running in the foreground is exited, the electronic device can restore the GPU frequency to increase based on the frequency corresponding to the first application.
[0024] It should be noted that since the electronic device increases the frequency of the GPU based on the first frequency corresponding to the first application before starting the second application, it can be seen that the frequency of the GPU can be increased using the frequency corresponding to the first application. Therefore, after exiting the second application running in the foreground, the frequency of the GPU can be restored to be increased based on the frequency corresponding to the first application.
[0025] Of course, if there are other applications running in the foreground, the electronic device can increase the frequency of the GPU based on the frequency corresponding to the application with the highest priority and / or the largest display size.
[0026] In a possible design of the first aspect, after the electronic device starts the first application in the foreground, or after the electronic device starts the second application in the foreground, the method further includes: in response to detecting that the GPU frequency reduction condition is met, the electronic device reduces the frequency of the GPU. For example, the electronic device can reduce the frequency of the GPU step by step according to the frequency gear.
[0027] In a possible design of the first aspect, the electronic device stores a correspondence table of application identifiers and frequencies (hereinafter referred to as matching frequencies), such as the table shown in Table 1 below. After the electronic device starts the first application in the foreground, the method further includes: the electronic device queries the application identifier of the first application from the correspondence table, indicating that the first application is a power-sensitive application described below, and the first frequency is the frequency corresponding to the application identifier of the first application in the correspondence table. After the electronic device starts the second application in the foreground, the method further includes: the electronic device does not query the application identifier of the second application from the correspondence table, indicating that the second application is a conventional application described below, and the second frequency is the highest frequency of the GPU, and the second frequency is higher than the first frequency.
[0028] That is to say, with this design, after a power-sensitive application is started, when the electronic device increases the frequency of the GPU, it can increase the frequency of the GPU to a frequency slightly lower than the maximum frequency, thereby avoiding the phenomenon of heat deterioration, and ensuring the performance of the electronic device while increasing the GPU frequency.
[0029] In a possible design of the first aspect, the electronic device further includes an image synthesis processing service, an accelerated graphics interface service, a display driver, and a hardware overlay HWC. After the electronic device starts the second application in the foreground, the upper limit of the frequency of the GPU frequency can be determined by the following steps:
[0030] The second application applies to the image synthesis processing service layer, and the layer application includes the application identifier of the second application. The image synthesis processing service obtains the application identifier of the second application from the layer application, and sends the application identifier of the second application to the accelerated image interface service. The accelerated image interface service detects whether the second application meets the first condition based on the application identifier of the second application. If the second application meets the first condition, the accelerated image interface service queries the application identifier of the second application from the correspondence table, and the correspondence table includes the correspondence between the application identifier and the frequency. If the application identifier of the second application is queried from the correspondence table, the frequency corresponding to the application identifier of the second application is obtained from the correspondence table, and the frequency corresponding to the identifier of the second application is sent to the display driver, that is, the upper limit of the frequency is the frequency corresponding to the application identifier of the second application in the correspondence table. If the application identifier of the second application is not queried from the correspondence table, the highest frequency of the GPU is sent to the display driver, that is, the upper limit of the frequency is the highest frequency. In other words, the electronic device can make a decision on the upper limit of the frequency through the accelerated image interface service, and does not always decide on the highest frequency.
[0031] In addition, the display driver can also detect whether the frequency increase condition is met. In response to detecting that the frequency increase condition is met, the electronic device increases the frequency of the GPU to the second frequency, including: in response to detecting that the frequency increase condition is met, the display driver sends a frequency increase message to the HWC, the frequency increase message includes the frequency corresponding to the identifier of the second application or the maximum frequency, and the second frequency includes the frequency corresponding to the identifier of the second application or the maximum frequency. The HWC increases the frequency of the GPU to the second frequency. In this way, the HWC can increase the frequency of the GPU according to the frequency upper limit, rather than increasing it to the maximum frequency every time.
[0032] In a second aspect, the present application further provides an electronic device, the electronic device comprising a display screen, a memory and one or more processors. The display screen, the memory and the processor are coupled. The memory is used to store computer program code, the computer program code comprising computer instructions, when the computer instructions are executed by the processor, the electronic device executes the method in the first aspect and any possible design thereof.
[0033] In a third aspect, the present application provides a chip system, which is applied to an electronic device including a display screen and a memory; the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through lines; the interface circuit is used to receive signals from the memory of the electronic device and send signals to the processor, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device executes the method as in the first aspect and any possible design method thereof.
[0034] In a fourth aspect, the present application provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method of the first aspect and any possible design thereof.
[0035] In a fifth aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method of the first aspect and any possible design thereof.
[0036] It can be understood that the beneficial effects that can be achieved by the electronic device of the second aspect, the chip system of the third aspect, the computer storage medium of the fourth aspect, and the computer program product of the fifth aspect provided above can be referred to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 One of the application schematic diagrams of the frequency modulation method provided in the embodiment of the present application;
[0038] Figure 2 A scene graph for running multiple applications in the foreground provided in an embodiment of the present application;
[0039] Figure 3 The second application diagram of the frequency modulation method provided in the embodiment of the present application;
[0040] Figure 4 A flow chart of a frequency modulation method provided in an embodiment of the present application;
[0041] Figure 5 is a flow chart of a frequency modulation method;
[0042] Figure 6 The third application diagram of the frequency modulation method provided in the embodiment of the present application;
[0043] Figure 7 A fourth application diagram of the frequency modulation method provided in an embodiment of the present application;
[0044] Figure 8 The fifth application diagram of the frequency modulation method provided in the embodiment of the present application;
[0045] Fig. 9 The sixth application diagram of the frequency modulation method provided in the embodiment of the present application;
[0046] Fig.10 A diagram of the software and hardware architecture of a mobile phone provided in an embodiment of the present application;
[0047] Fig.11 A timing interaction diagram of the frequency modulation method provided in an embodiment of the present application;
[0048] Fig.12 is a schematic diagram of an image processing process;
[0049] Fig.13 A corresponding relationship diagram between frequency gears and frequency values provided in an embodiment of the present application;
[0050] Fig.14 A schematic diagram of the principle of determining the frequency increase timing provided in an embodiment of the present application;
[0051] Fig.15 A schematic diagram of the principle of determining the timing of frequency reduction provided in an embodiment of the present application;
[0052] Fig.16 An example frequency modulation diagram provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The technical solutions in the embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in a "or" relationship.
[0054] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
[0055] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
[0056] The frequency modulation method provided in the embodiment of the present application can be applied to scenarios in which the GPU is required for image processing in electronic devices, including scenarios in which the GPU is required for image rendering and image synthesis. It should be noted that: Under normal circumstances, the hardware composer (HWC) in electronic devices can only complete some simple image synthesis tasks, and complex image synthesis also requires the participation of the GPU. For example, in game applications, the GPU is required to participate in image rendering and image synthesis to obtain multiple frames of game screens. For another example, in a video player, the GPU is required to participate in image rendering and image synthesis to obtain multiple video frames. For another example, when displaying motion effects, the GPU may also be required to participate in image rendering and image synthesis to obtain multiple motion effect frames.
[0057] In the above scenario, the electronic device can adjust the frequency of the GPU to meet the needs of image processing by using the frequency modulation method provided in the embodiment of the present application. In some embodiments, after detecting that the GPU cannot complete the image processing task in time, the electronic device can increase the frequency of the GPU to the highest frequency so that the GPU can provide sufficient computing power to complete the image processing in time.
[0058] It is understandable that after increasing the GPU frequency, the power consumption of the electronic device will also increase. In practice, when different applications are running, increasing the GPU frequency has different effects on the power consumption of the electronic device, and further has different effects on the application experience.
[0059] Take the comparison between a game app and a video player as an example:
[0060] When running game applications, after the electronic device increases the GPU frequency to the highest frequency, the power consumption of the electronic device will increase rapidly, causing the temperature of the electronic device to rise rapidly and generate significant heat. When the heating phenomenon worsens, such as when the temperature rises to the preset temperature value, the electronic device will limit the GPU frequency to a lower value, commonly known as thermal frequency limiting. After thermal frequency limiting, the game application may experience frame drops and freezes due to insufficient GPU frequency.
[0061] When the video player is running, after the electronic device increases the GPU frequency to the highest frequency, the power consumption of the electronic device will not increase significantly, nor will the temperature of the electronic device rise rapidly. In this case, it will not quickly enter the thermal limit frequency, so the video player can run smoothly without frame loss or lag.
[0062] For the sake of convenience, applications such as the above-mentioned game applications that have a greater impact on the power consumption of the entire machine can be called power-sensitive applications, while applications such as the above-mentioned video player that have a smaller impact on the power consumption of the entire machine can be called regular applications.
[0063] That is to say, during the operation of power-sensitive applications, after the GPU frequency is increased to the highest frequency, it may affect the user experience of power-sensitive applications, such as frame drops and freezes.
[0064] Based on the above problems, an embodiment of the present application provides a frequency modulation method. After starting an application (referred to as a target application, including the above-mentioned power-sensitive applications or conventional applications), when the electronic device increases the frequency of the GPU, it can increase the frequency of the GPU to the matching frequency corresponding to the target application, rather than increasing it to the maximum frequency. Among them, the matching frequency can meet the following two conditions: meet the image processing requirements of the target application, and will not significantly increase the power consumption of the entire machine. For example, the matching frequency corresponding to the power-sensitive application is lower than the matching frequency corresponding to the conventional application (ie, the maximum frequency). In this way, for each application, after increasing the frequency of the GPU, the user's experience of the application will not be reduced due to a significant increase in power consumption.
[0065] Generally, when the application interface of an application is displayed in the foreground, the GPU is required to perform image processing on the application. Accordingly, launching the application in this article refers to launching the application in the foreground, that is, running in the foreground and displaying the application interface after launching.
[0066] Exemplarily, the electronic device in the embodiment of the present application can be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, and a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) and a virtual reality (VR) device, etc., which support display functions. The embodiment of the present application does not impose any special restrictions on the specific form of the electronic device. Hereinafter, the present application scheme will be mainly explained by taking the electronic device as an example of a mobile phone.
[0067] After starting the target application, the mobile phone can obtain the application identifier of the target application and decide the matching frequency corresponding to the target application based on the application identifier. The application identifier can be an application name, an application package name, etc. In the following, the application package name is mainly used as an example. For the sake of convenience, the application package name of the target application can be recorded as the target package name.
[0068] Exemplarily, the mobile phone records the application package name of each sensitive application among multiple power-sensitive applications installed in the mobile phone and its corresponding matching frequency. For example, the mobile phone records the data shown in the following Table 1:
[0069] Table 1
[0070] Application package name Matching frequency AAAAA f1 BBBBB f2 CCCCC f3 DDDDD f4
[0071] After obtaining the target package name, the mobile phone can query the target package name from the above data recorded by the mobile phone. If the target package name is queried, it indicates that the target application is a power-sensitive application. The mobile phone can obtain the matching frequency corresponding to the target package name, thereby obtaining the matching frequency corresponding to the target application. For example, the target package name is "AAAAA", and the mobile phone can query Table 1 above to obtain the frequency f1 corresponding to the target application. Conversely, if the target package name is not queried, it indicates that the target application is a regular application, and the mobile phone can obtain the matching frequency corresponding to the target application as the highest frequency. For example, if the target package name is "EEEEE", the mobile phone queries the application package name in Table 1 above and does not include "EEEEE", and can obtain the matching frequency corresponding to the target application as the highest frequency.
[0072] Of course, the mobile phone can also record the application package name of the regular application and the corresponding highest frequency. If the target application is a regular application, the mobile phone can query the highest frequency corresponding to the target package name, so that the matching frequency corresponding to the target application is the highest frequency.
[0073] The matching frequencies corresponding to different power-sensitive applications may be different. For example, f1 and f2 in Table 1 above are different, indicating that the matching power corresponding to the power-sensitive application indicated by "AAAAA" is different from that of the power-sensitive application indicated by "BBBBB". Generally, the heavier the load of the power-sensitive application, the higher the matching frequency, so that the matching frequency can meet the application load requirements. For example, "AAAAA" indicates an application installed in the mobile phone, such as application A, and "BBBBB" indicates another application installed in the mobile phone, such as application B. Both application A and application B are power-sensitive applications, but the screen of application A is more complex, the frame rate is higher, and the image processing load is higher, while the screen of application B is simpler, the frame rate is lower, and the image processing load is lower. In this case, the matching frequency f1 corresponding to "AAAAA" can be set higher than the matching frequency f2 corresponding to "BBBBB".
[0074] See also Figure 1 For example, application A and application B are two different game applications. The screen of application A is shown in interface 101, and the screen of application B is shown in interface 102. Interface 101 is more complex than interface 102. When application A is running, if the frequency needs to be increased, it can be increased to f1. When application B is running, if the frequency needs to be increased, it can be increased to f2. f1>f2.
[0075] At this point, it should be noted that the timing of increasing the frequency can be found in the following Figure 12-Figure 15 And its related instructions, I will not go into details here.
[0076] The mobile phone can run one or more applications in the foreground. The more applications running at the same time, the heavier the image processing tasks that require the GPU to participate, and the higher the frequency requirement for the GPU.
[0077] When a mobile phone runs an application in the foreground, such as running an application in full screen, the GPU is mainly used for image processing of the application. Figure 1 The mobile phone can display interface 101 or interface 102. The application interface of application A is displayed in full screen in interface 101, and the application interface of application B is displayed in full screen in interface 102. That is, the mobile phone runs one application in full screen, and the GPU is mainly used for image processing of one application.
[0078] When a mobile phone runs multiple applications in the foreground, such as running multiple applications in split screen or floating window form, the GPU is used for image processing of multiple applications. Figure 2 In response to the user sliding operation from the right edge of interface 201 (same as interface 101 above) to the left (as indicated by the arrow in interface 201), the mobile phone can display interface 202, which includes application interface 2021 of application A and pop-up window 2022. Pop-up window 222 includes application icons of multiple quick applications, such as application icon 2023 of collection space, application icon 2024 of email, and application icon 2025 of notes. In response to the user clicking on the application icon of any quick application, the mobile phone can further display the application interface of any quick application in the form of a floating window. Taking any quick application as an example, in response to the user clicking on the application icon 224 of email in interface 202, the mobile phone can display interface 203. Interface 203 still includes application interface 2021 of application A, and also includes application interface 2032 of email displayed in floating window 2031, that is, the mobile phone runs two applications, application A and email, in the foreground, and the GPU is used for image processing of application A and email.
[0079] It should be noted that running application A and an email in the foreground is only a specific example. In practice, a large number of applications installed on a mobile phone can be run in the foreground at the same time, such as game applications, chat applications, shopping applications, video players, etc. Multiple applications can be run in the foreground in a floating window form or split screen form at the same time.
[0080] In combination with the above-mentioned case of running one application and the case of running multiple applications, in some embodiments, the mobile phone can set the matching frequency corresponding to the power-sensitive application based on the demand for the GPU frequency when running multiple applications. Among them, for any power-sensitive application, the mobile phone can set the matching frequency so that the matching frequency meets the following conditions: greater than or equal to the GPU frequency required by multiple applications including the power-sensitive application when running in the foreground at the same time.
[0081] Take application A as an example: when the mobile phone runs application A in the foreground, the required GPU frequency (which can be the highest frequency, average frequency, etc., the same applies below) is f5. When the mobile phone runs application A in the foreground and runs the email in the floating window, the required GPU frequency is f6. And, when the mobile phone runs application A and email in the foreground split screen, the required GPU frequency is f7. Correspondingly, the matching frequency corresponding to "AAAAA" indicating application A in Table 1 above can be the highest frequency f6 among f5, f6 and f7, or a frequency higher than f6. In this way, after starting application A, when increasing the GPU frequency, it can be increased to f1, so that even if multiple applications including application A are running in the foreground, the GPU frequency is sufficient.
[0082] Although the phone can run multiple applications in the foreground, at the same time, the phone will adjust the GPU frequency based on the frequency cap corresponding to one of the applications, rather than adjusting the GPU frequency based on multiple frequency caps corresponding to multiple applications, to avoid frequency adjustment confusion. It should be noted that the frequency cap here is not the same as the matching frequency mentioned above. If the application is a power-sensitive application, the frequency cap corresponding to the application refers to the matching frequency. If the application is a regular application, the frequency cap corresponding to the application refers to the maximum frequency.
[0083] Continue to see Figure 2 , the mobile phone can display interface 203, that is, the multiple applications running in the foreground include application A and email. The mobile phone can increase the frequency of the GPU based on the frequency upper limit corresponding to application A (such as f1), but will not increase the frequency of the GPU based on the frequency upper limit corresponding to application A (such as f1) and the frequency upper limit corresponding to the email (such as the maximum frequency) respectively, so as to avoid confusion in the frequency adjustment of the GPU.
[0084] In some embodiments, the mobile phone may decide whether to adjust the frequency of the GPU based on the frequency upper limit corresponding to the target application based on at least one of the following: a trigger start method of the target application and a priority ranking of the target application.
[0085] First, the triggering method of the target application.
[0086] Among them, the trigger start method includes but is not limited to at least one of the following: performing a trigger operation (such as a click operation) on the application icon of the target application on the desktop to trigger the start of the target application (recorded as method 1), performing a trigger operation (such as a click operation) on the shortcut icon of the target application in the pop-up window (such as the pop-up window 2022 in the interface 202) to trigger the start of the target application (recorded as method 2), and performing a trigger operation (such as a click operation) on the interface thumbnail of the target application in the multi-tasking interface to trigger the start of the target application (recorded as method 3).
[0087] Different triggering modes can trigger the mobile phone to run the target application in different forms (such as full screen, floating window, etc.). For example, in response to mode 1 or mode 3, the mobile phone can run the target application in full screen, such as Figure 1 In the interface 101, application A is running in full screen, and in the interface 102, application B is running in full screen. In another exemplary embodiment, in response to mode 2, the mobile phone can run the target application in a floating window, such as Figure 2 In the interface 203 shown, the email mailbox is running in the floating window 2031.
[0088] It is understandable that the number of pixels that the GPU needs to process when processing images varies depending on the target application running in different forms, and accordingly, the requirements for the GPU frequency are different. Among them, the display size is the largest when running in full screen mode, and the number of pixels that the GPU needs to process is also the largest; the display size when running in floating window mode is smaller than the display size when running in full screen mode, and the number of pixels that the GPU needs to process is also less.
[0089] When the mobile phone decides whether to adjust the frequency of the GPU based on the upper frequency limit corresponding to the target application based on the trigger start method of the target application, the following method can be used to decide: If the trigger start method, such as method 1 or method 3, triggers the mobile phone to run the target application in full screen form, it means that the display size of the target application is the largest when it is running, and the number of pixels that the GPU needs to process is also the largest. The mobile phone can adjust the frequency of the GPU based on the upper frequency limit corresponding to the target application. If the trigger start method, such as method 2, triggers the mobile phone to run the target application in a floating window form, it means that the display size of the target application is not the largest when it is running, and the number of pixels that the GPU needs to process is not the largest. The mobile phone may not adjust the frequency of the GPU based on the upper frequency limit corresponding to the target application. In this way, the mobile phone can always adjust the frequency of the GPU based on the upper frequency limit corresponding to the application that has higher requirements for the GPU frequency, thereby ensuring the operation of applications that have higher requirements for the GPU frequency.
[0090] For example, use method 1 to trigger the start of application A, and then use method 2 to trigger the start of email. Figure 3 :The mobile phone can display interface 301, which is the desktop of the mobile phone. Interface 301 includes application icon 3011 of application A. In response to the user clicking the application icon 3011 in interface 301 (i.e., in response to method 1), the mobile phone can start application A, that is, the current target application is application A. In addition, since method 1 can trigger the mobile phone to run the target application in full screen, such as the application interface of application A displayed in full screen in interface 101, the mobile phone can adjust the frequency of the GPU based on the frequency upper limit (e.g., f1) corresponding to application A. Figure 3 It should be noted that compared with interface 301, interface 101 is switched from a vertical screen to a horizontal screen. Subsequently, in response to the user calling out a pop-up window from interface 101 and then clicking on the application icon of the email in the pop-up window (i.e., in response to method 2, see the details of Figure 2 ), the mobile phone can start the email, that is, the current target application is the email. In addition, since method 2 can trigger the mobile phone to run the target application in a floating window, such as the application interface 2032 of the email displayed in the floating window 2031 in interface 203, the mobile phone will not adjust the GPU frequency based on the operation of the email, but will continue to adjust the GPU frequency based on the frequency upper limit (such as f1) corresponding to application A.
[0091] Of course, in addition to the aforementioned trigger start method, there are some other trigger start methods that can trigger the mobile phone to run the target application in split-screen form. In the case of running in split-screen form, the larger the size of the split screen, the more pixels the GPU needs to process, and the smaller the size of the split screen, the fewer pixels the GPU needs to process. Based on this, when the mobile phone decides whether to adjust the frequency of the GPU based on the upper frequency limit corresponding to the target application based on the trigger start method of the target application, it can also adopt the following method to decide: If the trigger start method triggers the mobile phone to run the target application in split-screen form, and the split-screen size of the target application is the largest, the number of pixels that the GPU needs to process is also the largest, and the mobile phone can adjust the frequency of the GPU based on the upper frequency limit corresponding to the target application. If the trigger start method triggers the mobile phone to run the target application in split-screen form, but the split-screen size of the target application is not the largest, and the number of pixels that the GPU needs to process is not the largest, the mobile phone may not adjust the frequency of the GPU based on the upper frequency limit corresponding to the target application.
[0092] In addition, if the screen is evenly split, that is, the sizes of the split screens are equal, such as an even two-split screen, the number of pixels that the GPU needs to process is the same. Further, if the trigger start method triggers the mobile phone to run the target application in split screen form, and the split screen size of the target application is the same as the split screen size of other applications, the mobile phone can adjust the frequency of the GPU based on the frequency upper limit corresponding to any application in the multiple applications (including the currently launched target application or other applications).
[0093] Second, the priority order of applications.
[0094] The priority order can be matched with the load of the application. Generally, the heavier the load of the application, the higher the demand for the GPU frequency, and the higher the priority can be set; the lighter the load of the application, the lower the demand for the GPU frequency, and the lower the priority can be set. For example, if the load of application A is heavier than that of application B, the priority of application A is higher than that of application B.
[0095] The mobile phone may record the priority of the applications installed in the mobile phone. For example, the mobile phone may record the following priority order: AAAAA, BBBBB, CCCCC, DDDDD, which represent the application package names of the applications with the highest priority to the lowest.
[0096] When the mobile phone decides whether to adjust the frequency of the GPU based on the frequency upper limit corresponding to the target application based on the trigger start mode of the target application, the decision can be made in the following way: If the target application has the highest priority among the applications running in the foreground, it means that the target application has the highest demand for the frequency of the GPU, and the mobile phone can adjust the frequency of the GPU based on the frequency upper limit corresponding to the target application. If the target application does not have the highest priority among the applications running in the foreground, it means that the target application does not have the highest demand for the frequency of the GPU, and the mobile phone may not adjust the frequency of the GPU based on the frequency upper limit corresponding to the target application. In this way, the mobile phone can preferentially adjust the frequency of the GPU based on the frequency upper limit corresponding to the application that has a higher requirement for the frequency of the GPU, thereby ensuring the operation of the application that has a higher requirement for the frequency of the GPU.
[0097] For example, if the priority of application A is higher than that of email, the phone starts application A and runs it in full screen. At this time, only application A is running in the foreground. Then application A (the current target application) is naturally the application with the highest priority among the applications running in the foreground. The phone can adjust the frequency of the GPU based on the frequency upper limit corresponding to application A. Subsequently, the phone starts email and runs email in a floating window. At this time, application A and email are running in the foreground, and the priority of email is lower than that of application A. This indicates that email (the current target application) is not the application with the highest priority among the applications running in the foreground. The phone does not adjust the frequency of the GPU based on the frequency upper limit corresponding to email, but continues to adjust the frequency of the GPU based on the frequency upper limit corresponding to application A.
[0098] At this point, it should be noted that: in other embodiments, the mobile phone can also decide whether to adjust the frequency of the GPU based on the frequency upper limit corresponding to the target application in combination with the trigger start method of the target application and the priority order of the application. Exemplarily, if the trigger start method triggers the mobile phone to run the target application in split-screen form, the mobile phone can decide whether to adjust the frequency of the GPU based on the frequency upper limit corresponding to the target application based on the priority of multiple applications. In addition, if the trigger start method triggers the mobile phone to run the target application in full screen or floating window form, the mobile phone can trigger the start method to decide whether to adjust the frequency of the GPU based on the frequency upper limit corresponding to the target application.
[0099] In addition, some applications may not require GPU for image processing, which are referred to as non-frequency modulation applications in the following. Based on this, in some embodiments, the mobile phone can record a blacklist of non-frequency modulation applications. After starting the target application, the mobile phone can detect whether the target application is in the blacklist. If the target application is in the blacklist, the mobile phone can decide not to adjust the frequency to the upper limit of the frequency corresponding to the target application.
[0100] In order to facilitate the understanding of the above embodiments, Figure 4The simple flowchart shown below summarizes the overall process of deciding the frequency cap after launching the target application. Figure 4 The overall process includes:
[0101] S401. The mobile phone starts the target application.
[0102] Exemplarily, the target application can be started in response to the above-mentioned method 1, method 2, method 3, etc.
[0103] S402: The mobile phone obtains the target package name of the target application.
[0104] S403: The mobile phone determines whether the target package name is in the blacklist. If yes, execute S408; if no, execute S404.
[0105] The blacklist includes application package names of applications that do not modulate the frequency.
[0106] If the target package name is in the blacklist, it indicates that the target application is a non-frequency modulation application, and the mobile phone will not adjust the GPU frequency based on the frequency upper limit corresponding to the target application. In this case, S408 can be executed to accurately control the closing of the frequency modulation scheme. If the target package name is not in the blacklist, it indicates that the target application is not a non-frequency modulation (i.e., frequency modulation) application, and the mobile phone can execute the following S404 to further decide whether to adjust the GPU frequency based on the frequency upper limit corresponding to the target application.
[0107] S404: The mobile phone decides whether to adjust the frequency of the GPU based on the upper frequency limit corresponding to the target application. If yes, execute S405; if no, execute S408.
[0108] For example, the mobile phone can decide whether to adjust the GPU frequency based on the frequency upper limit corresponding to the target application based on the triggering and starting method of the target application and the priority order of the application, so as to ensure the operation of applications with higher requirements for the GPU frequency. For details, please refer to the relevant descriptions of "First, the triggering and starting method of the target application" and "Second, the priority order of the application" above, which will not be repeated here.
[0109] If it is decided to adjust the frequency of the GPU based on the upper frequency limit corresponding to the target application, it indicates that the frequency modulation scheme is to be used to adjust the frequency of the GPU, and the mobile phone can execute the following S405 and subsequent steps to determine the upper frequency limit corresponding to the target application and perform frequency modulation. Otherwise, the mobile phone does not adjust the frequency of the GPU based on the upper frequency limit corresponding to the target application, and in this case, S408 can also be executed to accurately control the closing of the frequency modulation scheme.
[0110] S405: The mobile phone detects whether the target package name is in the list of power-sensitive applications. If yes, execute S406; if no, execute S407.
[0111] Exemplarily, the list of power-sensitive applications is included in Table 1 above, such as "AAAAA"-"DDDDD". If the target package name is in Table 1, it indicates that the target application is a power-sensitive application. If the target package name is not in Table 1, it indicates that the target application is not a power-sensitive application, that is, a regular application. Of course, a list of power-sensitive applications can also be recorded separately in the mobile phone for detection, and this application does not make specific limitations on this.
[0112] If the target application is a power-sensitive application, the mobile phone may execute the following S406 to adjust the frequency of the GPU. If the target application is not a power-sensitive application, that is, a regular application, the mobile phone may execute the following S407 to adjust the frequency of the GPU.
[0113] S406: The mobile phone queries the matching frequency corresponding to the target application based on the target package name, and adjusts the frequency of the GPU based on the matching frequency corresponding to the target application.
[0114] Among them, when it is detected that the frequency increase conditions are met, that is, when there is a frequency increase demand, the mobile phone can increase the GPU frequency to the matching frequency corresponding to the target application.
[0115] For example, the mobile phone can query Table 1 above to obtain the matching frequency corresponding to the target application, thereby obtaining the upper frequency limit. If it is detected that the frequency increase condition is met, such as the target application losing frames due to failure to complete the image processing task in time, the mobile phone can adjust the GPU frequency to the matching frequency corresponding to the target application.
[0116] S407. The mobile phone adjusts the frequency of the GPU based on the highest frequency.
[0117] That is, the upper frequency limit is the maximum frequency. Similarly, when the conditions for frequency increase are detected, the phone can increase the GPU frequency to the maximum frequency.
[0118] It should be noted that when it is detected that the frequency reduction conditions are met, the mobile phone can also reduce the frequency of the GPU, such as reducing the frequency of the GPU step by step, reducing the frequency of the GPU according to the degree of frame loss, etc. The embodiment of the present application does not make specific limitations on this.
[0119] Of course, after S404 decides to adjust the frequency of the GPU based on the frequency upper limit corresponding to the target application, the mobile phone can also detect whether the mobile phone is executing the frequency adjustment scheme. If the frequency adjustment scheme is not executed, the frequency adjustment scheme can be turned on, and then the mobile phone can execute S406 and S407 to adjust the frequency of the GPU. If the frequency adjustment scheme is executed, there is no need to repeatedly turn on the frequency adjustment scheme, and only the frequency of the GPU needs to be adjusted based on the frequency upper limit decided this time.
[0120] S408: The mobile phone detects whether the frequency modulation scheme is being executed. If so, S409 is executed; if not, the process of closing the frequency modulation scheme is not executed.
[0121] Considering that a mobile phone can run multiple applications in the foreground, if the frequency modulation scheme is being executed, the frequency modulation is not directly turned off, but S409 can be executed to further detect whether the conditions for turning off the frequency modulation scheme are met.
[0122] If the adjustment scheme is not executed, it indicates that the frequency modulation scheme has been turned off, and the mobile phone does not need to repeatedly execute the process of turning off the frequency modulation scheme, that is, the process of turning off the frequency modulation scheme may not be executed.
[0123] S409, the mobile phone detects whether the frequency of the GPU is adjusted based on the frequency upper limit corresponding to any application running in the foreground. If so, the frequency adjustment scheme is not closed; if not, S410 is executed.
[0124] If the phone adjusts the frequency of the GPU based on the frequency cap corresponding to any application running in the foreground, the phone can continue to execute the frequency adjustment scheme, and there is no need to turn off the frequency adjustment scheme.
[0125] If the mobile phone does not adjust the GPU frequency based on the frequency upper limit corresponding to any application running in the foreground, it means that the mobile phone may be adjusting the GPU frequency based on the frequency upper limit corresponding to an application that has been retreated to the background or has been closed. An application that has been retreated to the background or closed usually has no image processing requirements. There is no need to continue to adjust the GPU frequency based on the frequency upper limit corresponding to the application that has retreated to the background. S410 can be executed to turn off the frequency regulation scheme.
[0126] In some embodiments, the mobile phone may record a list of package names of applications running in the foreground. Also, the mobile phone may record a frequency modulation package name, which refers to the package name of the application corresponding to the frequency cap. The mobile phone may query the frequency modulation package name in the package name list. If the frequency modulation package name is found, it indicates that the mobile phone is adjusting the frequency of the GPU based on the frequency cap corresponding to an application running in the foreground. If the frequency modulation package name is not found, it indicates that the mobile phone has not adjusted the frequency of the GPU based on the frequency cap corresponding to any application running in the foreground.
[0127] Furthermore, when a new application is started in the foreground, the mobile phone can add the corresponding application package name to the package name list; when an application exits the foreground, the mobile phone can delete the corresponding application package name from the package name list, so that the application package name is consistent with the application running in the foreground of the mobile phone.
[0128] Furthermore, each time a decision is made to adjust the GPU frequency based on the frequency upper limit corresponding to the target application, the frequency adjustment package name is updated to the application package name of the target application; each time a frequency adjustment scheme is closed, the frequency adjustment package name is deleted, so that the frequency adjustment package name is consistent with the actual frequency upper limit based on which the frequency adjustment is based.
[0129] S410, turn off the FM scheme on the mobile phone.
[0130] In this way, the mobile phone can ensure that the frequency modulation scheme is turned off when the mobile phone does not turn off the frequency modulation scheme and the mobile phone adjusts the frequency of the GPU based on the frequency upper limit corresponding to an application exited to the background.
[0131] In some embodiments, the mobile phone may record the switch state of the frequency modulation scheme, and the switch state is initially the off state.
[0132] In the case where frequency modulation is required, for example, after an application is started and S404 is used to decide to adjust the frequency of the GPU based on the frequency upper limit corresponding to the currently started target application, the mobile phone can update the switch state to the on state and use the frequency modulation scheme to adjust the frequency based on the frequency upper limit. In this way, the on state can indicate that the frequency modulation scheme has been turned on.
[0133] In the case where the frequency modulation scheme needs to be turned off, if the detection result in S409 is negative, the mobile phone can update the switch state to the off state and turn off the frequency modulation scheme. In this way, the off state can indicate that the frequency modulation scheme has been turned off.
[0134] In this way, in the above S408, the mobile phone can accurately obtain the operation status of the frequency modulation scheme through the switch status.
[0135] It should be noted that in actual implementation, the mobile phone may also execute S409 first and then execute S408. Specifically, execute S409 first, and the mobile phone detects whether the frequency of the GPU is adjusted based on the frequency upper limit corresponding to any application running in the foreground. If so, the frequency modulation scheme will not be turned off. If not, it indicates that the mobile phone may be adjusting the frequency of the GPU based on the frequency upper limit corresponding to an application exited to the background, or the frequency modulation scheme may have been turned off, then: execute S408, and the mobile phone detects whether the frequency modulation scheme is being executed. If so, it indicates that the mobile phone is adjusting the frequency of the GPU based on the frequency upper limit corresponding to an application exited to the background, then execute S410 and turn off the frequency modulation scheme. If not, it indicates that the frequency modulation scheme has been turned off, and the frequency modulation scheme will not be turned off repeatedly.
[0136] Of course, if the problem of repeatedly shutting down the FM scheme is not considered, the mobile phone may not execute S408, and will not shut down the FM scheme if the detection result of S409 is yes, and will shut down the FM scheme if the detection result of S409 is no.
[0137] The following is still combined with the previous Figure 3 , and further describes the situation in which application A and email are different. Figure 4 Effects of the embodiment:
[0138] Example 1: For example, neither application A nor email is in the blacklist, and application A is a power-sensitive application, while email is a regular application.
[0139] Execute S401, the mobile phone starts application A; execute S402, the mobile phone obtains the target package name "AAAAA" of application A; execute S403, the mobile phone determines that "AAAAA" is not in the blacklist; execute S404, application A runs in full screen, and the mobile phone can decide to adjust the frequency of GPU based on the frequency upper limit corresponding to application A; execute S405, the mobile phone detects that "AAAAA" is in the list of power-sensitive applications shown in Table 1 above; execute S406, the mobile phone queries the matching rate f1 corresponding to "AAAAA" from Table 1 above, that is, the frequency upper limit corresponding to application A is f1, and the mobile phone can adjust the frequency of GPU based on f1, for example, when the frequency needs to be increased, the frequency of GPU is increased to f1 instead of the highest frequency.
[0140] Execute S401, the mobile phone starts the email mailbox; execute S402, the mobile phone obtains the target package name of the email mailbox, such as "EEEEE"; execute S403, the mobile phone determines that "EEEEE" is not in the blacklist; execute S404, the email mailbox is running in the floating window, and the A application is running in full screen at this time, the mobile phone can decide not to adjust the frequency of the GPU based on the frequency upper limit corresponding to the email mailbox; execute S408, the mobile phone detects that the A application running in the foreground is not in the blacklist, which indicates that the mobile phone can adjust the frequency of the GPU based on the frequency upper limit f1 corresponding to the A application, so the mobile phone will not turn off the frequency modulation scheme.
[0141] Example 2: Take application A as an example, which is not an application in the blacklist, application A is a power-sensitive application, and email is an application in the blacklist.
[0142] As in Example 1, S401 - S406 are executed to adjust the frequency of the GPU based on the frequency upper limit f1 corresponding to the A application.
[0143] Execute S401 and start the email mailbox; execute S402 and the mobile phone obtains the target package name "EEEEE" of the email mailbox; execute S403 and the mobile phone determines that "EEEEE" is in the blacklist; execute S408 and the mobile phone detects that application A running in the foreground is not in the blacklist, which indicates that the mobile phone can adjust the frequency of the GPU based on the frequency upper limit f1 corresponding to application A, so the mobile phone will not turn off the frequency modulation scheme.
[0144] It can be seen that the use of Figure 4In the embodiment of the present invention, when the mobile phone adjusts the frequency of the GPU, S405 and S406 can be used to increase the frequency of the GPU to a lower matching frequency for power-sensitive applications, rather than to the highest frequency, so that the performance of the mobile phone is guaranteed while the frequency of the GPU is increased. In some embodiments, see Figure 5 , the mobile phone will not execute the above S405 and S406, thus failing to achieve the above Figure 4 Effects of the embodiments.
[0145] use Figure 4 In some embodiments, the mobile phone also considers the situation that multiple applications are running in the foreground, and therefore decides to adjust the GPU frequency based on the frequency upper limit corresponding to the application with higher frequency requirements of the GPU through S404, and only turns off the frequency adjustment scheme when the mobile phone does not adjust the GPU frequency based on the frequency upper limit corresponding to any application running in the foreground through S408-S410. In some embodiments, the mobile phone does not consider the situation that multiple applications are running in the foreground, see Figure 5 , the mobile phone does not execute S404, and after determining that the target application is in the blacklist at S403, it executes S408 and S410 to turn off the frequency modulation scheme, thereby failing to achieve the above Figure 4 Effects of the embodiments.
[0146] In the above embodiments, the scheme for starting the target application is described. In actual implementation, when starting any target application, the above embodiments can be used to decide whether to adjust the frequency of the GPU based on the frequency upper limit corresponding to the target application and the frequency upper limit (matching frequency or maximum frequency corresponding to the target application).
[0147] In some embodiments, the mobile phone may execute the above embodiments only when the target application is started, and keep the decision result unchanged at other times. For example, after starting application A and before starting the email mailbox, the frequency of the GPU is always adjusted based on the frequency upper limit corresponding to application A, and when the frequency of the GPU is increased, it is increased to the matching frequency f1 corresponding to application A.
[0148] In other embodiments, after starting the target application, the mobile phone may also dynamically adjust the decision result so that the decision result matches the real-time status of the mobile phone.
[0149] In some scenarios, the user can switch between the floating window and the full-screen application interface. In response to the user's switching operation, such as a long press operation on the floating window, a zoom operation, etc., the mobile phone can switch the application interface displayed in the floating window to full-screen display, and switch the application interface displayed in full screen to display in the floating window. That is, the switching of the application interface displayed in the floating window and the full-screen display is completed. In this scenario, in response to the user's switching operation, the mobile phone can also switch to adjusting the frequency of the GPU based on the frequency upper limit corresponding to the application running in full screen after the switch. In this way, the mobile phone can always adjust the frequency of the GPU based on the frequency upper limit corresponding to the application running in full screen.
[0150] Take the long press operation of the floating window as an example, see Figure 6 Before the switch, the mobile phone may display interface 601, at which time the application interface of application C is displayed in full screen, and the application interface of application D is displayed in floating window 6011, that is, the application running in full screen before the switch is application C, and the mobile phone may adjust the frequency of the GPU based on the upper frequency limit corresponding to application C. In response to the user's long press operation on floating window 601, the mobile phone may display interface 602, at which time the application interface of application C is displayed in floating window 6011, and the application interface of application D is displayed in full screen, that is, the application running in full screen after the switch is application D, and the mobile phone may adjust the frequency of the GPU based on the upper frequency limit corresponding to application D.
[0151] Similar to the frequency cap decision in the previous article, if the application running in full screen after switching is a power-sensitive application, the frequency cap is the matching frequency corresponding to the application running in full screen after switching; if the application running in full screen after switching is a regular application, the frequency cap is the highest frequency, which will not be repeated here.
[0152] In other scenarios, the user can adjust the size of the split screen. In response to the user's adjustment operation, such as zooming in on a split screen area, dragging the split screen boundary, etc., the mobile phone can adjust the size of the split screen. In this scenario, in response to the user's adjustment operation, the mobile phone can also adjust the frequency of the GPU based on the frequency upper limit corresponding to the application with the largest split screen size after the size adjustment. In this way, the mobile phone can always adjust the frequency of the GPU based on the frequency upper limit corresponding to the application with the largest split screen size.
[0153] Take the adjustment operation as dragging the split screen dividing line as an example, see Figure 7Before the adjustment, the mobile phone may display interface 701, at which time the split screen size of application C is larger than the split screen size of application D. In this case, the split screen size of application C is the largest before the adjustment, and the mobile phone may adjust the GPU frequency based on the upper frequency limit corresponding to application C. In response to the user dragging the split screen dividing line 701 upward (in the direction indicated by the arrow in interface 701), the mobile phone may display interface 702, at which time the split screen size of application C is smaller than the split screen size of application D. In this case, the split screen size of application D is the largest after the adjustment, and the mobile phone may adjust the GPU frequency based on the upper frequency limit corresponding to application D.
[0154] Similar to the decision-making frequency upper limit in the previous article, if the application with the largest split-screen size after adjustment is a power-sensitive application, the frequency upper limit is the matching frequency corresponding to the application with the largest split-screen size after adjustment; if the application with the largest split-screen size after adjustment is a regular application, the frequency upper limit is the highest frequency, which will not be repeated here.
[0155] In practice, after starting an application, the mobile phone can also exit the application running in the foreground, such as exiting the application running in the background or closing the application.
[0156] When a mobile phone is running an application in the foreground, if the application is exited, it means that the mobile phone will run a new application in the foreground. Exemplarily, when the mobile phone is running application A in the foreground, the previous interface 101 can be displayed. In response to the user's operation of returning to the desktop in interface 101, such as sliding upward from the bottom of interface 101, the mobile phone can display the previous interface 301. That is, when the mobile phone exits application A in the foreground, it starts running the desktop application in the foreground. That is, the new application is a desktop application. In this case, the mobile phone adopts the aforementioned embodiment of starting the target application, decides whether to adjust the frequency of the GPU based on the frequency upper limit corresponding to the new application after starting the new application, and decides the frequency upper limit.
[0157] When a mobile phone runs multiple applications in the foreground, if one of the applications running in the foreground is exited, the remaining applications except for the one application will still be running in the foreground. In this case, the mobile phone can adjust the frequency of the GPU based on the frequency upper limit corresponding to the application with the highest priority and / or the largest display size among the remaining applications. Based on the previous description, it can be seen that the higher the priority and the larger the display size, the higher the frequency requirement for the GPU. In this way, after one of the multiple applications running in the foreground exits the foreground, the mobile phone can still ensure that the frequency of the GPU is adjusted based on the frequency upper limit corresponding to the application with a higher frequency requirement for the GPU.
[0158] Take adjusting the GPU frequency based on the frequency cap corresponding to the application with the largest display size among the remaining applications as an example:
[0159] See also Figure 8, when the mobile phone runs the E application in full screen in the foreground and runs the F application in the floating window, the interface 801 can be displayed, that is, there are multiple applications running in the foreground. At this time, the E application is running in full screen, and the mobile phone can adjust the frequency of the GPU based on the frequency upper limit corresponding to the E application. In response to the user dragging the floating window 8011 running the F application in the interface 801 out of the screen (as shown in the direction of the arrow in the interface 801), the mobile phone can display the interface 802. The interface 802 no longer includes the floating window, but displays the application interface of the E application in full screen, that is, the F application running in the foreground is exited, and the remaining application is the E application, then naturally the display size of the E application is the largest, and the mobile phone can continue to adjust the frequency of the GPU based on the frequency upper limit corresponding to the E application.
[0160] See also Fig. 9 , when the mobile phone runs the E application and the F application in the foreground split screen, the interface 901 can be displayed, that is, there are multiple applications running in the foreground. At this time, the split screen size (i.e., display size) of the E application is larger, and the mobile phone can adjust the GPU frequency based on the frequency upper limit corresponding to the E application. In response to the user closing the control ( Fig. 9 The mobile phone can display interface 902 by clicking the E application (indicated by ×9011). Interface 902 no longer includes the application interface of the E application, but displays the application interface of the F application in full screen, that is, the E application running in the foreground is exited, and the remaining application is the F application, then the display size of the F application is naturally the largest, and the mobile phone can switch to adjust the frequency of the GPU based on the frequency upper limit corresponding to the F application.
[0161] Similar to the frequency cap decision in the previous article, if the application with the highest priority and / or the largest display size among the remaining applications is a power-sensitive application, the frequency cap will be the matching frequency corresponding to the application with the highest priority and / or the largest display size among the remaining applications; if the application with the highest priority and / or the largest display size among the remaining applications is a regular application, the frequency cap will be the highest frequency, which will not be repeated here.
[0162] At this point, it should be noted that the A application and the B application, the C application and the D application, and the E application and the F application in the foregoing respectively represent two different applications installed on the mobile phone, but the applications in different groups can be the same. For example, at least two of the A application, the C application, and the E application can be the same application, and at least two of the B application, the D application, and the F application can also be the same application, and this application does not make specific limitations on this.
[0163] In the embodiments of the present application, the software system of the mobile phone can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture or a cloud architecture. The following embodiments will mainly take the Android system with a layered architecture as an example to illustrate the software and hardware architecture of the mobile phone.
[0164] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, see Fig.10 The software and hardware architecture of a mobile phone is composed of the application layer (applications), application framework layer (framework), native layer (Native), hardware abstraction layer (HAL), kernel layer (kernel) and hardware layer from top to bottom.
[0165] Among them, desktop applications, game applications, video players, chat applications and other applications can be installed in the application layer. These applications all need to display images through the display screen of the mobile phone. For example, it is necessary to display application icons, game screens, video frames, etc. on the desktop through the display screen of the mobile phone. Most of these images need to be obtained through GPU processing (such as rendering and synthesis), that is, they belong to the scene that requires GPU to process images. The applications mentioned in the above embodiments, such as A application-F application, can all be applications in the application layer.
[0166] The application framework layer provides an application programming interface (API) and a programming framework for the application layer. Exemplarily, the application framework layer may include a window manager, a content provider, a resource manager, and the like.
[0167] The local layer provides various services for the upper layer (such as the application framework layer). For example, the local layer includes image synthesis processing service (SurfaceFlinger), accelerated graphical port service (accelerate graphical portservice, AGP service), three-dimensional (3D) graphics processing library (such as: OpenGL ES), etc., only some of which are shown in the figure.
[0168] Among them, SurfaceFlinger can receive the layer application applied in the application layer. The layer application is used to apply for the layer for drawing the image. Based on the layer application, SurfaceFlinger can determine that the target application is started in the foreground.
[0169] Of course, SurfaceFlinger can also be used for refresh rate control. It is understandable that when an application in the application framework layer needs to display a new frame of image, it can request a vertical synchronization (VerticalSynchronization, vSync) signal through SurfaceFlinger. The vSync signal can trigger the application to complete the rendering of a new frame of image, and then synthesize it and finally send it to the display. Moreover, after a refresh of the display screen of the electronic device is completed, the vSync signal can be distributed through SurfaceFlinger to the application requesting the vSync signal, that is, to the application with rendering requirements. In other words, SurfaceFlinger can distribute the vSync signal from the display screen to the application, so as to control the application to start rendering after the display screen is refreshed once. That is, refresh rate control is achieved.
[0170] AGP service can be used to make frequency adjustment-related decisions, such as whether to adjust the GPU frequency based on the frequency upper limit corresponding to the target application, and the frequency upper limit. Exemplarily, the AGP service records information such as a blacklist of applications that do not adjust the frequency, a list of power-sensitive applications, power-sensitive applications and their corresponding matching frequencies, for making frequency adjustment-related decisions.
[0171] In some embodiments, the AGP service can also be used to control the switch of the frequency modulation scheme. For example, when it is decided to adjust the frequency of the GPU based on the frequency upper limit corresponding to the target application, if the frequency modulation scheme is not enabled, the AGP service can determine the switch to enable the frequency modulation scheme.
[0172] The hardware abstraction layer encapsulates the underlying hardware driver and provides a general interface for calling the driver to the upper layer, so that the upper layer can call the driver to drive the corresponding hardware work. The hardware abstraction layer includes the hardware composer (HWC) and the display abstraction module (displayHAL).
[0173] Among them, the HWC can control and adjust the frequency of the GPU. Of course, the HWC can also perform image synthesis and other processing, which is not specifically limited in this application.
[0174] The display abstraction module (displayHAL) can be used to send the decision result of AGPservice to the bottom layer (such as the display driver in the kernel layer). Of course, the display abstraction module can also be used for display-related processing, which is not specifically limited in this application.
[0175] The kernel layer includes drivers that drive the hardware, such as display drivers (Display drivers), GPU drivers (kgsl Driver), etc.
[0176] Among them, the display driver can detect whether to adjust (including increasing or decreasing) the frequency of the GPU based on the running status of the application, and send a frequency modulation message to the upper layer (such as HWC in the hardware abstraction layer) when it is detected that the frequency of the GPU needs to be adjusted. Furthermore, the frequency modulation message includes a frequency increase message or a frequency reduction message. The frequency increase message indicates to increase the frequency of the GPU, and the frequency reduction message indicates to reduce the frequency of the GPU. In the frequency increase message, the frequency upper limit can be carried so that the HWC can obtain the frequency upper limit of the frequency increase and realize targeted frequency increase. Of course, the display driver can also be used to drive the display screen to display images, and this application does not make specific limitations on this.
[0177] The GPU driver is used to drive the GPU to work, such as driving the GPU to adjust the frequency.
[0178] The hardware layer includes devices such as display screens and GPUs. The display screen can be used for image display, and the GPU can be used for image rendering and synthesis.
[0179] The following is combined with the above Fig.10 The hardware and software architecture shown in the figure, and taking the decision process of starting the target application as an example, the implementation of the frequency modulation solution provided by the embodiment of the present application is explained. Fig.11 , the FM solution includes:
[0180] S1101, target application starts.
[0181] It should be noted that starting means starting to run in the foreground, such as switching from running in the background to running in the foreground, or starting from never running to running in the foreground.
[0182] S1102. The target application sends a layer application to SurfaceFlinger, where the layer application includes a target package name of the target application.
[0183] The layer application is used to apply for a layer, and when drawing the image of the target application later, it is drawn in the layer in the application. It should be noted that for the specific implementation of the application layer, please refer to the description in the related technology, and this article will not explain it in detail.
[0184] The layer application includes the target package name of the target application, indicating the application that applied for the layer. For example, after application A is started, application A can send a layer application to SurfaceFlinger, and the layer application carries the target package name of application A "AAAAA" to indicate that the application that applied for the layer is application A.
[0185] S1103. SurfaceFlinger obtains the target package name from the layer application.
[0186] S1104. SurfaceFlinger sends the target package name to the AGP service.
[0187] After obtaining the target package name, the AGP service can perform a series of decision actions, as follows S1105-S1109, and S1117-S1119:
[0188] S1105. AGP service determines whether the target package name is in the blacklist. If yes, execute S1117; if no, execute S1106.
[0189] For example, the AGP service records a blacklist of non-frequency modulation applications, and the AGP service can compare the target package name with the blacklist to determine whether the target package name is in the blacklist. For the part not described in detail in S1105, please refer to the description of S403 above, which will not be repeated here.
[0190] S1106, AGP service decides whether to adjust the GPU frequency based on the frequency upper limit corresponding to the target application. If yes, execute S1107; if no, execute S1117. For details, please refer to the relevant description of S404, which will not be repeated here.
[0191] S1107. The AGP service queries the switch state of the frequency modulation scheme, and updates the switch state of the frequency modulation scheme to the on state if the query finds that the switch state is the off state.
[0192] If it is decided in S1106 to adjust the frequency of the GPU based on the frequency upper limit corresponding to the target application, it indicates that the frequency modulation scheme is to be used for frequency modulation. The mobile phone can keep the switch state of the frequency modulation scheme turned on to be consistent with the frequency modulation requirement.
[0193] Exemplarily, the switch state of the frequency modulation scheme is recorded in the AGP service. If the switch state is off, indicating that the frequency modulation scheme is not enabled, the AGP service may update the switch state to off, indicating that the frequency modulation scheme is enabled.
[0194] For the parts not described in detail in S1107, please refer to the description of the switch status in S410 above, which will not be repeated here.
[0195] S1108, AGP service detects whether the target package name is in the list of power-sensitive applications. If yes, execute S1109; if not, execute S1111.
[0196] For example, the AGP service records a list of power-sensitive applications, and the AGP service can compare the target package name with the list of power-sensitive applications to determine whether the target package name is in the list of power-sensitive applications. For the part not described in detail in S1108, please refer to the description of S405 above, which will not be repeated here.
[0197] S1109, AGP service queries the matching frequency corresponding to the target application. For details, please refer to the description of S406, which will not be repeated here.
[0198] S1110. AGP service sends a frequency modulation instruction to the Display Driver through the display HAL, where the frequency modulation instruction includes a matching frequency.
[0199] Wherein, the frequency modulation instruction includes a matching frequency, which indicates that when the frequency is increased, the frequency is increased to the matching frequency.
[0200] S1111. AGP service sends a frequency modulation instruction to the Display Driver through the display HAL. The frequency modulation instruction includes the maximum frequency.
[0201] Wherein, the frequency modulation instruction includes the maximum frequency, indicating that when the frequency is increased, the frequency is increased to the maximum frequency.
[0202] In some embodiments, if the switch state of the frequency modulation scheme is found to be off in the aforementioned S1107, it indicates that the frequency modulation scheme is off, and the AGP service can also carry an enable message in the aforementioned S1110 and S1111 to instruct the Display Driver to enable the frequency modulation scheme. If the switch state of the frequency modulation scheme is found to be on in the aforementioned S1107, it indicates that the frequency modulation scheme is on, indicating that the Display Driver is using the frequency modulation scheme for frequency modulation, and there is no need to carry an enable message in the frequency modulation instruction. Thus, the Display Driver can be accurately instructed to enable the frequency modulation scheme.
[0203] S1112. Display Driver detects whether a frequency increase condition or a frequency decrease condition is met. If not, the frequency is not adjusted.
[0204] At this point, it should be noted that: in the process of processing each frame of image, after the GPU completes image rendering, synthesis and other processing, it can be sent to the display through the Display Driver. In other words, the Display Driver can know whether the GPU has completed image rendering, synthesis and other processing, and the Display Driver can determine whether the time for the GPU to complete image rendering, synthesis and other processing is appropriate.
[0205] If the processing is completed too late (recorded as later than the preset time T0), such as the processing is completed later than the moment when the display screen refreshes and displays the next frame of the image, it is determined that the frequency increase condition is met, and the Display Driver can execute S1113 to achieve the frequency increase.
[0206] If the processing is completed too early (recorded as earlier than the preset time T3), such as the processing is completed much earlier than the moment when the display screen refreshes and displays the next frame of image, it is determined that the frequency reduction condition is met, and the Display Driver can execute S1115 to achieve frequency reduction.
[0207] In addition, if neither the frequency increase condition nor the frequency reduction condition is met, such as the time for the GPU to complete the processing is between the preset time T3 and the preset time T0, it means that neither the frequency increase nor the frequency reduction is required, and the Display Driver does not need to perform related frequency adjustment processing.
[0208] S1113. If the frequency increase condition is met, the Display Driver sends a frequency increase message to the HWC. The frequency increase message carries a frequency upper limit, which is a matching frequency or a maximum frequency.
[0209] It should be understood that if the frequency modulation instruction carries a matching frequency, the upper frequency limit is the matching frequency; if the frequency modulation instruction carries a maximum frequency, the upper frequency limit is the maximum frequency.
[0210] S1114. HWC increases the frequency of the GPU to the upper frequency limit through the GPU driver according to the frequency increase message.
[0211] S1115: If the frequency reduction condition is met, the Display Driver sends a frequency reduction message to the HWC.
[0212] S1116. The HWC reduces the frequency of the GPU through the GPU driver according to the frequency increase message.
[0213] For example, HWC can gradually reduce the GPU frequency through the GPU driver.
[0214] At this point, it should be noted that when a mobile phone adjusts the GPU frequency, it usually adjusts it in units of frequency gears, and different frequency gears correspond to different frequency ranges. For example, a frequency gear division is as follows Fig.12As shown, the frequency range includes 0-7, and the corresponding frequency intervals decrease in sequence. Among them, the frequency interval corresponding to 0 is an interval greater than or equal to f0, and the minimum value is f0; the frequency interval corresponding to 1 is an interval greater than or equal to f1 and less than f0, and the minimum value is f1; the frequency interval corresponding to 2 is an interval greater than or equal to f2 and less than f1, and the minimum value is f2... The frequency interval corresponding to 7 is an interval greater than or equal to f7 and less than f6, and the minimum value is f7.
[0215] Correspondingly, the frequency upper limit mentioned above can be a frequency upper limit gear. When the frequency increase condition is detected, the mobile phone can adjust the GPU frequency to the frequency upper limit gear. Wherein, the frequency upper limit is the highest frequency, and the frequency upper limit gear is the highest frequency gear, such as Fig.12 The upper frequency limit is the matching frequency, and the upper frequency limit gear is the matching frequency gear, such as Fig.12 Among them, there are 1st gear, 2nd gear, etc. which are lower than 0th gear.
[0216] S1117, AGP service checks whether the switch status of the frequency modulation scheme is turned on. If so, execute S1118; if not, do not turn off the frequency modulation scheme.
[0217] The switch state is in the on state, indicating that the frequency modulation scheme is being executed. The switch state is in the off state, indicating that the frequency modulation scheme is not being executed. That is, through S1117, S408 in the foregoing text can be implemented.
[0218] For the parts not described in detail in S1117, please refer to the description of the switch status in S408 and S410 above.
[0219] S1118, AGP service detects whether the GPU frequency is adjusted based on the frequency upper limit corresponding to any application running in the foreground. If yes, the frequency adjustment scheme is not closed; if no, S1118 is executed. For details, please refer to the description of S409 above, which will not be repeated here.
[0220] S1119. The AGP service update switch status is turned off.
[0221] S1120. AGP service sends a frequency modulation scheme shutdown message to Display Driver through display HAL.
[0222] S1121, Display Driver turns off the frequency modulation scheme.
[0223] That is, the above S410 is implemented through S1119-S1121.
[0224] At this point, it should be noted that the above Fig.11The above is only a specific implementation sequence. In actual implementation, the sequence and number of steps are not necessarily the same. Fig.11 Among them, several steps can be combined into one step, or one step can be divided into multiple steps, or the order of the steps can be changed.
[0225] For example, the AGP service may also execute S1107 after executing S1108 and before executing S1110 and S1111. Furthermore, if the switch state is found to be off, the AGP service may carry an on message in the frequency modulation instructions of S1110 and S1111.
[0226] As another example, the AGP service may also execute the action of querying the switch status in S1107 after executing S1108 and before executing S1110 and S1111. If the switch status is found to be off, the AGP service may carry the start message in the frequency modulation instructions of S1110 and S1111. Subsequently, after receiving the feedback of successful start from the Display Driver, the AGP service executes the action of updating the switch status in S1107.
[0227] As another example, S1108 and S1109 may be combined into one step: the AGP service queries the target package name and its corresponding matching frequency. If it is not found, it indicates that it is a regular application. If it is found, the matching frequency is obtained.
[0228] Also illustratively, the execution order of S1117 and S1118 can be exchanged, and S1118 can be executed first to detect whether the frequency of the GPU is adjusted based on the frequency upper limit corresponding to any application running in the foreground. If not, S1117 is executed.
[0229] The present application embodiment here exemplarily introduces a specific implementation of a mobile phone determining the timing of frequency increase and decrease:
[0230] See also Fig.13 The processing process of a frame of image mainly includes: step 1, rendering; step 2, synthesis; and step 3, sending to display.
[0231] Step 1: Rendering.
[0232] After receiving the vSync signal from SurfaceFlinger, the application can start drawing a new frame of image. Specifically, the application submits drawing instructions to the rendering thread (RenderThread) in the local layer. After receiving the drawing instructions, RenderThread processes the drawing instructions and then sends them to the GPU. After receiving the processed drawing instructions, the GPU can perform rendering processing. That is, during the processing of a frame of image, the GPU can be used for image rendering.
[0233] Step 2: Synthesis.
[0234] RenderThread can also send image content obtained after processing drawing instructions to SurfaceFlinger, such as the drawn image. After receiving the image content, SurfaceFlinger determines whether the image content needs to be synthesized and displayed in this frame, and processes the content that needs to be synthesized and displayed, for example, completing the processing of following the refresh rate. In addition, the content that does not need to be synthesized and displayed is placed in the waiting queue, and it is determined again whether it needs to be synthesized and displayed in the next frame.
[0235] Normally, HWC can only complete some simple synthesis work, while complex synthesis work needs to be completed by GPU. Therefore, SurfaceFlinger can determine whether the image synthesis of the current frame requires GPU support. If necessary, SurfaceFlinger can call the interface of the graphics library to complete the synthesis work that HWC cannot complete through GPU. That is, during the processing of a frame of image, GPU can also be used for image synthesis.
[0236] It should be noted that during the execution of step 2, the GPU may not have completed image rendering. Therefore, the GPU needs to complete image synthesis after completing image rendering.
[0237] Step 3, send and display.
[0238] After completing the image synthesis, the HWC can send the synthesis result to the display driver. Based on the synthesis result, the display driver further combines the processing result of the GPU, that is, the processing result of the GPU performing image rendering and image synthesis, obtains the image to be displayed and sends it to the display screen.
[0239] It should be noted that when the HWC completes image synthesis, the GPU may not have completed image rendering and image synthesis. Therefore, after receiving the synthesis result from the HWC, the display driver needs to further wait for the GPU to complete image rendering and image synthesis before it can obtain the image to be displayed and send it to the display screen.
[0240] It can be seen that in the process of processing a frame of image, the GPU needs to complete image rendering and image synthesis. Moreover, if the GPU fails to complete the process in time, the display driver will not be able to obtain the image to be displayed and send it to the display screen in time, which will cause frame loss.
[0241] During the processing of a frame of image, the mobile phone (such as the display driver in the kernel layer) can detect whether the end time of the GPU completing image processing (including rendering and synthesis) exceeds the preset time T0. If the end time exceeds the preset time T0, it means that the GPU cannot complete the processing of the current frame of image in time. At this time, the frequency increase condition is met. The mobile phone (such as the HWC in the hardware abstraction layer) can increase the frequency of the GPU to the frequency upper limit to ensure that the GPU completes the processing of the current frame of image in time to avoid frame loss.
[0242] In this way, the phone can increase the GPU frequency based on the situation that the GPU cannot complete image processing in time in the current frame. On the one hand, the phone can increase the frequency in time so that the GPU can process the current frame image in time to ensure that no frame is lost; on the other hand, the phone will not increase the GPU frequency when the GPU can complete image processing in time, so as not to waste resources.
[0243] In some embodiments, the preset time T0 may be a time point at which the time from the next refresh time of the display screen is a fixed time length 1. It is understandable that each time the display screen is refreshed, a new frame of image needs to be displayed. Therefore, the GPU needs to complete the processing of the current frame of image before the next refresh, and the preset time T0 also needs to be before the next refresh time. In this way, the mobile phone can quickly determine the preset time T0 based on the next refresh time and the fixed time length 1.
[0244] In other embodiments, the preset time T0 is the time length (recorded as duration L) from the moment T1 when the display driver starts waiting for the GPU to complete image processing to the next refresh moment T2, and the ratio of the time length from moment T1 to the duration L is a preset ratio λ1 (such as 0.7, 0.8, etc.) at the time point.
[0245] Taking the preset proportion λ1 as 0.7 as an example, Fig.14 During the processing of the k-th frame image, the mobile phone can determine that the preset time T0 is the moment T1+0.7*(T2-T1).
[0246] It can be seen that, by adopting this embodiment, the mobile phone can determine the matching preset time T0 according to the processing progress of the current frame image, so as to adjust the frequency level of the GPU in a targeted manner.
[0247] In addition, one point that needs to be emphasized is that when the display driver starts waiting for the GPU to complete image processing, it indicates that the CPU has basically completed the relevant processing of sending the image to the display. After that, whether frame loss occurs mainly depends on the working efficiency of the GPU. Therefore, by configuring the preset time T0 as the time after the display driver starts waiting for the GPU to complete image processing, the GPU frequency can be adjusted to accurately control frame loss without being affected only by the working efficiency of the GPU.
[0248] In practice, the display driver can wait for the GPU to complete image processing through a waiting function (such as plane_wait_input_fence). It is understandable that after the GPU completes image processing, it will release the corresponding fence. Correspondingly, after the display driver queries the fence through the waiting function and finds that it has been released, it can be determined that the GPU has completed image processing. At this time, the display driver can execute the subsequent display sending process and drive the display screen to display the current frame image. Based on this, the mobile phone can determine that time T1 is the time when the display driver starts to execute the waiting function.
[0249] In a specific implementation, after the preset time T0 is reached, the mobile phone can detect whether the display driver is executing the waiting function. If the display driver is still executing the waiting function at the preset time T0, the mobile phone can determine that the end time of the GPU completing the image processing exceeds the preset time T0; if the display driver has finished executing the waiting function at the preset time T0, the mobile phone can determine that the end time of the GPU completing the image processing does not exceed the preset time T0.
[0250] Continue to see Fig.14 , at the preset time T0, the display driver has not finished executing the waiting function, and the mobile phone can determine that the end time of the GPU completing the image processing exceeds the preset time T0.
[0251] After increasing the GPU frequency, in the subsequent image processing process, the mobile phone (such as the display driver) can detect whether the end time of the GPU completing the image processing exceeds the preset time T3. If the end time does not exceed the preset time T3, it means that the GPU can efficiently complete the image processing. At this time, the frequency reduction condition is met, and the mobile phone can reduce the GPU frequency, thereby saving resources.
[0252] Similar to the preset time T0: the preset time T3 can be a time point when the time length from the next refresh time T2 is a fixed time length 2, and the fixed time length 2 is greater than the fixed time length 1. In this way, the mobile phone can also quickly determine the preset time T3 based on the next refresh time T2 and the fixed time length 2. Alternatively, the preset time T3 can be a time point in the time length L, when the ratio of the time length from the time T1 to the time length L is a preset ratio λ2 (such as 0.5, 0.6, etc.), and the preset ratio λ2 is less than the preset ratio λ1.
[0253] Taking the preset proportion λ2 as 0.5 as an example, Fig.15 During the processing of the second frame of image shown in the figure (such as at the preset time T0), the mobile phone increases the frequency of the GPU to level 0. During the processing of the third frame of image, the mobile phone can detect whether the GPU has completed the image processing at the preset time T3=T1+0.5*(T2-T1). If completed, the frequency reduction condition is met.
[0254] Among them, regarding the determination of time T1, please refer to the relevant instructions in the previous text, which will not be repeated here.
[0255] Similarly, in a specific implementation, the mobile phone can detect whether the display driver is executing the waiting function after reaching the preset time T3. If the display driver is still executing the waiting function at the preset time T3, the mobile phone can determine that the end time of the GPU completing the image processing exceeds the preset time T3; if the display driver has finished executing the waiting function at the preset time T3, the mobile phone can determine that the end time of the GPU completing the image processing does not exceed the preset time T3.
[0256] Continue to see Fig.15 , at the preset time T3, the display driver has finished executing the waiting function, and the mobile phone can determine that the end time of the GPU completing the image processing does not exceed the preset time T3.
[0257] When the phone is downclocked, the GPU frequency can be reduced step by step, such as from 0 to 1, and then from 1 to 2... Continue to see Fig.15 After increasing the GPU frequency to level 0, during the processing of the third frame of the image, the mobile phone detects that the GPU has completed image processing at the preset time T3, and the mobile phone can reduce the GPU frequency from level 0 to level 1.
[0258] At this point, it should be noted that: Figure 12-Figure 15 The embodiment is only a possible implementation method for determining the frequency adjustment timing and the frequency reduction timing, and is not limited to this in actual implementation. In other embodiments, the mobile phone can also determine the frequency adjustment or frequency reduction timing based on the GPU usage rate or whether the application loses frames.
[0259] Take the frequency upper limit corresponding to the G application (the highest frequency level 0) and then the frequency upper limit corresponding to the H application (the matching frequency level 0) as an example:
[0260] See also Fig.16Before t0, the GPU frequency is adjusted based on the frequency upper limit 0 corresponding to the G application. At t1, the mobile phone detects that the frequency increase condition is met and increases the GPU frequency to 0; subsequently, at t2 and t3, the mobile phone detects that the frequency reduction condition is met, and then reduces the frequency from 0 to 1, and then from 1 to 2...
[0261] Continue to see Fig.16 After t0, the GPU frequency is adjusted based on the upper frequency limit of level 2 corresponding to the H application. At t4, the phone detects that the frequency increase condition is met, and increases the GPU frequency to level 2, instead of the highest level 2; subsequently, at t5, t6, and t7, the phone detects that the frequency reduction condition is met, and then reduces the frequency from level 2 to level 3, from level 3 to level 4, and from level 4 to level 5...
[0262] The present application also provides an electronic device, which may include: a display screen, a memory, and one or more processors (such as a CPU, a GPU, an NPU, etc.). The display screen, the memory, and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device may perform each function or step performed by the device in the above method embodiment.
[0263] The embodiment of the present application also provides a chip system, which includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected by lines. For example, the interface circuit can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit can be used to send signals to other devices (such as a processor). Exemplarily, the interface circuit can read instructions stored in the memory and send the instructions to the processor. When the instructions are executed by the processor, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.
[0264] This embodiment further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the image processing method in the above-mentioned embodiment.
[0265] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the image processing method in the above-mentioned embodiment.
[0266] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the image processing method in the above-mentioned method embodiments.
[0267] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.
[0268] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0269] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0270] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
[0271] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0272] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0273] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A frequency modulation method, characterized in that: Applied to an electronic device, the electronic device includes a graphics processor GPU, and the method includes: The electronic device starts the first application in the foreground; In response to detecting that a frequency increase condition of the GPU is met, the electronic device increases the frequency of the GPU to a first frequency; The electronic device starts a second application in the foreground; In response to detecting that the frequency increase condition is met, the electronic device increases the frequency of the GPU to a second frequency; The first application is different from the second application, and the second frequency is different from the first frequency.
2. The method according to claim 1, characterized in that In response to detecting that the frequency increase condition of the GPU is met, the electronic device increases the frequency of the GPU to a second frequency, including: In the case where the second application satisfies the first condition, in response to detecting that the frequency increase condition of the GPU is met, the electronic device increases the frequency of the GPU to the second frequency; The first condition includes at least one of the following: The second application is not an application in the blacklist; The second application is the application with the largest display size in the foreground; And, the second application is the application with the highest priority among the applications running in the foreground.
3. The method according to claim 2, characterized in that After the electronic device starts the second application in the foreground, the method further includes: The electronic device runs the first application and the second application in the foreground; In a case where the second application does not satisfy the first condition, in response to detecting that the frequency increase condition of the GPU is satisfied, the electronic device increases the frequency of the GPU to the first frequency.
4. The method according to claim 2, characterized in that: After the electronic device starts the second application in the foreground, the method further includes: The electronic device runs the second application in the foreground and ends running the first application in the foreground; In a case where the second application does not satisfy the first condition, the electronic device turns off the first switch, and after turning off the first switch, the electronic device does not adjust the frequency of the GPU.
5. The method according to any one of claims 1 to 3, characterized in that: After the electronic device starts the second application in the foreground, the method further includes: The electronic device runs the second application in full screen on the foreground, and runs the first application in a floating window on the foreground; After the electronic device increases the frequency of the GPU to a second frequency in response to detecting that the frequency increase condition is met, the method further includes: In response to a first trigger operation, the electronic device runs the first application in full screen in the foreground and runs the second application in a floating window in the foreground; In response to detecting that the frequency increase condition is met, the electronic device increases the frequency of the GPU to the first frequency.
6. The method according to any one of claims 1 to 3, characterized in that After the electronic device starts the second application in the foreground, the method further includes: The electronic device runs the first application and the second application in a split screen in the foreground; After the electronic device increases the frequency of the GPU to a second frequency in response to detecting that the frequency increase condition is met, the method further includes: In response to a second trigger operation, the electronic device adjusts the split screen size of the first application to a first size, and adjusts the split screen size of the second application to a second size, wherein the first size is larger than the second size; In response to detecting that the frequency increase condition is met, the electronic device increases the frequency of the GPU to the first frequency.
7. The method according to any one of claims 1 to 3, 5 and 6, characterized in that After the electronic device starts the second application in the foreground, the method further includes: The electronic device runs the first application and the second application in the foreground; After the electronic device increases the frequency of the GPU to a second frequency in response to detecting that the frequency increase condition is met, the method further includes: In response to a third trigger operation, the electronic device ends running the second application in the foreground; In response to detecting that the frequency increase condition is met, the electronic device increases the frequency of the GPU to the first frequency.
8. The method according to any one of claims 1 to 7, characterized in that After the electronic device starts the first application in the foreground, or after the electronic device starts the second application in the foreground, the method further includes: In response to detecting that a frequency reduction condition of the GPU is met, the electronic device reduces the frequency of the GPU.
9. The method according to any one of claims 1 to 8, characterized in that The electronic device stores a correspondence table of application identifiers and frequencies; After the electronic device starts the first application in the foreground, the method further includes: The electronic device searches for an application identifier of the first application from the correspondence table, and the first frequency is a frequency corresponding to the application identifier of the first application in the correspondence table; After the electronic device starts the second application in the foreground, the method further includes: The electronic device does not find the application identifier of the second application from the correspondence table, and the second frequency is the highest frequency of the GPU, and the second frequency is higher than the first frequency.
10. The method according to any one of claims 1 to 9, characterized in that The electronic device also includes an image synthesis processing service, an accelerated graphics interface service, a display driver and a hardware overlay HWC; After the electronic device starts the second application in the foreground, the method further includes: The second application applies to the image synthesis processing service layer, and the layer application includes an application identifier of the second application; The image synthesis processing service obtains the application identifier of the second application from the layer application, and sends the application identifier of the second application to the accelerated image interface service; The accelerated image interface service detects whether the second application satisfies a first condition based on an application identifier of the second application; If the second application satisfies the first condition, the accelerated image interface service queries the application identifier of the second application from a correspondence table, where the correspondence table includes a correspondence between the application identifier and the frequency; If the application identifier of the second application is found from the correspondence table, the frequency corresponding to the application identifier of the second application is obtained from the correspondence table, and the frequency corresponding to the identifier of the second application is sent to the display driver; If the application identifier of the second application is not found in the correspondence table, sending the maximum frequency of the GPU to the display driver; The display driver detects whether the frequency increase condition is met; In response to detecting that the frequency increase condition is met, the electronic device increases the frequency of the GPU to a second frequency, including: In response to detecting that the frequency increase condition is met, the display driver sends a frequency increase message to the HWC, the frequency increase message including the frequency corresponding to the identifier of the second application or the maximum frequency, and the second frequency including the frequency corresponding to the identifier of the second application or the maximum frequency; The HWC increases the frequency of the GPU to the second frequency.
11. An electronic device, characterized in that: include: A display screen, one or more processors, and one or more memories; the one or more processors are coupled to the display screen and the one or more memories; the one or more memories are used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in any one of claims 1-10.
12. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 10.
Citation Information
Patent Citations
CPU frequency adjusting method and system
CN110413400A
Frequency adjustment method and electronic equipment
CN117114961A
Frequency modulation method and electronic equipment
CN117130770A
Image display method and related device
CN117472483A
Power Consumption Control Method and Apparatus
US20240137870A1