Refresh rate switching method and electronic equipment
By detecting the refresh rate switching command across modes in the electronic device and handing it over to the graphics processor to process the layer synthesis, the problem of abnormal display during the refresh rate switching process is solved, and normal refresh rate switching and display transmission in different touch modes are realized.
Patent Information
- Application Number
- CN202311090673.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-25
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2043-08-25
AI Technical Summary
Existing electronic devices are prone to abnormal display problems during refresh rate switching, especially when switching refresh rate between different touch modes.
通过检测到跨模式的刷新率切换指令,强制将送显图像的图层合成处理交由图形处理器执行,从而降低显示处理器的负载,仅由显示处理器完成刷新率的切换处理。
When switching refresh rate between different touch modes, it ensures that the screen is sent normally, avoiding the problem of abnormal graphics.
Smart Images

Figure CN119516979A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a refresh rate switching method and an electronic device. Background Art
[0002] With the improvement of display technology, electronic devices such as mobile phones and tablets have gradually begun to support multiple screen refresh rates. Among them, the refresh rate (Refresh Rate or Scanning Frequency) refers to the number of times the image displayed on the screen of the electronic device is refreshed per second, in Hertz (Hz), which can also be called display frequency or display frame rate. Taking the refresh rate of an electronic device as 60Hz as an example, the electronic device can complete 60 refreshes and display image frames in 1 second (ie 1000 milliseconds), that is, refresh and display a frame of image every 16.6 milliseconds. The higher the refresh rate, the more times the electronic device can complete the refresh display of the image frame in 1 second, the better the stability of the displayed image, the smoother the display, and the smaller the impact on the eyes, but the higher the power consumption.
[0003] At present, after the electronic device and the stylus are wirelessly connected, the user can operate the touch screen of the electronic device through the stylus to provide input to the electronic device, so that the electronic device performs corresponding operations based on the input. In order to ensure the signal synchronization between the electronic device and the stylus, the electronic device needs to switch the refresh rate to a refresh rate that matches the stylus. However, in the current refresh rate switching process, there may be problems with abnormal display. Summary of the invention
[0004] The present application provides a refresh rate switching method and an electronic device, wherein the electronic device can normally complete the refresh rate switching under different touch modes while ensuring the normal display of the screen.
[0005] In order to achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, a refresh rate switching method is provided, which can be applied to an electronic device, wherein the electronic device supports a first touch mode and a second touch mode, the first touch mode supports a first refresh rate, and the second touch mode supports a second refresh rate, the method comprising: when the screen refresh rate is the first refresh rate of the first touch mode, detecting a first refresh rate switching instruction, the first refresh rate switching instruction being used to indicate switching from the first refresh rate of the first touch mode to the second refresh rate of the second touch mode; in response to the first refresh rate switching instruction, controlling a graphics processor to perform layer synthesis of an image to be displayed; controlling a display processor to switch the screen refresh rate from the first refresh rate of the first touch mode to the second refresh rate of the second touch mode; and displaying the image to be displayed synthesized by the graphics processor at the second refresh rate of the second touch mode.
[0007] Among them, the touch mode is used to indicate the user input method that the electronic device can support. There are differences in the user input methods indicated by the first touch mode and the second touch mode. For example, the first touch mode supports stylus touch, and the second touch mode supports finger touch. Optionally, while there are differences, there may also be overlapping user input methods. For example, the first touch mode supports stylus touch, and the second touch mode supports finger touch and stylus touch. This application does not limit the user input methods indicated by each touch mode.
[0008] Each touch mode corresponds to at least one refresh rate gear that can be supported. The refresh rate gears supported by different touch modes can be different or the same. Among them, the refresh rate gears supported by different touch modes are different. The refresh rate gears supported can be completely different, or there can be differences and overlapping refresh rate gears. For example, the first touch mode supports 30Hz and 60Hz, and the second touch mode supports 60Hz, 120Hz, and 144Hz.
[0009] The display processor is usually responsible for the layer synthesis and overlay of the displayed image and the switching of the refresh rate. The graphics processor is usually used to perform mathematical and geometric calculations for graphics rendering.
[0010] In the solution provided by the first aspect above, when the screen of the electronic device is refreshed using the first refresh rate of the first touch mode, if a cross-mode refresh rate switching instruction is detected, for example, a first refresh rate switching instruction for indicating a switch from the first refresh rate of the first touch mode to the second refresh rate of the second touch mode is detected, then the electronic device can respond to the cross-mode refresh rate switching instruction, and force the layer synthesis processing of the display image to be executed by the graphics processor, thereby reducing the load of the display processor, and the display processor can only complete the cross-mode refresh rate switching, such as completing the switch from the first refresh rate of the first touch mode to the second refresh rate of the second touch mode. In this way, the electronic device can use the second refresh rate of the switched second touch mode to refresh the image synthesized by the graphics processor on the screen. It can be understood that for refresh rate switching across modes with relatively large differences, the display processor may not be able to simultaneously complete the layer synthesis overlay of the display image and the refresh rate switching processing, resulting in abnormal display during the switching process. Therefore, when the refresh rate needs to be switched between different touch modes, this solution can transfer the layer synthesis processing of the image to be displayed, which was originally handled by the display processor, to the graphics processor to reduce the load of the display processor, and the display processor can focus on the refresh rate switching process. This ensures that the refresh rate switching across modes is completed normally, and that the image to be displayed is displayed normally. This avoids the problem of abnormal display during the refresh rate switching across modes.
[0011] In a possible implementation, the first touch mode is a pen touch mode, and the second touch mode is a hand touch mode, wherein the hand touch mode is used to indicate that the electronic device supports the user to provide input through finger operation, and the pen touch mode is used to indicate that the electronic device supports the user to provide input through both finger operation and stylus operation.
[0012] That is, when the screen of the electronic device is refreshed at the first refresh rate of the pen touch mode, if a first refresh rate switching instruction to switch to the second refresh rate of the hand touch mode is detected, the electronic device can respond to the instruction and force the layer synthesis processing of the image to be displayed to be executed by the graphics processor, thereby reducing the load of the display processor, and the display processor can normally complete the switch from the first refresh rate of the pen touch mode to the second refresh rate of the hand touch mode. In this way, the electronic device can use the second refresh rate of the hand touch mode after normal switching to normally refresh the image synthesized by the graphics processor on the screen.
[0013] In another possible implementation, the first touch mode is a hand touch mode, and the second touch mode is a pen touch mode.
[0014] That is, when the screen of the electronic device is refreshed at the first refresh rate of the hand touch mode, if a first refresh rate switching instruction to switch to the second refresh rate of the pen touch mode is detected, the electronic device can respond to the instruction and force the layer synthesis processing of the image to be displayed to be executed by the graphics processor, thereby reducing the load of the display processor, and the display processor can normally complete the switch from the first refresh rate of the hand touch mode to the second refresh rate of the pen touch mode. In this way, the electronic device can use the second refresh rate of the pen touch mode after normal switching to normally refresh the image synthesized by the graphics processor on the screen.
[0015] In one possible implementation, the first refresh rate is the same as the second refresh rate. It is understandable that although the refresh rate gears of the two touch modes are the same, due to the differences in the supported touch modes, the display timings that need to be adjusted for the refresh rates of each touch mode will also be different. For example, the display timing corresponding to 60Hz of the hand touch mode is quite different from the display timing corresponding to 60Hz of the pen touch mode (due to the need to support stylus input). Therefore, this solution can reduce the load on the display processor by transferring the layer synthesis processing of the display image that was originally the responsibility of the display processor to the graphics processor when it is necessary to switch the same refresh rate of different touch modes. The display processor can be centrally responsible for the same refresh rate switching processing of different touch modes.
[0016] In a possible implementation, the first refresh rate is different from the second refresh rate, that is, the cross-mode refresh rate switching of this solution involves both the refresh rate switching between different touch modes and the switching between different refresh rate gears.
[0017] In a possible implementation, the first refresh rate is greater than the second refresh rate. In this way, the solution can switch from a high refresh rate of one touch mode to a low refresh rate of another touch mode, such as switching from 144 Hz of a hand touch mode to 60 Hz of a pen touch mode.
[0018] In a possible implementation, the first refresh rate is greater than the second refresh rate. In this way, the solution can switch from a low refresh rate of one touch mode to a high refresh rate of another touch mode, such as switching from 60 Hz of a pen touch mode to 144 Hz of a hand touch mode.
[0019] Optionally, when the first refresh rate is different from the second refresh rate, since it involves both refreshing rate switching between different touch modes and switching between different refresh rate gears, the electronic device can separately complete refreshing rate switching between different touch modes and switching between different refresh rate gears.
[0020] In a possible implementation, when the first refresh rate is greater than the second refresh rate, the specific process of the refresh rate switching method provided by the present solution may include: when refreshing and displaying the Nth frame image, detecting a first refresh rate switching instruction, wherein N is a positive integer; in response to the first refresh rate switching instruction, controlling the display processor to perform layer synthesis of the Nth frame image to obtain a first image to be displayed; controlling the display processor to switch the screen refresh rate from the first refresh rate of the first touch mode to the second refresh rate of the first touch mode; displaying the first image synthesized by the display processor at the second refresh rate of the first touch mode; when refreshing and displaying the N+1th frame image, in response to the first refresh rate switching instruction, controlling the graphics processor to perform layer synthesis of the N+1th frame image to obtain a second image to be displayed; controlling the display processor to switch the screen refresh rate from the second refresh rate of the first touch mode to the second refresh rate of the second touch mode; displaying the second image synthesized by the graphics processor at the second refresh rate of the second touch mode.
[0021] In this way, when the screen of the electronic device is refreshed using the first refresh rate of the first touch mode (such as 144Hz of the hand touch mode), if it is detected that the second refresh rate of the second touch mode needs to be switched when refreshing and displaying a certain frame image (the Nth frame image), and the second refresh rate is lower than the first refresh rate (such as 60Hz of the pen touch mode), the electronic device can first complete the switching of different refresh rate gears during the refresh display process of the Nth frame image (such as switching from 144Hz of the hand touch mode to 60Hz of the hand touch mode), and then complete the same refresh rate switching of different touch modes during the refresh display process of the next frame image (the N+1th frame image) (such as switching from 60Hz of the hand touch mode to 60Hz of the pen touch mode). Among them, when refreshing and displaying the Nth frame image, since only the refresh rate gear needs to be switched, the touch mode does not change. That is, the high and low refresh rate gear switching under the same touch mode (the first touch mode) is completed, and the refresh rate switching across modes will not be involved, and the switching difference is not large. Therefore, the layer synthesis of the Nth frame image can still be handled by the display processor, without being handed over to the graphics processor. However, when refreshing and displaying the N+1th frame image, the same refresh rate switching of different touch modes needs to be completed, and the switching difference is large. Therefore, the layer synthesis of the N+1th frame image needs to be handed over to the graphics processor to reduce the load of the display processor, and the display processor can focus on the same refresh rate switching of different touch modes.
[0022] In a possible implementation, when the first refresh rate is less than the second refresh rate, the specific process of the refresh rate switching method provided by the present solution may include: when refreshing and displaying the Nth frame image, detecting a first refresh rate switching instruction, wherein N is a positive integer; in response to the first refresh rate switching instruction, controlling the graphics processor to perform layer synthesis of the Nth frame image to obtain a first image to be displayed; controlling the display processor to switch the screen refresh rate from the first refresh rate of the first touch mode to the first refresh rate of the second touch mode; displaying the first image synthesized by the graphics processor at the first refresh rate of the second touch mode; when refreshing and displaying the N+1th frame image, in response to the first refresh rate switching instruction, controlling the display processor to perform layer synthesis of the N+1th frame image to obtain a second image to be displayed; controlling the display processor to switch the screen refresh rate from the first refresh rate of the second touch mode to the second refresh rate of the second touch mode; and displaying the second image synthesized by the display processor at the second refresh rate of the second touch mode.
[0023] In this way, when the screen of the electronic device is refreshed using the first refresh rate of the first touch mode (such as 60Hz of the pen touch mode), if it is detected that the second refresh rate of the second touch mode needs to be switched when refreshing and displaying the Nth frame image, and the second refresh rate is higher than the first refresh rate (such as 144Hz of the hand touch mode), the electronic device can first complete the same refresh rate switching of different touch modes during the refresh display process of the Nth frame image (such as switching from 60Hz of the pen touch mode to 60Hz of the hand touch mode), and then complete the switching of different refresh rate gears under the same touch mode during the refresh display process of the next frame image (N+1th frame image) (such as switching from 60Hz of the hand touch mode to 144Hz of the hand touch mode). Among them, when refreshing and displaying the Nth frame image, since the same refresh rate switching of different touch modes is completed, it involves the refresh rate switching across modes, and the switching difference is large. Therefore, the layer synthesis of the Nth frame image needs to be handed over to the graphics processor to reduce the load of the display processor, and the display processor can be responsible for the same refresh rate switching of different touch modes. However, when refreshing and displaying the N+1th frame image, since it is necessary to complete the switching of different refresh rate gears in the same touch mode, it does not involve cross-mode, and the switching difference is small. Therefore, the layer synthesis of the N+1th frame image can still be handled by the display processor, and does not need to be handed over to the graphics processor.
[0024] In some scenarios, if the hardware conditions of the electronic device support it, the electronic device can also directly switch from the first refresh rate of the first touch mode to the second refresh rate of the second touch mode when refreshing and displaying the Nth frame image.
[0025] In a possible implementation, the refresh rate switching method provided by the present solution may further include: determining the usage status of the stylus; in response to the usage status switching from unused to used, or the usage status switching from used to unused, generating a first refresh rate switching instruction. In this way, when the user needs to use the stylus, the electronic device can switch the refresh rate to a refresh rate supported by the pen touch mode. When the user does not need to use the stylus, the electronic device can switch the refresh rate to a refresh rate supported by the hand touch mode.
[0026] In a possible implementation, the stylus can send the usage status to the electronic device when determining its usage status, so that the electronic device can receive the usage status sent by the stylus. In this way, the electronic device itself does not need to detect the usage status of the stylus.
[0027] In a possible implementation, the electronic device may also detect the use status of the stylus by itself. For example, the electronic device may detect the connection status, adsorption status, and full power status of the stylus to determine the use status of the stylus based on the detected connection status, adsorption status, and full power status.
[0028] Optionally, when the stylus pen is connected to and adsorbed on the electronic device and the power of the stylus pen is not full, the electronic device may determine that the usage status of the stylus pen is in use.
[0029] It is understandable that if the user takes off the stylus and uses it for the first time, since the stylus is still in the adsorption charging state before taking it off, the electronic device cannot detect the stylus's distance event in time through the error timeout packet (cep_timeout), resulting in the electronic device being unable to recognize that the stylus is in use in the first time, and the user cannot use the stylus normally in the first time after taking it off. Therefore, this solution adds a judgment of the full-charge state to force the adsorption charging state of the stylus before it is fully charged to be recognized as the stylus being in use, so that even if the user takes off the stylus for input in the first time, it can still be used normally.
[0030] Optionally, when the stylus is connected and attached to the electronic device and the stylus is fully charged, the electronic device can determine that the stylus is not in use. It is understandable that when the stylus is attached to the electronic device and is fully charged, the electronic device can promptly sense the stylus's removal event in other ways, so it is not necessary to forcibly identify that the stylus is in use. Simply by the stylus being attached to the electronic device, it is determined that the stylus is not in use.
[0031] Optionally, when the stylus pen is connected and not adsorbed to the electronic device, the electronic device may determine that the use state of the stylus pen is in use. It is understandable that when the stylus pen connected to the electronic device is away from the electronic device, the user is likely to be using the stylus pen.
[0032] Optionally, when the stylus pen is not connected to the electronic device, the electronic device determines that the use state of the stylus pen is not in use. It is understandable that the stylus pen usually needs to be connected to the electronic device for normal input. Therefore, if the electronic device is not connected, it means that the user does not need to use the stylus pen at present.
[0033] In a possible implementation, the first touch mode is a hand touch mode, and the second touch mode is a pen touch mode. The electronic device can determine a matching screen refresh rate as the second refresh rate from multiple refresh rates supported by the pen touch mode in response to the usage status switching from unused to used; and generate a first refresh rate switching instruction based on the second refresh rate of the pen touch mode.
[0034] In this way, when the current user does not need to use the stylus, the current screen refresh rate of the electronic device matches the hand stylus mode. When the touch scene changes and the user currently needs to use the stylus, the electronic device switches the current screen refresh rate to match the pen touch mode. That is, it can match a suitable refresh rate from multiple optional refresh rates in the pen touch mode, and generate a cross-mode refresh rate switching instruction accordingly.
[0035] In a possible implementation, the first touch mode is a pen touch mode, and the second touch mode is a hand touch mode. The electronic device can determine a matching screen refresh rate as the second refresh rate from multiple refresh rates supported by the hand touch mode in response to the usage status switching from use to not use; and generate a first refresh rate switching instruction based on the second refresh rate of the hand touch mode.
[0036] In this way, when the current scene requires the use of a stylus, the current screen refresh rate of the electronic device matches the stylus mode. When a touch scene change is detected and the user does not currently need to use the stylus, the electronic device can switch the current screen refresh rate to match the hand touch mode. That is, it can match a suitable refresh rate from multiple optional refresh rates in the hand touch mode, and generate a cross-mode refresh rate switching instruction accordingly.
[0037] In a possible implementation, the electronic device may also be pre-configured with a whitelist, which includes the touch modes corresponding to various applications. For example, game applications may be forcibly configured as hand touch mode, and applications that require a stylus such as painting and note-taking may be forcibly configured as pen touch mode.
[0038] Therefore, when the application running in the foreground of the electronic device is not in the preset whitelist, the electronic device can directly switch the refresh rate according to the usage scenario of the stylus. For example, in response to the usage state switching from unused to used, or the usage state switching from used to unused, a first refresh rate switching instruction is generated.
[0039] When the application running in the foreground of the electronic device is in the preset whitelist, the electronic device can switch the refresh rate according to the touch mode configured in the preset whitelist. For example, the touch mode corresponding to the application running in the foreground is found from the preset whitelist. When the touch mode corresponding to the application running in the foreground changes, such as switching from the first touch mode to the second touch mode, the electronic device can generate a first refresh rate switching instruction in response to the change of the touch mode.
[0040] As an example, in response to the touch mode corresponding to the application running in the foreground being switched from the first touch mode to the second touch mode, the electronic device can determine that the matching screen refresh rate is the second refresh rate from the multiple refresh rates supported by the second touch mode; and generate a first refresh rate switching instruction based on the second refresh rate of the second touch mode. In this way, when a touch scene change is identified based on the touch mode configured in the whitelist, the current screen refresh rate can be switched to match the changed touch mode. That is, a suitable refresh rate can be matched from the multiple optional refresh rates in the second touch mode, and a cross-mode refresh rate switching instruction can be generated accordingly.
[0041] Similarly, when the touch mode corresponding to the application currently running is switched from the second touch mode to the first touch mode, the electronic device can generate a second refresh rate switching instruction in response to the touch mode change, such as switching from the second refresh rate of the second touch mode to the first refresh rate of the first touch mode. At this time, the electronic device can determine that the matching screen refresh rate is the first refresh rate from the multiple refresh rates supported by the first touch mode; and generate the second refresh rate switching instruction according to the first refresh rate of the first touch mode.
[0042] In some embodiments, due to the change of the touch scene, this solution can switch the working mode of the touch firmware while switching the refresh rate. The touch firmware of the electronic device supports a first working mode and a second working mode, the first working mode corresponds to the first touch mode, and the second working mode corresponds to the second touch mode. The refresh rate switching method provided by this solution also includes: in response to the first refresh rate switching instruction, switching the working mode of the touch firmware from the first working mode to the second working mode. Thereby, not only the screen refresh rate can be matched with the current touch scene (such as the pen touch mode), but also the working mode of the touch firmware can be matched with the current touch scene.
[0043] In some embodiments, the refresh rate switching method provided by the present solution may further include: after the screen refresh rate is switched to the second refresh rate of the second touch mode, controlling the display processor to perform layer synthesis of the image to be displayed; and displaying the image to be displayed synthesized by the display processor at the second refresh rate of the second touch mode. In this way, after completing the refresh rate switching across modes, the layer synthesis of the displayed image can be restored to be the responsibility of the original display processor. And because the refresh rate switching has been completed, the display processor does not currently need to perform the refresh rate switching process, and is only responsible for the layer synthesis process of the displayed image. Of course, if a new refresh rate switching instruction is detected, the display processing still needs to perform the refresh rate switching process.
[0044] In a second aspect, a refresh rate switching device is provided, which is included in an electronic device, and has the function of implementing the electronic device behavior in any of the above-mentioned first aspect and the possible implementation methods of the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software implementation. The hardware or software includes one or more modules or units corresponding to the above-mentioned functions. As an example, the refresh rate switching device may include: a processing module and a display module.
[0045] Among them, the processing module is used to: when the screen refresh rate is the first refresh rate of the first touch mode, detect a first refresh rate switching instruction, and the first refresh rate switching instruction is used to indicate switching from the first refresh rate of the first touch mode to the second refresh rate of the second touch mode; the processing module is also used to: in response to the first refresh rate switching instruction, control the graphics processor to perform layer synthesis of the image to be displayed; the processing module is also used to: control the display processor to switch the screen refresh rate from the first refresh rate of the first touch mode to the second refresh rate of the second touch mode; the display module is used to: display the image to be displayed synthesized by the graphics processor at the second refresh rate of the second touch mode.
[0046] In a possible implementation, the first touch mode is a pen touch mode, and the second touch mode is a hand touch mode, wherein the hand touch mode is used to indicate that the electronic device supports the user to provide input through finger operation, and the pen touch mode is used to indicate that the electronic device supports the user to provide input through both finger operation and stylus operation.
[0047] In a possible implementation, the first touch mode is a hand touch mode, and the second touch mode is a pen touch mode.
[0048] In a possible implementation, the first refresh rate is the same as the second refresh rate; or the first refresh rate is greater than the second refresh rate; or the first refresh rate is greater than the second refresh rate.
[0049] In one possible implementation, when the first refresh rate is greater than the second refresh rate, the processing module is used to: when refreshing and displaying the Nth frame image, detect the first refresh rate switching instruction, where N is a positive integer; in response to the first refresh rate switching instruction, control the display processor to perform layer synthesis of the Nth frame image to obtain the first image to be displayed; and control the display processor to switch the screen refresh rate from the first refresh rate of the first touch mode to the second refresh rate of the first touch mode. The display module is used to: display the first image synthesized by the display processor at the second refresh rate of the first touch mode. The processing module is also used to: when refreshing and displaying the N+1th frame image, in response to the first refresh rate switching instruction, control the graphics processor to perform layer synthesis of the N+1th frame image to obtain the second image to be displayed; and control the display processor to switch the screen refresh rate from the second refresh rate of the first touch mode to the second refresh rate of the second touch mode. The display module is also used to: display the second image synthesized by the graphics processor at the second refresh rate of the second touch mode.
[0050] In a possible implementation, when the first refresh rate is less than the second refresh rate, the processing module is used to: when refreshing and displaying the Nth frame image, detect the first refresh rate switching instruction, where N is a positive integer; in response to the first refresh rate switching instruction, control the graphics processor to perform layer synthesis of the Nth frame image to obtain the first image to be displayed; and control the display processor to switch the screen refresh rate from the first refresh rate of the first touch mode to the first refresh rate of the second touch mode. The display module is used to: display the first image synthesized by the graphics processor at the first refresh rate of the second touch mode. The processing module is also used to: when refreshing and displaying the N+1th frame image, in response to the first refresh rate switching instruction, control the display processor to perform layer synthesis of the N+1th frame image to obtain the second image to be displayed; and control the display processor to switch the screen refresh rate from the first refresh rate of the second touch mode to the second refresh rate of the second touch mode. The display module is also used to: display the second image synthesized by the display processor at the second refresh rate of the second touch mode.
[0051] In a possible implementation, the processing module is further used to: determine the usage status of the stylus; and generate a first refresh rate switching instruction in response to the usage status switching from unused to used, or from used to unused.
[0052] In a possible implementation manner, the processing module is further configured to: receive a usage status of the stylus sent by the stylus.
[0053] In a possible implementation manner, the processing module is further configured to determine a usage state of the stylus pen according to a detected connection state, adsorption state, and full-charge state of the stylus pen.
[0054] In a possible implementation, the processing module is further used for: if it is detected that the stylus is connected and attached to the electronic device, and the stylus is not fully charged, then determining that the stylus is in use; if it is detected that the stylus is connected and attached to the electronic device, and the stylus is fully charged, then determining that the stylus is not in use; if it is detected that the stylus is connected and not attached to the electronic device, then determining that the stylus is in use; if it is detected that the stylus is not connected to the electronic device, then determining that the stylus is not in use.
[0055] In a possible implementation, the first touch mode is a hand touch mode, and the second touch mode is a pen touch mode. The processing module is further configured to: in response to the use state switching from unused to used, determine that a matching screen refresh rate is a second refresh rate from a plurality of refresh rates supported by the pen touch mode; and generate a first refresh rate switching instruction according to the second refresh rate of the pen touch mode.
[0056] In a possible implementation, the first touch mode is a pen touch mode, and the second touch mode is a hand touch mode. The processing module is further used to: in response to the use state switching from use to unuse, determine that the matching screen refresh rate is a second refresh rate from multiple refresh rates supported by the hand touch mode; and generate a first refresh rate switching instruction according to the second refresh rate of the hand touch mode.
[0057] In a possible implementation, the processing module is further configured to: when the foreground application is not in a preset whitelist, in response to the usage status switching from unused to used, or the usage status switching from used to unused, generate a first refresh rate switching instruction.
[0058] In a possible implementation, the processing module is also used to: when the foreground application is in a preset whitelist, match the touch mode corresponding to the foreground application from the preset whitelist; in response to the touch mode corresponding to the foreground application switching from the first touch mode to the second touch mode, generate a first refresh rate switching instruction.
[0059] In a possible implementation, the processing module is also used to: in response to the touch mode corresponding to the foreground application switching from the first touch mode to the second touch mode, determine that the matching screen refresh rate is the second refresh rate from multiple refresh rates supported by the second touch mode; and generate a first refresh rate switching instruction based on the second refresh rate of the second touch mode.
[0060] In a possible implementation, the touch control firmware of the electronic device supports a first working mode and a second working mode, the first working mode corresponds to the first touch control mode, and the second working mode corresponds to the second touch control mode. The processing module is further used to: in response to the first refresh rate switching instruction, switch the working mode of the touch control firmware from the first working mode to the second working mode.
[0061] In a possible implementation, the processing module is also used to: control the display processor to perform layer synthesis of the image to be displayed after the screen refresh rate is switched to the second refresh rate of the second touch mode; and display the image to be displayed synthesized by the display processor at the second refresh rate of the second touch mode.
[0062] In a third aspect, an electronic device is provided, comprising one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and 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 refresh rate switching method in any possible implementation of the first aspect.
[0063] In a fourth aspect, a chip is provided, which is applied to an electronic device; the chip 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 a 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 refresh rate switching method in any possible implementation of the first aspect above.
[0064] In a fifth aspect, an electronic device is provided, the electronic device comprising a stylus pen, wherein the electronic device executes the refresh rate switching method in any possible implementation of the first aspect.
[0065] In a sixth aspect, a computer storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the refresh rate switching method in any possible implementation of the first aspect.
[0066] In a seventh aspect, a computer program product is provided. When the computer program product is run on a computer, the electronic device executes the refresh rate switching method in any possible implementation of the first aspect.
[0067] It can be understood that the beneficial effects that can be achieved by the above-mentioned device of the second aspect, the electronic device of the third aspect, the chip of the fourth aspect, the electronic device of the fifth aspect, the computer storage medium of the sixth aspect, and the computer program product of the seventh aspect can be referred to the beneficial effects of the first aspect and any possible implementation thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 An abstract diagram showing timing provided in an embodiment of the present application;
[0069] Figure 2A waveform diagram showing timing provided in an embodiment of the present application;
[0070] Figure 3 A schematic diagram of a scenario provided for an embodiment of the present application;
[0071] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0072] Figure 5 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0073] Figure 6 A schematic diagram of an event reporting path provided in an embodiment of the present application;
[0074] Figure 7 A schematic diagram of the software structure of another electronic device provided in an embodiment of the present application;
[0075] Figure 8 A schematic diagram of a refresh rate switching method provided in an embodiment of the present application;
[0076] Fig. 9 Module interaction diagram provided in the embodiment of the present application Figure 1 ;
[0077] Fig.10 Module interaction diagram provided in the embodiment of the present application Figure 2 ;
[0078] Fig.11 A schematic diagram of a flow chart of another refresh rate switching method provided in an embodiment of the present application;
[0079] Fig.12 A waveform diagram of a switching display timing provided in an embodiment of the present application;
[0080] Fig.13 Another waveform diagram of switching display timing provided in an embodiment of the present application;
[0081] Fig.14 Module interaction diagram provided in the embodiment of the present application Figure 3 ;
[0082] Fig.15 Module interaction diagram provided in the embodiment of the present application Figure 4 ;
[0083] Fig.16 Module interaction diagram provided in the embodiment of the present application Figure 5 ;
[0084] Fig.17 A flowchart of another refresh rate switching method provided in an embodiment of the present application;
[0085] Fig.18 A schematic diagram of a usage scenario of a stylus pen provided in an embodiment of the present application. DETAILED DESCRIPTION
[0086] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. In the following, the terms "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 indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present embodiment, unless otherwise specified, "multiple" means two or more.
[0087] With the development of touch technology, more and more electronic devices use touch for human-computer interaction. In addition to providing input to the electronic device by operating the screen of the electronic device with fingers, users can also provide input to the electronic device by operating the screen of the electronic device with a stylus pen, so that the electronic device can perform corresponding operations based on the input.
[0088] Moreover, with the improvement of display technology, electronic devices have been updated from supporting fixed screen refresh rates, such as 30Hz and 60Hz in the early days, to supporting multiple screen refresh rates, such as 30Hz, 60Hz, 120Hz and 144Hz refresh rates at the same time, so as to optimize device power consumption while improving user experience.
[0089] However, due to the hardware limitations of the stylus, the touch mode of the stylus is usually adapted to the 60Hz refresh rate of the electronic device, and it cannot adapt to a high refresh rate (such as 144Hz). Therefore, at a 144Hz refresh rate, the electronic device only supports the processing and response of finger input events, but does not support the processing and response of stylus input events, that is, at a 144Hz refresh rate, there is no response when the stylus clicks the screen. Therefore, when adjusting the refresh rate of an electronic device, it is necessary to consider the usage scenario of the stylus.
[0090] However, current electronic devices usually simply switch from a low refresh rate to a high refresh rate, or from a high refresh rate to a low refresh rate, without considering the refresh rate limitations brought about by different touch modes of electronic devices, so that electronic devices support the processing and response of both finger input events and stylus input events at different refresh rates. As a result, in some scenarios where a stylus is required for touch or writing, the screen does not support stylus input due to blindly switching to a high refresh rate such as 144Hz, giving users the experience of being unable to touch or write with the stylus.
[0091] Therefore, when the user needs to use the stylus, the electronic device must switch the refresh rate to a refresh rate that matches the stylus. When the user does not need to use the stylus, the electronic device must switch the refresh rate to a refresh rate that matches the finger.
[0092] Due to the large display timing difference between the refresh rate matched by the stylus and the refresh rate matched by the finger, when the electronic device switches the refresh rate to the refresh rate matched by the stylus, the idle time at the end of the frame is too short. As a result, when the electronic device needs to switch the refresh rate to the refresh rate matched by the finger later, the idle time at the end of the frame is insufficient, resulting in display abnormalities such as a distorted or black screen for one frame of image.
[0093] In order to solve the above problems, the embodiment of the present application provides a refresh rate switching method, whereby the electronic device can not only switch the refresh rate to a refresh rate that matches the stylus when the user needs to use the stylus, but also switch the refresh rate to a refresh rate that matches the finger when the user does not need to use the stylus. At the same time, it can also ensure the normal refresh display of the screen during the switching, avoiding display abnormalities such as a flowery screen or a black screen.
[0094] In order to facilitate the distinction between the processing and response of finger input events and the processing and response of stylus input events, in an embodiment of the present application, the touch scenarios supported by the screen of the electronic device are divided into two touch modes: hand touch mode and pen touch mode.
[0095] The hand touch mode is used to indicate that the screen of the electronic device supports the user to provide input to the electronic device through finger operation, so that the electronic device can perform corresponding operations based on the input finger operation. That is, the screen of the electronic device can process and respond to the finger input operation.
[0096] The pen touch mode is used to indicate that the screen of the electronic device supports not only the user providing input to the electronic device through the stylus operation, but also the user providing input to the electronic device through the finger operation, so that the electronic device can perform corresponding operations based on the input finger operation or stylus operation. That is, the screen of the electronic device can process and respond to both the finger input operation and the stylus input operation.
[0097] In the embodiment of the present application, the refresh rate gears supported by the hand touch mode and the refresh rate gears supported by the pen touch mode are different, and the refresh rate gears supported by the two touch modes may have overlapping parts or different parts. For example, the pen touch mode supports a 60Hz refresh rate but not a 144Hz refresh rate, while the hand touch mode supports both a 60Hz refresh rate and a 144Hz refresh rate.
[0098] In some scenarios, for some electronic devices that do not support high refresh rates, the refresh rate gears supported by the hand touch mode and the refresh rate gears supported by the pen touch mode may also be the same. For example, the pen touch mode and the hand touch mode both support 30Hz refresh rates and 60Hz refresh rates. The embodiments of the present application do not limit the refresh rates supported by the above two touch modes.
[0099] In the embodiment of the present application, the electronic device switches the refresh rate to a refresh rate that matches the stylus, which may refer to switching the refresh rate to a refresh rate level supported by the pen touch mode. This ensures that the electronic device can support the processing and response of stylus input events at the switched refresh rate, thereby ensuring the user's experience of using the stylus.
[0100] The screen of the electronic device may include a display panel (e.g., a liquid crystal display (LCD)) and a touch panel (TP). The display panel is used to display images, videos, etc. The TP may be integrated into the display panel to detect touch operations acting on or near it. In some embodiments, the TP may also be disposed on the surface of the electronic device, at a different location from the display panel.
[0101] Optionally, the switching of the refresh rate of the electronic device may include switching of the screen display configuration, so as to ensure that when the refresh rate of the electronic device is switched to a refresh rate matching the stylus, the display panel of the screen can display normally and avoid display abnormality.
[0102] The switching of the screen display configuration by the above-mentioned electronic device may refer to switching the display timing of the screen, and the display timing may refer to the time sequence in which the image data included in a frame of image is displayed on the display panel. Among them, the display timings corresponding to different refresh rates in the same touch mode are different. For example, in the hand touch mode, the display timing corresponding to the 60Hz refresh rate is different from the display timing corresponding to the 144Hz refresh rate. The display timings corresponding to the same refresh rate in different touch modes are also different. For example, the display timing corresponding to the 60Hz refresh rate in the hand touch mode is also different from the display timing corresponding to the 60Hz refresh rate in the pen touch mode. Of course, the display timings corresponding to different refresh rates in different touch modes are also different.
[0103] Optionally, the switching of the refresh rate of the electronic device may also include the switching of the screen touch configuration, so as to ensure that when the refresh rate of the electronic device is switched to a refresh rate that matches the stylus, the working state of the touch panel of the screen can also match the stylus, avoiding touch abnormalities, so that the user's stylus or finger can input normally.
[0104] As mentioned above, the switching of the screen touch configuration by the electronic device may refer to the switching of the working mode of the touch firmware of the screen. Among them, the touch firmware runs inside the TP and can be used to obtain touch events and to report the obtained touch events. The working mode of the touch firmware can be used to indicate the type of touch input supported by the TP for detection (scanning). Optionally, the working mode of the touch firmware may include firmware mode 1 that supports both stylus input scanning and finger input scanning, and firmware mode 2 that only supports finger input scanning.
[0105] It can be understood that when the electronic device needs to switch to the refresh rate gear in the pen touch mode, it also needs to switch the working mode of the touch firmware to firmware mode 1 that supports stylus input scanning.
[0106] That is to say, in the embodiments of the present application, due to hardware limitations, the screen display configuration and screen touch configuration of the electronic device may be different in different touch modes, and there may be certain differences in the refresh rate gears, anti-interference capabilities and power consumption supported in different touch modes. For example, the 144Hz refresh rate gear only supports the hand touch mode, but not the pen touch mode. Even at the same refresh rate, there are differences in the screen display configuration and screen touch configuration between the hand touch mode and the pen touch mode.
[0107] It can be understood that for the hand touch mode that only considers finger touch input, since there is no need to support stylus input, there is no need to distinguish whether the input type is a stylus or a finger, nor is there any need to increase the scanning of the stylus input. This makes the screen display configuration and screen touch configuration used in the hand touch mode have lower power consumption and stronger anti-interference ability than the screen display configuration and screen touch configuration used in the pen touch mode.
[0108] Therefore, when the electronic device switches the refresh rate to a refresh rate level supported by the pen touch mode, it is necessary to match the screen display configuration and screen touch configuration in the pen touch mode to achieve the corresponding switching of the screen display configuration and the screen touch configuration.
[0109] Optionally, if the refresh rate originally set by the electronic device is a refresh rate gear supported by the hand touch mode, when it needs to be switched to a refresh rate gear supported by the pen touch mode, since the touch mode has changed, the electronic device needs to switch both the screen display configuration and the screen touch configuration to ensure that the display timing of the screen matches the refresh rate gear supported by the pen touch mode, and the working mode of the touch firmware of the screen matches the pen touch mode. In this way, it can be ensured that when the refresh rate of the electronic device is switched, not only the screen can display normally, but also the user's stylus and finger can input normally.
[0110] Optionally, if the refresh rate originally set to the electronic device is a refresh rate level supported by the pen touch mode, when it is necessary to switch to another refresh rate level supported by the pen touch mode, for example, switching the 60Hz refresh rate of the pen touch mode to the 30Hz refresh rate of the pen touch mode, since the touch mode has not changed, the working mode of the touch firmware of the screen remains unchanged and is still firmware mode 1. The electronic device can only switch the screen display configuration to ensure that the display timing of the screen matches the other refresh rate level (30Hz) supported by the pen touch mode.
[0111] Similarly, when the electronic device switches the refresh rate back to the refresh rate level supported by the hand touch mode, it also needs to switch the screen display configuration and the screen touch configuration according to the corresponding touch mode.
[0112] Optionally, if the refresh rate originally set to the electronic device is a refresh rate supported by the pen touch mode, when it needs to be switched to a refresh rate supported by the hand touch mode, since the touch mode has changed, the electronic device needs to switch both the screen display configuration and the screen touch configuration to ensure that the display timing of the screen matches the refresh rate supported by the hand touch mode, and that the working mode of the screen's touch firmware matches the hand touch mode.
[0113] Optionally, if the refresh rate originally set to the electronic device is a refresh rate level supported by the hand touch mode, when it is necessary to switch to another refresh rate level supported by the hand touch mode, for example, the 144Hz refresh rate of the hand touch mode is switched to the 60Hz refresh rate of the hand touch mode, since the touch mode has not changed, the working mode of the touch firmware of the screen remains unchanged and is still firmware mode 2. The electronic device can only switch the screen display configuration to ensure that the display timing of the screen matches the other refresh rate level (60Hz) supported by the hand touch mode.
[0114] See also Figure 1 , is an abstract diagram of a display timing provided by an embodiment of the present application. The display timing can be used to indicate the timing of transmitting image data, which may include vertical timing and horizontal timing.
[0115] In vertical timing, vertical synchronization (Vsync) can indicate the arrival of a new frame of image. Before Vsync, it includes the vertical front porch (VFP), and after Vsync, it includes the vertical back porch (VBP). Between adjacent VBP and VFP is the image data of a frame of image, which will be transmitted line by line by the processor of the electronic device to the display panel for display.
[0116] In horizontal timing, horizontal synchronization (Hsync) can indicate the arrival of a line of image data, which includes multiple pixels. Before each Hsync, a horizontal front porch (HFP) can be included, and after each Hsync, a horizontal back porch (HBP) can be included. Between adjacent HBPs and HFPs is the image data of the line.
[0117] Depend on Figure 1 It can be seen that after the image data of the previous frame is transmitted, it is necessary to pass through VFP before starting to transmit a new frame of image. Among them, no image data is transmitted during VFP, and this period of time can be understood as the idle time at the end of the frame. When starting to transmit a new frame of image, since it has passed through VFP before, Vsync can be used to indicate that the new frame of image has started to be transmitted. Vsync can be a pulse signal. When Vsync ends and passes through VBP, the image data of the frame of image starts to be transmitted, wherein each line of image data can be transmitted through a horizontal timing. And by Figure 1 It can be seen that there is no image data transmission during Vsync, VFP and VBP, while there is image data transmission between adjacent VFP and VBP. Therefore, the time between adjacent VFP and VBP is the time required to transmit one frame of image data, which can be called the effective display time.
[0118] When the image data of a frame of image starts to be transmitted, the image data of a frame of image can be transmitted to the display panel line by line for display. Similarly, when a line of image data starts to be transmitted, it first passes through HFP, and then Hsync indicates that the image data of the line starts to be transmitted. Hsync can be a pulse signal. When Hsync ends and passes through HBP, the image data of the line starts to be transmitted. Figure 1 It can be seen that there is no image data transmission between Hsync, HFP and HBP, but there is image data transmission between adjacent HBP and HFP. This period of time may be the time required to transmit a line of image data, which can be called the display time for each line.
[0119] Therefore, it can be seen that in the process of displaying a frame of image, in addition to the time actually transmitting the image data, it also includes the time occupied by Vsync, VFP, VBP, Hsync, HFP and HBP.
[0120] At present, electronic devices usually use the inter-frame touch drive (long vertical, Long-V) method to achieve switching of different refresh rates in hand touch mode. Long-V can support the effective display time (the time to transmit a frame of image data) in hand touch mode to remain unchanged, and can change the refresh rate by changing the vertical front porch (VFP) parameter in the display timing, that is, the length of the idle time at the end of the frame. Long-V can support dynamic refresh rate switching within 60Hz to 120Hz. Among them, Long-V is a touch drive mode of the screen, which means that after a frame of image (display stage) ends, touch drive is performed again to perform touch detection.
[0121] It can be understood that when the effective display time remains unchanged, by increasing a certain idle time at the end of the frame, the time for displaying a frame of image can be longer, thereby refreshing the displayed image frame less times per second, thus achieving the purpose of reducing the screen refresh rate. Conversely, by reducing a certain idle time at the end of the frame, the time for displaying a frame of image can be shorter, thereby refreshing the displayed image frame more times per second, thus achieving the purpose of increasing the screen refresh rate.
[0122] However, in pen touch mode, electronic devices can only support a maximum refresh rate of 60Hz and need to support stylus scanning, which results in a significant change in the effective display time in pen touch mode, and a shorter idle time at the end of the frame in the display timing. When electronic devices switch refresh rates in this case, it is easy for insufficient idle time at the end of the frame in the display timing to cause display errors during switching, resulting in a frame of image distortion or black screen, and other display abnormalities.
[0123] Exemplarily, as shown in Table 1, the present application provides a display timing corresponding to different refresh rate levels in different touch modes:
[0124] Table 1
[0125]
[0126] As can be seen from Table 1, when the electronic device switches between the display timings corresponding to the refresh rates of 60Hz to 144Hz in the hand touch mode, since there is no need to support the scanning of the stylus input, the effective display time remains unchanged, the display time of each line remains unchanged, and the timing parameters such as HBP, HFP, Hsync, Vsync, and VBP remain unchanged (or do not change much). The electronic device can change the refresh rate by changing the parameters of VFP in the display timing. For example, when the electronic device switches from a refresh rate of 120Hz in the hand touch mode to a refresh rate of 60Hz in the hand touch mode, the electronic device can increase VFP from 26 to 2340 to complete the switching of the display timing.
[0127] However, as can be seen from Table 1, when the electronic device switches from a 60Hz refresh rate in hand touch mode to a 60Hz refresh rate in pen touch mode, the effective display time changes greatly due to the need to support scanning of stylus input. For example, the HBP in the display timing increases from 20 to 318, resulting in an increase in the display time per line. Since the electronic device needs to refresh and display a frame of image every 16.6 milliseconds (ms), when the effective display time increases, the corresponding idle time at the end of the frame will become shorter.
[0128] For example, Figure 2 (a) in FIG. 1 shows a schematic diagram of a display timing of refreshing and displaying a frame of an image in a hand touch mode of an electronic device. Figure 2 (b) in FIG. 1 shows a schematic diagram of the display timing of an electronic device refreshing and displaying a frame of image in pen touch mode. Figure 2 From (a) and (b), we can see that although the refresh rates of the two touch modes are both 60Hz (that is, the time to display a frame of image is 16.6ms), compared with the hand touch mode, the effective display time required in the pen touch mode is relatively large, resulting in too short idle time at the end of the frame.
[0129] Since the display process of a frame of image can be divided into three stages: drawing and rendering, layer synthesis, and screen refresh display, displaying a frame of image originally requires a certain amount of processor resources and time. If the display timing is switched, there needs to be enough idle time at the end of the frame. Especially for some devices that do not have an image frame buffer inside, such as screens that use video mode to transmit image data, each frame of image data requires the processor to transmit the image data to the display panel in real time for display according to the display timing of the refresh rate. Therefore, if the idle time at the end of the frame is too short, the electronic device cannot complete the normal switching of the display timing and the normal display of the image at the same time, resulting in an abnormal display of a frame of image when switching the timing.
[0130] However, the refresh rate in the pen touch mode has the problem of too short idle time at the end of the frame. Therefore, when the electronic device switches from the refresh rate in the pen touch mode to the refresh rate in the hand touch mode, since the idle time at the end of the current frame is too short, the electronic device cannot simultaneously complete the normal switching of the display timing and the normal display of the image, resulting in an abnormal display of one frame of the image when switching the timing.
[0131] Therefore, the embodiment of the present application provides a refresh rate switching method, and when the electronic device detects that the Nth frame image needs to execute the refresh rate switching under different touch modes, the layer synthesis mode of the Nth frame image can be forcibly changed from the synthesis of the mobile display processor (MDP) to the synthesis of the graphics processor (GPU), thereby reducing the MDP load, and the MDP only needs to complete the switching of the display timing in the idle time at the end of the frame. Therefore, in the case of insufficient idle time at the end of the frame, the real-time switching of the display timing and the image display can still be completed normally, avoiding the problem of display abnormality.
[0132] Figure 3 Schematic diagram of a scenario applicable to an embodiment of the present application. The scenario includes a stylus 100 and an electronic device 200. The stylus 100 can provide input to the electronic device 200, and the electronic device 200 performs an operation in response to the input based on the input of the stylus 100. In addition, the user can also provide input to the electronic device 200 through a finger, and the electronic device 200 performs an operation in response to the input based on the input of the user's finger.
[0133] In the embodiment of the present application, the electronic device 200 may be a mobile phone, a tablet computer, a wearable device such as a smart watch, a smart bracelet, etc., a smart home device such as a television, a smart screen, a game console, a smart speaker, a smart projector, a smart TV box, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiment of the present application does not impose any special restrictions on the specific device form of the electronic device 200. Figure 3 The electronic device 200 is taken as a tablet computer as an example for description.
[0134] The electronic device 200 has a screen 201. The screen 201 may include a display panel and a touch panel TP. In some scenarios, the screen 201 composed of the TP and the display panel may also be called a touch screen or a touch screen.
[0135] The display panel is used to display images, videos, etc. The display panel can be LCD, organic light-emitting diode (OLED), active-matrix organic light-emitting diode or active-matrix organic light-emitting diode (AMOLED), flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (QLED), etc.
[0136] TP may also be referred to as a touch sensor, which may be integrated into a display panel to detect a touch operation on or near the display panel, for example, detecting a touch operation of a finger, or detecting a touch operation of a stylus 100. In some embodiments, TP may also be disposed on the surface of the electronic device, at a different location from the display panel.
[0137] The above-mentioned stylus pen 100 (also referred to as a stylus pen) may be, but is not limited to, an inductive pen and a capacitive pen. Capacitive pens may include passive capacitive pens and active capacitive pens. Passive capacitive pens may be referred to as passive capacitive pens, and active capacitive pens may be referred to as active capacitive pens.
[0138] Optionally, when the stylus 100 is an inductive pen, an electromagnetic induction board can be integrated on the screen 201 of the electronic device 200 that interacts with the stylus 100. Coils are distributed on the electromagnetic induction board, and coils are also integrated in the inductive pen. Based on the principle of electromagnetic induction, within the magnetic field generated by the electromagnetic induction board, as the inductive pen moves, the inductive pen can accumulate electrical energy. The inductive pen can transmit the accumulated electrical energy to the electromagnetic induction board through the coil in the inductive pen through free oscillation. The electromagnetic induction board can scan the coil on the electromagnetic induction board based on the electrical energy from the inductive pen and calculate the position of the inductive pen on the screen 201.
[0139] Optionally, one or more electrodes may be provided in the active capacitive pen (e.g., in the pen tip), and the active capacitive pen may transmit signals through the electrodes. When the stylus 100 is an active capacitive pen, an electrode array may be integrated on the screen 201 of the electronic device 200 that interacts with the stylus 100. In one embodiment, the electrode array may be a capacitive electrode array. The electronic device 200 may receive a signal from the active capacitive pen through the electrode array, and then, upon receiving the signal, may identify the position of the active capacitive pen on the screen 201 based on the change in the capacitance value on the screen 201.
[0140] In one embodiment, the stylus 100 and the electronic device 200 can be interconnected through a communication network to achieve interaction of wireless signals. The communication network can be, but is not limited to, a short-range communication network such as a WI-FI hotspot network, a WI-FI peer-to-peer (P2P) network, a Bluetooth network, a zigbee network, or a near-field communication (NFC) network. Optionally, the stylus 100 can also establish a wired connection with the electronic device 200 through a universal serial bus (USB) interface. The embodiment of the present application does not limit the specific communication method between the stylus 100 and the electronic device 200.
[0141] Taking the wireless connection as a Bluetooth connection as an example, both the stylus pen 100 and the electronic device 200 may include a Bluetooth module integrated with a Bluetooth function for communicating via Bluetooth transmission.
[0142] In one possible implementation, the Bluetooth module of the stylus 100 may be normally on. Optionally, the stylus 100 may also be configured with a power switch. After the power is turned on, the Bluetooth module is powered and can be searched and discovered by surrounding devices with Bluetooth modules. After turning on the Bluetooth function, the electronic device 200 can use the Bluetooth module of the electronic device 200 to search for surrounding Bluetooth devices within the Bluetooth transmission range, including the stylus 100. Optionally, the user can click on the electronic device 200 to view the Bluetooth device list, and then select the icon of the stylus 100, so that the electronic device 200 and the stylus 100 start the Bluetooth pairing process, and establish a Bluetooth connection after the pairing is successful.
[0143] In another possible implementation, when the user adsorbs the stylus pen 100 on the side frame or screen 201 of the electronic device 200 , the Bluetooth pairing and / or Bluetooth connection process between the stylus pen 100 and the electronic device 200 may also be triggered.
[0144] Optionally, when the user does not need to use the stylus 100, or the stylus 100 is not in a pairing state, or the remaining power of the stylus 100 is insufficient, the user can also directly bring the stylus 100 close to the electronic device 200 and rely on "strong magnetic attraction" to adsorb the stylus 100 to the frame of the electronic device 200 or the touch screen 11. For example, the stylus 100 can be adsorbed on the long frame of the electronic device 200.
[0145] Among them, "strong magnetic attraction" can ensure the safe storage of the stylus pen 100. In some embodiments, "strong magnetic attraction" can trigger the pairing and / or connection of the stylus pen 100 and the electronic device 200. In other embodiments, "strong magnetic attraction" can also complete the magnetic charging process of the stylus pen 100, which is not limited in the embodiments of the present application.
[0146] In some scenarios, in order to facilitate the storage of the stylus pen 100 , a storage compartment for storing the stylus pen 100 may also be provided on the electronic device 200 .
[0147] In some embodiments, the stylus pen 100 may further include a rechargeable battery, and the stylus pen 100 may charge the rechargeable battery by wireless charging.
[0148] Optionally, the stylus pen 100 may include a wireless charging coil to receive wireless charging input through the wireless charging coil. As a method, the electronic device 200 may also include a wireless charging coil to wirelessly charge the stylus pen through the wireless charging coil. The wireless charging coil of the stylus pen 100 may be coupled with the wireless charging coil of the electronic device 200, and the wireless charging of the rechargeable battery is realized by sensing the alternating electromagnetic field emitted by the wireless charging coil 350 of the electronic device 200.
[0149] As an example, see Figure 4 , is a structural diagram of an electronic device 400 provided in an embodiment of the present application, and the electronic device 400 can be the above-mentioned electronic device 200.
[0150] like Figure 4 As shown, the electronic device 400 may include a processor 410, an external memory interface 420, an internal memory 421, a universal serial bus (USB) interface 430, a charging management module 440, a power management module 441, a battery 442, a wireless communication module 460, a sensor module 480, a button 490, a motor 491, an indicator 492, a camera 493, a display screen 494, and a subscriber identification module (SIM) card interface 495, etc. Among them, the sensor module 480 may include a touch sensor 481.
[0151] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 400. In other embodiments, the electronic device 400 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0152] The processor 410 may include one or more processing units, for example, the processor 410 may include an application processor (AP), a modem processor, a GPU, an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0153] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0154] The processor 410 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 410 is a cache memory. The memory may store instructions or data that the processor 410 has just used or cyclically used. If the processor 410 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 410, and thus improves the efficiency of the system.
[0155] In some embodiments, the processor 410 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor (MIPI) interface, a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0156] Among them, the MIPI interface can be used to connect the processor 410 and peripheral devices such as the display screen 494. The MIPI interface includes a display pixel interface (DPI). In an embodiment of the present application, the processor 410 and the display screen 494 communicate through the DPI interface to realize the display function of the electronic device 400. Among them, the DPI interface can be used to send image data through a display timing, and the display timing can be a MIPI timing that complies with the MIPI protocol. The MIPI timing is used to indicate the time sequence of the image data of a frame of an image, so that the display screen 494 receives the image data in an orderly manner and controls the display screen 494 to display the image.
[0157] It is understandable that the interface connection relationship between the modules shown in this embodiment is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0158] The charging management module 440 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 440 may receive charging input from a wired charger through the USB interface 430. In some wireless charging embodiments, the charging management module 440 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 440 is charging the battery 442, it may also power the electronic device through the power management module 441.
[0159] In some embodiments, the electronic device 400 can support charging the stylus. Among them, the charging management module 440 can receive the input of the battery 442 and convert the DC signal input by the battery 442 into an AC signal. The AC signal is transmitted to the wireless charging coil through the matching circuit. The wireless charging coil can generate an alternating electromagnetic field when receiving the AC signal. The wireless charging coil of the stylus can sense the alternating electromagnetic field and perform wireless charging.
[0160] The power management module 441 is used to connect the battery 442, the charging management module 440 and the processor 410. The power management module 441 receives input from the battery 442 and / or the charging management module 440, and supplies power to the processor 410, the internal memory 421, the external memory, the display screen 494, the camera 493, and the wireless communication module 460. In some embodiments, the power management module 441 may also be disposed in the processor 410. In other embodiments, the power management module 441 and the charging management module 440 may also be disposed in the same device.
[0161] The wireless communication function of the electronic device 100 can be implemented through an antenna, a wireless communication module 460, a modem processor, a baseband processor, and the like.
[0162] The wireless communication module 460 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 400. The wireless communication module 460 can be one or more devices integrating at least one communication processing module. The wireless communication module 460 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 410. The wireless communication module 460 can also receive the signal to be sent from the processor 410, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna. In some embodiments, the wireless communication module 460 may include a Bluetooth module for communicating with other devices (such as a stylus) through Bluetooth communication technology.
[0163] In the embodiment of the present application, the electronic device 100 implements the display function through a GPU, an MDP, a display screen 494, and an application processor.
[0164] The GPU is a microprocessor for image processing, which is connected to the display screen 494 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. In the embodiment of the present application, the GPU can be used for the synthesis and superposition of multiple layers.
[0165] There are two ways to synthesize and overlay layers: GPU synthesis and hardware composer (HWC) synthesis. When HWC synthesis is used, HWC can implement layer synthesis overlay through the hardware device MDP. MDP is a dedicated display processor, which is mainly responsible for the hardware synthesis overlay of multiple layers and display timing (i.e. MIPI timing) control.
[0166] The display screen 494 is used to display images, videos, etc. The display screen 494 may be the above-mentioned screen 201. The display screen 494 includes a display panel. The display panel may be an LCD, an OLED, an AMOLED, etc. The display panel may be coupled to the processor 410 (such as an AP, a system on chip (SOC)) via a MIPI interface. Thus, the display panel may receive image data sent from the processor 410 via the MIPI interface.
[0167] In the embodiment of the present application, the display panel is an LCD as an example, and the display panel may include a display drive integrated circuit (DDIC). The DDIC is used to receive image data sent through the display timing, and control the display panel to control the corresponding liquid crystal molecules based on each pixel in the display panel, so that the display panel displays the image data.
[0168] In the embodiment of the present application, the display screen 494 may be a touch screen. That is, the touch sensor 481 is integrated in the display screen 494. The touch sensor 481 may also be referred to as a "touch panel TP". In other words, the display screen 494 may include a display panel and a touch panel TP. Therefore, the display screen 494 may also be referred to as a "touch screen".
[0169] Among them, the touch sensor 481 is used to detect a touch operation acting on or near it. After the touch operation detected by the touch sensor 481, it can be passed to the upper layer by the driver of the kernel layer (such as TP driver) to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 494. In other embodiments, the touch sensor 481 can also be set on the surface of the electronic device 400, which is different from the position of the display screen 494.
[0170] Optionally, the display screen 494 can be used to display information input by the stylus. For example, the display screen 494 can be used to display the motion trajectory of the stylus. Optionally, the display screen 494 can also display an interface related to the stylus input based on the input of the stylus.
[0171] The external memory interface 420 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 410 through the external memory interface 420 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0172] The internal memory 421 can be used to store computer executable program codes, which include instructions. The processor 410 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 421. For example, in an embodiment of the present application, the processor 410 can switch the refresh rate by executing the instructions stored in the internal memory 421. The internal memory 421 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function, etc. The data storage area may store data created during the use of the electronic device 100, etc. In addition, the internal memory 421 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0173] The methods in the following embodiments can all be implemented in the electronic device 400 having the above hardware structure.
[0174] The software system of the electronic device 400 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 400.
[0175] Figure 5 4 is a software structure diagram of the electronic device 400 provided in the embodiment of the present application. The layered architecture can divide the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into three layers, from top to bottom, namely, the application layer (referred to as the application layer), the application framework layer (referred to as the framework layer), and the kernel layer (also called the driver layer).
[0176] The application layer can include a series of application packages. Figure 5 As shown, the application layer may include multiple application packages such as application 1 and application 2. For example, it may include applications such as camera, drawing, calendar, game, map, navigation, Bluetooth, music, video, short message and desktop launcher.
[0177] The framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions. For example, the framework layer may include a window manager, an activity manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. (not shown in the drawings).
[0178] In some embodiments, Figure 5 As shown, the framework layer may also include a scene recognition module, a frame rate control module, an instruction issuing module, and the like.
[0179] The scene recognition module has the ability to sense external events and can determine the current touch interaction scene of the electronic device based on the sensed external events. In the embodiment of the present application, the touch interaction scene includes a touch scene using a stylus and a touch scene using a finger.
[0180] In the embodiments of the present application, Figure 5 As shown, the scene recognition module includes a stylus service module, which is used to determine whether the stylus is currently in use based on the perceived external events, that is, to determine whether the electronic device is currently in a touch scene using the stylus.
[0181] Optionally, the framework layer may include a wireless communication service module for providing the ability to establish a wireless communication connection with other devices. The scene recognition module may detect whether the electronic device has established a wireless communication connection with other input devices through the wireless communication service module. This can preliminarily determine whether the electronic device can be provided with input by other input devices, thereby facilitating the identification of the current touch interaction scene of the electronic device.
[0182] As an example, Figure 5 As shown, the scene recognition module may include a Bluetooth service module for detecting a connection event of the stylus, that is, whether the electronic device has established a Bluetooth connection with the stylus. When it is detected that the electronic device and the stylus are not connected by Bluetooth, it can be considered that the stylus is not currently in use. The stylus and the electronic device may both include a Bluetooth module to establish a Bluetooth connection with the Bluetooth module.
[0183] Optionally, when the electronic device and the stylus establish a communication connection through other means, the scene recognition module may also include other communication services. For example, when the electronic device and the stylus are connected via Wi-Fi, the scene recognition module may also include a Wi-Fi service module for detecting whether the electronic device and the stylus have established a Wi-Fi connection.
[0184] In the embodiment of the present application, the scene recognition module can also detect the state event of the stylus through the API from the kernel layer driver (such as the wireless charging driver), and the state event can be a charging event, a full-power stop charging event, an adsorption event, a distance (non-adsorption) event, etc. Therefore, the stylus service module can determine whether the stylus is currently in use based on these stylus state events and the above-mentioned connection events, that is, determine whether the electronic device is currently in a touch scene using the stylus.
[0185] After determining whether the stylus is currently in use, the stylus service module can send the stylus status information to the frame rate control module to determine the screen refresh rate suitable for the current touch scene of the electronic device. The frame rate control module is used to control the switching of the screen refresh rate.
[0186] like Figure 5 As shown, the frame rate control module includes a display control module, which is used to match the screen refresh rate gear supported in the current touch scene according to the detected usage status of the stylus and the current screen refresh rate, so as to control the display panel of the display screen to switch to the screen refresh rate gear corresponding to the touch scene.
[0187] Among them, the touch scene can be divided into hand touch mode and pen touch mode according to whether the stylus is in use. The screen refresh rate gear supported in the hand touch mode may be different from the screen refresh rate gear supported in the pen touch mode. Therefore, the frame rate control module needs to control the screen refresh gear switching according to the current touch scene.
[0188] When a change is detected in the current touch scene, such as switching from hand touch mode to pen touch mode, the display control module not only needs to match the corresponding refresh rate, but also needs to match the corresponding touch mode to control the display panel of the display screen to switch to the refresh rate supported by the corresponding touch mode. The switching of the refresh rate can be achieved by controlling the display timing of the display panel. Different refresh rates in different touch modes correspond to different display timings.
[0189] After determining the screen refresh rate suitable for the current touch scenario, the display control module can send a refresh rate switching instruction to the instruction issuing module, which sends the refresh rate switching instruction to the kernel layer driver (such as the display driver) to complete the refresh rate switching.
[0190] In an embodiment of the present application, the framework layer may include a layer synthesis service (SurfaceFlinger) and a hardware synthesizer HWC.
[0191] Among them, SurfaceFlinger is a special process, which is mainly responsible for the fusion of all layers (Surface) in a frame of image. SurfaceFlinger can calculate the position of each Surface in a frame of image based on parameters such as transparency, size, and position, and then hand it over to the hardware synthesizer or GPU to generate the final display frame of image, and then display the image on the display. In other words, the display of a frame of image can be completed by SurfaceFlinger, HWComposer, display, etc.
[0192] HWC is a module for layer synthesis, overlay and display in the Android system, providing hardware support for SurfaceFlinger. That is, HWC has the function or ability to use hardware to complete layer synthesis, overlay and display.
[0193] Among them, SurfaceFlinger provides all soft layer information to HWC and asks HWC for processing methods. In the embodiment of the present application, HWC can decide the layer synthesis method according to whether the touch scene has changed, whether to use hardware HWC synthesis or GPU synthesis. When the layer synthesis method adopts HWC synthesis, HWC can call the hardware device display processor MDP to perform layer synthesis and superposition. Then HWC can output the data of the synthesized superimposed image to the display screen for display. It should be noted that SurfaceFlinger will end the task of synthesizing the image only after obtaining the synthesized superimposed image through the underlying MDP hardware.
[0194] In an embodiment of the present application, the instruction issuing module can send the refresh rate switching instruction to the kernel layer driver (such as the display driver) through SurfaceFlinger and HWC to complete the refresh rate switching.
[0195] Among them, the refresh rate switching process may include: after the display control module decides on the screen refresh rate suitable for the current touch scenario, it sends a refresh rate switching instruction to SurfaceFlinger, SurfaceFlinger sends the refresh rate switching instruction to HWC, and HWC sends the refresh rate switching instruction to the display driver. After receiving the refresh rate switching instruction, the display driver notifies the display driver chip (such as DDIC) to switch to the target refresh rate, and the display driver chip drives the display panel (such as LCD) to complete the screen refresh rate switching, and refreshes the image at the new screen refresh rate.
[0196] In the embodiment of the present application, the electronic device switches the screen refresh rate, in addition to switching the refresh rate of the display panel of the display screen, and may also include switching the working mode of the touch panel of the display screen. Among them, the working mode of the touch firmware may include firmware mode 1 that supports both stylus input scanning and finger input scanning, and firmware mode 2 that only supports finger input scanning.
[0197] like Figure 5 As shown, the frame rate control module may further include a touch control module, which is used to match the working mode of the touch firmware of the corresponding touch panel in the current touch scene according to the detected use status of the stylus.
[0198] After determining the working mode of the touch firmware suitable for the current touch scenario, the touch control module may notify the driver of the kernel layer (such as the touch driver) to complete the working mode switching of the touch firmware.
[0199] Optionally, the display driver and touch driver of the kernel layer may be synchronously notified to complete the refresh rate switching and the touch firmware mode switching. The synchronous notification may mean that when the kernel stage controls the display driver to complete the refresh rate switching of the display panel, the touch driver is synchronously notified to complete the working mode switching of the touch firmware.
[0200] Optionally, the display driver and touch driver of the kernel layer may be asynchronously notified to complete the refresh rate switching and the touch firmware mode switching. The asynchronous notification may refer to triggering the refresh rate switching of the display panel and the working mode switching of the touch firmware at the framework layer.
[0201] The kernel layer is the layer between hardware and software. The kernel layer is used to drive the hardware to make it work. The hardware of the electronic device may include a touch panel, a display panel, a wireless charging coil, etc. The final functions of the Android operating system are all completed through the kernel layer.
[0202] In the embodiment of the present application, the kernel layer at least includes a display driver, a touch driver, a wireless charging driver, etc. The embodiment of the present application does not impose any restrictions on this. In one embodiment, when the electronic device supports Bluetooth, the kernel layer of the electronic device may also include a Bluetooth driver.
[0203] The display driver can drive the display panel to work. The display panel may include a display driver chip (eg, DDIC), and the display driver is used to drive the DDIC to complete the processing and implementation of image display on the display panel.
[0204] In the embodiment of the present application, the display driver can also be used to drive the DDIC to complete the switching of the screen refresh rate.
[0205] like Figure 5 As shown, the display driver may include a GPU synthesis module, an MDP synthesis module, an MDP display switching module, and an MDP display sending driver. Among them, the display driver can control whether the superposition synthesis of the layers is completed by the GPU synthesis module or the MDP synthesis module. The MDP display switching module is used to control the display timing switching of the display panel according to the refresh rate switching instruction issued. The MDP display sending driver is used to send image data to the DDIC according to the display timing to drive the DDIC to complete the display of the image data.
[0206] Taking the user starting application A as an example, after the user starts application A, the display screen will display the interface of application A. Specifically, application A sends the display parameters of the interface to be displayed to SurfaceFlinger. SurfaceFlinger is responsible for controlling the fusion of all layers in the interface. SurfaceFlinger sends the display parameters of the interface (such as memory address, color, etc.) to HWC through the interface for interface fusion. Usually, in the synthesis of the image, HWC obtains the synthesized image according to the display parameters of each interface by calling the underlying hardware MDP. HWC sends the image synthesized by the underlying hardware MDP to the display driver of the kernel layer. The display driver of the kernel layer gives the synthesized image to the display driver chip of the hardware layer, and the display driver chip of the hardware layer sends the synthesized image to the display panel for display. In the above manner, the display panel can complete the refresh display process of a frame of image.
[0207] In the embodiment of the present application, if the screen refresh rate needs to be switched under different touch modes when refreshing the Nth frame image, the HWC can force the layer synthesis mode of the Nth frame image to be changed to GPU synthesis, and send instructions to the driver (such as display driver) at the kernel stage to control the GPU synthesis module to realize the layer synthesis of the Nth frame image. In this way, the MDP load is reduced, and the MDP is only responsible for the display timing switching of the display panel.
[0208] The touch driver can work with the touch panel TP. The touch panel runs touch firmware, and the touch driver can be used to drive the touch firmware to obtain touch events and report the obtained touch events.
[0209] In the embodiment of the present application, the touch driver can also be used to drive the touch firmware to complete the switching of the working mode. The working mode may include the above-mentioned firmware mode 1 and firmware mode 2. In some embodiments, when it is detected that the screen refresh rate needs to be switched under different touch modes, the touch control module can send instructions to the driver in the kernel stage (such as the touch driver) to drive the touch firmware to complete the switching of the working mode.
[0210] The wireless charging driver (also called the wireless charging management module) is used to drive the wireless charging coil to complete the wireless charging of other devices (such as a stylus). In the embodiment of the present application, the wireless charging driver can be used to report the status event of the stylus, which can be a full-charge stop event, an adsorption event, a distance (non-adsorption) event, etc.
[0211] Taking the example of wireless charging of a stylus by an electronic device, the electronic device can control the battery of the electronic device to output current to the wireless charging coil of the electronic device through the wireless charging chip. Thus, the wireless charging coil of the electronic device can emit a high-frequency magnetic field. When the wireless charging coil of the stylus is paired with the wireless charging coil of the electronic device, the high-frequency magnetic field can generate an induced current on the wireless charging coil of the stylus. Thus, the wireless charging chip of the stylus can detect the induced current and input the induced current into the battery of the stylus.
[0212] like Figure 6 As shown, when the wireless charging chip of the electronic device recognizes through the wireless charging coil the adsorption event of the stylus (adsorption on the electronic device from the distant state), or the full-charge stop charging event (adsorption on the electronic device to be fully charged), or the distant event (distant from the adsorption stop charging state), etc., an interrupt signal (Interrupt) can be generated to trigger the chip driver of the kernel layer to process the interrupt process, and notify the wireless charging driver of the relevant events through the chip driver, which is further reported to the stylus service by the wireless charging driver, and finally used to realize the use status identification of the stylus. In some scenarios, the wireless charging driver can also report relevant status events to the Bluetooth service, and the Bluetooth service reports the status events and connection events of the stylus to the stylus service.
[0213] Usually, the wireless charging chip is in a low-power Q scanning mode after it is turned on or stopped. At this time, the wireless charging chip will periodically collect the Q value of the wireless charging coil. The Q value is a parameter used to indicate the efficiency of wireless charging and the quality of power transmission. When the stylus is adsorbed on the electronic device from a distant state, the wireless charging chip will detect that the Q value of the wireless charging coil has changed. At this time, the wireless charging chip can generate an interrupt signal (Interrupt) to notify the wireless charging driver through the chip-driven interrupt process. The wireless charging driver reports the adsorption event to the stylus service, or reports it to the Bluetooth service, and the Bluetooth service further reports it to the stylus service.
[0214] After the stylus is adsorbed on the electronic device and fully charged, it is in the adsorption and stopping charging state. At this time, when the stylus is moved away from the adsorption and stopping charging state, the wireless charging chip will also monitor the change in the Q value of the wireless charging coil. At this time, the wireless charging chip can generate an interrupt signal (Interrupt) to notify the wireless charging driver through the chip-driven interrupt process. The wireless charging driver reports the distance event during adsorption and stopping charging to the stylus service, or reports it to the Bluetooth service, which is further reported to the stylus service by the Bluetooth service.
[0215] It is understandable that the adsorption event of the stylus pen and the distance event when the stylus pen is adsorbed and stopped charging can be identified by scanning Q and reported in time. However, the distance event when the stylus pen is adsorbed and charged is currently reported only when the error timeout packet (cep_timeout) is identified.
[0216] At present, in order to ensure the smooth progress of the wireless charging process, the stylus and the electronic device need to transmit a data packet within a specified time. The transmitted data packet can be an error data packet (control error packet, CEP). If the electronic device does not receive the data packet within the specified time, the electronic device can detect the error timeout packet (cep_timeout), and the electronic device can then assume that the stylus has moved away. However, the detection of cep_timeout itself has a delay (such as 1.5s). Therefore, for the event of the stylus being away during adsorption and charging, it cannot be reported in time through cep_timeout recognition. This makes it impossible for the electronic device to recognize the use status of the stylus in time when the user uses the stylus for the first time, and it is impossible to switch the refresh rate or the touch firmware mode in time, resulting in touch abnormalities, affecting the user's experience of using the stylus.
[0217] In order to solve the above problem, in the embodiment of the present application, a full-charge stop state is added to identify the usage status of the stylus.
[0218] Specifically, after the stylus is adsorbed on the electronic device and fully charged, the stylus is in the adsorption and charging stop state. At this time, the stylus can notify the wireless charging coil of the electronic device of the full charge event (charge done) through the Qi protocol of the wireless charging coil. After the wireless charging coil of the electronic device receives the charge done event, the wireless charging chip of the electronic device can generate an interrupt signal (Interrupt) to notify the wireless charging driver through the chip-driven interrupt process. The wireless charging driver reports the full charge event to the stylus service, or reports it to the Bluetooth service, which is further reported to the stylus service by the Bluetooth service. Therefore, the stylus service identifies the use status of the stylus based on the connection event, adsorption event, and charging status to determine whether the current touch scene of the electronic device has changed, and realizes the intelligent switching of the corresponding refresh rate and touch firmware mode under different touch scenes.
[0219] It can be understood that the embodiments of the present application do not limit the structure of the framework layer and the kernel layer. The framework layer may include more service modules, and the kernel layer may include more driver processing modules.
[0220] For example, Figure 7As shown, the framework layer may also include a whitelist service for configuring corresponding touch modes for some applications. For example, for applications corresponding to some game scenarios, since a stylus is not required, the touch scenario may be configured to be a hand touch mode by force, and for applications corresponding to some stylus usage scenarios, such as drawing, note-taking, etc., the touch scenario may be configured to be a pen touch mode by force.
[0221] Optionally, the whitelist service may store an application whitelist corresponding to the hand touch mode and an application whitelist corresponding to the pen touch mode.
[0222] like Figure 7 As shown, the whitelist service can be configured in the above-mentioned frame rate control module, so that the frame rate control module can make a comprehensive decision on the screen refresh rate suitable for the current touch scene of the electronic device based on the whitelist service and the stylus service.
[0223] As a method, the frame rate control module can prioritize the touch scene configured in the whitelist service to determine the screen refresh rate suitable for the current touch scene of the electronic device. When the whitelist service does not configure the corresponding touch scene, the screen refresh rate suitable for the current touch scene of the electronic device is determined based on the state information of the stylus sent by the stylus service.
[0224] It is understandable that the software structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer layers than shown in the figure, or there may be more functional modules in each layer, or the functional modules may be arranged at different layers. For example, the frame rate control module, scene recognition module, and instruction issuing module may be arranged at the application layer.
[0225] The methods in the following embodiments can all be implemented in the electronic device 400 having the above software structure.
[0226] The following will take an electronic device as an example to specifically explain the technical solution provided in the embodiments of the present application.
[0227] like Figure 8 As shown, a refresh rate switching method provided in an embodiment of the present application may include:
[0228] S800: When the electronic device starts to refresh and display the Nth frame image, a first refresh rate switching instruction is detected.
[0229] The electronic device supports a hand touch mode and a pen touch mode, the electronic device supports a first refresh rate in the pen touch mode, and supports a second refresh rate in the hand touch mode. The first refresh rate and the second refresh rate may be the same or different.
[0230] In some embodiments, the first refresh rate switching instruction may be used to instruct switching from the first refresh rate in the pen touch mode to the second refresh rate in the hand touch mode.
[0231] When the electronic device detects the first refresh rate switching instruction, it can be determined that the refresh rate switching between different touch modes needs to be done. Because when switching the refresh rate between different touch modes, the refresh rate switching is implemented by the display processor MDP. For the scenario of switching from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode, if the layer synthesis processing of the image frame is still performed by the display processor MDP, the MDP load is too large, and the image frame will be abnormally displayed because the frame tail time is too short. Therefore, in an embodiment of the present application, the layer synthesis processing can be handed over to the graphics processor GPU to reduce the MDP load, and the MDP only needs to implement refresh rate switching.
[0232] In some embodiments, the refresh display of each frame of image may be triggered by a Vsync signal. The electronic device may determine to start refreshing and displaying a new frame of image when a Vsync signal is detected. It is understood that if the electronic device detects a first refresh rate switching instruction when starting to refresh and display a new frame of image, such as the Nth frame of image, the refresh rate switching method provided in the embodiment of the present application may be executed.
[0233] Optionally, the electronic device may identify the current touch scene to match the refresh rate in the corresponding touch mode according to the identified touch scene. If the refresh rate in the corresponding touch mode is different from the refresh rate of the touch mode currently used by the electronic device, the electronic device may trigger a refresh rate switch. If the refresh rate switch triggered is a switch from the refresh rate supported by the pen touch mode to the refresh rate supported by the hand touch mode, it can be confirmed that the first refresh rate switch instruction has been detected.
[0234] Optionally, each touch mode corresponds to one or more matching screen refresh rates. The screen refresh rate gears corresponding to each touch mode can be the same or different, and can have repeated parts or no repeated parts.
[0235] The screen refresh rate corresponding to each touch mode can be pre-associated through a correspondence table, so that the electronic device can match the screen refresh rate suitable for the current touch scene according to the recognized touch scene based on the preset correspondence table. The correspondence table can be pre-stored in the electronic device.
[0236] For example, as shown in Table 2, the hand touch mode (identified by serial number 1) corresponds to 1 to 4 matching screen refresh rates, and the pen touch mode (identified by serial number 2) corresponds to 1 matching screen refresh rate.
[0237] Table 2
[0238]
[0239] As an example, the first refresh rate switching instruction may be used to instruct switching from the 60 Hz gear in the pen touch mode (identified by serial number 2-1) to the 60 Hz gear in the hand touch mode (identified by serial number 1-2).
[0240] As another example, the first refresh rate switching instruction may also be used to instruct switching from the 60 Hz gear in the pen touch mode (identified by serial number 2-1) to the 144 Hz gear in the hand touch mode (identified by serial number 1-4).
[0241] In other embodiments, the first refresh rate switching instruction may also be used to instruct switching from the second refresh rate in the hand touch mode to the first refresh rate in the pen touch mode. For example, the first refresh rate switching instruction may be used to instruct switching from the 60Hz gear in the hand touch mode (identified by serial number 1-2) to the 60Hz gear in the pen touch mode (identified by serial number 2-1). For another example, the first refresh rate switching instruction may also be used to instruct switching from the 144Hz gear in the hand touch mode (identified by serial number 1-4) to the 60Hz gear in the pen touch mode (identified by serial number 2-1).
[0242] Optionally, the electronic device may identify the current touch scene to match the refresh rate in the corresponding touch mode according to the identified touch scene. If the refresh rate in the corresponding touch mode is different from the refresh rate of the touch mode currently used by the electronic device, the electronic device may trigger a refresh rate switch. If the refresh rate switch triggered is a switch from the refresh rate supported by the hand touch mode to the refresh rate supported by the pen touch mode, it can be confirmed that the first refresh rate switch instruction has been detected.
[0243] In some embodiments, the electronic device can identify the current touch scene according to whether the stylus is in use.
[0244] In some embodiments, the electronic device may also identify the current touch scene according to the touch scene configured in the application whitelist.
[0245] In some embodiments, the electronic device may also identify the current touch scene based on whether the stylus is in use and the touch scene configured in the application whitelist. In the embodiments of the present application, the electronic device does not limit the way in which the current touch scene is identified.
[0246] In some embodiments, when the electronic device triggers the refresh rate switch, it may also trigger the working mode switch of the touch firmware.
[0247] Optionally, the electronic device can identify the current touch scene to match the working mode of the touch firmware in the corresponding touch mode according to the identified touch scene. If the working mode of the touch firmware in the corresponding touch mode is different from the working mode currently used by the touch firmware of the electronic device, the electronic device can trigger the working mode switch of the touch firmware.
[0248] Optionally, each touch mode corresponds to one or more matching working modes of the touch firmware. The working modes of the touch firmware corresponding to each touch mode can be pre-associated through a correspondence table, so that the electronic device can match the working mode of the touch firmware suitable for the current touch scene based on the recognized touch scene and the preset correspondence table. The correspondence table can be pre-stored in the electronic device.
[0249] For example, as shown in Table 3, the hand touch mode (marked with serial number 1) corresponds to 1 to 4 matching screen refresh rates and a touch firmware working mode, and the pen touch mode (marked with serial number 2) corresponds to 1 to 3 matching screen refresh rates and a touch firmware working mode.
[0250] Table 3
[0251]
[0252] When the electronic device recognizes that the touch scene sends a change, for example, when it changes from the hand touch mode to the pen touch mode, the electronic device can match the corresponding touch firmware working mode - firmware mode 2 according to the changed touch scene, i.e., the pen touch mode, and send relevant instructions to the touch driver of the kernel layer to drive the touch firmware working mode to switch to firmware mode 2. For another example, when it changes from the pen touch mode to the hand touch mode, the electronic device can match the corresponding touch firmware working mode - firmware mode 1 according to the changed touch scene, i.e., the hand touch mode, and send relevant instructions to the touch driver of the kernel layer to drive the touch firmware working mode to switch to firmware mode 1.
[0253] S810: In response to the first refresh rate switching instruction, the electronic device performs layer synthesis processing on the Nth frame image through the GPU to obtain an image to be displayed.
[0254] In the embodiment of the present application, when the electronic device detects that the refresh rate of the Nth frame image needs to be switched to a different mode, the electronic device can forcibly change the layer synthesis mode of the Nth frame image to GPU synthesis. Thus, the electronic device can obtain the image to be displayed after the GPU layer synthesis is superimposed and transmitted to the display screen.
[0255] Optionally, when the electronic device starts to refresh and display the Nth frame image, SurfaceFlinger can obtain all layers of the Nth frame image and the first refresh rate switching instruction, and provide the data of all layers and the first refresh rate switching instruction to HWC, and ask HWC for processing. Since different modes of refresh rate switching are required, HWC can force all layer synthesis methods marked by all layers to be set to GPU synthesis according to the first refresh rate switching instruction, so that the GPU can synthesize and superimpose all layers of the Nth frame image, and finally form a frame of image to be transmitted to the display screen.
[0256] In some embodiments, when the first refresh rate switching instruction detected in the Nth frame image indicates switching from the first refresh rate in the pen touch mode to the second refresh rate in the hand touch mode, since the idle time at the end of the frame in the pen touch mode is too short, it is necessary to forcibly change the layer synthesis method of the current image to GPU synthesis to reduce the MDP load.
[0257] In some embodiments, when the first refresh rate switching instruction detected in the Nth frame image indicates switching from the second refresh rate in the hand touch mode to the first refresh rate in the pen touch mode, since the idle time at the end of the frame in the hand touch mode is usually sufficient, such as Figure 2 As shown in (a), therefore, for this refresh rate switching scenario, it is not necessary to forcibly change the layer synthesis mode of the current image to GPU synthesis, and it is still executed by MDP. At this time, in response to the first refresh rate switching instruction, the electronic device still performs layer synthesis processing on the Nth frame image through MDP to obtain the image to be displayed. Of course, for this refresh rate switching scenario, it is also possible to forcibly change the layer synthesis mode of the current image to GPU synthesis to reduce the MDP load. In this way, for the refresh rate switching scenario from hand to pen and the refresh rate switching scenario from pen to hand, it may not be differentiated or it may be differentiated. The embodiments of the present application are not limited to this.
[0258] S820. In response to the first refresh rate switching instruction, the electronic device switches the screen refresh rate of the display screen from the first refresh rate to the second refresh rate through the MDP.
[0259] In the embodiment of the present application, when the first refresh rate switching instruction detected by the Nth frame image indicates switching from the first refresh rate in the pen touch mode to the second refresh rate in the hand touch mode, the electronic device can determine that the Nth frame image needs to switch the refresh rate of different modes. Thus, the electronic device can control the switching of the display timing through the MDP, so as to switch the screen refresh rate of the display screen from the first refresh rate to the second refresh rate by changing the display timing parameters.
[0260] In the embodiment of the present application, in different touch modes, the display timings corresponding to different refresh rates can be pre-associated through a correspondence table, as shown in Table 2. Therefore, when the electronic device needs to switch the refresh rate, the matching display timing can be determined according to the preset correspondence table, so as to complete the refresh rate switching based on the matching display timing.
[0261] For example, taking the switch from the 60Hz gear in the pen touch mode to the 60Hz gear in the hand touch mode as an example, please refer to Table 2, the display timing corresponding to the 60Hz gear in the pen touch mode can be determined. Compared with the display timing corresponding to the 60Hz gear in the hand touch mode, the HBP, HFP, and VFP have changed. Therefore, the electronic device can reduce the HBP from 318 to 20, the HFP from 20 to 19, and the VFP from 26 to 2340 in the display timing corresponding to the 60Hz in the current pen touch mode. Thereby, the effective display time is shortened and the frame tail space is increased, but the time to refresh and display a frame of image remains unchanged at 16.6ms. For example, refer to Figure 2 The display timing diagram corresponding to the 60Hz gear in the pen touch mode shown in (b) and Figure 2 The display timing diagram corresponding to the 60Hz gear in the hand touch mode shown in (a) is shown in FIG. Ensure that the current display timing still meets the 60Hz screen refresh rate. Thus, the display timing is switched, and then the electronic device transmits the image data to the display screen according to the switched display timing, so that the displayed image can be refreshed at the switched 60Hz screen refresh rate that matches the finger touch.
[0262] It is understandable that Figure 2 As shown in (b), the frame tail time in the display timing corresponding to the 60Hz gear in the pen touch mode is too short. When it is necessary to switch to the 60Hz gear in the hand touch mode where the timing difference is larger, the MDP cannot simultaneously complete the layer synthesis processing of the image frame and the display timing switching corresponding to the refresh rate. In the embodiment of the present application, since the layer synthesis processing of the image frame has been forced to be executed by the graphics processor GPU, the MDP load is reduced. Therefore, the MDP can successfully complete the display timing switching corresponding to the refresh rate within the too short frame tail time. In this way, the normal display of the image frame is ensured, and the refresh rate switching is also completed.
[0263] In some embodiments, when the first refresh rate switching instruction detected by the Nth frame image indicates switching from the second refresh rate in the hand touch mode to the first refresh rate in the pen touch mode, the electronic device may also determine that the Nth frame image needs to switch the refresh rate of different modes. Thus, the electronic device can control the switching of the display timing through the MDP, so as to switch the screen refresh rate of the display screen from the second refresh rate to the first refresh rate by changing the display timing parameters.
[0264] For example, taking the switching from the 60Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode as an example, please refer to Table 2, the display timing corresponding to the 60Hz gear in the hand touch mode can be determined. Compared with the display timing corresponding to the 60Hz gear in the pen touch mode, HBP, HFP, and VFP have changed. Therefore, the electronic device can increase the HBP in the display timing corresponding to the 60Hz in the current hand touch mode to 318, increase the HFP to 20, and reduce the VFP to 26. Thereby increasing the effective display time and shortening the frame tail space, but the time for refreshing and displaying a frame of image remains unchanged at 16.6ms. Ensure that the current display timing not only meets the 60Hz screen refresh rate, but also supports the scanning of the stylus input. Thereby realizing the switching of the display timing, and then the electronic device transmits the image data to the display screen according to the switched display timing, so that the displayed image can be refreshed at the switched 60Hz screen refresh rate matching the stylus.
[0265] It is understandable that Figure 2 As shown in (a), the frame tail time in the display timing corresponding to the 60Hz gear in the hand touch mode is sufficient. Therefore, in the embodiment of the present application, when it is necessary to switch to the 60Hz gear in the pen touch mode with a larger timing difference, the MDP can simultaneously complete the layer synthesis processing of the image frame and the display timing switching corresponding to the refresh rate, or force the layer synthesis processing of the image frame to be executed by the graphics processor GPU, and the MDP only completes the display timing switching corresponding to the refresh rate.
[0266] S830: The electronic device displays the image to be displayed at the second refresh rate.
[0267] In an embodiment of the present application, when the first refresh rate switching instruction indicates switching from the first refresh rate in the pen touch mode to the second refresh rate in the hand touch mode, the electronic device can transmit the data of the image to be displayed formed after the Nth frame image is synthesized by the GPU to the display screen for display through the switched display timing after the MDP controls the switching of the display timing. Since the MDP only needs to implement the refresh rate switching, and the layer synthesis processing is performed by the GPU, even if the frame tail space time after the display timing is switched is too short, the electronic device can normally complete the display timing switching and the normal display of the Nth frame image.
[0268] For example, Fig. 9As shown, when refreshing and displaying the Nth frame image in the kernel stage, if the display driver of the electronic device receives the first refresh rate switching instruction, it can drive the GPU synthesis module to complete the synthesis and superposition of the layers of the Nth frame image, and drive the MDP display switching module to complete the corresponding display timing switching. After the GPU synthesis of the Nth frame image is completed and the display timing switching is completed, the MDP display driver (MDP MIPI driver) is controlled to transmit the GPU synthesized image to be displayed to the display panel (such as LCD) through the MIPI interface according to the switched display timing.
[0269] The display panel may include a display driver chip DDIC for receiving data of an image to be displayed sent via a display timing, and controlling the display panel to control corresponding liquid crystal molecules based on each pixel in the display panel so that the display panel displays the image to be displayed.
[0270] It can be understood that since the Nth frame image has completed the display timing switching process, that is, the screen refresh rate switching process, when the electronic device starts to refresh and display the N+1th frame image, there is no need to switch the display timing, and the N+1th frame image can restore the original layer synthesis method. For example, all layers of the N+1th frame image are MDP synthesized.
[0271] For example, Fig.10 As shown, when refreshing and displaying the N+1th frame image in the kernel stage, the display driver of the electronic device does not receive the first refresh rate switching instruction, so there is no need to drive the MDP display switching module to complete the corresponding display timing switching, and the original layer synthesis method can be restored, that is, the MDP synthesis module is driven to complete the synthesis and superposition of the layers of the N+1th frame image. After the MDP synthesis of the N+1th frame image is completed, the MDP display driver (MDP MIPI driver) is controlled to transmit the image to be displayed after the MDP synthesis to the display panel (such as LCD) through the MIPI interface for display according to the switched display timing.
[0272] It can be understood that the N-1th frame image is still refreshed and displayed at the screen refresh rate before the switch. When refreshing and displaying the N-1th frame image in the kernel stage, the display driver of the electronic device still uses the original layer synthesis method, that is, drives the MDP synthesis module to complete the synthesis and superposition of the layers of the N-1th frame image. After the MDP synthesis of the N-1th frame image is completed, the MDP display driver (MDP MIPI driver) is controlled to transmit the image to be displayed after the MDP synthesis to the display panel (such as LCD) through the MIPI interface for display according to the display timing before the switch.
[0273] In some embodiments, when the first refresh rate switching instruction detected by the Nth frame image indicates switching from the second refresh rate in the hand touch mode to the first refresh rate in the pen touch mode, if the layer synthesis processing of the Nth frame image is also forced to be executed by the graphics processor GPU, then after the electronic device controls the switching of the display timing through the MDP, it can transmit the data of the image to be displayed formed after the Nth frame image is synthesized by the GPU to the display screen for display through the switched display timing. If the Nth frame image still retains the original layer synthesis method, such as layer synthesis is performed by the MDP, then after the electronic device simultaneously controls the switching of the display timing through the MDP, it can transmit the data of the image to be displayed formed after the Nth frame image is synthesized by the MDP to the display screen for display through the switched display timing.
[0274] In some scenarios, when the electronic device starts to refresh and display the Nth frame image, if a first refresh rate switching instruction is detected, the electronic device may also start to respond to the first refresh rate switching instruction during the refresh display process of the next frame, i.e., the N+1th frame image, that is, complete the switch from the first refresh rate to the second refresh rate during the refresh display process of the N+1th frame image.
[0275] It can be understood that the above embodiment mainly takes the refresh rate switching from the pen touch mode to the hand touch mode as an example to introduce the refresh rate switching method in different touch modes. For switching from the refresh rate in the hand touch mode to the refresh rate in the pen touch mode, the above principle can also be used to implement it.
[0276] For example, when the electronic device starts to refresh and display the Nth frame image, if a second refresh rate switching instruction is detected, the second refresh rate switching instruction can be used to instruct to switch from the second refresh rate in the hand touch mode to the first refresh rate in the pen touch mode. Then, in response to the second refresh rate switching instruction, the electronic device can perform layer synthesis processing on the Nth frame image through the GPU to obtain the image to be displayed, and switch the screen refresh rate of the display screen from the second refresh rate in the hand touch mode to the first refresh rate in the pen touch mode through the MDP. Thus, the electronic device can display the image to be displayed at the first refresh rate.
[0277] The embodiment of the present application provides a method for switching refresh rates, which can switch the layer synthesis processing of the image frame originally performed by the display processor MDP to the layer synthesis processing of the image frame performed by the graphics processor GPU when it is necessary to switch the refresh rate of different modes. Thereby, the MDP load can be reduced, and only the switching of the MDP display timing needs to be completed in the frame idle area, and the MDP synthesis action is no longer performed at the same time. Thereby, it is ensured that the image frame can be sent to the display in time, and the problem of one frame of image not being able to be displayed normally during the switching process is avoided.
[0278] In some embodiments, when the first refresh rate is the same as the second refresh rate, it can be considered that the refresh rate switch triggered by the electronic device only involves the switch of the touch mode, and does not change the specific frame rate gear, that is, the time to refresh and display each frame of the image before and after the switch remains unchanged. For example, switch from the 60Hz gear in the pen touch mode to the 60Hz gear in the hand touch mode. When the display driver completes the refresh rate switch, it only involves the switch of the touch mode, and does not change the specific frame rate (always 60Hz), that is, the time to refresh and display each frame of the image before and after the switch remains unchanged at 16.6ms.
[0279] In some embodiments, when the above-mentioned first refresh rate is different from the second refresh rate, it can be considered that the refresh rate switch triggered by the electronic device not only involves the switching of the touch mode, but also involves the switching of the specific frame rate gear, that is, the time for refreshing and displaying each frame of the image before and after the switching changes. For example, from the 144Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode. When the display driver completes the refresh rate switching, it not only involves the switching of the touch mode, but also involves the switching of the specific frame rate gear (from 144Hz to 60Hz), that is, the time for refreshing and displaying each frame of the image before the switch is 6.9ms, and the time for refreshing and displaying each frame of the image after the switch is 16.6ms.
[0280] In an embodiment of the present application, for scenarios involving both switching of touch modes and switching of frame rate gears, if the hardware of the electronic device can support simultaneous switching of touch modes and switching of frame rate gears, the electronic device can directly implement switching from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode, or switching from the second refresh rate in hand touch mode to the first refresh rate in pen touch mode during the refresh display process of the Nth frame.
[0281] For example, when the electronic device starts to refresh and display the Nth frame image, it detects a first refresh rate switching instruction for instructing to switch from the first refresh rate in the pen touch mode to the second refresh rate in the hand touch mode. In response to the first refresh rate switching instruction, the electronic device performs layer synthesis processing on the Nth frame image through the GPU to obtain the first image to be displayed. And the screen refresh rate of the display screen is switched from the first refresh rate in the pen touch mode to the second refresh rate in the hand touch mode through the MDP. Thus, the electronic device displays the first image at the second refresh rate in the hand touch mode.
[0282] In an embodiment of the present application, if the hardware of the electronic device cannot support the switching of the touch mode and the switching of the frame rate gear at the same time, the electronic device may also execute the switching of the touch mode and the switching of the frame rate gear separately.
[0283] In some embodiments, when the first refresh rate switching instruction is used to instruct switching from the second refresh rate in the hand touch mode to the first refresh rate in the pen touch mode, the electronic device can first switch the frame rate gear and then switch the touch mode, thereby completing the switching of different refresh rates in different touch modes.
[0284] See also Fig.11 , an embodiment of the present application provides another refresh rate switching method, which may include:
[0285] S1100: When the electronic device starts to refresh and display the Nth frame image, a first refresh rate switching instruction is detected.
[0286] In the embodiment of the present application, the electronic device supports a first refresh rate in the pen touch mode, and supports a first refresh rate and a second refresh rate in the hand touch mode. The first refresh rate is different from the second refresh rate.
[0287] In some embodiments, the first refresh rate switching instruction is used to instruct switching from the second refresh rate in the hand touch mode to the first refresh rate in the pen touch mode. For example, the first refresh rate switching instruction may be used to instruct switching from the 144 Hz gear in the hand touch mode to the 60 Hz gear in the pen touch mode. The electronic device may support 60 Hz and 144 Hz in the hand touch mode.
[0288] When the electronic device detects the first refresh rate switching instruction, it can be determined that different refresh rates need to be switched between different touch modes. Since when switching between different refresh rates between different touch modes, both the touch mode and the refresh rate gear need to be switched, the electronic device can first switch the refresh rate gear to adjust the refresh rates of different touch modes to the same refresh rate gear, and then implement touch mode switching under the same refresh rate gear.
[0289] For example, when the first refresh rate switching instruction is used to indicate switching from the 144Hz gear in the hand touch mode (identified by serial numbers 1-4) to the 60Hz gear in the pen touch mode (identified by serial numbers 2-1), as shown in Table 3, the electronic device can first reduce the frame rate gear to the 60Hz gear in the hand touch mode (identified by serial numbers 1-2), and then implement the touch mode switching under the same refresh rate gear, that is, switching from the 60Hz gear in the hand touch mode (identified by serial numbers 1-2) to the 60Hz gear in the pen touch mode (identified by serial numbers 2-2). The switching order is 1-4>1-2>2-2.
[0290] It can be understood that since the hand touch mode supports some refresh rate gears (such as 144Hz) that the pen touch mode cannot support, it is impossible to switch the touch mode first without adjusting the frame rate gear. For example, when switching from the 144Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode, it is impossible to switch the touch mode while maintaining 144Hz, that is, it is impossible to switch to the 144Hz gear in the pen touch mode first, because the pen touch mode cannot support 144Hz. Therefore, it is impossible to switch from the 144Hz gear in the pen touch mode to the 60Hz gear in the pen touch mode. Therefore, it is necessary to switch the frame rate gear first, and then realize the switch of the touch mode after adjusting to the frame rate range supported by the pen touch mode.
[0291] In some embodiments, when the electronic device triggers the refresh rate switch, it may also trigger the working mode switch of the touch firmware.
[0292] Optionally, the electronic device may trigger the working mode switching of the touch firmware only when the touch mode switching under the same refresh rate gear is achieved.
[0293] For example, when the first refresh rate switching instruction is used to indicate the switch from the 144Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode, the electronic device can first reduce the frame rate gear to the 60Hz gear in the hand touch mode, and the working mode switch of the touch firmware may not be triggered at this time. Instead, when the touch mode is switched under the same refresh rate gear, the working mode switch of the touch firmware is triggered. That is, according to the changed touch scene, i.e., the pen touch mode, the corresponding working mode of the touch firmware - firmware mode 2 is matched, and relevant instructions are sent to the touch driver of the kernel layer to drive the working mode of the touch firmware to switch to firmware mode 2.
[0294] Optionally, the electronic device may also start triggering the touch firmware's operating mode switch when implementing different frame rate switching under the same touch mode, without waiting until the touch mode switching under the same refresh rate gear is implemented to start triggering the touch firmware's operating mode switch.
[0295] For example, when the first refresh rate switching instruction is used to indicate the switch from the 144Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode, the electronic device can first reduce the frame rate gear to the 60Hz gear in the hand touch mode, and at this time, the working mode switch of the touch firmware can be triggered at the same time. That is, according to the changed touch scene, that is, the pen touch mode, the corresponding working mode of the touch firmware - firmware mode 2 is matched, and relevant instructions are sent to the touch driver of the kernel layer to drive the working mode of the touch firmware to switch to firmware mode 2. At this time, relevant instructions will also be sent to the display driver of the kernel layer to drive the completion of the frame rate gear switch to the 60Hz gear in the hand touch mode.
[0296] S1110. In response to the first refresh rate switching instruction, the electronic device performs layer synthesis processing on the Nth frame image through the MDP to obtain a first image to be displayed.
[0297] In the embodiment of the present application, when the electronic device detects that the Nth frame image needs to switch to a different refresh rate of a different mode (switching from the second refresh rate to the first refresh rate), the electronic device can first adjust the frame rate gear to the first refresh rate in the original touch mode during the refresh display of the Nth frame image. In this way, the refresh rates of different touch modes are adjusted to the same refresh rate gear before subsequent mode switching is performed.
[0298] It can be understood that, since it is a switch between different refresh rates in the same touch mode, according to the current refresh rate switching method, the refresh rate can be changed only by changing the VFP parameters in the display timing, that is, the length of the idle time at the end of the frame, and there will be no display abnormality problems. Therefore, the layer synthesis method of the Nth frame image can still be executed by the MDP. And because it has been in hand touch mode, there is no need to support the input scanning of the stylus, and the idle time at the end of the frame is sufficient for the MDP to realize refresh rate switching and layer synthesis. In this way, when the electronic device starts to refresh and display the Nth frame image, there is no need to change the layer synthesis method of the Nth frame image.
[0299] Optionally, when the electronic device starts to refresh and display the Nth frame image, SurfaceFlinger can obtain all layers of the Nth frame image and the first refresh rate switching instruction, and provide the data of all layers and the first refresh rate switching instruction to HWC, and ask HWC for processing methods. Since different refresh rate switching of different modes is required, HWC can first maintain the original layer synthesis method of the Nth frame image according to the first refresh rate switching instruction, such as MDP synthesis, so that MDP can synthesize and superimpose all layers of the Nth frame image, and finally form a frame of image to be displayed to be transmitted to the display screen, that is, the first image.
[0300] It can be understood that before the electronic device triggers the switching of different refresh rates in different modes, the layer synthesis method for the image before the Nth frame image is still the original layer synthesis method, such as MDP synthesis, so that MDP can synthesize and superimpose all layers of the Nth frame image, and finally form a frame of image to be displayed to be transmitted to the display screen.
[0301] S1120. In response to the first refresh rate switching instruction, the electronic device switches the screen refresh rate of the display screen from the second refresh rate in the hand touch mode to the first refresh rate in the hand touch mode through the MDP.
[0302] In the embodiment of the present application, when the electronic device starts to refresh and display the Nth frame image, if it detects that a different refresh rate switch of a different mode is required, the electronic device can first control the switch of the display timing through the MDP, and switch the screen refresh rate of the display screen from the second refresh rate in the hand touch mode to the first refresh rate in the hand touch mode by changing the VFP parameter of the display timing. The switch of different refresh rates in the same touch mode is completed first.
[0303] In an embodiment of the present application, when the electronic device needs to switch between different refresh rates under the same touch mode, it can determine the matching display timing according to a preset correspondence table, thereby completing the switching of different refresh rates under the same touch mode based on the matching display timing.
[0304] As an example, taking the switch from the 120Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode as an example, the electronic device can first complete the switch from the 120Hz gear in the hand touch mode to the 60Hz gear in the hand touch mode. At this time, please refer to Table 2, and the display timing corresponding to the 120Hz gear in the hand touch mode can be determined. Compared with the display timing corresponding to the 60Hz gear in the hand touch mode, only the VFP (i.e., the idle time at the end of the frame) has sent a change. Therefore, the electronic device can increase the VFP in the display timing corresponding to the current 120Hz from 26 to 2340. Thereby, only the space time at the end of the frame is increased, and the effective display time remains unchanged, so that the time to refresh and display a frame of the image is lengthened, and then the number of times the image frame is refreshed per second is reduced, and the purpose of reducing the screen refresh rate is achieved.
[0305] It can be understood that before the electronic device triggers the switching of different refresh rates in different modes, the electronic device refreshes and displays the image before the Nth frame image according to the 120 Hz screen refresh rate in the hand touch mode before the switching.
[0306] like Fig.12 As shown in (a), taking the N-1th frame image as an example, when the electronic device starts to refresh and display the N-1th frame image, since the screen refresh rate of the current display screen is 120Hz in the hand touch mode, the electronic device can refresh and display the N-1th frame image according to the display timing corresponding to the 120Hz gear in the hand touch mode, and the time for refreshing and displaying the N-1th frame image is 8.3ms.
[0307] like Fig.12As shown in (b), after the N-1th frame image is refreshed and displayed, the electronic device can start to refresh and display the Nth frame image. At this time, if the electronic device detects a first refresh rate switching instruction to switch from the 120Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode, the electronic device can respond to the first refresh rate switching instruction, and when starting to refresh and display the Nth frame image, first control the switching of the display timing through the MDP, increase the length of the VFP (i.e., the idle time at the end of the frame), so as to first complete the switch from the 120Hz gear in the hand touch mode to the 60Hz gear in the hand touch mode.
[0308] like Fig.12 As shown in (b), since the effective display time remains unchanged, only the space time at the end of the frame is increased, the time for refreshing and displaying the Nth frame of the image is extended to 16.6ms, and the number of times the image frame is refreshed per second is reduced to 60, thus achieving the purpose of reducing the screen refresh rate to 60Hz.
[0309] As another example, taking the switch from the 144Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode as an example, the electronic device can first complete the switch from the 144Hz gear in the hand touch mode to the 60Hz gear in the hand touch mode. At this time, please refer to Table 2, and the display timing corresponding to the 144Hz gear in the hand touch mode can be determined. Compared with the display timing corresponding to the 60Hz gear in the hand touch mode, only the VFP (i.e., the idle time at the end of the frame) has sent a change. Therefore, the electronic device can increase the VFP in the display timing corresponding to the current 144Hz from 15 to 2340. Thereby, only the space time at the end of the frame is increased, and the effective display time remains unchanged, so that the time to refresh and display a frame of the image is lengthened, and then the number of times the image frame is refreshed per second is reduced, and the purpose of reducing the screen refresh rate is achieved.
[0310] It can be understood that before the electronic device triggers the switching of different refresh rates in different modes, the electronic device refreshes and displays the image before the Nth frame image according to the 144 Hz screen refresh rate in the hand touch mode before the switching.
[0311] like Fig.13 As shown in (a), taking the N-1th frame image as an example, when the electronic device starts to refresh and display the N-1th frame image, since the screen refresh rate of the current display screen is the 144Hz gear in the hand touch mode, the electronic device can refresh and display the N-1th frame image according to the display timing corresponding to the 144Hz gear in the hand touch mode, and the time for refreshing and displaying the N-1th frame image is 6.9ms.
[0312] like Fig.13As shown in (b), after the N-1th frame image is refreshed and displayed, the electronic device can start to refresh and display the Nth frame image. At this time, if the electronic device detects a first refresh rate switching instruction to switch from the 144Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode, the electronic device can respond to the first refresh rate switching instruction, and when starting to refresh and display the Nth frame image, first control the switching of the display timing through the MDP, increase the length of the VFP (i.e., the idle time at the end of the frame), so as to first complete the switch from the 144Hz gear in the hand touch mode to the 60Hz gear in the hand touch mode.
[0313] like Fig.13 As shown in (b), since the effective display time remains unchanged, only the space time at the end of the frame is increased, the time for refreshing and displaying the Nth frame of the image is extended to 16.6ms, and the number of times the image frame is refreshed per second is reduced to 60, thus achieving the purpose of reducing the screen refresh rate to 60Hz.
[0314] S1130. The electronic device displays a first image at a first refresh rate in a hand touch mode.
[0315] After the electronic device controls the switching of the display timing through MDP, it can transmit the data of the first image to be displayed after the Nth frame image is synthesized by MDP through the display timing corresponding to the first refresh rate in the switched hand touch mode, and display it on the display screen. Since the current display timing switching only involves VFP parameters, the idle time at the end of the frame is sufficient for MDP to realize refresh rate switching and layer synthesis. Therefore, the refresh display of the first image formed after the Nth frame image is synthesized by MDP can be completed normally.
[0316] For example, Fig.14 As shown, when refreshing and displaying the Nth frame image in the kernel stage, the refresh rate switching and layer synthesis are implemented by the MDP. Specifically, if the display driver of the electronic device receives a first refresh rate switching instruction, the original layer synthesis method of the Nth frame image can be maintained, that is, the MDP synthesis module is driven to complete the synthesis and superposition of the layers of the Nth frame image, and the MDP display switching module is driven to complete the corresponding display timing switching. At this time, the MDP display switching module is used to complete the switching of different frame rates in the hand touch mode, and does not involve the switching of the touch mode. In other words, the MDP display switching module is used to switch from the display timing corresponding to the second refresh rate in the hand touch mode to the display timing corresponding to the first refresh rate in the hand touch mode, that is, the display timing switching corresponding to different refresh rates in the same touch mode.
[0317] After the MDP synthesis of the Nth frame image is completed and the display timing is switched, the electronic device controls the MDP display driver (MDP MIPI driver) to transmit the first image formed after MDP synthesis to the display panel (such as LCD) through the MIPI interface for display according to the display timing corresponding to the first refresh rate in the switched hand touch mode.
[0318] It can be understood that before the electronic device triggers the switching of different refresh rates in different modes, for the image before the Nth frame image, the electronic device refreshes and displays the image before the Nth frame image according to the display timing corresponding to the second refresh rate in the hand touch mode before the switching.
[0319] Taking the N-1 frame image as an example, when refreshing and displaying the N-1 frame image in the kernel stage, the display driver of the electronic device also adopts the original layer synthesis method, that is, driving the MDP synthesis module to complete the synthesis and superposition of the layers of the N-1 frame image. Since the display driver of the electronic device does not receive the refresh rate switching instruction when refreshing and displaying the N-1 frame image, it is not necessary to drive the MDP display switching module to complete the corresponding display timing switching. Therefore, when refreshing and displaying the N-1 frame image in the kernel stage, the electronic device only drives the MDP synthesis module to complete the layer synthesis processing of the N-1 frame image. After the MDP synthesis of the N-1 frame image is completed, the electronic device controls the MDP display driver (MDP MIPI driver) to transmit the image formed after the MDP synthesis to the display panel (such as LCD) through the MIPI interface for display according to the original refresh rate, that is, the display timing corresponding to the second refresh rate in the hand touch mode before the switch.
[0320] It can be understood that since the Nth frame image has completed the switch from the second refresh rate in the hand touch mode to the first refresh rate in the hand touch mode, that is, the switch of different refresh rates in the same touch mode (i.e., hand touch mode), the second refresh rate of the hand touch mode is adjusted to the same frame rate level as the first refresh rate of the pen touch mode. Therefore, only the switch of the touch mode with the same frame rate level can be completed subsequently, that is, the switch from the first refresh rate in the hand touch mode to the first refresh rate in the pen touch mode. In this way, the switch of different refresh rates in different touch modes is realized.
[0321] S1140: When the electronic device starts to refresh and display the N+1th frame image, in response to the first refresh rate switching instruction, the electronic device performs layer synthesis processing on the N+1th frame image through the GPU to obtain a second image to be displayed.
[0322] In some embodiments, after the electronic device completes the switch from the second refresh rate in the hand touch mode to the first refresh rate in the hand touch mode, it can complete the switch of the touch mode at the same frame rate level when starting to refresh and display the next frame image, i.e., the N+1th frame image, i.e., switch from the first refresh rate in the hand touch mode to the first refresh rate in the pen touch mode.
[0323] Since the display timings corresponding to the refresh rates of different touch modes vary greatly, the MDP needs to spend more time to complete the switching and adjustment of the display timing. Therefore, in an embodiment of the present application, the electronic device can refer to the refresh rate switching method in the aforementioned embodiment during the refresh display process of the N+1 frame image, and hand over the layer synthesis processing to the graphics processor GPU to reduce the MDP load. At this time, the MDP only needs to implement the switching of the touch mode at the same frame rate gear. In this way, regardless of whether the idle time at the end of the frame of the current refresh rate is sufficient, the normal display of the N+1 frame image and the normal switching of the refresh rate can be guaranteed.
[0324] Optionally, when the electronic device starts to refresh and display the N+1th frame image, SurfaceFlinger can obtain all layers of the N+1th frame image and the first refresh rate switching instruction, and provide the data of all layers and the first refresh rate switching instruction to the HWC, and ask the HWC for processing. Since the same refresh rate switching of different modes is required, the HWC can force the layer synthesis mode marked by all layers of the N+1th frame image to be set to GPU synthesis according to the first refresh rate switching instruction, so that the GPU can synthesize and superimpose all layers of the N+1th frame image, and finally form a frame of image to be transmitted to the display screen, that is, the second image.
[0325] In some embodiments, since the first refresh rate in the hand touch mode is switched to the first refresh rate in the pen touch mode, the frame tail time in the hand touch mode is usually sufficient, such as Figure 2 As shown in (a), the frame tail time in the display timing corresponding to the 60Hz gear in the hand touch mode is sufficient. Even if the MDP needs to spend more time to complete the switching adjustment of the display timing, the MDP can also complete the layer synthesis processing of the image frame and the display timing switching corresponding to the refresh rate at the same time. Therefore, during the refresh display process of the N+1 frame image, the electronic device can also use the original layer synthesis method without changing the layer synthesis method of the current image to GPU synthesis, such as still performing layer synthesis processing on the N+1 frame image by the MDP to obtain the second image to be displayed.
[0326] S1150. In response to the first refresh rate switching instruction, the electronic device switches the screen refresh rate of the display screen from the first refresh rate in the hand touch mode to the first refresh rate in the pen touch mode through the MDP.
[0327] In an embodiment of the present application, when the electronic device detects that the N+1th frame image needs to switch to the same refresh rate of different modes, the electronic device can control the switching of the display timing through the MDP, and switch the screen refresh rate of the display screen from the first refresh rate in the hand touch mode to the first refresh rate in the pen touch mode by changing the display timing parameters.
[0328] In the embodiment of the present application, in different touch modes, the display timings corresponding to different refresh rates can be pre-associated through a correspondence table, as shown in Table 2. Therefore, when the electronic device needs to switch the refresh rate, the matching display timing can be determined according to the preset correspondence table, so as to complete the refresh rate switching based on the matching display timing.
[0329] As an example, taking the switch from the 120Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode as an example, after the electronic device completes the switch from the 120Hz gear in the hand touch mode to the 60Hz gear in the hand touch mode during the Nth frame image refresh and display process, it can then complete the switch from the 60Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode during the N+1th frame image refresh and display process.
[0330] For example, referring to Table 2, the display timing corresponding to the 60Hz gear in the hand touch mode can be determined. Compared with the display timing corresponding to the 60Hz gear in the pen touch mode, HBP, HFP, and VFP have changed. Therefore, during the Nth frame image refresh display process of the electronic device, if Fig.12 As shown in (b), after switching to the display timing corresponding to the 60Hz gear in the hand touch mode, during the N+1 frame image refresh display process, the HBP in the display timing corresponding to the 60Hz gear in the current hand touch mode can be increased from 20 to 318, the HFP can be increased from 19 to 20, and the VFP can be reduced from 2340 to 26, thereby achieving the display timing corresponding to the 60Hz gear in the pen touch mode.
[0331] It can be understood that the increase in HBP and HFP values will lead to a longer effective display time for the N+1th frame of image. Since the refresh rate of the two touch modes is the same at 60Hz, the refresh display time of a frame of image is fixed at 16.6ms. Therefore, the corresponding idle time at the end of the frame will become shorter.
[0332] like Fig.12As shown in (c), after the Nth frame image is refreshed and displayed, the electronic device can start to refresh and display the N+1th frame image. At this time, the electronic device can continue to respond to the first refresh rate switching instruction. When starting to refresh and display the N+1th frame image, it first controls the switching of the display timing through MDP, increases the length of the effective display time, and shortens the length of VFP (i.e., the idle time at the end of the frame) to complete the switch from the 60Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode. Fig.12 As shown in (c) in FIG. 1 , the time for refreshing and displaying the N+1th frame image remains unchanged, which is still 16.6 ms.
[0333] In this way, the switched display timing not only meets the 60Hz screen refresh rate, but also supports the scanning of the stylus input. Thus, the touch mode switching of the same frame rate gear is realized. Then, the electronic device transmits the image data to the display screen according to the switched display timing, and the displayed image can be refreshed at the switched 60Hz screen refresh rate that matches the stylus.
[0334] As another example, taking the switch from the 144Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode as an example, after the electronic device completes the switch from the 144Hz gear in the hand touch mode to the 60Hz gear in the hand touch mode during the Nth frame image refresh display process, it can then complete the switch from the 60Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode during the N+1th frame image refresh display process.
[0335] For example, referring to Table 2, the display timing corresponding to the 60Hz gear in the hand touch mode can be determined. Compared with the display timing corresponding to the 60Hz gear in the pen touch mode, HBP, HFP, and VFP have changed. Therefore, during the Nth frame image refresh display process of the electronic device, if Fig.13 As shown in (b), after the display timing corresponding to the 144 Hz gear in the hand touch mode is switched to the display timing corresponding to the 60 Hz gear in the hand touch mode, during the N+1 frame image refresh display process, the HBP in the display timing corresponding to the 60 Hz gear in the current hand touch mode can be increased from 20 to 318, the HFP can be increased from 19 to 20, and the VFP can be reduced from 2340 to 26, thereby achieving the display timing corresponding to the 60 Hz gear in the pen touch mode.
[0336] like Fig.13As shown in (c), after the Nth frame image is refreshed and displayed, the electronic device can start to refresh and display the N+1th frame image. At this time, the electronic device can continue to respond to the first refresh rate switching instruction. When starting to refresh and display the N+1th frame image, it first controls the switching of the display timing through MDP, increases the length of the effective display time, and shortens the length of VFP (i.e., the idle time at the end of the frame) to complete the switch from the 60Hz gear in the hand touch mode to the 60Hz gear in the pen touch mode. Fig.13 As shown in (c) in FIG. 1 , the time for refreshing the N+1th frame image remains unchanged at 16.6ms. In this way, the display timing after switching not only meets the 60Hz screen refresh rate, but also supports the scanning of the stylus input. Thus, the switching of the touch mode at the same frame rate level is realized.
[0337] S1160: The electronic device displays the second image at the first refresh rate in the pen touch mode.
[0338] In some embodiments, after the electronic device controls the switching of the display timing through the MDP, it can transmit the data of the second image to be displayed after the N+1 frame image is synthesized by the GPU through the display timing corresponding to the first refresh rate in the switched pen touch mode to the display screen for display. Since the MDP only needs to implement the refresh rate switching, and the layer synthesis processing is performed by the GPU, even if the frame tail space time after the display timing is switched is too short, the electronic device can normally complete the display timing switching and the normal display of the second image synthesized by the GPU of the N+1 frame image.
[0339] For example, Fig.15 As shown, when refreshing and displaying the N+1th frame image in the kernel stage, the display driver of the electronic device continues to respond to the first refresh rate switching instruction, drives the GPU synthesis module to complete the synthesis and superposition of the layers of the N+1th frame image, and drives the MDP display switching module to complete the corresponding display timing switching. After the GPU synthesis of the N+1th frame image is completed and the display timing switching is completed, the MDP display driver (MDP MIPI driver) is controlled to transmit the second image to be displayed after the GPU synthesis to the display panel (such as LCD) through the MIPI interface according to the switched display timing.
[0340] It can be understood that since the N+1 frame image has completed the switching process of the first refresh rate in the pen touch mode, when the electronic device starts to refresh and display the N+2 frame image, if no new refresh rate switching instruction is received, there is no need to switch the display timing, and the N+2 frame image can return to the original layer synthesis mode. For example, all layers of the N+2 frame image are restored to MDP synthesis.
[0341] For example, Fig.16As shown, when refreshing and displaying the N+2 frame image in the kernel stage, the display driver of the electronic device does not receive a new refresh rate switching instruction, so there is no need to drive the MDP display switching module to complete the corresponding display timing switching, and the original layer synthesis method can be restored, that is, the MDP synthesis module is driven to complete the synthesis and superposition of the layers of the N+2 frame image. After the MDP synthesis of the N+2 frame image is completed, the MDP display driver (MDP MIPI driver) is controlled to transmit the image to be displayed after the MDP synthesis to the display panel (such as LCD) through the MIPI interface for display according to the display timing corresponding to the first refresh rate in the switched pen touch mode.
[0342] In some scenarios, after the switch from the second refresh rate in the hand touch mode to the first refresh rate in the hand touch mode is completed during the refresh display of the Nth frame image, the switch from the first refresh rate in the hand touch mode to the first refresh rate in the pen touch mode may be completed after refreshing the display of one frame of image. That is, during the refresh display of the N+2th frame image, the switch from the first refresh rate in the hand touch mode to the first refresh rate in the pen touch mode is completed.
[0343] In some embodiments, in response to the first refresh rate switching instruction, the electronic device may issue a frame rate switching instruction of the same touch mode when the kernel layer refreshes and displays the Nth frame image, thereby triggering the display area of the kernel layer to complete the switch from the second refresh rate in the hand touch mode to the first refresh rate in the hand touch mode. When the kernel layer refreshes and displays the N+1th frame image, the touch mode switching instruction of the same frame rate is issued, thereby triggering the display area of the kernel layer to complete the switch from the first refresh rate in the hand touch mode to the first refresh rate in the pen touch mode.
[0344] In some embodiments, since the first refresh rate in the hand touch mode is switched to the first refresh rate in the pen touch mode, and the frame end time in the hand touch mode is usually sufficient, the electronic device can also perform layer synthesis processing on the N+1 frame image by the MDP during the N+1 frame image refresh display process to obtain the second image to be displayed. Therefore, after the electronic device controls the switching of the display timing by the MDP, it can transmit the data of the second image to be displayed formed by the synthesis of the N+1 frame image MDP to the display screen for display through the display timing corresponding to the first refresh rate in the pen touch mode after the switch.
[0345] The refresh rate switching method provided in the embodiment of the present application can first complete the switching of the refresh rate when it is necessary to switch different refresh rates of different touch modes, so as to adjust to the same refresh rate gear, and then complete the switching of different touch modes with the same refresh rate. And when executing the refresh rate switching of different touch modes, the electronic device can switch the layer synthesis processing of the image frame originally performed by the display processor MDP to the layer synthesis processing of the image frame performed by the graphics processor GPU. Thereby, the MDP load can be reduced, and only the switching of the MDP display timing needs to be completed in the frame idle area, and the MDP synthesis action is no longer performed at the same time. Thereby ensuring that the image frame can be sent to the display in time, avoiding the problem that a frame of image cannot be displayed normally during the refresh rate switching process of different touch modes. In this way, while ensuring the smooth completion of real-time switching, the constraints on the display timing parameters of different modes of the device are reduced, the display timing differences of different modes are increased, and the adjustable range of the device mode is increased.
[0346] In some scenarios, when the electronic device starts to refresh and display the Nth frame image, if a first refresh rate switching instruction to switch from the second refresh rate in hand touch mode to the first refresh rate in pen touch mode is detected, the electronic device may also start responding to the first refresh rate switching instruction during the refresh display process of the N+1th frame image, that is, first complete the switch from the second refresh rate in hand touch mode to the first refresh rate in hand touch mode during the refresh display process of the N+1th frame image, and then complete the switch from the first refresh rate in hand touch mode to the first refresh rate in pen touch mode during the refresh display process of the N+2th frame image.
[0347] It can be understood that the above embodiment takes the switching from the second refresh rate in the hand touch mode to the first refresh rate in the pen touch mode as an example to introduce the method of switching different refresh rates in different touch modes. For switching from the first refresh rate in the pen touch mode to the second refresh rate in the hand touch mode, a similar principle can also be used to implement it.
[0348] Because the hand touch mode supports some refresh rate gears (such as 144Hz), which the pen touch mode cannot support. Therefore, if the frame rate gear of the pen touch mode is adjusted first, the two touch modes may not be adjusted to the same frame rate gear. For example, when switching from the 60Hz gear in the pen touch mode to the 144Hz gear in the hand touch mode, it is not possible to first switch the 60 gear in the pen touch mode to the 144Hz gear in the pen touch mode by adjusting the frame rate gear, because the pen touch mode does not support 144Hz. Therefore, it is no longer possible to switch between different touch modes based on the same frame rate gear. Therefore, in an embodiment of the present application, for the scenario of switching from the first refresh rate in the pen touch mode to the second refresh rate in the hand touch mode, the electronic device can first complete the switching of the touch mode, and then complete the switching of the frame rate gear.
[0349] For example, when the electronic device starts to refresh and display the Nth frame image, a second refresh rate switching instruction is detected. The second refresh rate switching instruction is used to instruct to switch from the first refresh rate in the pen touch mode to the second refresh rate in the hand touch mode. Among them, the second refresh rate is different from the first refresh rate. The electronic device can respond to the second refresh rate switching instruction and perform layer synthesis processing on the Nth frame image through the GPU to obtain the first image to be displayed. And the screen refresh rate of the display screen is switched from the first refresh rate in the pen touch mode to the first refresh rate in the hand touch mode through the MDP. Thus, the electronic device displays the first image at the first refresh rate in the hand touch mode. Then when the electronic device starts to refresh and display the N+1th frame image, it continues to respond to the second refresh rate switching instruction, and the electronic device performs layer synthesis processing on the N+1th frame image through the MDP to obtain the second image to be displayed, and switches the screen refresh rate of the display screen from the first refresh rate in the hand touch mode to the second refresh rate in the hand touch mode through the MDP. Thus, the electronic device displays the first image at the second refresh rate in the hand touch mode.
[0350] As an example, taking the 60Hz gear in the pen touch mode as an example, the electronic device can first switch from the 60Hz gear in the pen touch mode to the 60Hz gear in the hand touch mode, that is, switch between different touch modes at the same frame rate gear. Then, the electronic device can switch from the 60Hz gear in the hand touch mode to the 144Hz gear in the hand touch mode, that is, switch between different frame rate gears in the same touch mode.
[0351] It can be understood that from Table 1, when the electronic device switches from a 60Hz refresh rate in pen touch mode to a 60Hz refresh rate in hand touch mode, the display timing difference between the two is large, and the MDP needs to spend more time to complete the switching adjustment of the display timing. The idle time at the end of the frame in the pen touch mode is too short, so if the layer synthesis processing of the image frame is still performed by the MDP, the MDP load is too large, which will cause abnormal transmission and display of the image frame. Therefore, in an embodiment of the present application, the electronic device can refer to the refresh rate switching method in the aforementioned embodiment during the refresh display process of the Nth frame image, and hand over the layer synthesis processing to the graphics processor GPU to reduce the MDP load. At this time, the MDP only needs to realize the switching of the touch mode of the same frame rate gear. In this way, even if the idle time at the end of the frame of the current refresh rate is insufficient, the normal transmission and display of the N1th frame image and the normal switching of the refresh rate can be guaranteed.
[0352] Optionally, when the electronic device starts to refresh and display the Nth frame image, SurfaceFlinger can obtain all layers of the Nth frame image and the second refresh rate switching instruction, and provide the data of all layers and the second refresh rate switching instruction to HWC, and ask HWC for processing. Since it is necessary to switch between different touch modes of the same frame rate first, HWC can force all the layer synthesis methods marked by all layers of the Nth frame image to be set to GPU synthesis according to the second refresh rate switching instruction, so that the GPU can synthesize and superimpose all layers of the Nth frame image, and finally form a frame of image to be transmitted to the display screen, that is, the first image.
[0353] At the same time, the electronic device can control the switching of the display timing through the MDP, and by changing the display timing parameters, the screen refresh rate of the display screen can be switched from the first refresh rate in the pen touch mode to the first refresh rate in the hand touch mode. In this way, after the electronic device controls the switching of the display timing through the MDP, it can transmit the data of the first image to be displayed formed after the Nth frame image is synthesized by the GPU to the display screen for display through the display timing corresponding to the first refresh rate in the switched hand touch mode.
[0354] After the Nth frame image completes the switching of different touch modes with the same frame rate and refreshes the display, the electronic device can complete the switching from the 60Hz gear in the hand touch mode to the 144Hz gear in the hand touch mode when starting to refresh and display the N+1th frame image.
[0355] It can be understood that, since different refresh rates are switched in the same touch mode, according to the current refresh rate switching method, the refresh rate can be changed only by changing the VFP parameters in the display timing, that is, the length of the idle time at the end of the frame, and there will be no display abnormality problems. Therefore, the layer synthesis method of the N+1 frame image can still be executed by the MDP. And the idle time at the end of the frame in the hand touch mode is sufficient for the MDP to implement refresh rate switching and layer synthesis. In this way, when the electronic device starts to refresh and display the N+1 frame image, there is no need to change the layer synthesis method of the N+1 frame image.
[0356] Optionally, when the electronic device starts to refresh and display the N+1th frame image, SurfaceFlinger can obtain all layers of the N+1th frame image and the second refresh rate switching instruction, and provide the data of all layers and the second refresh rate switching instruction to the HWC, and ask the HWC for processing methods. Since it is only necessary to continue switching different refresh rates of the same touch mode, the MDP can achieve refresh rate switching and layer synthesis at the same time. Therefore, the HWC can maintain the original layer synthesis method of the N+1th frame image according to the second refresh rate switching instruction, such as MDP synthesis, so that the MDP can synthesize and superimpose all layers of the N+1th frame image, and finally form a frame of image to be displayed to be transmitted to the display screen, that is, the second image.
[0357] At the same time, the electronic device can control the switching of the display timing through the MDP, and by changing the display timing parameters, the screen refresh rate of the display screen is switched from the first refresh rate in the hand touch mode to the second refresh rate in the hand touch mode. In this way, after the electronic device controls the switching of the display timing through the MDP, it can transmit the data of the second image to be displayed formed after the MDP synthesis of the N+1th frame image to the display screen for display through the display timing corresponding to the second refresh rate in the switched hand touch mode.
[0358] In an embodiment of the present application, the electronic device can determine whether to switch the current screen refresh rate to a refresh rate that matches the stylus according to the current usage scenario of the stylus.
[0359] In some embodiments, the electronic device can identify whether the current stylus is in use according to the connection state, adsorption state, and full power state of the stylus, so that the electronic device can determine the screen refresh rate gear suitable for the current touch scene according to the current stylus usage state and the current screen refresh rate, and generate a corresponding refresh rate switching instruction. The electronic device responds to the refresh rate switching instruction, completes the corresponding refresh rate switching, and ensures that there is no abnormality during the switching process.
[0360] See also Fig.17 , the embodiment of the present application provides another refresh rate switching method, which may include:
[0361] S1710: The electronic device detects status information of the stylus pen, where the status information includes a connection status, an adsorption status, and a full-charge status of the stylus pen.
[0362] In the embodiment of the present application, the electronic device can determine whether the stylus is currently in use by combining the state information of the stylus such as the connection state, adsorption state, and full power state. Thus, when it is recognized that the stylus is in use, the screen refresh rate can be switched to a refresh rate that is adapted to the stylus, thereby ensuring the normal use of the stylus.
[0363] Among them, the connection status of the stylus includes connected and unconnected. Generally, when the stylus is not in a communication connection state with the electronic device, the user cannot use the stylus. When the user needs to use the stylus, the stylus and the electronic device are usually in a communication connection state. Therefore, by detecting the connection status of the stylus, it can help the electronic device analyze whether the stylus is currently in use.
[0364] The communication connection between the stylus pen and the electronic device may be achieved through a wired method (such as a USB data cable) or a wireless method (such as Bluetooth, Wi-Fi, etc.). For example, taking the establishment of a communication connection between the stylus pen and the electronic device through Bluetooth as an example, the electronic device can detect whether it is in a Bluetooth connection state with the stylus pen.
[0365] Optionally, the electronic device can detect the connection event and disconnection event of the stylus through the Bluetooth service module of the framework layer. When the electronic device and the stylus establish a Bluetooth connection through the Bluetooth module, the Bluetooth module of the electronic device can report the connection event to the Bluetooth service module. When the electronic device and the stylus do not establish a Bluetooth connection or disconnect the Bluetooth connection, the Bluetooth module of the electronic device can report the disconnection event to the Bluetooth service module.
[0366] The adsorption state of the stylus includes adsorption and distance (non-adsorption). Generally, when the electronic device and the stylus are in communication connection, after using the stylus for a period of time, the user can also bring the stylus close to the electronic device to rely on "strong magnetic attraction" to adsorb the stylus to the frame or touch screen of the electronic device, so as to ensure the storage safety of the stylus while realizing wireless charging of the stylus by the electronic device. Fig.18 As shown in (a) of FIG. 1 , the stylus pen 100 is adsorbed on the right side frame of the electronic device 200. It can be understood that when the user normally uses the stylus pen, the stylus pen is usually far away from the electronic device and is not adsorbed on the electronic device. Fig.18 As shown in (b) in FIG. 1 , the stylus pen 100 is away from the electronic device 200 and is not adsorbed on the electronic device 200. Therefore, by detecting the adsorption state of the stylus pen, it can help the electronic device analyze whether the stylus pen is currently in use.
[0367] The full-charge state of the stylus includes full charge and not full charge. It can be understood that when the stylus is attached to the electronic device, if the stylus is not fully charged, the electronic device can continue to wirelessly charge the stylus (i.e., it is in the charging state at this time) until the stylus is fully charged. If the stylus is fully charged, the electronic device can stop wirelessly charging the stylus (i.e., it is in the stop charging state at this time). Therefore, the full-charge state of the stylus can also include charging and stop charging.
[0368] At present, electronic devices can promptly identify the adsorption event of the stylus and the distance event when the stylus is adsorbed and stopped charging by scanning Q. However, the identification of the distance event when the stylus is adsorbed and charged is achieved through the error timeout package (cep_timeout) identification. However, the detection of cep_timeout itself has a delay (such as 1.5s). Therefore, the electronic device cannot detect the distance event when the stylus is adsorbed and charged in the first time. This makes the user remove the stylus from the electronic device and use the stylus for the first time. Because the electronic device cannot recognize the use status of the stylus in time, it cannot switch the screen refresh rate to the refresh rate that matches the stylus in time, resulting in touch abnormalities, affecting the user's experience of using the stylus.
[0369] In order to solve the above problem, the embodiment of the present application adds detection of the full power state of the stylus to assist in analyzing whether the stylus is currently in use through the full power state. Optionally, the electronic device can detect the adsorption event, distance event, full power event, under-powered event, etc. of the stylus through the stylus service module of the framework layer.
[0370] In one scenario, when the stylus is attached to an electronic device from a distant state, the wireless charging chip of the electronic device will detect that the Q value of the wireless charging coil has changed. At this time, the wireless charging chip can generate an interrupt signal (Interrupt) to notify the wireless charging driver through the interrupt process driven by the chip, and the wireless charging driver reports the attachment event to the stylus service. After the stylus is attached to the electronic device, if the stylus is not fully charged, the stylus will be in the attached charging state.
[0371] In one scenario, after the stylus is attached to an electronic device and fully charged, it will be in an attached and stopped charging state. At this time, the stylus can notify the wireless charging coil of the electronic device of a full charge event (charge done) through the Qi protocol of the wireless charging coil. After the wireless charging coil of the electronic device receives the charge done event, the wireless charging chip of the electronic device can generate an interrupt signal (Interrupt) to notify the wireless charging driver through the interrupt process driven by the chip, and the wireless charging driver reports the full charge event to the stylus service.
[0372] In one scenario, if the stylus service does not receive a full-charge event when receiving an adsorption event of the stylus, it can be determined that the full-charge state of the stylus is not fully charged, that is, the stylus is in an adsorption charging state.
[0373] Optionally, when the wireless charging driver reports the adsorption event, if the charge done event is not detected, the wireless charging driver may also upload a not fully charged event to the stylus service.
[0374] In one scenario, when the stylus moves away from the adsorption and charging stop state, the wireless charging chip of the electronic device will also detect the change in the Q value of the wireless charging coil. At this time, the wireless charging chip can generate an interrupt signal (Interrupt) to notify the wireless charging driver through the chip-driven interrupt process, and the wireless charging driver reports the distance event during adsorption and charging stop to the stylus service.
[0375] S1720: The electronic device determines a current touch scene based on the status information of the stylus.
[0376] In some embodiments, the electronic device can determine the current touch scene according to the connection state and adsorption state of the stylus. The touch scene includes the touch scene of stylus input (also called pen control scene, writing scene, etc.) and the touch scene of finger input (also called hand control scene).
[0377] For example, taking the establishment of a communication connection between the stylus pen and the electronic device via Bluetooth as an example, the electronic device can identify the current touch scene through the corresponding relationship in Table 4.
[0378] Table 4
[0379] serial number Bluetooth connection status Adsorption state Corresponding touch scenes a Not connected Adsorption Finger input scene b Not connected keep away Finger input scene c connect Adsorption Finger input scene d connect Away (not adsorbed) Stylus input scenario
[0380] It can be understood that when the stylus performs a moving away or adsorption action, the electronic device can detect the moving away and adsorption events of the stylus in the first place, and the electronic device can directly determine the current touch scene according to the connection status and adsorption status of the stylus.
[0381] Since the stylus is in a connected state and not adsorbed when the user is using it. Therefore, when the electronic device detects that the stylus is in an unconnected state, the electronic device can also determine that the current stylus is not in use, and the current touch scene is the touch scene of finger input (i.e., the touch scene corresponding to codes a and b). When the electronic device detects that the stylus is in a connected state, but the stylus is in an adsorbed state, the electronic device can also determine that the current stylus is not in use, and the current touch scene is the touch scene of finger input (i.e., the touch scene corresponding to code c). When the electronic device detects that the stylus is in a connected state and the stylus is in a distant state, the electronic device can determine that the current stylus is in use, and the current touch scene is the touch scene of stylus input (i.e., the touch scene corresponding to code d).
[0382] In some embodiments, if the electronic device identifies the stylus away event through cep_timeout, the electronic device cannot detect the stylus away event at the first time. At this time, the electronic device can determine the current touch scene based on the connection status, adsorption status and full power status of the stylus.
[0383] For example, taking the establishment of a communication connection between the stylus pen and the electronic device via Bluetooth as an example, the electronic device can identify the current touch scene through the corresponding relationship in Table 5.
[0384] Table 5
[0385]
[0386] It can be understood that when the stylus is in a connected state, after the stylus is adsorbed on the electronic device and fully charged, the stylus will be in an adsorbed and stopped charging state. Since the wireless charging chip will always be in a low-power (lowpower) scanning Q mode after stopping charging. Therefore, when the stylus moves away from the adsorbed and stopped charging state, the wireless charging chip can promptly monitor the change in the Q value of the wireless charging coil, so that the distance event can be reported in time. Thus, when the electronic device detects a distance event, it can determine that the current stylus is in use, and the current touch scene is the touch scene input by the stylus (that is, the touch scene corresponding to code d). If no distance event is detected and it is still in the adsorbed and stopped charging state, the electronic device can confirm that the current stylus is not in use, and the current touch scene is the touch scene input by the finger (that is, the touch scene corresponding to code c2).
[0387] As for the scenario where the stylus is attached to the electronic device and is not fully charged, since the stylus's removal event cannot be detected in time, in the embodiment of the present application, it can be forced to assume that the current stylus is in use, and the current touch scene is the touch scene input by the stylus (i.e., the touch scene corresponding to code c1). In this way, when the user removes the stylus from the electronic device and uses the stylus for the first time, since the electronic device has switched the screen refresh rate to a refresh rate that matches the stylus in advance according to the stylus's usage status, there will be no touch abnormality, and the user can use the stylus to write or touch normally.
[0388] When the electronic device detects that the stylus is not connected, the electronic device can directly determine that the stylus is not in use and the current touch scene is the touch scene of finger input (ie, the touch scene corresponding to codes a1, a2 and b).
[0389] In one scenario, the Bluetooth service module of the framework layer can report connection events and disconnection events to the stylus service module of the framework layer when they are detected, so that the stylus service module can determine whether the current stylus is in use based on the connection events and disconnection events reported by the Bluetooth service module, and the adsorption events, distance events, full charge events, etc. reported by the wireless charging driver.
[0390] Optionally, when the stylus service module receives an unconnected event, it considers that the current stylus is not connected to the electronic device, and the current touch scene can be confirmed as a touch scene of finger input. If a connection event is received, the stylus service module can detect whether an adsorption event is received. If the stylus service module does not receive an adsorption event, it can be considered that the current stylus is in an unadsorbed state (it has been away from the electronic device), and the current touch scene can be confirmed as a touch scene of stylus input.
[0391] Optionally, when receiving the adsorption event, the stylus service module can determine whether a full power event is received. If the stylus service module does not receive the full power event, it can be considered that the current stylus is in a connected adsorption and not fully powered state, and the current touch scene can be forcibly confirmed as a touch scene input by the stylus.
[0392] Optionally, when the stylus service module receives a full-power event, it can determine whether a distance event is received. If the stylus service module does not receive a distance event, it can be considered that the current stylus is in a connected, adsorbed, fully-powered state, and the current touch scene can be confirmed to be a touch scene input by a finger. If a distance event is received, it can be considered that the current stylus is in an unadsorbed state (it has been away from the electronic device), and the current touch scene can be confirmed to be a touch scene input by the stylus.
[0393] That is, when the stylus service module recognizes that the stylus is in a state of connection, adsorption, and not fully charged, connection, and not adsorption (i.e., connection away), etc., it determines that the current touch scene is a touch scene of stylus input. When the stylus is recognized that the stylus is in a state of connection, adsorption, and full charge, or connection, etc., it determines that the current touch scene is a touch scene of finger input.
[0394] In some embodiments, the electronic device may also receive indication information from the stylus to indicate whether it is in use. Optionally, when the stylus recognizes that it is in use, it may directly send first indication information to the electronic device, so that the electronic device can directly confirm that the current touch scene is the touch scene input by the stylus. Optionally, when the stylus recognizes that it is not in use, it may directly send second indication information to the electronic device, so that the electronic device can directly confirm that the current touch scene is the touch scene input by the finger.
[0395] Optionally, the stylus can determine whether it is in use by detecting a holding state, a movement state, etc. of the stylus.
[0396] S1730: The electronic device matches the corresponding target refresh rate according to the current touch scene.
[0397] In the embodiment of the present application, after determining the current touch scene, the electronic device can determine a target refresh rate adapted to the current touch scene, so as to switch the screen refresh rate when the current screen refresh rate is different from the target refresh rate.
[0398] In some embodiments, the electronic device can determine the corresponding touch mode according to the current touch scene, and thus match the corresponding target refresh rate according to the refresh rate level supported by the corresponding touch mode. The touch mode includes a pen touch mode and a hand touch mode.
[0399] In some embodiments, different touch modes may also correspond to firmware operating modes of the touch screen. Therefore, after the electronic device determines the corresponding touch mode according to the current touch scene, it may also match the firmware operating mode supported by the corresponding touch mode.
[0400] Exemplarily, it is assumed that the default initial touch scene of the electronic device is a touch scene of finger input.
[0401] If the stylus pen is not connected to the electronic device via Bluetooth, the stylus pen service module can receive the unconnected event after reporting it to the Bluetooth service module and the stylus pen service module through the aforementioned event transmission path, and determine that the current touch scene is still the touch scene of finger input. The touch scene has not changed (finger input -> finger input).
[0402] In one scenario, if the stylus is connected to the electronic device via Bluetooth and the stylus is in a distant state, after reporting to the stylus service module through the same channel, the stylus service module can receive the connected event and the distant event, confirming that the current touch scene is the touch scene of the stylus input. The touch scene has changed (finger input -> stylus input). Of course, if the Bluetooth connection of the stylus is disconnected at this time, the stylus service module can receive the unconnected event, thereby determining that the current touch scene is restored to the touch scene of the finger input. The touch scene has changed again (stylus input -> finger input).
[0403] Next, if the stylus is adsorbed from the distant state without disconnecting the Bluetooth connection, the stylus service module can receive the connection event and the adsorption event after reporting to the stylus service module through the same channel. If the stylus service module does not receive the full power event, it means that the stylus is adsorbed on the electronic device and is in the charging state, then the stylus service module determines that the current touch scene is still the touch scene of the stylus input. The touch scene has not changed (stylus input -> stylus input). Of course, if the Bluetooth connection of the stylus is disconnected at this time, the stylus service module can receive the unconnected event, thereby determining that the current touch scene is the touch scene of the finger input. The touch scene has changed (stylus input -> finger input).
[0404] Next, if the stylus is attached to the electronic device for a period of time without disconnecting the Bluetooth connection, and the stylus service module receives a full-charge event, it means that the stylus is in the state of attachment and charging stop, and the stylus service module determines that the current touch scene is a touch scene of finger input. The touch scene has changed (stylus input -> finger input). Of course, if the Bluetooth connection of the stylus is disconnected at this time, the stylus service module can receive a disconnected event, so as to determine that the current touch scene is still a touch scene of finger input. The touch scene has not changed (finger input -> finger input).
[0405] Next, if the stylus is moved away from the adsorption and charging stop state without disconnecting the Bluetooth connection, the stylus service module can receive the connected event and the distance event after reporting to the stylus service module through the same channel. The stylus service module determines that the current touch scene is the touch scene of the stylus input. The touch scene has changed (finger input -> stylus input). Of course, if the Bluetooth connection of the stylus is disconnected at this time, the stylus service module can receive the unconnected event, thereby determining that the current touch scene is the touch scene of the finger input. The touch scene has changed (stylus input -> finger input).
[0406] It can be understood that if the stylus is moved away from the adsorption charging state without disconnecting the Bluetooth connection, the stylus service module can only receive connected events and adsorption events, and cannot receive the distance event in time (cep_timeout delay). Therefore, the stylus service module still retains the original touch scene recognition result, that is, the touch scene of the stylus input that is forcibly confirmed. This also happens to be consistent with the touch scene corresponding to the connection distance event. Therefore, there will be no recognition error of the touch scene. Even if the subsequent stylus service module receives a distance event after the cep_timeout delay, the recognized touch scene is also the touch scene of the stylus input. Therefore, there will be no recognition error of the touch scene.
[0407] In another scenario, if the stylus is connected to the electronic device via Bluetooth and the stylus is in an adsorbed charging state, then after reporting to the stylus service module through the same channel, the stylus service module can receive a connected event and an adsorbed event, and no full-charge event is received. This indicates that the stylus is not fully charged. At this time, the stylus service module can forcibly determine that the current touch scene is a touch scene for stylus input. The touch scene has changed (finger input -> stylus input). Of course, if the Bluetooth connection of the stylus is disconnected at this time, the stylus service module can receive a disconnected event, thereby determining that the current touch scene is restored to a touch scene for finger input. The touch scene has changed again (stylus input -> finger input).
[0408] Next, if the stylus is attached to the electronic device for a period of time without disconnecting the Bluetooth connection, the stylus service module receives a full charge event, indicating that the stylus is in the state of attachment and charging. At this time, the stylus service module can determine that the current touch scene is a touch scene of finger input. The touch scene has changed (stylus input -> finger input). For subsequent disconnection, distance and other scenes, please refer to the above description.
[0409] In another scenario, if the stylus is connected to the electronic device via Bluetooth and the stylus is in the adsorption and charging stop state, the stylus service module can receive the connection event, adsorption event and full charge event after reporting to the stylus service module through the same channel. This indicates that the stylus is in a fully charged state. At this time, the stylus service module can determine that the current touch scene is still a touch scene of finger input. The touch scene has not changed (finger input -> finger input). Of course, if the Bluetooth connection of the stylus is disconnected at this time, the stylus service module can receive the unconnected event, thereby determining that the current touch scene is still a touch scene of finger input. The touch scene has not changed (finger input -> finger input).
[0410] Next, if the stylus is moved away from the adsorption and charging stop state without disconnecting the Bluetooth connection, the stylus service module can receive the connected event and the distance event after reporting to the stylus service module through the same channel. The stylus service module determines that the current touch scene is the touch scene of the stylus input. The touch scene has changed (finger input -> stylus input). Of course, if the Bluetooth connection of the stylus is disconnected at this time, the stylus service module can receive the unconnected event, thereby determining that the current touch scene is the touch scene of the finger input. The touch scene has changed (stylus input -> finger input).
[0411] As an example, the identification of the above touch scene and whether the touch scene changes may be shown in Table 6:
[0412] Table 6
[0413]
[0414] In some embodiments, when the stylus service module of the electronic device determines the current touch scene, if it finds that the touch scene has changed compared to the previous touch scene, it can notify the frame rate control module so that the frame rate control module matches the corresponding target refresh rate according to the current touch scene. This realizes the real-time decision of the screen refresh rate suitable for the current touch scene of the electronic device. That is, at this time, it involves the refresh rate switching between different touch modes.
[0415] As an example, the stylus service module sends a scene switching instruction to the frame rate control module, so that the frame rate control module can respond to the scene switching instruction and determine a screen refresh rate suitable for the current touch scene of the electronic device.
[0416] Optionally, when the current touch scene is a touch scene of stylus input, the frame rate control module can determine that the corresponding touch mode is a pen touch mode according to the touch scene of stylus input. Thus, the frame rate control module can match the corresponding target refresh rate from the screen refresh rate gear supported in the pen touch mode. For example, as shown in Table 3, the target refresh rate can be 60Hz in the pen touch mode (i.e., sequence number 2-2).
[0417] In some embodiments, when the current touch scene is a touch scene of stylus input, the frame rate control module can also match the corresponding target working mode from the touch screen firmware working modes supported in the pen touch mode. For example, as shown in Table 3, the target working mode can be firmware mode 2 in the pen touch mode.
[0418] Optionally, when the current touch scene is a finger input touch scene, the frame rate control module can determine that the corresponding touch mode is a hand touch mode according to the finger input touch scene. Thus, the frame rate control module can match the corresponding target refresh rate from the screen refresh rate gears supported in the hand touch mode. For example, as shown in Table 3, the target refresh rate can be 144Hz (i.e., sequence numbers 1-4) in the hand touch mode.
[0419] In some embodiments, when the current touch scene is a finger input touch scene, the frame rate control module can also match the corresponding target operating mode from the touch screen firmware operating modes supported in the hand touch mode. For example, as shown in Table 3, the target operating mode can be firmware mode 1 in the hand touch mode.
[0420] In some embodiments, when the stylus service module of the electronic device determines the current touch scene, if it finds that the touch scene has not changed compared to the previous touch scene, it may not notify the frame rate control module. Thus, the frame rate control module continues to match the corresponding target refresh rate according to the previous touch scene. That is, at this time, it only involves the adjustment and change of the frame rate gear under the same touch mode.
[0421] In the embodiment of the present application, the refresh rate gears supported in different touch modes may have repeated parts or different parts. For example, the hand touch mode supports refresh rate gears such as 30hz~60hz~120hz~144hz, and also supports other refresh rates between these refresh rate gears (such as 62Hz, 125Hz, etc.). The pen touch mode can only support three frame rates of 30hz / 60hz / 120hz. In this way, not only the frame rate range and gears supported in the hand touch mode are increased, but also the power consumption in the hand touch mode can be reduced, and the anti-interference ability can be enhanced.
[0422] Optionally, the frame rate control module may match a corresponding target refresh rate according to a current touch scene and a refresh rate used by a current screen.
[0423] For example, taking the refresh rate of the current screen as 144Hz in hand touch mode (i.e., serial number 1-4) as an example, if the current touch scene is identified as a touch scene of stylus input, the frame rate control module can determine that the corresponding touch mode is pen touch mode according to the touch scene of stylus input. Thus, the frame rate control module can select the refresh rate gear closest to the refresh rate used by the current screen from the screen refresh rate gears supported in pen touch mode as the target refresh rate that matches the corresponding. For example, as shown in Table 3, the target refresh rate can be 60Hz in pen touch mode (i.e., serial number 2-2). Avoid excessive differences in refresh rate gear switching.
[0424] It can be understood that when the target refresh rate is 60 Hz in pen touch mode, the refresh rate switching process performed by the electronic device requires switching between different touch modes and different frame rate gears.
[0425] For another example, taking the refresh rate of the current screen as 60Hz in pen touch mode (i.e., serial number 2-2), if the current touch scene is identified as a touch scene of finger input, the frame rate control module can determine that the corresponding touch mode is hand touch mode according to the touch scene of finger input. Thus, the frame rate control module can select the refresh rate gear closest to the refresh rate used by the current screen from the screen refresh rate gears supported in hand touch mode as the target refresh rate that matches the corresponding. For example, as shown in Table 3, the target refresh rate can be 60Hz in hand touch mode (i.e., serial number 1-2). Avoid excessive differences in refresh rate gear switching.
[0426] It can be understood that when the target refresh rate is 60 Hz in the hand touch mode, since the refresh rate gears are the same, all of which are 60 Hz, the refresh rate switching process performed by the electronic device only needs to switch between different touch modes.
[0427] S1740: The electronic device adjusts the screen refresh rate to the target refresh rate.
[0428] In some embodiments, when the frame rate control module determines the target refresh rate, it can generate a refresh rate switching instruction and send it to the instruction issuing module, so as to issue the refresh rate switching instruction to the display driver of the kernel layer to complete the refresh rate switching.
[0429] Optionally, when the touch scene changes, the target refresh rate determined by the frame rate control module is the refresh rate under different touch modes compared to the refresh rate used by the current screen. Therefore, the refresh rate switching instruction generated involves switching the touch mode. For example, taking the refresh rate used by the current screen as the second refresh rate in the hand touch mode and the target refresh rate as the first refresh rate in the pen touch mode as an example, the refresh rate switching instruction generated can be the first refresh rate switching instruction in the aforementioned embodiment. Thus, the electronic device can execute the refresh rate switching method in the aforementioned embodiment to complete the refresh rate switching of different touch modes.
[0430] Optionally, when the refresh rate switching instruction generated involves not only the switching of the touch mode, but also the switching of the frame rate gear. If the refresh rate used by the current screen exceeds the refresh rate gear supported by the touch mode after switching, the electronic device can first adjust the refresh rate used by the current screen to the refresh rate range supported by the touch mode after switching, and then trigger the switch of the touch mode. For example, when the refresh rate used by the current screen is 120Hz in the hand touch mode, if it is switched to 60Hz in the pen touch mode, first reduce the frame rate gear to 60Hz in the hand touch mode. Then switch from 60Hz in the hand touch mode to 60Hz in the pen touch mode.
[0431] Optionally, when the touch scene does not change, the target refresh rate determined by the frame rate control module is the refresh rate of the same touch mode as the refresh rate used by the current screen. Therefore, the refresh rate switching instruction generated only involves switching the refresh rate gear. The refresh rate can be changed directly by changing the VFP parameter in the display timing, that is, the length of the idle time at the end of the frame.
[0432] In some embodiments, if the refresh rate switching of different touch modes is involved, the frame rate control module may also generate a firmware switching instruction when determining the target refresh rate, and issue the firmware switching instruction to the touch driver of the kernel layer to complete the working mode switching of the touch firmware. Optionally, the firmware switching instruction may also be sent to the instruction issuing module to issue the firmware switching instruction to the display driver of the kernel layer, instructing the display driver to complete the switching of the refresh rate while simultaneously notifying the touch driver in the kernel to complete the working mode switching of the touch firmware.
[0433] In the embodiment of the present application, the electronic device may also pre-configure corresponding touch modes for some applications, so that when the electronic device runs one of these applications in the foreground, the target refresh rate in the corresponding touch mode can be matched directly according to the touch mode configured for the application.
[0434] In some embodiments, the electronic device may also match the corresponding target refresh rate according to the touch mode configured in the whitelist. Optionally, the electronic device may store an application whitelist corresponding to the hand touch mode and an application whitelist corresponding to the pen touch mode. Each application in the application whitelist corresponding to the hand touch mode is forcibly configured as the hand touch mode. Each application in the application whitelist corresponding to the pen touch mode is forcibly configured as the pen touch mode.
[0435] When the application running in the foreground of the electronic device is the first application, if the application whitelist corresponding to the hand touch mode includes the first application, the electronic device can determine that the touch mode corresponding to the current scene is the hand touch mode. Thus, the electronic device can match the corresponding target refresh rate from the refresh rate gears supported in the hand touch mode. Among them, the first application can be a game application, a video application, or other application that does not require the use of a stylus.
[0436] When the application running in the foreground of the electronic device is the second application, if the application whitelist corresponding to the pen touch mode includes the second application, the electronic device can determine that the touch mode corresponding to the current scene is the pen touch mode. Thus, the electronic device can match the corresponding target refresh rate from the refresh rate gears supported in the pen touch mode. Among them, the second application can be a painting application, a note application, or other application that requires the use of a stylus.
[0437] Optionally, the application whitelist stored in the electronic device may also include pre-configured touch modes corresponding to various application programs, including applications corresponding to pen touch mode and applications corresponding to hand touch mode. Thus, the electronic device can determine the touch mode corresponding to the application program running in the foreground according to the application whitelist.
[0438] In one scenario, the whitelist service module of the framework layer of the electronic device can determine in real time whether the application whitelist has a corresponding touch mode configured for the application running in the foreground. If the application whitelist is configured with a touch mode corresponding to the application running in the foreground, the whitelist service module can notify the frame rate control module of the corresponding touch mode, so that the frame rate control module can match the target refresh rate in the touch mode.
[0439] Optionally, the application whitelist may detect a change in the touch mode and then notify the frame rate control module, so that the frame rate control module may match the target refresh rate in the touch mode.
[0440] In some embodiments, the electronic device may also combine the whitelist and the usage status of the stylus to match the corresponding target refresh rate.
[0441] Optionally, the electronic device may preferentially match the corresponding target refresh rate according to the touch mode configured in the whitelist. When the touch mode corresponding to the application running in the foreground is not configured in the application whitelist, the electronic device may determine the current touch scene according to the use status of the stylus. Thus, the corresponding touch mode is determined according to the current touch scene, and then the corresponding target refresh rate is matched.
[0442] In one scenario, the frame rate control module in the framework layer can prioritize the touch mode configured in the whitelist service module to determine the target refresh rate suitable for the current touch scenario of the electronic device. When the whitelist service module is not configured with the corresponding touch mode, the target refresh rate suitable for the current touch scenario of the electronic device is determined based on the state information of the stylus sent by the stylus service module.
[0443] In this way, the electronic device can integrate the whitelist and the usage status of the stylus to achieve refresh switching under different touch modes.
[0444] It is understandable that, in order to realize the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0445] The embodiment of the present application can divide the functional modules of the electronic device according to the above method. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0446] Some other embodiments of the present application also provide a refresh rate switching device, which can be applied to the above electronic device and is used to execute various functions or steps executed by the electronic device in the above method embodiment.
[0447] Some other embodiments of the present application also provide a refresh rate switching system, which includes a stylus and the above-mentioned electronic device.
[0448] Some other embodiments of the present application further provide an electronic device, the electronic device comprising the above-mentioned stylus pen, wherein the electronic device is used to execute each function or step executed by the electronic device in the above-mentioned method embodiment.
[0449] 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 through a line. The interface circuit can read the 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 embodiment. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.
[0450] An embodiment of the present application also provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the electronic device in the above-mentioned method embodiment.
[0451] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer executes each function or step executed by the electronic device in the above method embodiment.
[0452] Among them, the stylus pen, 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.
[0453] 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.
[0454] 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 modules or units is only a logical function division, and 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.
[0455] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A refresh rate switching method, characterized in that: Applied to an electronic device, the electronic device supports a first touch mode and a second touch mode, the method comprising: When the screen refresh rate is the first refresh rate of the first touch mode, a first refresh rate switching instruction is detected, where the first refresh rate switching instruction is used to instruct switching from the first refresh rate of the first touch mode to the second refresh rate of the second touch mode; In response to the first refresh rate switching instruction, controlling the graphics processor to perform layer synthesis of the image to be displayed; Controlling the display processor to switch the screen refresh rate from the first refresh rate of the first touch mode to the second refresh rate of the second touch mode; The image to be displayed synthesized by the graphics processor is displayed at the second refresh rate of the second touch mode.
2. The method according to claim 1, characterized in that: The first touch mode is a pen touch mode, and the second touch mode is a hand touch mode; or the first touch mode is a hand touch mode, and the second touch mode is a pen touch mode; The hand touch mode is used to indicate that the electronic device supports the user to provide input through finger operation, and the pen touch mode is used to indicate that the electronic device supports the user to provide input through both finger operation and stylus operation.
3. The method according to claim 1 or 2, characterized in that: The first refresh rate is the same as the second refresh rate; or The first refresh rate is greater than the second refresh rate; or The first refresh rate is lower than the second refresh rate.
4. The method according to any one of claims 1 to 3, characterized in that: When the first refresh rate is greater than the second refresh rate, the method further includes: When refreshing and displaying the Nth frame image, the first refresh rate switching instruction is detected, where N is a positive integer; In response to the first refresh rate switching instruction, controlling the display processor to perform layer synthesis of the Nth frame image to obtain a first image to be displayed; Controlling the display processor to switch the screen refresh rate from the first refresh rate of the first touch mode to the second refresh rate of the first touch mode; displaying the first image synthesized by the display processor at the second refresh rate of the first touch mode; When refreshing and displaying the N+1th frame image, in response to the first refresh rate switching instruction, controlling the graphics processor to perform layer synthesis of the N+1th frame image to obtain a second image to be displayed; Controlling the display processor to switch the screen refresh rate from the second refresh rate of the first touch mode to the second refresh rate of the second touch mode; The second image synthesized by the graphics processor is displayed at the second refresh rate of the second touch mode.
5. The method according to any one of claims 1 to 3, characterized in that: When the first refresh rate is less than the second refresh rate, the method further includes: When refreshing and displaying the Nth frame image, the first refresh rate switching instruction is detected, where N is a positive integer; In response to the first refresh rate switching instruction, control the graphics processor to perform layer synthesis of the Nth frame image to obtain a first image to be displayed; Controlling the display processor to switch the screen refresh rate from the first refresh rate of the first touch mode to the first refresh rate of the second touch mode; displaying the first image synthesized by the graphics processor at the first refresh rate of the second touch mode; When refreshing and displaying the N+1th frame image, in response to the first refresh rate switching instruction, controlling the display processor to perform layer synthesis of the N+1th frame image to obtain a second image to be displayed; Controlling the display processor to switch the screen refresh rate from the first refresh rate of the second touch mode to the second refresh rate of the second touch mode; The second image synthesized by the display processor is displayed at the second refresh rate of the second touch mode.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Determine the usage status of the stylus; In response to the use status switching from unused to used, or the use status switching from used to unused, the first refresh rate switching instruction is generated.
7. The method according to claim 6, characterized in that The determining the usage status of the stylus pen includes: receiving a usage status of the stylus sent by the stylus; or The use state of the stylus pen is determined according to the detected connection state, adsorption state, and full-charge state of the stylus pen.
8. The method according to claim 7, characterized in that Determining the use state of the stylus pen according to the detected connection state, adsorption state, and full power state of the stylus pen includes: If it is detected that the stylus is connected to and attached to the electronic device, and the power of the stylus is not full, determining that the use state of the stylus is in use; If it is detected that the stylus pen is connected to and attached to the electronic device, and the stylus pen is fully charged, determining that the usage status of the stylus pen is not in use; If it is detected that the stylus pen is connected and not adsorbed on the electronic device, determining that the use state of the stylus pen is in use; If it is detected that the stylus pen is not connected to the electronic device, it is determined that the usage status of the stylus pen is not in use.
9. The method according to any one of claims 6 to 8, characterized in that: The first touch mode is a hand touch mode, the second touch mode is a pen touch mode, and in response to the use state being switched from unused to used, generating the first refresh rate switching instruction includes: In response to the use state being switched from unused to used, determining a matching screen refresh rate as a second refresh rate from a plurality of refresh rates supported by the pen touch mode; The first refresh rate switching instruction is generated according to the second refresh rate of the pen touch mode.
10. The method according to any one of claims 6 to 8, characterized in that: The first touch mode is a pen touch mode, the second touch mode is a hand touch mode, and in response to the use state being switched from used to unused, generating the first refresh rate switching instruction includes: In response to the use state being switched from used to unused, determining a matching screen refresh rate as a second refresh rate from a plurality of refresh rates supported by the hand touch mode; The first refresh rate switching instruction is generated according to the second refresh rate of the hand touch mode.
11. The method according to any one of claims 6 to 10, characterized in that: The method further comprises: When the foreground application is not in the preset whitelist, in response to the use status switching from unused to used, or the use status switching from used to unused, generating the first refresh rate switching instruction; When the foreground application is in the preset whitelist, matching the touch mode corresponding to the foreground application from the preset whitelist; In response to the touch mode corresponding to the foreground application being switched from the first touch mode to the second touch mode, the first refresh rate switching instruction is generated.
12. The method according to claim 11, characterized in that The generating the first refresh rate switching instruction in response to the touch mode corresponding to the foreground application being switched from the first touch mode to the second touch mode includes: In response to the touch mode corresponding to the foreground application being switched from the first touch mode to the second touch mode, determining a matching screen refresh rate as a second refresh rate from a plurality of refresh rates supported by the second touch mode; The first refresh rate switching instruction is generated according to the second refresh rate of the second touch mode.
13. The method according to any one of claims 1 to 12, characterized in that: The touch control firmware of the electronic device supports a first working mode and a second working mode, the first working mode corresponds to the first touch control mode, and the second working mode corresponds to the second touch control mode, and the method further includes: In response to the first refresh rate switching instruction, the operating mode of the touch firmware is switched from the first operating mode to the second operating mode.
14. The method according to any one of claims 1 to 13, characterized in that: The method further comprises: After the screen refresh rate is switched to the second refresh rate of the second touch mode, controlling the display processor to perform layer synthesis of the image to be displayed; The image to be displayed synthesized by the display processor is displayed at the second refresh rate of the second touch mode.
15. An electronic device, characterized in that: The electronic device comprises a memory and one or more processors; the memory is used to store a program, and when the processor executes the program, the electronic device executes the method as described in any one of claims 1-14.
16. An electronic device, characterized in that: The electronic device includes a stylus.
17. A readable storage medium, characterized in that: The invention comprises a program, and when the program is executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Image synthesis method and device, electronic equipment and storage medium
CN110413245A
Refresh rate control method and system and electronic equipment
CN113220154A
Refresh rate switching method, electronic equipment and system
CN115686250A
Air Mouse Mode Implementation Method and Related Device
US20220308679A1
Cited By
Refresh rate switching method and electronic device
EP4730320A1
Refresh rate switching method and electronic device
WO2025044346A1