Refresh rate switching method and electronic device
Patent Information
- Application Number
- CN202311090673.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-25
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-08-25
AI Technical Summary
然而,目前的刷新率切换过程中,可能会存在送显异常的问题
[0067] It is understood that the beneficial effects achieved by the apparatus 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 provided above can be referred to the beneficial effects of the first aspect and any possible implementation thereof, which will not be repeated here.
Smart Images

Figure CN119516979B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a refresh rate switching method and an electronic device. Background Technology
[0002] With advancements in display technology, electronic devices such as smartphones and tablets have gradually begun to support various screen refresh rates. Refresh rate (or scanning frequency) refers to the number of times the image displayed on an electronic device's screen is refreshed per second, measured in Hertz (Hz). It can also be called display frequency or frame rate. For example, with a refresh rate of 60Hz, the electronic device can refresh the displayed image 60 times per second (1000 milliseconds), meaning one frame is displayed every 16.6 milliseconds. A higher refresh rate means more image frames can be refreshed per second, resulting in better image stability, smoother display, and less eye strain, but also higher power consumption.
[0003] Currently, after an electronic device and a stylus are wirelessly connected, users can operate the touchscreen of the electronic device using the stylus to provide input, which the electronic device then uses to perform corresponding operations. To ensure signal synchronization between the electronic device and the stylus, the electronic device needs to switch its refresh rate to match that of the stylus. However, current refresh rate switching processes may experience display anomalies. Summary of the Invention
[0004] This application provides a refresh rate switching method and an electronic device, which can normally complete refresh rate switching in different touch modes while ensuring normal display of the screen.
[0005] To achieve the above objectives, this application adopts the following technical solution:
[0006] In a first aspect, a refresh rate switching method is provided, which can be applied to an electronic device. 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 command, the first refresh rate switching command indicating a switch from the first refresh rate of the first touch mode to the second refresh rate of the second touch mode; responding to the first refresh rate switching command, controlling a graphics processor to perform layer compositing 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 after being composited by the graphics processor at the second refresh rate of the second touch mode.
[0007] The touch mode is used to indicate the user input methods supported by the electronic device. The first touch mode and the second touch mode indicate different user input methods. For example, the first touch mode supports stylus input, and the second touch mode supports finger input. Optionally, while there are differences, there can also be overlapping user input methods. For example, the first touch mode supports stylus input, and the second touch mode supports both finger and stylus input. This application does not limit the user input methods indicated by each touch mode.
[0008] Each touch mode has at least one supported refresh rate level. The supported refresh rate levels for different touch modes can be different or the same. The different supported refresh rate levels can be completely different or have some overlapping levels. For example, the first touch mode supports 30Hz and 60Hz, while the second touch mode supports 60Hz, 120Hz, and 144Hz.
[0009] The aforementioned display processor is typically responsible for layer compositing and overlaying of displayed images, as well as refresh rate switching. The aforementioned graphics processor is typically used to perform mathematical and geometric calculations for graphics rendering.
[0010] The solution provided in the first aspect above allows the electronic device to refresh its screen at a first refresh rate in a first touch mode. If a cross-mode refresh rate switching command is detected, such as a command indicating a switch from the first refresh rate of the first touch mode to the second refresh rate of the second touch mode, the electronic device can respond to the command and force the layer compositing processing of the displayed image to be handled by the graphics processor. This reduces the load on the display processor, allowing it to focus solely on the cross-mode refresh rate switching, such as switching 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 composed by the graphics processor on the screen. It is understandable that for cross-mode refresh rate switching with significant differences, the display processor may not be able to simultaneously complete the layer compositing and overlaying of the displayed image and the refresh rate switching processing, potentially leading to display anomalies during the switching process. Therefore, this solution reduces the load on the display processor (GPU) by offloading the image layer compositing process, which was originally handled by the display processor, to the graphics processor (GPU) when refresh rate switching between different touch modes is required. This allows the GPU to focus on the refresh rate switching process, ensuring both successful cross-mode refresh rate switching and accurate image delivery. It avoids display anomalies during cross-mode refresh rate switching.
[0011] 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, while the pen touch mode indicates that the electronic device simultaneously supports user input via both finger operation and stylus operation.
[0012] In other words, when an electronic device's screen refreshes at the first refresh rate in pen touch mode, if it detects a first refresh rate switching command to switch to the second refresh rate in hand touch mode, the electronic device can respond to this command and force the layer compositing processing of the displayed image to be performed by the graphics processor. This reduces the load on the display processor, allowing it to successfully switch from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode. In this way, the electronic device can then use the successfully switched second refresh rate in hand touch mode to properly refresh and display the image composed by the graphics processor on the screen.
[0013] In another possible implementation, the first touch mode is a hand touch mode, and the second touch mode is a pen touch mode.
[0014] In other words, when an electronic device's screen refreshes at the first refresh rate in touch mode, if it detects a refresh rate switching command to switch to the second refresh rate in pen touch mode, the electronic device can respond to this command and force the layer compositing processing of the displayed image to be performed by the graphics processor. This reduces the load on the display processor, allowing it to successfully switch from the first refresh rate in touch mode to the second refresh rate in pen touch mode. In this way, the electronic device can then use the successfully switched second refresh rate in pen touch mode to properly refresh and display the image composited by the graphics processor on the screen.
[0015] In one possible implementation, the first refresh rate and the second refresh rate are the same. It is understood that although the refresh rate levels for the two touch modes are the same, the display timing adjustments required for each touch mode will differ due to the differences in the supported touch methods. For example, the display timing corresponding to 60Hz in hand touch mode differs significantly from that in pen touch mode (due to the need to support stylus input). Therefore, this solution can reduce the load on the display processor by offloading the layer compositing processing of the displayed image, which was originally handled by the display processor, to the graphics processor when switching between different touch modes at the same refresh rate. The display processor can then centrally handle the switching processing of different touch modes at the same refresh rate.
[0016] In one possible implementation, the first refresh rate and the second refresh rate are different. That is, the cross-mode refresh rate switching of this solution involves not only the refresh rate switching between different touch modes, but also the switching between different refresh rate levels.
[0017] In one possible implementation, the first refresh rate is greater than the second refresh rate. Thus, this solution can seamlessly switch from a high refresh rate in one touch mode to a low refresh rate in another, such as switching from 144Hz in hand touch mode to 60Hz in pen touch mode.
[0018] In one possible implementation, the first refresh rate is greater than the second refresh rate. Thus, this solution can seamlessly switch from a low refresh rate in one touch mode to a high refresh rate in another, such as switching from 60Hz in pen touch mode to 144Hz in hand touch mode.
[0019] Optionally, when the first refresh rate and the second refresh rate are different, since it involves both the switching of refresh rates between different touch modes and the switching of different refresh rate levels, the electronic device can complete the switching of refresh rates between different touch modes and the switching of different refresh rate levels separately.
[0020] In one possible implementation, when the first refresh rate is greater than the second refresh rate, the specific process of the refresh rate switching method provided by this solution may include: when refreshing and displaying the Nth frame image, detecting a first refresh rate switching command, where N is a positive integer; in response to the first refresh rate switching command, controlling the display processor to perform layer compositing 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 command, controlling the graphics processor to perform layer compositing of the N+1th frame image to obtain a second image to be displayed; controlling the display processor to switch the screen refresh rate from the second refresh rate of the first touch mode to the second refresh rate of the second touch mode; displaying the second image synthesized by the graphics processor at the second refresh rate of the second touch mode.
[0021] Thus, when the screen of an electronic device refreshes using the first refresh rate of the first touch mode (e.g., 144Hz in hand touch mode), if, during the refresh of a certain frame (the Nth frame), it is detected that a switch to the second refresh rate of the second touch mode is needed, and the second refresh rate is lower than the first refresh rate (e.g., 60Hz in pen touch mode), the electronic device can first complete the switch between different refresh rate levels during the refresh of the Nth frame (e.g., from 144Hz in hand touch mode to 60Hz in hand touch mode), and then complete the switch back to the same refresh rate for the different touch modes during the refresh of the next frame (the N+1th frame) (e.g., from 60Hz in hand touch mode to 60Hz in pen touch mode). During the refresh of the Nth frame, only the refresh rate level needs to be switched; the touch mode remains unchanged. That is, only the high / low refresh rate level switch within the same touch mode (the first touch mode) is completed, without involving cross-mode refresh rate switching, and the switching difference is minimal. Therefore, the layer composition of the Nth frame can still be handled by the display processor, without needing to be delegated to the graphics processor. However, when refreshing the display of the N+1th frame, the switching between different touch modes at the same refresh rate is significantly different. Therefore, the layer composition of the N+1th frame needs to be delegated to the graphics processor to reduce the load on the display processor, which can then focus on handling the same refresh rate switching between different touch modes.
[0022] In one possible implementation, when the first refresh rate is less than the second refresh rate, the specific process of the refresh rate switching method provided by this solution may include: when refreshing and displaying the Nth frame image, detecting a first refresh rate switching command, where N is a positive integer; in response to the first refresh rate switching command, controlling the graphics processor to perform layer compositing 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 composed 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 command, controlling the display processor to perform layer compositing 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; displaying the second image composed by the display processor at the second refresh rate of the second touch mode.
[0023] Thus, when the screen of an electronic device refreshes using the first refresh rate of the first touch mode (e.g., 60Hz in pen touch mode), if, during the refresh of the Nth frame, a switch to the second refresh rate of the second touch mode is detected, and this second refresh rate is higher than the first refresh rate (e.g., 144Hz in hand touch mode), the electronic device can first complete the same refresh rate switch between different touch modes (e.g., from 60Hz in pen touch mode to 60Hz in hand touch mode) during the refresh of the Nth frame. Then, during the refresh of the next frame (the N+1th frame), it can complete the switch between different refresh rate levels within the same touch mode (e.g., from 60Hz in hand touch mode to 144Hz in hand touch mode). However, during the refresh of the Nth frame, since the same refresh rate switch between different touch modes is involved, cross-mode refresh rate switching is significant. Therefore, the layer composition of the Nth frame needs to be handled by the graphics processor to reduce the load on the display processor, which can then focus on handling the same refresh rate switch between different touch modes. However, when refreshing the display of the N+1th frame, since it only requires switching between different refresh rate levels within the same touch mode and does not involve cross-mode operation, the switching differences are small. Therefore, the layer composition of the N+1th frame can still be handled by the display processor, without needing to be delegated to the graphics processor.
[0024] In some scenarios, if the hardware of the electronic device supports it, the electronic device can also switch from the first refresh rate of the first touch mode to the second refresh rate of the second touch mode directly when refreshing and displaying the Nth frame of the image.
[0025] In one possible implementation, the refresh rate switching method provided by this solution may further include: determining the usage state of the stylus; and generating a first refresh rate switching command in response to a switch in usage state from inactive to active, or vice versa. Thus, when the user needs to use the stylus, the electronic device can switch the refresh rate to the refresh rate supported by the stylus touch mode. When the user does not need to use the stylus, the electronic device can switch the refresh rate to the refresh rate supported by the hand touch mode.
[0026] In one possible implementation, the stylus can send its usage status to the electronic device when it determines its own 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 stylus's usage status.
[0027] In one possible implementation, the electronic device can also detect the stylus's usage status itself. For example, the electronic device can detect the stylus's connection status, magnetic attachment status, and full charge status to determine the stylus's usage status based on the detected connection status, magnetic attachment status, and full charge status.
[0028] Optionally, when the stylus is connected and magnetically attached to the electronic device and the stylus is not fully charged, the electronic device can determine that the stylus is in use.
[0029] It's understandable that if a user removes the stylus and immediately begins using it, the electronic device, because the stylus was still in a charging state before being removed, cannot detect the stylus's movement away in time via the error timeout packet (cep_timeout). This prevents the electronic device from immediately recognizing the stylus as in use, thus rendering it unusable immediately after removal. Therefore, this solution adds a full-charge status check to force the stylus to be recognized as in use even when it's not fully charged, ensuring normal operation even if the user immediately begins inputting after removing the stylus.
[0030] Optionally, when the stylus is connected and magnetically attached to the electronic device and its battery is fully charged, the electronic device can determine that the stylus is not in use. It's understandable that when the stylus is magnetically attached to the electronic device and fully charged, the electronic device can detect the stylus's movement away in a timely manner through other means; therefore, it doesn't need to be forcibly identified as the stylus being used. Simply determining that the stylus is not in use based on its magnetic attachment to the electronic device is sufficient.
[0031] Optionally, when the stylus is connected but not magnetically attached to the electronic device, the electronic device can determine that the stylus is in use. It is understandable that when the stylus connected to the electronic device is moved away from the electronic device, the user is likely to be using the stylus.
[0032] Optionally, if the stylus is not connected to an electronic device, the electronic device determines that the stylus is not in use. It is understood that a stylus typically needs to be connected to an electronic device to input data. Therefore, if it is not connected to an electronic device, it means that the user does not currently need to use the stylus.
[0033] In one possible implementation, the first touch mode is a hand touch mode, and the second touch mode is a pen touch mode. The electronic device can, in response to the switching of the usage state from inactive to active, determine the matching screen refresh rate as the second refresh rate from a plurality of refresh rates supported by the pen touch mode; and generate a first refresh rate switching command based on the second refresh rate of the pen touch mode.
[0034] Thus, when the user does not need to use the stylus, the electronic device's current screen refresh rate matches the stylus mode. However, when a change in the touch scenario is detected, and the user needs to use the stylus, the electronic device switches its current screen refresh rate to match the stylus touch mode. In other words, it can select a suitable refresh rate from multiple selectable refresh rates in the stylus touch mode and generate a corresponding cross-mode refresh rate switching command.
[0035] In one possible implementation, the first touch mode is a pen touch mode, and the second touch mode is a hand touch mode. The electronic device can respond to a switch in usage state from being in use to being inactive, determine the matching screen refresh rate from a plurality of refresh rates supported by the hand touch mode as the second refresh rate, and generate a first refresh rate switching command based on the second refresh rate of the hand touch mode.
[0036] Thus, when a stylus is needed in the current scenario, the electronic device's current screen refresh rate matches the stylus mode. When a change in the touch scenario is detected, and the user no longer needs the stylus, the electronic device can switch its current screen refresh rate to match the hand touch mode. In other words, it can select a suitable refresh rate from multiple available refresh rates in hand touch mode and generate a corresponding cross-mode refresh rate switching command.
[0037] In one possible implementation, the electronic device may also be pre-configured with a whitelist, which includes the touch modes corresponding to each application. For example, game applications can be forced to be configured in hand touch mode, while applications that require a stylus, such as drawing and note-taking applications, can be forced to be configured in pen touch mode.
[0038] Therefore, when an application running in the foreground of an electronic device is not in the preset whitelist, the electronic device can directly switch the refresh rate based on the usage scenario of the stylus. For example, in response to a change in usage status from inactive to active, or vice versa, a first refresh rate switching command is generated.
[0039] When an application running in the foreground of an electronic device is in a preset whitelist, the device can prioritize switching refresh rates based on the touch modes configured in the whitelist. For example, the device can find the touch mode corresponding to the application running in the foreground from the 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 can respond to this change by generating a first refresh rate switching command.
[0040] As an example, an electronic device can switch from a first touch mode to a second touch mode in response to a touch mode corresponding to a foreground application. From multiple refresh rates supported by the second touch mode, it determines the matching screen refresh rate as the second refresh rate; based on the second refresh rate of the second touch mode, it generates a first refresh rate switching command. Thus, when a change in touch scenario is detected based on touch modes configured in a whitelist, the current screen refresh rate can be switched to match the changed touch mode. In other words, a suitable refresh rate can be matched from multiple selectable refresh rates in the second touch mode, and a cross-mode refresh rate switching command can be generated accordingly.
[0041] Similarly, when the touch mode corresponding to the application running in the background switches from the second touch mode to the first touch mode, the electronic device can respond to this change in touch mode by generating a second refresh rate switching command, such as switching from the second refresh rate of the second touch mode to the first refresh rate of the first touch mode. At this time, the electronic device can determine the matching screen refresh rate as the first refresh rate from the multiple refresh rates supported by the first touch mode; and generate the second refresh rate switching command based on the first refresh rate of the first touch mode.
[0042] In some embodiments, due to changes in the touch scenario, this solution can switch the operating mode of the touch firmware simultaneously with the refresh rate. The touch firmware of the electronic device supports a first operating mode and a second operating mode, where the first operating mode corresponds to a first touch mode and the second operating mode corresponds to a second touch mode. The refresh rate switching method provided by this solution further includes: in response to a first refresh rate switching command, switching the operating mode of the touch firmware from the first operating mode to the second operating mode. This allows not only the screen refresh rate to match the current touch scenario (such as a pen touch mode), but also the operating mode of the touch firmware to match the current touch scenario.
[0043] 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 compositing 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. Thus, after completing the cross-mode refresh rate switching, the layer compositing of the displayed image can revert to being handled by the original display processor. Furthermore, since the refresh rate switching has been completed, the display processor does not currently need to perform refresh rate switching processing, but is only responsible for the layer compositing processing of the displayed image. Of course, if a new refresh rate switching instruction is detected, the display processor still needs to perform the refresh rate switching processing.
[0044] Secondly, a refresh rate switching device is provided, which is included in an electronic device and has the function of implementing the behavior of the electronic device in any of the methods of the first aspect and its possible implementations. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-described function. As an example, the refresh rate switching device may include a processing module and a display module.
[0045] The processing module is configured to: detect a first refresh rate switching command when the screen refresh rate is a first refresh rate of the first touch mode, the first refresh rate switching command 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; the processing module is further configured to: control the graphics processor to perform layer compositing of the image to be displayed in response to the first refresh rate switching command; the processing module is further configured 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; and the display module is configured to: display the image to be displayed after being composited by the graphics processor at the second refresh rate of the second touch mode.
[0046] 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, while the pen touch mode indicates that the electronic device simultaneously supports user input via both finger operation and stylus operation.
[0047] In one possible implementation, the first touch mode is a hand touch mode, and the second touch mode is a pen touch mode.
[0048] In one possible implementation, the first refresh rate is the same as the second refresh rate; or the first refresh rate is greater than the second refresh rate; or the first refresh rate is greater than the second refresh rate.
[0049] In one possible implementation, when the first refresh rate is greater than the second refresh rate, the processing module is configured to: detect a first refresh rate switching command when refreshing and displaying the Nth frame image, where N is a positive integer; in response to the first refresh rate switching command, control the display processor to perform layer compositing 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 second refresh rate of the first touch mode. The display module is configured to: display the first image composed by the display processor at the second refresh rate of the first touch mode. The processing module is further configured to: in response to the first refresh rate switching command when refreshing and displaying the N+1th frame image, control the graphics processor to perform layer compositing 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 second refresh rate of the first touch mode to the second refresh rate of the second touch mode. The display module is further configured to: display the second image composed by the graphics processor at the second refresh rate of the second touch mode.
[0050] In one possible implementation, when the first refresh rate is less than the second refresh rate, the processing module is configured to: detect a first refresh rate switching command when refreshing and displaying the Nth frame image, where N is a positive integer; in response to the first refresh rate switching command, control the graphics processor to perform layer compositing 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 composed by the graphics processor at the first refresh rate of the second touch mode. The processing module is further configured to: in response to the first refresh rate switching command when refreshing and displaying the N+1th frame image, control the display processor to perform layer compositing 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 composed by the display processor at the second refresh rate of the second touch mode.
[0051] In one possible implementation, the processing module is further configured to: determine the usage state of the stylus; and generate a first refresh rate switching instruction in response to a change in usage state from inactive to active, or a change in usage state from active to inactive.
[0052] In one possible implementation, the processing module is also configured to: receive the stylus usage status sent by the stylus.
[0053] In one possible implementation, the processing module is further configured to: determine the usage status of the stylus based on the detected connection status, magnetic state, and full charge status of the stylus.
[0054] In one possible implementation, the processing module is further configured to: determine that the stylus is in use if it is detected that the stylus is connected and magnetically attached to the electronic device and the stylus is not fully charged; determine that the stylus is not in use if it is detected that the stylus is connected and magnetically attached to the electronic device and the stylus is fully charged; determine that the stylus is in use if it is detected that the stylus is connected but not magnetically attached to the electronic device; and determine that the stylus is not in use if it is detected that the stylus is not connected to the electronic device.
[0055] 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 a switch from an inactive to an active state, 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.
[0056] 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 a switch in usage state from in use to in use, determine a matching screen refresh rate as the 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.
[0057] In one possible implementation, the processing module is further configured to: when the background application is not in the preset whitelist, generate a first refresh rate switching instruction in response to the switching of the usage state from unused to used, or the switching of the usage state from used to unused.
[0058] In one possible implementation, the processing module is further configured to: when the foreground application is in a preset whitelist, match the touch mode corresponding to the foreground application from the preset whitelist; and generate a first refresh rate switching instruction in response to the foreground application switching from a first touch mode to a second touch mode.
[0059] In one possible implementation, the processing module is further configured to: in response to the foreground application switching its touch mode from a first touch mode to a second touch mode, determine a matching screen refresh rate as the second refresh rate from a plurality of refresh rates supported by the second touch mode; and generate a first refresh rate switching instruction based on the second refresh rate of the second touch mode.
[0060] In one possible implementation, the touch firmware of the electronic device supports a first operating mode and a second operating mode, wherein the first operating mode corresponds to a first touch mode and the second operating mode corresponds to a second touch mode. The processing module is further configured to: in response to a first refresh rate switching command, switch the operating mode of the touch firmware from the first operating mode to the second operating mode.
[0061] In one possible implementation, the processing module is further configured to: after the screen refresh rate is switched to the second refresh rate of the second touch mode, control the display processor to perform layer compositing of the image to be displayed; and display the image to be displayed after being composited by the display processor at the second refresh rate of the second touch mode.
[0062] Thirdly, an electronic device is provided, including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, including computer instructions, which, when executed by the one or more processors, cause the electronic device to perform the refresh rate switching method in any possible implementation of the first aspect described above.
[0063] Fourthly, a chip is provided for use in an electronic device; the chip includes one or more interface circuits and one or more processors; the interface circuits and processors are interconnected via lines; the interface circuits are used to receive signals from the memory of the electronic device and send signals to the processors, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device executes the refresh rate switching method in any possible implementation of the first aspect above.
[0064] Fifthly, an electronic device is provided, comprising a stylus. The electronic device performs the refresh rate switching method in any possible implementation of the first aspect described above.
[0065] In a sixth aspect, a computer storage medium is provided, including computer instructions that, when executed on an electronic device, cause the electronic device to perform the refresh rate switching method in any possible implementation of the first aspect described above.
[0066] In a seventh aspect, a computer program product is provided, which, when run on a computer, causes an electronic device to execute the refresh rate switching method in any possible implementation of the first aspect.
[0067] It is understood that the beneficial effects achieved by the apparatus 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 provided above can be referred to the beneficial effects of the first aspect and any possible implementation thereof, which will not be repeated here. Attached Figure Description
[0068] Figure 1 An abstract diagram of display timing provided for embodiments of this application;
[0069] Figure 2A waveform diagram showing the timing provided in an embodiment of this application;
[0070] Figure 3 A scenario diagram provided for an embodiment of this application;
[0071] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0072] Figure 5 A schematic diagram of the software structure of an electronic device provided in an embodiment of this application;
[0073] Figure 6 This application provides a schematic diagram of an event reporting path.
[0074] Figure 7 A schematic diagram of the software structure of another electronic device provided in an embodiment of this application;
[0075] Figure 8 A flowchart illustrating a refresh rate switching method provided in an embodiment of this application;
[0076] Figure 9 Module interaction diagram provided for embodiments of this application Figure 1 ;
[0077] Figure 10 Module interaction diagram provided for embodiments of this application Figure 2 ;
[0078] Figure 11 A flowchart illustrating another refresh rate switching method provided in an embodiment of this application;
[0079] Figure 12 A waveform diagram of a switching display timing provided in an embodiment of this application;
[0080] Figure 13 A waveform diagram of another switching display timing provided in an embodiment of this application;
[0081] Figure 14 Module interaction diagram provided for embodiments of this application Figure 3 ;
[0082] Figure 15 Module interaction diagram provided for embodiments of this application Figure 4 ;
[0083] Figure 16 Module interaction diagram provided for embodiments of this application Figure 5 ;
[0084] Figure 17 A flowchart illustrating another refresh rate switching method provided in an embodiment of this application;
[0085] Figure 18 This is a schematic diagram illustrating a usage scenario of a stylus provided in an embodiment of this application. Detailed Implementation
[0086] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "multiple" means two or more.
[0087] With the development of touch technology, more and more electronic devices are adopting touch for human-computer interaction. Users can input information into electronic devices not only by operating the screen with their fingers, but also by using a stylus, enabling the device to perform corresponding operations based on the input.
[0088] Furthermore, with the advancement of display technology, electronic devices have evolved from supporting fixed screen refresh rates, such as 30Hz and 60Hz, to supporting multiple screen refresh rates, such as simultaneously supporting 30Hz, 60Hz, 120Hz, and 144Hz, in order to optimize device power consumption while improving the smoothness of user experience.
[0089] However, due to hardware limitations, styluses are typically designed for electronic devices with a 60Hz refresh rate, and cannot handle higher refresh rates (such as 144Hz). Therefore, at a 144Hz refresh rate, electronic devices only support finger input events, not stylus input events; that is, at 144Hz, 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 stylus's intended use case.
[0090] However, current electronic devices typically switch between low and high refresh rates without considering the refresh rate limitations imposed by different touch methods. This results in devices simultaneously supporting both finger and stylus input events at various refresh rates. Consequently, in scenarios requiring stylus input or writing, blindly switching to a high refresh rate like 144Hz renders the screen unsupported for stylus input, providing users with an unresponsive stylus experience.
[0091] Therefore, when a user needs to use a stylus, the electronic device must switch its refresh rate to match the stylus's refresh rate. When the user does not need to use a stylus, the electronic device must switch its refresh rate to match the finger's refresh rate.
[0092] The significant timing difference between the refresh rate matched by the stylus and the refresh rate matched by the finger causes an excessively short idle time at the end of the frame when the electronic device switches to the refresh rate matched by the stylus. This results in insufficient idle time at the end of the frame when the electronic device subsequently needs to switch back to the refresh rate matched by the finger, leading to display abnormalities such as a distorted or black screen for one frame.
[0093] To address the aforementioned issues, this application provides a refresh rate switching method. The electronic device can not only switch the refresh rate normally to match the stylus when the user needs to use it, but also switch it normally to match the finger's refresh rate when the user does not need to use the stylus. Simultaneously, it ensures normal screen refresh during switching, avoiding display anomalies such as screen flickering or blackouts.
[0094] To facilitate the distinction between the processing and response to finger input events and stylus input events, in this embodiment of the application, the touch scenarios supported by the screen of the electronic device are divided into two touch modes: hand touch mode and stylus touch mode.
[0095] The hand touch mode indicates that the screen of an electronic device supports user input via finger gestures, allowing the device to perform corresponding operations based on these gestures. In other words, the screen of the electronic device can process and respond to finger input.
[0096] The stylus touch mode indicates that the screen of an electronic device supports input from both stylus and finger input. This allows the device to perform corresponding actions based on the input. In other words, the screen of the electronic device can process and respond to both finger and stylus input.
[0097] In this embodiment, 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 have overlapping or different parts. For example, the pen touch mode supports a 60Hz refresh rate but not a 144Hz refresh rate, while the hand touch mode supports both 60Hz and 144Hz refresh rates.
[0098] In some scenarios, for electronic devices that do not support high refresh rates, the refresh rate levels supported by the touch mode and the pen touch mode can be the same. For example, both pen touch mode and touch mode support 30Hz and 60Hz refresh rates. This application does not limit the refresh rates supported by each of the two touch modes.
[0099] In this embodiment, switching the refresh rate of the electronic device to match the stylus can mean switching the refresh rate to a level supported by the stylus touch mode. This ensures that the electronic device can support the processing and response to stylus input events at the switched refresh rate, thus guaranteeing the user's stylus experience.
[0100] 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 into the display panel to detect touch operations applied to or near it. In some embodiments, the TP may also be disposed on the surface of the electronic device, in a different location than the display panel.
[0101] Optionally, switching the refresh rate of an electronic device may include switching the screen display configuration. This ensures that the screen display panel can display correctly when the electronic device switches to a refresh rate that matches the stylus, avoiding display abnormalities.
[0102] The switching of screen display configurations in the aforementioned electronic devices can refer to switching the screen's display timing, which can be the order in which image data within a frame is displayed on the display panel. Different refresh rates within the same touch mode correspond to different display timings. For example, in hand-touch mode, the display timing of a 60Hz refresh rate differs from that of a 144Hz refresh rate. The same refresh rate also corresponds to different display timings in different touch modes. For instance, the display timing of a 60Hz refresh rate in hand-touch mode differs from that in pen-touch mode. Furthermore, different refresh rates within different touch modes also correspond to different display timings.
[0103] Optionally, switching the refresh rate of an electronic device may also include switching the screen touch configuration. This ensures that when the refresh rate of the electronic device is switched to match the stylus, the operating state of the screen's touch panel also matches the stylus, avoiding touch anomalies. This allows the user's stylus or finger to input normally.
[0104] The aforementioned switching of screen touch configuration in an electronic device can refer to switching the operating mode of the screen's touch firmware. The touch firmware runs internally within the touch panel (TP) and is used to acquire and report touch events. The operating mode of the touch firmware can indicate the types of touch input that the TP supports for detection (scanning). Optionally, the operating modes of the touch firmware can include firmware mode 1, which supports both stylus input scanning and finger input scanning, and firmware mode 2, which only supports finger input scanning.
[0105] It is understandable that when electronic devices need to switch to a refresh rate setting in pen touch mode, they also need to switch the working mode of the touch firmware to firmware mode 1 that supports stylus input scanning.
[0106] In other words, due to hardware limitations, the screen display configuration and screen touch configuration of the electronic device can differ under different touch modes. The supported refresh rate levels, anti-interference capabilities, and power consumption can all vary under different touch modes. For example, a 144Hz refresh rate only supports hand touch mode and not pen touch mode. Even at the same refresh rate, the screen display configuration and screen touch configuration differ between hand touch mode and pen touch mode.
[0107] It is understandable that for the hand touch mode, which only considers finger touch input, there is no need to distinguish between the input type of stylus and finger since stylus input is not required, nor is it necessary to add scanning for stylus input. This makes the screen display and screen touch configuration used in the hand touch mode have lower power consumption and stronger anti-interference ability compared to the screen display and screen touch configuration used in the pen touch mode.
[0108] Therefore, when an electronic device switches its refresh rate to a level supported by the pen touch mode, it needs to match the screen display configuration and screen touch configuration in the pen touch mode in order to achieve the corresponding switching of screen display configuration and screen touch configuration.
[0109] Optionally, if the refresh rate originally set by the electronic device is the refresh rate level supported by the touch mode, when switching to the refresh rate level supported by the pen touch mode, the electronic device needs to switch both the screen display configuration and the screen touch configuration because the touch mode has changed. This ensures that the screen display timing matches the refresh rate level supported by the pen touch mode, and that the screen touch firmware's operating mode matches the pen touch mode. In this way, it can be ensured that when the refresh rate of the electronic device is switched, not only can the screen display normally, but the user's stylus and fingers can also input normally.
[0110] Optionally, if the refresh rate originally set by the electronic device is the refresh rate level supported by the pen touch mode, when it is necessary to switch to another refresh rate level supported by the pen touch mode, such as switching from a 60Hz refresh rate to a 30Hz refresh rate in the pen touch mode, since the touch mode has not changed, the working mode of the screen's touch firmware remains unchanged and is still firmware mode 1. The electronic device can switch only the screen display configuration to ensure that the screen display timing matches the other refresh rate level (30Hz) supported by the pen touch mode.
[0111] Similarly, when an electronic device switches its refresh rate back to the refresh rate level supported by the touch mode, it also needs to switch the screen display configuration and screen touch configuration according to the corresponding touch mode.
[0112] Optionally, if the refresh rate originally set by the electronic device is the refresh rate level supported by the pen touch mode, when it needs to switch to the 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 screen display timing matches the refresh rate level supported by the hand touch mode, and that the working mode of the screen touch firmware matches the hand touch mode.
[0113] Optionally, if the refresh rate originally set by the electronic device is the refresh rate level supported by the touch mode, when it is necessary to switch to another refresh rate level supported by the touch mode, such as switching from a 144Hz refresh rate in the touch mode to a 60Hz refresh rate in the touch mode, since the touch mode has not changed, the working mode of the screen's touch firmware remains unchanged, still in firmware mode 2. The electronic device can switch only the screen display configuration to ensure that the screen display timing matches the other refresh rate level (60Hz) supported by the touch mode.
[0114] Please see Figure 1 This is an abstract diagram of a display timing provided in an embodiment of this application. The display timing can be used to indicate the timing of transmitting image data, and it can include vertical timing and horizontal timing.
[0115] In vertical timing, vertical synchronization (Vsync) indicates the arrival of a new frame. Before Vsync is the vertical front porch (VFP), and after Vsync is the vertical back porch (VBP). The image data for a given frame is located between adjacent VBPs and VFPs. This image data is transmitted line by line by the processor of the electronic device to the display panel for display.
[0116] In horizontal timing, horizontal synchronization (Hsync) can represent 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.
[0117] Depend on Figure 1 It is known that after transmitting the image data of the previous frame, it needs to pass through VFP before transmitting a new frame. During VFP, no image data is transmitted; this period can be understood as the frame end idle time. When transmitting a new frame, since VFP has already been passed, Vsync can be used to indicate the start of transmission. Vsync can be a pulse signal; when Vsync ends and VBP passes, the image data for that frame begins transmission. Each line of image data can be transmitted using a horizontal timing sequence. Figure 1 It can be seen that there is no image data transmission during Vsync, VFP, and VBP, but there is image data transmission between adjacent VFP and VBP. Therefore, the time between adjacent VFP and VBP is the time required to transmit one frame of image data, which can be called the effective display time.
[0118] When transmitting image data for a single frame, the image data can be transmitted line by line to the display panel for display. Similarly, when transmitting a line of image data, it first passes through the HFP, and then the Hsync signal indicates that the transmission of that line of image data has begun. The Hsync signal can be a pulse signal; when the Hsync signal ends and passes through the HBP, the transmission of that line of image data begins. Figure 1 It can be seen that there is no image data transmission between Hsync, HFP and HBP, but there is image data transmission between adjacent HBP and HFP. This time is the time required to transmit one line of image data, which can be called the display time per line.
[0119] Therefore, it can be seen that in the process of displaying a frame of image, in addition to the actual time for transmitting image data, it also includes the time occupied by Vsync, VFP, VBP, Hsync, HFP and HBP.
[0120] Currently, electronic devices typically use long vertical (Long-V) inter-frame touch driving to switch between different refresh rates in touch mode. Long-V allows for a constant effective display time (the time to transmit one frame of image data) in touch mode, and the refresh rate can be changed by altering the vertical front porch (VFP) parameter in the display timing, i.e., the length of the frame end idle time. Long-V supports dynamic refresh rate switching within the range of 60Hz to 120Hz. Specifically, Long-V is a touch driving mode for screens where a touch drive is performed again after one frame of image (display phase) has ended for touch detection.
[0121] It's understandable that, with the effective display time remaining constant, increasing the frame tail idle time allows for a longer display time for one frame, resulting in fewer frame refreshes per second and thus lowering the screen refresh rate. Conversely, decreasing the frame tail idle time shortens the display time for one frame, leading to more frame refreshes per second and thus increasing the screen refresh rate.
[0122] However, in pen touch mode, electronic devices can only support a maximum refresh rate of 60Hz and require stylus scanning. This causes significant changes in the effective display delivery time, resulting in a shorter idle time at the end of the frame in the display timing sequence. When switching refresh rates under these conditions, insufficient idle time at the end of the frame in the display timing sequence can lead to display errors during the switching process, such as a distorted or black screen.
[0123] For example, as shown in Table 1, this application provides a display timing sequence corresponding to different refresh rate levels under different touch modes:
[0124] Table 1
[0125]
[0126] As shown in Table 1, when an electronic device switches between refresh rates of 60Hz to 144Hz in touch mode, the effective display time remains unchanged, the display time per line remains unchanged, and timing parameters such as HBP, HFP, Hsync, Vsync, and VBP remain unchanged (or change only slightly) because there is no need to support stylus input scanning. The electronic device can change the refresh rate by altering the VFP parameter in the display timing. For example, when switching from a 120Hz refresh rate to a 60Hz refresh rate in touch mode, the electronic device can increase VFP from 26 to 2340 to complete the display timing switch.
[0127] However, as shown in Table 1, when an electronic device switches from a 60Hz refresh rate in 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 an increase in the display time per line. Since the electronic device needs to refresh and display one frame of image every 16.6 milliseconds (ms), the corresponding frame tail idle time becomes shorter when the effective display time increases.
[0128] 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 touch mode. Figure 2 (b) shows a schematic diagram illustrating the display timing of an electronic device refreshing and displaying a frame of image in pen touch mode. (Comparison) Figure 2 As can be seen from (a) and (b), although the refresh rate of both touch modes is 60Hz (i.e., the time to display one frame of image is 16.6ms), the effective display time required in pen touch mode is larger than that in hand touch mode, resulting in a shorter idle time at the end of the frame.
[0129] Since the display process of a single image frame can be divided into three stages—drawing and rendering, layer compositing, and screen refresh—displaying a single frame inherently requires processor resources and time. If a display timing switch is also performed, sufficient frame tail idle time is needed. This is especially true for screens that lack an internal frame buffer, such as those using video mode to transmit image data. In these cases, the processor must transmit each frame of image data to the display panel in real-time according to the refresh rate's display timing. Therefore, if the frame tail idle time is too short, the electronic device cannot simultaneously complete the normal switching of display timing and the normal display of the image, resulting in abnormal display of a single frame during timing switching.
[0130] 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, the electronic device cannot complete the normal switching of display timing and normal display of the image at the same time because the idle time at the end of the current frame is too short. As a result, an abnormal display of one frame of image occurs when switching timing.
[0131] Therefore, this 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 between different touch modes, it can forcibly change the layer composition method of the Nth frame image from mobile display processor (MDP) composition to graphics processing unit (GPU) composition, thereby reducing the load on the MDP. During the idle time at the end of the frame, the MDP only needs to complete the switching of display timing. Thus, even when the idle time at the end of the frame is insufficient, it can still complete the real-time switching of display timing and image display normally, avoiding display abnormalities.
[0132] Figure 3 This is a schematic diagram of a scenario applicable to an embodiment of this application. The scenario includes a stylus 100 and an electronic device 200. The stylus 100 can provide input to the electronic device 200, and the electronic device 200 performs an operation in response to the input based on the input from the stylus 100. Alternatively, a user can also provide input to the electronic device 200 using their finger, and the electronic device 200 performs an operation in response to the input based on the user's finger.
[0133] In this embodiment, the electronic device 200 can be a mobile phone, tablet computer, wearable device such as a smartwatch, smart bracelet, etc., smart home device such as a television, smart screen, game console, smart speaker, smart projector, smart TV box, in-vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc. This embodiment does not impose any special limitations on the specific device form of the electronic device 200. Figure 3 The following explanation uses a tablet computer as an example of electronic device 200.
[0134] The electronic device 200 includes a screen 201. The screen 201 may include a display panel and a touch panel TP. In some scenarios, the screen 201, consisting of the TP and the display panel, may also be referred to as a touch screen or a touch screen.
[0135] Display panels are used to display images, videos, etc. Display panels can be LCDs, organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), MiniLEDs, MicroLEDs, Micro-OLEDs, quantum dot light-emitting diodes (QLEDs), etc.
[0136] A TP, also known as a touch sensor, can be integrated into a display panel to detect touch operations applied to or near it. For example, it can detect touch operations by a finger or by a stylus 100. In some embodiments, the TP may also be located on the surface of the electronic device, in a different position than the display panel.
[0137] The aforementioned stylus 100 (also known as a pen) may be, but is not limited to, an inductive pen or a capacitive pen. Capacitive pens may include passive capacitive pens and active capacitive pens. Passive capacitive pens may be called passive capacitive pens, and active capacitive pens may be called active capacitive pens.
[0138] Optionally, when the stylus 100 is an inductive pen, an electromagnetic induction board can be integrated on the screen 201 of the electronic device 200 that interacts with the stylus 100. Coils are distributed on the electromagnetic induction board, and the inductive pen also integrates a coil. Based on the principle of electromagnetic induction, within the magnetic field range generated by the electromagnetic induction board, the inductive pen can accumulate electrical energy as it moves. The inductive pen can transmit the accumulated electrical energy to the electromagnetic induction board through free oscillation and its coil. The electromagnetic induction board can then scan the coils on the board based on the electrical energy from the inductive pen to calculate the position of the inductive pen on the screen 201.
[0139] Optionally, one or more electrodes may be provided in the active capacitive pen (e.g., within the pen tip), through which the active capacitive pen can emit signals. 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 can receive signals from the active capacitive pen through the electrode array, and then, upon receiving the signal, identify the position of the active capacitive pen on the screen 201 based on changes in the capacitance value on the screen 201.
[0140] In one embodiment, the stylus 100 and the electronic device 200 can be interconnected via a communication network to achieve wireless signal interaction. This communication network can be, but is not limited to, 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, etc. Optionally, the stylus 100 can also establish a wired connection with the electronic device 200 via a universal serial bus (USB) interface. This application does not limit the specific communication method between the stylus 100 and the electronic device 200.
[0141] Taking Bluetooth as an example of wireless connection, both the stylus 100 and the electronic device 200 can include a Bluetooth module with integrated Bluetooth functionality for communication via Bluetooth transmission.
[0142] In one possible implementation, the Bluetooth module of the stylus 100 can be always on. Optionally, the stylus 100 can also be equipped with a power switch. When the power is turned on, the Bluetooth module is powered on and can be discovered by nearby devices with Bluetooth modules. After the electronic device 200 enables Bluetooth, it can use its Bluetooth module to search for nearby Bluetooth devices within the Bluetooth transmission range, including the stylus 100. Optionally, the user can click to view the Bluetooth device list on the electronic device 200, and then select the icon of the stylus 100. This initiates the Bluetooth pairing process between the electronic device 200 and the stylus 100, and establishes a Bluetooth connection upon successful pairing.
[0143] In another possible implementation, when the user attaches the stylus 100 to the side bezel or screen 201 of the electronic device 200, the Bluetooth pairing and / or Bluetooth connection process between the stylus 100 and the electronic device 200 can also be triggered.
[0144] Optionally, when the user does not need to use the stylus 100, or the stylus 100 is not in pairing mode, or the remaining battery of the stylus 100 is low, the user can also directly bring the stylus 100 close to the electronic device 200 and rely on "strong magnetic attraction" to attach the stylus 100 to the frame of the electronic device 200 or the touch screen 11. For example, the stylus 100 can be attached to the long frame of the electronic device 200.
[0145] 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 application embodiment.
[0146] In some scenarios, electronic devices 200 may also be equipped with a storage compartment for storing the stylus 100 in order to facilitate storage of the stylus 100.
[0147] In some embodiments, the stylus 100 may also include a rechargeable battery, which can be wirelessly charged.
[0148] 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. In this configuration, the wireless charging coil of the stylus 100 can be coupled to the wireless charging coil of the electronic device 200, and wireless charging of the rechargeable battery can be achieved by sensing the alternating electromagnetic field emitted by the wireless charging coil 350 of the electronic device 200.
[0149] As an example, please refer to Figure 4 This is a schematic diagram of the structure of an electronic device 400 provided in an embodiment of this application. The electronic device 400 can be the same as the electronic device 200 described above.
[0150] like Figure 4 As shown, the electronic device 400 may include a processor 410, an external memory interface 420, an internal memory 421, a universal serial bus (USB) interface 430, a charging management module 440, a power management module 441, a battery 442, a wireless communication module 460, a sensor module 480, buttons 490, a motor 491, an indicator 492, a camera 493, a display screen 494, and a subscriber identification module (SIM) card interface 495, etc. The sensor module 480 may include a touch sensor 481.
[0151] It is 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 illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0152] Processor 410 may include one or more processing units, such as application processors (APs), modem processors, GPUs, image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0153] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0154] The processor 410 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 410 is a cache memory. This memory can store instructions or data that the processor 410 has just used or that are used repeatedly. If the processor 410 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 410, and thus improves the efficiency of the system.
[0155] In some embodiments, the processor 410 may include one or more interfaces. 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, etc.
[0156] The MIPI interface can be used to connect the processor 410 to peripheral devices such as the display screen 494. The MIPI interface includes a display pixel interface (DPI). In this embodiment, the processor 410 and the display screen 494 communicate via the DPI interface to realize the display function of the electronic device 400. The DPI interface can be used to send image data through a display timing sequence, which can be a MIPI timing sequence conforming to the MIPI protocol. The MIPI timing sequence is used to indicate the time order in which image data for a frame of an image is sent, so that the display screen 494 can receive the image data in an orderly manner and control the display screen 494 to display the image.
[0157] It is understood that the interface connection relationships between the modules illustrated in this embodiment are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0158] The charging management module 440 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 440 receives charging input from the wired charger via a USB interface 430. In some wireless charging embodiments, the charging management module 440 receives 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 supply power to the electronic device via the power management module 441.
[0159] In some embodiments, the electronic device 400 can support charging the stylus. The charging management module 440 can receive input from the battery 442 and convert the DC signal input from the battery 442 into an AC signal. This AC signal is transmitted to the wireless charging coil via a matching circuit. Upon receiving the AC signal, the wireless charging coil generates an alternating electromagnetic field. The stylus's wireless charging coil senses this alternating electromagnetic field and can then wirelessly charge.
[0160] The power management module 441 connects 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 to power the processor 410, internal memory 421, external memory, display screen 494, camera 493, and wireless communication module 460, etc. In some embodiments, the power management module 441 may also be located within the processor 410. In other embodiments, the power management module 441 and the charging management module 440 may be located in the same device.
[0161] The wireless communication function of the electronic device 100 can be realized through an antenna, a wireless communication module 460, a modem processor, and a baseband processor.
[0162] The wireless communication module 460 can provide solutions for wireless communication applications on the electronic device 400, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. 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 antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 410. The wireless communication module 460 can also receive signals to be transmitted from processor 410, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via 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.
[0163] In this embodiment of the application, the electronic device 100 implements the display function through a GPU, MDP, display screen 494, and application processor.
[0164] The GPU is a microprocessor for image processing, connected to the display screen 494 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. In this embodiment, the GPU can be used for the composite overlay of multiple layers.
[0165] The layer compositing and overlay methods include GPU compositing and hardware composer (HWC) compositing. When using HWC compositing, HWC can achieve layer compositing and overlay through the hardware device MDP. MDP is a dedicated display processor, mainly used to handle the hardware compositing and overlay of multiple layers, as well as display timing (i.e., MIPI timing) control.
[0166] Display screen 494 is used to display images, videos, etc. Display screen 494 can be the aforementioned screen 201. Display screen 494 includes a display panel. The display panel can be LCD, OLED, AMOLED, etc. The display panel can be coupled to processor 410 (such as an AP, system-on-chip (SOC)) via a MIPI interface. Thus, the display panel can receive image data sent from processor 410 via the MIPI interface.
[0167] This application embodiment takes an LCD as an example of a display panel, which may include a display driver integrated circuit (DDIC). The DDIC is used to receive image data sent through display timing and control the display panel to control the corresponding liquid crystal molecules based on each pixel in the display panel, so that the display panel displays the image data.
[0168] In this embodiment, the display screen 494 can be a touch screen. That is, the display screen 494 integrates a touch sensor 481. The touch sensor 481 can also be called a "touch panel TP". In other words, the display screen 494 can include a display panel and a touch panel TP. Therefore, the display screen 494 can also be called a "touchscreen".
[0169] Touch sensor 481 is used to detect touch operations applied to or near it. After a touch operation is detected by touch sensor 481, it can be passed to the upper layer by a kernel layer driver (such as a TP driver) to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 494. In some embodiments, touch sensor 481 may also be disposed on the surface of electronic device 400, in a different location than display screen 494.
[0170] Optionally, the display screen 494 can be used to display information input by the stylus. For example, the display screen 494 can be used to display the movement trajectory of the stylus. Optionally, the display screen 494 can also display an interface related to the stylus input based on the stylus input.
[0171] The external storage interface 420 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 410 through the external storage interface 420 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0172] Internal memory 421 can be used to store computer executable program code, which includes instructions. Processor 410 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 421. For example, in this embodiment, processor 410 can switch refresh rates by executing instructions stored in internal memory 421. Internal memory 421 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application required for a function, etc. The data storage area may store data created during the use of electronic device 100, etc. In addition, internal memory 421 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0173] The methods described in the following embodiments can all be implemented in an electronic device 400 having the above-described hardware structure.
[0174] The software system of electronic device 400 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 400.
[0175] Figure 5 This is a software structure block diagram of the electronic device 400 provided in this application embodiment. A layered architecture divides the software into several layers, each with a clear role and function. 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 called the driver layer).
[0176] The application layer can include a series of application packages. For example... Figure 5 As shown, the application layer can include multiple application packages such as Application 1 and Application 2. Examples include applications such as camera, drawing, calendar, games, maps, navigation, Bluetooth, music, video, SMS, and launcher.
[0177] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer includes predefined functions. For example, the framework layer may include a window manager, activity manager, content provider, view system, phone manager, resource manager, notification manager, etc. (not shown in the attached diagram).
[0178] In some embodiments, such as Figure 5 As shown, the framework layer may also include a scene recognition module, a frame rate control module, and a command issuance module.
[0179] The scene recognition module has the ability to sense external events and determine the current touch interaction scene of the electronic device based on the sensed external events. In this embodiment, the touch interaction scene includes a touch scene using a stylus and a touch scene using a finger.
[0180] In the embodiments of this application, such as Figure 5 As shown, the scene recognition module includes a stylus service module, which is used to determine whether the stylus is currently in use based on perceived external events, that is, to determine whether the electronic device is currently in a touch scene where the stylus is being used.
[0181] Optionally, the framework layer may include a wireless communication service module to provide 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 the identification of the current touch interaction scenario of the electronic device.
[0182] As an example, such as Figure 5 As shown, the scene recognition module may include a Bluetooth service module for detecting stylus connection events, i.e., whether the electronic device has established a Bluetooth connection with the stylus. When it is detected that the electronic device and the stylus are not connected via Bluetooth, it can be assumed that the stylus is not currently in use. Both the stylus and the electronic device may include Bluetooth modules to establish a Bluetooth connection.
[0183] Optionally, when the electronic device and the stylus establish a communication connection through other means, the scene recognition module may also include other communication services. For example, when the electronic device and the stylus are connected via Wi-Fi, the scene recognition module may also include a Wi-Fi service module to detect whether the electronic device and the stylus have established a Wi-Fi connection.
[0184] In this embodiment, the scene recognition module can also detect stylus status events from the kernel layer driver (such as a wireless charging driver) via an API. These status events can be charging events, full charge and charging stopped events, magnetic attraction events, and events where the stylus is moved away (not attracted). Therefore, the stylus service module can determine whether the stylus is currently in use, i.e., whether the electronic device is currently in a touch scenario where the stylus is being used, based on these stylus status events and the aforementioned connection events.
[0185] After determining whether the stylus is currently in use, the stylus service module can send the stylus status information to the frame rate control module to determine the appropriate screen refresh rate for the current touch scenario of the electronic device. The frame rate control module is responsible for controlling the switching of the screen refresh rate.
[0186] like Figure 5 As shown, the frame rate control module includes a display control module, which is used to match the screen refresh rate level supported in the current touch scenario based on the detected stylus usage status and the current screen refresh rate, so as to control the display panel of the screen to switch to the screen refresh rate level corresponding to the touch scenario.
[0187] The 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 supported in hand touch mode may differ from that supported in pen touch mode. Therefore, the frame rate control module needs to switch the screen refresh rate according to the current touch scenario.
[0188] 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 needs to match not only the corresponding refresh rate but also the corresponding touch mode to control the display panel to switch to the refresh rate supported by the corresponding touch mode. This refresh rate switching can be achieved by controlling the display panel's timing. Different refresh rates under different touch modes correspond to different display timings.
[0189] After determining the appropriate screen refresh rate for the current touch scenario, the display control module can send a refresh rate switching command to the command sending module, which in turn sends the refresh rate switching command to the kernel-level driver (such as the display driver) to complete the refresh rate switching.
[0190] In this embodiment of the application, the framework layer may include a layer compositing service (SurfaceFlinger) and a hardware compositor (HWC).
[0191] SurfaceFlinger is a special process primarily responsible for blending all layers (Surfaces) in a single image frame. Based on parameters such as transparency, size, and position, SurfaceFlinger calculates the position of each Surface within a frame, then passes this information to a hardware compositor or GPU to generate the final image for display. In other words, the display of a single image frame can be accomplished collaboratively by SurfaceFlinger, HWComposer, and the display screen.
[0192] HWC is a module in the Android system for layer compositing, overlaying, and displaying, providing hardware support for SurfaceFlinger. In other words, HWC has the functionality or capability to perform layer compositing, overlaying, and display using hardware.
[0193] In this embodiment, SurfaceFlinger provides all soft layer information to HWC and queries HWC for processing methods. HWC can determine the layer compositing method—whether to use hardware HWC compositing or GPU compositing—based on whether the touch scene changes. When HWC compositing is used, HWC can call the hardware device display processor (MDP) to perform layer compositing and overlay. Then, HWC can output the composited image data to the display screen for display. It should be noted that SurfaceFlinger only ends the image compositing task after obtaining the composited image through the underlying MDP hardware.
[0194] In this embodiment, the instruction issuing module can use SurfaceFlinger and HWC to send refresh rate switching instructions to the kernel layer driver (such as the display driver) to complete the refresh rate switching.
[0195] The refresh rate switching process can include: after the display control module determines the screen refresh rate suitable for the current touch scenario, it sends a refresh rate switching command to SurfaceFlinger. SurfaceFlinger sends the refresh rate switching command to HWC, and HWC sends the refresh rate switching command to the display driver. After receiving the refresh rate switching command, the display driver notifies the display driver chip (such as DDIC) to switch to the target refresh rate. The display driver chip drives the display panel (such as LCD) to complete the screen refresh rate switching and refresh the image display at the new screen refresh rate.
[0196] In this embodiment, the electronic device switches the screen refresh rate, which may include switching the refresh rate of the display panel and also switching the operating mode of the touch panel. The operating mode of the touch firmware may include firmware mode 1, which supports both stylus input scanning and finger input scanning, and firmware mode 2, which only supports finger input scanning.
[0197] like Figure 5 As shown, the frame rate control module may also include a touch control module, which is used to match the working mode of the touch panel's touch firmware in the current touch scenario according to the detected stylus usage status.
[0198] After determining the appropriate working mode for the touch firmware in the current touch scenario, the touch control module can notify the kernel layer driver (such as the touch driver) to complete the switching of the touch firmware's working mode.
[0199] Optionally, the display driver and touch driver at the kernel layer can be simultaneously notified to complete the refresh rate switch and the touch firmware mode switch. This simultaneous notification can refer to simultaneously notifying the touch driver to complete the touch firmware working mode switch when the kernel controls the display driver to complete the refresh rate switch of the display panel.
[0200] Optionally, the display driver and touch driver at the kernel layer can be notified asynchronously to complete the refresh rate switch and touch firmware mode switch. Asynchronous notification can refer to triggering the refresh rate switch of the display panel and the working mode switch of the touch firmware at the frame layer.
[0201] The kernel layer is the layer between hardware and software. It drives the hardware, enabling it to function. The hardware of an electronic device can include touch panels, display panels, wireless charging coils, and so on. Ultimately, all the functions of the Android operating system are implemented through the kernel layer.
[0202] In this embodiment, the kernel layer includes at least a display driver, a touch driver, and a wireless charging driver. This embodiment does not impose any limitations on these components. In one embodiment, when the electronic device supports Bluetooth, the kernel layer may further include a Bluetooth driver.
[0203] A display driver can drive a display panel to work. The display panel may include a display driver chip (e.g., DDIC), and the display driver is used to drive the DDIC to complete the processing and implementation of image display on the display panel.
[0204] In this embodiment of the application, the display driver can also be used to drive the DDIC to complete the switching of the screen refresh rate.
[0205] like Figure 5 As shown, the display driver may include a GPU compositing module, an MDP compositing module, an MDP display switching module, and an MDP display sending driver. The display driver controls whether the layer overlay compositing is performed by the GPU compositing module or the MDP compositing module. The MDP display switching module controls the display timing of the display panel according to the issued refresh rate switching command. The MDP display sending driver sends image data to the DDIC according to the display timing to drive the DDIC to display the image data.
[0206] Taking user launching application A as an example, after the user launches application A, the display screen will show 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 blending of all layers in the interface. SurfaceFlinger sends the display parameters of the interface (such as memory address, color, etc.) to HWC for interface blending through an interface. Typically, in image compositing, HWC obtains the composite image by calling the underlying hardware MDP based on the display parameters of each interface. HWC sends the composite image from the underlying hardware MDP to the display driver at the kernel level. The display driver at the kernel level gives the composite image to the display driver chip at the hardware level, and the display driver chip at the hardware level sends the composite image to the display panel for display. Following the above method, the display panel can complete the refresh and display process of one frame of image.
[0207] In this embodiment, if screen refresh rate switching between different touch modes is required when refreshing and displaying the Nth frame image, the HWC can forcibly change the layer composition method of the Nth frame image to GPU composition and send instructions to the kernel-level driver (such as the display driver) to control the GPU composition module to implement the layer composition of the Nth frame image. This reduces the load on the MDP, which is only responsible for the display timing switching of the display panel.
[0208] The touch driver can operate on a touch panel (TP). This touch panel runs touch firmware, and the touch driver can be used to drive the touch firmware to acquire touch events and report the acquired touch events.
[0209] In this embodiment, the touch driver can also be used to drive the touch firmware to switch operating modes. The operating modes may include firmware mode 1 and firmware mode 2 as described above. In some embodiments, when a screen refresh rate switch between different touch modes is detected, the touch control module can send instructions to the kernel-level driver (such as the touch driver) to drive the touch firmware to switch operating modes.
[0210] The wireless charging driver (also known as the wireless charging management module) is used to drive the wireless charging coil to wirelessly charge other devices (such as styluses). In this embodiment, the wireless charging driver can be used to report stylus status events, such as a full charge stop event, a magnetic attraction event, or a distance (not magnetic) event.
[0211] Taking wireless charging of a stylus by an electronic device as an example, the electronic device can control its battery to output current to its wireless charging coil via a wireless charging chip. This allows the 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 induces 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.
[0212] like Figure 6 As shown, when the wireless charging chip of an electronic device detects a stylus's attraction event (attaching to the electronic device from a distanced state), a full charge / charging stop event (fully charged while attached to the electronic device), or a distance event (moving away from the charging stop state), an interrupt signal can be generated. This triggers the kernel-level chip driver to handle the interrupt process and notify the wireless charging driver of the relevant events. The wireless charging driver then reports these events to the stylus service, ultimately enabling stylus usage status recognition. In some scenarios, the wireless charging driver can also report relevant status events to the Bluetooth service, which in turn reports the stylus's status and connection events to the stylus service.
[0213] Typically, wireless charging chips remain in a low-power Q-scanning mode after powering on or stopping charging. In this mode, the chip periodically samples the Q-value of the wireless charging coil. The Q-value is a parameter indicating the efficiency and quality of wireless charging. When a stylus moves from a distant position to attach to an electronic device, the wireless charging chip detects a change in the Q-value of the wireless charging coil. At this point, the chip generates an interrupt signal to notify the wireless charging driver via its interrupt procedure. The driver then reports the attachment event to the stylus service, or to the Bluetooth service, which in turn reports it to the stylus service.
[0214] After the stylus is fully charged by attaching to the electronic device, it enters a state of being attached but not charging. When the stylus moves away from this state, the wireless charging chip detects a change 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 driver's interrupt process. The wireless charging driver then reports the event of moving away during the attachment-to-charge-stop state to the stylus service, or to the Bluetooth service, which in turn reports it to the stylus service.
[0215] It's understandable that events like stylus attachment and disengagement during charging can be identified and reported promptly via Q scanning. However, for events like stylus disengagement during charging, currently, a report is only made after an error timeout packet (cep_timeout) is detected.
[0216] Currently, to ensure smooth wireless charging, the stylus and electronic device need to transmit data packets within a specified time. These data packets can be control error packets (CEPs). If the electronic device does not receive the data packet within the specified time, it can detect a timeout error packet (cep_timeout), at which point the electronic device can assume the stylus has moved away. However, the detection of cep_timeout itself has a delay (e.g., 1.5 seconds). Therefore, for events where the stylus moves away during magnetic charging, cep_timeout cannot be used to report them in a timely manner. This means that when the user first uses the stylus, the electronic device cannot immediately recognize the stylus's usage status and cannot promptly switch refresh rates or touch firmware modes, leading to touch abnormalities and affecting the user experience.
[0217] To address the aforementioned issues, this application embodiment incorporates a fully charged but not charging state to identify the stylus's usage status.
[0218] Specifically, after the stylus is fully charged after being attached to the electronic device, it enters a charging-off state. At this time, the stylus can notify the electronic device's wireless charging coil of a fully charged 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 to notify the wireless charging driver through the chip driver's interrupt process. The wireless charging driver then reports the fully charged event to the stylus service, or to the Bluetooth service, which further reports it to the stylus service. Thus, the stylus service identifies 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, enabling intelligent switching of the corresponding refresh rate and touch firmware mode under different touch scenarios.
[0219] It is understood that the embodiments of this application do not limit the structure of the framework layer and the kernel layer. The framework layer may include more service modules, and the kernel layer may include more driver processing modules.
[0220] For example, such as Figure 7As shown, the framework layer can also include a whitelist service, which allows applications to configure corresponding touch modes. For example, for some game applications that do not require a stylus, the touch mode can be forcibly configured as hand touch mode. For some stylus-using applications, such as drawing and note-taking, the touch mode can be forcibly configured as pen touch mode.
[0221] Optionally, the whitelist service may store a whitelist of applications corresponding to hand touch mode and a whitelist of applications corresponding to pen touch mode.
[0222] like Figure 7 As shown, 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.
[0223] As one approach, the frame rate control module can prioritize determining the appropriate screen refresh rate for the current touch scenario of the electronic device based on the touch scenarios configured in the whitelist service. When no corresponding touch scenario is configured in the whitelist service, the appropriate screen refresh rate is determined based on the stylus status information sent by the stylus service.
[0224] It is understood that the software structure illustrated in the embodiments of this application does not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer layers than illustrated, or each layer may have 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 described above may be arranged at the application layer.
[0225] The methods described in the following embodiments can all be implemented in an electronic device 400 having the above-described software structure.
[0226] The following will use electronic devices as an example to specifically illustrate the technical solutions provided in the embodiments of this application.
[0227] like Figure 8 As shown in the embodiments of this application, a refresh rate switching method may include:
[0228] S800: When the electronic device starts refreshing and displaying the Nth frame of the image, a first refresh rate switching command is detected.
[0229] The electronic device supports both hand touch mode and pen touch mode. In pen touch mode, the electronic device supports a first refresh rate, while in 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.
[0230] In some embodiments, the aforementioned first refresh rate switching instruction can be used to indicate switching from a first refresh rate in pen touch mode to a second refresh rate in hand touch mode.
[0231] When an electronic device detects a first refresh rate switching command, it can determine that a refresh rate switch between different touch modes is required. Since the refresh rate switching between different touch modes is handled by the Display Processor (MDP), switching from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode would place an excessive load on the MDP if the image frame layer compositing processing were still performed by the MDP. This could lead to abnormal image frame delivery due to excessively short frame tail times. Therefore, in this embodiment, the layer compositing processing can be offloaded to the Graphics Processing Unit (GPU) to reduce the MDP load; the MDP only needs to handle the refresh rate switching.
[0232] 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 upon detecting a Vsync signal. It is understood that if the electronic device detects a first refresh rate switching command when it starts refreshing and displaying a new frame of image, such as the Nth frame, it can execute the refresh rate switching method provided in the embodiments of this application.
[0233] Optionally, the electronic device can identify the current touch scenario and match the refresh rate of the corresponding touch mode based on the identified touch scenario. If the refresh rate of the matched touch mode is different from the refresh rate of the touch mode currently being used by the electronic device, the electronic device can trigger a refresh rate switch. If the triggered refresh rate switch is a switch from the refresh rate supported by the pen touch mode to the refresh rate supported by the hand touch mode, then the detection of the first refresh rate switch command can be confirmed.
[0234] 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, and can have some overlap or no overlap at all.
[0235] Each touch mode can be pre-associated with a corresponding screen refresh rate through a mapping table. This allows the electronic device to match a suitable screen refresh rate based on the detected touch scenario and the pre-defined mapping table. This mapping table can be pre-stored in the electronic device.
[0236] For example, as shown in Table 2, there are 1 to 4 matching screen refresh rates in the hand touch mode (identified by number 1), and there is one matching screen refresh rate in the pen touch mode (identified by number 2).
[0237] Table 2
[0238]
[0239] As an example, the aforementioned first refresh rate switching instruction could be used to indicate switching from the 60Hz level in pen touch mode (identified by number 2-1) to the 60Hz level in hand touch mode (identified by number 1-2).
[0240] As another example, the aforementioned first refresh rate switching instruction can also be used to indicate switching from the 60Hz level in pen touch mode (identified by serial number 2-1) to the 144Hz level in hand touch mode (identified by serial number 1-4).
[0241] In other embodiments, the aforementioned first refresh rate switching instruction can also be used to indicate a switch from the second refresh rate in touch mode to the first refresh rate in pen touch mode. For example, the aforementioned first refresh rate switching instruction can be used to indicate a switch from the 60Hz level in touch mode (identified by numbers 1-2) to the 60Hz level in pen touch mode (identified by numbers 2-1). As another example, the aforementioned first refresh rate switching instruction can also be used to indicate a switch from the 144Hz level in touch mode (identified by numbers 1-4) to the 60Hz level in pen touch mode (identified by numbers 2-1).
[0242] Optionally, the electronic device can identify the current touch scenario and match the refresh rate of the corresponding touch mode based on the identified touch scenario. If the refresh rate of the matched touch mode is different from the refresh rate of the touch mode currently being used by the electronic device, the electronic device can trigger a refresh rate switch. If the triggered refresh rate switch is a switch from the refresh rate supported by the hand touch mode to the refresh rate supported by the pen touch mode, then the detection of the first refresh rate switch command can be confirmed.
[0243] In some embodiments, the electronic device can identify the current touch scenario based on whether the stylus is in use.
[0244] In some embodiments, the electronic device may also identify the current touch scene based on the touch scene configured in the application whitelist.
[0245] In some embodiments, the electronic device may also identify the current touch scene by combining whether the stylus is in use and the touch scenes configured in the application whitelist. This application embodiment does not limit the method by which the electronic device identifies the current touch scene.
[0246] In some embodiments, when an electronic device triggers a refresh rate switch, it can also trigger a switch in the operating mode of the touch firmware.
[0247] Optionally, the electronic device can identify the current touch scenario and match the operating mode of the touch firmware in the corresponding touch mode based on the identified touch scenario. 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 can 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. The operating modes of the matching touch firmware for each touch mode can be pre-associated through a correspondence table, so that the electronic device can match the appropriate operating mode of the touch firmware for the current touch scenario based on the pre-defined correspondence table. This correspondence table can be pre-stored in the electronic device.
[0249] For example, as shown in Table 3, the hand touch mode (identified by number 1) has 1 to 4 matching screen refresh rates and one touch firmware working mode, while the pen touch mode (identified by number 2) has 1 to 3 matching screen refresh rates and one touch firmware working mode.
[0250] Table 3
[0251]
[0252] When an electronic device detects a change in the touch scenario, such as a change from hand touch mode to pen touch mode, the device can match the corresponding touch firmware operating mode—firmware mode 2—based on the changed touch scenario (pen touch mode) and send relevant instructions to the kernel-level touch driver to switch the touch firmware's operating mode to firmware mode 2. Similarly, when changing from pen touch mode to hand touch mode, the device can match the corresponding touch firmware operating mode—firmware mode 1—based on the changed touch scenario (hand touch mode) and send relevant instructions to the kernel-level touch driver to switch the touch firmware's operating mode to firmware mode 1.
[0253] S810, in response to the first refresh rate switching instruction, the electronic device performs layer compositing processing on the Nth frame image through the GPU to obtain the image to be displayed.
[0254] In this embodiment, 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 compositing method of the Nth frame image to GPU compositing. Thus, the electronic device can obtain the GPU-composited and overlaid image to be transmitted to the display screen.
[0255] Optionally, when the electronic device begins 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 query HWC for processing methods. Since different refresh rate switching modes are required, HWC can, according to the first refresh rate switching instruction, force all layer composition methods marked on all layers to be set to GPU composition, so that the GPU can composite and overlay all layers of the Nth frame image, ultimately forming a frame of image to be transmitted to the display screen.
[0256] In some embodiments, when the first refresh rate switching instruction detected in the Nth frame image indicates a switch from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode, since the frame end idle time in pen touch mode is too short, it is necessary to forcibly change the layer composition method of the current image to GPU composition in order to reduce the MDP load.
[0257] In some embodiments, when the first refresh rate switching command detected in the Nth frame image indicates a switch from the second refresh rate in hand touch mode to the first refresh rate in pen touch mode, since the frame end idle time in hand touch mode is usually sufficient, such as Figure 2 As shown in (a), for this refresh rate switching scenario, it is not necessary to forcibly change the layer composition method of the current image to GPU composition; it can still be performed by MDP. In this case, in response to the first refresh rate switching instruction, the electronic device still performs layer composition processing on the Nth frame image through MDP to obtain the image to be displayed. Of course, for this refresh rate switching scenario, it is also possible to forcibly change the layer composition method of the current image to GPU composition to reduce the load on MDP. Thus, refresh rate switching scenarios from hand to pen and from pen to hand can be processed without distinction, or they can be processed differently. This application does not limit this aspect.
[0258] S820, in response to the first refresh rate switching command, the electronic device switches the screen refresh rate of the display from the first refresh rate to the second refresh rate via MDP.
[0259] In this embodiment, when the first refresh rate switching command detected in the Nth frame image indicates a switch from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode, the electronic device can determine that the Nth frame image needs to undergo a refresh rate switch between different modes. Therefore, the electronic device can control the display timing switching via MDP to change the screen refresh rate from the first refresh rate to the second refresh rate by altering the display timing parameters.
[0260] In this embodiment, the display timings corresponding to different refresh rates under different touch modes can be pre-associated through a correspondence table, as shown in Table 2. Therefore, when an electronic device needs to switch refresh rates, it can determine the matching display timings based on the pre-defined correspondence table, and thus complete the refresh rate switching based on the matched display timings.
[0261] For example, taking the switch from 60Hz in pen touch mode to 60Hz in hand touch mode as an example, referring to Table 2, it can be determined that the display timing corresponding to the 60Hz level in pen touch mode has changed compared to the display timing corresponding to the 60Hz level in hand touch mode. Therefore, the electronic device can reduce HBP from 318 to 20, HFP from 20 to 19, and VFP from 26 to 2340 in the display timing corresponding to the current 60Hz level in pen touch mode. This reduces the effective display time and increases the frame end space, but the time to refresh and display one frame of image remains unchanged at 16.6ms. For example, see... Figure 2 The display timing diagram corresponding to the 60Hz setting in pen touch mode shown in (b) is shown in the figure. Figure 2 The diagram (a) shows the display timing for the 60Hz setting in touch mode. It ensures that the current display timing still meets the 60Hz screen refresh rate. This achieves the switching of the display timing, allowing the electronic device to transmit image data to the display screen according to the switched display timing, thus enabling the displayed image to be refreshed at the switched 60Hz screen refresh rate matched to finger touch.
[0262] Understandable, such as Figure 2 As shown in (b), the frame tail time in the display timing corresponding to the 60Hz level in pen touch mode is too short. When switching to the 60Hz level in hand touch mode, which has a larger timing difference, the MDP cannot simultaneously complete the image frame layer compositing process and the display timing switch corresponding to the refresh rate. However, in this embodiment, since the image frame layer compositing process is forcibly handled by the graphics processing unit (GPU), the load on the MDP is reduced. Therefore, the MDP can successfully complete the display timing switch corresponding to the refresh rate within the short frame tail time. In this way, the normal display of the image frame is ensured, and the refresh rate switch is also completed.
[0263] In some embodiments, when the first refresh rate switching command detected by the Nth frame image indicates a switch from the second refresh rate in hand-touch mode to the first refresh rate in pen-touch mode, the electronic device can also determine that the Nth frame image needs to undergo a refresh rate switch between different modes. Thus, the electronic device can control the switching of display timing via MDP to switch the screen refresh rate from the second refresh rate to the first refresh rate by changing the display timing parameters.
[0264] For example, switching from a 60Hz refresh rate in touch mode to a 60Hz refresh rate in pen touch mode. Referring to Table 2, the display timing for the 60Hz refresh rate in touch mode is determined. Compared to the 60Hz refresh rate in pen touch mode, HBP, HFP, and VFP have changed. Therefore, the electronic device can increase HBP to 318, HFP to 20, and decrease VFP to 26 in the current 60Hz refresh rate display timing. This increases the effective display time and shortens the frame tail space, but the time to refresh and display one frame remains unchanged at 16.6ms. This ensures that the current display timing meets both the 60Hz screen refresh rate and supports the scanning of stylus input. This achieves the switching of the display timing, and the electronic device transmits image data to the display screen according to the switched display timing, thus achieving a 60Hz screen refresh rate that matches the stylus.
[0265] Understandable, such as Figure 2 As shown in (a), the frame tail time in the display timing corresponding to the 60Hz level in the hand touch mode is sufficient. Therefore, in this embodiment, when it is necessary to switch to the 60Hz level in the pen touch mode with a large timing difference, the MDP can simultaneously complete the layer compositing processing of the image frame and the display timing switching corresponding to the refresh rate, or it can force the layer compositing processing of the image frame to be executed by the graphics processor GPU, and the MDP only completes the display timing switching corresponding to the refresh rate.
[0266] S830: The electronic device displays the image to be displayed at a second refresh rate.
[0267] In this embodiment, when the first refresh rate switching command 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 MDP, can transmit the data of the image to be displayed, formed by GPU compositing of the Nth frame image, to the display screen for display through the switched display timing. Since MDP only needs to implement refresh rate switching, and layer compositing processing is performed by the GPU, even if the frame tail space time after the display timing switch is too short, the electronic device can still normally complete the display timing switch and the normal display of the Nth frame image.
[0268] For example, such as Figure 9As shown, when the Nth frame image is refreshed and displayed during the kernel stage, if the display driver of the electronic device receives the first refresh rate switching instruction, it can drive the GPU compositing module to complete the compositing and overlay of the layers of the Nth frame image, and drive the MDP display switching module to complete the corresponding display timing switch. After the GPU compositing of the Nth frame image is completed and the display timing switch is finished, the MDP display driver (MDP MIPI driver) is controlled to transmit the GPU-composited image to be displayed to the display panel (such as LCD) through the MIPI interface according to the switched display timing.
[0269] The display panel may include a display driver chip (DDIC) for receiving data of the image to be displayed sent through the display timing sequence, and controlling the display panel to control the corresponding liquid crystal molecules based on each pixel in the display panel, so that the display panel displays the image to be displayed.
[0270] It's understandable that since the Nth frame has already completed the display timing switch (screen refresh rate switch), when the electronic device starts refreshing and displaying the N+1th frame, there's no need to perform another display timing switch, and the N+1th frame can revert to its original layer composition method. For example, all layers of the N+1th frame can be composed using MDP.
[0271] For example, such as Figure 10 As shown, when refreshing and displaying the N+1th frame image during the kernel stage, the electronic device's display driver does not receive the first refresh rate switching instruction. Therefore, it does not need to drive the MDP display switching module to complete the corresponding display timing switch, and the original layer compositing method can be restored, that is, the MDP compositing module is driven to complete the compositing and overlaying of the layers of the N+1th frame image. After the MDP compositing of the N+1th frame image is completed, the MDP display driver (MDP MIPI driver) is then controlled to transmit the MDP-composited image to be displayed to the display panel (such as LCD) through the MIPI interface according to the switched display timing.
[0272] It is understandable that the (N-1)th frame image is still refreshed and displayed at the screen refresh rate before the switch. When the kernel stage refreshes and displays the (N-1)th frame image, the electronic device's display driver still uses the original layer compositing method, that is, the MDP compositing module is driven to complete the compositing and overlay of the layers of the (N-1)th frame image. After the MDP compositing of the (N-1)th frame image is completed, the MDP display driver (MDP MIPI driver) is controlled to transmit the MDP-composited image to be displayed to the display panel (such as an LCD) via the MIPI interface according to the display timing before the switch.
[0273] In some embodiments, when the first refresh rate switching instruction detected by the Nth frame image indicates a switch from the second refresh rate in hand-touch mode to the first refresh rate in pen-touch mode, if the layer compositing processing of the Nth frame image is also forcibly delegated to the graphics processing unit (GPU), then after the electronic device controls the switching of the display timing via the MDP, it can transmit the data of the image to be displayed formed by the GPU compositing of the Nth frame image to the display screen for display through the switched display timing. If the Nth frame image retains its original layer compositing method, such as layer compositing performed by the MDP, then after the electronic device simultaneously controls the switching of the display timing via the MDP, it can transmit the data of the image to be displayed formed by the MDP compositing of the Nth frame image to the display screen for display through the switched display timing.
[0274] In some scenarios, when an electronic device starts to refresh and display the Nth frame of the image, if a first refresh rate switching command is detected, the electronic device can also start to respond to the first refresh rate switching command during the refresh and display of the next frame, i.e., the N+1th frame of the image. That is, the switch from the first refresh rate to the second refresh rate is completed during the refresh and display of the N+1th frame of the image.
[0275] It is understood that the above embodiments mainly use the example of switching the refresh rate from pen touch mode to hand touch mode to introduce the refresh rate switching method under different touch modes. The same principle can be used to switch the refresh rate from hand touch mode to pen touch mode.
[0276] For example, when an electronic device begins refreshing and displaying the Nth frame of the image, if a second refresh rate switching command is detected, this command can be used to instruct a switch from the second refresh rate in touch mode to the first refresh rate in pen touch mode. In response to the second refresh rate switching command, the electronic device can perform layer compositing processing on the Nth frame of the image using the GPU to obtain the image to be displayed, and then switch the screen refresh rate from the second refresh rate in touch mode to the first refresh rate in pen touch mode via MDP. Thus, the electronic device can display the image to be displayed at the first refresh rate.
[0277] This application provides a refresh rate switching method that, when switching between different refresh rate modes, switches the image frame layer compositing processing, originally performed by the Display Processor (MDP), to be performed by the Graphics Processor (GPU). This reduces the MDP load, as only the MDP display timing switching needs to be completed during frame idle periods, without simultaneous MDP compositing. This ensures that image frames are delivered in a timely manner, avoiding the problem of a single frame failing to display correctly during the switching process.
[0278] In some embodiments, when the first refresh rate and the second refresh rate are the same, it can be considered that the refresh rate switching triggered by the electronic device only involves the switching of the touch mode and does not change the specific frame rate level. That is, the time for refreshing and displaying each frame of the image remains unchanged before and after the switch. For example, switching from 60Hz in pen touch mode to 60Hz in hand touch mode. When the display driver completes the refresh rate switching, it only involves the switching of the touch mode and does not change the specific frame rate (which remains at 60Hz). That is, the time for refreshing and displaying each frame of the image remains unchanged at 16.6ms before and after the switch.
[0279] In some embodiments, when the first refresh rate and the second refresh rate are different, it can be considered that the refresh rate switching triggered by the electronic device involves not only the switching of the touch mode but also the switching of the specific frame rate level, that is, the time for refreshing and displaying each frame of the image changes before and after the switch. For example, switching from 144Hz in hand touch mode to 60Hz in pen touch mode. When the display driver completes the refresh rate switching, it involves not only the switching of the touch mode but also the switching of the specific frame rate level (from 144Hz to 60Hz), that is, the time for refreshing and displaying each frame of the image before the switch is 6.9ms, and the time for refreshing and displaying each frame of the image after the switch is 16.6ms.
[0280] In this embodiment of the application, for scenarios involving both touch mode switching and frame rate level switching, if the hardware of the electronic device can support simultaneous touch mode switching and frame rate level switching, the electronic device can directly switch from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode, or from the second refresh rate in hand touch mode to the first refresh rate in pen touch mode, during the refresh display process of the Nth frame.
[0281] For example, when an electronic device begins refreshing and displaying the Nth frame of an image, it detects a first refresh rate switching command indicating a switch from a first refresh rate in pen touch mode to a second refresh rate in touch mode. In response to the first refresh rate switching command, the electronic device performs layer compositing processing on the Nth frame of the image using the GPU to obtain the first image to be displayed. It then switches the screen refresh rate from the first refresh rate in pen touch mode to the second refresh rate in touch mode via MDP. Thus, the electronic device displays the first image at the second refresh rate in touch mode.
[0282] In this embodiment of the application, if the hardware of the electronic device cannot support the simultaneous switching of touch mode and frame rate level, the electronic device can also perform the switching of touch mode and frame rate level separately.
[0283] In some embodiments, when the aforementioned first refresh rate switching instruction is used to indicate switching from the second refresh rate in hand touch mode to the first refresh rate in pen touch mode, the electronic device can first switch the frame rate level and then switch the touch mode. This completes the switching between different refresh rates under different touch modes.
[0284] Please see Figure 11 This application provides another refresh rate switching method, which may include:
[0285] S1100 When the electronic device starts to refresh and display the Nth frame image, a first refresh rate switching command is detected.
[0286] In this embodiment, the electronic device supports a first refresh rate in pen touch mode and a second refresh rate in hand touch mode. The first refresh rate and the second refresh rate are different.
[0287] In some embodiments, the aforementioned first refresh rate switching instruction is used to indicate a switch from a second refresh rate in touch mode to a first refresh rate in pen touch mode. For example, the aforementioned first refresh rate switching instruction may be used to indicate a switch from a 144Hz level in touch mode to a 60Hz level in pen touch mode. The electronic device in touch mode may support both 60Hz and 144Hz.
[0288] When an electronic device detects the first refresh rate switching command, it can determine that a switch between different refresh rates for different touch modes is required. Since switching between different refresh rates for 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 different touch modes to the same refresh rate level, and then achieve touch mode switching within the same refresh rate level.
[0289] For example, when the first refresh rate switching command is used to indicate a switch from the 144Hz level in touch mode (identified by numbers 1-4) to the 60Hz level in pen touch mode (identified by number 2-1), as shown in Table 3, the electronic device can first reduce the frame rate level to the 60Hz level in touch mode (identified by numbers 1-2), and then switch the touch mode at the same refresh rate level, that is, switch from the 60Hz level in touch mode (identified by numbers 1-2) to the 60Hz level in pen touch mode (identified by number 2-2). The switching order is 1-4>1-2>2-2.
[0290] It's understandable that, because some refresh rate levels supported by the touch mode (such as 144Hz) are not supported by the pen touch mode, it's impossible to switch touch modes without adjusting the frame rate. For example, when switching from 144Hz in touch mode to 60Hz in pen touch mode, you cannot switch to touch mode while maintaining 144Hz; you cannot switch to 144Hz in pen touch mode first because pen touch mode does not support 144Hz. Therefore, you cannot switch from 144Hz in pen touch mode to 60Hz in pen touch mode. Thus, you need to switch the frame rate first to a range supported by pen touch mode before switching to touch mode.
[0291] In some embodiments, when an electronic device triggers a refresh rate switch, it can also trigger a switch in the operating mode of the touch firmware.
[0292] Optionally, the electronic device may trigger the touch firmware to switch operating modes only when the touch mode is switched at the same refresh rate level.
[0293] For example, when the first refresh rate switching instruction indicates a switch from 144Hz in touch mode to 60Hz in pen touch mode, the electronic device can first reduce the frame rate to 60Hz in touch mode, without triggering a switch in the touch firmware's operating mode. Instead, the touch firmware's operating mode switch is triggered when switching touch modes again at the same refresh rate. That is, based on the changed touch scenario (pen touch mode), the corresponding touch firmware operating mode—firmware mode 2—is matched, and relevant instructions are sent to the kernel-level touch driver to drive the touch firmware to switch to firmware mode 2.
[0294] Alternatively, the electronic device can also trigger the working mode switching of the touch firmware when switching between different frame rates under the same touch mode, without having to wait until the touch mode switching under the same refresh rate level is achieved before triggering the working mode switching of the touch firmware.
[0295] For example, when the first refresh rate switching instruction indicates a switch from 144Hz in touch mode to 60Hz in pen touch mode, the electronic device can first reduce the frame rate to 60Hz in touch mode. Simultaneously, this triggers a switch in the touch firmware's operating mode. Specifically, based on the changed touch scenario (pen touch mode), the corresponding touch firmware operating mode—firmware mode 2—is matched, and relevant instructions are sent to the kernel-level touch driver to switch the touch firmware's operating mode to firmware mode 2. At the same time, relevant instructions are also sent to the kernel-level display driver to complete the frame rate switch from touch mode to 60Hz.
[0296] S1110. In response to the first refresh rate switching command, the electronic device performs layer compositing processing on the Nth frame image through MDP to obtain the first image to be displayed.
[0297] In this embodiment, when the electronic device detects that the Nth frame image needs to switch between different refresh rates in different modes (from the second refresh rate to the first refresh rate), the electronic device can adjust the frame rate to the first refresh rate of 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 level before subsequent mode switching.
[0298] It's understandable that, since it's a switch between different refresh rates within the same touch mode, the current refresh rate switching method can be achieved simply by changing the VFP parameter in the display timing, i.e., the length of the frame end idle time, without causing display anomalies. Therefore, the layer composition method for the Nth frame image can still be executed by the MDP. Furthermore, since it's always in touch mode, there's no need to support stylus input scanning, and the frame end idle time is sufficient for the MDP to perform refresh rate switching and layer composition. Thus, when the electronic device starts refreshing and displaying the Nth frame image, there's no need to change the layer composition method for the Nth frame image.
[0299] Optionally, when the electronic device begins to refresh and display the Nth frame image, SurfaceFlinger can obtain all layers of the Nth frame image and the first refresh rate switching command, and provide the data of all layers and the first refresh rate switching command to HWC, and query HWC for processing method. Since different refresh rate switching is required for different modes, HWC can, according to the first refresh rate switching command, first maintain the original layer composition method of the Nth frame image, such as MDP composition, so that MDP can composite and overlay all layers of the Nth frame image, and finally form a frame of image to be transmitted to the display screen, i.e., the first image.
[0300] It is understandable that before the electronic device triggers the switching of different refresh rates in different modes, the layer composition method for images before the Nth frame is still the original layer composition method, such as MDP composition. Thus, MDP can composite and overlay all layers of the Nth frame image to finally form a frame of image to be transmitted to the display screen.
[0301] S1120, In response to the first refresh rate switching command, the electronic device switches the screen refresh rate of the display from the second refresh rate in touch mode to the first refresh rate in touch mode via MDP.
[0302] In this embodiment, when the electronic device starts refreshing and displaying the Nth frame of the image, and detects that a different refresh rate switch between different modes is required, the electronic device can first control the display timing switch via MDP. By changing the VFP parameter of the display timing, the screen refresh rate of the display screen is switched from the second refresh rate in touch mode to the first refresh rate in touch mode. This allows for the completion of different refresh rate switching within the same touch mode.
[0303] In this embodiment of the application, when an electronic device needs to switch between different refresh rates under the same touch mode, it can determine the matching display timing according to a preset correspondence table, and thus complete the switching between different refresh rates under the same touch mode based on the matching display timing.
[0304] As an example, let's consider switching from a 120Hz refresh rate in touch mode to a 60Hz refresh rate in pen touch mode. The electronic device can first switch from the 120Hz refresh rate in touch mode to the 60Hz refresh rate. Referring to Table 2, we can determine the display timing corresponding to the 120Hz refresh rate in touch mode. Compared to the display timing corresponding to the 60Hz refresh rate in touch mode, only the VFP (frame tail idle time) has changed. Therefore, the electronic device can increase the VFP in the current 120Hz display timing from 26 to 2340. This only increases the frame tail space time, while the effective display time remains unchanged. This lengthens the time to refresh and display one frame of image, resulting in fewer image frames refreshed per second, thus achieving the goal of reducing the screen refresh rate.
[0305] It is understandable that before the electronic device triggers the switch between different refresh rates in different modes, the electronic device refreshes and displays the image before the Nth frame according to the 120Hz screen refresh rate in the touch mode before the switch.
[0306] like Figure 12 As shown in (a), taking the N-1th frame image as an example, when the electronic device starts to refresh and display the N-1th frame image, since the current screen refresh rate of the display screen is 120Hz in the 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 touch mode. The refresh and display time of the N-1th frame image is 8.3ms.
[0307] like Figure 12As shown in (b), after the (N-1)th frame image is refreshed and displayed, the electronic device can begin to refresh and display the Nth frame image. At this time, if the electronic device detects a first refresh rate switching command to switch from the 120Hz level in touch mode to the 60Hz level in pen touch mode, the electronic device can respond to the first refresh rate switching command and, when starting to refresh and display the Nth frame image, first control the display timing switch through MDP to increase the VFP (i.e., frame end idle time) time length, so as to complete the switch from the 120Hz level in touch mode to the 60Hz level in touch mode first.
[0308] like Figure 12 As shown in (b), since the effective display time remains unchanged, only the frame tail space time is increased, which lengthens the time to refresh and display the Nth frame image to 16.6ms. Consequently, the number of times the image frames are refreshed and displayed per second is reduced to 60, thus achieving the goal of reducing the screen refresh rate to 60Hz.
[0309] As another example, let's consider switching from a 144Hz refresh rate in touch mode to a 60Hz refresh rate in pen touch mode. The electronic device can first switch from 144Hz to 60Hz. Referring to Table 2, we can determine the display timing for the 144Hz refresh rate in touch mode. Compared to the 60Hz refresh rate, only the VFP (frame tail idle time) has changed. Therefore, the electronic device can increase the VFP in the current 144Hz display timing from 15 to 2340. This only increases the frame tail space time, while the effective display time remains unchanged. This lengthens the time to refresh and display one frame, resulting in fewer refreshes per second, thus reducing the screen refresh rate.
[0310] It is understandable that before the electronic device triggers the switch between different refresh rates in different modes, the electronic device refreshes and displays the image before the Nth frame according to the 144Hz screen refresh rate in the touch mode before the switch.
[0311] like Figure 13 As shown in (a), taking the N-1th frame image as an example, when the electronic device starts to refresh and display the N-1th frame image, since the current screen refresh rate of the display screen is 144Hz in the 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 touch mode. The refresh and display time of the N-1th frame image is 6.9ms.
[0312] like Figure 13As shown in (b), after the (N-1)th frame of the image has finished refreshing and displaying, the electronic device can begin refreshing and displaying the Nth frame of the image. At this time, if the electronic device detects a first refresh rate switching command to switch from the 144Hz level in touch mode to the 60Hz level in pen touch mode, the electronic device can respond to the first refresh rate switching command and, when starting to refresh and display the Nth frame of the image, first control the switching of the display timing through MDP, increasing the time length of VFP (i.e., frame end idle time) to complete the switch from the 144Hz level in touch mode to the 60Hz level in touch mode.
[0313] like Figure 13 As shown in (b), since the effective display time remains unchanged, only the frame tail space time is increased, which lengthens the time to refresh and display the Nth frame image to 16.6ms. Consequently, the number of times the image frames are refreshed and displayed per second is reduced to 60, thus achieving the goal of reducing the screen refresh rate to 60Hz.
[0314] S1130, The electronic device displays a first image at a first refresh rate in touch mode.
[0315] After the electronic device switches the display timing via MDP control, it can transmit the data of the first image to be displayed, formed by MDP synthesis of the Nth frame image, to the display screen according to the display timing corresponding to the first refresh rate in the switched touch mode. Since the current display timing switch only involves VFP parameters, the frame end idle time is sufficient for MDP to achieve refresh rate switching and layer synthesis. Therefore, the refresh and display of the first image formed by MDP synthesis of the Nth frame image can be completed normally.
[0316] For example, such as Figure 14 As shown, when refreshing and displaying the Nth frame image during the kernel stage, the MDP handles refresh rate switching and layer composition. Specifically, if the display driver of the electronic device receives the first refresh rate switching instruction, it can maintain the original layer composition method of the Nth frame image, that is, drive the MDP composition module to complete the layer composition and overlay of the Nth frame image, and drive the MDP display switching module to complete the corresponding display timing switch. At this time, the MDP display switching module is used to complete the switching of different frame rates in the touch mode, and does not involve the switching of 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 touch mode to the display timing corresponding to the first refresh rate in the touch mode, that is, the display timing switch corresponding to different refresh rates in the same touch mode.
[0317] After the MDP synthesis of the Nth frame image ends and the display timing is switched, the electronic device controls the MDP display driver (MDP MIPI driver) to transmit the first image formed by MDP synthesis to the display panel (such as LCD) for display according to the display timing corresponding to the first refresh rate in the switched touch mode.
[0318] It is understandable that before the electronic device triggers the switching between different refresh rates in different modes, for images before the Nth frame, the electronic device refreshes and displays images before the Nth frame according to the display timing corresponding to the second refresh rate in the touch mode before the switch.
[0319] Taking the (N-1)th frame as an example, when the kernel stage refreshes and displays the (N-1)th frame, the electronic device's display driver also uses the original layer compositing method, that is, driving the MDP compositing module to complete the compositing and overlay of the layers of the (N-1)th frame image. Since the electronic device's display driver does not receive a refresh rate switching command when refreshing and displaying the (N-1)th frame image, it does not need to drive the MDP display switching module to complete the corresponding display timing switch. Therefore, when the kernel stage refreshes and displays the (N-1)th frame image, the electronic device only drives the MDP compositing module to complete the layer compositing processing of the (N-1)th frame image. After the MDP compositing of the (N-1)th frame image is completed, the electronic device then controls the MDP display driver (MDP MIPI driver) to transmit the image formed by the MDP compositing through the MIPI interface to the display panel (such as an LCD) for display, according to the original refresh rate, that is, the display timing corresponding to the second refresh rate in the touch mode before the switch.
[0320] It's understandable that since the Nth frame has already switched from the second refresh rate in touch mode to the first refresh rate in touch mode (i.e., different refresh rates within the same touch mode), the second refresh rate in touch mode has been adjusted to be at the same frame rate level as the first refresh rate in pen touch mode. Therefore, subsequent switching can only be done within the same frame rate level of the touch mode, i.e., switching from the first refresh rate in touch mode to the first refresh rate in pen touch mode. This achieves different refresh rate switching across different touch modes.
[0321] S1140. When the electronic device starts to refresh and display the N+1th frame image, in response to the first refresh rate switching instruction, the electronic device performs layer compositing processing on the N+1th frame image through the GPU to obtain the second image to be displayed.
[0322] In some embodiments, after the electronic device completes the switch from the second refresh rate in touch mode to the first refresh rate in touch mode, it can complete the switch to the touch mode at the same frame rate level again when it starts refreshing and displaying the next frame image, i.e., the N+1th frame image. That is, it switches from the first refresh rate in touch mode to the first refresh rate in pen touch mode.
[0323] Because the display timings corresponding to refresh rates differ significantly between different touch modes, the MDP needs to spend considerable time adjusting the display timing. Therefore, in this embodiment, during the refresh rate display of the (N+1)th frame, the electronic device can refer to the refresh rate switching method described in the previous embodiments and delegate the layer compositing processing to the graphics processing unit (GPU) to reduce the load on the MDP. In this case, the MDP only needs to switch between touch modes within the same frame rate range. This ensures normal display of the (N+1)th frame and normal refresh rate switching regardless of whether the idle time at the end of the current refresh rate frame is sufficient.
[0324] Optionally, when the electronic device begins refreshing and displaying the N+1th frame image, SurfaceFlinger can obtain all layers of the N+1th frame image and the first refresh rate switching instruction, and provide the data of all layers and the first refresh rate switching instruction to HWC, and query HWC for processing methods. Since the same refresh rate switching is required for different modes, HWC can, according to the first refresh rate switching instruction, force the layer composition method marked on all layers of the N+1th frame image to be set to GPU composition, so that the GPU can composite and overlay all layers of the N+1th frame image, ultimately forming a frame of image to be transmitted to the display screen, i.e., the second image.
[0325] In some embodiments, the refresh rate is switched from the first refresh rate in touch mode to the first refresh rate in pen touch mode, and the frame end time in touch mode is usually sufficient, such as... Figure 2 As shown in (a), the frame tail time in the display timing corresponding to the 60Hz setting in touch mode is sufficient. Even if the MDP needs to spend a lot of time to complete the display timing switch adjustment, the MDP can simultaneously complete the layer compositing processing of the image frame and the display timing switch corresponding to the refresh rate. Therefore, the electronic device can also use the original layer compositing method during the refresh display of the N+1th frame image without changing the current image's layer compositing method to GPU compositing. For example, the MDP can still perform layer compositing processing on the N+1th frame image to obtain the second image to be displayed.
[0326] S1150, in response to the first refresh rate switching command, the electronic device switches the screen refresh rate of the display from the first refresh rate in hand touch mode to the first refresh rate in pen touch mode via MDP.
[0327] In this embodiment of the application, when the electronic device detects that the N+1th frame image needs to switch between different modes of the same refresh rate, the electronic device can control the switching of the display timing through MDP. By changing the display timing parameters, the screen refresh rate of the display screen is switched from the first refresh rate in the hand touch mode to the first refresh rate in the pen touch mode.
[0328] In this embodiment, the display timings corresponding to different refresh rates under different touch modes can be pre-associated through a correspondence table, as shown in Table 2. Therefore, when an electronic device needs to switch refresh rates, it can determine the matching display timings based on the pre-defined correspondence table, and thus complete the refresh rate switching based on the matched display timings.
[0329] As an example, taking the switch from 120Hz in touch mode to 60Hz in pen touch mode as an example, after the electronic device completes the switch from 120Hz in touch mode to 60Hz in touch mode during the Nth frame image refresh display process, it can then complete the switch from 60Hz in touch mode to 60Hz in pen touch mode during the N+1th frame image refresh display process.
[0330] For example, referring to Table 2, the display timing corresponding to the 60Hz level in touch mode can be determined. Compared with the display timing corresponding to the 60Hz level in pen touch mode, HBP, HFP, and VFP have changed. Therefore, during the refresh display process of the Nth frame image, the electronic device, such as Figure 12 As shown in (b), after switching to the display timing corresponding to the 60Hz level in the hand touch mode, during the N+1 frame image refresh display process, the HBP in the display timing corresponding to the 60Hz level 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 realizing the display timing corresponding to the 60Hz level in the pen touch mode.
[0331] It is understandable that increasing the values of HBP and HFP will lead to a longer effective display time for the N+1th frame. Since the refresh rate of both touch modes is 60Hz, the refresh display time of a frame is fixed at 16.6ms. Therefore, the corresponding idle time at the end of the frame will be shorter.
[0332] like Figure 12As shown in (c), after the Nth frame image is refreshed and displayed, the electronic device can begin refreshing and displaying the N+1th frame image. At this time, the electronic device can continue to respond to the first refresh rate switching command. When starting to refresh and display the N+1th frame image, it first controls the switching of the display timing via MDP, increasing the effective display time and shortening the VFP (i.e., frame tail idle time) time, to complete the switch from the 60Hz level in touch mode to the 60Hz level in pen touch mode. Figure 12 As shown in (c), the time to refresh and display the N+1th frame remains unchanged at 16.6ms.
[0333] In this way, the switched display timing satisfies both the 60Hz screen refresh rate and supports the scanning of stylus input. This enables the switching of touch modes within the same frame rate range. Furthermore, the electronic device transmits image data to the display screen according to the switched display timing, thus achieving a 60Hz screen refresh rate that matches the stylus input.
[0334] As another example, taking the switch from 144Hz in touch mode to 60Hz in pen touch mode as an example, after the electronic device completes the switch from 144Hz in touch mode to 60Hz in touch mode during the Nth frame image refresh display process, it can then complete the switch from 60Hz in touch mode to 60Hz in pen touch mode during the N+1th frame image refresh display process.
[0335] For example, referring to Table 2, the display timing corresponding to the 60Hz level in touch mode can be determined. Compared with the display timing corresponding to the 60Hz level in pen touch mode, HBP, HFP, and VFP have changed. Therefore, during the refresh display process of the Nth frame image, the electronic device, such as Figure 13 As shown in (b), after switching the display timing from the 144Hz level in the touch mode to the 60Hz level in the touch mode, during the N+1th frame image refresh display process, the HBP in the current 60Hz level of the touch mode is increased from 20 to 318, the HFP is increased from 19 to 20, and the VFP is reduced from 2340 to 26, thereby achieving the switching to the display timing corresponding to the 60Hz level in the pen touch mode.
[0336] like Figure 13As shown in (c), after the Nth frame image is refreshed and displayed, the electronic device can begin refreshing and displaying the N+1th frame image. At this time, the electronic device can continue to respond to the first refresh rate switching command. When starting to refresh and display the N+1th frame image, it first controls the switching of the display timing via MDP, increasing the effective display time and shortening the VFP (i.e., frame tail idle time) time, to complete the switch from the 60Hz level in touch mode to the 60Hz level in pen touch mode. Figure 13 As shown in (c), the refresh time for displaying the (N+1)th frame remains unchanged at 16.6ms. Thus, the switched display timing satisfies both the 60Hz screen refresh rate and supports stylus input scanning. This enables switching between touch modes within the same frame rate range.
[0337] S1160, the electronic device displays a second image at a first refresh rate in pen touch mode.
[0338] In some embodiments, after the electronic device switches the display timing via MDP, it can transmit the data of the second image to be displayed, formed by GPU synthesis of the N+1th frame image, to the display screen for display, according to the display timing corresponding to the first refresh rate in the switched pen touch mode. Since MDP only needs to switch the refresh rate, and the layer synthesis processing is performed by the GPU, even if the frame tail space time after the display timing switch is too short, the electronic device can still complete the display timing switch normally and the normal display of the second image formed by GPU synthesis of the N+1th frame image.
[0339] For example, such as Figure 15 As shown, during the kernel stage when refreshing and displaying the N+1th frame image, the electronic device's display driver continues to respond to the first refresh rate switching command, driving the GPU compositing module to complete the compositing and overlaying of the layers of the N+1th frame image, and driving the MDP display switching module to complete the corresponding display timing switch. After the GPU compositing of the N+1th frame image is completed and the display timing switch is finished, the MDP display driver (MDP MIPI driver) is controlled to transmit the GPU-composited second image to be displayed to the display panel (such as LCD) through the MIPI interface according to the switched display timing.
[0340] It's understandable that since the (N+1)th frame has already completed the first refresh rate switching process in pen touch mode, when the electronic device starts refreshing and displaying the (N+2)th frame, if no new refresh rate switching command is received, there's no need to perform a display timing switch, and the (N+2)th frame can revert to its original layer composition method. For example, all layers of the (N+2)th frame can be restored to MDP composition.
[0341] For example, such as Figure 16As shown, when refreshing and displaying the N+2th frame image during the kernel stage, the electronic device's display driver does not receive a new refresh rate switching instruction. Therefore, it does not need to drive the MDP display switching module to complete the corresponding display timing switch, and can restore the original layer compositing method, that is, drive the MDP compositing module to complete the compositing and overlay of the layers of the N+2th frame image. After the MDP compositing of the N+2th frame image is completed, the MDP display driver (MDP MIPI driver) is controlled to transmit the MDP-composited image to be displayed to the display panel (such as LCD) through the MIPI interface according to the display timing corresponding to the first refresh rate in the switched pen touch mode.
[0342] In some scenarios, during the refresh display of the Nth frame, after switching from the second refresh rate in touch mode to the first refresh rate in touch mode, the switch can also be completed after refreshing one frame before switching back to the first refresh rate in pen touch mode. That is, during the refresh display of the N+2th frame, the switch from the first refresh rate in touch mode to the first refresh rate in pen touch mode is completed.
[0343] In some embodiments, in response to a first refresh rate switching command, the electronic device may, when refreshing and displaying the Nth frame of the image at the kernel layer, issue a frame rate switching command for the same touch mode, thereby triggering the display area of the kernel layer to switch from the second refresh rate in touch mode to the first refresh rate in touch mode. When refreshing and displaying the N+1th frame of the image at the kernel layer, a touch mode switching command for the same frame rate is issued, thereby triggering the display area of the kernel layer to switch from the first refresh rate in touch mode to the first refresh rate in pen touch mode.
[0344] In some embodiments, since the refresh rate switches from the first refresh rate in touch mode to the first refresh rate in pen touch mode, and the frame end time in touch mode is usually sufficient, the electronic device can still perform layer compositing on the N+1th frame image during the N+1th frame image refresh and display process to obtain the second image to be displayed. Therefore, after the electronic device controls the switching of the display timing via MDP, it can transmit the data of the second image to be displayed, formed by the MDP compositing of the N+1th frame image, to the display screen for display according to the display timing corresponding to the first refresh rate in the switched pen touch mode.
[0345] The refresh rate switching method provided in this application can, when switching between different refresh rates for different touch modes is required, first complete the refresh rate switching to adjust to the same refresh rate level, and then complete the switching between different touch modes at the same refresh rate. Furthermore, during the refresh rate switching between different touch modes, the electronic device can switch the image frame layer compositing processing, originally performed by the display processor (MDP), to be performed by the graphics processor (GPU). This reduces the load on the MDP; during frame idle periods, only the MDP display timing switching needs to be completed, without simultaneously performing MDP compositing. This ensures that image frames are delivered and displayed in a timely manner, avoiding the problem of a single image frame failing to display correctly during refresh rate switching between different touch modes. Thus, while ensuring smooth real-time switching, it reduces the constraint that the display timing parameters of different modes cannot be too large, increases the difference in display timing between different modes, and expands the adjustable range of device modes.
[0346] In some scenarios, when an electronic device starts refreshing and displaying the Nth frame of the image, if it detects a first refresh rate switching command to switch from the second refresh rate in touch mode to the first refresh rate in pen touch mode, the electronic device can also start responding to the first refresh rate switching command during the refresh and display of the N+1th frame of the image. That is, the switch from the second refresh rate in touch mode to the first refresh rate in touch mode is completed first during the refresh and display of the N+1th frame of the image, and then the switch from the first refresh rate in touch mode to the first refresh rate in pen touch mode is completed during the refresh and display of the N+2th frame of the image.
[0347] It is understood that the above embodiments use the 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 different refresh rates in different touch modes. A similar principle can be used to implement the switching from the first refresh rate in pen touch mode to the second refresh rate in hand touch mode.
[0348] Because some refresh rate levels (such as 144Hz) supported by the touch mode are not supported by the pen touch mode, adjusting the frame rate of the pen touch mode first may not allow the two touch modes to be adjusted to the same frame rate level. For example, when switching from 60Hz in pen touch mode to 144Hz in touch mode, it is not possible to switch from 60Hz to 144Hz by first adjusting the frame rate level, because the pen touch mode does not support 144Hz. Therefore, it is not possible to switch between different touch modes based solely on the same frame rate level. Therefore, in this embodiment, for scenarios where switching from a first refresh rate in pen touch mode to a second refresh rate in touch mode, the electronic device can complete the touch mode switch first, and then complete the frame rate level switch.
[0349] For example, when the electronic device begins to refresh and display the Nth frame of the image, a second refresh rate switching command is detected. This second refresh rate switching command instructs the device to switch from the first refresh rate in pen touch mode to the second refresh rate in touch mode. The second refresh rate is different from the first refresh rate. In response to the second refresh rate switching command, the electronic device can perform layer compositing processing on the Nth frame of the image using the GPU to obtain the first image to be displayed. Then, it switches the screen refresh rate of the display from the first refresh rate in pen touch mode to the first refresh rate in touch mode via MDP. Thus, the electronic device displays the first image at the first refresh rate in touch mode. Then, when the electronic device begins to refresh and display the N+1th frame of the image, it continues to respond to the second refresh rate switching command, performing layer compositing processing on the N+1th frame of the image using MDP to obtain the second image to be displayed, and switching the screen refresh rate of the display from the first refresh rate in touch mode to the second refresh rate in touch mode via MDP. Thus, the electronic device displays the first image at the second refresh rate in touch mode.
[0350] As an example, let's consider switching from 60Hz in pen touch mode to 144Hz in hand touch mode. The electronic device can first switch from 60Hz in pen touch mode to 60Hz in hand touch mode, i.e., switching between different touch modes within the same frame rate. Then, it can switch from 60Hz in hand touch mode to 144Hz in hand touch mode, i.e., switching between different frame rate levels within the same touch mode.
[0351] As can be understood from Table 1, when an 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 significant, and the MDP needs to spend a considerable amount of time to complete the display timing switch adjustment. Furthermore, the frame tail idle time in pen touch mode is too short. Therefore, if the layer compositing processing of image frames is still performed by the MDP, the MDP load will be too high, leading to abnormal image frame delivery. Therefore, in this embodiment, during the refresh display of the Nth frame image, the electronic device can refer to the refresh rate switching method in the aforementioned embodiments and delegate the layer compositing processing to the graphics processing unit (GPU) to reduce the MDP load. In this case, the MDP only needs to switch the touch mode within the same frame rate range. In this way, even if the frame tail idle time at the current refresh rate is insufficient, the normal delivery of the N1th frame image and the normal refresh rate switching can still be guaranteed.
[0352] Optionally, when the electronic device begins 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 query HWC for processing method. Since it is necessary to switch between different touch modes at the same frame rate first, HWC can, according to the second refresh rate switching instruction, force the layer composition method marked on all layers of the Nth frame image to be set to GPU composition, so that the GPU can composite and overlay all layers of the Nth frame image, and finally form a frame of image to be transmitted to the display screen, i.e., the first image.
[0353] Simultaneously, electronic devices can control the switching of display timing via MDP. By changing the display timing parameters, the screen refresh rate is switched from the first refresh rate in pen touch mode to the first refresh rate in hand touch mode. Thus, after switching the display timing via MDP, the electronic device can transmit the data of the first image to be displayed, formed by GPU synthesis of the Nth frame image, to the display screen using the display timing corresponding to the first refresh rate in the switched hand touch mode.
[0354] After the Nth frame of the image completes the switching between different touch modes at the same frame rate and refreshes the display, the electronic device can switch from the 60Hz level in the touch mode to the 144Hz level in the touch mode when it starts refreshing the display of the N+1th frame of the image.
[0355] It's understandable that, since it's a switch between different refresh rates within the same touch mode, the current refresh rate switching method can be achieved simply by changing the VFP parameter in the display timing, i.e., the length of the frame end idle time, without causing display anomalies. Therefore, the layer composition method for the N+1th frame image can still be executed by MDP. Furthermore, the frame end idle time in touch mode is sufficient for MDP to perform refresh rate switching and layer composition. Thus, when the electronic device begins refreshing and displaying the N+1th frame image, there's no need to change the layer composition method for the N+1th frame image.
[0356] Optionally, when the electronic device begins 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 command, and provide the data of all layers and the second refresh rate switching command to HWC, and query HWC for processing method. Since it only needs to continue to perform different refresh rate switching within the same touch mode, MDP can simultaneously achieve refresh rate switching and layer compositing. Therefore, HWC can maintain the original layer compositing method of the N+1th frame image according to the second refresh rate switching command, such as MDP compositing, so that MDP can composite and overlay all layers of the N+1th frame image, ultimately forming a frame of image to be transmitted to the display screen, i.e., the second image.
[0357] Simultaneously, the electronic device can control the switching of display timing via MDP. By changing the display timing parameters, the screen refresh rate is switched from the first refresh rate in touch mode to the second refresh rate in touch mode. Thus, after switching the display timing via MDP, the electronic device can transmit the data of the second image to be displayed, formed by the MDP synthesis of the N+1th frame image, to the display screen according to the display timing corresponding to the second refresh rate in touch mode.
[0358] In this embodiment, the electronic device can determine whether to switch the current screen refresh rate to a refresh rate that matches the stylus based on the current stylus usage scenario.
[0359] In some embodiments, the electronic device can identify whether the stylus is currently in use based on its connection status, magnetic attachment status, and full charge status. Based on this, the electronic device can determine the appropriate screen refresh rate setting for the current touch scenario and generate a corresponding refresh rate switching command. The electronic device then responds to this command, completing the refresh rate switch and ensuring a smooth transition.
[0360] Please see Figure 17 This application provides another method for switching refresh rates, which may include:
[0361] S1710 The electronic device detects the status information of the stylus, which includes the stylus's connection status, magnetic attachment status, and full charge status.
[0362] In this embodiment, the electronic device can determine whether the stylus is currently in use by combining information such as the stylus's connection status, magnetic attachment status, and full charge status. Therefore, upon detecting that the stylus is in use, the screen refresh rate can be switched to an appropriate refresh rate for the stylus, ensuring normal stylus operation.
[0363] The stylus's connection status includes connected and disconnected. Generally, a user cannot use the stylus when it is not in a communication connection with the electronic device. When a user needs to use the stylus, a communication connection is usually established between the stylus and the electronic device. Therefore, detecting the stylus's connection status can help the electronic device analyze whether the stylus is currently in use.
[0364] The communication connection between the stylus and the electronic device can be achieved via a wired connection (such as a USB cable) or a wireless connection (such as Bluetooth or Wi-Fi). For example, taking the establishment of a communication connection between the stylus and the electronic device via Bluetooth as an example, the electronic device can detect whether it is in a Bluetooth connection state with the stylus.
[0365] Optionally, the electronic device can detect connection and disconnection events of the stylus via the Bluetooth service module of the framework layer. When the electronic device and the stylus establish a Bluetooth connection via 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 fail to establish a Bluetooth connection or the Bluetooth connection is lost, the Bluetooth module of the electronic device can report the disconnection event to the Bluetooth service module.
[0366] The stylus's magnetic state includes being attached and being removed (not attached). Generally, when the electronic device and stylus are connected, after using the stylus for a period of time, the user can bring the stylus close to the electronic device to magnetically attach it to the device's frame or touchscreen using a strong magnetic attraction. This ensures the stylus's safe storage while allowing the electronic device to wirelessly charge the stylus. For example... Figure 18 As shown in (a), the stylus 100 is magnetically attached to the right side frame of the electronic device 200. It can be understood that when a user normally uses the stylus, it is usually far from the electronic device and not magnetically attached to it. Figure 18 As shown in (b), the stylus 100 is away from the electronic device 200 and is not attached to it. Therefore, by detecting the attachment status of the stylus, the electronic device can help analyze whether the stylus is currently in use.
[0367] A stylus's fully charged state includes both fully charged and partially charged. This means that when the stylus is magnetically attached to an electronic device, if its battery is not fully charged, the device can continuously wirelessly charge it (i.e., it is in a charging state) until it is fully charged. If the stylus is fully charged, the device can stop wirelessly charging it (i.e., it is in a stopped charging state). Therefore, a stylus's fully charged state can also include both charging and stopped charging.
[0368] Currently, electronic devices can promptly identify stylus attachment events and events where the stylus is removed from the device during charging by scanning Q. However, the identification of events where the stylus is removed during charging is achieved through error timeout packets (cep_timeout). However, cep_timeout detection itself has a delay (e.g., 1.5 seconds). Therefore, electronic devices cannot detect events where the stylus is removed during charging immediately. This results in touch abnormalities when the user removes the stylus from the device and immediately uses it, as the device cannot promptly recognize the stylus's usage status and cannot switch the screen refresh rate to match the stylus's refresh rate, thus affecting the user's stylus experience.
[0369] To address the aforementioned issues, this application embodiment adds detection of the stylus's full charge status, using this status to assist in analyzing whether the stylus is currently in use. Optionally, the electronic device can detect stylus attraction events, distance events, full charge events, and insufficient charge events through the stylus service module in the framework layer.
[0370] In one scenario, when a stylus moves from a distant position to a magnetic attachment on an electronic device, the device's wireless charging chip detects a change in the Q value of the wireless charging coil. At this point, the wireless charging chip generates an interrupt signal to notify the wireless charging driver via an interrupt procedure. The wireless charging driver then reports the attachment event to the stylus service. Once the stylus is attached to the electronic device, if its battery is not fully charged, it will remain in a charging state.
[0371] In one scenario, once the stylus is fully charged after being magnetically attached to an electronic device, it will enter a charged-off state. At this point, the stylus can notify the electronic device's wireless charging coil of a fully charged event (charge done) via the Qi protocol. Upon receiving this event, the electronic device's wireless charging chip generates an interrupt signal, which, through the chip's interrupt process, notifies the wireless charging driver. The wireless charging driver then reports the fully charged event to the stylus.
[0372] In one scenario, if the stylus service receives the stylus's magnetic attraction event but does not receive the full charge event, it can be determined that the stylus's full charge state is not fully charged, meaning the stylus is in a magnetic charging state.
[0373] Optionally, when the wireless charging driver reports an adsorption event, if it does not detect a "charge done" event, it can also upload a "not fully charged" event to the stylus service.
[0374] In one scenario, when the stylus moves away from the magnetic charging stop state, the wireless charging chip of the electronic device will also detect a change in the Q value of the wireless charging coil. At this time, the wireless charging chip can generate an interrupt signal to notify the wireless charging driver through the chip driver's interrupt process. The wireless charging driver then reports the moving event when the magnetic charging stop state is reached to the stylus service.
[0375] S1720: The electronic device determines the current touch scenario based on the status information of the stylus.
[0376] In some embodiments, the electronic device can determine the current touch scenario based on the connection and magnetic attachment status of the stylus. Touch scenarios include stylus input scenarios (also known as pen control scenarios, writing scenarios, etc.) and finger input scenarios (also known as hand control scenarios).
[0377] For example, taking the establishment of a communication connection between the stylus and the electronic device via Bluetooth as an example, the electronic device can identify the current touch scenario through the correspondence in Table 4.
[0378] Table 4
[0379] a Not connected Adsorption Finger input scenario b Not connected keep away Finger input scenario c connect Adsorption Finger input scenario d connect Keep away from (unadsorbed) Stylus input scenarios
[0380] It is understandable that when the stylus moves away or attaches, the electronic device can detect the event of the stylus moving away or attaching immediately, and then determine the current touch scenario based on the connection and attachment status of the stylus.
[0381] Because the stylus is connected but not magnetically attached when the user is using it, the electronic device can determine that the stylus is not in use and the current touch scenario is a finger input scenario (i.e., the touch scenarios corresponding to codes a and b) when it detects that the stylus is connected but magnetically attached. The electronic device can also determine that the stylus is not in use and the current touch scenario is a finger input scenario (i.e., the touch scenario corresponding to code c). When the electronic device detects that the stylus is connected but removed from the device, it can determine that the stylus is in use and the current touch scenario is a stylus input scenario (i.e., the touch scenario corresponding to code d).
[0382] In some embodiments, if the electronic device recognizes the stylus moving away via cep_timeout, the electronic device cannot detect the stylus moving away immediately. In this case, the electronic device can determine the current touch scenario based on the stylus's connection status, magnetic state, and full charge status.
[0383] For example, taking the establishment of a communication connection between the stylus and the electronic device via Bluetooth as an example, the electronic device can identify the current touch scene through the correspondence in Table 5.
[0384] Table 5
[0385]
[0386] It's understandable that when the stylus is connected, it enters a charging-off state after being fully charged by magnetically attached to the electronic device. Since the wireless charging chip remains in low-power Q-scan mode after charging stops, when the stylus moves away from this state, the wireless charging chip can promptly detect the change in the Q-value of the wireless charging coil and report the moving-away event. Therefore, when the electronic device detects a moving-away event, it can determine that the stylus is currently in use, and the current touch scenario is the one input by the stylus (i.e., the touch scenario corresponding to code d). If no moving-away event is detected, and the stylus remains in the charging-off state, the electronic device can confirm that the stylus is not in use, and the current touch scenario is the one input by the finger (i.e., the touch scenario corresponding to code c2).
[0387] In scenarios where the stylus is attached to an electronic device but not fully charged, the event of the stylus moving away cannot be detected in time. Therefore, in this embodiment, the stylus is assumed to be in use, and the current touch scenario is the touch scenario input by the stylus (i.e., the touch scenario corresponding to code c1). Thus, when the user removes the stylus from the electronic device and immediately uses it, the electronic device has already switched the screen refresh rate to match the stylus's usage status, preventing touch anomalies and allowing the user to write or touch normally.
[0388] When an electronic device detects that the stylus is not connected, it can directly determine that the stylus is not in use and the current touch scenario is the touch scenario of finger input (i.e. the touch scenario corresponding to codes a1, a2 and b).
[0389] In one scenario, the Bluetooth service module in the framework layer can report connection and disconnection events to the stylus service module in the framework layer. The stylus service module can then determine whether the stylus is currently in use based on the connection and disconnection events reported by the Bluetooth service module, as well as the magnetic attraction, distance, and full charge events reported by the wireless charging driver.
[0390] Optionally, when the stylus service module receives a disconnection event, it assumes that the stylus is not currently connected to the electronic device, thus confirming that the current touch scenario is a finger input scenario. If a connection event is received, the stylus service module can detect whether a magnetic attraction event has been received. If the stylus service module does not receive a magnetic attraction event, it assumes that the stylus is currently in an unattached state (far removed from the electronic device), thus confirming that the current touch scenario is a stylus input scenario.
[0391] Optionally, when the stylus service module receives a magnetic attraction event, it can determine whether a full charge event has been received. If the stylus service module does not receive a full charge event, it can assume that the stylus is currently in a connected magnetic attraction state but not fully charged, and can forcibly confirm that the current touch scenario is a touch scenario input by the stylus.
[0392] 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 connected, fully charged, and the current touch scenario is a finger input scenario. If a distance event is received, it can be assumed that the stylus is currently not attached (far from the electronic device), and the current touch scenario is a stylus input scenario.
[0393] In other words, when the stylus service module detects that the stylus is in a state of being connected but not fully charged, or not connected (i.e., the connection is far away), it confirms that the current touch scenario is a stylus input scenario. When it detects that the stylus is in a state of being connected and fully charged, or not connected, it determines that the current touch scenario is a finger input scenario.
[0394] In some embodiments, the electronic device may also receive indication information from the stylus indicating whether it is in use. Optionally, when the stylus detects that it is in use, it can directly send the first indication information to the electronic device, so that the electronic device can directly confirm that the current touch scenario is a touch scenario input by the stylus. Optionally, when the stylus detects that it is not in use, it can directly send the second indication information to the electronic device, so that the electronic device can directly confirm that the current touch scenario is a touch scenario input by the finger.
[0395] Optionally, the stylus can determine whether it is in use by detecting the holding state and movement state of the stylus.
[0396] S1730: The electronic device matches the corresponding target refresh rate according to the current touch scenario.
[0397] In this embodiment, after determining the current touch scenario, the electronic device can determine a target refresh rate suitable for the current touch scenario. Therefore, when the current screen refresh rate differs from this target refresh rate, the screen refresh rate is switched.
[0398] In some embodiments, the electronic device can determine the corresponding touch mode based on the current touch scenario, and then match the corresponding target refresh rate according to the refresh rate level supported by the corresponding touch mode. The touch modes include pen touch mode and hand touch mode.
[0399] In some embodiments, different touch modes may also correspond to different firmware operating modes of the touchscreen. Therefore, after determining the corresponding touch mode based on the current touch scenario, the electronic device can also match the firmware operating mode supported by the corresponding touch mode.
[0400] For example, assume that the default initial touch scenario for an electronic device is a touch scenario involving finger input.
[0401] If the stylus is not connected to the electronic device via Bluetooth, the event is reported to the Bluetooth service module and the stylus service module through the aforementioned event transmission path. The stylus service module can then receive the disconnection event and determine that the current touch scenario is still a finger input scenario. The touch scenario has not changed (finger input -> finger input).
[0402] In one scenario, if the stylus is connected to the electronic device via Bluetooth and is in a remote state, it will report to the stylus service module through the same channel. The stylus service module can then receive both a "connected" event and a "far away" event, confirming that the current touch scenario is a stylus input scenario. The touch scenario has changed (finger input -> stylus input). Of course, if the stylus's Bluetooth connection is then disconnected, the stylus service module can receive a "disconnected" event, thus confirming that the current touch scenario has reverted to a finger input scenario. The touch scenario has changed again (stylus input -> finger input).
[0403] Next, if the stylus is magnetically attached from a distance without disconnecting the Bluetooth connection, the stylus service module will report this information through the same channel. The stylus service module will then receive both a connection event and a magnetic attachment event. If the stylus service module does not receive a full charge event, it indicates that the stylus is charging while attached to the electronic device, and the stylus service module determines that the current touch scenario is still a stylus input scenario. The touch scenario has not changed (stylus input -> stylus input). Of course, if the stylus's Bluetooth connection is then disconnected, the stylus service module will receive a disconnection event, thus determining that the current touch scenario is a finger input scenario. The touch scenario has changed (stylus input -> finger input).
[0404] Next, if, without disconnecting the Bluetooth connection, the stylus is attached to the electronic device for a period of time and the stylus service module receives a full charge event, indicating that the stylus is in a de-charging state, the stylus service module determines that the current touch scenario is a finger input scenario. The touch scenario 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 disconnection event, thus determining that the current touch scenario is still a finger input scenario. The touch scenario has not changed (finger input -> finger input).
[0405] Next, if the stylus is moved away from its magnetic charging stop state without disconnecting the Bluetooth connection, the stylus service module will report this information through the same channel. The stylus service module will then receive both a "connected" event and a "moved away" event. The stylus service module will determine that the current touch scenario is a stylus input scenario. The touch scenario has changed (finger input -> stylus input). Conversely, if the stylus's Bluetooth connection is disconnected at this time, the stylus service module will receive a "disconnected" event, thus confirming that the current touch scenario is a finger input scenario. The touch scenario has also changed (stylus input -> finger input).
[0406] It's understandable that if the stylus is moved away from its magnetic charging state without disconnecting the Bluetooth connection, the stylus service module will only receive the connection and magnetic events, and will not receive the move-away event in time (due to the cep_timeout delay). Therefore, the stylus service module retains the original touch scene recognition result, i.e., the touch scene forcibly confirmed by the stylus input. This also happens to match the touch scene corresponding to the connection-away event. Therefore, there will be no touch scene recognition error. Even if the stylus service module subsequently receives the move-away event after the cep_timeout delay, the recognized touch scene will still be the touch scene input by the stylus. Therefore, there will be no touch scene recognition error.
[0407] In another scenario, if the stylus is connected to the electronic device via Bluetooth and is in a magnetic charging state, after reporting to the stylus service module through the same channel, the stylus service module can receive a connection event and a magnetic charging event, but not a full charge event. This indicates that the stylus is not fully charged. At this time, the stylus service module can forcibly determine that the current touch scenario is a stylus input scenario. The touch scenario has changed (finger input -> stylus input). Of course, if the stylus's Bluetooth connection is then disconnected, the stylus service module can receive a disconnection event, thus determining that the current touch scenario has reverted to a finger input scenario. The touch scenario has changed again (stylus input -> finger input).
[0408] Next, if the stylus is attached to the electronic device for a period of time without disconnecting the Bluetooth connection, and the stylus service module receives a full charge event, it indicates that the stylus has entered a non-charging state. At this point, the stylus service module can determine that the current touch scenario is a finger input scenario. The touch scenario has changed (stylus input -> finger input). Subsequent scenarios such as disconnection and distance can be referred to the aforementioned description.
[0409] In another scenario, if the stylus is already connected to the electronic device via Bluetooth and is in a magnetic charging / non-charging state, it will report to the stylus service module through the same channel. The stylus service module will then receive a connection event, a magnetic charging event, and a full charge event, indicating that the stylus is fully charged. At this point, the stylus service module can determine that the current touch scenario is still a finger input scenario. The touch scenario has not changed (finger input -> finger input). Of course, if the stylus's Bluetooth connection is then disconnected, the stylus service module will receive a disconnection event, thus confirming that the current touch scenario is still a finger input scenario. The touch scenario has not changed (finger input -> finger input).
[0410] Next, if the stylus is moved away from its magnetic charging stop state without disconnecting the Bluetooth connection, the stylus service module will report this information through the same channel. The stylus service module will then receive both a "connected" event and a "moved away" event. The stylus service module will determine that the current touch scenario is a stylus input scenario. The touch scenario has changed (finger input -> stylus input). Conversely, if the stylus's Bluetooth connection is disconnected at this time, the stylus service module will receive a "disconnected" event, thus confirming that the current touch scenario is a finger input scenario. The touch scenario has also changed (stylus input -> finger input).
[0411] As an example, the recognition of the above touch scenarios and whether the touch scenarios have changed can be shown in Table 6:
[0412] Table 6
[0413]
[0414] In some embodiments, when the stylus service module of an electronic device determines the current touch scene, if it finds that the touch scene has changed compared to the previous touch scene, it can notify the frame rate control module, which then matches the corresponding target refresh rate according to the current touch scene. This achieves real-time decision-making on the screen refresh rate suitable for the current touch scene of the electronic device. That is, this involves refresh rate switching between different touch modes.
[0415] As an example, the stylus service module sends a scene switching command to the frame rate control module, so that the frame rate control module can respond to the scene switching command and determine the screen refresh rate suitable for the current touch scene of the electronic device.
[0416] Optionally, when the current touch scenario is a stylus input scenario, the frame rate control module can determine the corresponding touch mode as stylus touch mode based on the stylus input scenario. Therefore, the frame rate control module can match the corresponding target refresh rate from the screen refresh rate levels supported in stylus touch mode. For example, as shown in Table 3, the target refresh rate can be 60Hz in stylus touch mode (i.e., number 2-2).
[0417] In some embodiments, when the current touch scenario is a stylus input scenario, the frame rate control module can also match the corresponding target working mode from the touch screen firmware working modes supported in the stylus touch mode. For example, as shown in Table 3, the target working mode can be firmware mode 2 in the stylus touch mode.
[0418] Optionally, when the current touch scenario is a finger-input touch scenario, the frame rate control module can determine the corresponding touch mode as a hand-touch mode based on the finger-input touch scenario. Therefore, the frame rate control module can match 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 144Hz in the hand-touch mode (i.e., numbers 1-4).
[0419] In some embodiments, when the current touch scenario is a finger-input touch scenario, the frame rate control module can also match the corresponding target working mode from the touchscreen firmware working modes supported in the hand touch mode. For example, as shown in Table 3, the target working mode can be firmware mode 1 in the hand touch mode.
[0420] In some embodiments, when the stylus service module of the electronic device determines the current touch scene, if it finds that the touch scene has not changed compared to the previous touch scene, it may not notify the frame rate control module. The frame rate control module then continues to match the corresponding target refresh rate based on the previous touch scene. That is, this only involves adjusting the frame rate level within the same touch mode.
[0421] In this embodiment, the refresh rate levels supported by different touch modes may have overlapping or differing portions. For example, the hand touch mode supports refresh rate levels ranging from 30Hz to 60Hz to 120Hz to 144Hz, and also supports other refresh rates between these levels (such as 62Hz, 125Hz, etc.). The pen touch mode, however, only supports three fixed frame rates: 30Hz, 60Hz, and 120Hz. This not only increases the range and levels of frame rates supported in hand touch mode, but also reduces power consumption and enhances anti-interference capabilities.
[0422] Optionally, the frame rate control module can match the corresponding target refresh rate based on the current touch scenario and the refresh rate currently used by the screen.
[0423] For example, taking the current screen refresh rate as 144Hz (i.e., numbers 1-4) in touch mode as an example, if the current touch scenario is detected as a stylus input scenario, the frame rate control module can determine the corresponding touch mode as stylus touch mode based on the stylus input scenario. Therefore, the frame rate control module can select the refresh rate level closest to the current screen's refresh rate from the screen refresh rate levels supported in stylus touch mode as the matching target refresh rate. For example, as shown in Table 3, the target refresh rate can be 60Hz in stylus touch mode (i.e., number 2-2). This avoids excessively large differences in refresh rate level switching.
[0424] It is understandable that when the target refresh rate is 60Hz in pen touch mode, the electronic device needs to switch between different touch modes and different frame rate levels during the refresh rate switching process.
[0425] For example, taking the current screen refresh rate as 60Hz in pen touch mode (i.e., number 2-2) as an example, if the current touch scenario is detected as finger input, the frame rate control module can determine the corresponding touch mode as hand touch mode based on the finger input scenario. Therefore, the frame rate control module can select the refresh rate level closest to the current screen's refresh rate from the screen refresh rate levels supported in hand touch mode as the matching target refresh rate. For example, as shown in Table 3, the target refresh rate can be 60Hz in hand touch mode (i.e., number 1-2). This avoids excessively large differences in refresh rate level switching.
[0426] It is understandable that when the target refresh rate is 60Hz in touch mode, since the refresh rate level is the same (60Hz), the electronic device only needs to switch between different touch modes during the refresh rate switching process.
[0427] S1740, The electronic device adjusts the screen refresh rate to the target refresh rate.
[0428] In some embodiments, when the frame rate control module determines the target refresh rate, it can generate a refresh rate switching instruction and send it to the instruction sending module, which then sends the refresh rate switching instruction to the display driver in the kernel layer to complete the refresh rate switching.
[0429] Optionally, when the touch scenario changes, the target refresh rate determined by the frame rate control module is a refresh rate under different touch modes than the current screen refresh rate. Therefore, the generated refresh rate switching command involves switching the touch mode. For example, if the current screen refresh rate is the second refresh rate under hand touch mode, and the target refresh rate is the first refresh rate under pen touch mode, the generated refresh rate switching command can be the first refresh rate switching command 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 between different touch modes.
[0430] Optionally, when the generated refresh rate switching command involves not only switching the touch mode but also switching the frame rate level, if the current screen refresh rate exceeds the refresh rate level supported by the switched touch mode, the electronic device can first adjust the current screen refresh rate to the range supported by the switched touch mode before triggering the touch mode switch. For example, if the current screen refresh rate is 120Hz in touch mode, and the switch is to 60Hz in pen mode, the frame rate level is first reduced to 60Hz in touch mode. Then, the switch is made from 60Hz in touch mode to 60Hz in pen mode.
[0431] Optionally, when the touch scenario remains unchanged, the target refresh rate determined by the frame rate control module is the same as the refresh rate used by the current screen under the same touch mode. Therefore, the generated refresh rate switching command only involves switching the refresh rate level. The refresh rate can be changed directly by altering the VFP parameter in the display timing, i.e., the length of the frame end idle time.
[0432] In some embodiments, if refresh rate switching between different touch modes is involved, the frame rate control module can also generate a firmware switching instruction when determining the target refresh rate, and send the firmware switching instruction to the touch driver at the kernel level to complete the switching of the touch firmware's working mode. Optionally, the firmware switching instruction can also be sent to the instruction issuing module, which sends the firmware switching instruction to the display driver at the kernel level, instructing the display driver to simultaneously notify the touch driver to complete the switching of the touch firmware's working mode while completing the refresh rate switching.
[0433] In this embodiment, the electronic device can also pre-configure corresponding touch modes for some applications. Therefore, when one of these applications is running in the foreground, the target refresh rate can be matched directly according to the pre-configured touch mode of that application.
[0434] In some embodiments, the electronic device can also match the corresponding target refresh rate according to the touch mode configured in the whitelist. Optionally, the electronic device can 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 hand touch mode. Each application in the application whitelist corresponding to the pen touch mode is forcibly configured to pen touch mode.
[0435] When the first application running in the foreground of an electronic device is the first application, if the first application is included in the application whitelist corresponding to the touch mode, the electronic device can determine that the touch mode corresponding to the current scene is touch mode. Therefore, the electronic device can match the corresponding target refresh rate from the refresh rate levels supported by touch mode. The first application can be a game application, a video application, or other applications that do not require the use of a stylus.
[0436] When the application running in the foreground 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 pen touch mode. Therefore, the electronic device can match the corresponding target refresh rate from the refresh rate levels supported by pen touch mode. The second application can be a drawing application, a note-taking application, or any other application that requires the use of a stylus.
[0437] Optionally, the application whitelist stored in the electronic device can also include pre-configured touch modes corresponding to each application, 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 this application whitelist.
[0438] In one scenario, the whitelist service module of the electronic device's framework layer can determine in real time whether the application whitelist contains a foreground application configured with the corresponding touch mode. If the application whitelist contains a foreground application with the corresponding touch mode configured, 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 for the touch mode.
[0439] Optionally, the application whitelist can detect changes 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 for the touch mode.
[0440] In some embodiments, electronic devices may also combine a whitelist and the stylus usage status to match the corresponding target refresh rate.
[0441] Optionally, the electronic device can prioritize matching the target refresh rate based on the touch modes configured in the whitelist. When no foreground application's touch mode is configured in the application whitelist, the electronic device can determine the current touch scenario based on the stylus usage status. This allows it to determine the corresponding touch mode and then match the target refresh rate.
[0442] In one scenario, the frame rate control module in the framework layer can prioritize determining the target refresh rate suitable for the current touch scenario of the electronic device based on the touch mode configured in the whitelist service module. When the corresponding touch mode is not configured in the whitelist service module, the target refresh rate suitable for the current touch scenario of the electronic device is determined based on the stylus status information sent by the stylus service module.
[0443] In this way, electronic devices can combine the whitelist and the stylus usage status to achieve refresh switching between different touch modes.
[0444] It is understood that, in order to achieve the above-mentioned functions, electronic devices include hardware and / or software modules that perform the respective functions. Based on the algorithmic steps of the examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by 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 conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.
[0445] This application embodiment can divide the electronic device into functional modules according to the above method. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0446] Other embodiments of this application also provide a refresh rate switching device, which can be applied to the above-described electronic device. This device is used to perform various functions or steps executed by the electronic device in the above method embodiments.
[0447] Other embodiments of this application also provide a refresh rate switching system, which includes a stylus and the aforementioned electronic device.
[0448] Other embodiments of this application also provide an electronic device including the aforementioned stylus. The electronic device is used to perform various functions or steps performed by the electronic device in the above method embodiments.
[0449] This application also provides a chip system including at least one processor and at least one interface circuit. The processor and the interface circuit are interconnected via lines. 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 steps in the above embodiments. Of course, the chip system may also include other discrete devices, and this application does not specifically limit this.
[0450] This application also provides a computer storage medium that includes computer instructions. When the computer instructions are executed on the electronic device, the electronic device performs various functions or steps performed by the electronic device in the above method embodiments.
[0451] This application also provides a computer program product that, when run on a computer, causes the computer to perform various functions or steps performed by the electronic device in the above method embodiments.
[0452] In this embodiment, the stylus, electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0453] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0454] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0455] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A refresh rate switching method, characterized in that, Applied to an electronic device that supports a first touch mode and a second touch mode, the method includes: When the screen refresh rate is the first refresh rate of the first touch mode, a first refresh rate switching command is detected. The first refresh rate switching command 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. In response to the first refresh rate switching command, the graphics processor is controlled to perform layer compositing of the image to be displayed; The display processor is controlled 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; When the first refresh rate is greater than the second refresh rate, when refreshing and displaying the Nth frame image, the first refresh rate switching command is detected, where N is a positive integer; in response to the first refresh rate switching command, the display processor is controlled to perform layer compositing of the Nth frame image to obtain a first image to be displayed; the display processor is controlled 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 first image composed by the display processor is displayed at the second refresh rate of the first touch mode; When refreshing the display of the N+1th frame image, in response to the first refresh rate switching command, the graphics processor is controlled to perform layer compositing of the N+1th frame image to obtain a second image to be displayed; the display processor is controlled 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 the second image composed 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 user input via finger operation, and the pen touch mode is used to indicate that the electronic device supports user input via both finger operation and stylus operation.
3. The method according to claim 1 or 2, characterized in that, The method further includes: the first refresh rate is the same as the second refresh rate; or The first refresh rate is less than the second refresh rate.
4. The method according to claim 1 or 2, characterized in that, When the first refresh rate is less than the second refresh rate, the method further includes: When refreshing the display of the Nth frame image, the first refresh rate switching command is detected, where N is a positive integer; In response to the first refresh rate switching command, the graphics processor is controlled to perform layer compositing of the Nth frame image to obtain the first image to be displayed; The display processor is controlled 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 first image synthesized by the graphics processor is displayed at the first refresh rate of the second touch mode; When refreshing the display of the N+1th frame image, in response to the first refresh rate switching command, the display processor is controlled to perform layer compositing of the N+1th frame image to obtain the second image to be displayed; The display processor is controlled 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.
5. The method according to claim 1 or 2, characterized in that, The method further includes: Determine the status of the stylus; In response to the usage state switching from unused to used, or the usage state switching from used to unused, the first refresh rate switching instruction is generated.
6. The method according to claim 5, characterized in that, Determining the usage status of the stylus includes: Receive the stylus usage status sent by the stylus; or The usage status of the stylus is determined based on the detected connection status, magnetic state, and full charge status of the stylus.
7. The method according to claim 6, characterized in that, The usage status of the stylus is determined based on the detected connection status, magnetic state, and full charge status of the stylus, including: If the stylus is detected to be connected and magnetically attached to the electronic device, and the stylus is not fully charged, then the stylus is determined to be in use. If the stylus is detected to be connected and magnetically attached to the electronic device, and the stylus is fully charged, then the stylus is determined to be in an unused state. If the stylus is detected to be connected but not magnetically attached to the electronic device, then the stylus is determined to be in use. If it is detected that the stylus is not connected to the electronic device, then the stylus is determined to be in an unused state.
8. The method according to claim 5, characterized in that, The first touch mode is a hand touch mode, and the second touch mode is a pen touch mode. In response to the switching of the usage state from inactive to active, a first refresh rate switching command is generated, including: In response to the switching of the usage state from inactive to active, a matching screen refresh rate is determined from a plurality of refresh rates supported by the pen touch mode to be the second refresh rate; The first refresh rate switching instruction is generated based on the second refresh rate of the pen touch mode.
9. The method according to claim 5, characterized in that, The first touch mode is a pen touch mode, and the second touch mode is a hand touch mode. In response to the switching of the usage state from in use to in use, a first refresh rate switching command is generated, including: In response to the switching of the usage state from used to unused, a matching screen refresh rate is determined from a plurality of refresh rates supported by the hand touch mode as the second refresh rate; The first refresh rate switching instruction is generated based on the second refresh rate of the hand touch mode.
10. The method according to claim 5, characterized in that, The method further includes: When the foreground application is not in the preset whitelist, the first refresh rate switching instruction is generated in response to the switching of the usage state from inactive to active, or from active to inactive. When the foreground application is in the preset whitelist, the touch mode corresponding to the foreground application is matched from the preset whitelist; In response to the foreground application switching its touch mode from the first touch mode to the second touch mode, the first refresh rate switching instruction is generated.
11. The method according to claim 10, characterized in that, The first refresh rate switching instruction is generated in response to the foreground application switching its touch mode from the first touch mode to the second touch mode, including: In response to the foreground application switching its touch mode from the first touch mode to the second touch mode, the screen refresh rate is determined to be the second refresh rate from among multiple refresh rates supported by the second touch mode; The first refresh rate switching instruction is generated based on the second refresh rate of the second touch mode.
12. The method according to claim 1 or 2, characterized in that, The touch firmware of the electronic device supports a first operating mode and a second operating mode, wherein the first operating mode corresponds to the first touch mode and the second operating mode corresponds to the second touch mode, and the method further includes: In response to the first refresh rate switching command, the operating mode of the touch firmware is switched from the first operating mode to the second operating mode.
13. The method according to claim 1 or 2, characterized in that, The method further includes: After the screen refresh rate is switched to the second refresh rate of the second touch mode, the display processor is controlled to perform layer compositing 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.
14. An electronic device, characterized in that, The electronic device includes 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 performs the method as described in any one of claims 1-13.
15. An electronic device, characterized in that, The electronic device includes a stylus, and the electronic device performs the method as described in any one of claims 1-13.
16. A readable storage medium, characterized in that, Includes a program that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1-13.
Citation Information
Patent Citations
Image synthesis method and device, electronic equipment and storage medium
CN110413245A
Refresh rate control method and system and electronic equipment
CN113220154A