Display method and electronic device
Patent Information
- Application Number
- CN202510442583.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2026-10-16
AI Technical Summary
定时器本身存在一定的时间误差,以及定时器可能没有基于同步信号进行校准,这均可能导致应用实际送帧的帧率与显示面板实际刷新的帧率不匹配,导致显示面板显示卡顿等问题
[0040]For the technical effects that can be achieved in the second to fifth aspects mentioned above, please refer to the description of the technical effects that can be achieved by the corresponding design schemes in the first aspect mentioned above. They will not be listed one by one here.
Smart Images

Figure CN122924716A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a display method and an electronic device. Background Technology
[0002] Some applications support self-rendering, meaning they can call upon the electronic device's hardware to generate data without relying on a backend server. After generating the data, the application can write it to the electronic device's cache, essentially sending frames. When the electronic device's display panel needs to refresh, the display driver chip can read the data from the cache, allowing the display panel to display graphics based on the data.
[0003] Applications can control the frame rate of sent frames using a timer. The display driver chip can control the actual refresh rate of the display panel by referring to the synchronization signal. However, timers themselves have a certain time error, and timers may not be calibrated based on the synchronization signal. Both of these factors can cause a mismatch between the frame rate actually sent by the application and the actual refresh rate of the display panel, resulting in display stuttering and other problems. Summary of the Invention
[0004] This application provides a display method and electronic device for reducing display lag and improving the display effect of the display panel.
[0005] Firstly, embodiments of this application provide a display method. This method can be applied to an electronic device. The electronic device side includes, for example, the electronic device itself, or software modules, hardware modules, or combined software and hardware modules within the electronic device. Hardware modules within the electronic device include, for example, processors, circuits, or chips. Chips may include modem chips, also known as baseband chips, or system-on-chip (SoC) chips containing modem cores, or system-in-package (SIP) chips. For simplicity, the following description uses an application to an electronic device as an example. This electronic device includes a cache and a display panel.
[0006] The method includes: when the application writes the first frame of data to the cache, determining the expected display time of the first frame of data, wherein the expected display time of the first frame of data is the expected time for the display panel to display the first frame of data; and determining to perform display processing on the first frame of data based on the first actual refresh time and the expected display time of the first frame of data, wherein the first actual refresh time is the actual refresh time of the display panel. The expected display time can also be called the expected on-screen time, etc., and its name is not limited.
[0007] In this embodiment, the electronic device can combine the first actual refresh time and the expected display time of the first frame data to accurately control the display time of the first frame data, so that each frame of data generated by the application can be displayed as close as possible to the expected display time, thereby reducing the problem of display panel stuttering and improving the display effect of the display panel.
[0008] In one possible implementation, determining to perform display processing on the first frame data based on the first actual refresh time and the expected display time of the first frame data includes: performing display processing on the first frame data at the first actual refresh time if the expected display time of the first frame data is equal to or earlier than the first actual refresh time.
[0009] This reduces the chances of the first frame of data being sent to the display too early or too late, thus reducing display panel stuttering and improving the stability of the display panel.
[0010] In one possible implementation, determining to perform display processing on the first frame of data based on the first actual refresh time and the expected display time of the first frame of data includes: if the expected display time of the first frame of data is later than the first actual refresh time, performing display processing on the first frame of data based on a second actual refresh time and the expected display time of the first frame of data, where the second actual refresh time is the actual refresh time of the display panel and is later than the first actual refresh time. For example, if the expected display time of the first frame of data is equal to or earlier than the second actual refresh time, the first frame of data is displayed at the second actual refresh time.
[0011] This also reduces the chance of the first frame of data being sent to the display too early, thus reducing display panel stuttering and improving the stability of the display panel.
[0012] In one possible implementation, the expected display time of the first frame data is determined based on the time it takes for the application to write the first frame data to the cache and the expected frame sending period, wherein the expected frame sending period is the time interval between the application writing two adjacent frames of data to the cache.
[0013] This ensures that each frame of data can be sent and displayed within the corresponding expected frame sending cycle, allowing the display panel to update and display data according to the expected frame sending cycle, which helps improve the stability of the display panel.
[0014] In one possible implementation, the expected delivery time for the first frame of data is N times the expected frame delivery period, where N is a positive integer. Optionally, N is the result of dividing the time it takes for the application to write the first frame of data to the buffer by the floor of the expected frame delivery period plus one.
[0015] This ensures that each frame of data is stably sent and displayed within the corresponding expected frame sending cycle, thereby improving the stability of the display panel.
[0016] In one possible implementation, the expected display time of the first frame data is determined based on the expected display time of the second frame data and the expected frame sending period. The second frame data and the first frame data are two adjacent frames of data written to the application cache, and the application writes the second frame data to the cache earlier than it writes the first frame data to the cache. The expected display time of the second frame data is the expected time for the display panel to display the second frame data.
[0017] This can reduce frame drops caused by time conflicts between sending and displaying two frames of data.
[0018] In one possible implementation, the first frame of data and the second frame of data are two frames of data generated by the application based on the same operation.
[0019] In one possible implementation, the expected display time of the first frame data is the later of a first time and a second time. The first time is determined based on the time when the application writes the first frame data to the cache and the expected frame delivery period. The second time is determined based on the expected display time and expected frame delivery period of the second frame data. The expected frame delivery period is the time interval at which the application is expected to write two adjacent frames of data to the cache. The second frame data and the first frame data are two adjacent frames of data written to the cache by the application. The application writes the second frame data to the cache earlier than it writes the first frame data to the cache. The expected display time of the second frame data is the time at which the display panel is expected to display the second frame data.
[0020] This implementation can be applied to scenarios where the first frame of data and the second frame of data are generated based on the same operation, or scenarios where they are generated based on different operations. The first time is the sum of the expected display time of the second frame of data and the expected frame-sending period, or it can be described as the first time being later than the expected display time of the second frame of data, with an interval of one expected frame-sending period between the first time and the expected display time of the second frame of data.
[0021] In this way, even if the frame rate of the application is unstable, the display time of the next frame can be determined based on the display time of the previous frame, which can ensure that the display time of two adjacent frames differs by one expected frame sending cycle, reducing frame drops and stuttering.
[0022] In one possible implementation, before determining the expected display time of the first frame of data, the method further includes: determining a first time that is earlier than or equal to the expected display time of the second frame of data.
[0023] This can reduce frame drops caused by time conflicts between sending and displaying two frames of data.
[0024] In one possible implementation, the first frame data and the second frame data are two frames of data generated by the application based on different operations.
[0025] In one possible implementation, before determining the display processing of the first frame data based on the first actual refresh time and the expected display time of the first frame data, the method further includes: correcting the expected display time of the first frame data based on a time offset, wherein the time offset is the adjustment amount for correcting the expected display time of the first frame data.
[0026] In this way, even if the actual refresh cycle of the display panel is unstable, adjusting the expected display time of the first frame data can reduce stuttering caused by the display time of the first frame data and the adjacent frame data being too close.
[0027] In one possible implementation, the method further includes: determining that a first time interval is less than or equal to a first threshold, wherein the first time interval is the time interval between the expected display time of the first frame data and the start time of the first actual refresh cycle, the first actual refresh cycle is the actual refresh cycle in which the expected display time of the first frame data is located, and the actual refresh cycle is the time interval between two refreshes performed by the display panel. Optionally, the first threshold can be preset. Optionally, the first threshold is, for example, 1, 0.8, or 0.9, and its value is not limited.
[0028] Thus, if the time interval between the expected display time of the first frame of data and the start time of the first actual refresh cycle is relatively small, the display time of the first frame of data and the next frame of data may be relatively close. Therefore, in this case, the display time of the first frame of data can be adjusted to reduce display stuttering or frame drops.
[0029] In one possible implementation, the time offset is based on a first time interval and determined in relation to the actual refresh cycle.
[0030] In one possible implementation, the method further includes: when the application writes the second frame data to the cache, determining the expected display time of the second frame data, the expected display time of the second frame data being the expected time for the display panel to display the second frame data, the second frame data and the first frame data being two adjacent frames of data written to the cache by the application, and the application writing the second frame data to the cache earlier than the application writing the first frame data to the cache.
[0031] In one possible implementation, the expected display time of the second frame data is the later of the third and fourth times. The third time is determined based on the time when the application writes the second frame data to the cache and the expected frame delivery period. The fourth time is determined based on the expected display time and the expected frame delivery period of the second frame data. The expected frame delivery period is the time interval between the expected application writing two adjacent frames of data to the cache.
[0032] In one possible implementation, the expected display time of the second frame data is determined based on the time it takes for the application to write the second frame data to the cache and the expected frame delivery cycle.
[0033] In one possible implementation, the method further includes: when the application writes the third frame data to the cache, determining the expected display time of the third frame data, wherein the expected display time of the third frame data is the expected time for the display panel to display the third frame data, the third frame data and the first frame data are two adjacent frames of data written to the cache by the application, and the application writes the third frame data to the cache later than the application writes the first frame data to the cache.
[0034] In one possible implementation, the expected display time of the third frame of data is determined based on the expected display time and expected frame period of the first frame of data.
[0035] Secondly, embodiments of this application provide an electronic device. This electronic device is used to perform any of the methods described in the first aspect above.
[0036] Optionally, the electronic device includes one or more processors, which can implement any of the methods described in the first aspect above. Optionally, the electronic device also includes a cache and a display panel.
[0037] Thirdly, embodiments of this application provide a chip. This chip is used to perform any of the methods described in the first aspect above. The chip is, for example, a SoC (System-on-a-Chip) chip.
[0038] Fourthly, embodiments of this application provide a computer-readable storage medium. This computer-readable storage medium is used to store a computer program that, when run on a computer, causes the computer to perform any of the methods described in the first aspect above.
[0039] Fifthly, embodiments of this application provide a computer program product. This computer program product includes a computer program that, when run on a computer, causes the computer to perform any of the methods described in the first aspect above.
[0040] For the technical effects that can be achieved in the second to fifth aspects mentioned above, please refer to the description of the technical effects that can be achieved by the corresponding design schemes in the first aspect mentioned above. They will not be listed one by one here. Attached Figure Description
[0041] Figure 1 A schematic diagram illustrating a first mechanism for displaying graphics according to an embodiment of this application;
[0042] Figure 2 A first schematic diagram illustrating the timing of production and consumption data provided in an embodiment of this application;
[0043] Figure 3 A schematic diagram illustrating the second mechanism for displaying graphics;
[0044] Figure 4 A second schematic diagram for the time of production and consumption data;
[0045] Figure 5 A schematic diagram illustrating a graphical user interface (GUI) provided in an embodiment of this application;
[0046] Figure 6 A schematic diagram illustrating a third mechanism for displaying graphics according to an embodiment of this application;
[0047] Figure 7 A schematic diagram illustrating the determination of the display time according to an embodiment of this application;
[0048] Figure 8 A third schematic diagram illustrating the timing of production and consumption data provided in an embodiment of this application;
[0049] Figure 9 A schematic diagram of a displayed GUI provided in one embodiment of this application;
[0050] Figure 10 A fourth schematic diagram of the timing of production and consumption data provided in an embodiment of this application;
[0051] Figure 11 A schematic diagram illustrating the correction of expected display time according to an embodiment of this application;
[0052] Figure 12 A fifth schematic diagram of the time of production and consumption data provided in one embodiment of this application;
[0053] Figure 13 A flowchart illustrating a display method provided in one embodiment of this application;
[0054] Figure 14 This is a schematic diagram of a first structure of an electronic device provided in an embodiment of this application;
[0055] Figure 15 This is a schematic diagram of a second structure of an electronic device provided in an embodiment of this application;
[0056] Figure 16 This is a schematic diagram of a third structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0057] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0058] The embodiments of this application involve at least one, including one or more; where "multiple" means two or more. Furthermore, it should be understood that in the description of this specification, terms such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order. For example, the first frame of data and the second frame of data do not represent their relative importance or order, but are merely for descriptive distinction. In the embodiments of this application, "and / or" merely describes an association relationship, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0059] References to "one embodiment" or "some embodiments" as used in this specification mean that one or more embodiments of this specification include a particular feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0060] As used in this specification, the terms “when,” “in the circumstances,” or “after” may be interpreted, depending on the context, as meaning “if,” “after,” “in response to determining,” or “in response to detecting.” Similarly, the phrases “when,” “in the circumstances,” or “if (the stated condition or event) is detected” may be interpreted, depending on the context, as meaning “if,” “in response to determining,” “when (the stated condition or event) is detected,” or “in response to detecting (the stated condition or event).”
[0061] The display method provided in this application is applicable to electronic devices. For example, the electronic device may be a portable electronic device such as a mobile phone, tablet computer, or laptop computer; or it may be a wearable device such as a watch or bracelet; or it may be a virtual reality (VR) device, augmented reality (AR) device, or mixed reality (MR) device; or it may be an in-vehicle device, etc. In short, this application does not limit the specific type of electronic device. For ease of description, this document mainly uses a mobile phone as an example for illustration.
[0062] Electronic devices have applications that can generate data based on self-rendering technology. The electronic device can then display this data as graphics, such as a GUI or images. Applications can be pre-installed applications, mini-programs, web pages, or lightweight applications; there are no restrictions on their specific form. Examples of applications include map applications and social applications. Self-rendering technology can be implemented using X-components. X-component technology is a technique that achieves self-rendering through X-components within an application. With self-rendering technology, applications can generate data without relying on a backend server.
[0063] The following is combined Figure 1 This paper describes a mechanism for displaying graphics on an electronic device, illustrating the process of displaying a GUI on an electronic device using self-rendering technology. The electronic device is, for example, a mobile phone.
[0064] like Figure 1 As shown, the electronic device includes a display panel, a display driver chip, a processor, a cache, and applications.
[0065] A processor is, for example, a central processing unit (CPU).
[0066] Optionally, the cache can be located within the processor; for example, both the processor and the cache can be integrated onto the SoC. Alternatively, the cache can exist independently of the processor, without limitation.
[0067] Display driver chips, such as display driver integrated circuits (DDICs).
[0068] Optionally, the interaction between the processor and the display driver chip can be based on the display serial interface (DSI). The DSI is generated based on the mobile industry processor interface (MIPI).
[0069] For example, the application generates the first frame of data and writes it to the cache. The display driver chip can control the display panel refresh via a synchronization signal. For instance, triggered by the synchronization signal, the display panel can read the first frame of data from the cache, update the displayed graphics based on the first frame of data, thus refreshing the display panel, which is equivalent to the display panel consuming data. The synchronization signal can be, for example, a vertical synchronization (VSYNC) signal. Optionally, the display panel refreshes according to a refresh (or display) frame rate. The display panel refresh frame rate refers to the maximum number of frames the display panel can display per unit of time. The display panel refresh frame rate describes the rate at which the display panel consumes data. The refresh frame rate can be equal to the frame rate at which the synchronization signal is generated.
[0070] When an application detects a synchronization signal, it can generate new data, such as a second frame, based on the synchronization signal and write this second frame to the buffer. This achieves frame sending, which is equivalent to the application producing data. Optionally, the application generates data according to the frame rate of the sent frames. The frame rate of the sent frames refers to how many frames the application writes to the buffer per unit of time. The frame rate of the sent frames describes the rate at which the application writes data. The frame rate of the sent frames is equal to the frame rate at which the application generates data.
[0071] When the frame rate of the application frame delivery is the same as the frame rate of the display panel refresh, this is equivalent to the data production rate and the data consumption rate being the same. Therefore, the application frame delivery process and the display panel refresh process can be synchronized through a synchronization signal.
[0072] When the frame rate of the application's frame transmission differs from the frame rate of the display panel's refresh, this is equivalent to a difference between the data production rate and the data consumption rate. In this case, the display driver chip can determine whether to actually update the graphics displayed on the display panel based on the synchronization signal and the specific situation of the data in the cache.
[0073] The following is combined Figure 2 The time frame shown in the production data and consumption graph indicates that... Figure 1 The content of the graphics displayed under this mechanism will be illustrated with examples. Figure 2The example used is an application sending frames at 60 frames per second (FPS) and a display panel refreshing at 120 FPS. In this example, with the application sending frames at 60 FPS, the application's frame sending period is 1000 / 60, or 16.6 milliseconds (ms). Similarly, with the display panel refreshing at 120 FPS, the display panel's refresh period is 1000 / 120, or 8.3 ms.
[0074] For example, if the display driver chip determines that the first frame of data is stored in the cache at 16.6ms (the start of the second refresh cycle), then the display driver chip can control the display panel to display the first frame of data at 16.6ms. Displaying the first frame of data can be understood as the display panel displaying based on the first frame of data, or displaying a graphic generated based on the first frame of data. Therefore, displaying the first frame of data can be replaced by describing the graphic corresponding to the first frame of data. When the application detects a synchronization signal, the application begins to generate the second frame of data.
[0075] At 24.9ms (the start of the third refresh cycle), the display driver chip determines that there is no new data in the cache. For example, the application may not have successfully generated the second frame of data yet, or the application may not have written the second frame of data to the cache. Therefore, the display driver chip can control the display panel to continue displaying the first frame of data at 24.9ms.
[0076] Between 24.9ms and 33.2ms, the application writes the second frame of data to the buffer.
[0077] The display driver chip determines that the second frame of data exists in the buffer at 33.2ms (the beginning of the 4th refresh cycle) and controls the display panel to display the second frame of data. Similarly, the display panel continues to display the graphic corresponding to the second frame of data at 41.5ms.
[0078] Therefore, it can be seen that the application's production data rate and the display panel's consumption data rate can maintain a stable 1:2 relationship, allowing the display panel to stably display at 60 FPS. Furthermore, it can be observed that the synchronization signal effectively coordinates the application's frame rate delivery and the display panel's refresh rate, whether they are different or the same.
[0079] However, the mechanisms by which different electronic devices generate synchronization signals may vary due to differences in hardware or software. Therefore, developers may need to develop applications specifically for different electronic devices to detect their synchronization signals. This makes application development more difficult and costly.
[0080] Therefore, there exists Figure 3 This illustrates another mechanism for displaying graphics. For example... Figure 3 As shown, the electronic device includes a display panel, a display driver chip, a processor, a cache, and applications. The implementation details of the display panel, display driver chip, processor, cache, and applications can be found in the preceding discussion; they will not be listed individually here.
[0081] and Figure 1 The difference is, Figure 3 The application does not need to detect synchronization signals; instead, it generates data and writes data to a cache based on triggers from a built-in timer. Optionally, this timer can be implemented in software.
[0082] The timer may not be synchronized with the synchronization signal, the timer itself may have some error, the timing of generating the synchronization signal may be unstable, or other reasons may cause a deviation between the actual frame rate sent by the application and the expected frame rate (or ideal frame rate), which may cause the display panel to experience frame drops or stuttering.
[0083] The following is combined Figure 4 This illustrates the time frame of production and consumption data. Figure 3 The mechanism for displaying graphics is illustrated with examples. Figure 4 The example used is an application sending frames at 60 FPS and a display panel refreshing at 120 FPS. In this example, with the application sending frames at 60 FPS, the application's frame sending cycle is 1000 / 60, or 16.6 ms. Similarly, with the display panel refreshing at 120 FPS, the display panel's refresh cycle is 1000 / 120, or 8.3 ms.
[0084] like Figure 4 As shown, the application generates data at time t1, such as the first frame of data. The display panel shows this first frame of data at 8.3ms. The application generates the second frame of data at time t2.
[0085] The application expects a frame rate of 60 FPS, and ideally, the time difference between time t2 and time t1 should be 16.6 ms. However, due to timing errors or other factors, the time difference between t2 and t1 may be less than 16.6 ms, for example, 15.6 ms. This could cause the display panel to show the second frame of data at 16.6 ms.
[0086] Ideally, the application's ideal frame rate is 60 FPS, and the display panel refresh rate is 120 FPS. Correspondingly, the application's ideal frame rate interval is 16.6 ms. In this case, the display panel should update data every 16.6 ms according to the application's ideal frame rate interval. However, if... Figure 4As shown, because the actual frame rate of the application is unstable, the display panel does not always update the data once every 16.6ms, but sometimes updates the data once every 8.3ms. For example, there is no 16.6ms interval between the display panel updating the data of the first frame and the data of the second frame, but an interval of 8.3ms. That is, the display panel display is unstable and stuttering occurs.
[0087] For example, Figure 5 This illustrates the GUI displayed on an electronic device. Figure 5 The GUI shown in (b) and Figure 5 The GUI shown in (c) can be used as... Figure 4 The graphic corresponding to the first frame of data in the image. Figure 4 An example of the graphic corresponding to the second frame of data in the image.
[0088] The electronic device's display panel shows the GUI shown in 5(a). The user clicks the map icon in 5(a), and the electronic device displays... Figure 5 The GUI shown in (b) depicts the electronic device struggling to load a map. The electronic device then displays... Figure 5 The GUI shown in (c) displays a search box on the map, the user's current location, and suggested destinations.
[0089] Electronic device display Figure 5 (a) and Figure 5 The GUI shown in (b) may be spaced 16.6ms apart. Due to timer counting errors, the electronic device display may show... Figure 5 The GUI shown in (b) and Figure 5 The GUIs shown in (c) are spaced 8.3ms apart. This indicates that the display panel updates the GUI at 16.6ms most of the time, but occasionally at 8.3ms, indicating a stuttering issue with the display panel.
[0090] In view of this, embodiments of this application provide a display solution designed to reduce display stuttering and improve the stability of the display panel. For example, even when the actual frame rate of the application is unstable and / or the application does not detect synchronization signals, the data generated by the application can still be displayed at the frame rate expected by the application.
[0091] Before introducing the display scheme provided in the embodiments of this application, the following will introduce some of the terms involved in the various embodiments of this application.
[0092] 1. Actual refresh frame rate and expected refresh frame rate.
[0093] The actual refresh rate refers to the number of frames displayed on the display panel per unit of time. It describes the rate at which the display panel actually consumes frame data. The actual refresh rate can be represented as F1. The actual refresh rate can be 60 FPS, 120 FPS, 30 FPS, etc., and its value is not limited. If the actual refresh rate is 30 FPS, it means that the display panel actually refreshes 30 frames per second.
[0094] The expected refresh rate refers to the number of frames the display panel is expected to display per unit of time. It describes the rate at which the display panel is expected to consume frame data. The expected refresh rate can be represented as F3. The expected refresh rate can be 60 FPS, 120 FPS, 30 FPS, etc., and its value is not limited. If the expected refresh rate is 30 FPS, it means the display panel is expected to refresh 30 frames per second.
[0095] Optionally, the actual refresh rate can be equal to, less than or greater than the expected refresh rate, and there is no limitation on this.
[0096] 2. Actual refresh cycle and expected refresh cycle.
[0097] The actual refresh rate period refers to the time interval between two consecutive refreshes performed by the display panel. The actual refresh rate period can be represented as S1. The value of the actual refresh rate period can be 33.3ms, 16.6ms, or 8.3ms, etc., and its value is not limited. Optionally, S1 = 1000 / F1. For example, if the actual refresh frame rate is 120 FPS, then the actual refresh rate period S1 = 1000 / 120 = 8.3ms.
[0098] The expected refresh rate period refers to the time interval between two consecutive refreshes of the display panel. The expected refresh rate period can be represented as S3. The value of the expected refresh rate period can be 33.3ms, 16.6ms, or 8.3ms, etc., and its value is not limited. Optionally, S3 = 1000 / F3. If the expected refresh rate is 120 FPS, then the expected refresh rate period S3 = 1000 / 120 = 8.3ms.
[0099] Optionally, the actual refresh cycle can be equal to, less than or greater than the expected refresh cycle, and there is no limitation on this.
[0100] 3. Expected frame rate refers to the number of frames the application is expected to write to the cache per unit of time. The expected frame rate can describe both the actual rate at which the application writes data to the cache and the actual rate at which the application generates data. The expected frame rate can be represented as F2. The expected frame rate can be 60 FPS, 120 FPS, 30 FPS, etc., and its value is not limited. If the expected frame rate is 60 FPS, it means the application is expected to write 60 frames to the cache per second.
[0101] Optionally, the expected frame sending period can be greater than, less than or equal to the actual refresh period, and there is no limitation on this.
[0102] 4. Expected frame feed period refers to the expected time interval between two adjacent frames of data being written to the buffer by the application. The expected frame feed period describes the rate at which the application is expected to generate or write data. The expected frame feed period can be represented as S². The value of the expected frame feed period can be 33.3ms, 16.6ms, or 8.3ms, etc., and its value is not limited. Optionally, S² = 1000 / F². For example, if the application's expected frame feed rate is 60 FPS, then the expected frame feed period S² = 1000 / 60 = 16.6ms.
[0103] 5. Expected display time refers to the expected time for the data (or the corresponding graphic) to be displayed on the display panel. For different frames of data, each frame has its own expected display time. For example, the expected display time for the Zth frame of data is the expected time for the Zth frame of data (or the corresponding graphic) to be displayed on the display panel.
[0104] The display scheme provided by the embodiments of this application will be described below with reference to the accompanying drawings. The following description uses an electronic device as the execution subject of the method, but it can also be executed by a processor or a SoC (System-on-a-Chip) in an electronic device, etc., without specific limitation.
[0105] Please refer to Figure 6 This is a schematic diagram illustrating the mechanism for displaying graphics provided in an embodiment of this application. Figure 6 As shown, the electronic device includes a display panel, a processor, and a cache. Additionally, the electronic device also includes an application. Optionally, the electronic device also includes a display driver chip. The implementation methods of the display panel, processor, cache, application, and display driver chip can be referred to the implementation methods of the display panel, processor, cache, application, and display driver chip discussed above, and will not be listed individually here.
[0106] like Figure 6 As shown, the application generates a frame of data, such as frame Z. The application can write frame Z to a buffer. Optionally, the application can set a timer to generate data based on the timer's trigger. The application then writes frame Z to the buffer. Z can be a positive integer.
[0107] After the electronic device detects that the application has written the Z-frame data to the buffer, it determines (or calculates) the expected display time of the Z-frame data, for example, the expected display time of the Z-frame data is time T3. For example, the expected display time of the Z-frame data refers to the expected time to display the Z-frame data (or the graphic corresponding to the Z-frame data) on the display panel.
[0108] The display panel refreshes according to the actual refresh cycle. Optionally, the electronic device can detect the synchronization signal of the display driver chip. Each time a synchronization signal is received, it means that the display panel needs to be refreshed. Alternatively, the display panel can be set with a timer, and the refresh will be performed after the timer expires.
[0109] Electronic devices can detect whether a display panel needs to be refreshed. For example, if an electronic device detects a synchronization signal at the current time T4, then time T4 indicates that the display panel's actual refresh time. The electronic device can determine whether to send the graphic corresponding to the Z-frame data for display processing based on the expected display time of the Z-frame data (e.g., time T3) and the display panel's actual refresh time (e.g., the current time T4). The current time T4 is one example of the first actual refresh time.
[0110] For example, if the expected display time of the Z-frame data is earlier than or equal to the first actual refresh time, i.e., time T3 is earlier than or equal to the current time T4, then the electronic device can control the display processing of the Z-frame data. Display processing, also known as a display operation, refers to the electronic device processing the Z-frame data so that it can be displayed on the display panel. Specifically, the electronic device can instruct the Z-frame data to be transmitted to the underlying hardware, such as the display driver chip, so that the display panel can display the Z-frame data in a timely manner.
[0111] For example, if the expected display time of the Z-th frame data is 16.6ms and the first actual refresh time is 16.6ms, then the expected display time of the Z-th frame data is equal to the first actual refresh time. Therefore, the electronic device determines to process the display of the Z-th frame data at 16.6ms.
[0112] Alternatively, if the expected display time of the Z-frame data is later than the first actual refresh time (i.e., time T3 is later than the current time T4), the electronic device can temporarily refrain from displaying the Z-frame data. At the next refresh time, such as the second actual refresh time, the electronic device can then display the Z-frame data based on its expected display time and the second actual refresh time. The second actual refresh time is the actual refresh time of the display panel and is later than the first actual refresh time. For example, the second actual refresh time is one actual refresh cycle later than the first actual refresh time.
[0113] Based on the expected display time and the second actual refresh time of the Z-frame data, the content of the display processing for the expected display time of the Z-frame data can be determined by referring to the expected display time and the first actual refresh time of the Z-frame data. These details will not be listed here. For example, if the expected display time of the Z-frame data is earlier than or equal to the second actual refresh time, the electronic device can control the display processing of the Z-frame data at the second actual refresh time. Alternatively, if the expected display time of the Z-frame data is later than the second actual refresh time, the electronic device can determine the display processing of the Z-frame data at an actual refresh time after the second actual refresh time, based on the expected display time of the Z-frame data, and so on.
[0114] For example, if the expected display time for frame Z is 33.2ms and the first actual refresh time is 16.6ms, then the expected display time for frame Z is later than the first actual refresh time. Therefore, the electronic device does not process the display of frame Z temporarily. Until the second actual refresh time of 33.2ms, the electronic device determines that the expected display time for frame Z is equal to the second actual refresh time, and then processes the display of frame Z at 33.2ms.
[0115] In this embodiment, the electronic device does not send the Z-frame data for display processing as soon as it detects that the display panel needs to be refreshed. Instead, it controls the sending process of the Z-frame data based on the expected sending time of the Z-frame data and the actual refresh time of the display panel. This ensures that the Z-frame data can be sent for display at a more accurate time, thus avoiding display stuttering caused by data being sent for display too early or too late. This helps to improve the stability of the display panel and enhance the display effect.
[0116] Optional, Figure 6 The data of the Zth frame involved can be used as an example of the data of the first frame, the expected display time of the data of the Zth frame can be used as an example of the expected display time of the data of the first frame, and the current time T4 can be used as an example of the first actual refresh time.
[0117] There are several ways to determine the expected display time of the Zth frame data in electronic devices, which will be described below.
[0118] In the first implementation method A1, the electronic device determines the expected display time of the Z-frame data based on the time it takes for the application to write the Z-frame data to the buffer and the expected frame sending period. For simplicity, the time it takes for the application to write the Z-frame data to the buffer will be referred to as the first write time.
[0119] Optionally, the relationship between the expected frame delivery period and the actual refresh period of the display panel can be arbitrary. For example, the expected frame delivery period can be equal to, greater than, or less than the actual refresh period of the display panel; there is no limitation on this. This application embodiment mainly uses the example of an expected frame delivery period being less than the actual refresh period of the display panel for illustration.
[0120] In one design under the first implementation scheme A1, the expected display time of the Zth frame data is determined based on the first write time, the reference time, and the expected frame sending period. The reference time is a time base with any value, such as the time when the application writes the first generated data to the cache.
[0121] Under this design, one way to determine the expected display time of the Zth frame data can refer to the following formula (1).
[0122]
[0123] Where T3 is the expected display time of the Zth frame data, T1 is the reference time, T2 is the first write time, and R represents the expected frame sending period. This indicates that (T2-T1) / R is rounded down. The value of R can be, for example, 16.6ms, 8.3ms, etc., and its value is not limited.
[0124] Optionally, the expected display time T2 for the Zth frame of data can be equal to or later than the reference time T1.
[0125] Please refer to Figure 7 This is a schematic diagram illustrating how to determine the expected display time, as provided in an embodiment of this application. Figure 7 This example uses an expected frame rate of 60 FPS, an actual refresh rate of 120 FPS, a first write time of t2, and a reference time of t1. In the example with an expected frame rate of 60 FPS, the expected frame rate delivery period is 1000 / 60 = 16.6 ms. In the example with an actual refresh rate of 120 FPS, the actual refresh period is 1000 / 120 = 8.3 ms. Additionally, Figure 7 It also illustrates the first to third expected frame sending cycles, etc.
[0126] like Figure 7 As shown, the application generates frame Z to frame Z+2 respectively, and writes frame Z, frame Z+1 and frame Z+2 to the buffer at t2, t5 and t6 respectively.
[0127] For example, the time difference between t2 and t1 is 10.5ms. According to the above formula (1), the expected display time of the Z-frame data can be determined to be 16.6ms.
[0128] For example, the time difference between t5 and t1 is 16.9ms. According to the above formula (1), the expected display time of the Z+1 frame data can be determined to be 33.2ms.
[0129] For example, the time difference between t6 and t1 is 33.7ms. According to the above formula (1), the expected display time of the Z+2 frame data can be determined to be 49.8ms.
[0130] If the electronic device detects that the display panel needs to be refreshed at 16.6ms, and determines that the actual refresh time of the display panel is equal to the expected display time of the Z-frame data, then the electronic device can process the display of the Z-frame data.
[0131] The electronic device detects that the display panel needs to be refreshed at 24.9ms. The electronic device determines that the expected display time of the Z+1 frame data is later than the actual refresh time of the display panel this time. Therefore, the display panel can continue to display the Z frame data. And so on.
[0132] Therefore, it can be seen that electronic devices can control the graphics display time relatively accurately based on the expected display time, so that the display panel can display stably and reduce the occurrence of display panel stuttering.
[0133] In another design under the first implementation method A1, the expected display time of the Zth frame data is determined based on the first write time and the expected frame sending period.
[0134] Under this design, one way to determine the expected display time of the Zth frame data is to refer to the following formula (2). Formula (2) can be understood as an example of the case where the reference time in formula (1) is 0.
[0135]
[0136] Where T3 is the expected display time for the Zth frame of data, T2 is the first write time, and R represents the expected frame sending period. This indicates that T2 / R is rounded down.
[0137] Under formula (2), the expected display time of the Zth frame data can be N times the expected frame sending period. N is a positive integer, and the value of N can be, for example, 1, 2, 3, etc., without limitation. Optionally, N is the result of dividing the first write time by the expected frame sending period, rounded down, and then adding one.
[0138] The above formulas (1) and (2) are examples of formulas for determining the expected display time of the Z-th frame data. In fact, there are many other formulas for calculating the expected display time, which are not limited here.
[0139] Because the actual frame sending cycle of an application may be unstable, or the actual frame rate of the application may be unstable, the application may write two adjacent frames of data to the buffer at similar times. In this case, if the expected display time of two adjacent frames of data is determined according to the first implementation method A1 described above, the expected display time of the later frame of data may be earlier than or equal to the expected display time of the earlier frame of data, resulting in a conflict in the expected display times of two adjacent frames of data. As a result, when the display panel displays these two adjacent frames of data, it may discard one of the frames of data, i.e., frame dropping occurs.
[0140] The following is combined with Figure 8 The data generation and consumption times shown are used to analyze the aforementioned frame loss situation. Figure 8 This example uses an expected frame rate of 60 FPS, an actual refresh rate of 120 FPS, a first write time of t2, and a reference time of t1. In the example with an expected frame rate of 60 FPS, the expected frame rate delivery period is 1000 / 60 = 16.6 ms. In the example with an actual refresh rate of 120 FPS, the actual refresh period is 1000 / 120 = 8.3 ms. Additionally, Figure 8 It also illustrates the first to third expected frame sending cycles, etc.
[0141] For example, the application first generates frame Z-1 data, and then generates frame Z data. However, due to the unstable frame rate of the application's actual frame sending cycle, the time when frame Z-1 data and frame Z data are written to the buffer is not 16.6ms apart, but 15.1ms apart. If the expected display time of frame Z-1 data and the expected display time of frame Z data are calculated according to the first implementation method A1 above, then the expected display time of frame Z-1 data and the expected display time of frame Z data should both be 16.6ms.
[0142] If both the Z-1 frame data and the Z frame data are displayed at 16.6ms, the graphic corresponding to the Z-1 frame data may be covered by the graphic corresponding to the Z frame data, meaning the graphic corresponding to the Z-1 frame data is dropped, resulting in frame dropping.
[0143] Therefore, this application provides a second implementation method A2, which can avoid the conflict of expected display time between two adjacent frames, thereby reducing the occurrence of frame drops.
[0144] In the second implementation method A2, the electronic device can determine the expected display time of the Z-frame data based on the expected display time of the Z-1-frame data and the expected frame period. The Z-1-frame data is the data of the frame preceding (or the previous frame) of the Z-frame data. The Z-1-frame data and the Z-frame data are two adjacent frames of data generated by the application, and the application writes the Z-1-frame data to the buffer earlier than the application writes the Z-frame data to the buffer. Correspondingly, the application generates the Z-1-frame data earlier than the application generates the Z-frame data. For simplicity, the time when the application writes the Z-1-frame data to the buffer is referred to as the second write time. The Z-1-frame data can be used as an example of the second frame data.
[0145] In the second implementation method A2, optionally, the expected display time of the Zth frame data can be the sum of the expected display time of the Z-1th frame data and the expected frame transmission period. For example, one way to calculate the expected display time of the Zth frame data is to refer to the following formula (3).
[0146] T3=T3′+R (3)
[0147] Where T3 is the expected display time of the Z-th frame data, T3′ is the expected display time of the Z-1-th frame data, and R represents the expected frame sending period.
[0148] Continue to refer to Figure 8 If the electronic device can determine the expected display time of the Z-1 frame data and the expected display time of the Z frame data according to the above formula (3), then the Z-1 frame data will be displayed at 16.6ms and the Z frame data will be displayed at 33.2ms. This avoids the problem of conflict between the expected display time of the Z-1 frame data and the expected display time of the Z frame data.
[0149] In one possible implementation, if there is a conflict between the expected display times of two adjacent frames of data determined by the first implementation method A1, the electronic device may use the second implementation method A2 to determine the expected display time of the Zth frame of data.
[0150] In one possible implementation, the second implementation method A2 described above can be applied to scenarios where both the (Z-1)th frame data and the Zth frame data are two frames of data generated by the application based on the same operation. Optionally, if the Zth frame data and the (Z-1)th frame data are data triggered by the same operation, then the electronic device can determine the expected display time of the Zth frame data according to the second implementation method A2. Optionally, the operation refers to the operation performed by the user on the application, such as user input operations, touch operations, click operations, or swipe operations on the application, and the type of operation is not limited.
[0151] The second implementation method, A2, ensures that there is no conflict in the expected display time of two adjacent frames, reducing frame drops. Compared to the first implementation method, A1, the second implementation method, A2, takes into account the case where the actual frame rate of the application is unstable. Therefore, even when the actual frame rate of the application is unstable, the display panel can be controlled to display data stably, ensuring the display effect of the display panel.
[0152] As discussed earlier, due to the unstable frame rate of the actual frame transmission in the application, the application may drop one of the frames between two adjacent frames. Based on this, there is a possible scenario where the user performs different operations on the application, and the application generates frame Z-1 and frame Z based on these different operations. For example, if the user clicks to open the application, the application can generate frame Z-1 based on this click operation; subsequently, if the user performs an input operation, the application can generate frame Z based on this input operation. In this case, the expected transmission and display time of frame Z and frame Z-1 may actually depend on when the user performs the operation, and there may be no direct relationship between the expected transmission and display times of frame Z and frame Z-1. In this situation, if the second implementation method A2 described above is continued, determining the expected transmission and display time of frame Z based on the expected transmission and display time of frame Z-1 may not be appropriate.
[0153] The following is combined with Figure 9 The illustrated GUI provides an example of how adjacent frames of data are generated based on different operations. For example... Figure 9 As shown in (a), the user performs a click operation, such as clicking on a map application. The application generates corresponding data based on this click operation, and the electronic device displays the data accordingly. Figure 9 The GUI shown in (b) and Figure 9 The GUI is shown in (c). Then, the user inputs information, such as entering the desired destination "carrot plantation," and the electronic device generates corresponding data to display. Figure 9 The GUI shown in (d) displays the route to the "carrot plantation". In this case, Figure 9 Expected display time of the GUI in (c) Figure 9 The expected display time of the GUI in (d) is actually triggered by different operations, therefore Figure 9 Expected display time of the GUI in (c) Figure 9 The expected display time of the GUI in (d) may not be directly related.
[0154] Therefore, this application provides a third implementation method A3 to provide another solution for determining the expected display time of the Zth frame data. This solution can avoid frame loss due to conflicts in the expected display times of two adjacent frames, and is also applicable to scenarios where two adjacent frames are generated by the application based on different operations or based on the same operation.
[0155] In the third embodiment A3, the electronic device determines the maximum value between the expected display time determined in the first embodiment A1 and the expected display time determined in the second embodiment A2 as the final expected display time of the Z-frame data. The expected display time determined in the first embodiment A1 can be used as an example of a first time, and the expected display time determined in the second embodiment A2 can be used as an example of a second time. The third embodiment A3 is equivalent to combining the first embodiment A1 and the second embodiment A2.
[0156] Optionally, in this implementation, a formula for determining the final expected display time of the Zth frame data can be referred to as the following formula (4).
[0157]
[0158] Where T3 is the expected final display time of the Z-th frame data, T1 is the reference time, T2 is the write time of the Z-th frame data, and R represents the expected frame sending period. This indicates that (T2-T1) / R is rounded down, and T3′ is the expected display time of the Z-1 frame of data.
[0159] Optionally, in this implementation, another formula for determining the expected display time of the Zth frame data can be referred to as formula (5) below.
[0160]
[0161] Where T3 is the expected display time of the Z-th frame data, T2 is the write time of the Z-th frame data, and R represents the expected frame sending period. This indicates that T2 / R is rounded down, and T3′ is the expected display time of the Z-1 frame of data.
[0162] Optionally, the electronic device may determine the expected display time of the Z-frame data according to the first embodiment A1 described above. If the expected display time of the Z-frame data is earlier than or equal to the expected display time of the Z-1-frame data, the electronic device may determine the final expected display time of the Z-frame data using the third embodiment A3.
[0163] Optionally, if the Z-th frame data and the Z-1-th frame data are data generated by the application based on different operations, or if the Z-th frame data and the Z-1-th frame data are data generated by the application based on the same operation, the electronic device may determine the final expected display time of the Z-th frame data according to the third implementation method A3.
[0164] In the third implementation A3, the electronic device can determine whether to perform display processing on the Z-frame data based on the final expected display time of the Z-frame data and the actual refresh time of the display panel. For example, if the final expected display time of the Z-frame data is earlier than or equal to the first actual refresh time, the electronic device can control the display processing of the Z-frame data.
[0165] Alternatively, if the expected display time of frame Z is later than the first actual refresh time, the electronic device can temporarily refrain from displaying frame Z. At the second actual refresh time, the electronic device can then, following the same process, display frame Z based on its expected display time and the second actual refresh time. For example, if the expected display time of frame Z is earlier than or equal to the second actual refresh time, the electronic device can control the display of frame Z. If the expected display time of frame Z is later than the second actual refresh time, the electronic device will temporarily refrain from displaying frame Z, and so on.
[0166] The third implementation method A3 can ensure that there is no conflict in the expected display time of two adjacent frames of data, reduce the occurrence of frame loss, and is applicable to various scenarios where the data of the Zth frame and the Z-1th frame are data generated by the application based on different operations or the same operation.
[0167] The following examples illustrate the applicable situations of the first embodiment A1 to the third embodiment A3 described above.
[0168] For example, the first implementation method A1 described above can be applied to determine the expected display time of the Zth frame data when there is no conflict in the expected display times of two adjacent frames of data.
[0169] The second implementation method A2 described above can be applied to determine the expected display time of the Zth frame data when there is a conflict in the expected display time of two adjacent frames of data, and when these two adjacent frames of data are generated based on the same operation.
[0170] The third implementation method A3 described above can be applied to determine the expected display time of the Zth frame data when there is a conflict in the expected display times of two adjacent frames of data, and when these two adjacent frames of data are generated based on different operations. Also, the third implementation method A3 described above can be applied to determine the expected display time of the Zth frame data when there is a conflict in the expected display times of two adjacent frames of data, and when these two adjacent frames of data are generated based on the same operation.
[0171] Overall, compared to the first implementation method A1, the second implementation method A3 takes into account the unstable frame rate of the actual frame transmission and can avoid conflicts in the expected transmission and display times of adjacent frames. Compared to the second implementation method A2, the second implementation method A3 is also applicable to scenarios where the Z-th frame data and the Z-1-th frame data are generated by the application based on different operations, thus having better versatility.
[0172] In actual operation of electronic devices, the actual refresh rate of the display panel may be unstable, or the actual refresh rate may differ from the expected refresh rate. In this case, sending the display at the expected display time of two adjacent frames determined according to any of the first embodiment A1 to the third embodiment A3 may cause display panel stuttering.
[0173] The following is combined with Figure 10 The data generation and consumption times shown are analyzed to illustrate the above situation. Figure 10 This example uses a desired frame rate of 60 FPS and a desired refresh rate of 120 FPS for the display panel. With a desired frame rate of 60 FPS, the desired frame rate interval is 1000 / 60 = 16.666666ms. With a desired refresh rate of 120 FPS, the desired refresh rate interval is 1000 / 120 = 8.3333333ms.
[0174] like Figure 10 As shown, the expected refresh rate of the display panel is 8.3333333ms. However, due to hardware limitations of electronic devices, the actual refresh rate may not be 8.3333333ms, for example, it could be 8.370372ms. The application writes the data of frame Z and frame Z+1 to the cache at a time difference of 16.666666ms. However, the display panel actually shows the data of frame Z and frame Z+1 only 8.370372ms apart. This means that the data of frame Z and frame Z+1 are consumed by the display panel at a rate of 120Hz. In other words, the display panel does not update the data every 16.666666ms, but only occasionally every 8.370372ms, resulting in display stuttering.
[0175] Therefore, in one possible implementation, the electronic device can determine the expected display time of the Z-frame data based on any of the first to third implementations A1. For ease of distinction, this expected display time is referred to as the first expected display time. The electronic device can correct the first expected display time of the Z-frame data based on a time offset to obtain the second expected display time of the Z-frame data, or in other words, obtain the actual / target expected display time of the Z-frame data. The time offset is the adjustment amount used to correct the first expected display time.
[0176] Optionally, if the electronic device determines that the first time interval between the first expected display time of the Z-frame data and the start time of the first actual refresh cycle is less than or equal to a first threshold, then the electronic device adjusts the first expected display time of the Z-frame data based on the time offset. The first actual refresh cycle is the actual refresh cycle in which the first expected display time of the Z-frame data is located, or in other words, the first actual refresh cycle is the actual refresh cycle with the smallest time interval to the first expected display time of the Z-frame data.
[0177] Optionally, the first threshold can be 0.8ms, 0.9ms, or 1ms, etc., and its value is not limited. If the first threshold is 1, it means that the first time interval of the Z-th frame data is greater than 0 and less than or equal to 1, and the electronic device determines to correct the first expected display time of the Z-th frame data. The first threshold can be preset in the electronic device.
[0178] The following is combined with Figure 11 The example shown is the first expected display time for correcting the data of the Zth frame. Figure 11 Taking a first threshold of 1ms as an example.
[0179] like Figure 11 As shown, the electronic device determines the first expected display time of the Zth frame data as time t5 and the first expected display time of the Z+1th frame data as time t8 according to any of the first embodiment A1 to the third embodiment A3 described above. The electronic device determines a first time interval ΔT' between time t5 and the start time t7 of the first actual refresh cycle. If ΔT' is less than a first threshold, the electronic device can correct the first expected display time of the Zth frame data based on the time offset to obtain the corrected expected display time t5' of the Zth frame data, that is, the expected display time t5' is the second expected display time.
[0180] The electronic device can determine whether to perform display processing on the Z-frame data based on the second expected display time of the Z-frame data and the first actual refresh time of the display panel. For example, if the second expected display time of the Z-frame data is earlier than or equal to the first actual refresh time, then the electronic device can control the display processing of the Z-frame data.
[0181] Alternatively, if the second expected display time of the Z-frame data is later than the first actual refresh time, the electronic device may temporarily refrain from displaying the Z-frame data. For example, the electronic device can wait until the second actual refresh time, and then determine whether to display the Z-frame data based on the second actual refresh time and the second expected display time. The content of the display processing for the Z-frame data based on the second actual refresh time and the second expected display time can refer to the previously discussed method for determining the display processing based on the second actual refresh time and the first expected display time.
[0182] At the point in time when the application writes the Z-th frame data to the buffer (e.g., the first write time), the electronic device may not be able to precisely determine the exact time of the first actual refresh cycle. Therefore, optionally, the electronic device can determine the time difference ΔT between the first expected display time of the Z-th frame data and the start time of the second actual refresh cycle, and determine the remainder of this time difference ΔT divided by the length of the actual refresh cycle (e.g., 8.3 ms), and determine this remainder as the first time interval ΔT'. Of course, there are many other ways to calculate the first time interval ΔT', and this is not limited. The second actual refresh cycle is an actual refresh cycle in which the first write time occurs, or in other words, the actual refresh cycle with the smallest time difference from the first write time.
[0183] Optionally, the time offset can be preset. In one possible implementation, the time offset is a fixed value preset in the electronic device. In another possible implementation, the time offset can be determined by the electronic device. Examples of how the electronic device determines the time offset are described below.
[0184] In one possible design, the time offset is related to the actual refresh cycle and the first time interval ΔT'. For example, the time offset could be half of an actual refresh cycle minus the value of the first time interval ΔT'. For instance, if an actual refresh cycle is 8.3ms and the first time interval ΔT' is 0.1ms, then the time offset could be 4.05ms.
[0185] In this design, the expected display time of the Zth frame data is adjusted to the middle of the first actual refresh cycle. Thus, the electronic device determines the second expected display time T8' of the Z+1 frame data based on the second expected display time T5' of the Zth frame data. For example, the electronic device can determine the second expected display time T8' of the Z+1 frame data according to the third implementation method A3 described above, based on the second expected display time T5' of the Zth frame data. This ensures that the second expected display time of the Z+1 frame falls within the third actual refresh cycle, allowing the Z+1 frame data to be displayed at the end of the third actual refresh cycle. The third actual refresh cycle is the second actual refresh cycle after the first actual refresh cycle, meaning the first actual refresh cycle is earlier than the third actual refresh cycle, and there is a two-actual-refresh-cycle interval between the third and first actual refresh cycles. The Z+1 frame data and the Zth frame data are two adjacent frames of data written to the application cache, and the Z+1 frame data is the frame following the Zth frame data. The Z+1 frame data can be used as an example of the third frame data.
[0186] In another possible design, the time offset is 2 / 5 of an actual refresh cycle minus the value of the first time interval ΔT'. Of course, there are many other ways to determine the time offset, and this application embodiment does not limit this one.
[0187] The electronic device determines the desired data transmission time using any of the embodiments in this application, and controls the data transmission time based on the desired data transmission time. Based on this, the time relationship between data production and consumption in the swimlane of the captured frame can be specifically referred to... Figure 12 The diagram shown is shown in the image.
[0188] like Figure 12 As shown, the falling edge represents consumption data, based on Figure 12 It can be seen that the three frames of data are consumed by the display panel at times t1, t2 and t3 respectively. The time difference between any two adjacent times in t1, t2 and t3 is the same, which means that the display panel consumes data stably, reducing the possibility of display panel stuttering, that is, the display panel has high display stability.
[0189] This application describes the method using an electronic device as the execution subject. In fact, a processor or SoC in an electronic device can also be used as the execution subject of the method. When a processor or SoC is used as the execution subject, the execution process can refer to the execution process of the electronic device described above, and will not be listed one by one here.
[0190] The following is combined Figure 13 The flowchart shown illustrates the display method, which introduces the display method provided in the embodiments of this application. Figure 13This example demonstrates how an electronic device executes this method. The content of the electronic device can be found in the preceding discussion (as described in the previous text). Figures 6 to 12 The contents of any of the electronic devices mentioned herein will not be listed here. This electronic device includes a display panel and a cache. The contents of the display panel and cache can be referred to in the preceding discussion (as described above). Figures 6 to 12 The contents of any of the display panels and caches involved are not listed here.
[0191] S1301. When the electronic device writes the first frame of data to the buffer, it determines the expected display time of the first frame of data. The expected display time of the first frame of data is the expected time for the first frame of data to be displayed on the display panel.
[0192] The first frame of data can be as discussed above (as mentioned above). Figures 6 to 12 The Zth frame of data (as discussed above). The expected delivery and display time of the first frame of data can be as discussed above (as discussed above). Figures 6 to 12 The expected display time or the first expected display time of the Zth frame data (in any case involved).
[0193] Under this assumption, optionally, the electronic device can determine the expected time for sending and displaying the first frame of data by referring to the content of the first implementation method A1 to the third implementation method A3 discussed above, which will not be listed here.
[0194] Optionally, the electronic device can also correct the expected display time of the first frame of data based on the time offset. The details of the time offset and the correction of the expected display time of the first frame of data can be found in the preceding sections on time offset and the correction of the expected display time of the first frame of data, respectively, and will not be listed here.
[0195] S1302. The electronic device determines to perform display processing on the first frame data based on the first actual refresh time and the expected display time of the first frame data.
[0196] The content of the first actual refresh time and the expected display time based on the first actual refresh time and the first frame data, and the content of the display processing of the first frame data, can be determined by referring to the content of the first actual refresh time and the expected display time based on the first actual refresh time and the Zth frame data, respectively, and will not be listed one by one here.
[0197] Figure 13 Taking the execution of this method by an electronic device as an example, this method can also be executed by the processor or SoC in the electronic device. When the processor or SoC is the execution subject, the execution process can refer to the execution process of the electronic device discussed above, and will not be listed one by one here.
[0198] Please see Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device can be any of the electronic devices mentioned above, such as a mobile phone. This electronic device can realize the functions of the electronic devices mentioned above. For example, this electronic device can realize the functions mentioned above... Figures 6 to 12 The functions performed by any electronic device. This electronic device can execute the methods performed by the aforementioned electronic devices, such as implementing... Figure 13 The display method shown.
[0199] like Figure 14 As shown, the electronic device may include a processor 110, a display screen 194, a cache 210, and a graphics processing unit (GPU) 220. Optionally, the electronic device may also include an external memory interface 120, internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0200] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the nerve center and command center of the electronic device. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0201] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system. Optionally, the processor 110 and the GPU 220 can be integrated. Optionally, the processor 110 and the cache 210 can also be integrated.
[0202] In some embodiments, the processor 110 may execute the display methods provided in the embodiments of this application. When the electronic device is the terminal device described above, the processor 110 may execute any of the display methods described above, for example... Figures 6 to 12 The method steps performed by any of the electronic devices involved. For example, if the processor 110 detects that the application writes the first frame data to the cache 210, it can determine the expected display time of the first frame data, and based on the first actual refresh time and the expected display time of the first frame data, determine to perform display processing on the first frame data, such as transmitting the first frame data to the display screen 194 for display.
[0203] In some embodiments, the processor 110 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), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0204] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100. For example, the touch sensor 180K can detect user operations, and the application can determine and generate a frame of data based on the operation, such as the first frame of data.
[0205] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.
[0206] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0207] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.
[0208] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.
[0209] The GPIO interface is configurable via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc. The display screen 194 may include a display driver chip and a display panel, etc.
[0210] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0211] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0212] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in conjunction with a tuning switch.
[0213] The mobile communication module 150 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G in electronic devices. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0214] The wireless communication module 160 can provide solutions for wireless communication applications in electronic devices, 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 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0215] In some embodiments, antenna 1 of the electronic device is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling the electronic device to communicate with networks and other devices via wireless communication technology.
[0216] The display screen 194 is used to display the application's interface, etc. In some embodiments, the electronic device may include one or N display screens 194, where N is a positive integer greater than 1.
[0217] The electronic device 100 can perform shooting functions through an ISP, a camera 193, a video codec, a GPU, a display 194, and an application processor. The ISP is used to process the data fed back by the camera 193.
[0218] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system and software code for at least one application program. The data storage area may store data generated during the use of the electronic device (e.g., images, videos, etc.). Furthermore, internal memory 121 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, general-purpose flash memory, etc.
[0219] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, images, videos, and other files can be saved on the external memory card.
[0220] Electronic devices can implement audio functions such as music playback and recording through audio modules 170, speakers 170A, receivers 170B, microphones 170C, headphone jacks 170D, and application processors.
[0221] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0222] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls and other external playback scenarios through one or more speakers 170A.
[0223] The receiver 170B, also known as a "handpiece," can be one or more, and is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.
[0224] The microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals.
[0225] The 170D headphone jack is used to connect wired headphones.
[0226] The pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194.
[0227] The gyroscope sensor 180B can be used to determine the motion attitude of an electronic device. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization.
[0228] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.
[0229] The magnetic sensor 180D includes a Hall effect sensor. Electronic devices can use the magnetic sensor 180D to detect the opening and closing of a flip cover.
[0230] The 180E accelerometer can detect the magnitude of acceleration in various directions (typically three axes) of electronic devices. When the electronic device is stationary, it can detect the magnitude and direction of gravity.
[0231] The 180F distance sensor is used to measure distance. Electronic devices can measure distance using infrared or laser.
[0232] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device emits infrared light outward through the LED. The electronic device uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that an object is near the electronic device. When insufficient reflected light is detected, the electronic device can determine that no object is near the electronic device.
[0233] An ambient light sensor 180L is used to detect ambient light levels. Electronic devices can adaptively adjust the brightness of the display screen 194 based on the detected ambient light levels.
[0234] The fingerprint sensor 180H is used to collect fingerprints.
[0235] The 180J temperature sensor is used to detect temperature.
[0236] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K is used to detect touch operations applied to or near it. The touch sensor can then transmit the detected touch operation to the application processor to determine the type of touch event.
[0237] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords.
[0238] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. The electronic device can receive button inputs and generate key signal inputs related to user settings and function control. Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the electronic device.
[0239] Understandable Figure 14 The components shown do not constitute a specific limitation on the electronic device. The electronic device in the embodiments of this application may include, but is not limited to, components that are... Figure 14 More or fewer parts. Furthermore, Figure 14 The combination / connection relationships between the components can also be adjusted and modified.
[0240] Figure 15 A software structure diagram of an electronic device provided in an embodiment of this application. Figure 15 The electronic device shown can perform the display method provided in the above-described method embodiments. Optionally, Figure 15 The electronic devices shown can be any of the electronic devices listed above. For example... Figure 15 As shown, the software architecture of an electronic device can be a layered structure. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. The layered architecture can be, for example, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. This application embodiment uses a layered architecture from top to bottom, consisting of an application layer, an application framework layer, a system library, a kernel layer, and a hardware layer, as an example; however, the specific layering method of the architecture is not limited.
[0241] like Figure 15 As shown, the application layer can include map applications or other applications.
[0242] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications within the application layer. The application framework layer includes predefined functions. It may also include rendering services, which provide rendering services to the application. For example, after a touch sensor detects a user tapping a map application, the map application can send a command to the rendering service to request the rendering of relevant map graphics.
[0243] Optionally, the application layer and application framework layer can run in a virtual machine on the electronic device. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0244] A system library may include at least one functional module. For example, a rendering engine. The rendering engine is used for drawing, image rendering, compositing, and layer processing. For instance, the rendering engine can perform rendering operations when invoked by a rendering service.
[0245] The kernel layer is the layer between hardware and software. The kernel layer can contain display drivers and GPU drivers, among others.
[0246] The hardware layer includes various hardware components such as displays, touch sensors, GPUs, and caches. For example, the rendering engine can call the GPU to render graphics data and can also write data to the cache. Displays include, for example, display panels and display driver chips. Of course, the hardware layer also includes other hardware, such as processors, which will not be listed here.
[0247] The rendering service or rendering engine determines the expected display time of the data. Based on the expected display time and the actual refresh time of the display, it calls the display to show the data to display the corresponding graphics. For example, if the expected display time is earlier than or equal to the actual refresh time of the display, the display is called to show the data. This example uses a rendering service or rendering engine to perform these steps; in reality, these steps can also be performed by other modules in the electronic device, and there is no limitation on this.
[0248] Understandable Figure 15 The software structure shown does not constitute a specific limitation on the software structure of electronic devices. The software structure of the electronic devices in the embodiments of the present invention may include, but is not limited to, the following: Figure 15 More or fewer modules, for example, than Figure 15 More or fewer layers, or, a layer containing more than Figure 15 More or fewer modules, etc. Furthermore, Figure 15 The combination / connection relationships between modules can also be adjusted and modified.
[0249] Figure 16 This is a schematic diagram of the structure of the electronic device 1600 provided in an embodiment of this application. The electronic device 1600 may be a terminal device or a server as described above. Figure 16As shown, electronic device 1600 may include: one or more processors 1601; one or more memories 1602; a communication interface 1603; and one or more computer programs 1604. These components can be connected via one or more communication buses 1605. The one or more computer programs 1604 are stored in the memory 1602 and configured to be executed by the one or more processors 1601. The one or more computer programs 1604 include instructions. For example, when electronic device 1600 is the electronic device described above, the instructions can be used to perform the relevant steps of the processor as described in the corresponding embodiments above. The communication interface 1603 is used to enable communication between electronic device 1600 and other devices; for example, the communication interface may be a transceiver.
[0250] In the embodiments provided above, the methods provided by the embodiments of this application are described from the perspective of an electronic device (e.g., a terminal device or a server) as the executing entity. To implement the functions of the methods provided in the embodiments of this application above, the electronic device may include hardware structures and / or software modules, implementing the above functions in the form of hardware structures, software modules, or a combination of hardware structures and software modules. Whether a particular function is executed in the form of hardware structures, software modules, or a combination of hardware structures and software modules depends on the specific application and design constraints of the technical solution.
[0251] This application provides a chip. The chip is used to perform the display method as described in any of the above method embodiments. The chip is, for example, a SoC chip.
[0252] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)). Where there is no conflict, the solutions in the above embodiments can be combined.
[0253] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0254] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0255] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0256] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0257] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope and intent of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and variations.
Claims
1. A display method, characterized in that, The method is applied in an electronic device, the electronic device including a cache and a display panel, the display panel being used to display data in the cache; the method includes: When the application writes the first frame of data into the cache, the expected display time of the first frame of data is determined, and the expected display time of the first frame of data is the time when the display panel is expected to display the first frame of data. Based on the first actual refresh time and the expected display time of the first frame data, it is determined that the first frame data will be processed for display. The first actual refresh time is the actual refresh time of the display panel.
2. The method according to claim 1, characterized in that, Based on the first actual refresh time and the expected display time of the first frame data, it is determined that the first frame data will be processed for display, including: If the expected display time of the first frame data is earlier than or equal to the first actual refresh time, the first frame data is processed for display at the first actual refresh time.
3. The method according to claim 1 or 2, characterized in that, Based on the first actual refresh time and the expected display time of the first frame data, it is determined that the first frame data will be processed for display, including: If the expected display time of the first frame data is later than the first actual refresh time, the first frame data is processed for display based on the second actual refresh time and the expected display time of the first frame data. The second actual refresh time is the actual refresh time of the display panel, and the second actual refresh time is later than the first actual refresh time.
4. The method according to any one of claims 1-3, characterized in that, The expected display time of the first frame data is determined based on the time it takes for the application to write the first frame data into the cache and the expected frame sending period, wherein the expected frame sending period is the time interval at which the application is expected to write two adjacent frames of data into the cache.
5. The method according to any one of claims 1-3, characterized in that, The expected display time of the first frame data is determined based on the expected display time and expected frame period of the second frame data. The second frame data and the first frame data are two adjacent frames of data written into the cache by the application, and the application writes the second frame data into the cache earlier than it writes the first frame data into the cache. The expected display time of the second frame data is the expected time for the display panel to display the second frame data.
6. The method according to any one of claims 1-3, characterized in that, The expected display time of the first frame data is the later of a first time and a second time. The first time is determined based on the time when the application writes the first frame data to the cache and the expected frame delivery period. The second time is determined based on the expected display time of the second frame data and the expected frame delivery period. The expected frame sending period is the time interval at which the application is expected to write two adjacent frames of data into the cache. The second frame data and the first frame data are two adjacent frames of data written into the cache by the application. The application writes the second frame data into the cache earlier than it writes the first frame data into the cache. The expected display time of the second frame data is the time at which the display panel is expected to display the second frame data.
7. The method according to claim 6, characterized in that, Before determining the expected display time of the first frame of data, the method further includes: The first time is determined to be earlier than or equal to the expected display time of the second frame of data.
8. The method according to claim 6 or 7, characterized in that, The first frame data and the second frame data are two frames of data generated by the application based on different operations.
9. The method according to any one of claims 1-8, characterized in that, Before determining to perform display processing on the first frame data based on the first actual refresh time and the expected display time of the first frame data, the method further includes: Based on the time offset, the expected display time of the first frame data is corrected, where the time offset is the adjustment amount for correcting the expected display time of the first frame data.
10. The method according to claim 9, characterized in that, The method further includes: The first time interval is determined to be less than or equal to a first threshold, wherein the first time interval is the time interval between the expected display time of the first frame data and the start time of the first actual refresh cycle, the first actual refresh cycle is the actual refresh cycle in which the expected display time of the first frame data is located, and the actual refresh cycle is the time interval between two refreshes performed by the display panel.
11. The method according to claim 10, characterized in that, The time offset is determined based on the first time interval and the actual refresh cycle.
12. The method according to any one of claims 1-11, characterized in that, The method further includes: When the application writes the second frame data to the cache, the expected display time of the second frame data is determined, wherein the expected display time of the second frame data is the expected time for the display panel to display the second frame data, the second frame data and the first frame data are two adjacent frames of data written to the cache by the application, and the time when the application writes the second frame data to the cache is earlier than the time when it writes the first frame data to the cache, wherein: The expected display time of the second frame data is the later of the third and fourth times. The third time is determined based on the time when the application writes the second frame data into the cache and the expected frame delivery period. The fourth time is determined based on the expected display time of the second frame data and the expected frame delivery period, where the expected frame delivery period is the time interval between the application writing two adjacent frames of data into the cache.
13. An electronic device, characterized in that, The electronic device is used to perform the method as described in any one of claims 1-12.
14. A computer program product, characterized in that, When the computer program is run on a computer, it causes the computer to perform the method as described in any one of claims 1-12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1-12.