[tip:tools/kvm] kvm tools: Use double buffering with SDL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  7ae6095e5c1b28b4efc88056fea7fdd75e1fd82b
Gitweb:     http://git.kernel.org/tip/7ae6095e5c1b28b4efc88056fea7fdd75e1fd82b
Author:     Sasha Levin <levinsasha928@xxxxxxxxx>
AuthorDate: Thu, 9 Jun 2011 16:48:17 -0400
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Thu, 9 Jun 2011 08:32:28 +0300

kvm tools: Use double buffering with SDL

Page flip every time we copy the buffer over instead of invalidating
rects.
This should improve performance by letting hardware do the page
flipping.

Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/ui/sdl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/kvm/ui/sdl.c b/tools/kvm/ui/sdl.c
index bf2f7c9..aa3eff9 100644
--- a/tools/kvm/ui/sdl.c
+++ b/tools/kvm/ui/sdl.c
@@ -91,7 +91,7 @@ static void *sdl__thread(void *p)
 	if (!guest_screen)
 		die("Unable to create SDL RBG surface");
 
-	flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL;
+	flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_DOUBLEBUF;
 
 	screen = SDL_SetVideoMode(fb->width, fb->height, fb->depth, flags);
 	if (!screen)
@@ -99,7 +99,7 @@ static void *sdl__thread(void *p)
 
 	for (;;) {
 		SDL_BlitSurface(guest_screen, NULL, screen, NULL);
-		SDL_UpdateRect(screen, 0, 0, 0, 0);
+		SDL_Flip(screen);
 
 		while (SDL_PollEvent(&ev)) {
 			switch (ev.type) {
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux