Search

CN-121029111-B - Display method and related equipment

CN121029111BCN 121029111 BCN121029111 BCN 121029111BCN-121029111-B

Abstract

The application provides a display method and related equipment, and relates to the technical field of equipment display. The display method comprises the steps of drawing and rendering image content of a first image frame to be displayed, determining an offset parameter for enabling image frame synthesis, determining the first target image frame based on the offset parameter and the first image frame, updating the offset parameter when the fact that a fence displayed by the first target image frame is not released is detected, determining a second target image frame based on the updated offset parameter and the first image frame, synthesizing the image content of the first image frame to obtain the first image frame when the fact that the fence displayed by the second target image frame is released is detected, and sending and displaying the first image frame. By using the method, the frame loss probability of the electronic equipment can be reduced, and the equipment use experience of the user is improved.

Inventors

  • Yang Zudi

Assignees

  • 荣耀终端股份有限公司

Dates

Publication Date
20260512
Application Date
20240520

Claims (11)

  1. 1. A display method, the method comprising: drawing and rendering the image content of the first image frame to be displayed; determining an offset parameter for enabling image frame synthesis based on a working time length of the display synthesis service SurfaceFlinger and a period of the vertical synchronization signal, and determining a first target image frame based on the offset parameter and the first image frame; Updating the offset parameter based on a barrier release of other image frames, which are image frames before the first target image frame, and determining a second target image frame based on the updated offset parameter and the first image frame, which is displayed before the first target image frame, in case that it is detected that the barrier of the display of the first target image frame is not released; synthesizing the image content of the first image frame to obtain the first image frame under the condition that the barrier displayed by the second target image frame is released; and transmitting and displaying the first image frame.
  2. 2. The display method according to claim 1, wherein the updating the offset parameter based on the barrier release of the other image frames in the case where it is detected that the barrier of the display of the first target image frame is not released, comprises: And under the condition that SurfaceFlinger detects that the displayed fence of the first target image frame is not released within the preset time, updating the offset parameter based on the fence release of the other image frames, wherein the preset time is smaller than the working time length of SurfaceFlinger.
  3. 3. The display method according to claim 1, wherein the synthesizing the image content of the first image frame in a case where it is detected that the barrier of the display of the second target image frame is released includes: And the SurfaceFlinger calls a hardware hybrid renderer or a graphic processor to synthesize the image content of the first image frame under the condition that the barrier of the display of the second target image frame is detected to be released.
  4. 4. The display method of claim 1, wherein the method further comprises: In the event that it is detected that the barrier of the display of the second target image frame is not released, the image content of the first image frame is discarded.
  5. 5. The display method according to claim 1, wherein the first image frame to be displayed is an interface of an application program, and the updating the offset parameter based on the barrier release of the other image frames in a case where it is detected that the barrier of the display of the first target image frame is not released includes: and updating the offset parameter based on the barrier release of the other image frames under the condition that the application program is a preset first application program and the barrier of the display of the first target image frame is detected not to be released.
  6. 6. The display method of claim 5, wherein the method further comprises: And under the condition that the application program is a preset second application program and the barrier of the display of the first target image frame is detected not to be released, discarding the synthesis of the image content of the first image frame.
  7. 7. The display method of claim 6, wherein the first preset application is an application in an application whitelist and the second preset application is an application not in the application whitelist.
  8. 8. The display method according to any one of claims 1 to 7, wherein in the case where it is detected that the barrier of the display of the first target image frame is not released, updating the offset parameter based on the barrier release of the other image frames includes: And updating offset parameters for enabling the synthesis of the first image frame to be displayed and N image frames after the first image frame to be displayed based on the barrier release of the other image frames under the condition that the barrier of the display of the first target image frame is not released, wherein the first image frame and the N image frames after the first image frame belong to the same continuous frame brushing event.
  9. 9. The display method according to any one of claims 1 to 7, wherein the updating the offset parameter includes adding one to the offset parameter.
  10. 10. An electronic device comprising a display screen, a memory, and a processor; The display screen, the memory and the processor are coupled; the memory is used for storing program instructions; The processor is configured to read the program instructions stored in the memory to implement the display method according to any one of claims 1 to 9.
  11. 11. A computer readable storage medium having stored therein computer readable instructions which when executed by a processor implement the display method of any one of claims 1 to 9.

Description

Display method and related equipment Technical Field The embodiment of the application relates to the technical field of equipment display, in particular to a display method and related equipment. Background The Fence (Fence) mechanism is a resource lock mechanism in the operating system, and is also present in the graphics rendering process. For example, assuming that the screen refresh rate is 60hz, surfeflinger detects whether the displayed Fence of the previous image frame is released when synthesizing the image data of the current image frame, if the displayed Fence of the previous image frame is released, surfaceFlinger synthesizes the image data of the current image frame, and if the displayed Fence of the previous image frame is not released, surfaceFlinger gives up synthesizing the image data of the current image frame and waits for the next vertical synchronization signal to wake up. Under the conditions of insufficient scheduling capability, abnormal threads and the like of an operating system, release abnormality can be caused in the Fence of the display of the image frames, and frequent frame loss phenomenon can be caused in the electronic equipment. Disclosure of Invention In view of the foregoing, it is necessary to provide a display method and related device, which can solve the problem that when the release abnormality occurs in the Fence of the display of the image frame, the electronic device frequently loses the frame. In a first aspect, the present application provides a display method, including rendering image content of a first image frame to be displayed, determining an offset parameter for enabling image frame synthesis, determining the first target image frame based on the offset parameter and the first image frame, updating the offset parameter when a barrier (Fence) for displaying the first target image frame is detected to be unreleased, determining a second target image frame based on the updated offset parameter and the first image frame, synthesizing the image content of the first image frame to obtain the first image frame when the Fence for displaying the second target image frame is detected to be unreleased, and transmitting and displaying the first image frame. By adopting the technical scheme, when the fact that the Fence used for enabling the first image frame to be synthesized (the displayed Fence of the first target image frame) is not released is detected, the offset parameter is updated, for example, the offset parameter is updated through a display synthesis service (SurfaceFlinger), so that the Fence used for enabling the first image frame to be synthesized is changed from the displayed Fence of the first target image frame to the displayed Fence of the second target image frame, because the second target image frame is displayed before the first target image frame, that is, the displayed Fence of the second target image frame can be released earlier than the displayed Fence of the first target image frame, the image content of the first image frame is synthesized under the condition that the displayed Fence of the first target image frame is not released, compared with the related technology, when the displayed Fence of the first target image frame is not released, the frame is required to wait for a next-sf signal to be displayed Fence of the second target image frame, the frequency of the image frame is prolonged, the frequency of the image frame is not synthesized, for example, the frequency of the image frame is prolonged, the image frame is not synthesized, the image frame is more difficult to be synthesized, the CPU is more difficult to process, and the working time is more difficult, and the working time is reduced, and the working time of a fault-tolerant system is more easily, and the working time is more difficult, and the working time is more well and more likely because the CPU is more is compared. In one possible implementation, determining the offset parameter for enabling image frame synthesis includes determining the offset parameter for enabling image frame synthesis based on the period of the vertical synchronization signal and the on-time period of SurfaceFlinger. By adopting the technical scheme, the offset parameter for enabling the image frame synthesis can be determined based on the working time length of SurfaceFlinger and the period of the vertical synchronization signal, for example, the value of the offset parameter is the integral of the working time length of SurfaceFlinger divided by the period of the vertical synchronization signal. In one possible implementation, updating the offset parameter in the event that the displayed rail of the first target image frame is detected not to be released includes SurfaceFlinger updating the offset parameter in the event that the displayed rail of the first target image frame is detected not to be released within a preset time, the preset time being less than an operating duration of SurfaceFli