From 37299201ea61744044352c1b70c9e68faa206c3e Mon Sep 17 00:00:00 2001
From: notaz <notasas@gmail.com>
Date: Tue, 16 Nov 2010 14:58:47 +0200
Subject: [PATCH] fail on offscreen hardware surfaces

also add more fake modes, somebody could use that to scale down
---
 src/video/omapdss/sdlif.c | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/src/video/omapdss/sdlif.c b/src/video/omapdss/sdlif.c
index 93d18f7..2b76641 100644
--- a/src/video/omapdss/sdlif.c
+++ b/src/video/omapdss/sdlif.c
@@ -52,13 +52,22 @@ static SDL_Rect **omap_ListModes(SDL_VideoDevice *this, SDL_PixelFormat *format,
 	static SDL_Rect omap_mode_list[] = {
 		// XXX: we are not really restricted to fixed modes
 		// FIXME: should really check the display for max supported
-		{ 0, 0, 800, 480 },
-		{ 0, 0, 720, 480 },
-		{ 0, 0, 640, 480 },
-		{ 0, 0, 640, 400 },
-		{ 0, 0, 512, 384 },
-		{ 0, 0, 320, 240 },
-		{ 0, 0, 320, 200 },
+		{ 0, 0, 1600, 1200 },
+		{ 0, 0, 1408, 1056 },
+		{ 0, 0, 1280, 1024 },
+		{ 0, 0, 1152,  864 },
+		{ 0, 0, 1024,  768 },
+		{ 0, 0,  960,  720 },
+		{ 0, 0,  800,  600 },
+		{ 0, 0,  768,  576 },
+		{ 0, 0,  720,  576 },
+		{ 0, 0,  800,  480 },
+		{ 0, 0,  720,  480 },
+		{ 0, 0,  640,  480 },
+		{ 0, 0,  640,  400 },
+		{ 0, 0,  512,  384 },
+		{ 0, 0,  320,  240 },
+		{ 0, 0,  320,  200 },
 	};
 	// broken API needs this
 	static SDL_Rect *omap_modes[] = {
@@ -123,6 +132,18 @@ static int omap_FlipHWSurface(SDL_VideoDevice *this, SDL_Surface *surface)
 	return 0;
 }
 
+/* we can't do hw surfaces (besides screen one) yet */
+static int omap_AllocHWSurface(SDL_VideoDevice *this, SDL_Surface *surface)
+{
+	trace("%p", surface);
+	return -1;
+}
+
+static void omap_FreeHWSurface(SDL_VideoDevice *this, SDL_Surface *surface)
+{
+	trace("%p", surface);
+}
+
 static int omap_SetColors(SDL_VideoDevice *this, int firstcolor, int ncolors, SDL_Color *colors)
 {
 	trace("%d, %d, %p", firstcolor, ncolors, colors);
@@ -194,6 +215,8 @@ static SDL_VideoDevice *omap_create(int devindex)
 	this->LockHWSurface = omap_LockHWSurface;
 	this->UnlockHWSurface = omap_UnlockHWSurface;
 	this->FlipHWSurface = omap_FlipHWSurface;
+	this->AllocHWSurface = omap_AllocHWSurface;
+	this->FreeHWSurface = omap_FreeHWSurface;
 	this->SetColors = omap_SetColors;
 	this->UpdateRects = omap_UpdateRects;
 	this->VideoQuit = omap_VideoQuit;
-- 
2.39.5