CN117076035B - Optimization method of screen pattern under X window system - Google Patents

Optimization method of screen pattern under X window system Download PDF

Info

Publication number
CN117076035B
CN117076035B CN202311321954.8A CN202311321954A CN117076035B CN 117076035 B CN117076035 B CN 117076035B CN 202311321954 A CN202311321954 A CN 202311321954A CN 117076035 B CN117076035 B CN 117076035B
Authority
CN
China
Prior art keywords
server
application
screen
redrawing
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311321954.8A
Other languages
Chinese (zh)
Other versions
CN117076035A (en
Inventor
王勇军
杨达成
张铎
刘意虎
周磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kirin Software Co Ltd
Original Assignee
Kirin Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kirin Software Co Ltd filed Critical Kirin Software Co Ltd
Priority to CN202311321954.8A priority Critical patent/CN117076035B/en
Publication of CN117076035A publication Critical patent/CN117076035A/en
Application granted granted Critical
Publication of CN117076035B publication Critical patent/CN117076035B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • Digital Computer Display Output (AREA)

Abstract

The invention discloses an optimization method of a screen under an X window system, which comprises the following steps: the first application locks an X server; the method comprises the steps that a first application obtains a screen state to be set and sends a screen resetting request to an X server; creating a new frame buffer by the X server; the first application sends a redrawing request to the X server; the X server receives the redrawing request; the first application unlocks the X server; the X server informs the second application to redraw; the second application redraws to a new frame buffer; the second application sends a redrawing completion signal to the X server; and after receiving the redrawing completion signal sent by the second application, the X server switches the display controller to point to the new frame buffer and destroys the old frame buffer.

Description

Optimization method of screen pattern under X window system
Technical Field
The invention relates to an optimization method, in particular to an optimization method for a screen under an X window system.
Background
The X window system, also called Xorg graphic server, is the most basic graphic interaction system on Unix/Linux system, adopts the client/server design concept, has excellent flexibility and strong functions, and becomes the default graphic system in Unix/Linux.
As shown in fig. 1, the X window system generally uses xrandr application to implement functions of adjusting screen resolution, rotating and changing display mode (screen expansion copy switch), but these scenes may have various problems of screen splash and screen splash during actual calling, such as: the screen-locking interface is used for screen-flashing, screen resolution is switched, screens are rotated, screen expansion and copying are set, and screen-flashing phenomenon occurs when the scenes are copied, so that user experience is greatly affected. To solve this problem, some release versions disable crtc when setting the above scenario, which can solve the problems of splash and splash but can cause the display to be black, and also affect the user experience.
The Chinese patent invention discloses a method, a device and a terminal for drawing a graph based on an X window system (201710703287.8), and provides the method, the device and the terminal for drawing the graph based on the X window system. The embodiment of the method comprises the steps of obtaining a target instruction, and calling a corresponding graph drawing function if the target instruction is a hardware acceleration instruction; acquiring a next acceleration instruction, and if the next acceleration instruction is still a hardware acceleration instruction, temporarily not calling a hardware synchronization function, and continuing to process the next acceleration instruction; if the next acceleration instruction is a software acceleration instruction, calling a hardware synchronization function, and processing the next acceleration instruction after synchronizing system data; when at least two hardware acceleration instructions are continuously executed, a graphic drawing function corresponding to each hardware acceleration instruction is sequentially called, at least two hardware acceleration instructions are continuously submitted to the GPU, after the hardware acceleration instructions submitted to the GPU are processed, a hardware synchronization function is called once to complete system data synchronization of a plurality of hardware acceleration instructions, the advantages of the GPU are better played, the performance of an X window system is improved, and the problems of screen display in scenes such as screen rotation, display mode change and the like under the X window system are not involved.
The invention relates to a method and a device for repairing the access of a Graphic Processing Unit (GPU) video memory for active error detection (202210543511.2), and provides the method and the device for repairing the access of the GPU video memory for active error detection; after the abnormal access of the display data is found, the GPU desktop driving module can pause the display screen updating operation, the GPU kernel driving module pauses all the display memory accesses first, then the display memory controller is initialized again, the abnormal access of the display memory is repaired, then the normal access of all the modules to the display memory is restored, the desktop display is refreshed, and the graphic desktop is restored to a normal state. The active detection mechanism of the video memory access error can timely find out the video memory access error fault, perform error repair and field recovery, solve the problem of display screen display caused by the video memory access fault, do not need to change hardware, and improve the stability and user experience of the GPU system, but do not relate to the problems of rotating a screen, changing a display mode and other scene screen display under the X window system.
Chinese patent (201711104206.9) "a splash screen detection method, a splash screen detection device and an electronic device", discloses a splash screen detection method, a splash screen detection device, an electronic device and a computer-readable storage medium, wherein the splash screen detection method comprises: acquiring original image data acquired when the intelligent terminal shoots; acquiring a picture to be detected, which is obtained after the intelligent terminal photographs; detecting whether the difference between the image attribute in the picture to be detected and the corresponding image attribute in the original image data is within a preset difference range; if the difference is not in the preset difference range, determining that the picture to be detected has a screen display phenomenon. According to the scheme, although intelligent detection of the screen-splash phenomenon possibly occurring during photographing can be realized, manual detection of the screen-splash phenomenon by a tester is reduced, and the problems of screen-splash in scenes such as rotating a screen and changing a display mode under an X window system are not involved.
Therefore, a method is needed to solve the problems of screen rotation, display mode change and the like of the scene under the X window system.
Disclosure of Invention
In order to solve the above problems, the present invention aims to provide an optimization method for a screen under an X window system, by improving RandR extension protocol: after the new FB is drawn, the new FB is sent to be displayed, and the problems of screen display, screen flashing and the like in the scenes of screen locking interface, screen rotation, screen expansion copying setting and the like under an X window system are solved on the premise that the display is not black.
The invention discloses an optimization method of a screen under an X window system, which comprises the following steps:
step S1: locking an X server in a first application of an X client;
step S2: the method comprises the steps that a first application of an X client obtains a screen state to be set and sends a screen resetting request to an X server;
step S3: creating a new frame buffer by the X server according to the reset screen request;
step S4: the first application of the X client sends a redrawing request to the X server according to the screen state resetting request;
step S5: the X server receives the redrawing request;
step S6: the first application of the X client unlocks the X server according to the redrawing request;
step S7: the X server notifies a second application of the X client to redraw according to the redrawing request;
step S8: the second application of X client redraws to the new frame buffer;
step S9: after the new frame buffer is drawn, the second application of the X client sends a redrawing completion signal to the X server;
step S10: after receiving the redrawing completion signal sent by the second application of the X client, the X server switches the display controller to point to the new frame buffer and destroys the old frame buffer.
Further, in step S3, the X server creates a new frame buffer, and does not remove the old frame buffer, and the display controller points to the old frame buffer, on which new drawing will take place.
Further, before step S1, step S0 is further included;
step S0: an XRRSetCrtcPreConfig interface and a processing function ProcRRSetCrtcPreConfig are added in the RandR extension protocol.
Further, in step S4, the first application of the X client sends a redrawing request to the X server through the xrrsetctcpreffig interface; the data interaction mode of the XRRSetCrtcPreConfig interface relates to: and feeding back the parameter information of the new frame buffer related to the redrawing request to the X server.
Further, in step S7, the X server notifies the second application of the X client of redrawing through the processing function procrrsetcrtcpreffig according to the redrawing request; the data interaction mode of the processing function ProcRRSetCrtcPreConfig relates to: and feeding back the parameter information of the new frame buffer received by the X server to a second application of the X client.
Further, the first application is an xrandr application.
The invention has the beneficial effects that:
the optimization method of the invention adds an XRRSetCrtcPreConfig interface and a corresponding processing function ProcRRSetCrtcPreConfig in a RandR expansion protocol, notifies an X client that the screen state is changed before an actual display controller (crtc) exchanges Frame Buffer (FB) for display, and needs to redraw and sends a new FB for display after drawing is completed.
X server creates a new FB that matches the screen state to be set but crtc still points to the old FB: at this stage, only a new FB is created, the old FB is not removed, crtc still points to the old FB, but all new drawing actions are performed on the new FB, so that the phenomena of screen display, tearing and the like are solved when the new FB content is sent and displayed without drawing.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is an original flow of xrandr application setup screen rotation, changing display mode;
fig. 2 is a schematic diagram of the procedure of the xrandr application setting screen rotation and display mode changing by adopting the optimization method of the present invention.
Detailed Description
The following description of the technical solution in the embodiments of the present invention is clear and complete. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways other than those described herein, and persons skilled in the art will readily appreciate that the present invention is not limited to the specific embodiments disclosed below.
Abbreviations and key term definitions:
x: the X Window System is a Window System displayed in a bitmap mode. Developed in 1984 by MT (institute of technology, ma), which is a standard toolkit and protocol for building graphical user interfaces on Unix-like operating systems, for almost all existing modern operating systems.
X11 protocol: x Window rapidly evolves after being pushed out, and in 1987, the core protocol is 11 th edition, abbreviated as: x11. This version has implemented the philosophy of "providing a mechanism, not a policy", so thoroughly that the core protocol is essentially stable, without requiring particularly large changes. Thus, at present, X Window is still X11.
X extension protocol: x server defines 119 interfaces, interfaces other than 128 are for EXTENSION (# define EXTENSION_BASE 128). However, each extension may implement multiple interfaces, and the ProcVector only prepares one entry for each extension, so the extension protocol requires self-distribution if there are multiple interfaces. The implementation of each extension protocol requires unified processing from its corresponding extension protocol entry.
RandR extension protocol: is an extension protocol for the X protocol for adjusting screen resolution, rotating, and implementing screen extension copy switching.
xrandr: the official configuration application of RandR extension protocol is used to set the size, direction, or rotation of the screen output, etc.
Display controller (hereinafter abbreviated as crtc): an RGB signal generation source (TCON), and a memory switching controller (Display Controller).
Frame Buffer (FB): for describing the memory information (e.g., format, pitch, size, etc.) and the hardware independent basic elements.
The invention provides an optimization method of a scene screen, which is characterized in that the RandR expansion protocol is improved: after the new FB is drawn, the new FB is sent to be displayed, and the problems of screen display, screen flashing and the like when the screen is locked, rotated, set, expanded and copied and other scenes under the X window system are solved on the premise that the display is not black.
The invention discloses an optimization method of a screen under an X window system, which comprises the following steps:
step S0: an XRRSetCrtcPreConfig interface and a processing function ProcRRSetCrtcPreConfig are added in the RandR extension protocol.
The second application to notify X clients before the actual crtc swap FB sends out: the screen state changes, re-rendering is required, and a new FB is sent to display after rendering is completed.
Step S1: the first application of X client locks X server so that X server closes the connection with other clients and no longer processes requests sent by other clients.
Step S2: the first application of the X client obtains the screen state to be set (screen rotation, changing display mode, size after expanding copy mode, etc.) and sends a reset screen request to the X server accordingly.
Step S3: the X server creates a new FB conforming to the screen state to be set according to the reset screen request; this stage creates only one new FB, and does not remove the old FB and crtc still points to the old FB, but all new drawing actions will take place on the new FB. As shown in fig. 1, the original processing manner at this stage is to directly direct crtc to the new FB and delete the old FB after creating a new FB, so that the new FB content is sent and displayed without drawing, and thus, phenomena such as screen display, tearing and the like occur.
Step S4: the first application of the X client sends a redrawing request to the X server through an XRRSetCrtcPreConfig interface according to the reset screen request; informing it that: the screen state changes, and the second application needs to be redrawn; the data interaction mode of the XRRSetCrtcPreConfig interface relates to: the new parameter (such as the width, the height, etc. of crtc) information of the FB related to the redrawing request is fed back to the X server, so that the X server changes the parameter information of the FB associated with crtc after receiving the parameter, but the actual hardware crtc is not changed.
Step S5: the X server receives the redrawing request;
step S6: the first application of the X client unlocks the X server according to the redrawing request;
step S7: the X server informs a second application of the X client of redrawing through a processing function ProcRRSetCrtcPreConfig according to the redrawing request; the data interaction mode of the processing function ProcRRSetCrtcPreConfig relates to: and feeding back the parameter information of the new FB received by the X server to the second application.
Step S8: the second application of X client redraws to the new FB;
step S9: after the new FB is drawn, the second application of the X client sends a redrawing completion signal to the X server to inform the X server;
step S10: after receiving the redrawing completion signal sent by the second application of the X client, the X server switches crtc to point to the new FB and destroys the old FB.
It should be noted that only the first application of X client can unlock or lock X server, while the second application (other client applications than the first application) cannot unlock or lock X server. The first application can only feed back the relevant parameters to the X server, and then the X server transmits the relevant parameters to the second application. When the second application needs to redraw the window size, the first application needs to lock the X server, feed back the parameters of the new FB to the X server, and unlock the X server after the information of the FB bound with crtc in the X server is updated, so that the second application redraws to the new FB.
As shown in fig. 2, when the first application is an xrandr application, the specific implementation steps are as follows:
step S1: the X server is locked in the xrandr application of the X client such that the X server closes the connection with the other clients and no longer processes requests sent by the other clients.
Step S2: the xrandr application of the X client obtains the screen state to be set (screen rotation, size after setting the extended copy mode, etc.) and sends a screen resetting request to the X server to request the screen state to be reset;
step S3: x server creates a new FB according to the screen state to be set according to the reset screen request.
Step S4: the xrandr application of the X client sends a redrawing request to the X server through an XRRSetCrtcPreConfig interface according to the reset screen request; informing it that: the screen state changes, and the second application needs to be redrawn; the data interaction mode of the XRRSetCrtcPreConfig interface relates to: the new parameter (such as the width, the height, etc. of crtc) information of the FB related to the redrawing request is fed back to the X server, so that the X server changes the parameter information of the FB associated with crtc after receiving the parameter, but the actual hardware crtc is not changed.
Step S5: the X server receives the redrawing request;
step S6: the xrandr application of the X client unlocks the X server according to the redrawing request;
step S7: the X server informs a second application of the X client to redraw through a processing function ProcRRSetCrtcPreConfig according to the received redrawing request; the data interaction mode of the processing function ProcRRSetCrtcPreConfig relates to: and feeding back the parameter information of the new FB received by the X server to the second application.
Step S8: the second application of X client redraws to the new FB;
step S9: after the new FB is drawn, the second application of the X client sends a redrawing completion signal to the X server to inform the X server;
step S10: after receiving the redrawing completion signal sent by the second application of the X client, the X server switches crtc to point to the new FB and destroys the old FB.
In step S8, it is known that the redrawing of the second application is performed on the new FB, but at this time, the actual hardware crtc is not changed, the display content still corresponds to the old FB, and the crtc is not pointed to the new FB until the new FB is redrawn (steps S9 and S10), and the old FB is destroyed. Therefore, the problems of screen display and the like caused by direct display of the content of the new FB without drawing are avoided.
The optimization method of the invention has the advantages that:
1. originality of implementation:
A. by adding an XRRSetCrtcPreConfig interface and a corresponding processing function ProcRRSetCrtcPreConfig in the RandR extension protocol, the state of an X client screen is notified to change before the actual crtc exchanges the FB for display, the redrawing is needed, and a new FB is displayed after the drawing is completed.
B. X server creates a new FB that matches the screen state to be set but crtc still points to the old FB: at this stage, only a new FB is created, the old FB is not removed, crtc still points to the old FB, but all new drawing actions are performed on the new FB, so that the phenomena of screen display, tearing and the like are solved when the new FB content is sent and displayed without drawing.
It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.

Claims (6)

1. The method for optimizing the screen under the X window system is characterized by comprising the following steps of:
step S1: locking an X server in a first application of an X client;
step S2: the method comprises the steps that a first application of an X client obtains a screen state to be set and sends a screen resetting request to an X server;
step S3: creating a new frame buffer by the X server according to the reset screen request;
step S4: the first application of the X client sends a redrawing request to the X server according to the screen state resetting request;
step S5: the X server receives the redrawing request;
step S6: the first application of the X client unlocks the X server according to the redrawing request;
step S7: the X server notifies a second application of the X client to redraw according to the redrawing request;
step S8: the second application of X client redraws to the new frame buffer;
step S9: after the new frame buffer is drawn, the second application of the X client sends a redrawing completion signal to the X server;
step S10: after receiving the redrawing completion signal sent by the second application of the X client, the X server switches the display controller to point to the new frame buffer and destroys the old frame buffer.
2. The method according to claim 1, wherein in step S3, the X server creates a new frame buffer, and does not remove an old frame buffer, and the display controller points to the old frame buffer.
3. The method for optimizing a screen under an X window system according to claim 1, further comprising step S0 before step S1;
step S0: an XRRSetCrtcPreConfig interface and a processing function ProcRRSetCrtcPreConfig are added in the RandR extension protocol.
4. The method for optimizing screen under X window system according to claim 3, wherein in step S4, the first application of X client sends a redrawing request to X server through XRRSetCrtcPreConfig interface; the data interaction mode of the XRRSetCrtcPreConfig interface relates to: and feeding back the parameter information of the new frame buffer related to the redrawing request to the X server.
5. A method for optimizing a screen under an X window system according to claim 3, wherein in step S7, the X server notifies the second application of the X client of redrawing through a processing function procrrsetcrtcpreffig according to the redrawing request; the data interaction mode of the processing function ProcRRSetCrtcPreConfig relates to: and feeding back the parameter information of the new frame buffer received by the X server to a second application of the X client.
6. The method for optimizing a screen under an X window system according to any one of claims 1 to 5, wherein the first application is an xrandr application.
CN202311321954.8A 2023-10-13 2023-10-13 Optimization method of screen pattern under X window system Active CN117076035B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311321954.8A CN117076035B (en) 2023-10-13 2023-10-13 Optimization method of screen pattern under X window system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311321954.8A CN117076035B (en) 2023-10-13 2023-10-13 Optimization method of screen pattern under X window system

Publications (2)

Publication Number Publication Date
CN117076035A CN117076035A (en) 2023-11-17
CN117076035B true CN117076035B (en) 2023-12-26

Family

ID=88717347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311321954.8A Active CN117076035B (en) 2023-10-13 2023-10-13 Optimization method of screen pattern under X window system

Country Status (1)

Country Link
CN (1) CN117076035B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5289574A (en) * 1990-09-17 1994-02-22 Hewlett-Packard Company Multiple virtual screens on an "X windows" terminal
WO2021184369A1 (en) * 2020-03-20 2021-09-23 西安诺瓦星云科技股份有限公司 Screen display control method, apparatus and system
CN114595021A (en) * 2022-03-10 2022-06-07 Oppo广东移动通信有限公司 Method and device for repairing splash screen, electronic equipment, chip and storage medium
WO2023001163A1 (en) * 2021-07-20 2023-01-26 华为技术有限公司 Screen refreshing method and device capable of improving dynamic effect performance

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6915401B2 (en) * 2002-03-21 2005-07-05 International Business Machines Corporation System and method for managing off-screen buffers for electronic images
EP2201523A4 (en) * 2007-09-11 2010-12-15 Smart Internet Technology Crc A system and method for capturing digital images
CN114077468A (en) * 2020-08-18 2022-02-22 华为技术有限公司 Screen window redrawing method, electronic equipment and computer-readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5289574A (en) * 1990-09-17 1994-02-22 Hewlett-Packard Company Multiple virtual screens on an "X windows" terminal
WO2021184369A1 (en) * 2020-03-20 2021-09-23 西安诺瓦星云科技股份有限公司 Screen display control method, apparatus and system
WO2023001163A1 (en) * 2021-07-20 2023-01-26 华为技术有限公司 Screen refreshing method and device capable of improving dynamic effect performance
CN114595021A (en) * 2022-03-10 2022-06-07 Oppo广东移动通信有限公司 Method and device for repairing splash screen, electronic equipment, chip and storage medium

Also Published As

Publication number Publication date
CN117076035A (en) 2023-11-17

Similar Documents

Publication Publication Date Title
EP2962191B1 (en) System and method for virtual displays
KR20130138143A (en) System and method for display mirroring
JP2007179554A (en) System and method for duplicating display screen
WO1999026228A1 (en) Method and apparatus for phase-locking a plurality of display devices and multi-level driver for use therewith
US6844879B2 (en) Drawing apparatus
CN105190701B (en) Synthesis system based on primitive and method
CN109189359B (en) Main resolution input control method and system for display equipment and storage medium
CN105741819A (en) Image layer processing method and device
EP3783491A1 (en) Video generation method and apparatus, server and storage medium
CN107608588B (en) Display layer, display method, display system and operating system
CN117076035B (en) Optimization method of screen pattern under X window system
CN113316018B (en) Method, device and storage medium for overlaying time information on video picture display
CN112114919B (en) Screen rotation display optimization method and device
JPH07271344A (en) Graphic display device
US20200410032A1 (en) Method for acquiring webpage frame, server, and storage medium
US7212220B2 (en) Auto screen centering and expansion of VGA display modes on larger size of LCD display device
TWI658443B (en) Digital signage system
EP3783505A1 (en) Webpage frame acquisition method, server and storage medium
CN113127260A (en) Display exception handling method, device, equipment and medium
US7046227B2 (en) System and method for continuously tracing transfer rectangles for image data transfers
CN113301411B (en) Video processing method, device and system and video processing equipment
CN114339338B (en) Image custom rendering method based on vehicle-mounted video and storage medium
CN112073686B (en) Image display method and device and electronic equipment
CN113126869B (en) Method and system for realizing KVM image high-speed redirection based on domestic BMC chip
CN117234446A (en) Multi-screen display method and system for vehicle-mounted device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant