Refresh rate switching method and electronic device
By detecting the refresh rate switching instruction across modes in the electronic device, the layer synthesis processing is handed over to the graphics processor to perform, which solves the problem of abnormal display during the refresh rate switching process, and realizes the stability of refresh rate switching and the normality of image display.
Patent Information
- Application Number
- PCT/CN2024/096199
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-25
- Filing Date
- 2024-05-29
- Publication Date
- 2025-03-06
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.
By detecting the refresh rate switching command across modes, the electronic device handes the layer synthesis processing of the displayed image to the graphics processor to perform, thereby reducing the load on the display processor and ensuring the normal completion of the refresh rate switching and the normal display of the screen.
It effectively avoids the problem of abnormal display sending during cross-mode refresh rate switching, ensuring the normal display sending of images and stable switching of refresh rate.
Smart Images

Figure CN2024096199_06032025_PF_FP_ABST
Abstract
Description
Refresh rate switching method and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on August 25, 2023, with application number 202311090673.6 and application name “Refresh rate switching method and electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] 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
[0003] 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 one frame of image every 16.6 milliseconds. The higher the refresh rate, the more times the electronic device can complete the refresh and display of image frames 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.
[0004] Currently, after a stylus pen and an electronic device are wirelessly connected, a user can use the stylus pen to operate the electronic device's touchscreen, providing input to the electronic device, which then performs corresponding operations based on the input. To ensure signal synchronization between the electronic device and the stylus pen, the electronic device needs to switch its refresh rate to match the stylus pen's. However, the current refresh rate switching process may cause display anomalies.
[0005] Summary of the Invention
[0006] The present application provides a refresh rate switching method and an electronic device, which can normally complete the refresh rate switching under different touch modes while ensuring the normal display of the screen.
[0007] To achieve the above objectives, this application adopts the following technical solutions:
[0008] 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 includes: 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.
[0009] 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 method indicated by each touch mode.
[0010] Each touch mode corresponds to at least one supported refresh rate level. The refresh rate levels supported by different touch modes can be different or the same. Different touch modes can support different refresh rate levels. The refresh rate levels supported by different touch modes can be completely different, or they can have both different and overlapping refresh rate levels. For example, the first touch mode supports 30Hz and 60Hz, and the second touch mode supports 60Hz, 120Hz, and 144Hz.
[0011] 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.
[0012] The solution provided by the first aspect above is that 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. 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 display anomalies that are prone to occur during the switching process. Therefore, when switching refresh rates between different touch modes, this solution offloads the display processor's layer compositing, which was previously handled by the display processor, to the graphics processor, reducing the display processor's load and allowing the display processor to focus on the refresh rate switching process. This ensures both the normal completion of refresh rate switching across modes and the normal display of the image to be displayed, thus avoiding display anomalies during refresh rate switching across modes.
[0013] In one possible implementation, the first touch mode is a pen touch mode, and the second touch mode is a hand touch mode. The hand touch mode indicates that the electronic device supports user input via finger operation, and the pen touch mode indicates that the electronic device supports user input via both finger operation and stylus operation.
[0014] That is, when the screen of an 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 the normal switch to normally refresh the image synthesized by the graphics processor on the screen.
[0015] In another possible implementation, the first touch mode is a hand touch mode, and the second touch mode is a pen touch mode.
[0016] That is, when the screen of an 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 displayed image 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 the normal switch to normally refresh the image synthesized by the graphics processor on the screen.
[0017] In one possible embodiment, the first refresh rate is the same as the second refresh rate. It can be understood that although the refresh rate gears of the two touch modes are the same, due to the differences in the supported touch methods, 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 handing over the layer synthesis processing of the display image that was originally the responsibility of the display processor to the graphics processor when the same refresh rate switching of different touch modes is required. The display processor can be centrally responsible for the same refresh rate switching processing of different touch modes.
[0018] In one 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 refreshing rate switching between different touch modes and refreshing rate switching between different refresh rate levels.
[0019] In one possible implementation, the first refresh rate is greater than the second refresh rate. This allows the solution to switch from a high refresh rate in one touch mode to a low refresh rate in another touch mode, such as switching from 144 Hz in hand touch mode to 60 Hz in pen touch mode.
[0020] In one possible implementation, the first refresh rate is greater than the second refresh rate. This allows the solution to switch from a low refresh rate in one touch mode to a high refresh rate in another touch mode, such as switching from 60 Hz in a pen touch mode to 144 Hz in a hand touch mode.
[0021] 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.
[0022] In one possible embodiment, when the first refresh rate is greater than the second refresh rate, the specific process of the refresh rate switching method provided by this solution may include: when refreshing and displaying the Nth frame image, detecting a first refresh rate switching instruction, 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 the 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 the 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; and displaying the second image synthesized by the graphics 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 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 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 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 of the next frame image (the N+1th frame image). (Switching from 60Hz of the hand touch mode to 60Hz of the pen touch mode). 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 is not involved, and the switching difference is not large. Therefore, the layer composition of the Nth frame can still be handled by the display processor, without having to be handed over to the graphics processor. However, when refreshing and displaying the N+1th frame, the switching of the same refresh rate for different touch modes must be completed, resulting in significant switching differences. Therefore, the layer composition of the N+1th frame needs to be handed over to the graphics processor to reduce the load on the display processor, allowing the display processor to focus on switching the same refresh rate for different touch modes.
[0024] In one possible embodiment, when the first refresh rate is less than the second refresh rate, the specific process of the refresh rate switching method provided by this solution may include: when refreshing and displaying the Nth frame image, detecting a first refresh rate switching instruction, where 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 the 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 the 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.
[0025] 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 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 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 in the same touch mode (such as switching from 60Hz of the hand touch mode to 144Hz of the hand touch mode) during the refresh display of the next frame image (the N+1th frame image). Among them, when refreshing the display of the Nth frame image, since the same refresh rate switching of different touch modes is completed, it involves cross-mode refresh rate switching, 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. The display processor can be centrally responsible for the same refresh rate switching of different touch modes. However, when refreshing the N+1 frame, the refresh rate switch between different levels within the same touch mode is required, so there's no cross-mode involved and the switching difference is minimal. Therefore, the layer compositing for the N+1 frame can still be handled by the display processor, without having to hand it over to the graphics processor.
[0026] 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.
[0027] In one possible implementation, the refresh rate switching method provided by this solution may further include: determining the usage status of the stylus; and generating a first refresh rate switching instruction in response to the usage status switching from unused to used, or vice versa. In this way, if 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. If 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.
[0028] 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.
[0029] In one possible implementation, the electronic device may also detect the stylus usage status itself. For example, the electronic device may detect the stylus connection status, adsorption status, and full power status to determine the stylus usage status based on the detected connection status, adsorption status, and full power status.
[0030] Optionally, when the stylus is connected to and adsorbed on the electronic device and the stylus is not fully charged, the electronic device may determine that the usage status of the stylus is in use.
[0031] Understandably, if the user removes the stylus and uses it immediately, the electronic device will not be able to detect the stylus's removal event in a timely manner through the error timeout packet (cep_timeout), because the stylus is still in the attached charging state before removal. As a result, the electronic device cannot immediately recognize that the stylus is in use, and the user cannot use the stylus normally immediately after removing it. Therefore, this solution adds a full charge state judgment to forcibly recognize the stylus's attached charging state before it is fully charged as the stylus being used. This way, even if the user removes the stylus and uses it for input, the stylus can still be used normally.
[0032] Optionally, when the stylus is connected and attached to the electronic device and the stylus is fully charged, the electronic device may determine that the stylus is not in use. It is understood that when the stylus is attached to the electronic device and fully charged, the electronic device can promptly detect the stylus's removal through other means, thus eliminating the need to forcibly identify the stylus as in use. Simply by observing the stylus being attached to the electronic device, it can be determined that the stylus is not in use.
[0033] Optionally, when the stylus is connected and not attached to the electronic device, the electronic device may determine that the stylus is in use. It is understandable that when the stylus connected to the electronic device is away from the electronic device, the user is likely to be using the stylus.
[0034] Optionally, when the stylus is not connected to the electronic device, the electronic device determines that the stylus is not in use. It is understood that the stylus usually needs to be connected to the electronic device to input normally. Therefore, if the electronic device is not connected, it means that the user does not need to use the stylus at present.
[0035] In one possible embodiment, the first touch mode is a hand touch mode, and the second touch mode is a pen touch mode. The electronic device can determine the 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.
[0036] In this way, when the user does not need to use a stylus, the electronic device's current screen refresh rate matches the hand-stylus mode. However, when a touch scene change is detected and the user needs to use a stylus, the electronic device switches the current screen refresh rate to match the pen touch mode. In other words, the electronic device can select an appropriate refresh rate from the multiple selectable refresh rates in the pen touch mode and generate a corresponding cross-mode refresh rate switching instruction.
[0037] In one possible embodiment, the first touch mode is a pen touch mode, and the second touch mode is a hand touch mode. The electronic device can determine the 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.
[0038] In this way, when the current scenario requires the use of a stylus, the electronic device's current screen refresh rate matches the pen touch mode. However, when a change in the touch scenario is detected and the user no longer needs to use the stylus, the electronic device can switch the current screen refresh rate to match the hand touch mode. In other words, it can select an appropriate refresh rate from the multiple selectable refresh rates in hand touch mode and generate a corresponding cross-mode refresh rate switching instruction.
[0039] In one possible implementation, the electronic device may also be pre-configured with a whitelist that includes the touch modes corresponding to various applications. For example, gaming applications may be forced to be configured in hand touch mode, while applications that require a stylus, such as drawing or note-taking, may be forced to be configured in pen touch mode.
[0040] 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 status switching from unused to used, or from used to unused, a first refresh rate switching instruction is generated.
[0041] When the application running in the foreground of an electronic device is on a preset whitelist, the electronic device may prioritize switching the refresh rate based on the touch mode configured in the preset whitelist. For example, the touch mode corresponding to the application running in the foreground is found in the preset whitelist. When the touch mode corresponding to the application running in the foreground changes, such as switching from a first touch mode to a second touch mode, the electronic device may generate a first refresh rate switching instruction in response to the change in the touch mode.
[0042] 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.
[0043] Similarly, if the touch mode corresponding to the currently running application switches 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. In this case, the electronic device can determine a matching screen refresh rate of the first refresh rate from the multiple refresh rates supported by the first touch mode; and generate the second refresh rate switching instruction based on the first refresh rate of the first touch mode.
[0044] In some embodiments, due to changes in 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 can the screen refresh rate 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.
[0045] In some embodiments, the refresh rate switching method provided by this 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 switch 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 switch 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.
[0046] In a second aspect, a refresh rate switching device is provided. The device is included in an electronic device and has the function of implementing the electronic device behavior described in the first aspect and any of the possible implementations of the first aspect. This function can be implemented through hardware or through hardware executing corresponding software implementations. 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.
[0047] 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.
[0048] In one possible implementation, the first touch mode is a pen touch mode, and the second touch mode is a hand touch mode. The hand touch mode indicates that the electronic device supports user input via finger operation, and the pen touch mode indicates that the electronic device supports user input via both finger operation and stylus operation.
[0049] In a possible implementation, the first touch mode is a hand touch mode, and the second touch mode is a pen touch mode.
[0050] 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.
[0051] In one possible embodiment, when the first refresh rate is greater than the second refresh rate, the processing module is used to: detect the first refresh rate switching instruction when refreshing and displaying the Nth frame image, 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.
[0052] In one possible embodiment, when the first refresh rate is less than the second refresh rate, the processing module is configured to: detect a first refresh rate switching instruction when refreshing and displaying the Nth frame image, 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; 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 configured to: display the first image synthesized by the graphics processor at the first refresh rate of the second touch mode. The processing module is further configured 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 a 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 further configured to: display the second image synthesized by the display processor at the second refresh rate of the second touch mode.
[0053] In a possible implementation, the processing module is further configured to: determine a 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.
[0054] In a possible implementation, the processing module is further configured to: receive a usage status of the stylus sent by the stylus.
[0055] In a possible implementation, the processing module is further configured to determine a usage status of the stylus according to the detected connection status, adsorption status, and full-charge status of the stylus.
[0056] In one possible embodiment, the processing module is further used to: if it is detected that the stylus is connected and attached to the electronic device, and the stylus is not fully charged, determine 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, determine that the stylus is not in use; if it is detected that the stylus is connected and not attached to the electronic device, determine that the stylus is in use; if it is detected that the stylus is not connected to the electronic device, determine that the stylus is not in use.
[0057] In one 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 usage state switching from unused to used, determine a matching screen refresh rate as a second refresh rate from a plurality of refresh rates supported by the pen touch mode; and generate a first refresh rate switching instruction based on the second refresh rate of the pen touch mode.
[0058] In one 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 configured to: in response to the usage state switching from used to unused, determine a matching screen refresh rate as a second refresh rate from a plurality of refresh rates supported by the hand touch mode; and generate a first refresh rate switching instruction based on the second refresh rate of the hand touch mode.
[0059] In a possible implementation, the processing module is further configured to: when the foreground application is not in a preset whitelist, generate a first refresh rate switching instruction in response to the usage status switching from unused to used, or from used to unused.
[0060] In one possible embodiment, 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.
[0061] In one possible embodiment, 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 the matching screen refresh rate as 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.
[0062] In one possible embodiment, the touch control firmware of the electronic device supports a first operating mode and a second operating mode, where the first operating mode corresponds to the first touch control mode and the second operating mode corresponds to the second touch control mode. The processing module is further configured to: in response to the first refresh rate switching instruction, switch the operating mode of the touch control firmware from the first operating mode to the second operating mode.
[0063] In a possible embodiment, 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.
[0064] 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 configured to store computer program code, the computer program code comprising computer instructions. When the one or more processors execute the computer instructions, the electronic device performs the refresh rate switching method of any possible implementation of the first aspect.
[0065] 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 the memory of the electronic device and send signals to the processor, and the signals include 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 above-mentioned first aspect.
[0066] In a fifth aspect, an electronic device is provided, the electronic device including a stylus pen, wherein the electronic device executes the refresh rate switching method in any possible implementation of the first aspect.
[0067] 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.
[0068] 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.
[0069] 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
[0070] FIG1 is an abstract diagram showing a timing sequence according to an embodiment of the present application;
[0071] FIG2 is a waveform diagram showing a timing sequence according to an embodiment of the present application;
[0072] FIG3 is a schematic diagram of a scenario provided by an embodiment of the present application;
[0073] FIG4 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0074] FIG5 is a schematic diagram of a software structure of an electronic device provided in an embodiment of the present application;
[0075] FIG6 is a schematic diagram of an event reporting path provided in an embodiment of the present application;
[0076] FIG7 is a schematic diagram of the software structure of another electronic device provided in an embodiment of the present application;
[0077] FIG8 is a schematic flow chart of a refresh rate switching method provided in an embodiment of the present application;
[0078] FIG9 is a first schematic diagram of module interaction provided in an embodiment of the present application;
[0079] FIG10 is a second schematic diagram of module interaction provided in an embodiment of the present application;
[0080] FIG11 is a schematic flow chart of another refresh rate switching method provided in an embodiment of the present application;
[0081] FIG12 is a waveform diagram of a switching display timing provided by an embodiment of the present application;
[0082] FIG13 is a waveform diagram of another switching display timing provided by an embodiment of the present application;
[0083] FIG14 is a third schematic diagram of module interaction provided in an embodiment of the present application;
[0084] FIG15 is a fourth schematic diagram of module interaction provided in an embodiment of the present application;
[0085] FIG16 is a fifth schematic diagram of module interaction provided in an embodiment of the present application;
[0086] FIG17 is a schematic flow chart of another refresh rate switching method provided in an embodiment of the present application;
[0087] FIG18 is a schematic diagram of a usage scenario of a stylus provided in an embodiment of the present application. DETAILED DESCRIPTION
[0088] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the 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 this embodiment, unless otherwise specified, "multiple" means two or more.
[0089] With the development of touch technology, more and more electronic devices are adopting 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, so that the electronic device can perform corresponding operations based on the input.
[0090] Moreover, with the advancement of display technology, electronic devices have evolved 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, in order to optimize device power consumption while improving user experience.
[0091] 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 higher refresh rates (such as 144Hz). Therefore, at a 144Hz refresh rate, the electronic device only supports the processing and response of finger input events, and 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 taps the screen. Therefore, when adjusting the refresh rate of an electronic device, it is necessary to consider the usage scenario of the stylus.
[0092] However, current electronic devices typically simply switch from a low refresh rate to a high refresh rate, or vice versa, without considering the refresh rate limitations imposed by different touch modes. This results in electronic devices processing and responding to 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, blindly switching to a high refresh rate, such as 144Hz, can cause the screen to not support stylus input, giving users an experience where the stylus is unable to touch or write.
[0093] 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.
[0094] Due to the significant difference in display timing between the refresh rates matched to the stylus and the finger, the idle time at the end of the frame is too short when the electronic device switches the refresh rate to the one matched to the stylus. Consequently, when the electronic device subsequently needs to switch the refresh rate to the one matched to the finger, the idle time at the end of the frame is insufficient, resulting in display anomalies such as a distorted or black screen for one frame.
[0095] To address the aforementioned issues, embodiments of the present application provide a refresh rate switching method. This method allows an electronic device to switch its refresh rate to a rate that matches the stylus when the user needs to use it, and also to switch its refresh rate to a rate that matches the finger when the user does not need to use the stylus. This method also ensures that the screen refreshes normally during the switching process, avoiding display anomalies such as a distorted or black screen.
[0096] 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.
[0097] The hand touch mode indicates 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. In other words, the screen of the electronic device can process and respond to finger input operations.
[0098] Pen touch mode indicates that the screen of an electronic device supports input from both a stylus and a finger, allowing the electronic device to perform corresponding operations based on the finger or stylus input. In other words, the screen of the electronic device is capable of processing and responding to both finger and stylus input.
[0099] In the embodiments of the present application, the refresh rate levels supported by the hand touch mode and the pen touch mode are different. The refresh rate levels supported by the two touch modes may overlap or differ. 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 and a 144Hz refresh rate.
[0100] In some scenarios, for some electronic devices that do not support high refresh rates, the refresh rate levels supported by the hand touch mode and the pen touch mode can 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.
[0101] 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 with the stylus.
[0102] The screen of an 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 with the display panel to detect touch operations applied thereto or near the display panel. In some embodiments, the TP may also be disposed on the surface of the electronic device, at a different location from the display panel.
[0103] Optionally, the switching of the refresh rate of the electronic device may include switching of the screen display configuration to ensure that when the refresh rate of the electronic device is switched to a refresh rate that matches the stylus, the display panel of the screen can display normally and avoid display anomalies.
[0104] 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.
[0105] Optionally, switching the refresh rate of the electronic device may also include switching the touch configuration of the screen. This ensures that when the refresh rate of the electronic device is switched to a refresh rate that matches the stylus, the operating state of the touch panel on the screen also matches the stylus, avoiding touch anomalies. This allows the user's stylus or finger to input normally.
[0106] As mentioned above, the switching of the screen touch configuration by the electronic device may refer to switching 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.
[0107] It is understandable 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.
[0108] 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 supported, anti-interference capabilities, and power consumption in different touch modes. For example, the 144Hz refresh rate gear only supports hand touch mode and does not support pen touch mode. Even at the same refresh rate, the screen display configuration and screen touch configuration of hand touch mode and pen touch mode are different.
[0109] 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 adopted by the hand touch mode lower power consumption and stronger anti-interference ability of the whole machine compared to the screen display configuration and screen touch configuration adopted by the pen touch mode.
[0110] Therefore, when the electronic device switches the refresh rate to the 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 screen touch configuration.
[0111] Alternatively, if the refresh rate originally set for the electronic device is a refresh rate level supported by the hand touch mode, when it is switched to a refresh rate level supported by the pen touch mode, the touch mode has changed, so the electronic device needs to switch both the screen display configuration and the screen touch configuration to ensure that the screen's display timing matches the refresh rate level supported by the pen touch mode, and that the operating mode of the screen's touch firmware matches the pen touch mode. This ensures that when the refresh rate of the electronic device is switched, not only can the screen display normally, but the user's stylus and finger can also input normally.
[0112] Optionally, if the refresh rate originally set to the electronic device is a refresh rate level supported by the pen touch mode, when it needs to be switched to another refresh rate level supported by the pen touch mode, for example, the 60Hz refresh rate of the pen touch mode is switched 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.
[0113] 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.
[0114] Optionally, if the refresh rate originally set for the electronic device is a refresh rate level supported by the pen touch mode, when it needs to be switched to a refresh rate level 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 level supported by the hand touch mode, and that the working mode of the screen's touch firmware matches the hand touch mode.
[0115] Optionally, if the refresh rate originally set to the electronic device is a refresh rate level supported by the hand touch mode, when it needs to be switched 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.
[0116] Please refer to Figure 1, which 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.
[0117] In vertical timing, vertical synchronization (Vsync) can indicate the arrival of a new image frame. 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 specific frame. This image data will be transmitted line by line by the electronic device's processor to the display panel for display.
[0118] In horizontal timing, horizontal synchronization (Hsync) can indicate the arrival of a row of image data, which includes multiple pixels. Before each Hsync, there may be a horizontal front porch (HFP), and after each Hsync, there may be a horizontal back porch (HBP). Between adjacent HBPs and HFPs is the image data for that row.
[0119] As shown in Figure 1, 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. During VFP, no image data is transmitted, and this period can be understood as idle time at the end of the frame. When starting to transmit a new frame of image, since it has already passed through VFP, 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 begins to be transmitted, wherein each line of image data can be transmitted through a horizontal timing sequence. As shown in Figure 1, during Vsync, VFP, and VBP, no image data is transmitted, while image data is transmitted between adjacent VFP and VBP. Therefore, the time between adjacent VFP and VBP is the time required to transmit a frame of image data, which can be called the effective display time.
[0120] When the image data for a frame begins to be transmitted, it can be transmitted line by line to the display panel for display. Similarly, when a line of image data begins to be transmitted, it first passes through HFP, and then Hsync indicates the start of transmission of that line of image data. Hsync can be a pulse signal. When Hsync ends and passes through HBP, transmission of that line of image data begins. As shown in Figure 1, there is no image data transmission between Hsync, HFP, and HBP, while image data is transmitted between adjacent HBPs and HFPs. This period of time can be the time required to transmit a line of image data and can be called the per-line display time.
[0121] Therefore, it can be seen that in the process of displaying a frame of image, in addition to the time actually used to transmit image data, the time also includes the time occupied by Vsync, VFP, VBP, Hsync, HFP, and HBP.
[0122] At present, electronic devices usually use inter-frame touch drive (long vertical, Long-V) 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) is completed, touch drive is performed again to perform touch detection.
[0123] It can be understood that, while the effective display time remains unchanged, increasing the idle time at the end of the frame can extend the display time of a single image frame, thereby reducing the number of image frame refreshes per second and thus achieving the goal of reducing the screen refresh rate. Conversely, decreasing the idle time at the end of the frame can shorten the display time of a single image frame, thereby increasing the number of image frame refreshes per second and thus achieving the goal of increasing the screen refresh rate.
[0124] However, in pen touch mode, electronic devices can only support a maximum refresh rate of 60Hz and require stylus scanning. This results in significant changes in the effective display time in pen touch mode, shortening the idle time at the end of the frame in the display timing. When electronic devices switch refresh rates in this situation, insufficient idle time at the end of the frame in the display timing can lead to display errors during the switch, resulting in a distorted or black screen.
[0125] For example, as shown in Table 1, the present application provides a display timing corresponding to different refresh rate levels in different touch modes:
[0126] Table 1
[0127] As can be seen from Table 1, when the electronic device switches between the display timings corresponding to the 60Hz to 144Hz refresh rates in the hand touch mode, since there is no need to support scanning of the stylus input, the effective display time remains unchanged, the display time per line remains unchanged, and the timing parameters such as HBP, HFP, Hsync, Vsync, and VBP remain unchanged (or change slightly). 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 120Hz refresh rate in the hand touch mode to a 60Hz refresh rate in the hand touch mode, the electronic device can increase VFP from 26 to 2340 to complete the switching of the display timing.
[0128] However, as can be seen in Table 1, when an 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 significantly due to the need to support stylus input scanning. For example, the HBP in the display timing increases from 20 to 318, resulting in a longer display time per line. Because electronic devices need to refresh and display a frame every 16.6 milliseconds (ms), as the effective display time increases, the corresponding idle time at the end of the frame decreases.
[0129] For example, Figure 2 (a) shows a schematic diagram of the display timing of an electronic device refreshing and displaying a frame of image in hand touch mode, and Figure 2 (b) shows a schematic diagram of the display timing of an electronic device refreshing and displaying a frame of image in pen touch mode. Comparing Figures 2 (a) and (b) shows that although the refresh rate of the two touch modes is the same at 60Hz (i.e., the time to display a frame of image is 16.6ms), the effective display time required in the pen touch mode is longer than that in the hand touch mode, resulting in an excessively short idle time at the end of the frame.
[0130] 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 sufficient idle time at the end of the frame. Especially for some devices that do not have an internal image frame buffer, 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.
[0131] However, the refresh rate in 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 pen touch mode to the refresh rate in 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 image when switching the timing.
[0132] Therefore, an embodiment of the present application provides a refresh rate switching method. When an electronic device detects that the refresh rate of the Nth frame image needs to be switched under different touch modes, it can forcibly change the layer synthesis method of the Nth frame image from synthesis by the display processor (MDP) to synthesis by the graphics processor (GPU), thereby reducing the MDP load. The MDP only needs to complete the display timing switching during the idle time at the end of the frame. Therefore, even if the idle time at the end of the frame is insufficient, the real-time switching of the display timing and image display can still be completed normally, avoiding display anomalies.
[0133] FIG3 is a 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 responsive to the input provided by the stylus 100. Alternatively, a user can provide input to the electronic device 200 using a finger, and the electronic device 200 performs an operation responsive to the input provided by the user's finger.
[0134] In the embodiment of the present application, the electronic device 200 can 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 car 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), and other electronic devices. The embodiment of the present application does not impose any special restrictions on the specific device form of the electronic device 200. FIG3 is an example of the electronic device 200 being a tablet computer for illustration.
[0135] 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.
[0136] 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.
[0137] A TP, also known as a touch sensor, can be integrated into a display panel to detect touch operations applied to or near the display panel. For example, it can detect touch operations by a finger or by a stylus 100. In some embodiments, the TP can also be located on the surface of the electronic device, away from the display panel.
[0138] The stylus 100 (also referred to as a stylus) may be, but is not limited to, an inductive stylus or a capacitive stylus. Capacitive pens may include passive capacitive pens and active capacitive pens. Passive capacitive pens may be referred to as passive capacitive pens, while active capacitive pens may be referred to as active capacitive pens.
[0139] Optionally, when the stylus 100 is an inductive stylus, 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 stylus. Based on the principle of electromagnetic induction, within the magnetic field generated by the electromagnetic induction board, as the inductive stylus moves, the inductive stylus can accumulate electrical energy. The inductive stylus can transfer the accumulated electrical energy to the electromagnetic induction board through the coil in the inductive stylus through free oscillation. The electromagnetic induction board can scan the coil on the electromagnetic induction board based on the electrical energy from the inductive stylus and calculate the position of the inductive stylus on the screen 201.
[0140] 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 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.
[0141] In one embodiment, the stylus 100 and the electronic device 200 can be interconnected through a communication network to achieve wireless signal interaction. 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.
[0142] Taking the wireless connection as a Bluetooth connection as an example, the stylus pen 100 and the electronic device 200 may both include a Bluetooth module integrated with a Bluetooth function for communicating via Bluetooth transmission.
[0143] 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.
[0144] 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.
[0145] Optionally, when the user does not need to use the stylus 100, or the stylus 100 is not in the pairing state, or the remaining power of the stylus 100 is insufficient, the user can also directly place 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.
[0146] The "strong magnetic attraction" ensures the safe storage of the stylus 100. In some embodiments, the "strong magnetic attraction" can trigger pairing and / or connection between the stylus 100 and the electronic device 200. In other embodiments, the "strong magnetic attraction" can also complete the magnetic charging process of the stylus 100, which is not limited in this embodiment of the application.
[0147] In some scenarios, in order to facilitate the storage of the stylus pen 100 , the electronic device 200 may also be provided with a storage compartment for storing the stylus pen 100 .
[0148] 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.
[0149] Optionally, the stylus 100 may include a wireless charging coil to receive wireless charging input. Alternatively, the electronic device 200 may also include a wireless charging coil to wirelessly charge the stylus. The wireless charging coil of the stylus 100 may couple with the wireless charging coil of the electronic device 200, inducing the alternating electromagnetic field emitted by the wireless charging coil 350 of the electronic device 200 to wirelessly charge the rechargeable battery.
[0150] As an example, please refer to FIG. 4 , which is a schematic structural diagram of an electronic device 400 provided in an embodiment of the present application. The electronic device 400 may be the electronic device 200 described above.
[0151] As shown in FIG4 , 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. Sensor module 480 may include a touch sensor 481.
[0152] It should 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, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0153] 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). The different processing units may be independent devices or integrated into one or more processors.
[0154] 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.
[0155] Processor 410 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 410 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 410. If processor 410 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 410 latency, and thus improves system efficiency.
[0156] In some embodiments, the processor 410 may include one or more interfaces. The interfaces 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 interface (MIPI) interface, a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0157] 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 via 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 via 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 sending the image data of a frame of 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.
[0158] It is understood that the interface connection relationship between the modules illustrated in this embodiment is merely an illustrative 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 from the above embodiments, or a combination of multiple interface connection methods.
[0159] The charging management module 440 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 440 can receive charging input from the wired charger via the USB interface 430. In some wireless charging embodiments, the charging management module 440 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 442, the charging management module 440 can also provide power to the electronic device via the power management module 441.
[0160] In some embodiments, electronic device 400 can support charging a stylus. Charging management module 440 can receive input from battery 442 and convert the DC signal from battery 442 into an AC signal. This AC signal is transmitted to the wireless charging coil via a matching circuit. The wireless charging coil generates an alternating electromagnetic field upon receiving the AC signal. The stylus's wireless charging coil senses this alternating electromagnetic field, enabling wireless charging.
[0161] 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 provides power to the processor 410, the internal memory 421, the external memory, the display 494, the camera 493, and the wireless communication module 460. In some embodiments, the power management module 441 may also be provided in the processor 410. In other embodiments, the power management module 441 and the charging management module 440 may also be provided in the same device.
[0162] 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.
[0163] 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 technology (IR), etc. 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, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 410. The wireless communication module 460 can also receive the signal to be sent from the processor 410, frequency modulate it, 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) via Bluetooth communication technology.
[0164] In an 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.
[0165] The GPU is a microprocessor for image processing that connects 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 overlay of multiple layers.
[0166] Layer compositing and overlaying can be achieved through GPU compositing and hardware composer (HWC) compositing. When using HWC compositing, the HWC implements layer compositing and overlaying through the MDP hardware device. The MDP is a dedicated display processor that is primarily responsible for hardware compositing and overlaying multiple layers, as well as display timing (i.e., MIPI timing) control.
[0167] Display screen 494 is used to display images, videos, etc. Display screen 494 may be screen 201 described above. Display screen 494 includes a display panel. The display panel may be an LCD, OLED, AMOLED, etc. The display panel is coupled to processor 410 (e.g., an AP, a system-on-chip (SOC)) via a MIPI interface. The display panel can thus receive image data sent from processor 410 via the MIPI interface.
[0168] In the embodiments of the present application, a display panel is an LCD. The display panel may include a display driver integrated circuit (DDIC). The DDIC is configured to receive image data transmitted via a display timing sequence and control 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 data.
[0169] In the embodiment of the present application, the display screen 494 may be a touch screen. That is, the display screen 494 may include a touch sensor 481. 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."
[0170] 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 kernel layer driver (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, at a different location from the display screen 494.
[0171] Optionally, display screen 494 can be used to display information input by the stylus. For example, display screen 494 can be used to display the movement trajectory of the stylus. Optionally, display screen 494 can also display an interface related to the stylus input based on the stylus input.
[0172] 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 via the external memory interface 420 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0173] 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.
[0174] The methods in the following embodiments can all be implemented in the electronic device 400 having the above hardware structure.
[0175] The software system of the electronic device 400 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 400.
[0176] Figure 5 is a software structure diagram of an electronic device 400 provided in an embodiment of the present application. A layered architecture can divide the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into three layers, from top to bottom: the application layer (referred to as the application layer), the application framework layer (referred to as the framework layer), and the kernel layer (also known as the driver layer).
[0177] The application layer can include a series of application packages. As shown in Figure 5, the application layer can include multiple application packages such as Application 1 and Application 2. For example, it can include applications such as camera, drawing, calendar, game, map, navigation, Bluetooth, music, video, short message, and desktop launcher.
[0178] The framework layer provides an application programming interface (API) and programming framework for 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 telephony manager, a resource manager, a notification manager, etc. (not shown in the figure).
[0179] In some embodiments, as shown in FIG5 , the framework layer may further include a scene recognition module, a frame rate control module, an instruction issuing module, and the like.
[0180] 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.
[0181] In an embodiment of the present application, as shown in FIG5 , the scene recognition module includes a stylus service module for determining whether the stylus is currently in use based on perceived external events, that is, determining whether the electronic device is currently in a touch scene using the stylus.
[0182] Optionally, the framework layer may include a wireless communication service module for providing the ability to establish wireless communication connections with other devices. The scene recognition module can use the wireless communication service module to detect whether the electronic device has established a wireless communication connection with other input devices. This allows for a preliminary determination of whether the electronic device can receive input from other input devices, facilitating identification of the electronic device's current touch interaction scenario.
[0183] As an example, as shown in FIG5 , the scene recognition module may include a Bluetooth service module for detecting a stylus connection event, that is, whether a Bluetooth connection is established between the electronic device and the stylus. If it is detected that no Bluetooth connection is established between the electronic device and the stylus, the stylus may be considered unused. Both the stylus and the electronic device may include Bluetooth modules to establish a Bluetooth connection.
[0184] 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.
[0185] In the embodiment of the present application, the scene recognition module can also detect stylus status events from the kernel layer driver (such as the wireless charging driver) through the API. The status events can include charging events, full-charge stop events, adsorption events, and distance (non-adsorption) events. The stylus service module can then determine whether the stylus is currently in use based on these stylus status events and the aforementioned connection events, that is, whether the electronic device is currently in a touch scenario where the stylus is used.
[0186] 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 scenario of the electronic device. The frame rate control module is used to control the switching of the screen refresh rate.
[0187] As shown in Figure 5, 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.
[0188] Touch scenarios can be divided into hand touch mode and pen touch mode based on whether the stylus is in use. The screen refresh rate levels supported in hand touch mode and pen touch mode can be different. Therefore, the frame rate control module needs to control the screen refresh rate level switching based on the current touch scenario.
[0189] When a change in the current touch scenario is detected, such as switching from hand touch mode to pen touch mode, the display control module must match not only the corresponding refresh rate but also the corresponding touch mode, controlling the display panel to switch to the refresh rate supported by the corresponding touch mode. This can be achieved by controlling the display timing of the display panel. Different refresh rates in different touch modes correspond to different display timings.
[0190] 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 then sends the refresh rate switching instruction to the kernel layer driver (such as the display driver) to complete the refresh rate switching.
[0191] In an embodiment of the present application, the framework layer may include a layer synthesis service (SurfaceFlinger) and a hardware synthesizer HWC.
[0192] SurfaceFlinger is a special process responsible for fusing all layers (Surfaces) within a single image frame. SurfaceFlinger calculates the position of each Surface within a single image frame based on parameters such as transparency, size, and position. This process then passes the final image frame to the hardware compositor or GPU, which is then displayed on the display. In other words, the display of a single image frame is a collaborative effort between SurfaceFlinger, HWComposer, and the display.
[0193] HWC is a module in the Android system that performs layer compositing, overlaying, and display, providing hardware support for SurfaceFlinger. In other words, HWC has the function or ability to use hardware to complete layer compositing, overlaying, and display.
[0194] 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 based on 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.
[0195] 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.
[0196] 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 then 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.
[0197] In an embodiment of the present application, the electronic device switches the screen refresh rate, not only by switching the refresh rate of the display panel of the display screen, but also by switching the operating mode of the touch panel of the display screen. The operating modes of the touch firmware may include firmware mode 1, which supports both stylus input scanning and finger input scanning, and firmware mode 2, which supports only finger input scanning.
[0198] As shown in FIG5 , the frame rate control module may further include a touch control module for matching the operating mode of the touch firmware of the touch panel corresponding to the current touch scene according to the detected usage status of the stylus.
[0199] After determining the operating 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 operating mode switching of the touch firmware.
[0200] Optionally, the display driver and touch driver at 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 touch firmware operating mode switching.
[0201] 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 operating mode switching of the touch firmware at the framework layer.
[0202] The kernel layer is the layer between hardware and software. It drives the hardware, enabling it to operate. The hardware of an electronic device can include touch panels, display panels, wireless charging coils, and more. Ultimately, the Android operating system's functions are performed through the kernel layer.
[0203] In the embodiment of the present application, the core layer includes at least 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 core layer of the electronic device may also include a Bluetooth driver.
[0204] The display driver can drive the display panel to work. The display panel may include a display driver chip (such as a DDIC), and the display driver is used to drive the DDIC to complete the processing and implementation of image display on the display panel.
[0205] 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.
[0206] As shown in Figure 5, the display driver may include a GPU synthesis module, an MDP synthesis module, an MDP display switching module, and an MDP display driver. The display driver can control whether the layer overlay synthesis 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 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.
[0207] Taking the user launching application A as an example, after the user launches 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 image synthesis, 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 this way, the display panel can complete the refresh display process of one frame of image.
[0208] In this embodiment of the present application, if the screen refresh rate needs to be switched between different touch modes when refreshing the Nth frame, the HWC can forcibly change the layer synthesis mode of the Nth frame image to GPU synthesis and issue a command to the kernel driver (such as the display driver) to control the GPU synthesis module to implement the layer synthesis of the Nth frame image. This reduces the MDP load, and the MDP is only responsible for the display timing switching of the display panel.
[0209] 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.
[0210] In embodiments of the present application, the touch driver can also be used to drive the touch firmware to switch operating modes. The operating modes may include the aforementioned firmware mode 1 and firmware mode 2. In some embodiments, when a screen refresh rate switch between different touch modes is detected, the touch control module can issue a command to a kernel-level driver (e.g., the touch driver) to drive the touch firmware to switch operating modes.
[0211] The wireless charging driver (also known as the wireless charging management module) is used to drive the wireless charging coil to complete wireless charging of other devices (such as a stylus). In this embodiment of the present application, the wireless charging driver can be used to report stylus status events, such as full charge stop event, adsorption event, and distance (unadsorption) event.
[0212] For example, an electronic device wirelessly charges a stylus. The electronic device can use a wireless charging chip to control the electronic device's battery to output current to the device's wireless charging coil. This causes the electronic device's wireless charging coil to emit a high-frequency magnetic field. When the stylus's wireless charging coil is paired with the electronic device's wireless charging coil, this high-frequency magnetic field can induce a current in the stylus's wireless charging coil. The stylus's wireless charging chip can then detect this induced current and input it into the stylus's battery.
[0213] As shown in Figure 6, when the wireless charging chip of an electronic device detects a stylus adsorption event (adsorption on an electronic device from a distant state), a full-charge stop-charging event (adsorption on an electronic device to fully charge), or a distant event (distance from an adsorption stop-charging state), etc. through the wireless charging coil, an interrupt signal (Interrupt) can be generated to trigger the kernel layer chip driver to handle the interrupt process. The chip driver notifies the wireless charging driver of the relevant event, which is further reported to the stylus service by the wireless charging driver, ultimately used to realize the stylus usage status recognition. In some scenarios, the wireless charging driver can also report relevant status events to the Bluetooth service, and the Bluetooth service reports the stylus status event and connection event to the stylus service.
[0214] Typically, the wireless charging chip remains in a low-power Q-scanning mode when powered on or when charging is stopped. During this mode, the wireless charging chip periodically collects 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 placed on an electronic device from a distance, the wireless charging chip detects changes in the Q value of the wireless charging coil. At this point, the wireless charging chip can generate an interrupt signal to notify the wireless charging driver through the chip-driven interrupt process. The wireless charging driver then reports the adsorption event to the stylus service, or to the Bluetooth service, which then reports it to the stylus service.
[0215] After the stylus is attached to an electronic device and fully charged, it enters the attached and non-charging state. At this time, when the stylus is moved away from the attached and non-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 the attachment and non-charging state to the stylus service, or reports it to the Bluetooth service, which further reports it to the stylus service.
[0216] It is understood that both the stylus adsorption event and the stylus removal event during adsorption and charging can be identified and reported promptly through Q scanning. However, the stylus removal event during adsorption and charging is currently only reported after the error timeout packet (cep_timeout) is identified.
[0217] Currently, in order to ensure the smooth progress of the wireless charging process, a data packet needs to be transmitted between the stylus and the electronic device 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 an error timeout packet (cep_timeout), at which point the electronic device can assume that the stylus has moved away. However, the detection of cep_timeout itself has a delay (such as 1.5s). Therefore, the distance event of the stylus during adsorption charging cannot be reported in time through cep_timeout identification. 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 touch firmware mode in time, resulting in touch anomalies, affecting the user's experience of using the stylus.
[0218] In order to solve the above problem, in an embodiment of the present application, a full-charge stop state is added to identify the usage status of the stylus.
[0219] Specifically, after the stylus is fully charged by being attached to an electronic device, it enters the attached and stopped charging 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 then reports the full charge event to the stylus service, or reports it to the Bluetooth service, which then reports it to the stylus service. The stylus service can then identify the stylus's usage status based on the connection event, attachment event, and charging status to determine whether the current touch scenario of the electronic device has changed, thereby achieving intelligent switching of the corresponding refresh rate and touch firmware mode under different touch scenarios.
[0220] It can be understood that the embodiments of the present application do not limit the structures 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.
[0221] For example, as shown in Figure 7, the framework layer can also include a whitelist service for configuring corresponding touch modes for certain applications. For example, for applications that require gaming scenarios and do not require a stylus, the touch mode can be forced to be set to hand touch mode. For applications that require a stylus, such as drawing and note-taking, the touch mode can be forced to be set to pen touch mode.
[0222] 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.
[0223] As shown in FIG7 , the whitelist service can be configured in the 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 scenario of the electronic device based on the whitelist service and the stylus service.
[0224] As a method, the frame rate control module can prioritize the touch scenarios configured in the whitelist service to determine the screen refresh rate suitable for the electronic device's current touch scenario. If no corresponding touch scenario is configured in the whitelist service, the frame rate control module can determine the screen refresh rate suitable for the electronic device's current touch scenario based on the stylus status information sent by the stylus service.
[0225] It is understood that the software structure illustrated in the embodiments 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, or each layer may contain more functional modules, 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.
[0226] The methods in the following embodiments can all be implemented in the electronic device 400 having the above software structure.
[0227] The following will take electronic equipment as an example to specifically illustrate the technical solutions provided in the embodiments of the present application.
[0228] As shown in FIG8 , a refresh rate switching method provided in an embodiment of the present application may include:
[0229] S800: When the electronic device starts to refresh and display the Nth frame image, a first refresh rate switching instruction is detected.
[0230] The electronic device supports a hand touch mode and a pen touch mode. In the pen touch mode, the electronic device supports a first refresh rate, and in the hand touch mode, the electronic device supports a second refresh rate. The first refresh rate and the second refresh rate can be the same or different.
[0231] 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.
[0232] When the electronic device detects the first refresh rate switching instruction, it can be determined that the refresh rate switching between different touch modes is required. 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 the refresh rate switching.
[0233] In some embodiments, the refresh display of each frame of image can be triggered by a Vsync signal. The electronic device can 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 embodiments of the present application can be executed.
[0234] Optionally, the electronic device may identify the current touch scene and match the refresh rate in the corresponding touch mode according to the identified touch scene. If the refresh rate in the matched 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 triggered refresh rate switch is from a refresh rate supported by the pen touch mode to a refresh rate supported by the hand touch mode, it can be confirmed that the first refresh rate switch instruction has been detected.
[0235] Optionally, each touch mode corresponds to one or more matching screen refresh rates. The screen refresh rate levels corresponding to each touch mode can be the same or different, with some overlap or no overlap.
[0236] 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 scenario based on the recognized touch scenario and the preset correspondence table. The correspondence table can be pre-stored in the electronic device.
[0237] 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 one matching screen refresh rate.
[0238] Table 2
[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 indicate switching from the 60Hz gear in the pen touch mode (identified by serial number 2-1) to the 144Hz gear in the hand touch mode (identified by serial number 1-4).
[0241] In other embodiments, the above-mentioned first refresh rate switching instruction can also be used to indicate switching from the second refresh rate in hand touch mode to the first refresh rate in pen touch mode. For example, the above-mentioned first refresh rate switching instruction can be used to indicate switching from the 60Hz gear in hand touch mode (identified by sequence number 1-2) to the 60Hz gear in pen touch mode (identified by sequence number 2-1). For another example, the above-mentioned first refresh rate switching instruction can also be used to indicate switching from the 144Hz gear in hand touch mode (identified by sequence number 1-4) to the 60Hz gear in pen touch mode (identified by sequence number 2-1).
[0242] Optionally, the electronic device may identify the current touch scene and match the refresh rate in the corresponding touch mode based on the identified touch scene. If the refresh rate in the matched 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 triggered refresh rate switch is from a refresh rate supported by the hand touch mode to a 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 based on 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 can also identify the current touch scene by combining whether the stylus is in use and the touch scenes configured in the application whitelist. The embodiment of the present application does not limit the manner in which the electronic device identifies the current touch scene.
[0246] In some embodiments, when the electronic device triggers the refresh rate switch, it may also trigger the operating mode switch of the touch firmware.
[0247] Optionally, the electronic device may identify the current touch scene and match the operating mode of the touch firmware in the corresponding touch mode according to the identified touch scene. If the operating mode of the touch firmware in the corresponding touch mode is different from the operating mode currently used by the touch firmware of the electronic device, the electronic device may trigger a switch in the operating mode of the touch firmware.
[0248] Optionally, each touch mode corresponds to one or more matching touch firmware operating modes. Each touch mode and the matching touch firmware operating modes can be pre-associated using a correspondence table, so that the electronic device can match the touch firmware operating mode suitable for the current touch scenario based on the identified touch scenario and a 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 (identified by serial number 1) corresponds to 1 to 4 matching screen refresh rates and a touch firmware working mode, and the pen touch mode (identified by serial number 2) corresponds to 1 to 3 matching screen refresh rates and a touch firmware working mode.
[0250] Table 3
[0251] When the electronic device recognizes a change in the touch scene, for example, a change from hand touch mode to pen touch mode, the electronic device can match the corresponding touch firmware operating 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 operating mode to switch to firmware mode 2. For another example, when the electronic device recognizes a change in the touch scene, i.e., the hand touch mode, the electronic device can match the corresponding touch firmware operating 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 operating mode to switch to firmware mode 1.
[0252] 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.
[0253] In an 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 method of the Nth frame image to GPU synthesis. The electronic device can thus obtain the image to be displayed after the GPU layer synthesis and superposition to be transmitted to the display screen.
[0254] 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 the layer synthesis mode of all layer annotations 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.
[0255] In some embodiments, when the first refresh rate switching instruction detected in the Nth frame image indicates switching from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode, since the idle time at the end of the frame in 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.
[0256] 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, since the idle time at the end of the frame in the hand touch mode is usually sufficient, as shown in (a) in Figure 2, for this refresh rate switching scenario, it is also possible not to force the layer synthesis mode of the current image to be changed 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 force the layer synthesis mode of the current image to be changed 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, no distinction can be made, or distinction can be made. The embodiments of the present application are not limited to this.
[0257] 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.
[0258] In an embodiment of the present application, when the first refresh rate switching instruction detected in the Nth frame of 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 refresh rate of the Nth frame of image needs to be switched to a different mode. The electronic device can then control the switching of the display timing through the MDP 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.
[0259] In the embodiment of the present application, the display timings corresponding to different refresh rates in different touch modes can be pre-associated through a correspondence table, as shown in Table 2. Therefore, when the electronic device needs to switch the refresh rate, it can determine the matching display timing according to the preset correspondence table, and thus complete the refresh rate switching based on the matching display timing.
[0260] For example, switching from a 60Hz setting in pen touch mode to a 60Hz setting in hand touch mode can be illustrated by referring to Table 2. The display timing corresponding to the 60Hz setting in pen touch mode can be determined. Compared to the display timing corresponding to the 60Hz setting in hand touch mode, the HBP, HFP, and VFP values 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 current display timing corresponding to the 60Hz setting in pen touch mode. This reduces the effective display time and increases the frame end space, but the time required to refresh a single frame remains unchanged at 16.6ms. For example, refer to the display timing diagram corresponding to the 60Hz setting in pen touch mode shown in (b) of FIG. 2 and the display timing diagram corresponding to the 60Hz setting in hand touch mode shown in (a) of FIG. This ensures that the current display timing still meets the 60Hz screen refresh rate. This enables the switching of display timing, and the electronic device then transmits image data to the display screen according to the switched display timing, thereby refreshing the displayed image at the switched 60Hz screen refresh rate that matches finger touch.
[0261] It can be understood that, as shown in (b) of Figure 2, 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.
[0262] In some embodiments, when the first refresh rate switching instruction detected in the Nth frame of 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 of image requires switching between different refresh rates. The electronic device can thereby control the switching of the display timing through the MDP 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.
[0263] For example, switching from a 60Hz setting in hand touch mode to a 60Hz setting in pen touch mode can be illustrated by referring to Table 2. The display timing corresponding to the 60Hz setting in hand touch mode is determined to be different from the display timing corresponding to the 60Hz setting in pen touch mode. Therefore, the electronic device can increase the HBP to 318, the HFP to 20, and the VFP to 26 in the display timing corresponding to the current 60Hz setting in hand touch mode. This increases the effective display time and shortens the frame end space, but the time required to refresh a single frame remains unchanged at 16.6ms. This ensures that the current display timing meets both the 60Hz screen refresh rate and supports scanning of stylus input. This achieves the switching of the display timing, and the electronic device then transmits image data to the display screen according to the switched display timing, refreshing the displayed image at the switched 60Hz screen refresh rate that matches the stylus.
[0264] It can be understood that, as shown in (a) in Figure 2, 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 where the timing difference is larger, the MDP can simultaneously complete the layer synthesis processing of the image frame and the display timing switching corresponding to the refresh rate, or it can 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.
[0265] S830: The electronic device displays the image to be displayed at the second refresh rate.
[0266] In an embodiment of the present application, when the first refresh rate switching instruction indicates a switch from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode, the electronic device, after controlling the display timing switch via the MDP, can transmit the data of the image to be displayed, formed after GPU synthesis of the Nth frame image, to the display screen for display via the switched display timing. Because the MDP only needs to implement refresh rate switching, and the layer synthesis processing is performed by the GPU, the electronic device can normally complete the display timing switch and normally transmit and display the Nth frame image even if the frame tail space time after the display timing switch is too short.
[0267] For example, as shown in Figure 9, when refreshing and displaying the Nth frame image in the kernel phase, if the display driver of the electronic device receives a 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 is switched, 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.
[0268] The display panel may include a display driver chip DDIC for receiving data of an image to be displayed sent via a display timing sequence, 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.
[0269] It can be understood that since the display timing switching process, i.e., the screen refresh rate switching process, has already been completed for the Nth frame image, when the electronic device begins to refresh and display the N+1th frame image, no further display timing switching is required, and the original layer composition method can be restored for the N+1th frame image. For example, all layers of the N+1th frame image are MDP composited.
[0270] For example, as shown in FIG10 , when refreshing and displaying the N+1th frame image in the kernel phase, the display driver of the electronic device does not receive the first refresh rate switching instruction. Therefore, it is not necessary to drive the MDP display switching module to complete the corresponding display timing switch, 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 according to the switched display timing for display.
[0271] It is 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 electronic device's display driver still uses the original layer synthesis method, that is, it 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 MDP synthesized image to be displayed to the display panel (such as LCD) via the MIPI interface according to the display timing before the switch.
[0272] 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, 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 GPU synthesis of the Nth frame image 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 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 MDP synthesis of the Nth frame image to the display screen for display through the switched display timing.
[0273] 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 responding 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, completing the switch from the first refresh rate to the second refresh rate during the refresh display process of the N+1th frame image.
[0274] It is understood that the above embodiment mainly uses the refresh rate switching from pen touch mode to hand touch mode as an example to introduce the refresh rate switching method between different touch modes. The same principle can be used to implement the refresh rate switching from hand touch mode to pen touch mode.
[0275] For example, when the electronic device begins 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. 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. As a result, the electronic device can display the image to be displayed at the first refresh rate.
[0276] The present invention provides a refresh rate switching method that, when switching between different refresh rate modes, switches the layer synthesis processing of image frames, originally performed by the display processor (MDP), to that performed by the graphics processor (GPU). This reduces the MDP load, as only the MDP display timing needs to be switched during the frame idle period, eliminating the need for simultaneous MDP synthesis. This ensures that image frames are displayed in a timely manner, avoiding the issue of one frame not being displayed properly during the switching process.
[0277] In some embodiments, when the first refresh rate and the second refresh rate are the same, 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, switching 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 (which is 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.
[0278] 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 involves not only the switching of the touch mode, but also 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 switch 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 switch, 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.
[0279] 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 realize 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.
[0280] For example, when the electronic device begins refreshing and displaying the Nth frame of image, it detects a first refresh rate switching instruction for instructing to switch from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode. In response to the first refresh rate switching instruction, the electronic device uses the GPU to perform layer synthesis processing on the Nth frame of image to obtain the first image to be displayed. The screen refresh rate of the display screen is switched from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode through the MDP. The electronic device then displays the first image at the second refresh rate in hand touch mode.
[0281] In an embodiment of the present application, if the hardware of the electronic device cannot support switching of the touch mode and switching of the frame rate gear at the same time, the electronic device may also execute the switching of the touch mode and switching of the frame rate gear separately.
[0282] 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 may first switch the frame rate gear and then switch the touch mode, thereby completing the switching of different refresh rates in different touch modes.
[0283] Referring to FIG. 11 , an embodiment of the present application provides another refresh rate switching method, which may include:
[0284] S1100: When the electronic device starts to refresh and display the Nth frame image, a first refresh rate switching instruction is detected.
[0285] In the embodiment of the present application, the electronic device supports a first refresh rate in pen touch mode and supports a first refresh rate and a second refresh rate in hand touch mode. The first refresh rate is different from the second refresh rate.
[0286] In some embodiments, the first refresh rate switching instruction is used to instruct switching from the second refresh rate in hand touch mode to the first refresh rate in pen touch mode. For example, the first refresh rate switching instruction may be used to instruct switching from the 144 Hz gear in hand touch mode to the 60 Hz gear in pen touch mode. In hand touch mode, the electronic device may support both 60 Hz and 144 Hz.
[0287] When the electronic device detects the first refresh rate switching instruction, it can be determined that it is necessary to switch between different refresh rates of different touch modes. Since switching between different refresh rates of different touch modes requires switching both the touch mode and the refresh rate level, the electronic device can first switch the refresh rate level to adjust the refresh rates of the different touch modes to the same refresh rate level, and then implement touch mode switching under the same refresh rate level.
[0288] 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 sequence numbers 1-4) to the 60Hz gear in the pen touch mode (identified by sequence 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 sequence numbers 1-2), and then implement touch mode switching under the same refresh rate gear, that is, switching from the 60Hz gear in the hand touch mode (identified by sequence numbers 1-2) to the 60Hz gear in the pen touch mode (identified by sequence numbers 2-2). The switching order is 1-4>1-2>2-2.
[0289] 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 no longer possible 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 to adjust to the frame rate range supported by the pen touch mode before implementing the switch of the touch mode.
[0290] In some embodiments, when the electronic device triggers the refresh rate switch, it may also trigger the operating mode switch of the touch firmware.
[0291] Optionally, the electronic device may trigger the operating mode switching of the touch firmware only when the touch mode switching is achieved at the same refresh rate level.
[0292] 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. At this time, the working mode switch of the touch firmware may not be triggered. Instead, when the touch mode is switched under the same refresh rate gear again, the working mode switch of the touch firmware is triggered. 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.
[0293] Optionally, the electronic device can also start triggering the touch firmware's working mode switch when implementing different frame rate switching under the same touch mode, without having to wait until the touch mode switching under the same refresh rate gear is implemented before triggering the touch firmware's working mode switch.
[0294] 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.
[0295] 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.
[0296] In an embodiment of the present application, when the electronic device detects that the Nth frame image needs to switch to a different refresh rate in a different mode (switching from the second refresh rate to the first refresh rate), the electronic device can first adjust the frame rate level to the first refresh rate in the original touch mode during the refresh display of the Nth frame image. This allows the refresh rates of different touch modes to be adjusted to the same refresh rate level before subsequent mode switching is performed.
[0297] 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.
[0298] 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 the HWC, and ask the HWC for processing. Since different refresh rate switches are required for different modes, the HWC can first maintain the original layer synthesis method of the Nth frame image, such as MDP synthesis, according to the first refresh rate switching instruction, so that the 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.
[0299] 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.
[0300] 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.
[0301] In an embodiment of the present application, when the electronic device begins refreshing and displaying the Nth frame image and detects that a different refresh rate switch between different modes is required, the electronic device can first control the switching of the display timing through the MDP, and by changing the VFP parameter of the display timing, 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. This can first complete the switching of different refresh rates in the same touch mode.
[0302] In an embodiment of the present application, when an electronic device needs to switch between different refresh rates in 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 in the same touch mode based on the matching display timing.
[0303] As an example, taking the switching 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 switching from the 120Hz gear in the hand touch mode to the 60Hz gear in the hand touch mode. At this time, referring to Table 2, 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 changed. Therefore, the electronic device can increase the VFP in the display timing corresponding to the current 120Hz from 26 to 2340. In this way, 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 image is lengthened, and the number of times the image frame is refreshed per second is reduced, thereby achieving the purpose of reducing the screen refresh rate.
[0304] 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 120Hz screen refresh rate in the hand touch mode before the switching.
[0305] As shown in (a) in Figure 12, 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 level in the hand touch mode, and the time for refreshing and displaying the N-1th frame image is 8.3ms.
[0306] As shown in (b) of Figure 12, after the refresh display of the N-1th frame image is completed, the electronic device can start refreshing and displaying 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 and increase the length of the VFP (i.e., the idle time at the end of the frame) to first complete the switch from the 120Hz gear in the hand touch mode to the 60Hz gear in the hand touch mode.
[0307] As shown in (b) of Figure 12, since the effective display time remains unchanged, only the space time at the end of the frame is increased, so that 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.
[0308] As another example, taking the switching 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 switching from the 144Hz gear in the hand touch mode to the 60Hz gear in the hand touch mode. At this time, referring to Table 2, 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 changed. Therefore, the electronic device can increase the VFP in the display timing corresponding to the current 144Hz from 15 to 2340. In this way, 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 image is lengthened, and the number of times the image frame is refreshed per second is reduced, thus achieving the purpose of reducing the screen refresh rate.
[0309] 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 144Hz screen refresh rate in the hand touch mode before the switching.
[0310] As shown in (a) in Figure 13, 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 144Hz 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 level in the hand touch mode, and the time for refreshing and displaying the N-1th frame image is 6.9ms.
[0311] As shown in (b) of Figure 13, after the refresh display of the N-1th frame image is completed, the electronic device can start refreshing and displaying 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 and increase the length of the VFP (i.e., the idle time at the end of the frame) to first complete the switch from the 144Hz gear in the hand touch mode to the 60Hz gear in the hand touch mode.
[0312] As shown in (b) of Figure 13, since the effective display time remains unchanged, only the space time at the end of the frame is increased, so that 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.
[0313] S1130: The electronic device displays a first image at a first refresh rate in a hand touch mode.
[0314] After the electronic device switches the display timing using the MDP, it can transmit the data of the first image to be displayed, formed after MDP synthesis of the Nth frame, to the display screen for display, using the display timing corresponding to the first refresh rate in the switched hand touch mode. Since the current display timing switch only involves VFP parameters, the idle time at the end of the frame is sufficient for the MDP to implement refresh rate switching and layer synthesis. This allows the refresh display of the first image formed after MDP synthesis of the Nth frame to be completed normally.
[0315] Exemplarily, as shown in FIG14 , 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.
[0316] 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) and transmits 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.
[0317] 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.
[0318] Taking the N-1th frame image as an example, when refreshing and displaying the N-1th frame image in the kernel phase, the electronic device's display driver also uses the original layer synthesis method, that is, it drives the MDP synthesis module to complete the synthesis and superposition of the layers of the N-1th frame image. Because the electronic device's display driver does not receive a refresh rate switching instruction when refreshing and displaying the N-1th frame image, it does not need to drive the MDP display switching module to complete the corresponding display timing switch. Therefore, when refreshing and displaying the N-1th frame image in the kernel phase, the electronic device only drives the MDP synthesis module to complete the layer synthesis processing of the N-1th frame image. After the MDP synthesis of the N-1th frame image is completed, the electronic device controls the MDP display driver (MDP MIPI driver) to transmit the image formed by the MDP synthesis to the display panel (such as LCD) via 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.
[0319] It can be understood that since the Nth frame image has completed the switch from the second refresh rate in hand touch mode to the first refresh rate in hand touch mode, that is, the switch between 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, subsequently, only the switch of touch modes with the same frame rate level can be completed, that is, the switch from the first refresh rate in hand touch mode to the first refresh rate in pen touch mode. In this way, the switch between different refresh rates in different touch modes is achieved.
[0320] 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.
[0321] In some embodiments, after the electronic device completes switching from the second refresh rate in hand touch mode to the first refresh rate in hand touch mode, it can complete the touch mode switch at the same frame rate level when starting to refresh and display the next frame image, i.e., the N+1th frame image. That is, it switches from the first refresh rate in hand touch mode to the first refresh rate in pen touch mode.
[0322] Since the display timings corresponding to the refresh rates of different touch modes vary significantly, the MDP needs to spend a considerable amount of time to complete the switching and adjustment of the display timing. Therefore, in an embodiment of the present application, during the refresh and display process of the N+1 frame image, the electronic device can refer to the refresh rate switching method in the aforementioned embodiment 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 touch modes at the same frame rate level. In this way, regardless of whether the idle time at the end of the frame at 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.
[0323] Optionally, when the electronic device starts to refresh and display the N+1 frame image, SurfaceFlinger can obtain all layers of the N+1 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+1 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+1 frame image, and finally form a frame of image to be displayed to be transmitted to the display screen, that is, the second image.
[0324] In some embodiments, since the refresh rate is switched from the first refresh rate in the hand touch mode to the first refresh rate in the pen touch mode, and the frame tail time in the hand touch mode is usually sufficient, as shown in (a) in FIG2 , 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 simultaneously complete the layer synthesis processing of the image frame and the display timing switching corresponding to the refresh rate. 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 having the MDP perform layer synthesis processing on the N+1 frame image to obtain the second image to be displayed.
[0325] 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.
[0326] 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 by changing the display timing parameters, 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.
[0327] In the embodiment of the present application, the display timings corresponding to different refresh rates in different touch modes can be pre-associated through a correspondence table, as shown in Table 2. Therefore, when the electronic device needs to switch the refresh rate, it can determine the matching display timing according to the preset correspondence table, and thus complete the refresh rate switching based on the matching display timing.
[0328] 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.
[0329] 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 and display process, the electronic device switches to the display timing corresponding to the 60Hz gear in the hand touch mode, as shown in (b) in Figure 12. During the N+1th frame image refresh and 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.
[0330] It can be understood that the increase in the HBP and HFP values will lead to a longer effective display time for the N+1 frame image. Since the refresh rate of the two touch modes is the same at 60Hz, the refresh display time of a frame image is fixed at 16.6ms. Therefore, the corresponding idle time at the end of the frame will become shorter.
[0331] As shown in (c) of Figure 12, after the refresh display of the Nth frame image is completed, 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 the MDP, increases the length of the effective display time, and shortens the length of the 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. As shown in (c) of Figure 12, the time for refreshing and displaying the N+1th frame image remains unchanged at 16.6ms.
[0332] In this way, the switched display timing not only meets the 60Hz screen refresh rate but also supports scanning of stylus input. This enables switching of touch modes within the same frame rate range. The electronic device then transmits image data to the display screen according to the switched display timing, refreshing the displayed image at the switched 60Hz screen refresh rate that matches the stylus.
[0333] 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.
[0334] 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 and display process, the electronic device switches from the display timing corresponding to the 144Hz gear in the hand touch mode to the display timing corresponding to the 60Hz gear in the hand touch mode, as shown in (b) in Figure 13. Then, during the N+1th frame image refresh and 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.
[0335] As shown in (c) in Figure 13, 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 the 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. As shown in (c) in Figure 13, the time for refreshing and displaying the N+1th frame image remains unchanged and is still 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 touch modes at the same frame rate gear is realized.
[0336] S1160: The electronic device displays the second image at the first refresh rate in the pen touch mode.
[0337] In some embodiments, after the electronic device controls the switching of the display timing via the MDP, it can transmit data of the second image to be displayed, formed after GPU synthesis of the N+1th frame image, to the display screen for display, using the display timing corresponding to the first refresh rate in the switched pen touch mode. Because the MDP only needs to implement refresh rate switching, and the layer synthesis processing is performed by the GPU, even if the spatial time at the end of the frame after the display timing switch is too short, the electronic device can still normally complete the display timing switch and normally transmit and display the second image after GPU synthesis of the N+1th frame image.
[0338] For example, as shown in FIG15 , when refreshing and displaying the N+1th frame image in the kernel phase, the display driver of the electronic device continues to respond to the first refresh rate switching instruction, driving the GPU synthesis module to complete the synthesis and superposition of the layers of the N+1th frame image, and driving 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 is switched, 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) via the MIPI interface according to the switched display timing.
[0339] It is understandable that since the N+1 frame image has already completed the switching process to the first refresh rate in pen touch mode, when the electronic device begins 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 composition method. For example, all layers of the N+2 frame image are restored to MDP composition.
[0340] For example, as shown in FIG16 , 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. Therefore, there is no need to drive the MDP display switching module to complete the corresponding display timing switch, 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.
[0341] In some scenarios, after completing the switch from the second refresh rate in hand touch mode to the first refresh rate in hand touch mode during the refresh display of the Nth frame, the switch from the first refresh rate in hand touch mode to the first refresh rate in pen touch mode may be completed after refreshing one frame of image. That is, during the refresh display of the N+2th frame of image, the switch from the first refresh rate in hand touch mode to the first refresh rate in pen touch mode is completed.
[0342] In some embodiments, in response to the first refresh rate switching instruction, the electronic device may issue a frame rate switching instruction for 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 for 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.
[0343] In some embodiments, since the switch is made from the first refresh rate in hand touch mode to the first refresh rate in pen touch mode, and the frame tail time in hand touch mode is generally sufficient, the electronic device may continue to use the MDP to perform layer synthesis processing on the N+1th frame image during the refresh and display process of the N+1th frame image to obtain the second image to be displayed. Thus, after the electronic device controls the switching of the display timing via 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, using the display timing corresponding to the first refresh rate in the switched pen touch mode.
[0344] The refresh rate switching method provided in the embodiment of the present application can first complete the refresh rate switching when it is necessary to switch between 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 in the frame idle area, only the switching of the MDP display timing needs to be completed, and the MDP synthesis action is no longer performed at the same time. Thereby, it is ensured that the image frame can be sent for display in time, and the problem of one frame of image not being able to be displayed normally during the refresh rate switching process of different touch modes is avoided. 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.
[0345] In some scenarios, when the electronic device starts to refresh and display the Nth frame image, if it detects 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, 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.
[0346] It is understood that the above embodiment uses the method of switching from the second refresh rate in hand touch mode to the first refresh rate in pen touch mode as an example to introduce the method of switching between different refresh rates in different touch modes. Switching from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode can also be implemented using a similar principle.
[0347] Because the hand touch mode supports some refresh rate gears (such as 144Hz), which the pen touch mode cannot support. Therefore, if you adjust the frame rate gear of the pen touch mode first, you may not be able to adjust the two touch modes 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, you cannot 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.
[0348] For example, when the electronic device begins refreshing and displaying the Nth frame image, it detects a second refresh rate switching instruction. The second refresh rate switching instruction is used to instruct a switch from a first refresh rate in pen touch mode to a second refresh rate in hand touch mode. The second refresh rate is different from the first refresh rate. In response to the second refresh rate switching instruction, the electronic device may perform layer compositing processing on the Nth frame image using the GPU to obtain a first image to be displayed. Furthermore, the electronic device may switch the screen refresh rate of the display screen from the first refresh rate in pen touch mode to the first refresh rate in hand touch mode using the MDP. Thus, the electronic device displays the first image at the first refresh rate in hand touch mode. Then, when the electronic device begins refreshing and displaying the N+1th frame image, it continues to perform layer compositing processing on the N+1th frame image using the MDP in response to the second refresh rate switching instruction to obtain a second image to be displayed. Furthermore, the electronic device may switch the screen refresh rate of the display screen from the first refresh rate in hand touch mode to the second refresh rate in hand touch mode using the MDP. Thus, the electronic device displays the first image at the second refresh rate in hand touch mode.
[0349] As an example, taking the 60Hz gear in pen touch mode as an example, switching to the 144Hz gear in hand touch mode, the electronic device can first complete the switch from the 60Hz gear in pen touch mode to the 60Hz gear in hand touch mode, that is, switching between different touch modes at the same frame rate gear. Then, the electronic device can complete the switch from the 60Hz gear in hand touch mode to the 144Hz gear in hand touch mode, that is, switching between different frame rate gears in the same touch mode.
[0350] 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 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.
[0351] 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, the HWC can force the layer synthesis method 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 displayed to be transmitted to the display screen, that is, the first image.
[0352] At the same time, the electronic device can control the switching of display timings through the MDP. 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 display timings through the MDP, it can transmit the data of the first image to be displayed, formed after the GPU synthesis of the Nth frame of image, to the display screen for display using the display timing corresponding to the first refresh rate in the switched hand touch mode.
[0353] 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.
[0354] 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.
[0355] 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 HWC, and ask HWC for processing. Since it is only necessary to continue switching between different refresh rates of the same touch mode, MDP can achieve refresh rate switching and layer synthesis at the same time. Therefore, HWC can maintain the original layer synthesis method of the N+1th frame image, such as MDP synthesis, according to the second refresh rate switching instruction, so that 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.
[0356] 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, switch 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. 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 using the display timing corresponding to the second refresh rate in the switched hand touch mode.
[0357] In an embodiment of the present application, the electronic device may 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.
[0358] In some embodiments, the electronic device can identify whether the stylus is currently in use based on the stylus's connection status, adsorption status, and full charge status. Based on the stylus's current usage status and the current screen refresh rate, the electronic device can determine a screen refresh rate level suitable for the current touch scenario and generate a corresponding refresh rate switching instruction. The electronic device then responds to the refresh rate switching instruction, completes the corresponding refresh rate switching, and ensures that there are no anomalies during the switching process.
[0359] Referring to FIG. 17 , an embodiment of the present application provides another refresh rate switching method, which may include:
[0360] 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.
[0361] In the embodiment of the present application, the electronic device can determine whether the stylus is currently in use by combining information such as the stylus's connection status, adsorption status, and full charge status. Therefore, upon recognizing that the stylus is in use, the screen refresh rate can be switched to a refresh rate suitable for the stylus, ensuring normal use of the stylus.
[0362] The stylus's connection status includes connected and disconnected. Generally, if the stylus is not in a communication connection with the electronic device, the user cannot use the stylus. When the user needs to use the stylus, they usually put the stylus in a communication connection with the electronic device. Therefore, by detecting the stylus's connection status, the electronic device can analyze whether the stylus is currently in use.
[0363] The communication connection between the stylus pen and the electronic device can 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 example of establishing a communication connection between the stylus pen and the electronic device via Bluetooth, the electronic device can detect whether it is in a Bluetooth connection state with the stylus pen.
[0364] Optionally, the electronic device can detect connection and disconnection events 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 the Bluetooth connection is disconnected, the Bluetooth module of the electronic device can report the disconnection event to the Bluetooth service module.
[0365] The adsorption state of the stylus includes adsorption and distance (non-adsorption). Generally, when the electronic device is communicatively connected to the stylus, after the user has used the stylus for a period of time, the user can also move 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. As shown in (a) of Figure 18, the stylus 100 is adsorbed on the right side frame of the electronic device 200. It can be understood that when the user uses the stylus normally, the stylus is usually away from the electronic device and is not adsorbed on the electronic device. As shown in (b) of Figure 18, the stylus 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, it can help the electronic device analyze whether the stylus is currently in use.
[0366] The stylus's fully charged state includes fully charged and partially charged. It is understood that when the stylus is attached to an 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 stopped charging state at this time). Therefore, the fully charged state of the stylus can also include charging and stopped charging.
[0367] At present, electronic devices can identify the adsorption event of the stylus and the distance event when the stylus is adsorbed and charging is stopped by scanning Q in a timely manner. However, the identification of the distance event when the stylus is adsorbed and charging is realized through the error timeout packet (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 charging in the first time. This means that when the user removes the stylus from the electronic device and uses the stylus for the first time, the electronic device cannot recognize the use status of the stylus in time and 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.
[0368] To address the above issues, the present embodiment adds detection of the stylus's full power status to assist in analyzing whether the stylus is currently in use. Optionally, the electronic device can use the stylus service module at the framework layer to detect events such as the stylus's attachment, removal, full power, and partial power.
[0369] In one scenario, when the stylus is attached to an electronic device from a distance, the device's wireless charging chip detects a change in the Q value of the wireless charging coil. The chip then generates an interrupt signal, notifying the wireless charging driver through a chip-driven interrupt process. The driver then reports the attachment event to the stylus service. Once the stylus is attached to the electronic device, if the battery level is not fully charged, the stylus enters the attached charging state.
[0370] In one scenario, after the stylus is fully charged by being attached to an electronic device, it enters the attached charging stop state. At this point, the stylus can notify the wireless charging coil of the electronic device of a full charge event (charge done) via the Qi protocol of the wireless charging coil. Upon receiving the charge done event, the wireless charging chip of the electronic device can generate an interrupt signal (interrupt), which notifies the wireless charging driver through the chip-driven interrupt process. The wireless charging driver then reports the full charge event to the stylus service.
[0371] In one scenario, if the stylus service does not receive a full charge event when receiving a stylus adsorption event, it can be determined that the stylus is not fully charged, that is, the stylus is in an adsorption charging state.
[0372] 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.
[0373] 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.
[0374] S1720: The electronic device determines a current touch scene based on the status information of the stylus.
[0375] In some embodiments, the electronic device can determine the current touch scene based on the connection status and adsorption status of the stylus. Touch scenes include touch scenes for stylus input (also known as pen control scenes, writing scenes, etc.) and touch scenes for finger input (also known as hand control scenes).
[0376] 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.
[0377] Table 4
[0378] It can be understood that when the stylus moves away or is adsorbed, the electronic device can detect the stylus movement and adsorption events immediately, and can directly determine the current touch scene based on the connection status and adsorption status of the stylus.
[0379] Since the stylus is in a connected state and not in an adsorbed state 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).
[0380] 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.
[0381] 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 correspondence in Table 5.
[0382] Table 5
[0383] 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 adsorption stop charging state. Since the wireless charging chip will always be in a low-power (lowpower) Q scanning mode after stopping charging. Therefore, when the stylus moves away from the adsorption stop 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 (i.e., the touch scene corresponding to code d). If no distance event is detected and it is still in the adsorption stop 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 (i.e., the touch scene corresponding to code c2).
[0384] In the scenario where the stylus is attached to an electronic device and is not fully charged, since the stylus removal event cannot be detected in time, in this embodiment of the application, it is possible to force the stylus to be considered to be 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, the electronic device has already switched the screen refresh rate to a refresh rate that matches the stylus based on the stylus's usage status. Therefore, no touch abnormality will occur, and the user can use the stylus to write or touch normally.
[0385] When the electronic device detects that the stylus is not connected, it 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).
[0386] 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 it detects them. The stylus service module can then determine whether the current stylus is in use based on the connection events and disconnection events reported by the Bluetooth service module, as well as the adsorption events, distance events, and full-charge events reported by the wireless charging driver.
[0387] Optionally, upon receiving a disconnect event, the stylus service module deems the stylus not currently connected to the electronic device and can confirm that the current touch scene is a finger-input touch scene. If a connection event is received, the stylus service module can detect whether an adsorption event has been received. If the stylus service module does not receive an adsorption event, it can be assumed that the stylus is currently in an unadsorbed state (moved away from the electronic device) and can confirm that the current touch scene is a stylus-input touch scene.
[0388] Optionally, upon receiving the adsorption event, the stylus service module may determine whether a full-charge event has been received. If the stylus service module does not receive the full-charge event, it may be considered that the stylus is currently in the adsorption state but not fully charged, and the current touch scene may be forcibly confirmed as a touch scene for stylus input.
[0389] Optionally, when the stylus service module receives a full charge event, it can determine whether a distance event has been received. If the stylus service module does not receive a distance event, it can be assumed that the stylus is currently in a connected, adsorbed, and fully charged state, and the current touch scene can be confirmed as a touch scene input by a finger. If a distance event is received, it can be assumed that the stylus is currently in an unadsorbed state (it has been removed from the electronic device), and the current touch scene can be confirmed as a touch scene input by the stylus.
[0390] That is, when the stylus service module identifies the stylus as being in a state such as being connected, adsorbed, and not fully charged, or being unadsorbed (i.e., being connected and far away), it determines the current touch scene as a stylus input touch scene. When the stylus service module identifies the stylus as being in a state such as being connected, adsorbed, and fully charged, or being unconnected, it determines the current touch scene as a finger input touch scene.
[0391] 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 a 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 a touch scene input by a finger.
[0392] Optionally, the stylus can determine whether it is in use by detecting a holding state, a movement state, etc. of the stylus.
[0393] S1730: The electronic device matches the corresponding target refresh rate according to the current touch scene.
[0394] 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, thereby switching the screen refresh rate when the current screen refresh rate is different from the target refresh rate.
[0395] In some embodiments, the electronic device can determine the corresponding touch mode based on the current touch scenario, thereby matching the corresponding target refresh rate according to the refresh rate level supported by the corresponding touch mode. Wherein, the touch mode includes pen touch mode and hand touch mode.
[0396] In some embodiments, different touch modes may also correspond to touch screen firmware operating modes. Therefore, after the electronic device determines the corresponding touch mode according to the current touch scenario, it may also match the firmware operating mode supported by the corresponding touch mode.
[0397] Exemplarily, it is assumed that the default initial touch scene of the electronic device is a touch scene of finger input.
[0398] If the stylus is not connected to the electronic device via Bluetooth, the stylus service module receives the disconnection event after reporting it to the Bluetooth service module and the stylus service module through the aforementioned event transmission path. The stylus service module then determines that the current touch scene is still the finger input scene. The touch scene has not changed (finger input -> finger input).
[0399] In one scenario, if the stylus is connected to the electronic device via Bluetooth and is in a remote state, after reporting to the stylus service module through the same channel, the stylus service module can receive a connected event and a remote event, confirming that the current touch scene is the touch scene of stylus input. The touch scene has changed (finger input -> stylus input). Of course, if the stylus's Bluetooth connection is disconnected at this time, the stylus service module can receive a disconnected event, thereby determining that the current touch scene has been restored to the touch scene of finger input. The touch scene has changed again (stylus input -> finger input).
[0400] Then, 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 again 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).
[0401] 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, indicating that the stylus is in the attached and charging stopped state, the stylus service module determines that the current touch scene is a finger input touch scene. The touch scene has changed (stylus input -> finger input). Of course, if the stylus's Bluetooth connection is disconnected at this time, the stylus service module can receive a disconnected event, thereby determining that the current touch scene is still a finger input touch scene. The touch scene has not changed (finger input -> finger input).
[0402] Then, if the stylus is moved away from the adsorption and charging 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 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 finger input. The touch scene has changed (stylus input -> finger input).
[0403] 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 the connected event and the adsorption event, 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 error in the recognition 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 error in the recognition of the touch scene.
[0404] In another scenario, if the stylus is connected to the electronic device via Bluetooth and the stylus is in the adsorption charging state, then after reporting to the stylus service module through the same channel, the stylus service module can receive the connection event and the adsorption 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 the touch scene of 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 finger input. The touch scene has changed again (stylus input -> finger input).
[0405] Next, if the stylus remains 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 indicates that the stylus is in the attached, charging-stopped state. At this point, the stylus service module can determine that the current touch scenario is finger input. The touch scenario has changed (stylus input -> finger input). For subsequent disconnection and distance scenarios, refer to the previous description.
[0406] 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 the 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 the touch scene of finger input. The touch scene has not changed (finger input -> finger input).
[0407] Then, if the stylus is moved away from the adsorption and charging 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 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 finger input. The touch scene has changed (stylus input -> finger input).
[0408] As an example, the identification of the above touch scene and whether the touch scene has changed may be as shown in Table 6:
[0409] Table 6
[0410] In some embodiments, when the electronic device's stylus service module determines the current touch scenario and discovers that the touch scenario has changed compared to the previous touch scenario, it can notify the frame rate control module, which then matches the corresponding target refresh rate based on the current touch scenario. This enables real-time determination of the screen refresh rate appropriate for the electronic device's current touch scenario. This involves switching refresh rates between different touch modes.
[0411] 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.
[0412] Optionally, when the current touch scene is a stylus input touch scene, the frame rate control module can determine that the corresponding touch mode is pen touch mode based on the stylus input touch scene. Thus, the frame rate control module matches the corresponding target refresh rate from the screen refresh rate levels supported in pen touch mode. For example, as shown in Table 3, the target refresh rate can be 60Hz in pen touch mode (i.e., sequence number 2-2).
[0413] In some embodiments, when the current touch scene is a touch scene using a stylus input, the frame rate control module may also match a corresponding target operating mode from the touch screen firmware operating modes supported in the pen touch mode. For example, as shown in Table 3, the target operating mode may be firmware mode 2 in the pen touch mode.
[0414] 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 based on the finger-input touch scene. Thus, the frame rate control module matches the corresponding target refresh rate from the screen refresh rate levels supported in the hand touch mode. For example, as shown in Table 3, the target refresh rate can be 144 Hz (i.e., sequence numbers 1-4) in the hand touch mode.
[0415] 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.
[0416] 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. The frame rate control module then continues to match the corresponding target refresh rate based on the previous touch scene. In other words, this only involves adjusting the frame rate level within the same touch mode.
[0417] In the embodiment of the present application, the refresh rate gears supported in different touch modes may have overlapping 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.
[0418] Optionally, the frame rate control module may match a corresponding target refresh rate according to the current touch scene and the refresh rate used by the current screen.
[0419] 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 based on 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 target refresh rate. 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.
[0420] 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.
[0421] For another example, taking the refresh rate of the current screen as 60Hz in pen touch mode (i.e., serial number 2-2), if it is identified that the current touch scene is a touch scene of finger input, the frame rate control module can determine that the corresponding touch mode is hand touch mode based on 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 target refresh rate. 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.
[0422] 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 are 60 Hz, the refresh rate switching process performed by the electronic device only needs to switch between different touch modes.
[0423] S1740: The electronic device adjusts the screen refresh rate to the target refresh rate.
[0424] 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, which then issues the refresh rate switching instruction to the display driver of the kernel layer to complete the refresh rate switching.
[0425] Optionally, when the touch scene changes, the target refresh rate determined by the frame rate control module is the refresh rate in 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 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.
[0426] Optionally, when the refresh rate switching instruction generated involves not only switching of the touch mode, but also 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 switching of the touch mode. For example, when the refresh rate used by the current screen is 120Hz in hand touch mode, if it is switched to 60Hz in pen touch mode, first reduce the frame rate gear to 60Hz in hand touch mode. Then switch from 60Hz in hand touch mode to 60Hz in pen touch mode.
[0427] Optionally, when the touch scene remains unchanged, the target refresh rate determined by the frame rate control module is the same as the refresh rate currently used by the screen under the same touch mode. Therefore, the generated refresh rate switching instruction 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.
[0428] 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 operating mode switching of the touch firmware. Optionally, the firmware switching instruction may also be sent to the instruction issuing module, which issues the firmware switching instruction to the display driver of the kernel layer, instructing the display driver to complete the refresh rate switching while simultaneously notifying the touch driver in the kernel to complete the operating mode switching of the touch firmware.
[0429] In an embodiment of the present application, the electronic device may also pre-configure corresponding touch modes for some applications. Thus, when the electronic device runs one of these applications in the foreground, it can directly match the target refresh rate in the corresponding touch mode according to the touch mode configured for the application.
[0430] 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 to the hand touch mode. Each application in the application whitelist corresponding to the pen touch mode is forcibly configured to the pen touch mode.
[0431] When the first application is running in the foreground of the electronic device, if the first application is included in the application whitelist corresponding to the hand touch mode, the electronic device can determine that the touch mode corresponding to the current scene is the hand touch mode. The electronic device can then match the corresponding target refresh rate from the refresh rate ranges supported in the hand touch mode. The first application can be a game application, a video application, or other application that does not require the use of a stylus.
[0432] When the foreground application of an electronic device is a second application, if the second application is included in the application whitelist corresponding to the pen touch mode, the electronic device can determine that the touch mode corresponding to the current scene is the pen touch mode. The electronic device can then match the corresponding target refresh rate from the refresh rate ranges supported in the pen touch mode. The second application can be a drawing application, a note-taking application, or other application that requires the use of a stylus.
[0433] Optionally, the application whitelist stored in the electronic device may also include pre-configured touch modes corresponding to various applications, 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 running in the foreground based on the application whitelist.
[0434] In one scenario, the whitelist service module of the electronic device's framework layer can determine in real time whether a touch mode corresponding to the application running in the foreground is configured in the application whitelist. If the touch mode corresponding to the application running in the foreground is configured in the application whitelist, 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.
[0435] 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 can match the target refresh rate in the touch mode.
[0436] 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.
[0437] Optionally, the electronic device can prioritize the touch modes configured in the whitelist and match the corresponding target refresh rate. If the touch mode corresponding to the foreground application is not configured in the application whitelist, the electronic device can determine the current touch scenario based on the stylus usage status. This allows the electronic device to determine the corresponding touch mode based on the current touch scenario and, in turn, match the corresponding target refresh rate.
[0438] 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 a target refresh rate suitable for the electronic device's current touch scenario. If the whitelist service module doesn't have a corresponding touch mode configured, the frame rate control module can determine a target refresh rate suitable for the electronic device's current touch scenario based on the stylus status information sent by the stylus service module.
[0439] 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.
[0440] It is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules that perform the corresponding functions. 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 this application.
[0441] In the embodiment of the present application, the electronic device can be divided into functional modules 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 modules 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. In actual implementation, other division methods can be used.
[0442] Some other embodiments of the present application further provide a refresh rate switching device, which can be applied to the above electronic device and is used to execute the functions or steps executed by the electronic device in the above method embodiment.
[0443] Other embodiments of the present application further provide a refresh rate switching system, which includes a stylus and the above-mentioned electronic device.
[0444] Some other embodiments of the present application further provide an electronic device, comprising the aforementioned stylus, wherein the electronic device is configured to execute the functions or steps executed by the electronic device in the aforementioned method embodiment.
[0445] 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 via a circuit. The interface circuit can read instructions stored in a memory and send the instructions to the processor. When the instructions are executed by the processor, the electronic device can perform the various steps of the above-mentioned embodiments. Of course, the chip system can also include other discrete components, which are not specifically limited by the present application.
[0446] An embodiment of the present application further 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 the various functions or steps executed by the electronic device in the above-mentioned method embodiment.
[0447] An embodiment of the present application further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the functions or steps executed by the electronic device in the above method embodiment.
[0448] Among them, the stylus pen, electronic device, computer storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0449] 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.
[0450] In the several embodiments provided in this 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 merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, 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.
[0451] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection 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 claimed in any one of claims 1 to 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
Refresh rate switching method and electronic equipment
CN119516979A
Touch sensing system and driving method of the same
CN108255333A
Image synthesis method and device, electronic equipment and storage medium
CN110413245A
Control method, control device and electronic equipment thereof
CN110908535A
Refresh rate control method and system and electronic equipment
CN113220154A