Disclosure of Invention
The technical problem to be solved by the application is how to enable each virtual machine to be displayed by using a screen of a terminal device, and the display control method and the display control device are provided.
In a first aspect, an embodiment of the present application provides a display control method, which is applied to a terminal device installed with multiple virtual machines, and the method includes:
acquiring frame buffer information of a physical display card of the terminal equipment;
dividing the frame buffer of the physical display card according to the frame buffer information of the physical display card to obtain frame buffer information corresponding to each virtual machine in the plurality of virtual machines; the frame buffer information corresponding to the first virtual machine is used for displaying on a screen display area corresponding to the frame buffer information corresponding to the first virtual machine by the first virtual machine; the first virtual machine is any one of the virtual machines.
Optionally, the dividing, according to the frame buffer information of the physical graphics card, the frame buffer of the physical graphics card includes:
and dividing the frame buffer of the physical display card according to the number of the virtual machines installed on the terminal equipment and the frame buffer information of the physical display card, so that the sizes of the screen display areas corresponding to the plurality of divided frame buffer information are the same, and the screen display areas corresponding to the plurality of divided frame buffer information are not overlapped.
Optionally, the dividing the frame buffer of the physical graphics card according to the frame buffer information of the physical graphics card includes:
and acquiring a frame buffer division configuration file, dividing the frame buffer of the physical display card according to the frame buffer division configuration file, and generating the frame buffer division configuration file according to the frame buffer information of the physical display card.
Optionally, the frame buffer partitioning configuration file includes one of the following partitioning policies:
a symmetric equal division strategy, an asymmetric non-overlapping division strategy, a partial overlapping division strategy and a full overlapping division strategy.
Optionally, the frame buffer information includes:
base address, number of pixels per scan line, horizontal resolution, vertical resolution, and pixel format.
In a second aspect, an embodiment of the present application provides a display control apparatus, which is applied to a terminal device installed with multiple virtual machines, where the apparatus includes:
the acquisition unit is used for acquiring frame buffer information of a physical display card of the terminal equipment;
the dividing unit is used for dividing the frame buffer of the physical display card according to the frame buffer information of the physical display card to obtain frame buffer information corresponding to each virtual machine in the plurality of virtual machines;
the frame buffer information corresponding to the first virtual machine is used for displaying on a screen display area corresponding to the frame buffer information corresponding to the first virtual machine by the first virtual machine; the first virtual machine is any one of the virtual machines.
Optionally, the dividing unit is specifically configured to:
dividing the frame buffer of the physical display card according to the number of the virtual machines installed on the terminal equipment and the frame buffer information of the physical display card to obtain the frame buffer information corresponding to each virtual machine in the plurality of virtual machines; the screen display areas corresponding to the plurality of divided frame buffer information are the same in size, and the screen display areas corresponding to the plurality of divided frame buffer information are not overlapped.
Optionally, the dividing unit is specifically configured to:
acquiring a frame buffer division configuration file, and dividing the frame buffer of the physical display card according to the frame buffer division configuration file to obtain frame buffer information corresponding to each virtual machine in the plurality of virtual machines; and the frame buffer division configuration file is generated according to the frame buffer information of the physical display card.
Optionally, the frame buffer partitioning configuration file includes one of the following partitioning policies:
a symmetric equal partition strategy, an asymmetric non-overlapping partition strategy, a partially overlapping partition strategy, and a fully overlapping partition strategy.
Optionally, the frame buffer information includes:
base address, number of pixels per scan line, horizontal resolution, vertical resolution, and pixel format.
In a third aspect, an embodiment of the present application provides a terminal device, where the terminal device includes: a processor and a memory;
the memory to store instructions;
the processor is configured to execute the instructions in the memory to perform the display control method according to any one of the above first aspects.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where instructions are stored, and when the instructions are executed on a terminal device, the instructions cause the terminal device to execute the display control method according to any one of the above first aspects.
Compared with the prior art, the embodiment of the application has the following advantages:
the embodiment of the application provides a display control method and a display control device, for a terminal device provided with a plurality of virtual machines, as the screen display of the terminal device is driven by a physical display card on the terminal device, and one storage unit in a frame buffer of the physical display card of the terminal device corresponds to one pixel on the screen of the terminal device. Therefore, in the embodiment of the present application, the frame buffer information of the physical graphics card of the terminal device may be obtained, and the frame buffer of the physical graphics card is divided according to the frame buffer information of the physical graphics card, so as to obtain the frame buffer information corresponding to each of the plurality of virtual machines. It is understood that each frame buffer information obtained by dividing may correspond to a screen display area on the screen. Because each virtual machine has frame buffer information corresponding to the virtual machine, namely each virtual machine has a corresponding screen display area. Therefore, the first virtual machine, which is any one of the plurality of virtual machines, can be displayed according to the screen display area corresponding to the frame buffer information corresponding to the first virtual machine. Therefore, by the scheme provided by the embodiment of the application, each virtual machine can be displayed by using the screen of the terminal equipment.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. The inventor of the present application has found, through research, that in the conventional technology, when the number of virtual machines installed on a terminal device is multiple, a physical graphics card of the terminal device may be allocated to one of the multiple virtual machines, where the one virtual machine drives a screen of the terminal device to display by using the physical graphics card, and other virtual machines cannot display by using the screen of the terminal device at any time because the other virtual machines are not allocated with the physical graphics card of the terminal device. In practical applications, each virtual machine installed on the terminal device may have a screen usage requirement, because a user generally needs to use the screen of the terminal device for displaying when using the virtual machine. Therefore, when a plurality of virtual machines are installed on the terminal device, how to enable each virtual machine to be displayed by using the screen of the terminal device is a problem that needs to be solved urgently at present.
In order to solve the above problem, embodiments of the present application provide a display control method and apparatus, where each virtual machine may use a screen of a terminal device to perform display.
Various non-limiting embodiments of the present application are described in detail below with reference to the accompanying drawings.
Exemplary method
It should be noted that, in practical application, the screen of the terminal device may be driven by the physical display card of the terminal device to display. Specifically, a frame buffer (english: frame buffer) of a physical graphics card includes a plurality of storage units, where one storage unit corresponds to one address in a memory. In other words, the frame buffer of the physical graphics card occupies an address range in the memory. One storage unit in the frame buffer of the physical graphics card corresponds to one pixel on the screen of the terminal device, in other words, the frame buffer of the physical graphics card corresponds to the whole screen of the terminal device. And writing data in a certain format into the frame buffer of the physical display card, so that corresponding content can be output on a screen of the terminal equipment.
Therefore, in the embodiment of the present application, frame buffer information of a physical graphics card of a terminal device may be obtained first, and then the frame buffer information is divided, and corresponding frame buffer information is determined for each of a plurality of virtual machines installed on the terminal device. The following describes a display control method provided in an embodiment of the present application with reference to the drawings.
For convenience of understanding, an application scenario of the embodiment of the present application is first described. Reference may be made to fig. 1, which is a schematic diagram of an exemplary application scenario provided in an embodiment of the present application.
Fig. 1 shows aterminal device 100 provided with multiple virtual machines according to an embodiment of the present application, where theterminal device 100 shown in fig. 1 includes a hardware portion and a software portion. The hardware part comprises ascreen 101 and aphysical display card 102, and thephysical display card 102 can be used for driving thescreen 101 to display. The software portion includes a virtual machine monitor (English: hypervisor)layer 103 and a client (English: guest)layer 104. The Hypervisor of the Hypervisor layer may be used to establish software, hardware, or firmware in the process of executing the virtual machine, for example, the Hypervisor may interact with the physical graphics card and perform corresponding processing, so that the virtual machine can call resources of the physical graphics card. The plurality of virtual machines installed on theterminal device 100 are located at theguest layer 104, and the plurality of virtual machines may call their own operating systems at theguest layer 104, so as to implement corresponding functions, for example, to implement displaying corresponding contents on thescreen 101.
Next, a display control method provided in an embodiment of the present application will be described.
Referring to fig. 2, the figure is a schematic flow chart of a display control method according to an embodiment of the present application.
The display control method provided in the embodiment of the present application may be executed by a terminal device installed with a plurality of virtual machines, specifically, may be executed by a Hypervisor on the terminal device installed with the plurality of virtual machines, that is, may be executed by the Hypervisor located in theHypervisor layer 103 shown in fig. 1.
The display control method provided in the embodiment of the present application can be implemented, for example, by the following steps S201 to S202.
S201: frame buffer information of a physical display card of the terminal equipment is obtained.
The embodiment of the present application does not specifically limit a specific implementation manner of obtaining the frame buffer information of the physical graphics card, and as an example, the frame buffer information of the physical graphics card may be obtained by reading a configuration file of the physical graphics card of the terminal device.
In this embodiment of the application, the frame buffer information may be understood as information required for displaying on a screen of a physical graphics card driving terminal device. In this embodiment of the present application, the frame buffer information may include: base address, number of pixels per scan line, horizontal resolution, vertical resolution, and pixel format.
Wherein: the base address comprises a starting address and an address length of the frame buffer, and the number of pixels on the screen of the terminal equipment corresponding to the frame buffer can be determined through the base address. The number of pixels per scanning line refers to the number of pixels through which the scanning line passes when scanning from left to right on the screen of the terminal device. The number of pixels per scanning line may also be understood as the number of pixels included in the width of the screen display area corresponding to the frame buffer. The horizontal resolution refers to the number of pixels included in the width corresponding to the screen display area corresponding to the frame buffer. The vertical resolution refers to the number of pixels included in a screen display area corresponding to the frame buffer. The pixel format refers to a data format which supports display in a screen display area corresponding to the frame buffer.
S202: dividing the frame buffer of the physical display card according to the frame buffer information of the physical display card to obtain frame buffer information corresponding to each virtual machine in the plurality of virtual machines; the frame buffer information corresponding to the first virtual machine is used for displaying on a screen display area corresponding to the frame buffer information corresponding to the first virtual machine by the first virtual machine; the first virtual machine is any one of the plurality of virtual machines.
After the frame buffer information of the physical display card is acquired, the frame buffer of the physical display card can be divided to obtain the frame buffer information corresponding to each virtual machine in the plurality of virtual machines. It can be understood that the divided frame buffer information corresponding to each of the plurality of virtual machines respectively corresponds to one display area on the screen of the terminal device.
For convenience of description, in the following embodiments, "any one of the plurality of virtual machines" will be referred to as a "first virtual machine". For the first virtual machine, after the first virtual machine has the corresponding frame buffer information, the frame buffer information can be displayed in the screen display area corresponding to the frame buffer information corresponding to the first virtual machine.
The embodiment of the application does not specifically limit the specific implementation manner of dividing the frame buffer of the physical graphics card according to the frame buffer information of the physical graphics card, as long as the corresponding frame buffer information can be determined for each virtual machine, and the specific implementation manner of dividing the frame buffer of the physical graphics card can be determined according to actual conditions.
As can be seen from the above description, with the display control method provided in the embodiment of the present application, each virtual machine can perform display operation using the screen of the terminal device.
The embodiment of the present application does not specifically limit the execution timing of the display control method shown in fig. 2. As an example, if the time difference between the installation of the plurality of virtual machines by the user is small, that is, the user installs the plurality of virtual machines on the terminal device within a certain time (for example, one hour), the method shown in fig. 2 may be executed at a preset time after the user installs the plurality of virtual machines on the terminal device. The preset time is not particularly limited in the embodiments of the present application, and the preset time may be, for example, 5 minutes.
In addition, it is considered that in practical applications, there may be a certain time difference between the times when the user installs multiple virtual machines on the terminal device, for example, the user installs a virtual machine No. one and a virtual machine No. two on the terminal device one week later, and installs a virtual machine No. three on the terminal device. In this case, the display control method shown in fig. 1 may be executed after the terminal device detects that a new virtual machine, i.e., virtual machine No. three, is installed. For this situation, if the frame buffer information corresponding to the first virtual machine is changed after the frame buffer of the physical graphics card is divided, the virtual machine monitor may send a frame buffer update message to the first virtual machine, so that the first virtual machine displays the screen display area corresponding to the frame buffer information obtained through reallocation. Similarly, if the frame buffer information corresponding to the second virtual machine is changed after the frame buffer of the physical graphics card is divided, the virtual machine monitor may send a frame buffer update message to the second virtual machine, so that the second virtual machine displays the screen display area corresponding to the frame buffer information obtained through reallocation.
Of course, the display control method shown in fig. 2 may also be executed at other times, and is not described in detail here.
Two specific implementation manners of dividing the frame buffer of the physical graphics card according to the frame buffer information of the physical graphics card are described below.
In an implementation manner of the embodiment of the present application, it is considered that in practical applications, there may be a need for each virtual machine installed on the terminal device to simultaneously use a screen of the terminal device for displaying. Therefore, in an implementation manner of the embodiment of the present application, the frame buffer of the physical graphics card may be divided according to the number of virtual machines installed on the terminal device and the frame buffer information of the physical graphics card, so that the screen display areas corresponding to the plurality of divided frame buffer information are the same in size, and the screen display areas corresponding to the plurality of divided frame buffer information are not overlapped. In other words, if the number of the virtual machines installed on the terminal device is a first number, the screen corresponding to the frame buffer (i.e., the entire screen of the terminal device) is symmetrically and equally divided into a first number of screen display areas according to the frame buffer information of the physical graphics card, the screen display areas in the first number of screen display areas are all the same in size, and the first number of screen display areas are not overlapped with each other. And one divided screen display area corresponding to one virtual machine.
It should be noted that, in the concrete implementation, "the screen corresponding to the frame buffer is symmetrically and equally divided into the first number of screen display areas according to the frame buffer information of the physical graphics card, the size of each screen display area in the first number of screen display areas is the same, and the first number of screen display areas are not overlapped with each other," for example, the address range occupied by the frame buffer of the physical graphics card is averagely divided into the first number of parts, and then, for each divided frame buffer, the address range occupied by the frame buffer is obtained based on the division, and the frame buffer information corresponding to the divided frame buffer is determined. Specifically, it can be understood in conjunction with table 1 below. Table 1 shows frame buffer information of the physical graphics card and 4 frame buffer information obtained by the division. Of course, table 1 is shown only for convenience of understanding and does not constitute a limitation on the embodiments of the present application.
TABLE 1
As can be seen from table 1, the frame buffer base address of the physical graphics card is 0, the horizontal resolution is 8, the vertical resolution is 8, and the number of pixels per scan line is 8, which is equal to the horizontal resolution of the physical graphics card. And determining the address range corresponding to the frame buffer of the physical display card to be 0-63 according to thebase address 0 and the horizontal resolution and the vertical resolution. In table 1, the frame buffer of the physical graphics card is divided into 4 equal parts by symmetric division. The frame buffer address range corresponding to the screen display area corresponding to each virtual machine can be determined according to the corresponding base address, horizontal resolution and vertical resolution. Specifically, it can be understood by referring to fig. 3, where fig. 3 is a schematic diagram of a mapping relationship between a frame buffer of a physical graphics card and a screen pixel provided in an embodiment of the present application. As can be seen from fig. 3, the screen display areas corresponding to the four divided frame buffer information are the same in size. Specifically, the method comprises the following steps:
the base address corresponding to the first virtual machine is 0, the horizontal resolution and the vertical resolution are both 4, and the corresponding frame buffer address ranges can be determined to be 0-3, 8-11, 16-19 and 24-27 according to thebase address 0, the horizontal resolution and the vertical resolution. Based on the mapping relationship between the frame buffer and the screen pixel points shown in fig. 3, the screen display area corresponding to the first virtual machine can be determined to be the display area corresponding to the upper left corner of the screen.
Similarly, the base address corresponding to the second virtual machine is 4, the horizontal resolution and the vertical resolution are both 4, and according to thebase address 4, the horizontal resolution and the vertical resolution, and the mapping relationship between the frame buffer and the screen pixel point, the screen display area corresponding to the second virtual machine can be determined to be the display area corresponding to the upper right corner of the screen.
Similarly, the base address corresponding to the virtual machine three is 32, the horizontal resolution and the vertical resolution are both 4, and according to thebase address 4, the horizontal resolution and the vertical resolution, and the mapping relationship between the frame buffer and the screen pixel points, the screen display area corresponding to the virtual machine three can be determined to be the display area corresponding to the lower left corner of the screen.
Similarly, the base address corresponding to the fourth virtual machine is 36, the horizontal resolution and the vertical resolution are both 4, and according to thebase address 4, the horizontal resolution and the vertical resolution, and the mapping relationship between the frame buffer and the screen pixel point, the screen display area corresponding to the fourth virtual machine can be determined to be the display area corresponding to the lower right corner of the screen.
It should be noted that table 1 and fig. 3 are only shown for convenience of understanding, in practical applications, the frame buffer information of the physical graphics card is not necessarily shown in table 1, for example, in practical applications, the base address of the physical graphics card may be, for example, 0xE0000000, the number of pixels per scan line may be, for example, 1920, the horizontal resolution may be, for example, 1920, the vertical resolution may be, for example, 1080, the pixel format is 32 bits RGB color, and the like, which are not described herein in a list.
Therefore, by adopting the frame buffer division mode, even if the virtual machines installed on the terminal equipment display by using the screen of the terminal equipment at the same time, because the screen display areas corresponding to the virtual machines are not overlapped, the contents displayed on the screen by the virtual machines are not overlapped, and the use experience of a user is better.
In another implementation manner of the embodiment of the present application, the frame buffer of the physical graphics card may be further divided by a frame buffer division configuration file. Specifically, after frame buffer information of a physical graphics card of the terminal device is acquired, a frame buffer division configuration file may be generated based on the frame buffer information of the physical graphics card, and then the frame buffer of the physical graphics card may be divided based on the frame buffer division configuration file.
The embodiments of the present application do not specifically limit the content included in the frame buffer dividing configuration file, and as an example, the frame buffer configuration file may include frame buffer information corresponding to each virtual machine, so that after the frame buffer configuration file is obtained, frame buffer information corresponding to each virtual machine in a plurality of virtual machines may be obtained according to the frame buffer dividing configuration file.
In this embodiment of the present application, the frame buffer division configuration file may embody a division policy followed by dividing the frame buffer of the physical graphics card. The partitioning policy is not specifically limited in the embodiment of the present application, and as an example, the partitioning policy may include any one of a symmetric partition policy, an asymmetric non-overlapping partition policy, a partially overlapping partition policy, and a completely overlapping partition policy.
Wherein:
the symmetrical equal division strategy means that the screen display areas corresponding to the plurality of divided frame buffer information have the same size, and the screen display areas corresponding to the plurality of divided frame buffer information do not overlap.
The asymmetric non-overlapping division strategy means that at least two screen display areas have different sizes and the screen display areas corresponding to the plurality of divided frame buffer information are not overlapped in the screen display areas corresponding to the plurality of divided frame buffer information.
The partial overlap division strategy refers to that in screen display areas corresponding to a plurality of frame buffer information obtained by division, a partial overlap area can exist between any two screen display areas, but any two screen display areas are not completely overlapped (namely, the screen display areas corresponding to two virtual machines are not identical).
The completely overlapping division strategy means that the screen display areas corresponding to the plurality of frame buffer information obtained by division are the same, namely the screen display areas corresponding to the plurality of virtual machines are the same screen display area. In the embodiment of the present application, the screen display area corresponding to each virtual machine obtained by dividing by using the completely overlapping division policy may be the whole screen of the terminal device or a partial area in the whole screen of the terminal device, and the embodiment of the present application is not particularly limited.
It can be understood that, for the symmetric halving partition strategy and the asymmetric non-overlapping partition strategy, each virtual machine may use the screen of the terminal device to display at the same time, and the display contents corresponding to each virtual machine do not overlap. For the partial overlap division strategy, if a partial overlap region exists between screen display regions corresponding to two virtual machines, if the time for the two virtual machines to display using the screen of the terminal device is controlled, so that the two virtual machines do not display using the screen of the terminal device at the same time, the two virtual machines can both display using the screen of the terminal device normally, and the user cannot be influenced to view the contents displayed on the terminal device by the two virtual machines. Similarly, for the completely overlapping division strategy, as long as only one virtual machine uses the screen of the terminal device to display at the same time, each virtual machine can normally use the screen of the terminal device to display, and the user can not be influenced to view the content displayed by each virtual machine on the terminal device.
It should be noted that, in consideration of that, in an actual application, a user is familiar with a situation that a screen of a terminal device used by each virtual machine is displayed, in order to reasonably use screen resources of the terminal device, in an embodiment of the present application, the foregoing division policy may be determined by the user according to an actual situation. For example, when the user determines that the possibility that each virtual machine uses the screen of the terminal device for displaying at the same time is not very high, the partitioning policy may be determined as a completely overlapping partitioning policy; for another example, when the user determines that the possibility that each virtual machine uses the screen of the terminal device to display at the same time is relatively high, the partition strategy may be determined as a symmetric equally-divided partition strategy or an asymmetric non-overlapping equally-divided partition strategy; for another example, when the user determines that the possibility that two virtual machines both use the screen of the terminal device to display at the same time is not high, the partition policy may be determined as a partial overlapping partition equal partition policy; and so on. Then, the virtual machine monitor obtains the partition policy determined by the user, for example, the virtual machine monitor obtains the partition policy input by the user on the terminal device, and generates a frame buffer partition configuration file based on the partition policy and the frame buffer information of the physical display card.
It should be noted that, in this embodiment of the present application, when a user inputs a partitioning policy on a terminal device, a partitioning constraint condition corresponding to the partitioning policy may also be input, and then, a virtual machine monitor may generate the frame buffer partitioning configuration file based on the partitioning constraint condition corresponding to the partitioning policy and frame buffer information of the physical graphics card.
The embodiment of the present application does not specifically limit the partitioning constraint condition, where the partitioning constraint condition is used to enable the virtual machine monitor to determine a partitioning result of the frame buffer of the physical graphics card. With respect to the partitioning constraint, there are now exemplified: for example, when the partitioning policy is a partial overlap partitioning policy, the partitioning constraint condition input by the user on the terminal device may be, for example, the size of an overlap area of screen display areas corresponding to the two virtual machines, and the like. For another example, when the partitioning policy is an asymmetric non-overlapping partitioning policy, the partitioning constraint condition input by the user on the terminal device may be, for example, a ratio between screen display areas corresponding to the respective virtual machines. For another example, when the partitioning policy is a completely overlapping partitioning policy, the partitioning constraint condition input by the user on the terminal device may be, for example, a ratio between a screen display area corresponding to each virtual machine and a screen of the terminal device. For another example, when the partitioning policy is a symmetric partition policy, the partitioning constraint condition input by the user on the terminal device may be, for example, the number of virtual machines installed on the terminal device.
The following describes an implementation manner of "the first virtual machine controls a screen display area corresponding to frame buffer information corresponding to the first virtual machine to display".
As before, the screen of the terminal device may be driven by the physical display card of the terminal device to display. In this embodiment, the virtual machine monitor may create, for the first virtual machine, a virtual graphics card corresponding to the first virtual machine, and when the first virtual machine detects the virtual graphics card, may obtain frame buffer information corresponding to the first virtual machine, and create a virtual graphics card driver based on the frame buffer information corresponding to the first virtual machine. After the virtual graphics card driver is created, the first virtual machine can control the screen display area corresponding to the frame buffer information corresponding to the first virtual machine to display based on the virtual graphics card driver.
In practical application, when creating a virtual graphics card corresponding to a first virtual machine, a virtual monitor may use frame buffer information corresponding to the first virtual machine and configuration parameters corresponding to the virtual graphics card to create, or may use only configuration parameters corresponding to the virtual graphics card to create, which is not specifically limited in the embodiment of the present application.
The configuration parameters corresponding to the virtual graphics card are not specifically limited in the embodiments of the present application, and the configuration parameters corresponding to the virtual graphics card may include, for example, a pixel bit width, a mode number, an Original Equipment Manufacturer (OEM) product name, device state information, a pixel clock, a refresh rate, and the like. The pixel bit width refers to the number of bits occupied by each pixel data; the mode number is used for describing the display mode of the virtual display card, for example, the resolution of a screen display area is determined by the mode number supported by the virtual display card; the OEM product name is used to describe information of the manufacturer of the virtual graphics card, such as: manufacturer name, graphics card model number, etc. The device state information is used for indicating whether the function of the virtual display card is started or not. In the embodiment of the application, the function of displaying the screen of the virtual display card driving terminal device is started. The frequency of the pixel clock is related to the resolution of the screen display area, and the higher the resolution of the screen display area is, the higher the frequency of the pixel clock is. The refresh rate refers to the number of times the electron beam repeatedly scans an image displayed on the screen display area, and the higher the refresh rate, the better the stability of the displayed image. It should be noted that the configuration parameters corresponding to the virtual graphics card may be determined according to the configuration parameters of the physical graphics card.
It should be noted that, if the virtual graphics card is created by using frame buffer information corresponding to the first virtual machine and configuration parameters corresponding to the virtual graphics card, the frame buffer information corresponding to the first virtual machine is stored in a memory space corresponding to the first virtual machine, and the first virtual machine can directly obtain the frame buffer information corresponding to the first virtual machine from its own memory space, and create a virtual graphics card drive based on the frame buffer information corresponding to the first virtual machine. If the virtual graphics card is created by using the configuration parameters corresponding to the virtual graphics card, the frame buffer information corresponding to the first virtual machine may be stored in the memory space corresponding to the virtual machine monitor. For this case, the first virtual machine may send a frame buffer information acquisition request to the virtual machine monitor; the virtual machine monitor determines frame buffering information corresponding to the first virtual machine according to the frame buffering information acquisition request, and sends the frame buffering information corresponding to the first virtual machine; then, the first virtual machine can create a virtual graphics card driver based on the frame buffer information corresponding to the first virtual machine.
The display control method provided by the embodiment of the present application is introduced above, and the display control method provided by the embodiment of the present application is introduced below with reference to a specific scenario.
Referring to fig. 4, a schematic diagram of another exemplary scenario provided in the embodiment of the present application is shown. As shown in fig. 4, theterminal device 100 is installed with 3 virtual machines, each of the three virtual machines has a corresponding virtual system, and each of thevirtual systems 1041, 1042, and 1043 shown in fig. 4 is located in theguest layer 104 of theterminal device 100.
As shown in fig. 4, theHypervisor layer 103 has a frame bufferdevice service module 1031, and the frame bufferdevice service module 1031 may obtain frame buffer information of thephysical graphics card 102, divide the frame buffer information of thephysical graphics card 102 into 3 parts, and obtain three parts of frame buffer information, which areframe buffer information 1021, 1022, and 1023, respectively. Theframe buffer information 1021 corresponds to thevirtual system 1041, theframe buffer information 1022 corresponds to thevirtual system 1042, and theframe buffer information 1023 corresponds to thevirtual system 1043. Each virtual system in theguest layer 104 has a corresponding frame buffer driver module, thevirtual system 1041 has a frame buffer driver module 1041a, thevirtual system 1042 has a frame buffer driver module 1042a, and thevirtual system 1043 has a frame buffer driver module 1043a.
The frame bufferdevice service module 1031 may create a virtual graphics card corresponding to thevirtual system 1041 based on theframe buffer information 1021, and after the frame buffer device driver module 1041a in thevirtual system 1041 detects the virtual graphics card corresponding to thevirtual system 1041, may create a corresponding graphics card driver based on theframe buffer information 1021, and display the driver by using thescreen display area 101a in the created graphicscard driver screen 101. Similarly, the frame bufferdevice service module 1031 may create a virtual graphics card corresponding to thevirtual system 1042 based on theframe buffer information 1022, and after the frame buffer device driver module 1042a in thevirtual system 1042 detects the virtual graphics card corresponding to thevirtual system 1042, may create a corresponding graphics card driver based on theframe buffer information 1022 and drive thescreen display region 101b in thescreen 101 to display the video card driver. The frame bufferdevice service module 1031 may create a virtual graphics card corresponding to thevirtual system 1043 based on theframe buffer information 1023, and after the frame buffer device driver module 1043a in thevirtual system 1043 detects the virtual graphics card corresponding to thevirtual system 1043, may create a corresponding graphics card driver based on theframe buffer information 1023, and drive thescreen display area 101c in thescreen 101 to display by using the created graphics card.
It should be noted that, as to a specific implementation manner of the frame bufferdevice server module 1031 acquiring the frame buffer information of thephysical display card 102 and dividing the frame buffer information of thephysical display card 102, reference may be made to the description part of the above related contents, and details are not described here. Fig. 4 is shown merely for convenience of understanding, and does not limit the embodiments of the present application. The number of virtual machines installed in theterminal device 100 may be other than 3 as shown in fig. 4. In addition, the specific manner of dividing the frame buffer information of the physical graphics card may also be other than that shown in fig. 4, for example, the division may be performed according to any one of the aforementioned symmetric partition policy, asymmetric non-overlapping partition policy, partial overlapping partition policy, and full overlapping partition policy.
Exemplary device
Based on the display control method provided by the above embodiment, the embodiment of the present application further provides a display control apparatus, which is described below with reference to the accompanying drawings.
Referring to fig. 5, the figure is a schematic structural diagram of a display control apparatus according to an embodiment of the present application.
The display control device provided by the embodiment of the application can be applied to terminal equipment provided with a plurality of virtual machines. As shown in fig. 5, thedisplay control device 500 may specifically include: anacquisition unit 501 and adividing unit 502.
An obtainingunit 501, configured to obtain frame buffer information of a physical graphics card of the terminal device;
adividing unit 502, configured to divide the frame buffer of the physical graphics card according to the frame buffer information of the physical graphics card, so as to obtain frame buffer information corresponding to each of the multiple virtual machines;
the frame buffer information corresponding to the first virtual machine is used for displaying on a screen display area corresponding to the frame buffer information corresponding to the first virtual machine by the first virtual machine; the first virtual machine is any one of the plurality of virtual machines.
Optionally, the dividingunit 502 is specifically configured to:
dividing the frame buffer of the physical display card according to the number of the virtual machines installed on the terminal equipment and the frame buffer information of the physical display card to obtain the frame buffer information corresponding to each virtual machine in the plurality of virtual machines; the screen display areas corresponding to the plurality of divided frame buffer information are the same in size, and the screen display areas corresponding to the plurality of divided frame buffer information are not overlapped.
Optionally, the dividingunit 502 is specifically configured to:
acquiring a frame buffer division configuration file, and dividing the frame buffer of the physical display card according to the frame buffer division configuration file to obtain frame buffer information corresponding to each virtual machine in the plurality of virtual machines; and the frame buffer division configuration file is generated according to the frame buffer information of the physical display card.
Optionally, the frame buffer partitioning configuration file includes one of the following partitioning policies:
a symmetric equal division strategy, an asymmetric non-overlapping division strategy, a partial overlapping division strategy and a full overlapping division strategy.
Optionally, the frame buffer information includes:
base address, number of pixels per scan line, horizontal resolution, vertical resolution, and pixel format.
Since theapparatus 500 is an apparatus corresponding to the method provided in the above method embodiment, and the specific implementation of each unit of theapparatus 500 is the same as that of the above method embodiment, for the specific implementation of each unit of theapparatus 500, reference may be made to the description part of the above method embodiment, and details are not repeated here.
As can be seen from the above description, with the display control apparatus provided in the embodiment of the present application, each virtual machine installed on a terminal device can perform a display operation using a screen of the terminal device.
An embodiment of the present application further provides a terminal device, where the terminal device includes: a processor and a memory;
the memory to store instructions;
the processor is used for executing the instructions in the memory and executing the display control method of the above method embodiment.
The embodiment of the present application further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on a terminal device, the terminal device is caused to execute the display control method described in the above method embodiment.
The embodiment of the present application provides a computer program product, which when running on a terminal device, enables the terminal device to execute the display control method described in the above embodiment.
It should be noted that, in the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the system or the device disclosed by the embodiment, the description is simple because the system or the device corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.