A three-dimensional scene display method and system

By constructing a circular memory queue and using separate control for write and read pointers, combined with Vulkan extensions, parallel copy-free interaction between rendering and display is achieved, solving the problems of latency accumulation and memory overhead in VR 3D display systems, and improving smoothness and resource utilization efficiency.

CN122391449APending Publication Date: 2026-07-14NANCHANG VIRTUAL REALITY RES INST CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANCHANG VIRTUAL REALITY RES INST CO LTD
Filing Date
2026-06-12
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing VR 3D display systems suffer from latency accumulation due to multi-level buffering and high memory bandwidth and capacity overhead, making it difficult to meet real-time rendering requirements.

Method used

By allocating direct memory access buffers to construct a physically contiguous circular video memory queue, using separate control for write pointers and read pointers, and combining Vulkan extensions to achieve direct association between the rendering target and image resources, and displaying through handle mapping, parallel copy-free interaction between rendering and display is achieved.

Benefits of technology

It effectively reduces video memory access latency, improves the smoothness of 3D scene display and resource utilization efficiency, eliminates VSync waiting and buffer swapping latency, and achieves efficient rendering and display collaboration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391449A_ABST
    Figure CN122391449A_ABST
Patent Text Reader

Abstract

The application provides a three-dimensional scene display method and system, a physically continuous ring-shaped display memory queue is constructed by allocating a direct memory access buffer, and a slot is used as a rendering target and a display source. Based on the separation control of the write pointer and the read pointer, the rendering target is associated with the image resource by using the Vulkan extension to realize scene rendering; when displaying, a page table mapping is created by handle mapping, image data is directly obtained from the physical memory and submitted to the panel to complete the scan output. The method realizes parallel and copy-free interaction of rendering and display. The application effectively reduces the display memory access delay, and improves the fluency and resource utilization efficiency of three-dimensional scene display.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of virtual reality 3D display technology, specifically to a 3D scene display method and system. Background Technology

[0002] In existing virtual reality (VR) 3D display systems, the core of mainstream VR graphics rendering architectures (such as Vulkan / OpenGL ES) is the strong binding of multi-buffered exchange chains and vertical synchronization (VSync) signals.

[0003] Multi-buffering mechanisms typically employ double or triple buffering. By alternately exchanging data between the front buffer and the back buffer, the GPU writes a complete frame to the front buffer (A) for display while the application renders the next frame in the back buffer (B or C), achieving frame-by-frame image updates to avoid display tearing. On Linux platforms, the GPU handles 3D graphics rendering, while the CPU handles scene calculations and pose synchronization. The rendering result is output to the display panel by the display engine after buffer swapping. Buffer swapping (page-flip) operations are strictly limited to occur when the VSync signal is generated. This ensures display integrity and avoids tearing. Furthermore, current technology solutions are primarily designed based on Android systems and Qualcomm chips, and all mainstream VR devices on the market are built upon this approach. This architecture ensures image integrity and avoids screen drift and dizziness.

[0004] Multi-level buffering leads to accumulated latency, creating a significant latency bottleneck in VR scenarios. Since head-mounted displays need to complete the closed-loop feedback of "user motion perception → 3D scene rendering → image display" within 20ms, any frame swapping, VSync waiting, or image copying operations introduce additional latency, resulting in lag in interaction. Due to limited video memory bandwidth and DMA (Direct Memory Access) bandwidth, as well as insufficient optimization of the display driver and compositor layer, the latency of traditional dual-buffered architectures under Linux systems can typically reach 40-60ms, making it difficult to meet the real-time rendering requirements of VR.

[0005] Secondly, multiple buffers consume more video memory and bandwidth. Furthermore, switching between buffers (even pointer swapping) involves memory management overhead, which is particularly significant on embedded platforms such as the RK3588. This creates additional overhead for platforms with limited memory resources. Summary of the Invention

[0006] To address these issues, embodiments of the present invention provide a three-dimensional scene display method and system to solve the technical problems in existing VR three-dimensional display systems, such as latency accumulation caused by multi-level buffer switching and large memory bandwidth and capacity overhead caused by multiple buffers.

[0007] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0008] According to a first aspect of the present invention, this application provides a method for displaying a three-dimensional scene, the method comprising:

[0009] Allocate a preset number of direct memory access buffers and return a corresponding handle for each buffer;

[0010] Each buffer is used as a physical slot to create a physically contiguous circular memory queue, which is directly accessible to the application side and the display compositor.

[0011] The metadata of each slot in the circular video memory queue is initialized, and the metadata includes write pointers and read pointers;

[0012] A 3D application is constructed by using each buffer as a rendering target.

[0013] The first target slot is selected as the rendering target from the circular video memory queue based on the write pointer;

[0014] External memory expansion is performed using Vulkan (VK_KHR_external_memory), importing the DMA-BUF buffer memory corresponding to the first target slot as a Vulkan image resource, and establishing a pass-through association between the rendering target and the physical video memory.

[0015] The second target slot is selected from the circular video memory queue as the display source based on the read pointer;

[0016] Perform a scan on the current display source and display the output, including:

[0017] Obtain the handle corresponding to the second target slot;

[0018] Map the corresponding handle, map the physical memory address of the rendered image data in the corresponding buffer to a virtual address in user space, and create a page table mapping that points to the physical memory page used during scene rendering;

[0019] Based on the page table mapping, the image data to be displayed is obtained from the physical memory page and submitted to the display panel for display.

[0020] Furthermore, the metadata also includes status flags and a timestamp indicating when the frame rendering is complete. The status flags are either a first flag, a second flag, a third flag, or a fourth flag. The first flag is FREE, indicating that the corresponding slot is in an idle state. The second flag is RENDERING, indicating that the corresponding slot is in a rendering state. The third flag is READY, indicating that the corresponding slot is in a rendering complete and ready-to-display state. The fourth flag is DISPLAYING, indicating that the corresponding slot is in a scanning and output state.

[0021] Furthermore, when initializing the metadata of each slot in the circular memory queue, the write pointer, the read pointer, and the timestamp are initialized to 0, and the status flag is initialized to the first identifier.

[0022] Furthermore, the method also includes: synchronously controlling scene rendering based on the written pointer to select a rendering target and performing scan output and display based on the read pointer to select a display source, including:

[0023] Each time a new frame is ready to be rendered, check whether the status flag of the first target slot pointed to by the current write pointer meets the first condition. The first condition is that the status flag of the first target slot pointed to by the current write pointer is the first identifier or the fourth identifier.

[0024] If the status flag of the first target slot pointed to by the current write pointer meets the first condition, then the current first target slot is immediately occupied, and the status flag of the first target slot pointed to by the current write pointer is set to the second flag;

[0025] The Vulkan extension associates the current first target slot with a Vulkan image resource as the rendering target for scene rendering.

[0026] After rendering is complete, update the timestamp using the current time and set the status flag of the first target slot pointed to by the current write pointer to the third flag;

[0027] Update the current write pointer to point to the next slot in the circular memory queue;

[0028] If the status flag of the first target slot pointed to by the current write pointer does not meet the first condition, the current frame is actively discarded, and the current write pointer is updated to point to the next slot in the circular memory queue.

[0029] Furthermore, the method also includes: synchronously controlling scene rendering based on the written pointer to select a rendering target and performing scan output and display based on the read pointer to select a display source, including:

[0030] Each time a new frame is ready to be rendered, it is determined whether the first target slot pointed to by the current write pointer has caught up with the second target slot pointed to by the current read pointer;

[0031] If the first target slot pointed to by the current write pointer has not caught up with the second target slot pointed to by the current read pointer, then check whether the status flag of the first target slot pointed to by the current write pointer meets the first condition. The first condition is that the status flag of the first target slot pointed to by the current write pointer is the first identifier or the fourth identifier.

[0032] If the status flag of the first target slot pointed to by the current write pointer meets the first condition, then the current first target slot is immediately occupied, and the status flag of the first target slot pointed to by the current write pointer is set to the second flag;

[0033] The Vulkan extension associates the current first target slot with a Vulkan image resource as the rendering target for scene rendering.

[0034] After rendering is complete, update the timestamp using the current time and set the status flag of the first target slot pointed to by the current write pointer to the third flag;

[0035] Update the current write pointer to point to the next slot in the circular memory queue;

[0036] If the status flag of the first target slot pointed to by the current write pointer does not meet the first condition, the current frame is actively discarded, and the current write pointer is updated to point to the next slot in the circular memory queue.

[0037] Furthermore, the synchronous control of scene rendering based on the written pointer and the scanning output and display based on the read pointer, using the status flags, also includes:

[0038] If the first target slot pointed to by the current write pointer catches up with the second target slot pointed to by the current read pointer, then check whether the status flag of the current first target slot or the current second target slot meets the second condition. The second condition is that the status flag of the current first target slot or the current second target slot is the first identifier.

[0039] If the status flag of the current first target slot or the current second target slot meets the second condition, then the current first target slot is immediately occupied, and the status flag of the first target slot pointed to by the current write pointer is set to the second flag.

[0040] The Vulkan extension associates the current first target slot with a Vulkan image resource as the rendering target for scene rendering.

[0041] After rendering is complete, update the timestamp using the current time and set the status flag of the first target slot pointed to by the current write pointer to the third flag;

[0042] Update the current write pointer to point to the next slot in the circular memory queue;

[0043] If the status flag of the current first target slot or the current second target slot does not meet the second condition, then query whether the status flag of the current first target slot or the current second target slot meets the third condition, wherein the third condition is that the status flag of the current first target slot / second target slot is the fourth identifier;

[0044] If the status flag of the current first target slot or the current second target slot meets the third condition, then the current first target slot is immediately occupied, and the status flag of the first target slot pointed to by the current write pointer is set to the second flag.

[0045] By using the Vulkan extension, the current first target slot is used as the rendering target and associated with the Vulkan image resource for scene rendering, directly overwriting the frame content corresponding to the current first target slot.

[0046] After rendering is complete, update the timestamp using the current time and set the status flag of the first target slot pointed to by the current write pointer to the third flag;

[0047] Update the current write pointer to point to the next slot in the circular memory queue;

[0048] If the status flag of the current first target slot or the current second target slot does not meet the third condition, the current frame is actively discarded, and the current write pointer is updated to point to the next slot in the circular memory queue.

[0049] Further, updating the current write pointer to point to the next slot in the circular memory queue includes:

[0050] The write pointer update value pointing to the next slot in the circular memory queue is calculated using the first algorithm formula: write_index΄=(write_index+1) mod N; where write_index΄ is the write pointer update value, write_index is the current value of the write pointer, N is the total number of slots in the circular memory queue, and mod represents the modulo operation.

[0051] Furthermore, the synchronous control of scene rendering based on the written pointer and the scanning output and display based on the read pointer, using the status flags, includes:

[0052] When the display driver's page flip complete event is detected or the immediate commit mode is adopted, the display compositor needs to commit a new frame.

[0053] Check whether the status flag of the second target slot pointed to by the current read pointer meets the fourth condition, wherein the status flag of the second target slot pointed to by the current write pointer is the third identifier;

[0054] If the status flag of the second target slot pointed to by the current read pointer satisfies the fourth condition, then perform a scan output on the current second target slot and set the status flag of the second target slot pointed to by the current read pointer to the fourth flag;

[0055] After the scan output is completed for the current second target slot, the status flag of the second target slot pointed to by the current read pointer is set to the first identifier, and the current read pointer is updated to point to the next slot in the circular memory queue;

[0056] If the status flag of the second target slot pointed to by the current read pointer does not meet the fourth condition, then the current read pointer is directly updated to point to the next slot in the circular memory queue.

[0057] Further, updating the current read pointer to point to the next slot in the circular memory queue includes:

[0058] The update value of the read pointer pointing to the next slot in the circular memory queue is calculated using the second algorithm formula: display_index΄=(display_index+1) mod N; where display_index΄ is the update value of the read pointer, display_index is the current value of the read pointer, N is the total number of slots in the circular memory queue, and mod represents the modulo operation.

[0059] According to a second aspect of the present invention, this application provides a three-dimensional scene display system, the system comprising:

[0060] The display driver is used to allocate a preset number of direct memory access buffers and return a corresponding handle for each buffer; it creates a physically contiguous circular video memory queue with each buffer as a physical slot, for direct access by the application side and the display compositor.

[0061] A state machine manager is used to initialize the metadata of each slot in the circular video memory queue, including write pointers and read pointers;

[0062] On the application side, each buffer is used as a rendering target to construct a 3D application;

[0063] The application side selects the first target slot from the circular video memory queue as the rendering target based on the write pointer; the current rendering target is associated with Vulkan image resources through Vulkan extensions to perform scene rendering;

[0064] The display synthesizer is used to select a second target slot from the circular video memory queue as a display source based on a read pointer; and to perform a scan output and display on the current display source, including:

[0065] Obtain the handle corresponding to the second target slot;

[0066] Map the corresponding handle, map the physical memory address of the rendered image data in the corresponding buffer to a virtual address in user space, and create a page table mapping that points to the physical memory page used during scene rendering;

[0067] Based on the page table mapping, the image data to be displayed is obtained from the physical memory page and submitted to the display panel for display.

[0068] Compared with existing technologies, the 3D scene display method and system provided in this application construct a physically contiguous circular video memory queue by allocating a direct memory access buffer, with slots serving as both rendering targets and display sources. Based on separate control of write and read pointers, the Vulkan extension is used to associate rendering targets with image resources to achieve scene rendering. During display, a page table mapping is created through handle mapping, directly retrieving image data from physical memory and submitting it to the panel to complete the scan output. This application embodiment achieves parallel, copy-free interaction between rendering and display, effectively reducing video memory access latency and improving the smoothness and resource utilization efficiency of 3D scene display. Attached Figure Description

[0069] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.

[0070] The structures, proportions, sizes, etc. illustrated in this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed herein, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.

[0071] Figure 1A schematic diagram of the logical structure of a three-dimensional scene display system provided in this application embodiment;

[0072] Figure 2 A flowchart illustrating a three-dimensional scene display method provided in this application embodiment;

[0073] Figure 3 This is a flowchart illustrating the scanning, output, and display of the current display source in a three-dimensional scene display method provided in this application embodiment;

[0074] Figure 4 A flowchart illustrating scene rendering and scanning output display using state flag synchronization control, as provided in one embodiment of this application;

[0075] Figure 5 A flowchart illustrating scene rendering and scanning output display using state flag synchronization control, provided in another embodiment of this application;

[0076] Figure 6 A flowchart illustrating scene rendering and scanning output display using state flag synchronization control, as provided in yet another embodiment of this application;

[0077] Figure 7 This is a flowchart illustrating scene rendering and scanning output display using state flag synchronization control, provided in another embodiment of this application. Detailed Implementation

[0078] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0079] To solve the above technical problems, such as Figure 1 As shown in the figure, this application provides a three-dimensional scene display system, which is applied to virtual reality (VR) three-dimensional display.

[0080] This application embodiment is based on the Mali610 GPU, RK3588 and OpenEuler operating system to implement key technical support, providing key underlying support for the subsequent development of the VR industry.

[0081] Specifically, the three-dimensional scene display system provided in this application embodiment includes: a display driver 01, a circular video memory queue 03, an application side 04, a display synthesizer 05, and a state machine manager 06.

[0082] Furthermore, the display driver 01 allocates a preset number of direct memory access buffers 02 and returns a corresponding handle for each buffer 02; using each buffer 02 as a physical slot, a physically contiguous circular video memory queue 03 is created for direct access by the application side 04 and the display compositor 05. (Reference) Figure 1 Taking a preset quantity of 4 as an example, the display driver 01 allocates 4 direct memory access buffers 02, with each buffer 02 serving as a physical slot. Thus, the created circular video memory queue 03 has four physical slots, which are labeled as slot 0, slot 1, slot 2, and slot 3, respectively.

[0083] The state machine manager 06 is used to initialize the metadata of each slot in the circular video memory queue 03. The metadata includes write pointers and read pointers.

[0084] In this embodiment, the application side 04 constructs a 3D application using each buffer 02 as a rendering target. The application side 04 selects the first target slot from the circular video memory queue 03 as the rendering target based on the write pointer; and associates the current rendering target with Vulkan image resources through Vulkan extensions to perform scene rendering.

[0085] The display compositor 05 is used to select a second target slot as a display source from the circular video memory queue 03 based on the read pointer; and to perform a scan output and display on the current display source. The steps include: obtaining the handle corresponding to the second target slot; mapping the corresponding handle, mapping the physical memory address of the rendered image data in the corresponding buffer to a virtual address in user space, and creating a page table mapping pointing to the physical memory page used during scene rendering; obtaining the image data to be displayed from the physical memory page based on the page table mapping, and submitting it to the display panel 07 for display.

[0086] Compared with existing technologies, the 3D scene display system provided in this application constructs a physically contiguous circular video memory queue by allocating a direct memory access buffer, with slots serving as both rendering targets and display sources. Based on separate control of write and read pointers, the Vulkan extension is used to associate rendering targets with image resources, achieving scene rendering. During display, a page table mapping is created through handle mapping, directly retrieving image data from physical memory and submitting it to the panel to complete the scan output. This application embodiment achieves parallel, copy-free interaction between rendering and display, effectively reducing video memory access latency and improving the smoothness and resource utilization efficiency of 3D scene display.

[0087] Corresponding to the three-dimensional scene display disclosed above, this invention also discloses a three-dimensional scene display method. The following details a three-dimensional scene display method disclosed in this invention, in conjunction with the three-dimensional scene display system described above, to solve the technical problems of latency accumulation caused by multi-level buffer switching and large memory bandwidth and capacity overhead caused by multiple buffers in existing VR three-dimensional display systems.

[0088] like Figure 2 As shown below, the specific steps of a three-dimensional scene display method provided in the embodiments of this application will be described in detail.

[0089] The display driver 01 allocates a preset number of direct memory access buffers 02 and returns a corresponding handle for each buffer.

[0090] Direct Memory Access Buffer (DMA-BUF) is a shared mechanism and framework in the Linux kernel used to implement and manage memory buffers that can be directly accessed via DMA operations. A handle is an integer value or pointer allocated by the operating system or driver layer to uniquely identify a resource; applications access and manage underlying resources indirectly through handles.

[0091] The display driver 01 creates a physically contiguous circular video memory queue 03, with each buffer 02 as a physical slot, for direct access by the application side 04 and the display synthesizer 05.

[0092] In this embodiment, the display driver requests a preset number of contiguous physical memory blocks from the physical memory manager by calling the DMA-BUF framework interface of the operating system kernel. Each memory block serves as a direct memory access buffer. The system generates a unique handle for each successfully allocated buffer, which is an identifier used to reference the buffer in subsequent operations. The system returns the handle to the caller so that the application and the display compositor can subsequently locate and operate on the corresponding buffer using the handle.

[0093] A physical slot refers to a logical unit in a circular memory queue. Each slot corresponds to a DMA-BUF buffer, used to hold the rendering and display data of a single frame of image. A circular memory queue is a queue data structure with its head and tail connected. It uses modulo operations to achieve indexing and is used to manage the rotation of multiple buffers between rendering and display.

[0094] In this embodiment, the display driver treats each allocated direct memory access buffer as a physical slot and organizes these slots into a ring structure according to a preset order. Specifically, the system maintains a fixed-size array in the video memory. Each element in the array stores the handle of the corresponding slot and the physical address information of the buffer. A ring access logic with the beginning and end connected is implemented using modulo operations, thus forming a physically contiguous ring-shaped video memory queue. This queue allows the application side and the display compositor to bypass the traditional data copy path and directly access the corresponding slot memory through the handle.

[0095] The state machine manager 06 initializes the metadata of each slot in the circular video memory queue 03.

[0096] Furthermore, metadata refers to a set of information describing the state of each slot, used to synchronously control the rendering and display process. Metadata includes write pointers, read pointers, status flags, and timestamps. The write pointer points to the index of the next available rendering slot in the circular queue and moves to the next slot after each rendering is completed. The read pointer points to the index of the next slot to be displayed in the circular queue and moves to the next slot after each display is completed. The timestamp is used to record the time when frame rendering is completed.

[0097] Additionally, the status flags are either the first, second, third, or fourth flag; the first flag is FREE, indicating that the corresponding slot is in an idle state; the second flag is RENDERING, indicating that the corresponding slot is in a rendering state; the third flag is READY, indicating that the corresponding slot is in a rendering completed and ready-to-display state; and the fourth flag is DISPLAYING, indicating that the corresponding slot is in a scanning and output state.

[0098] This application's embodiments achieve fine-grained management of the lifecycle of each slot in the circular video memory queue by introducing four mutually exclusive status flags (FREE, RENDERING, READY, DISPLAYING) into the metadata. This effectively avoids concurrent conflicts between rendering and display operations on the same slot, ensuring mutual exclusion and data consistency in resource access. Simultaneously, by recording the timestamp of frame rendering completion, a precise time base is provided for the synchronization control logic. This enables the system to accurately determine the completion order of each frame in critical scenarios such as the write pointer catching up with the read pointer, thereby making reasonable decisions to discard or overwrite frames, further improving the smoothness and stability of 3D scene display.

[0099] Furthermore, when initializing the metadata of each slot in the circular memory queue, the write pointer, read pointer, and timestamp are initialized to 0, and the status flag is initialized to the first identifier.

[0100] In this embodiment, the state machine manager initializes the metadata structure corresponding to each physical slot in the circular video memory queue during system startup or reset. Specifically, the state machine manager iterates through each slot in the circular video memory queue and independently sets the metadata fields for each slot: setting the write pointer to 0 indicates that the next rendering operation will start from slot 0 in the queue; setting the read pointer to 0 indicates that the next display operation will start from slot 0 in the queue; setting the timestamp to 0 indicates that no frame has been rendered yet; and setting the status flag to the first identifier, i.e., the FREE state, through enumeration assignment, indicating that the corresponding slot is currently idle, neither occupied by the application for rendering nor by the display compositor for scanning output. Thus, the metadata of all slots in the circular video memory queue is unified to a definite and consistent initial baseline state, establishing a clear state starting point for subsequent synchronous control of rendering and display.

[0101] Application 04 uses each buffer 02 as a rendering target to construct a 3D application; application 04 selects the first target slot from the circular video memory queue 03 as the rendering target based on the write pointer; and associates the current rendering target with Vulkan image resources through Vulkan extension to perform scene rendering.

[0102] In this embodiment, a 3D application is built using mainstream development tools such as Vulkan. Each direct memory access buffer within a circular memory queue is used as the rendering target. Simultaneously, external memory expansion (VK_KHR_external_memory) is performed via Vulkan, importing the buffer (DMA-BUF) memory corresponding to the first target slot as a Vulkan image resource, thus establishing a direct connection between the rendering target and physical memory. The feasibility of this approach has been verified on an RK3588+Mali-G610.

[0103] The display synthesizer 05 selects the second target slot from the circular video memory queue 03 as the display source based on the read pointer; the current display source is scanned and output, and then displayed.

[0104] refer to Figure 3 In this embodiment of the application, the above steps specifically include: obtaining the handle corresponding to the second target slot; mapping the corresponding handle, mapping the physical memory address of the rendered image data in the corresponding buffer 02 to a virtual address in user space, creating a page table mapping pointing to the physical memory page used during scene rendering; obtaining the image data to be displayed from the physical memory page based on the page table mapping, and submitting it to the display panel 07 for display.

[0105] In this embodiment, after determining the second target slot, the display compositor reads the handle of the direct memory access buffer corresponding to that slot from the metadata of the circular video memory queue. This handle is a unique identifier allocated and returned by the display driver, and the display compositor can uniquely determine the buffer resource to be displayed through this handle.

[0106] Furthermore, based on the established page table mapping relationship, the display compositor's GPU directly reads the image data to be displayed stored in the mapped physical memory pages through virtual addresses. In this embodiment, the corresponding frame virtual address is sent to the display compositor via DRM / KMS atomic commit. The display compositor then submits the read image data line by line to the frame buffer of the display panel through the display controller interface according to the timing requirements of the display panel, driving the panel to complete image refresh and achieve the final display output of the 3D scene.

[0107] This application's embodiments construct a physically contiguous circular video memory queue, separating rendering and display into independent parallel operation streams. Decoupling and synchronization are achieved using write and read pointers, and a direct association between the rendering target and the physical buffer is realized through Vulkan extensions. Furthermore, zero-copy access to rendered data by the display end is achieved through page table mapping. This scheme eliminates the memory bandwidth overhead caused by data copying between buffers in traditional swap-chain image processing, enabling true parallel execution of the rendering and display threads. Simultaneously, by explicitly managing metadata and buffer resources, deterministic resource isolation and access guarantees are provided for high real-time 3D applications, effectively improving system frame rate stability and overall response efficiency.

[0108] In this embodiment, the traditional approach of relying on multiple buffers and VSync for synchronization is abandoned. Instead, a circular video memory queue is constructed by allocating a direct memory access buffer, which is equivalent to a single shared buffer pool. It consists of multiple physical contiguous slots, which are used to achieve multi-frame cyclic storage while maintaining single-path zero-copy. Asynchronous display control based on read-write pointers is adopted, and scheduling is based on a strong real-time operating system kernel. This achieves efficient display of VR 3D scenes, completely eliminates VSync waiting and buffer exchange latency, realizes parallel copyless interaction between rendering and display, and effectively overcomes the bandwidth bottleneck of existing solutions.

[0109] To achieve efficient coordination between rendering and display in a single-buffered architecture while avoiding read / write conflicts and frame overwriting risks, this application proposes a lightweight circular frame buffer synchronization mechanism for low-latency VR scenarios. This mechanism is based on the core concept of a "single-buffered channel," with the buffer queue containing multiple physical slots forming a continuous circular queue structure. Each slot corresponds to an allocated video memory area, namely the aforementioned allocated Direct Memory Access Buffer (DMA-BUF), and is further managed using status flags and pointers, forming a producer-consumer model.

[0110] Specifically, in a three-dimensional scene display method disclosed in this application embodiment, the state machine manager 06 uses state flags to synchronously control scene rendering based on the written pointer to select the rendering target and to perform scanning output and display based on the read pointer to select the display source.

[0111] The following provides a detailed explanation of the above steps. Please refer to the provided text. Figure 4 In one embodiment of this application, each time a new frame is ready to be rendered, the status flag of the first target slot pointed to by the current write pointer is queried to see if it meets a first condition. The first condition is that the status flag of the first target slot pointed to by the current write pointer is a first identifier or a fourth identifier.

[0112] In this embodiment, when preparing to render a new frame, the state machine manager first obtains the value of the current write pointer, locates the corresponding physical slot from the circular memory queue based on this value, and marks the slot as the first target slot. Subsequently, it reads the status flag field from the metadata of the first target slot and compares the value of the status flag with a preset first condition. The first condition is defined as: the status flag is a first identifier or the status flag is a fourth identifier. Here, FREE indicates that the slot is in an idle state and is not occupied by any party; DISPLAYING indicates that the corresponding slot is in a scanning output state, that is, the slot is currently being scanned and output by the display compositor, but is about to be released. By querying this status flag, the system determines whether the current first target slot meets the conditions for immediate occupation.

[0113] If the status flag of the first target slot pointed to by the current write pointer meets the first condition, then the current first target slot is immediately occupied, and the status flag of the first target slot pointed to by the current write pointer is set to the second flag.

[0114] In this embodiment, the query result shows that the status flag of the first target slot is FREE or DISPLAYING. That is, when the first condition is met, the state machine manager determines that the slot can be occupied by the application. The state machine manager then performs a slot occupation operation, updating the status flag field of the first target slot from its current value to a second flag. The second flag indicates that the slot is currently in a rendering state and is occupied by the application as a rendering target. By updating the status flag, the system ensures that the display compositor will not read or access the slot during its rendering, thus achieving resource mutual exclusion protection.

[0115] The Vulkan extension associates the current first target slot with a Vulkan image resource for scene rendering.

[0116] Similarly, in this embodiment, external memory expansion (VK_KHR_external_memory) is performed using Vulkan, and the buffer (DMA-BUF) memory corresponding to the first target slot is imported as Vulkan image resources to establish a direct association between the rendering target and the physical video memory.

[0117] After rendering is complete, update the timestamp using the current time and set the status flag of the first target slot pointed to by the current write pointer to the third flag.

[0118] In this embodiment, after the application completes the scene rendering operation for the first target slot, it obtains the current system time by calling a high-precision clock function and writes this time value as a timestamp into the metadata timestamp field of the first target slot to record the precise time point when the image frame rendering is completed. Subsequently, the state machine manager updates the state flag field of the first target slot from the second flag to the third flag. The third flag indicates that the corresponding slot is in a rendering-complete and ready-to-display state, that is, the slot has completed rendering, and the stored image data is ready for the display compositor to read and perform scan output.

[0119] Update the current write pointer to point to the next slot in the circular memory queue.

[0120] In this embodiment, when updating the write pointer, the state machine manager obtains the current value of the write pointer, increments it by 1, and then performs a modulo operation using the total number of slots N in the circular memory queue. This modulo operation calculates the remainder when divided by N, and uses the remainder as the new write pointer value. Through this modulo operation, the write pointer moves from its current slot to the next slot in the circular memory queue. If it currently points to the last slot, it returns to the slot with index 0 after the modulo operation, thus achieving a circular loop. The updated write pointer will serve as the basis for selecting the first target slot when rendering a new frame next time.

[0121] The above steps are explained in detail below. Specifically, the write pointer update value pointing to the next slot in the circular memory queue is calculated using the first algorithm formula, which is: write_index΄=(write_index+1)mod N; where write_index΄ is the write pointer update value, write_index is the current value of the write pointer, N is the total number of slots in the circular memory queue, and mod represents the modulo operation.

[0122] This application embodiment implements the write pointer update calculation through a first algorithm formula, and uses modulo operation to ensure the cyclic flow of the write pointer in the circular memory queue. This algorithm allows the write pointer to automatically point to the next slot after each rendering, and automatically return to the starting position after traversing all slots, eliminating the need for additional boundary checks or reset operations, thus simplifying the index management logic of the circular queue. Simultaneously, this algorithm guarantees that the write pointer always stays within the valid index range of 0 to N-1, avoiding index out-of-bounds errors and providing a reliable index calculation foundation for the rendering side to continuously and stably select the first target slot.

[0123] If the status flag of the first target slot pointed to by the current write pointer does not meet the first condition, the current frame is actively discarded, and the current write pointer is updated to point to the next slot in the circular memory queue.

[0124] In this embodiment, when the query result shows that the status flag of the current first target slot is neither the first identifier nor the fourth identifier (i.e., the first condition is not met), the state machine manager determines that the slot cannot be occupied at present. At this time, the state machine manager does not perform rendering operations and actively discards the new frame to be rendered, thus abandoning the current rendering task. Subsequently, the state machine manager updates the current write pointer to point to the next slot in the circular memory queue in the same way, that is, it calculates the remainder when divided by N and moves the write pointer to the next slot. By discarding the current frame and moving the write pointer, the system avoids blocking and waiting due to insufficient slot resources, maintaining the continuity of the rendering process.

[0125] This application embodiment achieves synchronous control of the circular video memory queue slots on the rendering side through a status flag query and update mechanism. Each time a new frame is ready to be rendered, the system first checks whether the status flag of the first target slot pointed to by the current write pointer meets a first condition. Only when the condition is met will the slot be occupied and rendering executed; otherwise, the current frame is actively discarded and the write pointer is moved. This mechanism effectively avoids concurrent conflicts between rendering and display operations on the same slot, ensuring mutual exclusion of resource access. Simultaneously, by actively discarding frames that cannot occupy slots and continuing to advance the write pointer, the system avoids blocking delays caused by waiting for slot release, ensuring the continuous progress of the rendering process. Furthermore, after rendering is complete, the timestamp is updated and the status flag is set to READY, providing a clear ready signal to the display side and achieving efficient synchronization between rendering and display.

[0126] In this embodiment, when the application is ready to render a new frame, the state machine manager locates the corresponding physical slot from the circular memory queue based on the current write pointer value, marks the slot as the first target slot, and uses it as the rendering target for this rendering operation. If the current write pointer value is 0, the slot with index 0 in the queue is selected as the first target slot, and the direct memory access buffer corresponding to this slot will be used to carry the rendering output of the current frame.

[0127] refer to Figure 5 In another embodiment of this application, each time a new frame is ready to be rendered, it is determined whether the first target slot pointed to by the current write pointer catches up with the second target slot pointed to by the current read pointer.

[0128] In this embodiment, when the application side prepares to render a new frame, the state machine manager first obtains the value of the current write pointer, locates the corresponding physical slot from the circular memory queue based on this value, and marks the slot as the first target slot. Simultaneously, the state machine manager obtains the value of the current read pointer, locates the corresponding physical slot from the circular memory queue based on this value, and marks the slot as the second target slot. Subsequently, the state machine manager compares the values ​​of the current write pointer and the current read pointer to determine whether the first target slot has caught up with the second target slot. Specifically, if the first target slot has caught up with the second target slot, it means that the rendering side is about to use the slot that the display side has not yet finished reading; if the first target slot has not caught up with the second target slot, it means that there is at least one slot between the rendering side and the display side, and there is available buffer space.

[0129] If the first target slot pointed to by the current write pointer has not caught up with the second target slot pointed to by the current read pointer, then check whether the status flag of the first target slot pointed to by the current write pointer meets the first condition. The first condition is that the status flag of the first target slot pointed to by the current write pointer is the first flag or the fourth flag.

[0130] In this embodiment, when the determination result is that the first target slot pointed to by the current write pointer has not caught up with the second target slot pointed to by the current read pointer, the state machine manager reads the status flag field from the metadata of the first target slot and compares the value of the status flag with a preset first condition. The first condition is defined as: the status flag is a first identifier or the status flag is a fourth identifier. As mentioned above, the first identifier is FREE, indicating that the corresponding slot is in an idle state and is not occupied by any party; the fourth identifier is DISPLAYING, indicating that the corresponding slot is in a scanning output state, that is, the corresponding slot is currently being scanned and output by the display synthesizer, but is about to be released. Through this query operation, it is determined whether the first target slot has the condition to be immediately occupied when there is no catching up.

[0131] If the status flag of the first target slot pointed to by the current write pointer meets the first condition, then the current first target slot is immediately occupied, and the status flag of the first target slot pointed to by the current write pointer is set to the second flag; the current first target slot is associated with the Vulkan image resource as the rendering target through Vulkan extension, and scene rendering is performed; after rendering is completed, the timestamp is updated using the current time, and the status flag of the first target slot pointed to by the current write pointer is set to the third flag; the current write pointer is updated to point to the next slot in the circular memory queue.

[0132] If the status flag of the first target slot pointed to by the current write pointer does not meet the first condition, the current frame is actively discarded, and the current write pointer is updated to point to the next slot in the circular memory queue.

[0133] Similarly, the write pointer update value pointing to the next slot in the circular memory queue is calculated using the first algorithm formula, which is: write_index΄=(write_index+1) mod N; where write_index΄ is the write pointer update value, write_index is the current value of the write pointer, N is the total number of slots in the circular memory queue, and mod represents the modulo operation.

[0134] refer to Figure 6 If the first target slot pointed to by the current write pointer catches up with the second target slot pointed to by the current read pointer, then check whether the status flag of the current first target slot or the current second target slot meets the second condition. The second condition is that the status flag of the current first target slot or the current second target slot is the first identifier.

[0135] In this embodiment, when the application prepares to render a new frame, the state machine manager first obtains the value of the current write pointer, locates the corresponding physical slot from the circular memory queue based on this value, and marks the slot as the first target slot. Simultaneously, the state machine manager obtains the value of the current read pointer, locates the corresponding physical slot from the circular memory queue based on this value, and marks the slot as the second target slot. Subsequently, the state machine manager compares the values ​​of the current write pointer and the current read pointer to determine whether the first target slot has caught up with the second target slot. When the state machine manager determines that the first target slot has caught up with the second target slot, the system enters the catching-up processing branch. At this time, the state machine manager reads the status flag field from the metadata of the first target slot and compares the value of the status flag with a preset second condition. The second condition is defined as: the status flag being the first identifier indicates that the slot is in an idle state, neither being occupied by rendering nor by display. Through this query operation, the system determines whether the current slot is in an idle state under catching-up conditions, thereby deciding whether it can be directly occupied.

[0136] If the status flag of the current first target slot or the current second target slot meets the second condition, then the current first target slot is immediately occupied, and the status flag of the first target slot pointed to by the current write pointer is set to the second flag.

[0137] In this embodiment, when the query result shows that the status flag of the current first target slot or the current second target slot is FREE, i.e., the second condition is met, the state machine manager determines that the slot can be occupied by the application. The state machine manager then performs a slot occupation operation, updating the status flag field of the first target slot from the current value FREE to the second flag. The second flag indicates that the slot is currently in a rendering state and is occupied by the application as a rendering target. By updating the status flag, the system ensures that the display compositor will not read or access the slot during its rendering, thus achieving mutual exclusion protection of resources.

[0138] The Vulkan extension associates the current first target slot with a Vulkan image resource for scene rendering.

[0139] Similarly, in this embodiment, external memory expansion (VK_KHR_external_memory) is performed using Vulkan, and the buffer (DMA-BUF) memory corresponding to the first target slot is imported as Vulkan image resources to establish a direct association between the rendering target and the physical video memory.

[0140] After rendering is complete, update the timestamp using the current time and set the status flag of the first target slot pointed to by the current write pointer to the third flag.

[0141] In this embodiment, after the application completes the scene rendering operation for the first target slot, it obtains the current system time by calling a high-precision clock function and writes this time value as a timestamp into the metadata timestamp field of the first target slot to record the precise time point when the image frame rendering is completed. Subsequently, the state machine manager updates the state flag field of the first target slot from the second flag to the third flag. The third flag indicates that the corresponding slot is in a rendering-complete and ready-to-display state, that is, the slot has completed rendering, and the stored image data is ready for the display compositor to read and perform scan output.

[0142] Update the current write pointer to point to the next slot in the circular memory queue.

[0143] Similarly, the write pointer update value pointing to the next slot in the circular memory queue is calculated using the first algorithm formula, which is: write_index΄=(write_index+1) mod N; where write_index΄ is the write pointer update value, write_index is the current value of the write pointer, N is the total number of slots in the circular memory queue, and mod represents the modulo operation.

[0144] If the status flag of the current first target slot or the current second target slot does not meet the second condition, then query whether the status flag of the current first target slot or the current second target slot meets the third condition. The third condition is that the status flag of the current first target slot or the current second target slot is the fourth flag.

[0145] In this embodiment, when the query result shows that the status flag of the current first target slot or the current second target slot is not FREE, i.e., the second condition is not met, the state machine manager continues to read the status flag field from the metadata of the slot and compares the value of the status flag with a preset third condition. The third condition is defined as: the status flag is the fourth identifier, indicating that the slot is currently being scanned and output by the display compositor. Through this query operation, the system determines whether the current slot is in the process of display output in the case of a tailgating situation, thereby deciding whether the content of the slot can be forcibly overwritten.

[0146] If the status flag of the current first target slot or the current second target slot meets the third condition, then the current first target slot is immediately occupied, and the status flag of the first target slot pointed to by the current write pointer is set to the second flag.

[0147] In this embodiment, when the query result shows that the status flag of the current first target slot or the current second target slot is DISPLAYING, i.e., the third condition is met, the state machine manager determines that although the slot is currently occupied by the display compositor, the rendering side can forcibly occupy the slot. The state machine manager then performs a slot occupation operation, updating the status flag field of the first target slot from the current value DISPLAYING to the second flag. Through this forced occupation operation, the rendering side is allowed to overwrite the content of the slot that is being displayed and output, sacrificing the current display frame, to ensure that the rendering process can continue to move forward and avoid blocking caused by waiting for the display to complete.

[0148] By using the Vulkan extension, the current first target slot is used as the rendering target and associated with the Vulkan image resource for scene rendering, directly overwriting the frame content corresponding to the current first target slot.

[0149] Similarly, in this embodiment, external memory expansion (VK_KHR_external_memory) is performed using Vulkan, and the buffer (DMA-BUF) memory corresponding to the first target slot is imported as Vulkan image resources to establish a direct association between the rendering target and the physical video memory.

[0150] To overcome the limitations of traditional VSync waiting, the above embodiments of the present invention allow overwriting of older frames that have not yet been fully displayed in highly dynamic interactive scenarios. Specifically, when the first target slot pointed to by the current write pointer catches up with the second target slot pointed to by the current read pointer, and either the first or second target slot is still in the DISPLAYING state, the content of that frame can be directly overwritten. This strategy sacrifices the integrity of a very small number of frames in exchange for reduced end-to-end latency, significantly improving VR immersion and anti-motion sickness capabilities.

[0151] After rendering is complete, update the timestamp using the current time and set the status flag of the first target slot pointed to by the current write pointer to the third flag.

[0152] In this embodiment, after the application completes the scene rendering operation for the first target slot, it obtains the current system time by calling a high-precision clock function and writes this time value as a timestamp into the metadata timestamp field of the first target slot to record the precise time point when the image frame rendering is completed. Subsequently, the state machine manager updates the state flag field of the first target slot from the second flag to the third flag. The third flag indicates that the corresponding slot is in a rendering-complete and ready-to-display state, that is, the slot has completed rendering, and the stored image data is ready for the display compositor to read and perform scan output.

[0153] Update the current write pointer to point to the next slot in the circular memory queue.

[0154] Similarly, after updating the state flags, the state machine manager updates the write pointer. Specifically, the state machine manager obtains the current write pointer value, increments it by 1, and then performs a modulo operation using the total number of slots N in the circular memory queue. This modulo operation moves the write pointer from its current slot to the next slot in the circular memory queue. If it currently points to the last slot, it returns to the slot with index 0 after the modulo operation, thus completing the circular loop. The updated write pointer will be used as the basis for selecting the first target slot when rendering a new frame.

[0155] If the status flag of the current first target slot or the current second target slot does not meet the third condition, the current frame is actively discarded, and the current write pointer is updated to point to the next slot in the circular memory queue.

[0156] In this embodiment, when the query result shows that the status flag of the current first target slot or the current second target slot is not DISPLAYING (i.e., the status flag is RENDERING or READY), the state machine manager does not perform rendering operations and actively discards the new frame to be rendered, thus abandoning the current rendering task. Subsequently, the state machine manager updates the current write pointer to point to the next slot in the circular memory queue in the same way, that is, it calculates the remainder when divided by N and moves the write pointer to the next slot. By discarding the current frame and moving the write pointer, the system avoids blocking and waiting caused by unavailable slot resources, maintaining the continuity of the rendering process.

[0157] This application's embodiments introduce a tiered processing mechanism in tailgating scenarios, employing different strategies based on the status flag of the overtaken slot to achieve fine-grained scheduling between the rendering and display sides during resource contention. When the write pointer catches up with the read pointer, if the current first or second target slot is in a FREE state, it is normally occupied for rendering, making full use of idle resources; if the current first or second target slot is in a DISPLAYING state, the rendering side is allowed to forcibly overwrite it, sacrificing the current display frame to ensure the rendering process is not blocked, suitable for scenarios where real-time requirements outweigh image integrity; if the current first or second target slot is in a RENDERING or READY state, the current frame is actively discarded and the write pointer is advanced, avoiding long waiting times for the rendering thread. This tiered mechanism provides the system with flexible resource contention handling capabilities while ensuring resource mutual exclusion, effectively balancing the needs of rendering real-time performance and image integrity.

[0158] Furthermore, the query results show that the status flag of the current first or second target slot is neither FREE nor DISPLAYING. That is, when the status flag is RENDERING or READY, the state machine manager determines that the slot cannot be normally occupied or forcibly overwritten. At this time, the state machine manager does not perform rendering operations and actively discards the new frame to be rendered, thus abandoning the current rendering task. Subsequently, the state machine manager updates the current write pointer to point to the next slot in the circular memory queue in the same way, that is, it calculates the remainder when divided by N and moves the write pointer to the next slot. By discarding the current frame and moving the write pointer, the system avoids blocking and waiting due to unavailable slot resources, maintaining the continuity of the rendering process.

[0159] This application's embodiments introduce a tail-tracking mechanism for write and read pointers on the rendering side. Before rendering a new frame, it first checks if the first target slot has caught up with the second target slot. Only if they haven't caught up is a status flag lookup and slot occupancy operation performed. This mechanism effectively avoids the problem of display data being overwritten or rendering blocking that can occur when the rendering side blindly occupies slots when the write pointer catches up with the read pointer. If they haven't caught up, the availability of a slot is determined by a status flag. Rendering is only performed when the slot is in the FREE or DISPLAYING state; otherwise, the current frame is actively discarded and the write pointer is advanced. This ensures resource mutual exclusion between rendering and display, avoids rendering thread blocking due to unavailable slots, and maintains the continuous forward progress of the rendering process.

[0160] refer to Figure 7 In this embodiment, when a page flip completion event of the display driver 01 is detected or an immediate commit mode is adopted, the display compositor needs to commit a new frame; it then checks whether the status flag of the second target slot pointed to by the current read pointer satisfies the fourth condition. The fourth condition is that the status flag of the second target slot pointed to by the current write pointer is a third identifier.

[0161] If the status flag of the second target slot pointed to by the current read pointer meets the fourth condition, then a scan output is performed on the current second target slot, and the status flag of the second target slot pointed to by the current read pointer is set to the fourth flag; after the scan output is completed on the current second target slot, the status flag of the second target slot pointed to by the current read pointer is set to the first flag, and the current read pointer is updated to point to the next slot in the circular memory queue.

[0162] If the status flag of the second target slot pointed to by the current read pointer does not meet the fourth condition, then the current read pointer is directly updated to point to the next slot in the circular memory queue.

[0163] Furthermore, in the embodiments of this application, the specific steps for updating the current read pointer to point to the next slot in the circular memory queue are described in detail below.

[0164] The update value of the read pointer pointing to the next slot in the circular memory queue is calculated using the second algorithm formula: display_index΄=(display_index+1) mod N; where display_index΄ is the update value of the read pointer, display_index is the current value of the read pointer, N is the total number of slots in the circular memory queue, and mod represents the modulo operation.

[0165] Compared with existing technologies, the 3D scene display method provided in this application constructs a physically contiguous circular video memory queue by allocating a direct memory access buffer, with slots serving as both rendering targets and display sources. Based on separate control of write and read pointers, the Vulkan extension is used to associate rendering targets with image resources to achieve scene rendering. During display, a page table mapping is created through handle mapping to directly obtain image data from physical memory and submit it to the panel, completing the scan output. This application embodiment achieves parallel, copy-free interaction between rendering and display, effectively reducing video memory access latency and improving the smoothness and resource utilization efficiency of 3D scene display.

[0166] The embodiments described in this application completely eliminate the fixed latency caused by multi-buffer swapping and VSync waiting, achieving high real-time performance in conjunction with a real-time kernel. Rendered frames can be displayed almost immediately (latency depends only on the scan position), achieving single-digit millisecond-level "Motion-to-Photon" latency, while also supporting latency optimization through overlay strategies. Motion-to-Photon latency refers to the total time elapsed from when a user performs a physical action (e.g., turning their head, moving the mouse, or pressing a button) until the corresponding updated image pixels (photons) are fully displayed on the screen.

[0167] In addition, the embodiments of this application significantly reduce memory usage. Compared with the double buffering mechanism, the single buffering mechanism reduces video memory usage by more than 50%.

[0168] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.

Claims

1. A method for displaying a three-dimensional scene, characterized in that, The method includes: Allocate a preset number of direct memory access buffers and return a corresponding handle for each buffer; Each buffer is used as a physical slot to create a physically contiguous circular memory queue, which is directly accessible to the application side and the display compositor. The metadata of each slot in the circular video memory queue is initialized, and the metadata includes write pointers and read pointers; A 3D application is constructed by using each buffer as a rendering target. The first target slot is selected as the rendering target from the circular video memory queue based on the write pointer; The Vulkan extension associates the current rendering target with Vulkan image resources for scene rendering. The second target slot is selected from the circular video memory queue as the display source based on the read pointer; Perform a scan on the current display source and display the output, including: Obtain the handle corresponding to the second target slot; Map the corresponding handle, map the physical memory address of the rendered image data in the corresponding buffer to a virtual address in user space, and create a page table mapping that points to the physical memory page used during scene rendering; Based on the page table mapping, the image data to be displayed is obtained from the physical memory page and submitted to the display panel for display.

2. The three-dimensional scene display method as described in claim 1, characterized in that, The metadata also includes status flags and a timestamp indicating when the frame rendering is complete. The status flags are either a first flag, a second flag, a third flag, or a fourth flag. The first flag is FREE, indicating that the corresponding slot is in an idle state. The second flag is RENDERING, indicating that the corresponding slot is in a rendering state. The third flag is READY, indicating that the corresponding slot is in a rendering complete and ready-to-display state. The fourth flag is DISPLAYING, indicating that the corresponding slot is in a scanning and output state.

3. The three-dimensional scene display method as described in claim 2, characterized in that, When initializing the metadata of each slot in the circular video memory queue, the write pointer, the read pointer and the timestamp are initialized to 0, and the status flag is initialized to the first identifier.

4. The three-dimensional scene display method as described in claim 3, characterized in that, The method further includes: using the status flag to synchronously control scene rendering based on the written pointer to select a rendering target and performing scanning output and display based on the read pointer to select a display source, including: Each time a new frame is ready to be rendered, check whether the status flag of the first target slot pointed to by the current write pointer meets the first condition. The first condition is that the status flag of the first target slot pointed to by the current write pointer is the first identifier or the fourth identifier. If the status flag of the first target slot pointed to by the current write pointer meets the first condition, then the current first target slot is immediately occupied, and the status flag of the first target slot pointed to by the current write pointer is set to the second flag; The Vulkan extension associates the current first target slot with a Vulkan image resource as the rendering target for scene rendering. After rendering is complete, update the timestamp using the current time and set the status flag of the first target slot pointed to by the current write pointer to the third flag; Update the current write pointer to point to the next slot in the circular memory queue; If the status flag of the first target slot pointed to by the current write pointer does not meet the first condition, the current frame is actively discarded, and the current write pointer is updated to point to the next slot in the circular memory queue.

5. A three-dimensional scene display method as described in claim 3, characterized in that, The method further includes: using the status flag to synchronously control scene rendering based on the written pointer to select a rendering target and performing scanning output and display based on the read pointer to select a display source, including: Each time a new frame is ready to be rendered, it is determined whether the first target slot pointed to by the current write pointer has caught up with the second target slot pointed to by the current read pointer; If the first target slot pointed to by the current write pointer has not caught up with the second target slot pointed to by the current read pointer, then check whether the status flag of the first target slot pointed to by the current write pointer meets the first condition. The first condition is that the status flag of the first target slot pointed to by the current write pointer is the first identifier or the fourth identifier. If the status flag of the first target slot pointed to by the current write pointer meets the first condition, then the current first target slot is immediately occupied, and the status flag of the first target slot pointed to by the current write pointer is set to the second flag; The Vulkan extension associates the current first target slot with a Vulkan image resource as the rendering target for scene rendering. After rendering is complete, update the timestamp using the current time and set the status flag of the first target slot pointed to by the current write pointer to the third flag; Update the current write pointer to point to the next slot in the circular memory queue; If the status flag of the first target slot pointed to by the current write pointer does not meet the first condition, the current frame is actively discarded, and the current write pointer is updated to point to the next slot in the circular memory queue.

6. The three-dimensional scene display method as described in claim 5, characterized in that, Synchronous control using the status flags to perform scene rendering based on the written pointer to select a rendering target and to perform scanning output and display based on the read pointer to select a display source also includes: If the first target slot pointed to by the current write pointer catches up with the second target slot pointed to by the current read pointer, then check whether the status flag of the current first target slot or the current second target slot meets the second condition. The second condition is that the status flag of the current first target slot or the current second target slot is the first identifier. If the status flag of the current first target slot or the current second target slot meets the second condition, then the current first target slot is immediately occupied, and the status flag of the first target slot pointed to by the current write pointer is set to the second flag. The Vulkan extension associates the current first target slot with a Vulkan image resource as the rendering target for scene rendering. After rendering is complete, update the timestamp using the current time and set the status flag of the first target slot pointed to by the current write pointer to the third flag; Update the current write pointer to point to the next slot in the circular memory queue; If the status flag of the current first target slot or the current second target slot does not meet the second condition, then query whether the status flag of the current first target slot or the current second target slot meets the third condition, wherein the third condition is that the status flag of the current first target slot or the current second target slot is the fourth identifier; If the status flag of the current first target slot or the current second target slot meets the third condition, then the current first target slot is immediately occupied, and the status flag of the first target slot pointed to by the current write pointer is set to the second flag. By using the Vulkan extension, the current first target slot is used as the rendering target and associated with the Vulkan image resource for scene rendering, directly overwriting the frame content corresponding to the current first target slot. After rendering is complete, update the timestamp using the current time and set the status flag of the first target slot pointed to by the current write pointer to the third flag; Update the current write pointer to point to the next slot in the circular memory queue; If the status flag of the current first target slot or the current second target slot does not meet the third condition, the current frame is actively discarded, and the current write pointer is updated to point to the next slot in the circular memory queue.

7. A three-dimensional scene display method as described in any one of claims 4 to 6, characterized in that, Updating the current write pointer to point to the next slot in the circular memory queue includes: The write pointer update value pointing to the next slot in the circular memory queue is calculated using the first algorithm formula, which is: write_index΄=(write_index+1) mod N; Where write_index΄ is the write pointer update value, write_index is the current write pointer value, N is the total number of slots in the circular memory queue, and mod represents the modulo operation.

8. A three-dimensional scene display method as described in claim 7, characterized in that, Synchronous control using the status flags to perform scene rendering based on the written pointer selected rendering target and to perform scanning output and display based on the read pointer selected display source includes: When the display driver's page flip complete event is detected or the immediate commit mode is adopted, the display compositor needs to commit a new frame. Check whether the status flag of the second target slot pointed to by the current read pointer meets the fourth condition, wherein the status flag of the second target slot pointed to by the current write pointer is the third identifier; If the status flag of the second target slot pointed to by the current read pointer satisfies the fourth condition, then perform a scan output on the current second target slot and set the status flag of the second target slot pointed to by the current read pointer to the fourth flag; After the scan output is completed for the current second target slot, the status flag of the second target slot pointed to by the current read pointer is set to the first identifier, and the current read pointer is updated to point to the next slot in the circular memory queue; If the status flag of the second target slot pointed to by the current read pointer does not meet the fourth condition, then the current read pointer is directly updated to point to the next slot in the circular memory queue.

9. A three-dimensional scene display method as described in claim 8, characterized in that, Updating the current read pointer to point to the next slot in the circular memory queue includes: The second algorithm formula is used to calculate the update value of the read pointer pointing to the next slot in the circular memory queue. The second algorithm formula is: display_index΄=(display_index+1) mod N; Where display_index΄ is the updated value of the read pointer, display_index is the current value of the read pointer, N is the total number of slots in the circular memory queue, and mod represents the modulo operation.

10. A three-dimensional scene display system, characterized in that, The system includes: The display driver is used to allocate a preset number of direct memory access buffers and return a corresponding handle for each buffer; it creates a physically contiguous circular video memory queue with each buffer as a physical slot, for direct access by the application side and the display compositor. A state machine manager is used to initialize the metadata of each slot in the circular video memory queue, including write pointers and read pointers; On the application side, each buffer is used as a rendering target to construct a 3D application; The application side selects the first target slot from the circular video memory queue as the rendering target based on the write pointer; the current rendering target is associated with Vulkan image resources through Vulkan extensions to perform scene rendering; The display synthesizer is used to select a second target slot from the circular video memory queue as a display source based on a read pointer; and to perform a scan output and display on the current display source, including: Obtain the handle corresponding to the second target slot; Map the corresponding handle, map the physical memory address of the rendered image data in the corresponding buffer to a virtual address in user space, and create a page table mapping that points to the physical memory page used during scene rendering; Based on the page table mapping, the image data to be displayed is obtained from the physical memory page and submitted to the display panel for display.