Display screen refreshing method and related device
By adjusting the refresh operation on the display screen of the electronic device according to the Vsync signal and image frame generation situation, the power consumption loss problem caused by the refresh rate being lower than the frame rate is solved, and power consumption reduction and equipment performance maintenance are achieved.
Patent Information
- Application Number
- CN202411296681.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-09-14
AI Technical Summary
The display screen of an electronic device may cause power consumption loss when refreshing the display screen, especially when the image frame is not generated for a long time or the frame rate is lower than the refresh rate, causing the display to repeatedly refresh the same screen, increasing power consumption.
By maintaining the displayed image frame on the display screen without performing a refresh action until the next Vsync signal is received and performing a refresh operation when a new image frame is generated, or setting a threshold limit to the number of times not refreshed between consecutive Vsync signals, reduce Refresh rate to reduce power consumption.
It effectively reduces the power consumption loss of electronic devices, avoids the splash screen problem caused by the long-term failure of the display screen to refresh, maintains equipment performance and reduces the refresh rate.
Smart Images

Figure CN119091828A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a display screen refresh method and related devices. Background Art
[0002] After the electronic device generates the image frame, it sends it to the display screen, which can refresh the display screen according to the refresh rate, thereby presenting a continuous and smooth display effect. For example, the display screen of the electronic device can refresh the display screen at a fixed refresh rate of 60Hz, 90Hz or 120Hz.
[0003] However, refreshing the display screen of an electronic device may cause a large power consumption loss problem. For example, if an electronic device does not generate image frames for a long time, or generates image frames at an extremely low frame rate, the display screen of the electronic device may still display repeated images after being refreshed many times. For another example, an electronic device continuously generates image frames, but the frame rate may be lower than the refresh rate. For example, an electronic device plays a video, and the video includes multiple continuous video frames (ie, image frames). The frame rate of the video is lower than the refresh rate of the electronic device, which may cause the display screen of the electronic device to refresh twice or more times before displaying a new image. The above situations will all lead to power consumption loss of the electronic device. Summary of the invention
[0004] In order to solve the above problems, the present application provides a display screen refresh method and related devices, the purpose of which is to reduce the power consumption loss of electronic equipment.
[0005] In a first aspect, the present application provides a method for refreshing a display screen, which can be applied to electronic devices, such as mobile phones, tablet computers, laptop computers, etc. The electronic device may include a first application and a display screen, such as a first application may be a video playback application, a social communication application, a consulting and reading application, etc.
[0006] In this method, during the process of displaying a first image frame on a display screen, a first application can generate a second image frame; at a first moment, the electronic device obtains a first Vsync signal, and then, in response to the first Vsync signal, the electronic device can refresh and display the second image frame on the display screen; the first application does not generate an image frame after the first moment until a second moment, and at a second moment, the electronic device obtains a second Vsync signal, and then, in response to the second Vsync signal, the electronic device may not perform a refresh action on the display screen and maintain displaying the second image frame, wherein the first moment is later than the second moment.
[0007] For example, there is a display cycle between two consecutive Vsync signals. In display cycle 1, the display screen displays the first image frame, and the first application generates the second image frame. At the first moment, the electronic device obtains the first Vsync signal, indicating that display cycle 1 ends and enters display cycle 2. In response to the first Vsync signal, the electronic device can refresh and display the second image frame newly generated by the first application on the display screen. In display cycle 2, the display screen displays the second image frame, and the first application does not generate an image frame. At the second moment, the electronic device obtains the second Vsync signal, indicating that display cycle 2 ends and enters display cycle 3. In display cycle 2 between the first moment and the second moment, the first application does not generate an image frame. In display cycle 3, the electronic device can respond to the second Vsync signal and not perform a refresh action on the display screen, and maintain displaying the second image frame.
[0008] In this way, when the first application does not generate an image frame, the display screen may not perform a refresh action and still maintain displaying the previous second image frame, thereby avoiding power consumption loss caused by the display screen performing a refresh action and still displaying repeated image frames.
[0009] In one possible implementation, the method for refreshing the display screen may further include: while the display screen maintains displaying the second image frame, the first application generates a third image frame; at a third moment, the electronic device obtains a third Vsync signal, and the electronic device can refresh and display the third image frame on the display screen in response to the third Vsync signal.
[0010] For example, a display cycle is between two consecutive Vsync signals, and in display cycle 3 after the second moment, the second image frame is displayed on the display screen. At the third moment, the electronic device obtains a third Vsync signal, indicating that display cycle 3 ends and enters display cycle 4. In display cycle 3 between the second moment and the third moment, the first application generates a third image frame. In display cycle 4, the electronic device responds to the third Vsync signal and can perform a refresh action on the display screen to refresh and display the third image frame.
[0011] In this way, when the first application generates a new image frame, the third image frame, the electronic device can normally perform a refresh action on the display screen to refresh and display the third image frame to avoid affecting the normal display of the new image frame.
[0012] In one possible implementation, the method for refreshing the display screen may further include: between the first moment and the fourth moment, the first application does not generate an image frame, and at the fourth moment, the electronic device obtains a fourth Vsync signal, and the electronic device can refresh and display the second image frame on the display screen in response to the fourth Vsync signal.
[0013] For example, there is a display cycle between two consecutive Vsync signals. In display cycle 3 after the second moment, no refresh action is performed on the display screen, and the second image frame is displayed. At the fourth moment, the electronic device obtains a fourth Vsync signal, indicating that display cycle 3 ends and enters display cycle 4. In display cycle 3 between the second moment and the fourth moment, the first application does not generate an image frame. In display cycle 4, the electronic device responds to the fourth Vsync signal and can perform a refresh action on the display screen to refresh and display the second image frame.
[0014] In this way, when the electronic device does not perform a refresh operation on the display screen to maintain the display of the second image frame, but the first application continues to fail to generate a new image frame, the electronic device can perform a refresh operation on the display screen again to refresh the display of the repeated second image frame, thereby avoiding problems such as screen flickering caused by not refreshing the display screen for a long time, and maintaining the performance of the electronic device.
[0015] In one possible implementation, between the first moment and the fourth moment, the first application does not generate an image frame, and the electronic device obtains N Vsync signals, where N is greater than 0, for example, N=1, and at the second moment between the first moment and the fourth moment, the electronic device obtains a second Vsync signal; for example, N=2, and at the second moment between the first moment and the fourth moment, the electronic device obtains a second Vsync signal, and at a moment between the second moment and the fourth moment, the electronic device may obtain another Vsync signal, and in response to the Vsync signal, the electronic device may also maintain display of the second image frame without performing a refresh action on the display screen.
[0016] This means that the electronic device may not perform a refresh action on the display screen once or multiple times and maintain displaying the second image frame. Then, when the first application continues to fail to generate a new image frame, the electronic device may perform a refresh operation on the display screen again to refresh and display the repeated second image frame. This can further reduce power consumption losses and avoid problems such as screen flickering caused by not refreshing the display screen for a long time.
[0017] In one possible implementation, before the electronic device responds to the fourth Vsync signal and refreshes and displays the second image frame on the display screen, the refreshing method of the display screen also includes: the electronic device determines that the number of times the display screen does not perform a refresh action reaches a first threshold, for example, determining that the number of times the display screen does not perform a refresh action continuously reaches the first threshold.
[0018] For example, the first threshold is 1, and there is one display cycle between two consecutive Vsync signals. In display cycle 3 after the second moment, no refresh action is performed on the display screen, and the second image frame is displayed. At the fourth moment, the electronic device obtains a fourth Vsync signal, indicating that display cycle 3 ends and enters display cycle 4. In display cycle 3 between the second moment and the fourth moment, the first application does not generate an image frame, and the number of times the display screen does not perform a refresh action reaches 1. In display cycle 4, the electronic device can perform a refresh action on the display screen in response to the fourth Vsync signal to refresh and display the second image frame.
[0019] Exemplarily, the number of times the display screen does not refresh can be determined by the number of frame skips. The electronic device can calculate the number of frame skips in response to the Vsync signal. Based on the above example and taking the frame skip number of 1 as an example, in display cycle 3 after the second moment, no refresh action is performed on the display screen, and the second image frame is maintained for display. It is determined that the number of times the display screen does not refresh is 1, and the electronic device can reduce the number of frame skips by 1; in display cycle 4, the electronic device responds to the fourth Vsync signal and determines that the number of frame skips is 0, and further determines that the number of times the display screen does not refresh reaches 1, and the electronic device can perform a refresh action on the display screen to refresh and display the second image frame.
[0020] For example, the first threshold is 2, and there is one display cycle between two consecutive Vsync signals. In display cycle 3 after the second moment, no refresh action is performed on the display screen, and the second image frame is kept displayed. In display cycle 4 after display cycle 3, no refresh action is performed on the display screen, and the second image frame is kept displayed. At the fourth moment, the electronic device obtains the fourth Vsync signal, indicating that display cycle 4 ends and enters display cycle 5. In display cycle 3 and display cycle 4 between the second moment and the fourth moment, the first application does not generate an image frame, and the number of times the display screen does not perform a refresh action continuously reaches 2. In display cycle 5, the electronic device can perform a refresh action on the display screen in response to the fourth Vsync signal to refresh and display the second image frame.
[0021] In this way, the number of times the display screen does not perform a refresh action can be limited based on the first threshold, which can more accurately avoid problems such as the display screen flickering caused by not refreshing the display screen for a long time, thereby maintaining the performance of the electronic device.
[0022] In one possible implementation, in a first period between a first moment and a second moment, the first period is a display period, and the display screen continuously displays the second image frame. The method for refreshing the display screen further includes: between the first moment and a fifth moment, the first application does not generate an image frame, and at the fifth moment, the electronic device obtains a fifth Vsync signal, and the electronic device can refresh and display the second image frame on the display screen in response to the fifth Vsync signal; at a sixth moment, the electronic device obtains a sixth Vsync signal; in a second period between the fifth moment and the sixth moment, the second period is a display period, and the display screen continuously displays the second image frame; the duration of the first period is less than the duration of the second period, indicating that the refresh frequency of the electronic device on the display screen has become lower, and the refresh rate has decreased.
[0023] In this way, when the electronic device does not perform a refresh operation on the display screen to maintain display of the second image frame, but the first application continues to fail to generate a new image frame, the electronic device can perform a refresh operation on the display screen again to refresh and display the repeated second image frame and reduce the refresh rate. The electronic device can continue to display the second image frame for a longer time between the fifth moment and the sixth moment, thereby reducing the power consumption of the electronic device.
[0024] In one possible implementation, between the first moment and the fifth moment, the first application does not generate an image frame, and the electronic device obtains L Vsync signals, where L is greater than 0, for example, L=2. At a second moment between the first moment and the fifth moment, the electronic device obtains a second Vsync signal. At a moment between the second moment and the fifth moment, the electronic device can obtain another Vsync signal, and in response to the Vsync signal, the electronic device can refresh and display a second image frame for a longer time on the display screen before the sixth moment arrives.
[0025] In this way, when the first application continues not to generate new image frames, the electronic device can reduce the refresh rate and continue to display the second image frame for a longer time between the fifth moment and the sixth moment, which can reduce the power consumption of the electronic device.
[0026] In one possible implementation, before the electronic device responds to the fifth Vsync signal and refreshes and displays the second image frame on the display screen, the method for refreshing the display screen also includes: determining that the number of display cycles in which the first application has not continuously generated image frames reaches a second threshold, and the display cycle refers to the length of time between the electronic device continuously obtaining two Vsync signals.
[0027] For example, the electronic device obtains two Vsync signals at time 1 and time 2 respectively, and the electronic device does not obtain any Vsync signal between time 1 and time 2, and the period between time 1 and time 2 is the display period.
[0028] Exemplarily, the second threshold is 3, the first application does not generate an image frame in three consecutive display cycles, the electronic device obtains the fifth Vsync signal, indicating that the third display cycle of the three consecutive display cycles ends and enters the next display cycle, and the electronic device responds to the fifth Vsync signal to refresh and display the second image frame on the display screen.
[0029] In this way, when the number of display periods in which the first application does not continuously generate image frames reaches a second threshold, it can be considered that the electronic device is in low power consumption, and the refresh rate of the display screen can be reduced, thereby reducing the power consumption of the electronic device.
[0030] In one possible implementation, the refresh method of the display screen also includes: at the seventh moment, the electronic device obtains the seventh Vsync signal, and the electronic device determines, in response to the seventh Vsync signal, that the first application has not generated an image frame between the second moment and the seventh moment, indicating that no new image frame has been generated after the second image frame; and the electronic device determines that the number of display cycles in which the first application has not generated image frames continuously has not reached a second threshold, where the display cycle refers to the length of time between two consecutive Vsync signals obtained by the electronic device, indicating that the electronic device may not need to reduce the refresh rate; and the electronic device determines that the number of times the display screen does not perform a refresh action has not reached a first threshold, indicating that a refresh action can be performed on the display screen. Subsequently, the electronic device does not perform a refresh action on the display screen, and maintains displaying the second image frame.
[0031] In this way, when it is determined that the first application has not generated an image frame, that the electronic device does not need to lower the refresh rate, and that the refresh action can be performed without executing the display screen, the electronic device does not execute the refresh action on the display screen and maintains displaying the second image frame. On the one hand, this avoids affecting the normal display of the image frame, and on the other hand, it avoids problems such as screen flickering caused by the electronic device not executing the refresh action on the display screen for a long time.
[0032] In a possible implementation, the refresh method of the display screen also includes: at the eighth moment, the electronic device obtains the eighth Vsync signal, and the electronic device responds to the eighth Vsync signal, and when it is determined that the first application generates an image frame between the second moment and the eighth moment, it indicates that there is a new image frame to be displayed; or, the electronic device determines that the number of display cycles in which the first application does not continuously generate an image frame reaches a second threshold, and the display cycle refers to the length of time between the electronic device continuously obtaining two Vsync signals, and it can be considered that the electronic device is in a low power consumption state and can reduce the refresh rate; or, the electronic device determines that the number of times the display screen does not perform a refresh action reaches a first threshold. If any of the above three conditions is met, the electronic device refreshes and displays the image frame on the display screen. Among them, if the first condition is met, the electronic device can refresh and display the latest image frame generated by the first application on the display screen, and if the second condition or the third condition is met, the electronic device can refresh and display the second image frame on the display screen.
[0033] In this way, when it is determined that the first application generates an image frame, or when it is determined that the electronic device will reduce the refresh rate, or when it is determined that the number of times a refresh action is not performed on the display screen reaches a first threshold, the electronic device performs a refresh action on the display screen to display the image frame. On the one hand, it normally displays the newly generated image frame of the first application, and on the other hand, it avoids problems such as screen flickering caused by the electronic device not performing a refresh action on the display screen for a long time.
[0034] In a possible implementation, the refresh method of the display screen further includes: calculating a first threshold value based on a ratio of a refresh rate of the second image frame to a minimum refresh rate. For example, the first threshold value is obtained based on the ratio of the refresh rate of the second image frame to the minimum refresh rate minus 1. In this way, the first threshold value is calculated by considering the refresh rate of the electronic device refreshing the second image frame on the display screen, so as to avoid the display screen not performing a refresh action too many times, causing the refresh rate of the electronic device to be lower than the latest refresh rate, thereby avoiding problems such as screen flickering in the electronic device.
[0035] In a second aspect, the present application provides an electronic device, which includes a memory and a processor; the memory stores computer program code, and the computer program code includes computer instructions; one or more processors call computer instructions to enable the electronic device to execute the display screen refresh method of the first aspect above.
[0036] In a third aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method for refreshing a display screen according to the first aspect is implemented.
[0037] In a fourth aspect, the present application provides a computer program product, which includes a computer program code. When the computer program code is executed by an electronic device, the method for refreshing a display screen of the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of a display screen refresh method provided in the related art;
[0039] Figure 2 A schematic diagram of another display screen refresh method provided in the related art;
[0040] Figure 3a A signaling interaction diagram of a display screen refresh method provided in an embodiment of the present application;
[0041] Figure 3b A software architecture diagram of an electronic device provided in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of a refresh rate provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of an image frame transmission and display provided in an embodiment of the present application;
[0044] Figure 6 A signaling interaction diagram of another display screen refresh method provided in an embodiment of the present application;
[0045] Figure 7 A schematic diagram of a display screen refresh method provided in an embodiment of the present application;
[0046] Figure 8 A schematic diagram of the judgment logic of a display screen refresh method provided in an embodiment of the present application;
[0047] Fig. 9 A schematic diagram of the judgment logic of another display screen refresh method provided in an embodiment of the present application;
[0048] Fig.10 A signaling interaction diagram of another display screen refresh method provided in an embodiment of the present application;
[0049] Fig.11 A schematic diagram of another display screen refresh method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the description of the following embodiments clear and concise, the vocabulary involved in the embodiments of the present application is first explained. It should be understood that this explanation is for a clearer understanding of the embodiments of the present application and does not necessarily constitute a limitation on the embodiments of the present application.
[0051] Refresh rate: refers to the number of times the display screen of an electronic device refreshes an image frame per second. For example, if the refresh rate of an electronic device is 60 Hz, it means that the display screen of the electronic device can refresh and display an image frame 60 times per second.
[0052] Frame rate: refers to the number of image frames that an electronic device can generate and send to the display per second. For example, if the video playback application of an electronic device plays a video with a frame rate of 30fps, it means that the electronic device can send 30 frames of the video to the display screen within 1 second, and the display screen of the electronic device can display these 30 frames of the video in 1 second.
[0053] Vsync (Vertical Synchronization) signal: refers to a synchronization pulse signal sent by the electronic device before the display screen of the electronic device refreshes a frame of image. In some embodiments, the electronic device can send a Vsync signal based on the refresh rate. For example, if the refresh rate of the electronic device is 60 Hz, the electronic device can send a Vsync signal 60 times per second.
[0054] Display cycle: refers to the duration of time that the electronic device displays the video between the moments corresponding to the two consecutive Vsync signals when the electronic device receives two consecutive Vsync signals.
[0055] In the related art, the refresh rate of an electronic device may be the same as the frame rate. The display screen of the electronic device is refreshed once based on the refresh rate, and the display screen can display a new image frame, which can provide a smoother visual experience. However, it is also possible that the frame rate of the electronic device is lower than the refresh rate.
[0056] In scenarios such as the electronic device being on a static desktop, in the application interface of an e-book application, or in the application interface of a browser application, the display screen of the electronic device may display a static picture for a long time, that is, display repeated image frames for a long time, and the electronic device may not generate new image frames for a long time, or the frame rate of generated image frames may be extremely low.
[0057] like Figure 1As shown, the electronic device displays image frame 0 in the first display cycle, and the electronic device can generate image frame 1 in the first display cycle. The process of generating image frame 1 includes: the GPU of the electronic device can first render to obtain the various layers of image frame 1, and the CPU of the electronic device can then synthesize the various layers of image frame 1 to obtain image frame 1; the electronic device can enter the second display cycle after receiving the Vsync signal, and the display screen LCD can refresh and display image frame 1. Similarly, the electronic device can generate image frame 2 in the second display cycle, and the electronic device can display image frame 2 in the third display cycle. After the third display cycle, no new image frame has been generated, and the display screen of the electronic device will refresh and repeatedly display image frame 2 based on a preset refresh rate.
[0058] Based on the scenario described above, it is shown that the display screen of the electronic device refreshes the display screen based on the refresh rate. It may appear that repeated images are still displayed after multiple refreshes. The display screen will refresh the same image frame multiple times, causing the electronic device to waste unnecessary power consumption and cause power loss.
[0059] When an electronic device is playing a video, the display screen of the electronic device will continuously update the image and display new image frames, but the frame rate of the video may be lower than the refresh rate, causing the display screen to display repeated images after refreshing.
[0060] like Figure 2 As shown, for example, the frame rate of the video is 30fps, and the refresh rate of the electronic device is 60Hz. The electronic device displays image frame 0 in the first display cycle, and the electronic device can generate image frame 1 in the first display cycle; the electronic device receives the Vsync signal and can enter the second display cycle, the display screen can refresh and display image frame 1, and the electronic device can generate image frame 2 in the second display cycle; the electronic device receives the Vsync signal and can enter the third display cycle, the display screen can refresh and display image frame 2, and the electronic device does not generate a new image frame in the third display cycle; the electronic device receives the Vsync signal and can enter the fourth display cycle, the display screen will refresh and display repeated image frame 2, and the electronic device can generate image frame 3 in the fourth display cycle, and so on, and the subsequent electronic device will refresh and display the same picture twice for the same image frame.
[0061] Based on the scenario introduced above, it shows that the display screen of the electronic device refreshes the display screen based on the refresh rate, and it may be refreshed twice or even more times to display a new screen. The display screen may refresh twice or even more times for the same image frame, which also causes the electronic device to waste unnecessary power consumption and cause power loss.
[0062] Therefore, in order to solve the above problems, an embodiment of the present application provides a method for refreshing a display screen. When the electronic device did not generate a new image frame in the previous display cycle, the electronic device may not refresh and display repeated image frames on the display screen in the current display cycle. This can also be called performing a frame skipping operation to reduce power consumption loss.
[0063] The refresh rate modes of the electronic device are first introduced, including the idle mode and the adaptive refresh rate mode provided in the embodiments of the present application.
[0064] When the electronic device is in the adaptive refresh rate mode, when a new image frame is generated in each display cycle of the electronic device, the display screen of the electronic device may refresh the displayed image frame based on the preset refresh rate, and when a new image frame is not generated in the display cycle of the electronic device, the display screen may not refresh the display, that is, perform a frame skipping operation. Figure 3a This is described in detail in the embodiment 1 shown. For example, when the adaptive refresh rate flag is True or 1, it indicates that the electronic device is in the adaptive refresh rate mode.
[0065] When the electronic device is in idle mode and no new image frames are generated during the display cycle of the electronic device, the display screen will refresh and display repeated image frames based on the refresh rate, and frame skipping cannot be performed. Fig.10 This is described in detail in the third embodiment shown. For example, when the adaptive refresh rate flag is False or 0, it indicates that the electronic device is in idle mode.
[0066] It should be noted that when the idle mode flag bit is False, it indicates that the electronic device is in adaptive refresh rate mode; when the idle mode flag bit is True, it indicates that the electronic device is in idle mode. This application does not limit this.
[0067] Next, combine Figure 3a-Figure 11 The refreshing method of a display screen provided in an embodiment of the present application is described in detail.
[0068] Embodiment 1:
[0069] The following describes a method for refreshing a display screen in a current display cycle by taking an example where an electronic device is in an adaptive refresh rate mode and generates a new image frame in a previous display cycle.
[0070] like Figure 3bAs shown, the operating system of the electronic device is an Android system as an example. The Android system can adopt a layered architecture, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into five layers, from top to bottom, respectively, the application (Application, APP) layer, the application framework layer (also known as the native framework Native layer), the hardware abstraction layer (Hardware Abstraction Layer, HAL), the driver layer (also known as the kernel Kernel layer) and the hardware layer. It should be noted that the mobile phone can also run the iOS operating system, and this application does not limit this.
[0071] In some embodiments, the application layer includes a first application, the Native layer includes a display engine service SurfaceFlinger, the HAL layer includes a compositor HardwareComposer (HWC for short), the Kernel layer includes a display driver, and the hardware layer includes a display screen.
[0072] like Figure 3a As shown, combined Figure 3b The software structure of the electronic device shown in the figure, the method for refreshing the display screen may include the following steps:
[0073] S301: The first application stores image data in a rendering buffer.
[0074] Image data is used to describe the properties of the image frame to be generated, such as pixel value, color, transparency, etc. Rendering buffer is used to temporarily store image data.
[0075] In some embodiments, the image data may be obtained by drawing for the first application. For example, the first application is a social communication application, a gallery application, a consulting reading application, etc. The first application may draw image data of the application interface. For example, the consulting reading application may draw the text of the e-book in response to the user's viewing operation of the e-book; for another example, the social communication application may draw pinyin characters, emoticons, etc. in response to the user's triggering operation of the chat box.
[0076] In some embodiments, the image data may also be obtained by decoding the first application. For example, the first application may be a video playback application, and the video playback application may decode the video to obtain the image data in response to a user's operation of playing the video.
[0077] S302: SurfaceFlinger reads image data from the rendering buffer.
[0078] In some embodiments, SurfaceFlinger can read image data from the rendering buffer for rendering based on the refresh rate. For example, if the refresh rate is 60 Hz, SurfaceFlinger can read image data from the rendering buffer for rendering 60 times in 1 second, and read image data from the rendering buffer and render it every 16.7 ms.
[0079] The mipi driver can send an APP_Vsync signal to SurfaceFlinger based on the refresh rate. For example, if the refresh rate is 60Hz, the mipi driver can send an APP_Vsync signal to SurfaceFlinger every 16.7ms. SurfaceFlinger can read image data from the rendering buffer and render it in response to the APP_Vsync signal.
[0080] like Figure 3b As shown, the mipi driver may also be called a display serial interface (DSI) driver. The display driver includes the DSI driver. The DSI driver may call the DSI interface of the hardware layer to send an APP_Vsync signal to SurfaceFlinger.
[0081] S303: SurfaceFlinger renders multiple layers based on the image data.
[0082] In some embodiments, SurfaceFlinger can call a graphics processing unit (GPU) to render multiple layers based on image data.
[0083] Exemplarily, taking the first application as a video playback application as an example, the multiple layers may include video frames, a progress bar, a comment area, and the like.
[0084] It should be noted that SurfaceFlinger rendering multiple layers based on image data is only an example. SurfaceFlinger may also render one layer based on image data, and this application does not limit this.
[0085] S304: SurfaceFlinger calls HWC to synthesize multiple layers to obtain an image frame.
[0086] In some embodiments, SurfaceFlinger may also call HWC based on the refresh rate to synthesize multiple layers to obtain an image frame.
[0087] For example, the mipi driver can send a SF_Vsync signal to SurfaceFlinger based on the refresh rate. For example, if the refresh rate is 60Hz, the mipi driver can send a SF_Vsync signal to SurfaceFlinger every 16.7ms. SurfaceFlinger can call HWC to synthesize multiple layers to obtain an image frame in response to the APP_Vsync signal.
[0088] like Figure 3b As shown, the DSI driver can call the DSI interface of the hardware layer to send the SF_Vsync signal to SurfaceFlinger.
[0089] S305: SurfaceFlinger sends commit to the display driver through HWC.
[0090] Commit is used to instruct the display driver that a new image frame has been synthesized.
[0091] In some embodiments, commit may carry a preset refresh rate, such as a refresh rate for displaying video frames.
[0092] S306: The display driver updates the synthesis flag bit to 1 and the idle flag bit to 0 in response to commit.
[0093] The synthesis flag bit is used to indicate the synthesis state of the image frame. For example, if the synthesis flag bit is 1, it indicates that a new image frame is synthesized, and if the synthesis flag bit is 0, it indicates that no new image frame is synthesized.
[0094] It should be noted that the synthesis flag bit being 1 or 0 is only an example and may be other values as long as it can distinguish whether a new image frame is synthesized.
[0095] Commit is sent by surfaceFlinger to the display driver through HWC after the image frame is synthesized, so the display driver can update the synthesis mark bit to 1 in response to commit.
[0096] Idle means that the electronic device is in a low power consumption state, for example, the electronic device will not generate new image frames for a long time, or will generate new image frames at an extremely low frame rate.
[0097] In order to solve this problem, when the electronic device is idle, the electronic device can enter an idle mode and reduce the refresh rate, which can also be called lowering the refresh rate.
[0098] The idle flag is used to count the display cycles in which no new image frames are generated. The idle flag is equal to M, indicating that the electronic device has not generated new image frames within M-1 consecutive display cycles (it can also be called that the number of consecutive display cycles in which no image frames are generated reaches the second threshold), and it can be considered that the electronic device is in a low power consumption state and the electronic device will enter the idle mode. The idle flag is less than M, indicating that the electronic device will not enter the idle mode. M can be any pre-set value greater than 1.
[0099] The display driver receives commit, indicating that a new image frame is generated. The electronic device does not need to enter the idle mode, and the idle flag bit can be recounted, so the display driver can update it to 0.
[0100] It should be noted that the updating of the idle flag bit to 0 by the display driver upon receiving commit is only an example, and may also be updated to other values, which may indicate re-counting of the display cycles during which the electronic device has not received commit continuously.
[0101] For an introduction to the idle mode, please refer to the detailed description of Example 3 below, which will not be expanded here.
[0102] S307: SurfaceFlinger stores the image frame in the display buffer.
[0103] The rendering buffer is used to temporarily store image frames.
[0104] SurfaceFlinger stores the synthesized image frame in the display buffer through HWC.
[0105] It should be noted that, when SurfaceFlinger obtains a layer based on image data rendering, SurfaceFlinger can also call HWC to store the image frame in the display buffer without executing S304.
[0106] S308: The display driver reads the image frame synthesized by the HWC from the display buffer.
[0107] In some embodiments, the display driver may read the image frame in response to commit. Accordingly, S307 may be performed first, and then S305 may be performed.
[0108] S309: The display driver receives a Vsync signal.
[0109] In some embodiments, S301 - S308 described above may be executed in the previous display cycle. When the display driver receives the Vsync signal, it indicates that the previous display cycle ends and the current display cycle will begin.
[0110] Combination Figure 1 As shown, for example, the electronic device generates a new image frame 2 in the second display cycle. After receiving the Vsync signal, it indicates that the second display cycle ends and the third display cycle will begin.
[0111] In some embodiments, the mipi driver may send a Vsync signal to the display driver based on a refresh rate. For example, if the refresh rate is 120 Hz, the mipi driver may send a Vsync signal to the display driver every 8.3 ms.
[0112] like Figure 3b As shown, the mipi driver can call the DSI interface of the hardware layer to send a Vsync signal to the display driver.
[0113] The Vsync signal, APP_Vsync signal and SF_Vsync signal mentioned above are all sent based on the refresh rate, but there are some differences in the phases of the three. For example, after the mipi driver sends the APP_Vsync signal to SurfaceFlinger, the mipi driver sends the SF_Vsync signal to SurfaceFlinger after 2ms, and the display driver sends the Vsync signal to the display driver after 2ms.
[0114] S310: The display driver responds to the Vsync signal and sets the idle flag bit to +1.
[0115] Based on the introduction of S306 above, the idle flag is used to count the display cycles in which no new image frames are generated. After receiving the Vsync signal, the display driver can add 1 to the idle flag. The idle flag is 1, indicating that a new image frame is generated in the previous cycle, and there is no need to enter the idle mode next time.
[0116] It should be noted that the idle flag bit +1 is only an example, and other values can also be added as long as counting can be achieved.
[0117] S311: The display driver determines whether the idle flag is equal to M, otherwise executes S312.
[0118] Based on the introduction of S310, the idle flag bit is 1, and M is a value greater than 1, so the display driver can determine that the idle flag bit is not equal to M and can continue to execute S312.
[0119] It should be noted that, for an example in which the idle flag bit is equal to M, reference may be made to the description of Embodiment 3 below.
[0120] It should be emphasized that S311 is an optional execution step and may not be executed when the synthesis mark bit is 1.
[0121] S312: The display driver determines that the synthesis mark bit is 1, and sends the image frame and the clock signal to the display screen.
[0122] It should be understood that the time for the display driver to send an image frame is usually fixed, and the display driver can send a clock signal to the display screen to fill the display cycle during the remaining time of a display cycle. The clock signal has the same number of rows and columns as the resolution of the image frame. The clock signal is non-display data, and the display screen does not need to display a response after receiving the clock signal.
[0123] like Figure 4 As shown, at different refresh rates, the duration of the display driver sending image frames to the display screen is fixed, for example, 7ms. The refresh rate of the electronic device is 120Hz, the duration of a display cycle is about 8.3ms, and the remaining 1.3ms display driver can send a clock signal to the display screen; the refresh rate of the electronic device is 60Hz, the duration of a display cycle is about 16.7ms, and the remaining 9.7ms display driver can send a clock signal to the display screen; the refresh rate of the electronic device is 30Hz, the duration of a display cycle is about 26.7ms, and the remaining 19.7ms display driver can send a clock signal to the display screen.
[0124] Based on the introduction of S306 above, the synthesis mark bit is updated to 1, indicating that a new image frame is generated in the previous display cycle, and the new image frame can be displayed in the current display cycle, so the display driver can send the image frame and clock signal to the display screen based on the preset refresh rate.
[0125] S313: In response to receiving the image frame and the clock signal, the display screen refreshes the display image based on a preset refresh rate.
[0126] When the display screen receives the image frame, it can refresh the display screen based on a preset refresh rate to show the user the content corresponding to the image frame.
[0127] S314: The display driver updates the synthesis flag bit to 0.
[0128] The new image frame has been sent to the display screen. In the absence of a new image frame, the display driver can reset the synthesis flag bit and update it to 0.
[0129] Combination Figure 3bAs shown, HWC may include a commit module, and SurfaceFlinger may send a commit to the display driver through the commit module, that is, execute S305 described above. The display driver includes a judgment driver and a DSI driver. The judgment driver may execute S306, S308, S310-S312, S314 described above, and the DSI driver may execute S309 described above.
[0130] Combination Figure 5 As shown, the electronic device includes an AP (indicating the part of the electronic device other than the display screen) and a module (including a display screen panel). The DSI can send an APP_Vsync signal to render a layer. The DSI can send an SF_Vsync signal to synthesize an image frame. Then the DSI interface can send the image frame to the panel for display. For related detailed introduction, please refer to Example 1, which will not be repeated here.
[0131] In addition, it should be understood that in the embodiment of the present application, if the electronic device does not generate a new image frame in a display cycle, the display screen will not be refreshed in the next display cycle, and frame skipping will be performed to reduce power consumption loss (for relevant details, please refer to Example 2). However, if the electronic device does not generate a new image in multiple consecutive display cycles, continuous frame skipping is likely to cause problems such as screen flickering on the display screen, so a frame skipping number can be pre-set to avoid excessive frame skipping on the display screen.
[0132] Therefore, in order to solve this problem, the display driver can calculate the number of frame skips. In some embodiments, the number of frame skips can be calculated based on the current refresh rate of the electronic device (also referred to as the refresh rate of the second image frame, the refresh rate of the second image frame is the refresh rate of the latest image frame generated by the first application) and the minimum refresh rate. In the display cycle of generating a new image frame, the display driver can determine the current refresh rate based on the refresh rate carried by the commit. In the display cycle where no new image frame is generated, the display driver can determine the current refresh rate based on the refresh rate carried by the most recent commit in the previous display cycle, and the ratio of the current refresh rate to the minimum refresh rate is rounded down minus 1 as the number of frame skips.
[0133] For example, the current refresh rate is 120Hz, the minimum refresh rate is 30Hz, and the calculated number of frame skips is 3; the current refresh rate is 60Hz, the minimum refresh rate is 30Hz, and the calculated number of frame skips is 1; the current refresh rate is 40Hz, the minimum refresh rate is 30Hz, and the calculated number of frame skips is 0.
[0134] In some embodiments, after the display driver receives a Vsync signal, the display driver calculates the number of frame skips once, that is, it can be calculated once in each display cycle, and this application does not limit this.
[0135] In the embodiment of the present application, considering that the number of frame skipping is related to the current refresh rate, the display driver can calculate the number of frame skipping once after obtaining the refresh rate carried by a commit, so as to use it in the display cycle in which the frame skipping will be performed. For relevant examples, please refer to the introduction of the second embodiment. For example, the calculation is performed after executing S312, and the present application does not limit this. It can also be calculated once in each display cycle, and it can also be calculated in the display cycle in which no new image frame is generated.
[0136] In this way, when the electronic device is in the adaptive refresh rate mode, the electronic device generates a new image frame and can display the new image frame normally to avoid affecting the normal display of the new image frame.
[0137] It should be noted that, during the execution of S312, even if the number of frame skipping is greater than 0, when the synthesis flag bit is 1, that is, when the first application generates a new image frame, the electronic device will refresh the display screen on the display screen, that is, refresh and display the screen corresponding to the new image frame (also referred to as refreshing the display image frame), which can be referred to in Example 2. Figure 7 Related instructions.
[0138] Embodiment 2:
[0139] The following introduces a method for refreshing the display screen in the current display cycle and the next display cycle by taking an example in which the electronic device is in an adaptive refresh rate mode, the electronic device does not generate new image frames in the previous display cycle, the current display cycle, and the next display cycle, and the image frames are displayed normally in the previous display cycle, and the number of frame skips is 1.
[0140] like Figure 6 As shown, combined Figure 3b The software structure of the electronic device shown in the figure, the method for refreshing the display screen may include the following steps:
[0141] S601: The display driver receives a Vsync signal.
[0142] The electronic device did not generate a new image frame in the previous display cycle, and the display driver received the Vsync signal, indicating that the previous display cycle ended and the current display cycle will begin.
[0143] Combination Figure 7As shown, for example, the last display cycle of the second embodiment is the third display cycle. In the second display cycle, the first application generates image frame 2 (also referred to as the second image frame), and the display screen displays image frame 1 (also referred to as the first image frame). Then, at the end of the second display cycle, the display driver receives the Vsync signal (also referred to as the electronic device obtaining the first Vsync signal at the first moment), indicating that the third display cycle has entered, and the electronic device can refresh and display image frame 2 on the display screen. In the third display cycle, the electronic device does not generate a new image frame (also referred to as the first application not generating an image frame between the first moment and the second moment), and displays image frame 2 on the display screen. After the display driver receives the Vsync signal at the end of the third display cycle (that is, executing S601, which can also be referred to as the electronic device obtaining the second Vsync signal at the second moment), it indicates that the third display cycle ends and the fourth display cycle will enter.
[0144] It should be noted that other implementations of S601 can refer to the introduction of S309 in the first embodiment, which will not be described in detail here.
[0145] S602: The display driver responds to the Vsync signal and sets the idle flag bit to +1.
[0146] S603: The display driver determines whether the idle flag is equal to M, otherwise executes S604.
[0147] It should be noted that the implementation of S602-S603 can refer to the introduction of S309-S310 in the first embodiment, and will not be repeated here.
[0148] Combination Figure 7 As shown, assuming that M is equal to 5, the previous display cycle of Example 2 is the third display cycle, and the electronic device generates a new image frame 2 in the second display cycle, indicating that the idle flag is updated to 1 based on the received Vsync signal at the end of the second display cycle, and the electronic device does not generate a new image frame in the third display cycle, indicating that no commit is received in the third display cycle, and the idle flag is still 1 and is not set to 0. At the end of the third display cycle, based on the received Vsync signal, the idle flag + 1 is equal to 2. In the fourth display cycle, the display driver can determine that the idle flag is not equal to M, and the fourth display cycle does not need to enter the idle mode.
[0149] S604: The display driver determines that the synthesis flag bit is not 1, the number of frame skipping times is not 0, and the adaptive refresh rate flag bit is True, and sends a clock signal to the display screen.
[0150] In some embodiments, the number of frame skipping times can be calculated based on the current refresh rate and the minimum refresh rate. Please refer to the introduction of the number of frame skipping times in Example 1. If no new image frame is generated in the previous display cycle, the judgment can be made based on the number of frame skipping times calculated based on the display cycle in which a new image frame was most recently generated.
[0151] Combination Figure 7 As shown, the previous display cycle of Example 2 is the third display cycle, the electronic device generates a new image frame 2 in the second display cycle, and calculates the number of frame skipping to be 1, and the electronic device does not generate a new image frame in the third display cycle, indicating that no commit is received in the third display cycle. In the fourth display cycle, the current refresh rate can be obtained using the second display cycle, and the number of frame skipping is still 1.
[0152] In embodiment 2, no new image frame is generated in the previous display cycle, the synthesis mark bit in the current display cycle is not 1, the number of frame skipping is 1, not 0, the next display cycle does not enter idle mode, and the adaptive refresh rate mark bit is still True, indicating that the electronic device is in adaptive refresh rate mode and frame skipping can be performed. Therefore, the display driver can send a clock signal to the display screen without sending repeated image frames to the display screen.
[0153] S605: The display screen receives a clock signal.
[0154] The display screen does not receive an image frame in the current display cycle, but only receives a clock signal, so it may not be refreshed or display a response. Figure 7 This example can also be referred to as the electronic device not performing a refresh action on the display screen in response to the second Vsync signal, and maintaining display of the second image frame.
[0155] For example, after receiving the clock signal, the display screen may ignore the clock signal and make no response, or it may use the clock signal to detect errors in the data transmission process and take corresponding measures to recover, which is not limited in the present application.
[0156] In this way, when the electronic device is in the adaptive refresh rate mode, no new image frame is generated and the number of frame skipping is not 0, the display screen of the electronic device may not refresh the display, thereby reducing the power consumption of the electronic device.
[0157] S606: The display driver will skip the frame times -1.
[0158] In the second embodiment, the frame skipping number is 1. After the display screen skips a frame once, the display driver can obtain the frame skipping number as 0 by subtracting 1 from the frame skipping number.
[0159] S607: The display driver receives a Vsync signal.
[0160] The electronic device does not generate a new image frame in the current display cycle, and the display driver receives the Vsync signal, indicating that the current display cycle ends and the next display cycle will begin.
[0161] Based on the S601 example, combined Figure 7 As shown, for example, the current display cycle of the second embodiment is the fourth display cycle, and the electronic device does not generate a new image frame in the fourth display cycle. In the fourth display cycle, the display screen still displays image frame 2, but the display screen is not refreshed, which is an empty frame. After receiving the Vsync signal, it indicates that the fourth display cycle ends and the fifth display cycle will begin.
[0162] It should be noted that other implementations of S607 can refer to the introduction of S309 in the first embodiment, which will not be described in detail here.
[0163] S608: The display driver responds to the Vsync signal and sets the idle flag bit to +1.
[0164] S609: The display driver determines whether the idle flag is equal to M, otherwise executes S609.
[0165] Based on the example of S603, combined Figure 7 As shown, assuming that M is equal to 5, at the end of the third display cycle, based on the received Vsync signal, the idle flag bit +1 is equal to 2 (see S602 described above), and no new image frame is generated in the fourth display cycle. At the end of the fourth display cycle, based on the received Vsync signal, the idle flag bit +1 is equal to 3 (see S608 described above), the display driver can determine that the idle flag bit is not equal to M, and there is no need to enter the idle mode in the fifth display cycle.
[0166] S610: The display driver determines that the number of frame skipping is 0, and sends the repeated image frame and clock signal to the display screen.
[0167] In the current display cycle, the display screen has skipped frames so that the number of frame skips becomes 0. In the next display cycle, the display driver can determine that the number of frame skips is 0 (it can also be called the number of times the display screen does not perform a refresh action reaches a first threshold, and the value of the frame skip number is the first threshold), indicating that there will be no more frame skipping in the next display cycle. Therefore, the image frame displayed in the previous display cycle is sent to the display screen as a repeated image frame and clock signal.
[0168] S611: In response to receiving the repeated image frames and the clock signal, the display screen refreshes and displays the repeated images based on a preset refresh rate.
[0169] like Figure 7As shown, assuming that the next display cycle of Example 2 is the fifth display cycle (also referred to as the end moment of the fourth display cycle is the fourth moment, and the display driver receives the fourth Vsync signal), in the fifth display cycle, the display screen also displays image frame 2 (also referred to as the second image frame), but image frame 2 is repeatedly sent to the display screen, and the display screen refreshes and displays the repeated image frame 2 based on a preset refresh rate.
[0170] In addition, in some embodiments, after the display screen refreshes to display repeated image frames, the number of frame skips can be calculated again. Since no new image frames have been generated, it indicates that the current refresh rate remains unchanged (see the introduction of S604), and the number of frame skips can be calculated to be still 1.
[0171] Continue to see Figure 7 For example, the next display cycle of Example 2 is the fifth display cycle. In the fifth display cycle, the display screen refreshes and displays the repeated image frame 2. No image frame is generated in the fifth display cycle. S601-605 can be repeatedly executed, the synthesis mark bit is 0, the sixth display cycle will not enter the idle mode, and the number of frame skips is not 0. Therefore, in the sixth display cycle, the display screen only receives the clock signal and is not refreshed.
[0172] Continue to see Figure 7 As shown, in the sixth display cycle, image frame 2 (also referred to as the second image frame) is displayed on the display screen, and the first application can generate image frame 3 (also referred to as the third image frame), that is, at the end of the sixth display cycle (also referred to as the third moment), the display driver can receive a Vsync signal (also referred to as the third Vsync signal), indicating that the seventh display cycle has begun, and the display driver responds to the Vsync signal, determines that the synthesis mark bit is 1, and can send image frame 3 and the clock signal to the display screen, and then refresh the display screen to display the image frame 3. The detailed steps can be referred to in Example 1, and will not be repeated here.
[0173] Combination Figure 8 As shown, when a new image frame is generated, SurfaceFlinger can send a commit (also called AtomicCommit) to the display driver through HWC. After receiving the Vsync signal, the judgment driver can determine whether a commit is received between this Vsync signal and the previous Vsync signal, or whether the number of frame skipping is 0, or whether the idle mode is entered. When any of the above three conditions is met, the display screen cannot perform a frame skipping operation, but performs a refresh operation (also called a refresh action). When none of the above three conditions are met, the display screen can perform a frame skipping operation. Among them, when the judgment driver determines that the idle flag bit is equal to M, it can determine to enter the idle mode and reduce the refresh rate.
[0174] Combination Fig. 9 As shown, after the display driver receives the Vsync signal, the display driver can first calculate the number of frame skipping times, and then the display driver can determine whether a commit is received (for example, whether the synthesis mark bit is 1), or determine whether the number of frame skipping times is 0, or determine whether to enter the idle mode (for example, determine whether the idle mark bit is equal to M). When any of the above three conditions is met, the display screen cannot perform the frame skipping operation. When none of the above three conditions is met, the display screen can perform the frame skipping operation.
[0175] In this way, on the one hand, when no new image frame is generated, the display screen may not be refreshed, thereby reducing power consumption loss; on the other hand, by limiting the number of frame skips, the screen flickering problem caused by the display screen not being refreshed for a long time can be avoided, thereby maintaining the performance of the electronic device.
[0176] Embodiment three:
[0177] The following takes the case where the electronic device is in adaptive refresh rate mode in the previous display cycle, no new image frame is generated in the previous display cycle, the idle flag is 3, M is 4, and the current display cycle will enter idle mode as an example to introduce the refresh method of the display screen in the current display cycle.
[0178] like Fig.10 As shown, combined Figure 3b The software structure of the electronic device shown in the figure, the method for refreshing the display screen may include the following steps:
[0179] S101: The display driver receives a Vsync signal.
[0180] The electronic device did not generate a new image frame in the previous display cycle, and the display driver received the Vsync signal, indicating that the previous display cycle ended and the current display cycle will begin.
[0181] Combination Fig.11 As shown, assuming that the previous display cycle of Example 3 is the fifth display cycle, no new image frame is generated in the fifth display cycle, after receiving the Vsync signal, it indicates that the fifth display cycle ends and enters the sixth display cycle. The sixth display cycle is the current display cycle of Example 3.
[0182] S102: The display driver responds to the Vsync signal and sets the idle flag bit to +1.
[0183] The display driver responds to the Vsync signal and sets the idle mark bit +1. The idle mark bit is 3, and the idle mark bit +1 is equal to 4.
[0184] S103: The display driver determines whether the idle flag is equal to M, and if so, executes S104.
[0185] The idle flag bit is equal to M, which is used to indicate that the display driver has not received a commit within M-1 consecutive display cycles, indicating that no new image frame has been generated within M-1 consecutive display cycles.
[0186] In the third embodiment, M is 4, the idle flag bit+1 is equal to 4, and the display driver determines that the idle flag bit is equal to M, indicating that the display driver can determine that the idle flag bit will enter the idle mode.
[0187] like Fig.11 As shown, assuming that M is 4, the sixth display cycle is the current display cycle of Example 3. In the first display cycle, the GPU of the electronic device renders and the CPU synthesizes to obtain image frame 1. In the second display cycle, the GPU of the electronic device renders and the CPU synthesizes to obtain image frame 2. No new image frames are generated in three consecutive display cycles from the third display cycle to the fifth display cycle, and the idle mode will be entered in the sixth display cycle.
[0188] S104: The display driver updates the flag bit of the adaptive refresh rate to False.
[0189] It should be understood that when an electronic device skips frames (see S604-S605 described above), the display screen of the electronic device does not refresh the display, which essentially lowers the refresh rate. Assuming that frames are skipped and the idle mode is entered during a display cycle, the refresh rate will be lowered again on the basis of lowering the refresh rate. The display screen will not refresh the display for a longer period of time, which may easily lead to a refresh rate lower than the minimum refresh rate supported by the electronic device, resulting in screen flickering. Therefore, in order to avoid this situation, when the electronic device is about to enter idle mode, frame skipping will no longer occur.
[0190] See also Fig.11 As shown, assuming that the sixth display cycle enters idle mode and frames are skipped in the sixth display cycle, it means that the display screen will only receive a clock signal in the sixth display cycle. When the number of frame skips is 1, the display screen will refresh once from the fifth display cycle until the end of the sixth display cycle, which may cause screen flickering.
[0191] Therefore, when the electronic device is about to enter the idle mode, the display driver updates the adaptive refresh rate flag to False, indicating that the electronic device does not skip frames in the idle mode, that is, even if the number of frame skips in the current display cycle is not 0, the display will still refresh the display.
[0192] S105: The display driver sends repeated image frames and more clock signals to the display screen.
[0193] When the electronic device is in idle mode, the display driver can send repeated image frames and more clock signals to the display screen to reduce the refresh rate.
[0194] For example, in combination Figure 4 and Fig.11 As shown, the electronic device can enter the idle mode in the sixth display cycle (the sixth display cycle can also be called the second cycle between the fifth moment and the sixth moment, the fifth Vsync signal is obtained at the fifth moment, and the sixth Vsync signal is obtained at the sixth moment), and the display driver can send repeated image frames 2 and more clock signals to the display screen to lower the refresh rate. For example, in the first display cycle-the fifth display cycle, the refresh rate of the electronic device is 120Hz. In the fifth display cycle, after the display driver sends the image frame to the display screen, it can send a 1.3ms clock signal to the display screen. In the sixth display cycle, the refresh rate of the electronic device is reduced to 60Hz. After the display driver sends the image frame to the display screen, it can send a 9.7ms clock signal to the display screen.
[0195] Combination Fig.11 As shown, the electronic device can display image frame 2 (also called the second image frame) in the third display period. The third display period can also be called the first period between the first moment and the second moment. The first Vsync signal is obtained at the first moment and the second Vsync signal is obtained at the second moment.
[0196] S106: In response to receiving the repeated image frames and more clock signals, the display screen refreshes and displays the repeated images based on the reduced refresh rate.
[0197] In addition, when the electronic device is in idle mode, the display driver receives a commit in a display cycle, indicating that a new image frame is generated in the display cycle. The electronic device can exit the idle mode in the next display cycle. The electronic device can refresh the display screen based on the refresh rate pre-set before recovery, and can increase the refresh rate to the pre-set refresh rate.
[0198] In addition, in some embodiments, when the electronic device is in idle mode, the display driver receives commit in a display cycle and can record the adaptive refresh rate flag as True again, indicating that the electronic device exits idle mode and enters adaptive refresh rate mode, and the electronic device can skip frames again when skipping frames is needed. For example, in embodiment 1, while executing S306, the adaptive refresh rate flag can be updated to True.
[0199] like Fig.11As shown, in the seventh display cycle, the GPU of the electronic device renders and the CPU synthesizes to obtain image frame 3. The electronic device can exit the idle mode in the eighth display cycle, and the refresh rate is increased. For example, the refresh rate of the electronic device is restored from 60Hz to 120Hz pre-set in the adaptive refresh rate mode. The display screen of the subsequent electronic device can still refresh the display screen based on 120Hz, and can skip frames again if frame skipping is required.
[0200] In this way, when the electronic device is about to enter the idle mode, the electronic device is prevented from performing a frame skipping operation, thereby preventing the display screen from flickering due to long-term non-refreshing, and further maintaining the performance of the electronic device.
[0201] Based on the introduction of Embodiments 1 to 3, it can be known that when the synthesis mark bit is 1, or the number of frame skipping is 0, or the idle mark bit is M, and any of the three conditions are met, the display screen will refresh the displayed image frame, and any two or three of the above conditions may be met at the same time. This indicates that when a new image frame is generated, or the number of frame skipping reaches the limit, or when the idle mode is about to be entered, the display screen will refresh the displayed image frame.
[0202] When the synthesis mark bit is 0, the number of frame skipping is not 0, and the idle mark bit is not equal to M, the idle mark bit is not equal to M, indicating that the adaptive refresh rate mark bit is also True, the display screen does not need to refresh the display, that is, the frame skipping operation can be performed, and the display driver only sends a clock signal (also called an empty frame) to the display screen to reduce power consumption loss.
[0203] For example, combining Fig.11 As shown, at the end moment of the third display cycle (also referred to as the seventh moment), the electronic device obtains a Vsync signal (also referred to as the seventh Vsync signal), and the electronic device responds to the Vsync signal to determine that the first application has not generated an image frame between the end moment of the second display cycle (also referred to as the second moment) and the end moment of the third display cycle; for example, the second threshold is 3, and it is determined that the number of display cycles in which the first application has not generated image frames continuously is 1, which does not reach the second threshold; for example, the first threshold is 1, and it is determined that the number of times the display screen does not perform a refresh action is 0, which does not reach the first threshold, and the electronic device can perform a frame skipping operation (also referred to as not performing a refresh action) on the display screen to maintain the display of image frame 2 (also referred to as a second image frame).
[0204] Another example is combining Fig.11As shown, at the end moment of the seventh display cycle (also referred to as the eighth moment), the electronic device obtains a Vsync signal (also referred to as the eighth Vsync signal), and the electronic device responds to the Vsync signal to determine that the first application generates image frame 3 between the end moment of the sixth display cycle (also referred to as the second moment, or also referred to as a moment between the second moment and the eighth moment) and the end moment of the seventh display cycle, and can refresh and display image frame 3 on the display screen (refresh and display the newly generated image frame of the first application).
[0205] Another example is combining Fig.11 As shown, assuming that the second threshold is 3, at the end of the fifth display cycle (also referred to as the eighth moment), the electronic device obtains a Vsync signal (also referred to as the eighth Vsync signal), and the electronic device responds to the Vsync signal to determine that the first application has not generated image frames in the third display cycle to the fifth display cycle, indicating that the electronic device has determined that the number of display cycles in which no image frames have been generated continuously reaches the second threshold 3, and the electronic device can refresh the display image frame 2 on the display screen.
[0206] Another example is combining Fig.11 As shown, assuming that the first threshold is 1, at the end moment of the fourth display cycle (also referred to as the eighth moment), the electronic device obtains a Vsync signal (also referred to as the eighth Vsync signal), and the electronic device responds to the Vsync signal to determine that the first application performs a frame skipping operation (also referred to as not performing a refresh action) in the fourth display cycle, indicating that the electronic device determines that the number of times the display screen does not perform a refresh action reaches the first threshold 1, and the electronic device can refresh the display image frame 2 on the display screen.
[0207] It should be noted that the electronic device in the above embodiment is a mobile phone only for example. In some embodiments, the electronic device can be a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA) and other terminal devices. This application does not impose any special restrictions on the specific form of the above electronic devices.
[0208] The embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a computer, one or more steps in any of the above-mentioned display screen refreshing methods can be implemented.
[0209] The computer-readable storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0210] Another embodiment of the present application further provides a computer program product including instructions. When the computer program product is executed by a computer, one or more steps in any of the above display screen refreshing methods can be implemented.
[0211] The electronic device, computer-readable storage medium, and computer program product provided in this embodiment are all used to execute the corresponding display screen refresh method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding display screen refresh method provided above, and will not be repeated here.
[0212] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.
[0213] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0214] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for refreshing a display screen, It is characterized in that Applied to an electronic device, the electronic device includes a first application and a display screen, and the method includes: During the process of the display screen displaying the first image frame, the first application generates a second image frame; At a first moment, the electronic device responds to a first Vsync signal to refresh and display the second image frame on the display screen; the first Vsync signal is obtained at the first moment; At the second moment, the electronic device responds to the second Vsync signal, does not perform a refresh action on the display screen, and maintains displaying the second image frame; the second Vsync signal is obtained at the second moment; the second moment is later than the first moment; the first application does not generate an image frame between the first moment and the second moment.
2. The method according to claim 1, It is characterized in that Also includes: In the process that the display screen continues to display the second image frame, the first application generates a third image frame; At a third moment, the electronic device responds to a third Vsync signal to refresh and display the third image frame on the display screen; the third Vsync signal is obtained at the third moment.
3. The method according to claim 1, It is characterized in that Also includes: At a fourth moment, the electronic device refreshes and displays the second image frame on the display screen in response to a fourth Vsync signal; the fourth Vsync signal is obtained at the fourth moment; The first application does not generate an image frame between the first moment and the fourth moment.
4. The method according to claim 3, It is characterized in that Before the electronic device refreshes and displays the second image frame on the display screen in response to the fourth Vsync signal, the electronic device further includes: It is determined that the number of times that the display screen does not perform a refresh action reaches a first threshold.
5. The method according to claim 1, It is characterized in that In a first period between the first moment and the second moment, the display screen continuously displays the second image frame; the method further includes: At a fifth moment, the electronic device refreshes and displays the second image frame on the display screen in response to a fifth Vsync signal; the fifth Vsync signal is obtained at the fifth moment; At a sixth moment, the electronic device obtains a sixth Vsync signal; Among them, in the second period between the fifth moment and the sixth moment, the display screen continues to display the second image frame; the duration of the first period is shorter than the duration of the second period; and the first application does not generate an image frame between the first moment and the fifth moment.
6. The method according to claim 5, It is characterized in that Before the electronic device refreshes and displays the second image frame on the display screen in response to the fifth Vsync signal, the electronic device further includes: It is determined that the number of display periods during which the first application does not continuously generate an image frame reaches a second threshold, where the display period refers to the duration between two consecutive Vsync signals obtained by the electronic device.
7. The method according to claim 1, It is characterized in that Also includes: At a seventh moment, the electronic device determines, in response to the seventh Vsync signal, that the first application does not generate an image frame between the second moment and the seventh moment, and determines that the number of display cycles in which the first application does not continuously generate an image frame does not reach a second threshold, and determines that the number of times the display screen does not perform a refresh action does not reach a first threshold, and does not perform a refresh action on the display screen, and maintains displaying the second image frame; The seventh Vsync signal is obtained at the seventh moment; and the display period refers to the duration between two consecutive Vsync signals obtained by the electronic device.
8. The method according to claim 1, It is characterized in that Also includes: At an eighth moment, the electronic device determines, in response to an eighth Vsync signal, that the first application generates an image frame between the second moment and the eighth moment, or determines that the number of display cycles in which the first application does not continuously generate an image frame reaches a second threshold, or determines that the number of times the display screen does not perform a refresh action reaches a first threshold, and refreshes the display screen to display an image frame; the eighth Vsync signal is obtained at the eighth moment; The display period refers to the duration between two consecutive Vsync signals obtained by the electronic device.
9. The method according to claim 4, 7 or 8, It is characterized in that Also includes: The first threshold is calculated based on the ratio of the refresh rate of the second image frame to the minimum refresh rate.
10. An electronic device, It is characterized in that including memory and processor; The memory is coupled to the processor, and the memory is used to store computer program code, wherein the computer program code includes computer instructions, and one or more of the processors call the computer instructions to enable the electronic device to execute the display screen refresh method as described in any one of claims 1-9.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for refreshing a display screen according to any one of claims 1 to 9 is implemented.
12. A computer program product, It is characterized in that The invention comprises computer program codes, which, when executed by an electronic device, implement the steps of the method for refreshing a display screen according to any one of claims 1 to 9.
Citation Information
Patent Citations
Time sequence control method, time sequence controller and display device
CN104078016A
Method and apparatus for controlling refreshing frequency, time schedule controller, and display apparatus
CN107799053A
Display screen frequency conversion method, DDIC chip, display screen module and terminal
CN111968582A
Display control method, device and system and display equipment
CN114446239A
Screen refresh rate switching method and electronic equipment
CN116052618A
Cited By
Display screen refresh method and related apparatus
WO2026056547A1
