CN112698874B - Method for simultaneously displaying ast display card and independent display card in kylin system - Google Patents

Method for simultaneously displaying ast display card and independent display card in kylin system Download PDF

Info

Publication number
CN112698874B
CN112698874B CN202011598588.7A CN202011598588A CN112698874B CN 112698874 B CN112698874 B CN 112698874B CN 202011598588 A CN202011598588 A CN 202011598588A CN 112698874 B CN112698874 B CN 112698874B
Authority
CN
China
Prior art keywords
ast
buf
dma
card
display card
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
CN202011598588.7A
Other languages
Chinese (zh)
Other versions
CN112698874A (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 CN202011598588.7A priority Critical patent/CN112698874B/en
Publication of CN112698874A publication Critical patent/CN112698874A/en
Application granted granted Critical
Publication of CN112698874B publication Critical patent/CN112698874B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Abstract

The invention provides a method for simultaneously displaying an ast display card and an independent display card in an kylin system, which comprises the following steps: and establishing a mechanism for accessing the dma _ buf between the kernel space and the user space, so that the image data rendered by the independent display card is sent to the ast display card for driving through the dma _ buf object and the export/import function, and is displayed and output by the ast display card. The invention realizes a channel mechanism based on RPIME on the kylin operating system, and realizes the simultaneous display output of the ast display card and the independent display card.

Description

Method for simultaneously displaying ast display card and independent display card in kylin system
Technical Field
The invention relates to the technical field of development of a server operating system, in particular to a method for simultaneously displaying different types of display cards in an kylin system.
Background
To implement the high-demand hardware platform management function, the server generally uses the BMC as a control management channel to manage the server hardware platform. In BMC, an ast graphics card is integrated, and the ast graphics card (BMC) only has a basic display function and does not have the capability of rendering complex graphic scenes. Therefore, in order to render a complex image scene, a user generally configures an independent graphics card on the server, and the independent graphics card performs image rendering and display output functions.
In general, the server only needs to display output through one display card at the same time, and when a plurality of display cards (for example, an independent display card and an integrated ast display card) exist on the server at the same time, the server can select the designated display card to complete the image rendering and display output tasks of the current application by switching the display cards according to the application needs. Chinese utility model patent CN201720134319.2 discloses a two show card auto-change over device and server based on platform of soaring. This two display card auto-change over device sets up switch, independent display card and BMC module on the mainboard of soar server, the integrated BMC board of BMC module carries the display card, and independent display card and BMC board carry the display card and pass through the switch to be connected, and independent display card and BMC board carry the display card still are connected with the display respectively. Although the patent realizes the free switching between the onboard BMC display card and the externally-inserted independent display card, the function of BMC remote management is realized while the requirement of a client on the display performance of a product is met.
In the prior art, attention is often paid to switching use of the display cards, and simultaneous display output of the integrated display card and the independent display card cannot be supported. In some application scenarios, due to the requirement of conveniently viewing and managing multiple tasks in parallel, a user sometimes connects multiple displays to one server, and each display views one task correspondingly. In such a scenario, due to the limited output interface of the independent graphics card, the output requirements of multiple displays may not be met, and often, an ast graphics card (BMC) is also required to assist in displaying the output. At this moment, what is needed is no longer the switching display output of the independent display card and the ast display card, but the simultaneous display output of the independent display card and the ast display card: after the independent display card finishes rendering the image data, the image data is transmitted to an ast display card (BMC), and the ast display card (BMC) and the independent display card simultaneously display an output image.
In a server system of a Linux kernel, a BMC is used as a control management channel in default configuration, and a basic display function is provided through an ast graphics card integrated on the BMC, but because the ast graphics card has no acceleration function, an independent graphics card needs to be configured in some scenes; when the independent display card works, the ast display card does not display and output at the moment because the image data cannot be transmitted to the BMC. Therefore, in the server system with the linux kernels of the ast graphics card (BMC) and the independent graphics card at the same time, the independent graphics card can normally display output, the ast graphics card cannot display the output, and the requirement that the ast graphics card (BMC) and the independent graphics card can not simultaneously display output cannot be met.
In summary, currently, in an operating system and a Linux open source community of a Linux kernel, no release version can support simultaneous display of an ast graphics card (BMC) and an independent graphics card. In the BMC drive, a similar PRIME mechanism is not realized, and images rendered by the independent display card can be transmitted to the AST display card integrated with the BMC to be displayed and output. Therefore, a mechanism is needed to be implemented to transmit the image rendered by the independent graphics card to the ast graphics card (BMC), so that the ast graphics card (BMC) and the independent graphics card can be output simultaneously.
Disclosure of Invention
In order to solve the technical problems, the invention aims to provide a method for simultaneously displaying an ast graphics card and an independent graphics card in an kylin system, which realizes a channel mechanism of RPIME on an kylin operating system, so that image data rendered by the independent graphics card is sent to an ast graphics card integrated with BMC through a channel, and the simultaneous display output of the ast graphics card (BMC) and the independent graphics card is realized.
In order to achieve the purpose, the invention adopts the following technical means:
a method for simultaneously displaying an ast graphics card and an independent graphics card in an kylin system comprises the steps of establishing a mechanism for accessing dma _ buf between an inner core space and a user space, enabling image data rendered by the independent graphics card to be sent to an ast graphics card driver through a dma _ buf object and an export/import function, and enabling the ast graphics card to display and output the image data.
Wherein, the method comprises the following steps:
s101: the independent display card drives a memory which is applied for sharing access in the kernel space;
s102: rendering an image by the independent display card, and writing the rendered image data into the shared memory;
s103: the independent display card driver calls a dma _ buf _ export () function to create a dma _ buf object, and mounts the shared memory into the dma _ buf object;
s104: the independent display card driver calls a dma _ buf _ fd () function to associate the created dam _ buf object with the globally visible file descriptor fd, and meanwhile, the fd is transmitted to the ast display card driver through a user space;
s105: and the ast display card driver calls the dma _ buf _ import () function to acquire the image data in the shared memory and display the output image.
Wherein, a reservation/reservation release mechanism of the dma _ buf object is set in the kylin system.
In step S103, the created dma _ buf object is mapped to the virtual address space of the kernel space.
The invention is further improved in that: sharing and accessing of the dma _ buf objects are handled using the nonce mechanism.
In S105, before the ast graphics card driver calls the dma _ buf _ import () function, xorg is used to determine whether the display area of the ast graphics card needs to be updated.
Further, when the Xorg judges that the display area of the ast graphics card needs to be updated, the ast graphics card driver acquires the dma _ buf object by calling the dma _ buf _ get (fd) function.
When the Xorg judges that the display area of the ast graphics card needs to be updated, the ast graphics card driver calls the dma _ buf _ get (fd) to acquire the dma _ buf object.
In step S104, the independent graphics card driver transmits fd to the user space by the ioctl method.
Compared with the prior art, the invention has the beneficial effects that:
the invention provides a mechanism for accessing the dma _ buf between the kernel space and the user space of the kylin system, so that the image data rendered by the independent display card can be sent to the BMC integrated ast display card through the dma _ buf subsystem, thereby realizing the simultaneous display output of the ast display card (BMC) and the independent display card.
The method comprises the steps that image data rendered by an independent display card are written into a shared memory and mounted on a dma _ buf object through a dma _ buf subsystem, the dma _ buf object is converted into a file descriptor fd serving as a transmission medium through the dma _ buf subsystem and is sent to a user space, and after the user space obtains the fd, the dma _ buf object is transmitted to a designated driving device through the fd serving as a medium, so that interaction among the driving devices is realized.
And realizing an export/import function on an independent display card driver and an ast display card driver. The independent graphics driver, as a producer, creates a dma _ buf object and imports the rendered image data into the dma _ buf object after completing the image rendering, and the dma _ buf object is converted into a file descriptor fd as a transmission medium. And the ast display card drive is used as a consumer, after receiving the fd transmitted by the user space, the corresponding dma _ buf object is acquired through the fd, and the data cached by the import in the dma _ buf object is delivered to the ast display card for display and output.
The kylin system is provided with a reservation/reservation release mechanism of the dma _ buf object, and the dma _ buf object can be reserved in a memory so as to be distributed at any time when the dma _ buf object needs to be used. After the reservation is released, the reserved memory can be recycled. The map/demap mechanism for the dma _ buf object may map the dma _ buf object to the virtual address space of the kernel space so that it may be read and written to, and unmapped from, the virtual address space when no longer needed.
When the Xorg judges that the display area of the ast display card needs to be updated, the ast display card is driven to receive the fd transmitted by the user space, the corresponding dma _ buf object is obtained through the fd, the data cached by the import in the dma _ buf object is delivered to the ast display card to update the display area needing to be updated, and therefore simultaneous display of the ast display card (BMC) and the independent display card is achieved.
The invention also has the advantages that:
(1) And the design and the realization of the simultaneous display scheme are independent design and research, so that the method has complete intellectual property.
(2) The originality of the implementation mode creatively realizes the dma _ buf access mechanism between the kernel space and the user space based on the independent display card and the ast display card, the export function driven by the independent display card and the import function driven by the ast display card (BMC) on the kylin operating system, thereby realizing the image data transmission from the independent display card to the ast display card (BMC).
(3) The method has obvious implementation effect, and the kylin operating system can well realize the simultaneous display output of the independent display card and the ast display card (BMC).
Drawings
FIG. 1 is a main data flow diagram of the data transfer from the independent graphics card to the ast graphics card (BMC) of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood by those skilled in the art, the present invention will be further described in detail with reference to the accompanying drawings and examples. Unnecessary detail and functionality of the invention may be omitted from the description so as not to obscure the understanding of the present invention.
For part of the noun explanations in the present invention, reference is made to the following:
dma _ buf: the dma _ buf is an independent subsystem in the kernel and provides a unified framework for shared caching among different devices and subsystems. The main application scenario of the method in the kernel is to support the prime mechanism in the GPU driver. As a general purpose module in the kernel, dma _ buf has a wide application range. For example, memory from camera acquisition transmitted through the pciv driver, memory internally managed by gpu, and so on. The dma buf subsystem comprises three main components, namely (1) a dma buf object, the implementation back end of which is an sg table, and an interface exposed to a user space is a file descriptor, and the sharing access to the dma buf object is realized through the transfer of the file descriptor, so that frequent copying of memory areas managed by different drivers is avoided. (2) The lancet object, when the device finishes accessing the dma _ buf object, provides a signal mechanism to notify other related devices, for example, after the independent graphics card renders an image to the dma _ buf object, the integrated graphics card needs to be notified to display the content represented by the dma _ buf; (3) A reservation object that is responsible for managing shared and mutually exclusive access to the dma _ buf object.
The PRIME mechanism: the PRIME mechanism is a buffer sharing mechanism implemented based on dma _ buf, and can efficiently display images rendered on the independent display cards on the integrated display card.
BMC: the baseboard management controller is an independent system, does not depend on other hardware (such as a CPU, a memory and the like) on the system, does not depend on a BIOS (basic input/output System), an OS (operating System) and the like, can provide a platform management function, and can facilitate the remote management, monitoring, installation, restart and other operations of a server.
ast display card (BMC): the BMC is generally used as a control management channel for managing a server hardware platform, an ast display card with a basic display function is arranged in the BMC, and the card is generally integrated into the BMC. The ast display card (bmc) is an own ast display card in the bmc, and only has a basic display function and does not have the capability of rendering complex graphic scenes.
Xorg: xorg is an implementation of X11, which provides an X Server. The X Server is a graph rendering Server and is responsible for executing the graph rendering request of the X client and simultaneously feeding back the keyboard and mouse operations of the user and the like to the X client.
As shown in figure 1, the invention provides a method for simultaneously displaying an ast graphics card and an independent graphics card in an kylin system, which comprises the step of establishing a mechanism for accessing dma _ buf between a kernel space and a user space, so that image data rendered by the independent graphics card is sent to an ast graphics card driver through a dma _ buf object and an export/import function, and is displayed and output by the ast graphics card.
In order to realize the image data transmission from the independent display card to the ast display card (BMC), the invention writes the image data rendered by the independent display card into the shared memory through the dma _ buf subsystem and mounts the image data onto the dma _ buf object, transmits the image data to the ast display card drive through the dma _ buf object and the export/import mechanism, and updates the display area through the ast display card drive. The mechanism for implementing the invention specifically comprises:
(1) A mechanism is set up to access the dma _ buf between the kernel space and the user space. Converting the handle of the dma _ buf object in the kernel space into a file descriptor fd accessible to a user space, and transmitting the file descriptor fd to the user space, wherein after the user space obtains the fd, the dma _ buf object is transmitted to a designated driving device through the fd as a medium, so that interaction among the driving devices is realized;
(2) And realizing an export/import mechanism on an independent display card driver and an ast display card driver. The independent graphics card driver serves as a producer, and after image rendering is completed, a dma _ buf object is created and rendered image data is exported into the dma _ buf object, and the dma _ buf object is converted into a file descriptor fd serving as a transmission medium. The ast display card is driven as a consumer, after the fd transmitted from the user space is received, the corresponding dma _ buf object is obtained through the fd, and the cached data from the import in the dma _ buf object is transmitted to the ast display card for display and output;
(3) The mapping/demapping mechanism for the dma _ buf object is set. The mechanism can map the dma _ buf objects to the virtual address space of the kernel space so that they can be read and written, and can also unmap them from the virtual address space of the kernel space when they are no longer needed;
(4) The reservation/unreserve mechanism for the dma buf object is set in the kylin system. The dma _ buf objects may be reserved in memory space so as to be available for allocation at any time when needed for use. After the reservation is released, the reserved memory space can be recycled;
(5) Processing shared and exclusive access of the dma _ buf object;
(6) A method for judging whether the display area of the ast display card needs to be updated is set. And if the update is needed, acquiring the dma _ buf object of the ast driver import and updating the area needing the update.
The method for simultaneously displaying the ast display card and the independent display card in the kylin system comprises the following steps:
s101: and the independent display card drives a memory which is applied for sharing access in the kernel space.
S102: the independent display card renders an image, and the rendered image data is written into the shared memory through the dma _ buf subsystem.
S103: the independent graphics driver invokes the dma _ buf _ export () function to create a dma _ buf object, which maps into the virtual address space of the kernel space, and mounts the shared memory into the dma _ buf object.
The dma _ buf objects are mapped to the virtual address space of the kernel space so that they can be read and written, and can be unmapped from the virtual address space of the kernel space when no longer needed. In the embodiment, a reservation/reservation release mechanism of the dma _ buf object is set in the kylin system, so that the distribution is convenient. Thus, the dma _ buf objects can be reserved in the memory so as to be distributed at any time when needed; after the reservation is released, the reserved memory can be recycled.
S104: the independent display card driver calls a dma _ buf _ fd () function to associate the created dam _ buf object with the globally visible file descriptor fd, and meanwhile, the fd is transmitted to the user space through an ioctl method, and then the user space transmits the fd to the ast display card driver;
s105: and judging whether the display area of the ast display card needs to be updated or not by using the Xorg, and calling the dma _ buf _ get (fd) by the drive of the ast display card to acquire the dma _ buf object when the Xorg judges that the display area of the ast display card needs to be updated.
And then, the ast display card driver calls the dma _ buf _ import () function to acquire the image data in the shared memory, display the output image and update the display area.
In this embodiment, sharing and accessing of the dma _ buf object is handled using the nonce mechanism.
The above is only a preferred embodiment of the present invention, and is used to help understand the method and its core idea of the present invention. Based on the embodiments of the present invention, those skilled in the art can make modifications without creative efforts, which fall within the protection scope of the present invention.

Claims (5)

1. A method for simultaneously displaying an ast display card and an independent display card in an kylin system is characterized by comprising the following steps: establishing a mechanism for accessing dma _ buf between the kernel space and the user space, so that image data rendered by the independent display card is sent to the ast display card for driving through a dma _ buf object and an export/import function, and is displayed and output by the ast display card;
s101: the independent display card drives a memory which is applied for sharing access in the kernel space;
s102: rendering an image by the independent display card, and writing the rendered image data into the shared memory;
s103: the independent display card driver calls a dma _ buf _ export () function to create a dma _ buf object, and mounts the shared memory into the dma _ buf object;
s104: the independent display card driver calls a dma _ buf _ fd () function to associate the created dam _ buf object with the globally visible file descriptor fd, and meanwhile, the fd is transmitted to the ast display card driver through the user space;
s105: the ast display card drives and calls a dma _ buf _ import () function to acquire image data in the shared memory and display an output image;
in S105, before the ast graphics card drives and calls the dma _ buf _ import () function, xorg is used for judging whether the display area of the ast graphics card needs to be updated;
when the Xorg judges that the display area of the ast display card needs to be updated, the ast display card driver calls the dma _ buf _ get (fd) to obtain the dma _ buf object.
2. The method for simultaneously displaying the ast graphics card and the independent graphics card in the kylin system as claimed in claim 1, wherein: the reservation/unreserve mechanism for the dma buf object is set in the kylin system.
3. The method of claim 1, wherein the ast graphics card and the independent graphics card are displayed simultaneously in the kylin system, and the method comprises: in step S103, the created dma _ buf object is mapped to the virtual address space of the kernel space.
4. The method of claim 3, in which the ast graphic card and the independent graphic card are displayed simultaneously in the kylin system, wherein: sharing and access of the dma _ buf objects is handled using the nonce mechanism.
5. The method of claim 1, wherein the ast graphics card and the independent graphics card are displayed simultaneously in the kylin system, and the method comprises: in step S104, the independent graphics card driver transmits fd to the user space by the ioctl method.
CN202011598588.7A 2020-12-29 2020-12-29 Method for simultaneously displaying ast display card and independent display card in kylin system Active CN112698874B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011598588.7A CN112698874B (en) 2020-12-29 2020-12-29 Method for simultaneously displaying ast display card and independent display card in kylin system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011598588.7A CN112698874B (en) 2020-12-29 2020-12-29 Method for simultaneously displaying ast display card and independent display card in kylin system

Publications (2)

Publication Number Publication Date
CN112698874A CN112698874A (en) 2021-04-23
CN112698874B true CN112698874B (en) 2022-12-09

Family

ID=75511972

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011598588.7A Active CN112698874B (en) 2020-12-29 2020-12-29 Method for simultaneously displaying ast display card and independent display card in kylin system

Country Status (1)

Country Link
CN (1) CN112698874B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708002A (en) * 2012-05-15 2012-10-03 曙光信息产业(北京)有限公司 Display management method of video card in baseboard management controller (BMC) s, and server
CN109408407A (en) * 2018-10-19 2019-03-01 龙芯中科技术有限公司 The distribution method and device of display memory
CN111142951A (en) * 2019-12-27 2020-05-12 中国电子科技集团公司第十五研究所 Double-independent-display-card synchronous display device and method of Feiteng platform
CN111240631A (en) * 2020-02-20 2020-06-05 湖南麒麟信安科技有限公司 Method and system for virtually transmitting Linux virtual machine screen picture based on AMD display card

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880587B (en) * 2012-10-09 2014-12-24 无锡江南计算技术研究所 Embedded accelerating core based independent graphics card architecture
CN104572509B (en) * 2014-12-26 2017-11-07 中国电子科技集团公司第十五研究所 A kind of method that the distribution of display card video memory is realized in Godson calculating platform
CN105094895B (en) * 2015-06-30 2019-02-12 珠海豹趣科技有限公司 A kind of method and device for installing more video drivers
CN206515811U (en) * 2017-02-15 2017-09-22 湖南长城银河科技有限公司 A kind of double video card switching devices and server based on platform of soaring
CN111158625A (en) * 2019-12-31 2020-05-15 中国电子科技集团公司第十五研究所 Double-independent display card dynamic switching device and method based on Feiteng platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708002A (en) * 2012-05-15 2012-10-03 曙光信息产业(北京)有限公司 Display management method of video card in baseboard management controller (BMC) s, and server
CN109408407A (en) * 2018-10-19 2019-03-01 龙芯中科技术有限公司 The distribution method and device of display memory
CN111142951A (en) * 2019-12-27 2020-05-12 中国电子科技集团公司第十五研究所 Double-independent-display-card synchronous display device and method of Feiteng platform
CN111240631A (en) * 2020-02-20 2020-06-05 湖南麒麟信安科技有限公司 Method and system for virtually transmitting Linux virtual machine screen picture based on AMD display card

Also Published As

Publication number Publication date
CN112698874A (en) 2021-04-23

Similar Documents

Publication Publication Date Title
CN103034524B (en) Half virtualized virtual GPU
RU2445705C2 (en) Method of preparing data display in servers (versions) and machine-readable medium
US6710753B2 (en) Multi-screen session mobility between terminal groups
CA2933712C (en) Resource processing method, operating system, and device
US8126993B2 (en) System, method, and computer program product for communicating sub-device state information
US20080077917A1 (en) Virtual machine system and a method for sharing a graphics card amongst virtual machines
EP3627319B1 (en) Display resource scheduling method and device for embedded system
JP2013542515A (en) Redirection between different environments
US20120110272A1 (en) Cross process memory management
CN102063242A (en) Display system and display method
US10558496B2 (en) Techniques for accessing a graphical processing unit memory by an application
CN114741044A (en) Cross-operating environment display output sharing method based on heterogeneous rendering
US20220050795A1 (en) Data processing method, apparatus, and device
CN113419845A (en) Calculation acceleration method and device, calculation system, electronic equipment and computer readable storage medium
EP3605327B1 (en) Method and apparatus for capturing screenshots of guest operating system in computer device
CN116774933A (en) Virtualization processing method of storage device, bridging device, system and medium
CN115309511A (en) Xen-based data interaction method and device, storage medium and electronic equipment
CN116010296A (en) Method, device and system for processing request
CN112698874B (en) Method for simultaneously displaying ast display card and independent display card in kylin system
US10733689B2 (en) Data processing
US9984652B2 (en) Topology and bandwidth management for IO and inbound AV
US7930445B2 (en) Computer system using remote I/O and I/O data transfer method
CN103678244A (en) Intelligent device without application processor
GB2519640A (en) Topology and bandwidth management for IO and inbound AV
CN117312229B (en) Data transmission device, data processing equipment, system, method and medium

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