The content of the invention
Based on this, it is necessary to provide a kind of display interface method for refreshing that can reduce energy consumption.
A kind of display interface method for refreshing, including:
The refreshing instruction of display interface is received, obtains the brush of display interface corresponding with the refreshing instruction of the display interface
New timestamp and refresh cycle;
The refreshing instruction of the display window on the display interface is received, obtains the target refresh time of the display window
Stamp;
Judge whether the absolute value for the time difference that the target refresh timestamp stabs with the refresh time is less than or equal to
The half of the refresh cycle, if so, then adjust the target refresh timestamp so that target refresh timestamp after adjustment with
The refresh time stamp is in the same time.
In one of the embodiments, it is described receive the display window on the display interface refreshing instruction the step of it
Also include afterwards:
Obtain frame per second corresponding to the display window;
The maximum in the frame per second is obtained, refresh time stamp and refresh cycle are worth to according to the maximum of the frame per second,
And set it to refresh time stamp and the refresh cycle of the refreshing instruction of display interface.
In one of the embodiments, the maximum according to the frame per second is worth to refresh time stamp and refresh cycle
Also include after step:
Whether the refresh cycle obtained described in judgement is more than the default fixed refresh cycle, if so, then performing described
The refresh time stamp being worth to according to the maximum of the frame per second and the refresh cycle are set as the refreshing instruction of display interface
Refresh time stamp and the step of the refresh cycle;Otherwise, the refreshing instruction of display interface is set according to the fixed refresh cycle
Refresh time stamp and the refresh cycle.
In one of the embodiments, also include after the step of adjustment target refresh timestamp:
By the display interface and its comprising display window picture frame write-in display controller frame buffer zone, pass through
The display controller is by the Refresh Data in the frame buffer zone to display screen.
In one of the embodiments, the display window be Video Applications display window, animation application display window or
One or more in game application display window.
A kind of display interface method for refreshing that can reduce energy consumption is provided in addition, there is a need to.
A kind of display interface method for refreshing, including:
Frame buffer queue insertion event is detected, obtains the frame in frame buffer queue, extracts the frame time stamp of the frame;
Timestamp adjust instruction is received, obtains refresh time stamp and the refresh cycle of the timestamp adjust instruction;
According to formula:
tc-tp=n × T+toffset
Calculate time offset toffsetWith period distances n;Wherein, tcStabbed for frame time, tpStabbed for the refresh time, T
For the refresh cycle, and toffsetFor the value less than T;
The frame time that the frame is adjusted according to the time offset and period distances stabs.
In one of the embodiments, the frame time that the frame is adjusted according to the time offset and period distances
The step of stamp, includes:
Judge whether the time offset is less than T/2, if so, frame time stamp then is adjusted into tp+n×T;It is no
Then, frame time stamp is adjusted to tp+(n+1)×T;
In one of the embodiments, also include before the step of reception timestamp adjust instruction:
Window ID corresponding to the frame is obtained, is stabbed according to the frame time of the frame and calculates the frame that corresponding the same window identifies
Frame per second, choose the maximum of frame per second;
Frame per second corresponding to acquisition is the window ID of maximum, obtains the frame time stamp of frame corresponding to the window ID,
Timestamp adjust instruction is generated according to frame time stamp and the frame per second for maximum.
In one of the embodiments, also wrapped before the step of frame per second corresponding to the acquisition is the window ID of maximum
Include:
Obtain default fixed refresh rate and it is fixed refresh timestamp, judge described in as maximum frame per second whether be more than institute
Fixed refresh rate is stated, if it is not, then generating timestamp adjust instruction according to the fixed refresh rate and the fixed timestamp that refreshes.
In one of the embodiments, the window ID corresponds to Video Applications window, animation application widget or game and answered
With at least one of window.
A kind of display interface refreshing apparatus that can reduce energy consumption is provided in addition, there is a need to.
A kind of display interface refreshing apparatus, including:
Command reception module, for receiving the refreshing instruction of display interface, obtain the refreshing instruction with the display interface
The refresh time stamp of corresponding display interface and refresh cycle;
Window acquisition module, for receiving the refreshing instruction of the display window on the display interface, obtain the display
The target refresh timestamp of window;
Timestamp adjusting module, for judge the target refresh timestamp that the window acquisition module obtains with it is described
Whether the absolute value of the time difference for the refresh time stamp that command reception module obtains is less than or equal to the command reception mould
The half for the refresh cycle that block obtains, if so, the target refresh timestamp is then adjusted, so that the target refresh after adjustment
Timestamp stabs in the same time with the refresh time.
In one of the embodiments, described device also includes instruction setting module, for being more when the display window
When individual, frame per second corresponding to each display window is obtained;The maximum in the frame per second is obtained, according to the maximum of the frame per second
Refresh time stamp and refresh cycle are worth to, and sets it to the refresh time stamp of the refreshing instruction of display interface and refreshes week
Phase.
In one of the embodiments, whether the refresh cycle that the instruction setting module is additionally operable to obtain described in judgement is big
In the default fixed refresh cycle, if so, then performing the refresh time for being worth to the maximum according to the frame per second
Stamp and the refresh cycle are set as the step of refresh time stamp and refresh cycle of the refreshing instruction of display interface;Otherwise, root
Refresh time stamp and the refresh cycle of the refreshing instruction of display interface are set according to the fixed refresh cycle.
In one of the embodiments, described device also includes refresh module, for by the display interface and its comprising
Display window picture frame write-in display controller frame buffer zone, by the display controller by the frame buffer zone
Refresh Data on display screen.
In one of the embodiments, the display window be Video Applications display window, animation application display window or
One or more in game application display window.
A kind of display interface refreshing apparatus that can reduce energy consumption is provided in addition, there is a need to.
A kind of display interface refreshing apparatus, including:
Frame information acquisition module, for detecting frame buffer queue insertion event, the frame in frame buffer queue is obtained, extracts institute
State the frame time stamp of frame;
Command reception module, for receiving timestamp adjust instruction, obtain the refresh time of the timestamp adjust instruction
Stamp and refresh cycle;
Offset computing module, for according to formula:
tc-tp=n × T+toffset
Calculate time offset toffsetWith period distances n;Wherein, tcStabbed for frame time, tpStabbed for the refresh time, T
For the refresh cycle, and toffsetFor the value less than T;
Timestamp adjusting module, the frame time for adjusting the frame according to the time offset and period distances stab.
In one of the embodiments, the timestamp adjusting module is additionally operable to judge whether the time offset is less than
T/2, if so, frame time stamp then is adjusted into tp+n×T;Otherwise, frame time stamp is adjusted to tp+(n+1)×T;
In one of the embodiments, described device also includes directive generation module, for obtaining window corresponding to the frame
Mouth mark, the frame per second for the frame for calculating corresponding the same window mark is stabbed according to the frame time of the frame, choose the maximum of frame per second;Obtain
Frame per second is the window ID of maximum corresponding to taking, and the frame time stamp of frame corresponding to the window ID is obtained, according to the frame
Timestamp and the frame per second for maximum generate timestamp adjust instruction.
In one of the embodiments, the directive generation module is additionally operable to obtain default fixed refresh rate and fixed brush
New timestamp, judge it is described whether be more than the fixed refresh rate as maximum frame per second, if it is not, then according to the fixation refreshing
Rate and the fixed timestamp that refreshes generate timestamp adjust instruction.
In one of the embodiments, the window ID corresponds to Video Applications window, animation application widget or game and answered
With at least one of window.
Above-mentioned display interface method for refreshing and device, when updating the content of display window, by by the target refresh time
The display window that the absolute value of the difference of stamp and refresh time stamp is less than or equal to the half of refresh cycle is carried out more in synchronization
Newly, and according to corresponding to the content of the display window generates display interface picture frame and refresh so that have on display interface
During multiple display windows, the number that can make the picture frame of generation display interface and refresh is reduced, so as to reduce energy consumption.
Embodiment
In one embodiment, as shown in figure 1, a kind of display interface method for refreshing, this method are completely dependent on computer journey
Sequence, it can run in the computer system based on von Neumann system, this method includes:
Step S102, the refreshing instruction of display interface is received, obtain display circle corresponding with the refreshing instruction of display interface
The refresh time stamp in face and refresh cycle.
Display interface refreshing instruction is the instruction of picture frame corresponding to the display interface for controlling GPU to refresh on display screen.
Refresh time stamp is timestamp when receiving the display interface refreshing instruction corresponding to display interface refreshing instruction, refreshes week
Phase is the time cycle for receiving display interface refreshing instruction, that is, expection receives display interface refreshing instruction and arrived next time
This receives the time interval between display interface refreshing instruction.
Step S104, the refreshing instruction of the display window on display interface is received, when obtaining the target refresh of display window
Between stab.
As shown in Fig. 2 can have multiple display windows on display interface, display window can correspond to Video Applications, animation application
Or game application.Picture frame in display window needs to be brushed according to default frame per second (dynamic frame per second or the frame per second of fixation)
Newly.For example, the standard frame per second of film is 24 frame per second (24 hertz), i.e., it is (early that next moving-picture frame can be switched to every 1/24 second
Phase is film, and digital Age is frame data).If as shown in figure 3, there is 3 display windows on display interface, A, B and C represent 3
Frame per second corresponding to application in individual display window is respectively 1/2T, 1/3T and 1/5T, then the maximum in the frame per second of display window
For 1/2T.
Target refresh timestamp is that this is shown for the expection that frame per second corresponding to the application in display window is calculated
Show the refresh time stamp that the content in window is updated.For example, frame per second corresponding to some display window is 20hz, that is, refresh week
Phase is 0.05 second, if then the display window is 10:00:00:The content of updated display when 00, and current time is 10:00:
00:01 (time that 10 milliseconds have been crossed after updating), then its corresponding target refresh timestamp is 10:00:00:05 is (i.e. pre-
Phase is updated to the content in display window again by 40 milliseconds again).
Step S106, judges whether the absolute value for the time difference that target refresh timestamp stabs with refresh time is less than or equal to
The half of refresh cycle, if so, then performing:
Step S108, target refresh timestamp is adjusted, so that the target refresh timestamp after adjustment and refresh time stamp are same
Moment;Otherwise, perform:
Step S110, skip the display window.
As shown in figure 4, the refresh cycle of display interface refreshing instruction is fixed 2T, it is assumed that initial time stamp 0, is then existed
When the refresh time stamp 2T moment arrives, when the target refresh timestamp by the way that A windows and B windows is calculated is 2T moment and 3T
Carve, because itself and refresh time stamp 2T difference are respectively 0 and T, be respectively less than or the half equal to refresh cycle 2T, then at the 2T moment
Update the content in A windows and B windows.And for C windows, because its target refresh timestamp is 5T, 2T is stabbed with refresh time
Difference be 3T, more than refresh cycle 2T half, then do not update the content shown in C windows.
And when the stamp 4T moment of refresh time next time arrives, during target refresh by the way that A windows and C windows is calculated
Between stamp be 4T moment and 5T moment, because itself and refresh time stamp 4T difference are respectively 0 and T, respectively less than or equal to the refresh cycle
2T half, the then content in updating A windows and C windows at the 4T moment.And for B windows, due to its target refresh timestamp
For 6T, and refresh time stamp 4T difference is 2T, more than refresh cycle 2T half, does not then update the content shown in B windows.
That is, the timestamp by shifting to an earlier date or delaying renewal display window more new content, by multiple display windows more
The operation of new content is completed when a display interface refreshes.
In the present embodiment, when display window is multiple, the refreshing instruction of the display window on reception display interface
Frame per second corresponding to each display window can be also obtained after step;The maximum in the frame per second is obtained, according to the maximum of frame per second
Refresh time stamp and refresh cycle are worth to, and sets it to the refresh time stamp of the refreshing instruction of display interface and refreshes week
Phase.
If as shown in figure 3, there is 3 display windows on display interface, the application pair in 3 display windows that A, B and C are represented
The frame per second answered is respectively 1/2T, 1/3T and 1/5T, then the maximum in the frame per second of display window is 1/2T, then can be by display interface
Refresh cycle of refreshing instruction be set as 2T, the refresh time stamp of display interface can be obtained by being superimposed the refresh cycle.
In the present embodiment, further, the step of refresh time stamp and refresh cycle being worth to according to the maximum of frame per second
Whether the refresh cycle that also can determine whether to obtain afterwards is more than the default fixed refresh cycle, if so, then perform set it to it is aobvious
The step of showing refresh time stamp and the refresh cycle of the refreshing instruction at interface;Otherwise, set according to the fixed refresh cycle and show boundary
The refresh time stamp of the refreshing instruction in face and refresh cycle.
That is, the refreshing instruction of display interface can be determined according to the frame per second (such as 60hz etc.) of fixation set in advance
Refresh cycle, and by superposition obtain refresh time stab, then refresh time stab arrive when generate display interface refresh refer to
Order.If but the display window (for example, frame per second is 80hz game application window) that frame per second is more than fixed frame per second, basis be present
The refresh time stamp of the refreshing instruction of the frame per second setting display interface of the display window and refresh cycle.
If, also can be in a circulation it should be noted that frame per second of the frame per second corresponding to application in display window for change
The step of maximum in above-mentioned acquisition frame per second is performed in body repeatedly, so as to obtain the dynamic refresh cycle, and according to the dynamic
Refresh cycle generation display interface refreshing instruction.
In in the present embodiment, after the step of adjusting target refresh timestamp can also by display interface and its comprising it is aobvious
Show the frame buffer zone of the picture frame write-in display controller of window, by display controller by the data brush in the frame buffer zone
Newly on display screen.
The picture frame in all display windows on display interface can be obtained, then splices the image of integral display interface
Frame.That is, the picture frame of the display interface got need to be only written to the frame buffer zone of display controller, show
Controller is after the data in detecting frame buffer zone change, i.e., automatically by the Refresh Data in frame buffer zone to display screen
On.User can see the display interface after the refreshing on a display screen.
In one embodiment, a kind of display interface method for refreshing, this method are completely dependent on computer program, can run on
In computer system based on von Neumann system, this method includes:
Step 1, frame buffer queue insertion event is detected, obtain the frame in frame buffer queue, extract the frame time stamp of frame.
Frame buffer queue is that the buffer zone of frame data is stored in operating system.For example, when playing video, player
The data mode of frame is obtained after video file is decoded, the frame buffer in the frame data insertion operation system for then obtaining decoding
In queue, the frame in frame buffer queue includes frame time stamp, that is, needs the timestamp displayed it on display screen, operation system
Then system, by the frame by being taken out in frame buffer queue, can be written into the buffering area of display controller when frame time is stabbed and arrived at
In.
Step 2, timestamp adjust instruction is received, obtain refresh time stamp and the refresh cycle of timestamp adjust instruction.
The refresh time stamp of timestamp adjust instruction takes out the timestamp of frame in frame buffer queue.If for example, time
The refresh time stamp for stabbing adjust instruction is 00:00:00.005 (when being respectively, minute, second and millisecond), then in the clock of operating system
Arrive at 00:00:Frame is searched when 00.005 in frame buffer queue, is stabbed for the frame time of frame earlier than 00:00:00.005 frame,
Then it is drawn off, is then written in the buffering area of display controller.For example, if the frame time stamp of first frame is 00:00:
00.003, the frame time stamp of second frame is 00:00:00.006, the frame time stamp of the third frame is 00:00:00.005, then take out first frame and
Third frame.
In one embodiment, operating system can generate timestamp adjust instruction according to fixed frequency.It is predeterminable to have admittedly
Refresh rate is determined, by the way that current time is superimposed into the cycle corresponding to fixed refresh rate come cycle generation timestamp adjust instruction.For example,
If fixed refresh rate is 50hz, i.e., the cycle is 0.02 second, if the timestamp originated after os starting is 00:00:00.000,
Then respectively 00:00:00.020、00:00:Timestamp adjust instruction is generated when 00.040 ... timestamp arrives at.
Step 3, according to formula:
tc-tp=n × T+toffset
Calculate time offset toffsetWith period distances n;Wherein, tcStabbed for frame time, tpStabbed for refresh time, T is brush
New cycle, and toffsetFor the value less than T.
Step 4, the frame time that frame is adjusted according to time offset and period distances stab.
In the present embodiment, the step of frame time stamp that frame is adjusted according to time offset and period distances, includes:
Judge whether time offset is less than T/2, if so, frame time stamp then is adjusted into tp+n×T;When otherwise, by frame
Between stamp be adjusted to tp+(n+1)×T。
If for example, first, second, the third three frames in frame buffer be present, its frame time stamp tcRespectively first:00:00:
00.020th, second:00:00:00.080 and third:00:00:00.150, the refresh time stamp of the time adjust instruction received is 00:
00:00.010, its refresh cycle T are 0.04 second, then:
For first frame, its time offset toffsetFor 0.01 second, period distances n was 0;
For second frame, its time offset toffsetFor 0.03 second, period distances n was 1;
For the third frame, its time offset toffsetFor 0.02 second, period distances n was 3;
Then the frame time stamp of first frame can be adjusted to 00:00:00.010(00:00:00.010+0 × 0.04), by second frame
Frame time stamp is adjusted to 00:00:00.090(00:00:00.010+ (1+1) × 0.04), the frame time stamp of the third frame is adjusted to
00:00:00.170(00:00:00.010+(3+1)×0.04)。
In one embodiment, also include before the step of receiving timestamp adjust instruction:Window mark corresponding to getting frame
Know, the frame per second for calculating the frame that corresponding the same window identifies is stabbed according to the frame time of frame, choose the maximum of frame per second;Corresponding to acquisition
Frame per second is the window ID of maximum, obtains the frame time stamp of frame corresponding to window ID, according to frame time stamp and is maximum
Frame per second generation timestamp adjust instruction.
(in Windows, all interfaces are all for window ID corresponding to the frame i.e. window of the content of the expression display frame
Based on window, the corresponding main window of desktop background) mark, can be obtained by the interface function of operating system.If on interface
First, second and the third three windows be present, and the application of first, second and the third three corresponding three kinds of frame per second of window, corresponding frame per second are respectively
1/2T, 1/3T and 1/5T (can subtract each other calculating of averaging, for dynamic frame per second and static frame per second) by multiple frames, then frame
The frame of corresponding three kinds of window IDs is included in buffering area simultaneously.In frame corresponding to three kinds of window IDs, frame corresponding to first window
Frame per second it is maximum, then can according to corresponding to first window frame frame time stamp generation timestamp adjust instruction, and timestamp adjustment refers to
The refresh time stamp of order is the frame time stamp of the corresponding frame of the first window, and the refresh cycle is the week of frame corresponding to first window
Phase.
, then can be to corresponding to window ID second in frame buffer zone after generation timestamp adjust instruction is stabbed according to the frame time of first
It is adjusted, its frame time can be stabbed and postpone or delay according to abovementioned steps S108 method with the frame time stamp of third frame, from
And make it that first, second and the third three frames corresponding to window are refreshed in the same time.
Further, in the present embodiment, may be used also before the step of frame per second corresponding to acquisition is the window ID of maximum
Default fixed refresh rate and fixed refreshing timestamp are obtained, whether judge maximum frame per second is more than fixed refresh rate, if it is not,
Timestamp adjust instruction is then generated according to fixed refresh rate and the fixed timestamp that refreshes.
That is, as in precedent, if first, second and the frame per second of the third three windows are all smaller, and default fixed refresh rate
It is larger, then still fixed refresh timestamp adjustment frame buffer zone Zhong Jia, second and the third three windows pair to fix corresponding to refresh rate
The frame answered, otherwise, delayed with frame per second and its frame time stamp adjustment frame corresponding to the maximum window of frame per second in first, second and the third three windows
Rush Qu Zhongjia, second and the third three frames corresponding to window.
Further, window ID is corresponded in Video Applications window, animation application widget or game application window at least
It is a kind of.
In one embodiment, as shown in figure 5, a kind of display interface refreshing apparatus, including:
Command reception module 102, for receiving the refreshing instruction of display interface, obtain the refreshing instruction pair with display interface
The refresh time stamp for the display interface answered and refresh cycle.
Window acquisition module 104, for receiving the refreshing instruction of the display window on display interface, obtain display window
Target refresh timestamp.
Timestamp adjusting module 106, for judging that the target refresh timestamp that window acquisition module 104 obtains connects with instruction
Whether the absolute value for receiving the time difference for the refresh time stamp that module 102 obtains is less than or equal to what command reception module 102 obtained
The half of refresh cycle, if so, target refresh timestamp is then adjusted, so that target refresh timestamp and refresh time after adjustment
Stamp is in the same time.
In the present embodiment, as shown in fig. 6, display interface refreshing apparatus also includes instruction setting module 108, for working as
State display window for it is multiple when, obtain frame per second corresponding to each display window;The maximum in frame per second is obtained, according to frame per second most
It is big to be worth to refresh time stamp and refresh cycle, and set it to the refresh time stamp of the refreshing instruction of display interface and refresh
Cycle.
In the present embodiment, it is default solid whether the refresh cycle that instruction setting module 108 is additionally operable to judge to obtain is more than
The refresh cycle is determined, if so, then performing the refresh time stamp that will be worth to according to the maximum of the frame per second and the refreshing week
Phase is set as the step of refresh time stamp and refresh cycle of the refreshing instruction of display interface;Otherwise, according to the fixed refresh cycle
Refresh time stamp and the refresh cycle of the refreshing instruction of display interface are set.
In the present embodiment, as shown in fig. 6, display interface refreshing apparatus also includes refresh module 110, for that will show boundary
Face and its comprising display window picture frame write-in display controller frame buffer zone, by display controller by frame buffer zone
Interior Refresh Data is on display screen.
Show in this example it is shown that window is Video Applications display window, animation application display window or game application
Show the one or more in window.
In one embodiment, a kind of display interface refreshing apparatus, including frame information acquisition module, command reception module,
Offset computing module and timestamp adjusting module, wherein:
Frame information acquisition module, for detecting frame buffer queue insertion event, the frame in frame buffer queue is obtained, extracts frame
Frame time stamp.
Command reception module, for receiving timestamp adjust instruction, obtain timestamp adjust instruction refresh time stamp and
Refresh cycle.
Offset computing module, for according to formula:
tc-tp=n × T+toffset
Calculate time offset toffsetWith period distances n;Wherein, tcStabbed for frame time, tpStabbed for refresh time, T is brush
New cycle, and toffsetFor the value less than T.
Timestamp adjusting module, the frame time for adjusting frame according to time offset and period distances stab.
In one embodiment, timestamp adjusting module is additionally operable to judge whether time offset is less than T/2, if so, then
Frame time stamp is adjusted to tp+n×T;Otherwise, frame time stamp is adjusted to tp+(n+1)×T。
In one embodiment, display interface refreshing apparatus also includes directive generation module, for window corresponding to getting frame
Mouth mark, the frame per second for the frame for calculating corresponding the same window mark is stabbed according to the frame time of frame, choose the maximum of frame per second;Acquisition pair
The frame per second answered is the window ID of maximum, obtains the frame time stamp of frame corresponding to window ID, is stabbed according to frame time and for most
The frame per second generation timestamp adjust instruction being worth greatly.
In one embodiment, directive generation module is additionally operable to obtain default fixed refresh rate and fixed refresh time
Stamp, whether be judged as maximum frame per second is more than fixed refresh rate, if it is not, then refreshing timestamp with fixed according to fixed refresh rate
Generate timestamp adjust instruction.
In one embodiment, window ID is corresponded in Video Applications window, animation application widget or game application window
At least one.
Above-mentioned display interface method for refreshing and device, when updating the content of display window, by by the target refresh time
The display window that the absolute value of the difference of stamp and refresh time stamp is less than or equal to the half of refresh cycle is carried out more in synchronization
Newly, and according to corresponding to the content of the display window generates display interface picture frame and refresh so that have on display interface
During multiple display windows, the number that can make the picture frame of generation display interface and refresh is reduced, so as to reduce energy consumption.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with
The hardware of correlation is instructed to complete by computer program, described program can be stored in a computer read/write memory medium
In, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
Embodiment described above only expresses the several embodiments of the present invention, and its description is more specific and detailed, but simultaneously
Therefore the limitation to the scope of the claims of the present invention can not be interpreted as.It should be pointed out that for one of ordinary skill in the art
For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the guarantor of the present invention
Protect scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.