Methods for obtaining offset parameters, offset control methods, and systems for vertical synchronization modules
By identifying scene changes in the display system, obtaining layer generation time and calculating offset parameters, and dynamically adjusting the vertical synchronization module, the problem of the vertical synchronization module being unable to be dynamically adjusted is solved, improving frame rate stability and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SPREADTRUM SEMICON (NANJING) CO LTD
- Filing Date
- 2023-07-28
- Publication Date
- 2026-06-30
AI Technical Summary
In existing technologies, the vertical synchronization module cannot dynamically adjust according to different display scenarios, resulting in poor frame rate stability and responsiveness, and a poor user experience.
By identifying scene changes in the display system, obtaining the layer generation time, calculating the offset parameters, and updating the vertical synchronization module in real time, the offset is dynamically adjusted to match the display scene.
Improve frame rate stability, shorten screen loading time, reduce the probability of frame drops and stuttering, and enhance user experience.
Smart Images

Figure CN116991351B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image display technology, and in particular to a method for obtaining offset parameters of a vertical synchronization module, an offset control method, a system, a device, a medium, a chip, and a chip module. Background Technology
[0002] In the Android operating system, hardware Vsync (vertical synchronization) is used as the sampling value for the display system. The simulated software Vsync model is used to ensure the Render Pipeline (a framework for drawing graphics and rendering images) beat. This allows the SW Vsync (Software Vertical Synchronization) signal on the Framework side to be flexibly changed. Although this method can reduce jank (stuttering) rate, it will take two Vsync intervals from the construction of a frame of data to its display, and the display speed will not be improved. Therefore, Google then proposed the concept of Vsync Offset (vertical synchronization offset) to optimize display performance through virtualization behavior. However, due to the large differences in scene load and the long research cycle, there are no gaps in device adaptation, scene adaptation, and gain level. Therefore, Vsync Offset is still in a static configuration state.
[0003] Frame rate stability and responsiveness are the most intuitive aspects for users. Due to the limitations of the rendering scene load, frame rate stability and responsiveness will vary in different scenes. This is more pronounced on machines with poor hardware performance or insufficient software optimization, resulting in a poor user experience. Summary of the Invention
[0004] The technical problem to be solved by this disclosure is to overcome the defect in the prior art that the vertical synchronization module cannot be dynamically adjusted according to different display scenarios, and to provide a method for obtaining the offset parameters of the vertical synchronization module, an offset control method, a system, a device, a medium, a chip, and a chip module.
[0005] This disclosure solves the above-mentioned technical problems through the following technical solution:
[0006] The first aspect provides a method for obtaining the offset parameter of a vertical synchronization module, applied to a display system, wherein the method includes:
[0007] Identify whether the current first display scene in the display system has changed;
[0008] In response to a change in the first display scene, the generation time of the layer in the changed second display scene is obtained;
[0009] The offset parameters for the vertical synchronization module are calculated based on the generation duration.
[0010] The offset parameter is used to characterize the difference between the screen refresh rate of the first display scene and the refresh signal of the layer in the second display scene.
[0011] Preferably, the step of identifying whether the current first display scene in the display system has changed includes:
[0012] Obtain the layer display information corresponding to the layers that are continuously displayed in the first display scene in the display system;
[0013] The layer display information includes at least one of the following: refresh rate, number of layers in the list, internal layer information, layer composition method, and layer on-screen time deviation.
[0014] In response to differences in the display information of adjacent layers, it is recognized that the first display scene has changed.
[0015] Preferably, the offset parameter includes a first offset on the application side and a second offset on the display synthesis side, and the step of calculating the offset parameter for the vertical synchronization module based on the generation duration includes:
[0016] Obtain the target generation time of the layer in the second display scene;
[0017] The first offset and the second offset are calculated based on the target generation time.
[0018] The first offset includes the first imaging cycle duration or the first working duration on the application side, and the second offset includes the second imaging cycle duration or the second working duration on the display synthesis side.
[0019] Preferably, the step of obtaining the target generation time of the layer in the second display scene includes:
[0020] Iterate through the voting rights of the layers and select the target layer with the highest voting rights;
[0021] The voting right represents the priority of the layer;
[0022] The generation time corresponding to the target layer is used as the target generation time of the layer in the second display scene.
[0023] Preferably, the step of using the generation time corresponding to the target layer as the target generation time of the layer in the second display scene includes:
[0024] Obtain the sample generation time corresponding to the target layer in several frames;
[0025] The target generation time is calculated based on the sample generation time.
[0026] Preferably, the step of calculating the target generation duration based on the sample generation time includes:
[0027] Obtain several layers in the second display scene and use them as sample layers, and use the generation time corresponding to the sample layers as the sample generation time;
[0028] The first duration deviation between the generation times of any two of the samples is calculated;
[0029] If the first duration deviation is greater than a first preset deviation threshold, then the maximum value of the sample generation duration is selected as the target generation duration;
[0030] In response to the first duration deviation being less than a first preset deviation threshold, the average of the generation durations of several samples is calculated and used as the target generation duration.
[0031] Preferably, the offset parameter further includes the layer's composition priority mode, and the step of calculating the offset parameter for the vertical synchronization module based on the generation duration includes:
[0032] Obtain the buffer wait time of the rendering thread in the second display scene;
[0033] If the first ratio of the buffer waiting time to the target generation time meets the first preset ratio requirement, then the compositing priority mode of the second display scene is display compositing priority;
[0034] Otherwise, the composition priority mode for the second display scene is application priority.
[0035] The second aspect provides an offset control method for a vertical synchronization module, wherein the vertical synchronization module includes a vertical synchronization model, and the offset control method includes:
[0036] Obtain the offset parameters of the vertical synchronization model;
[0037] The offset parameter is obtained based on the method for obtaining the offset parameter of the vertical synchronization module described above;
[0038] In response to the update of the offset parameter, the rendering duration of the updated display scene is obtained;
[0039] Based on the rendering duration, the interval before the next display compositing module operation is calculated;
[0040] If the second ratio of the interval duration to the vertical synchronization cycle duration of the updated display scene is less than the second preset ratio, the updated offset parameter is input to the vertical synchronization model for offsetting.
[0041] Preferably, the offset control method further includes:
[0042] If the second ratio of the interval duration to the vertical synchronization duration of the updated display scene is greater than the second preset ratio, then a preset static offset parameter is input to the vertical synchronization model for offset control.
[0043] Preferably, the offset control method further includes:
[0044] Get the display information of the first layer in the display scene before the update, and the display information of the second layer in the display scene after the update;
[0045] If the information displayed in the first layer is better than that displayed in the second layer, then a preset static offset parameter is input to the vertical synchronization model for offset control.
[0046] Preferably, the offset control method further includes:
[0047] Obtain the layer generation duration corresponding to the continuous generation of several layers in the updated display scene within a preset time.
[0048] Calculate the second duration deviation between the generation times of adjacent layers;
[0049] If the second duration deviation is greater than a preset deviation threshold, a preset static offset parameter is input to the vertical synchronization model for offset control.
[0050] Preferably, the offset control method further includes:
[0051] Associate the updated offset parameter with the updated display scene;
[0052] In response to the updated target display scene, the target offset parameter that matches the target display scene is invoked.
[0053] The third aspect provides a system for obtaining offset parameters of a vertical synchronization module, the system including a scene recognition module, a duration statistics module and a calculation module;
[0054] The scene recognition module is used to identify whether the current first display scene in the display system has changed;
[0055] The duration statistics module is used to obtain the generation duration of the layer in the changed second display scene in response to a change in the first display scene;
[0056] The calculation module is used to calculate the offset parameters for the vertical synchronization module based on the generation duration;
[0057] The offset parameter is used to characterize the difference between the screen refresh rate of the first display scene and the refresh signal of the layer in the second display scene.
[0058] The fourth aspect provides an offset control system for a vertical synchronization module, the offset control system including a parameter acquisition module, a duration acquisition module, a time calculation module and an offset control module;
[0059] The parameter acquisition module is used to acquire the offset parameters of the vertical synchronization model; wherein, the offset parameters are obtained based on the vertical synchronization module offset parameter acquisition system described above.
[0060] The duration acquisition module is used to acquire the updated rendering duration of the display scene in response to the update of the offset parameter.
[0061] The time calculation module is used to calculate the interval between the next display and composition side working time based on the rendering duration.
[0062] The offset control module is configured to input the updated offset parameters into the vertical synchronization model for offsetting if the ratio of the interval duration to the vertical synchronization cycle duration of the updated display scene is less than a preset ratio.
[0063] The fifth aspect provides an electronic device, including a memory, a processor, and a computer program stored in the memory and for running on the processor, wherein the processor executes the computer program to implement the method for obtaining the offset parameters of the vertical synchronization module described above, or to implement the offset control method of the vertical synchronization module described above.
[0064] A sixth aspect provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, it implements the method for obtaining the offset parameters of the vertical synchronization module described above, or implements the offset control method of the vertical synchronization module described above.
[0065] A seventh aspect provides a chip, characterized in that the chip stores a computer program, which, when executed by the chip, implements the method for obtaining the offset parameters of the vertical synchronization module as described above, or implements the offset control method of the vertical synchronization module as described above.
[0066] The eighth aspect provides a chip module for use in an electronic device, characterized in that it includes a transceiver component and a chip, wherein the chip is used to execute the method for obtaining the offset parameters of the vertical synchronization module as described above, or to implement the offset control method of the vertical synchronization module as described above.
[0067] Based on common knowledge in the field, the above-mentioned preferred conditions can be combined arbitrarily to obtain various preferred embodiments of this disclosure.
[0068] The positive and progressive effects of this disclosure are as follows: by identifying changes in the display scene, obtaining the layer generation time of the changed display scene, and calculating the offset parameters corresponding to the changed display scene, the vertical synchronization module is updated in real time, which improves frame rate stability and shortens the on-screen time, reduces the probability of frame drop and stuttering, and improves stability and responsiveness, thereby further enhancing the user experience. Attached Figure Description
[0069] Figure 1 This is a flowchart of the method for obtaining the offset parameters of the vertical synchronization module in Embodiment 1 of this disclosure;
[0070] Figure 2 This is a flowchart of step S101 in the method for obtaining the offset parameters of the vertical synchronization module in Embodiment 1 of this disclosure;
[0071] Figure 3 This is a schematic diagram illustrating the layer generation time in Embodiment 1 of this disclosure;
[0072] Figure 4 This is a schematic diagram of the scene change recognition process in the method for obtaining the offset parameters of the vertical synchronization module in Embodiment 1 of this disclosure;
[0073] Figure 5 This is a flowchart of step S102 in the method for obtaining the offset parameters of the vertical synchronization module in Embodiment 1 of this disclosure;
[0074] Figure 6 This is a flowchart of step S103 in the method for obtaining the offset parameters of the vertical synchronization module in Embodiment 1 of this disclosure;
[0075] Figure 7 This is a first flowchart of the offset control method for the vertical synchronization module in Embodiment 2 of this disclosure;
[0076] Figure 8 This is a second flowchart of the offset control method for the vertical synchronization module in Embodiment 2 of this disclosure;
[0077] Figure 9 This is a third flowchart of the offset control method for the vertical synchronization module in Embodiment 2 of this disclosure;
[0078] Figure 10This is the fourth flowchart of the offset control method for the vertical synchronization module in Embodiment 2 of this disclosure;
[0079] Figure 11 This is a schematic diagram of the App-side offset control in the working principle of Embodiment 1 and Embodiment 2 of this disclosure;
[0080] Figure 12 This is a schematic diagram of the system for obtaining the offset parameters of the vertical synchronization module in Embodiment 3 of this disclosure;
[0081] Figure 13 This is a schematic diagram of the offset control system of the vertical synchronization module in Embodiment 4 of this disclosure;
[0082] Figure 14 This is a schematic diagram of the hardware structure of the electronic device according to Embodiment 5 of this disclosure. Detailed Implementation
[0083] The present disclosure is further illustrated below by way of embodiments, but the present disclosure is not limited to the scope of the embodiments described herein.
[0084] Example 1
[0085] This embodiment provides a method for obtaining the offset parameters of a vertical synchronization module, such as... Figure 1 As shown, this method of acquisition is applied to a display system.
[0086] S101. Identify whether the current first display scene in the display system has changed;
[0087] S102. In response to a change in the first display scene, obtain the generation time of the layer in the changed second display scene;
[0088] S103. Calculate the offset parameters for the vertical synchronization module based on the generation duration;
[0089] The offset parameter is used to characterize the difference between the screen refresh rate of the first display scene and the refresh signal of the layer in the second display scene.
[0090] In this solution, the re-acquisition of offset parameters for the changed display scene is triggered by recognizing changes in the display scene. The overall generation time of drawing, rendering, compositing, and displaying the layers in the switched second display scene is calculated based on signals emitted from the App application side. Optionally, a Frame Timeline can be used to represent the layer generation time, which includes the layer itself. The offset parameters corresponding to the changed second display scene are obtained from the layer generation time, enabling the acquisition of dynamic offset parameters for the vertical synchronization module in the changed second display scene, thus improving the matching degree between the vertical synchronization module and the display scene.
[0091] As a feasible approach, such as Figure 2 As shown, step S101 includes:
[0092] S1011. Obtain the layer display information corresponding to the layers continuously displayed in the first display scene in the display system;
[0093] The layer display information includes refresh rate, number of layers in the list, internal layer information, layer composition method, and layer on-screen time deviation.
[0094] S1012. In response to the different display information of adjacent layers, it is recognized that the first display scene has changed.
[0095] This solution proposes a scene dynamic Vsync Offset based on Surface Flinger. By recognizing layer display information, it accurately determines changes in the display scene. Changes in screen refresh rate, composition method, and layer information will cause changes in Vsync (vertical synchronization) interval or overall generation time. Based on these changes, the changes in the display scene are identified. The layer on-screen time deviation represents the difference between the actual time and the expected time of the layer on-screen exceeding a time threshold. An offset parameter matching the display scene is calculated, which can shorten the on-screen time of the changed display field and improve the user experience.
[0096] As one possible approach, changes in layer information include changes in the layer list, changes in the visible area, changes in the display area, and changes in the layer order.
[0097] As a feasible approach, such as Figure 3 As shown, the layer generation time can also be obtained from the time when the APP application initiates the layer request (including the timestamps of the current and next initiation), the time when the layer drawing starts and ends, the time when rendering starts and data is submitted, the time waiting for the GPU to complete rendering, the time when the compositing module consumes the data (including the timestamps of the current and next consumption), the time when compositing starts and ends, the time when the compositing engine works, the time waiting for compositing to complete, the time when the data is actually displayed, and the time when the display module consumes the data (including the timestamps of the current and next consumption). Those skilled in the art will understand that the time in this solution can be a timestamp, moment information, or duration information to obtain the accurate duration of each stage in the layer generation process, which is used to calculate the precise deviation parameters.
[0098] As a feasible approach, such as Figure 4As shown, each time a display scene is detected, the generation duration and / or timestamps of each stage corresponding to the layer of the changed display scene are obtained and cached for calculation of the offset parameters of the changed display scene. When a change in the current display scene is detected again, the data in the cache is reset, and statistical samples of the data in the changed display scene are collected and calculated. This avoids interference between layer information in different display scenes.
[0099] As a feasible approach, such as Figure 5 As shown, step S102 includes:
[0100] S1021. Traverse the voting rights of the layers and select the target layer with the highest voting rights;
[0101] The voting right represents the priority of the layer;
[0102] S1022. The generation time corresponding to the target layer is used as the target generation time of the layer in the second display scene.
[0103] In this solution, since the Vsync returns from the APP side are all at a uniform time, it is necessary to calculate the priority of the layers based on voting rights. In the Android system, the layer with the highest voting rights has the highest weight, meaning it has the highest priority and occupies the largest display space, which is the display area that the user is most interested in. By selecting the target layer with the highest voting rights and obtaining the corresponding target generation time, the offset of the target layer is calculated. Calculating only the offset of the target layer can reduce the amount of offset parameter calculation while meeting user needs and improving the efficiency of obtaining offset parameters.
[0104] As one possible approach, step S1022 includes:
[0105] Obtain the sample generation time corresponding to the target layer in several frames;
[0106] The target generation time is calculated based on the sample generation time.
[0107] In this solution, the generated layers in the second display scene are sampled, and the generation time of several samples is used to determine whether the second display scene is in a stable state. The sample review time includes timestamp samples from the generation of the target layer to its display, so that the target generation time calculated from the sample generation time is accurately matched with the second display scene, so as to obtain more accurate offset parameters.
[0108] As one possible approach, the step of calculating the target generation duration based on the sample generation time includes:
[0109] Obtain several layers in the second display scene and use them as sample layers, and use the generation time corresponding to the sample layers as the sample generation time;
[0110] The first duration deviation between the generation times of any two of the samples is calculated;
[0111] If the first duration deviation is greater than a first preset deviation threshold, then the maximum value of the sample generation duration is selected as the target generation duration;
[0112] In response to the first duration deviation being less than a first preset deviation threshold, the average of the generation durations of several samples is calculated and used as the target generation duration.
[0113] In this scheme, the stability of the second display scene is determined by calculating the deviation between the generation times of any two samples in the second display scene. If the time deviation meets the deviation threshold, the layer generation in the second display scene is in a stable state, that is, the generation time of the target layer is stable. According to actual work requirements, the total time can be calculated based on the generation times of several samples, as well as the average time, variance time, or median time as the target generation time, which is used to calculate the offset parameter of the second display scene. If the time deviation does not meet the deviation threshold, the layer generation in the second display scene is in an unstable state, that is, the generation time of the target layer fluctuates greatly. In this case, the maximum value among the generation times of several samples is used as the target generation time to ensure that the offset parameter calculated from the target generation time is controlled within a reasonable range.
[0114] As one possible approach, the offset parameters include a first offset on the application side and a second offset on the display composition side, such as... Figure 6 As shown, step S103 includes:
[0115] S1031. Obtain the target generation time of the layer in the second display scene;
[0116] S1032. Calculate the first offset and the second offset based on the target generation time;
[0117] The first offset includes the first imaging cycle duration or the first working duration on the application side, and the second offset includes the second imaging cycle duration or the second working duration on the display synthesis side.
[0118] In this solution, the accuracy of the offset parameters is improved by calculating the first offset on the App side and the second offset on the composite display side by obtaining the layer generation duration corresponding to the stable state of the display scene. Based on the target generation duration of the layers in the second display scene, the corresponding first and second offsets are calculated according to the time nodes of each stage of drawing, rendering, compositing, and display within the target generation duration. The first offset includes, but is not limited to, the first working duration or the first imaging cycle on the App side (WorkDuration), and similarly, the second offset includes, but is not limited to, the second working duration or the second imaging cycle on the composite display side.
[0119] In this solution, the dynamic adjustment scheme of Vsync Offset for the display scene was found through extensive preliminary experiments that the main parameters affecting the offset are the drawing, rendering, and compositing time points and their consumption in the Render Pipeline. By adding a RenderTimeline module to the SurfaceFlinger process to monitor the time of each node in each frame and complete timestamp statistics, and adding a Vsync Duration module to monitor environmental changes and modify the duration of the app and sf.
[0120] As one possible approach, the offset parameter also includes the layer's composition priority mode, and the step of calculating the offset parameter for the vertical synchronization module based on the generation duration includes:
[0121] Get the buffer (dequeue) wait time of the rendering thread in the second display scene;
[0122] If the first ratio of the buffer waiting time to the target generation time meets the requirement of the first preset ratio, then the compositing priority mode of the second display scene is display compositing priority;
[0123] Otherwise, the composition priority mode for the second display scene is application priority.
[0124] In this scheme, the buffer wait time represents the time T that the rendering thread waits for the buffer. dequeue_span Among them, T dequeue_span =T post -T dequeue T post T represents the time point from when the APP submits data to the synthesis module. dequeueThis indicates the time point at which the rendering thread acquires the buffer. As an implementation, in response to a buffer wait time to target generation time ratio being less than a preset threshold, the Vsync signal for display composition in the second display scene takes priority, and the composition priority mode is marked. This can significantly reduce buffer wait time when display composition is prioritized.
[0125] The method for obtaining the offset parameters of the vertical synchronization module provided in this embodiment identifies changes in the display scene, obtains the layer generation time of the changed display scene, and calculates the offset parameters corresponding to the changed display scene. This is used to update the vertical synchronization module in real time, improve frame rate stability, shorten the on-screen time, reduce the probability of frame drops and stuttering, improve stability and responsiveness, and further enhance the user experience.
[0126] Example 2
[0127] This embodiment provides an offset control method for a vertical synchronization module, such as... Figure 7 As shown, the vertical synchronization module includes a vertical synchronization model, and the offset control method includes:
[0128] S201. Obtain the offset parameters of the vertical synchronization model;
[0129] The offset parameter is obtained based on the method for obtaining the offset parameter of the vertical synchronization module in Embodiment 1;
[0130] S202. In response to the update of the offset parameter, the rendering duration of the updated display scene is obtained.
[0131] S203. Based on the rendering duration, calculate the interval between the next display and composition side operation time.
[0132] S204. In response to the second ratio of the interval duration to the vertical synchronization cycle duration of the updated display scene being less than the second preset ratio, the updated offset parameter is input to the vertical synchronization model for offsetting.
[0133] In this solution, the rendering time T of the GPU (Graphics Processing Unit) in the updated display scene is obtained. draw T draw =T actual_span -T post T actual_span T represents the actual processing time of the App process. post This indicates the time point when the APP submits data to the compositing module, and further, the time interval T until the next display of the compositing module's working time is obtained. latency T latency=nT next_sf_vsync -T draw_point Where n represents the frame in the vertical synchronization cycle at which the display synthesis side is working, and n is a natural number greater than 1, T draw_point This indicates the moment when the GPU completes rendering. Based on the interval duration matching the updated vertical synchronization cycle duration of the display scene, the updated offset parameters, including the first offset on the application side and the second offset on the display compositing side, are fed back into the vertical synchronization model to ensure they take effect in the next RenderPipeline. This improves frame rate jitter or shortens on-screen time on devices with different performance levels, further enhancing the user experience.
[0134] As a feasible approach, such as Figure 8 As shown, the offset control method further includes:
[0135] S205. In response to the second ratio of the interval duration to the vertical synchronization duration of the updated display scene being greater than the second preset ratio, a preset static offset parameter is input to the vertical synchronization model for offset control.
[0136] In this scheme, when the interval duration of the updated real-world scenario does not meet the ratio requirement of the vertical synchronization duration, it indicates that the updated offset parameter may affect the stability of the vertical synchronization module. The stability of the control of the vertical synchronization module is ensured by presetting the static offset parameter, thus avoiding negative optimization of the vertical synchronization module.
[0137] As a feasible approach, such as Figure 9 As shown, the offset control method further includes:
[0138] S206. Obtain the display information of the first layer in the display scene before the update, and the display information of the second layer in the display scene after the update;
[0139] S207. In response to the fact that the display information of the first layer is better than the display information of the second layer, a preset static offset parameter is input to the vertical synchronization model for offset control.
[0140] In this solution, the adjustment effect of the vertical synchronization module based on the updated offset parameters is evaluated by comparing the layer display information in the display scene before and after the update. When the adjustment effect is positive feedback, the offset parameters of the vertical synchronization module are maintained to ensure the control stability of the vertical synchronization module.
[0141] As a feasible approach, such as Figure 10 As shown, the offset control method further includes:
[0142] S208. Obtain the layer generation duration corresponding to the continuous generation of several layers in the updated display scene within a preset time.
[0143] S209. Calculate the deviation between the generation times of adjacent layers;
[0144] S210. In response to the deviation being greater than a preset deviation threshold, a preset static offset parameter is input to the vertical synchronization model for offset control.
[0145] In this scheme, the adjustment effect of the vertical synchronization module based on the updated offset parameters is evaluated. When the adjustment effect is negative feedback, the stability of the control of the vertical synchronization module is ensured by preset static offset parameters to avoid negative optimization of the vertical synchronization module.
[0146] As one possible implementation, the offset control method further includes:
[0147] Associate the updated offset parameter with the updated display scene;
[0148] In response to the updated target display scene, the target offset parameter that matches the target display scene is invoked.
[0149] In this solution, by associating and storing the display scene with the corresponding offset parameters, the adjustment time of the offset parameters of the vertical synchronization module for different display scenes is shortened, thereby realizing real-time offset control of the vertical synchronization module for different display scenes and improving the user experience.
[0150] As one feasible approach, the display scene, display system parameters, terminal information, and corresponding offset parameters can be associated, and the associated information can be sent to a cloud server. The cloud server can then organize or further process the collected associated data to obtain the optimal offset parameters that match the display scene, display system parameters, and terminal information. The optimal offset parameters can then be sent to the corresponding display system or terminal to enable rapid setup of vertical synchronization modules in similar display scenes.
[0151] The offset control method of the vertical synchronization module provided in this embodiment calculates the interval between the rendering duration and the next display compositing side working time in the updated display scene. This allows the updated offset parameters to be input into the vertical synchronization model in a timely manner to control the vertical synchronization module to offset. The method also provides feedback verification on the display effect in the updated display scene after the offset settings are updated. This improves the display efficiency in the updated display scene while forming a negative feedback mechanism to better adapt to scene changes, thereby reducing the probability of frame drops and stuttering, improving stability and responsiveness, providing a better user experience, and ensuring the stability of the display scene.
[0152] The following examples illustrate the working principles of the method for obtaining the offset parameters of the vertical synchronization module in Embodiment 1 and the method for controlling the offset of the vertical synchronization module in Embodiment 2. Figure 11 As shown, specifically:
[0153] After recognizing a change in the current display scene, offset control is applied to the App side;
[0154] Reset the timeline data related to the generation duration of the displayed scene in the cache;
[0155] Iterate through the layers and get the layer with the highest voting power.
[0156] Data sampling of generation time for layers in the display scene;
[0157] Determine whether sufficient sample data has been obtained;
[0158] In response to the acquisition of sufficient sample data, the total duration and average duration of sample data generation are calculated.
[0159] If insufficient sample data is obtained, the deviation between the sample data of the preceding and following frames is calculated.
[0160] If the deviation does not exceed the deviation threshold, continue collecting and adding sample data;
[0161] If the deviation exceeds the deviation threshold, the maximum value among the sample values is selected as the sample data generation time.
[0162] The duration of waiting for the buffer in the rendering thread (Dequeue Buffer duration) is calculated based on the time point when the App submits data to the compositing module and the time point when the rendering thread obtains the buffer in the sample data.
[0163] If the ratio of the Dequeue Buffer duration to the average duration is greater than 1 / 4, then Vsync-sf is marked as preferred in this display scenario;
[0164] If the ratio of the Dequeue Buffer duration to the average duration is less than 1 / 4, then Vsync-app is marked as preferred in this display scenario;
[0165] The estimated actual GPU rendering time is the latency from the end of rendering to the next Vsync-sf.
[0166] Calculate the Workduration on the App side, where Workduration = Average duration + Fluctuation coefficient;
[0167] Conversely, the offset setting on the Surface Flinger side is adjusted after a change in the current display scene is detected.
[0168] Reset the timeline data related to the generation duration of the displayed scene in the cache;
[0169] Data sampling of generation time for layers in the display scene;
[0170] In response to the acquisition of sufficient sample data, the total duration and average duration of sample data generation are calculated.
[0171] If insufficient sample data is obtained, the timestamp in the sample data is recorded.
[0172] Determine if the composition method is Client composition;
[0173] If the compositing method is Client compositing, then obtain the drawing time of the Draw Layer and the GPU rendering time;
[0174] Determine whether the composition method submitted by the App side prioritizes Vsync-sf;
[0175] In response to the compositing method being Vsync-sf preferred, the layers are traversed to obtain the DequeueBuffer duration of the Layer with the highest voting power;
[0176] Idle Time is estimated based on the Dequeue Buffer duration;
[0177] If the synthesis method is not Vsync-sf preferred, then the Idle Time is directly estimated.
[0178] Work Duration on the Surface Flinger side is enabled based on Idle Time.
[0179] The Workduration on the App side and the Work Duration on the Surface Flinger side are synchronized to the Offset dynamic adjustment module to perform offset control of the vertical synchronization module for the current display scene.
[0180] Feedback sampling is performed on the display scene after the offset setting;
[0181] The data is based on a comparison of three consecutive frames of feedback sample data with the sample data before offset control;
[0182] The response was that all three consecutive frames of feedback sample data showed negative optimization compared to the sample data before offset control;
[0183] Then restore the default static vertical synchronization offset;
[0184] The response to three consecutive frames of feedback sample data is better than the sample data before offset control;
[0185] Then maintain the current offset parameters for offset control of the vertical synchronization module.
[0186] Example 3
[0187] This embodiment provides a system 100 for obtaining the offset parameters of a vertical synchronization module, such as... Figure 12 As shown, the acquisition system includes a scene recognition module 101, a duration statistics module 102, and a calculation module 103;
[0188] The scene recognition module 101 is used to identify whether the current first display scene in the display system has changed;
[0189] The duration statistics module 102 is used to obtain the generation duration of the layer in the changed second display scene in response to a change in the first display scene;
[0190] The calculation module 103 is used to calculate the offset parameters for the vertical synchronization module based on the generation duration;
[0191] The offset parameter is used to characterize the difference between the screen refresh rate of the first display scene and the refresh signal of the layer in the second display scene.
[0192] As one possible approach, the scene recognition module 101 is further configured to obtain layer display information corresponding to continuously displayed layers in the first display scene of the display system; wherein, the layer display information includes at least one of refresh rate, number of layers in the layer list, internal layer information, layer composition method, and layer on-screen time deviation; in response to the difference in the display information of adjacent layers, the first display scene is identified as having changed.
[0193] In one possible implementation, the offset parameters include a first offset on the application side and a second offset on the display composition side; the calculation module 103 includes a layer acquisition unit and an offset calculation unit;
[0194] The layer acquisition unit is used to acquire the target generation time of the layer in the second display scene;
[0195] The offset calculation unit is used to calculate the first offset and the second offset based on the target generation duration. The first offset includes the first imaging cycle duration or the first working duration on the application side, and the second offset includes the second imaging cycle duration or the second working duration on the display synthesis side.
[0196] As one possible approach, the layer acquisition unit is further configured to traverse the voting rights of the layers and select the target layer with the highest voting rights; wherein the voting rights represent the priority of the layer; and the generation time corresponding to the target layer is used as the target generation time of the layer in the second display scene.
[0197] As one possible approach, the layer acquisition unit is also used to acquire the sample generation duration corresponding to several frames of the target layer; and calculate the target generation duration based on the sample generation duration.
[0198] In one possible way, the layer acquisition unit is also used to acquire several layers in the second display scene, and use them as sample layers and the generation time corresponding to the sample layers as sample generation time;
[0199] The offset calculation unit is further configured to calculate a first duration deviation between any two sample generation durations; in response to the first duration deviation being greater than a first preset deviation threshold, the maximum value of the sample generation duration is selected as the target generation duration; in response to the first duration deviation being less than the first preset deviation threshold, the average of several sample generation durations is calculated and used as the target generation duration.
[0200] As one possible approach, the offset parameter also includes the layer's composition priority mode, and the calculation module 103 further includes a buffer wait time acquisition unit and a judgment unit;
[0201] The buffer wait time acquisition unit is used to acquire the buffer wait time of the rendering thread in the second display scene;
[0202] The judgment unit is configured to respond to the requirement that the first ratio of the buffer waiting time to the target generation time meets the first preset ratio, in which case the composition priority mode of the second display scene is display composition priority; otherwise, the composition priority mode of the second display scene is application priority.
[0203] It should be noted that the implementation principle of the vertical synchronization module offset parameter acquisition system in this embodiment is the same as that of the vertical synchronization module offset parameter acquisition method in Embodiment 1, so it will not be repeated here.
[0204] The vertical synchronization module offset parameter acquisition system provided in this embodiment identifies changes in the display scene, obtains the layer generation time of the changed display scene, and calculates the offset parameter corresponding to the changed display scene. This is used to update the vertical synchronization module in real time, improve frame rate stability, shorten the on-screen time, and further enhance the user experience.
[0205] Example 4
[0206] This embodiment provides an offset control system 200 for a vertical synchronization module, such as... Figure 13 As shown, the offset control system 200 includes a parameter acquisition module 201, a rendering duration acquisition module 202, a time calculation module 203, and an offset control module 204.
[0207] The parameter acquisition module 201 is used to acquire the offset parameters of the vertical synchronization model; wherein, the offset parameters are obtained based on the vertical synchronization module offset parameter acquisition system described in Embodiment 3;
[0208] The rendering duration acquisition module 202 is used to acquire the rendering duration of the updated display scene in response to the offset parameter update.
[0209] The time calculation module 203 is used to calculate the interval time before the next display of the compositing side working time based on the rendering duration.
[0210] The offset control module 204 is configured to input the updated offset parameters into the vertical synchronization model for offsetting when the second ratio of the interval duration to the vertical synchronization cycle duration of the updated display scene is less than the second preset ratio.
[0211] As one possible approach, the offset control module 204 is further configured to input a preset static offset parameter into the vertical synchronization model for offset control in response to a second ratio of the interval duration to the vertical synchronization duration of the updated display scene being greater than a second preset ratio.
[0212] As one possible implementation, the offset control system further includes a layer information acquisition module 205;
[0213] The layer information acquisition module 205 is used to acquire the first layer display information in the display scene before the update, and the second layer display information in the display scene after the update;
[0214] The offset control module 204 is also used to input a preset static offset parameter to the vertical synchronization model for offset control in response to the first layer display information being better than the second layer display information.
[0215] As one possible implementation, the offset control system further includes a layer duration acquisition module 206;
[0216] The layer duration acquisition module 206 is used to acquire the layer generation duration corresponding to the continuous generation of several layers in the updated display scene within a preset time.
[0217] The offset control module 204 is also used to calculate a second duration deviation between the generation times of the layers corresponding to adjacent layers; in response to the second duration deviation being greater than a second preset deviation threshold, a preset static offset parameter is input to the vertical synchronization model for offset control.
[0218] As one possible implementation, the offset control system also includes an association module 207;
[0219] The association module 207 is used to associate the updated offset parameter with the updated display scene;
[0220] The offset control module 204 is also used to call the target offset parameter that matches the target display scene in response to the updated target display scene.
[0221] It should be noted that the implementation principle of the offset control system of the vertical synchronization module in this embodiment is the same as that of the offset control method of the vertical synchronization module in Embodiment 2, so it will not be described again here.
[0222] The offset control system of the vertical synchronization module provided in this embodiment calculates the interval between the rendering duration and the next display compositing side working time in the updated display scene, so as to input the updated offset parameters into the vertical synchronization model in a timely manner, control the vertical synchronization module to offset, and provide feedback verification on the display effect in the updated display scene after offset setting, so as to improve the display efficiency in the updated display scene while ensuring the stability of the display scene.
[0223] Example 5
[0224] like Figure 14 The diagram shown is a structural schematic of an electronic device provided in Embodiment 5 of this disclosure. It includes a memory, a processor, and a computer program stored in the memory and used to run on the processor. When the processor executes the computer program, it implements the method for obtaining the offset parameters of the vertical synchronization module described in Embodiment 1 or the offset control method of the vertical synchronization module described in Embodiment 2. Figure 14 The electronic device 30 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0225] Electronic device 30 may be in the form of a general-purpose computing device, such as a server device. Components of electronic device 30 may include, but are not limited to: at least one processor 31, at least one memory 32, and a bus 33 connecting different system components (including memory 32 and processor 31).
[0226] Bus 33 includes a data bus, an address bus, and a control bus.
[0227] The memory 32 may include volatile memory, such as random access memory (RAM) 321 and / or cache memory 322, and may further include read-only memory (ROM) 323.
[0228] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0229] The processor 31 executes various functional applications and data processing by running computer programs stored in the memory 32, such as the method for obtaining the offset parameters of the vertical synchronization module described in Embodiment 1 of this disclosure or the offset control method of the vertical synchronization module described in Embodiment 2.
[0230] Electronic device 30 can also communicate with one or more external devices 34 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 35. Furthermore, the model-generated device 30 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public network, such as the Internet) via network adapter 36. As shown, network adapter 36 communicates with other modules of the model-generated device 30 via bus 33. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the model-generated device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.
[0231] It should be noted that although the units / modules or sub-units / modules of the electronic device are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.
[0232] Example 6
[0233] This disclosure also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method for obtaining offset parameters of the vertical synchronization module as described in Embodiment 1 or the method for offset control of the vertical synchronization module as described in Embodiment 2.
[0234] The readable storage medium may be more specifically adopted, including but not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.
[0235] In possible implementations, this disclosure can also be implemented as a program product comprising program code, which, when the program product is run on a terminal device, causes the terminal device to execute the method for obtaining the offset parameters of the vertical synchronization module as described in Embodiment 1 or the offset control method of the vertical synchronization module as described in Embodiment 2.
[0236] The program code for executing this disclosure can be written in any combination of one or more programming languages. The program code can be executed entirely on a user device, partially on a user device, as a standalone software package, partially on a user device and partially on a remote device, or entirely on a remote device.
[0237] Example 7
[0238] Regarding the modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. For example, for various devices and products applied to or integrated into a chip, all of their modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits; for various devices and products applied to or integrated into a chip module, all of their modules / units can be implemented using hardware methods such as circuits, and different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The components can be implemented using software programs that run on the processor integrated within the chip module. The remaining (if any) modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into the terminal, each of its components / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or in different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated within the terminal, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits.
[0239] While specific embodiments of this disclosure have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of this disclosure is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of this disclosure, but all such changes and modifications fall within the scope of protection of this disclosure.
Claims
1. A method for obtaining offset parameters of a vertical synchronization module, characterized in that, The acquisition method is applied to display systems. Identify whether the current first display scene in the display system has changed; In response to a change in the first display scene, the generation time of the layer in the changed second display scene is obtained; The offset parameters for the vertical synchronization module are calculated based on the generation duration. The offset parameter is used to characterize the difference between the screen refresh rate of the first display scene and the refresh signal of the layer in the second display scene; The offset parameters include a first offset on the application side and a second offset on the display synthesis side. The step of calculating the offset parameters for the vertical synchronization module based on the generation duration includes: Obtain the target generation time of the layer in the second display scene; The first offset and the second offset are calculated based on the target generation time. The first offset includes the first imaging cycle duration or the first working duration on the application side, and the second offset includes the second imaging cycle duration or the second working duration on the display synthesis side. The step of obtaining the target generation time of the layer in the second display scene includes: Iterate through the voting rights of the layers and select the target layer with the highest voting rights; The voting right represents the priority of the layer; The generation time corresponding to the target layer is used as the target generation time of the layer in the second display scene.
2. The method for obtaining the offset parameters of the vertical synchronization module according to claim 1, characterized in that, The step of identifying whether the current first display scene in the display system has changed includes: Obtain the layer display information corresponding to the layers that are continuously displayed in the first display scene in the display system; The layer display information includes at least one of the following: refresh rate, number of layers in the list, internal layer information, layer composition method, and layer on-screen time deviation. In response to differences in the display information of adjacent layers, it is recognized that the first display scene has changed.
3. The method for obtaining the offset parameters of the vertical synchronization module according to claim 1, characterized in that, The step of using the generation time corresponding to the target layer as the target generation time of the layer in the second display scene includes: Obtain the sample generation time corresponding to the target layer in several frames; The target generation time is calculated based on the sample generation time.
4. The method for obtaining the offset parameters of the vertical synchronization module according to claim 3, characterized in that, The step of calculating the target generation time based on the sample generation time includes: Obtain several layers in the second display scene and use them as sample layers, and use the generation time of the sample layers as the sample generation time; The first duration deviation between the generation times of any two of the samples is calculated; If the first duration deviation is greater than a first preset deviation threshold, then the maximum value of the sample generation duration is selected as the target generation duration; In response to the first duration deviation being less than a first preset deviation threshold, the average of the generation durations of several samples is calculated and used as the target generation duration.
5. The method for obtaining the offset parameters of the vertical synchronization module according to claim 1, characterized in that, The offset parameter also includes the layer's composition priority mode, and the step of calculating the offset parameter for the vertical synchronization module based on the generation duration includes: Obtain the buffer wait time of the rendering thread in the second display scene; If the first ratio of the buffer waiting time to the target generation time meets the requirement of the first preset ratio, then the compositing priority mode of the second display scene is display compositing priority; Otherwise, the composition priority mode for the second display scene is application priority.
6. An offset control method for a vertical synchronization module, characterized in that, The vertical synchronization module includes a vertical synchronization model, and the offset control method includes: Obtain the offset parameters of the vertical synchronization model; The offset parameter is obtained based on the method for obtaining the offset parameter of the vertical synchronization module according to any one of claims 1-5; In response to the update of the offset parameter, the rendering duration of the updated display scene is obtained; Based on the rendering duration, the interval before the next display of the compositing side is calculated; If the second ratio of the interval duration to the vertical synchronization duration of the updated display scene is less than the second preset ratio, then the updated offset parameter is input to the vertical synchronization model for offsetting.
7. The offset control method for the vertical synchronization module according to claim 6, characterized in that, The offset control method further includes: If the second ratio of the interval duration to the vertical synchronization duration of the updated display scene is greater than the second preset ratio, then a preset static offset parameter is input to the vertical synchronization model for offset control.
8. The offset control method for the vertical synchronization module according to claim 6, characterized in that, The offset control method further includes: Get the display information of the first layer in the display scene before the update, and the display information of the second layer in the display scene after the update; If the information displayed in the first layer is better than that displayed in the second layer, then a preset static offset parameter is input to the vertical synchronization model for offset control.
9. The offset control method for the vertical synchronization module according to claim 6, characterized in that, The offset control method further includes: Obtain the layer generation duration corresponding to the continuous generation of several layers in the updated display scene within a preset time. Calculate the second duration deviation between the generation times of adjacent layers; If the second duration deviation is greater than the second preset deviation threshold, then a preset static offset parameter is input to the vertical synchronization model for offset control.
10. The offset control method for the vertical synchronization module according to any one of claims 6-9, characterized in that, The offset control method further includes: Associate the updated offset parameter with the updated display scene; In response to the updated target display scene, the target offset parameter that matches the target display scene is invoked.
11. A system for obtaining offset parameters of a vertical synchronization module, characterized in that, Applied to a display system, the acquisition system includes a scene recognition module, a duration statistics module, and a calculation module; The scene recognition module is used to identify whether the current first display scene in the display system has changed; The duration statistics module is used to obtain the generation duration of the layer in the changed second display scene in response to a change in the first display scene; The calculation module is used to calculate the offset parameters for the vertical synchronization module based on the generation duration; The offset parameter is used to characterize the difference between the screen refresh rate of the first display scene and the refresh signal of the layer in the second display scene; The offset parameters include a first offset on the application side and a second offset on the display composition side; the calculation module includes a layer acquisition unit and an offset calculation unit; The layer acquisition unit is used to acquire the target generation time of the layer in the second display scene; The offset calculation unit is used to calculate the first offset and the second offset based on the target generation time; the first offset includes the first imaging cycle time or the first working duration on the application side, and the second offset includes the second imaging cycle time or the second working duration on the display synthesis side. The layer acquisition unit is further configured to traverse the voting rights of the layers and select the target layer with the highest voting rights; wherein the voting rights represent the priority of the layer; and the generation time corresponding to the target layer is used as the target generation time of the layer in the second display scene.
12. An offset control system for a vertical synchronization module, characterized in that, The offset control system includes a parameter acquisition module, a duration acquisition module, a time calculation module, and an offset control module; The parameter acquisition module is used to acquire the offset parameters of the vertical synchronization model; wherein, the offset parameters are obtained based on the vertical synchronization module offset parameter acquisition system of claim 11; The duration acquisition module is used to acquire the updated rendering duration of the display scene in response to the update of the offset parameter. The time calculation module is used to calculate the interval between the next display and composition side working time based on the rendering duration. The offset control module is configured to input the updated offset parameters into the vertical synchronization model for offsetting if the ratio of the interval duration to the vertical synchronization duration of the updated display scene is less than a preset ratio.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and for running on the processor, characterized in that, When the processor executes the computer program, it implements the method for obtaining the offset parameters of the vertical synchronization module as described in any one of claims 1-5, or implements the offset control method of the vertical synchronization module as described in any one of claims 6-10.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the method for obtaining the offset parameters of the vertical synchronization module as described in any one of claims 1-5, or implements the offset control method of the vertical synchronization module as described in any one of claims 6-10.
15. A chip, characterized in that, The chip stores a computer program, which, when executed by the chip, implements the method for obtaining the offset parameters of the vertical synchronization module as described in any one of claims 1-5, or implements the offset control method of the vertical synchronization module as described in any one of claims 6-10.
16. A chip module, used in electronic devices, characterized in that, It includes a transceiver component and a chip, wherein the chip is used to execute the method for obtaining the offset parameters of the vertical synchronization module as described in any one of claims 1-5, or to implement the offset control method of the vertical synchronization module as described in any one of claims 6-10.