A text terminal refresh method based on GPU display controller

By allocating video memory areas in the GPU and coordinating with the CPU to process text refresh, and utilizing the GPU's BLT operation, the performance bottleneck of existing text terminal display refresh is solved, achieving efficient and smooth text display.

CN119356782BActive Publication Date: 2025-09-30WUHAN LINGJIU MICROELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411409668.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-09-30
Estimated Expiration
2044-10-10

AI Technical Summary

Technical Problem

The display refresh method of existing text terminals relies on CPU line-by-line operation, resulting in high CPU resource consumption, low refresh efficiency, insufficient GPU utilization, and lack of CPU and GPU collaboration, leading to system performance bottlenecks and poor user experience.

Method used

Two video memory areas A and B are opened in the GPU. A is the visible area of ​​the screen, and B is the invisible area. The GPU display controller cooperates with the CPU to process text refresh, and the GPU's BLT operation is used to move large blocks of content between video memory areas to optimize the display refresh process.

Benefits of technology

Improves the refresh efficiency of text terminals, reduces CPU load, fully utilizes GPU performance, and optimizes user experience and system resource utilization in large data volume scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356782B_ABST
    Figure CN119356782B_ABST
Patent Text Reader

Abstract

The present invention provides a text terminal refresh method based on a GPU display controller, comprising: opening two continuous display memory areas A and B in a GPU, wherein the display memory area A can store m lines of text, and the display memory area B can store n lines of text; during the text input process, when a line break operation is triggered, determining the state of the current screen display area; and modifying the starting address of the designated screen display area of ​​the current GPU display controller based on the state of the current screen display area, thereby refreshing and displaying the newly added text lines. The present invention aims to achieve refresh of displayed content by collaboratively working with the GPU and the CPU and by modifying the starting address of the display area, thereby improving refresh efficiency, reducing CPU load, and fully utilizing GPU performance to optimize the smoothness of text terminal refresh.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and more particularly to a text terminal refresh method based on a GPU display controller. Background Art

[0002] As a basic interactive tool, text terminals are widely used in scenarios such as server management and command line operations. Traditional terminals typically rely on CPU line-by-line operations for screen display and line refresh. As screen content increases, especially when processing large amounts of scrolling text, a full-screen refresh operation is often triggered, resulting in reduced system performance and affecting the terminal's responsiveness. The GPU 2D acceleration engine provides efficient BLT (bit block transfer) operations that can accelerate the movement of screen content and improve display efficiency. However, existing text terminal display refresh methods do not fully utilize the collaborative work of the GPU and CPU, resulting in limitations in performance and resource utilization.

[0003] During the display refresh process of existing text terminals, it is found that the traditional method based on CPU line-by-line refresh and full-screen redrawing has at least the following technical problems:

[0004] (1) High CPU resource consumption: Full-screen refresh operations consume a lot of CPU resources, especially when processing fast text refreshes. The CPU load will increase significantly, thus affecting the overall performance of the system.

[0005] (2) Low refresh efficiency: Each full-screen refresh requires redrawing all the contents of the screen. Especially when processing large amounts of text, the refresh speed is significantly reduced, resulting in a poor user experience and easily causing display freezes or delays.

[0006] (3) Insufficient GPU utilization: Although GPUs have significant advantages in graphics processing and display acceleration, existing technologies do not effectively utilize the 2D acceleration function of GPUs and cannot effectively improve the display refresh performance of text terminals;

[0007] (4) Lack of multi-task collaboration: Existing refresh solutions usually rely only on the CPU for operation and fail to achieve collaborative work between the GPU and the CPU, resulting in inefficient resource utilization of the system.

[0008] It can be seen that the existing technology has a performance bottleneck in efficient text refresh, cannot fully utilize the acceleration capabilities of the GPU, and consumes a lot of system resources in large data volume scenarios. Summary of the Invention

[0009] The present invention aims to solve the technical problems existing in the prior art and provides a text terminal refresh method based on a GPU display controller, aiming to improve the text terminal page refresh efficiency and the overall system performance.

[0010] The present invention provides a text terminal refresh method based on a GPU display controller, comprising:

[0011] S1, allocate a video memory area in the GPU and divide the video memory area into two continuous video memory areas A and B, wherein video memory area A is a visible area of ​​the screen and can store m lines of text, and video memory area B is an invisible area and can store n lines of text, where m and n are positive integers and n ≥ m;

[0012] S2, when the text terminal starts, initializes the display control system and sets the starting address of the designated screen display area of ​​the GPU display controller. The screen display area starts from row 0 of the video memory area A;

[0013] S3, during the text input process, when a line break operation is triggered, the state of the current screen display area is determined, and according to the state of the current screen display area and based on the newly added text line, the starting address of the designated screen display area of ​​the GPU display controller is modified to refresh the display content of the display area.

[0014] On the basis of the above technical solution, the present invention can also make the following improvements.

[0015] Optionally, in S3, according to the state of the current screen display area and based on the newly added text line, modifying the starting address of the designated screen display area of ​​the GPU display controller and refreshing the display content of the display area includes:

[0016] If the current screen display area is not full, execute S4; if the current screen display area is full, execute S5 or S6;

[0017] S4, processing the newly added text lines based on CPU resources;

[0018] S5, if the current screen display area is full and the start address of the designated screen display area of ​​the GPU display controller is between 0 and n lines, adding a new text line based on CPU resource processing;

[0019] S6: If the current screen display area is full and the starting address of the designated screen display area of ​​the GPU display controller is at row n+1, a new text row is added based on CPU resources and GPU resources.

[0020] Optionally, the S4, processing the newly added text line based on CPU resources, includes:

[0021] If the current screen display area is not full, the new text line entered will be appended to the end of the current screen display area;

[0022] Keep the starting address of the designated screen display area of ​​the GPU display controller unchanged;

[0023] Processes display refresh of newly added text lines based on CPU resources.

[0024] Optionally, in S5, if the current screen display area is full and the starting address of the screen display area specified by the GPU display controller is between 0 and n lines, processing a new text line based on CPU resources includes:

[0025] Continue to add the new text lines entered to the end of the current screen display area;

[0026] Update the starting address of the specified screen display area of ​​the current GPU display controller and move it down one row until it reaches the nth row of the video memory area;

[0027] Processes display refresh of newly added text lines based on CPU resources.

[0028] Optionally, in S6, if the current screen display area is full and the starting address of the designated screen display area of ​​the GPU display controller is at line n+1, processing a new text line based on CPU resources and GPU resources includes:

[0029] If the current screen display area is full and the starting address of the designated screen display area of ​​the current GPU display controller is located at row n+1, the display content of rows n+1 to m+n of video memory area B is moved to video memory area A based on the GPU's BLT operation, and the starting address of the designated screen display area of ​​the GPU display controller is adjusted to row 0 of video memory area A.

[0030] Clear the contents of video memory area B;

[0031] Continue to execute S5 and S6, and repeat the display refresh of the text line.

[0032] Optionally, in S3, during the text input process, when a line break operation is triggered, determining the state of the current screen display area includes:

[0033] When the input text exceeds the data capacity of the current text line or the user enters the carriage return symbol, the text line wrapping operation is triggered;

[0034] The state of the current screen display area is determined according to the number of text lines that have been input, where the state of the current screen display area includes the state of the current screen display area being not full and the state of the current screen display area being full.

[0035] Optionally, determining the state of the current screen display area according to the number of text lines that have been input includes:

[0036] If the number of text lines entered is less than m, the current screen display area is not full;

[0037] If the number of text lines entered is ≥ m, the current screen display area is full.

[0038] Optionally, the video memory area A is adapted to the screen size. If the screen height is i, the height occupied by a single line of text is j, and m=i / j.

[0039] The present invention provides a text terminal refresh method based on a GPU display controller. The method opens two continuous video memory areas A and B in the GPU, wherein the video memory area A can store m lines of text, and the video memory area B can store n lines of text. During text input, when a line break operation is triggered, the state of the current screen display area is determined. Based on the state of the current screen display area and the designated screen display area starting address of the current GPU display controller, the GPU and CPU are coordinated to perform a display refresh on the text. The present invention aims to achieve refresh of displayed content by collaboratively working with the GPU and CPU and modifying the display area starting address, thereby improving refresh efficiency, reducing CPU load, and fully utilizing GPU performance to optimize the smoothness of text terminal refresh. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is an architectural flow chart of a text terminal refresh method based on a GPU display controller provided by the present invention;

[0041] Figure 2 This is a schematic diagram of an implementation of a text terminal refresh method based on a GPU display controller provided by the present invention for processing newly added text lines when the screen is not full;

[0042] Figure 3 This is a schematic diagram of an implementation of a text terminal refresh method based on a GPU display controller provided by the present invention when the starting address is between lines 0 and n;

[0043] Figure 4 This is a schematic diagram of an implementation of a text terminal refresh method based on a GPU display controller provided by the present invention with the starting address being in row n+1;

[0044] Figure 5 The present invention provides a schematic diagram of a BLT operation implementation method of a text terminal refresh method based on a GPU display controller. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. In addition, the technical features in the various embodiments or single embodiments provided by the present invention can be arbitrarily combined with each other to form a feasible technical solution. This combination is not restricted by the sequence of steps and / or structural composition mode, but must be based on the ability of ordinary technicians in this field to implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0046] Figure 1 The present invention provides a flowchart of a text terminal refresh method based on a GPU display controller, such as Figure 1 As shown, the method includes:

[0047] S1. Open up a video memory area in the GPU and divide the video memory area into two continuous video memory areas A and B. Video memory area A is a visible area on the screen and can store m lines of text. Video memory area B is an invisible area and can store n lines of text. m and n are positive integers, and n ≥ m.

[0048] It is understood that the embodiment of the present invention allocates two continuous memory areas A and B in the GPU, which together form a single memory area. Memory area A is the visible area of ​​the screen, used to display text content, while memory area B is the invisible area. The capacity of the invisible area is no less than that of the visible area, enabling scrolling refresh of displayed content, avoiding full-screen redrawing, and improving display efficiency.

[0049] The A video memory area is adapted to the screen size. Assuming the screen height is i, the height occupied by a single line of text is j, and i / j=m, the A video memory area can store m lines of text, and the B video memory area can store n lines of text, and n≥m, and a total of m+n lines of text can be accommodated. The larger the capacity of the video memory area B, the more video memory resources are required, but the frequency of using BLT operations will be reduced and the overall efficiency will be improved.

[0050] S2, when the text terminal starts, initializes the display control system and sets the starting address of the designated screen display area of ​​the GPU display controller. The screen display area starts from the 0th row of the video memory area A.

[0051] It is understandable that when the text terminal is started, the display control system is initialized. Initially, the starting address of the designated screen display area of ​​the GPU display controller is set to the 0th row of the video memory area A, that is, the display starts from the 0th row of the video memory area A.

[0052] S3, during the text input process, when a line break operation is triggered, the state of the current screen display area is determined; according to the state of the current screen display area and based on the newly added text line, the starting address of the designated screen display area of ​​the GPU display controller is modified to refresh the display content of the display area.

[0053] Exemplarily, S3, during the text input process, when a line break operation is triggered, determining the state of the current screen display area, includes: during the text input process, when the input text content exceeds the data capacity of the current text line or the user enters a carriage return symbol, triggering the text line break operation. Determining the state of the current screen display area based on the number of text lines already entered, wherein the state of the current screen display area includes the state of the current screen display area being not full and the state of the current screen display area being full.

[0054] If the number of text lines entered is less than m, the current screen display area is not full.

[0055] If the number of text lines entered is ≥ m, the current screen display area is full.

[0056] Exemplarily, in S3, according to the status of the current screen display area and based on the newly added text line, the starting address of the designated screen display area of ​​the GPU display controller is modified, and the display content of the display area is refreshed, including: if the current screen display area is not full, execute S4; if the current screen display area is full, execute S5 or S6.

[0057] S4, processing the newly added text lines based on CPU resources.

[0058] like Figure 2 As shown, when the current screen display area is not full, that is, the number of text lines input is less than m lines, the newly input text lines are processed based on CPU resources.

[0059] Specifically, S4 includes:

[0060] S4.1, append the new text line to the end of the current screen display area;

[0061] S4.2, the GPU display controller specifies that the starting address of the screen display area remains unchanged;

[0062] S4.3: At this time, only CPU resources are used to process the display refresh of the newly added rows. Since the amount of data in the new rows is small, the CPU load remains low.

[0063] S5: If the current screen display area is full and the start address of the screen display area specified by the GPU display controller is between 0 and n lines, add a new text line based on CPU resource processing.

[0064] Among them, if the current screen display area is full and the starting address of the designated screen display area of ​​the GPU display controller is between 0 and n lines, since the current screen display area is full, when a new text line is input, the starting address of the designated screen display area of ​​the GPU display controller needs to be updated.

[0065] Specifically, such as Figure 3 As shown, S5 specifically includes:

[0066] S5.1, continue adding new text lines to the display area;

[0067] S5.2, updates the starting address of the designated screen display area of ​​the GPU display controller and moves it down one row until it reaches the nth row of the video memory; dynamically adjusts the starting address of the designated screen display area through the CRTC to achieve fast switching of the visible video memory area on the screen.

[0068] S5.3, uses CPU resources to handle the display refresh of the newly added rows.

[0069] S6: If the current screen display area is full and the starting address of the designated screen display area of ​​the GPU display controller is at row n+1, a new text row is added based on CPU resources and GPU resources.

[0070] It can be understood that if the current screen display area is full and the starting address of the designated screen display area of ​​the GPU display controller is in row n+1, then the (n+1)th row to the (n+m)th row in the video memory area B, a total of m rows, are not displayed, and the m rows not displayed in the video memory area B are moved to the video memory area A.

[0071] See also Figure 4 , S6 specifically includes:

[0072] S6.1, use the GPU's BLT operation to move the display content of the n+1th row to the m+nth row in the video memory area B to the video memory area A, and at the same time adjust the starting address of the designated screen display area of ​​the GPU display controller to the 0th row of the video memory area A. The BLT operation implementation diagram is shown in Figure 5 As shown;

[0073] S6.2, clear the contents of video memory area B;

[0074] S6.3, continue with S5 operation and repeat the above cycle to ensure smooth scrolling and refreshing of the displayed content.

[0075] Among them, the GPU handles the movement of large blocks of content through BLT operations, and the CPU is responsible for processing the rendering of new lines. The GPU and CPU work together to improve the overall performance of the system; and use the GPU's BLT operations to quickly move content between video memory areas, reducing the consumption of system resources.

[0076] The following is a specific example of a text terminal refresh method based on a GPU display controller provided by the present invention, which includes the following steps:

[0077] (1) Create two contiguous memory areas A and B of equal size. Each memory area can hold m lines of text, and the total area can hold 2 times m lines of text.

[0078] (2) When the user inputs a line break operation in the terminal, the system first adjusts the starting address of the designated screen display area of ​​the display controller CRTC from the first line to the second line, and directly completes the line break display;

[0079] (3) When the starting address is between row 0 and row m, no BLT operation is required. The CPU simply adds a new row of content and moves the starting address of the CRTC down one row, continuing to refresh downwards.

[0080] (4) As the number of input lines increases, the screen content gradually moves downward, and the starting address is adjusted downward line by line. When the starting address reaches line m+1, the system performs the GPU's BLT operation, rolling all the contents of the A video memory area back to line 0 through GPU acceleration, and at the same time resets the starting address of the CRTC to line 0;

[0081] (5) The GPU is primarily responsible for large-scale content movement and refreshing, while the CPU only handles the rendering of newly added lines. The GPU and CPU work together to ensure that the system can efficiently refresh the text terminal.

[0082] The present invention provides a text terminal refresh method based on a GPU display controller, which enables fast and seamless text terminal operation and significantly improves system response speed and user experience. Specific advantages are as follows:

[0083] (1) Improve refresh efficiency: Move large blocks of content between video memory areas through the GPU's BLT operation, avoiding full-screen redrawing and significantly improving the terminal's refresh speed;

[0084] (2) The larger the capacity of the invisible area of ​​the screen, the more video memory resources are required, but the frequency of BLT operations will be reduced accordingly, thereby improving overall efficiency. The system shows more flexible adaptability between resource consumption and operating efficiency;

[0085] (3) Optimizing performance in large text scenarios: When the screen is full, the GPU and CPU work together to significantly improve the efficiency of scrolling large text data and enhance the user experience.

[0086] (4) Reduce system resource consumption: The collaborative work of GPU and CPU realizes reasonable task allocation and reduces the overall system resource consumption.

[0087] It should be noted that, in the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0088] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0089] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0090] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0091] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0092] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0093] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A text terminal refresh method based on a GPU display controller, characterized in that: include: S1, allocate a video memory area in the GPU and divide the video memory area into two continuous video memory areas A and B, wherein video memory area A is a visible area of ​​the screen and can store m lines of text, and video memory area B is an invisible area and can store n lines of text, where m and n are positive integers and n ≥ m; S2, when the text terminal starts, initializes the display control system and sets the starting address of the designated screen display area of ​​the GPU display controller. The screen display area starts from row 0 of the video memory area A; S3, during the text input process, when a line break operation is triggered, determining the state of the current screen display area, modifying the start address of the designated screen display area of ​​the GPU display controller based on the state of the current screen display area and the newly added text line, and refreshing the display content of the display area; In S3, according to the state of the current screen display area and based on the newly added text line, the starting address of the designated screen display area of ​​the GPU display controller is modified to refresh the display content of the display area, including: If the current screen display area is not full, execute S4; if the current screen display area is full, execute S5 or S6; S4, processing the newly added text lines based on CPU resources; S5, if the current screen display area is full and the start address of the designated screen display area of ​​the GPU display controller is between 0 and n lines, adding a new text line based on CPU resource processing; S6: If the current screen display area is full and the start address of the designated screen display area of ​​the GPU display controller is at row n+1, a new text row is added based on CPU resources and GPU resources.

2. The text terminal refresh method according to claim 1, characterized in that: S4, processing of new text lines based on CPU resources, including: If the current screen display area is not full, the new text line entered will be appended to the end of the current screen display area; Keep the starting address of the designated screen display area of ​​the GPU display controller unchanged; Processes display refresh of newly added text lines based on CPU resources.

3. The text terminal refresh method according to claim 1, characterized in that: S5, if the current screen display area is full and the start address of the screen display area specified by the GPU display controller is between lines 0 and n, processing a new text line based on CPU resources includes: Continue to add the new text lines entered to the end of the current screen display area; Update the starting address of the specified screen display area of ​​the current GPU display controller and move it down one row until it reaches the nth row of the video memory area; Processes display refresh of newly added text lines based on CPU resources.

4. The text terminal refresh method according to claim 1, characterized in that: S6: If the current screen display area is full and the starting address of the designated screen display area of ​​the GPU display controller is at line n+1, processing a new text line based on CPU resources and GPU resources includes: If the current screen display area is full and the starting address of the designated screen display area of ​​the current GPU display controller is located at row n+1, the display content of rows n+1 to m+n of video memory area B is moved to video memory area A based on the GPU's BLT operation, and the starting address of the designated screen display area of ​​the GPU display controller is adjusted to row 0 of video memory area A. Clear the contents of video memory area B; Continue to execute S5 and S6, and repeat the display refresh of the text line.

5. The text terminal refresh method according to claim 1, characterized in that: The step S3, during the text input process, when a line break operation is triggered, determines the state of the current screen display area, including: When the input text exceeds the data capacity of the current text line or the user enters the carriage return symbol, the text line wrapping operation is triggered; The state of the current screen display area is determined according to the number of text lines that have been input, where the state of the current screen display area includes the state of the current screen display area being not full and the state of the current screen display area being full.

6. The text terminal refresh method according to claim 5, characterized in that: Determining the state of the current screen display area according to the number of text lines that have been input includes: If the number of text lines entered is less than m, the current screen display area is not full; If the number of text lines entered is ≥ m, the current screen display area is full.

7. The text terminal refresh method according to claim 1, characterized in that: The video memory area A is adapted to the screen size. If the screen height is i, the height occupied by a single line of text is j, and m=i / j.

Citation Information

Patent Citations

  • GPU invisible video memory management method and system based on visible video memory exchange area

    CN112465689A

  • Screen driving circuit, display screen and electronic equipment

    CN117059033A