changeset 982:b29547a5b85b

avoid WAIT in virtual console
author root@henri.cr.ie.u-ryukyu.ac.jp
date Fri, 01 Oct 2010 00:26:02 +0900
parents a193a851b5e3
children ff74988bbb2a
files Renderer/Engine/ps3fb/cp_vt.cc Renderer/Engine/viewer.cc old/framebuffer/Makefile old/framebuffer/cp_vt.c old/framebuffer/fb_finish.c
diffstat 5 files changed, 60 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/ps3fb/cp_vt.cc	Thu Sep 30 23:54:08 2010 +0900
+++ b/Renderer/Engine/ps3fb/cp_vt.cc	Fri Oct 01 00:26:02 2010 +0900
@@ -166,11 +166,13 @@
   error_str = select_error_str( error, error_str, activate_tty_error, activate_tty_error_str );
   error     = error | activate_tty_error;
 
+#if 0
   const int   waitactive_tty_error     = ioctl( vt->tty, VT_WAITACTIVE, vt->tty_ndx );
   const char* waitactive_tty_error_str = "Could not switch to tty";
 
   error_str = select_error_str( error, error_str, waitactive_tty_error, waitactive_tty_error_str );
   error     = error | waitactive_tty_error;
+#endif
 
   // From: http://opensolaris.org/os/project/vconsole/vt.7i.txt
   // (Close enough to Linux and a pretty good source of documentation.)
--- a/Renderer/Engine/viewer.cc	Thu Sep 30 23:54:08 2010 +0900
+++ b/Renderer/Engine/viewer.cc	Fri Oct 01 00:26:02 2010 +0900
@@ -946,9 +946,13 @@
 
     data_update_wait->spawn();  
     if (profile) {
-	if (frames % 1000 == 999) {
+	if (frames % 100 == 99) {
 	    manager->show_profile();
         }
+        if (this_time != start_time) {
+           printf("%f FPS\n", (((float)frames)/(this_time-start_time))*1000.0);
+           start_time = this_time; frames = 0;
+        }
     }
 
 }
--- a/old/framebuffer/Makefile	Thu Sep 30 23:54:08 2010 +0900
+++ b/old/framebuffer/Makefile	Fri Oct 01 00:26:02 2010 +0900
@@ -1,11 +1,14 @@
-all: fb_info fb_test
+all: fb_info fb_test fb_finish
 
-CC = gcc -std=c99 -O2
+CC = gcc -std=c99 -O2 -g
 fb_info : fb_info.o cp_fb.o cp_vt.o
 	$(CC) -o  $@ $+
 
 fb_test : fb_test.o  cp_fb.o cp_vt.o -lm
 	$(CC) -o  $@ $+
 
+fb_finish : fb_finish.o  cp_fb.o cp_vt.o -lm
+	$(CC) -o  $@ $+
+
 clean:
-	rm -f fb_info fb_test *.o
+	rm -f fb_info fb_test fb_finish *.o
--- a/old/framebuffer/cp_vt.c	Thu Sep 30 23:54:08 2010 +0900
+++ b/old/framebuffer/cp_vt.c	Fri Oct 01 00:26:02 2010 +0900
@@ -165,12 +165,13 @@
 
   error_str = select_error_str( error, error_str, activate_tty_error, activate_tty_error_str );
   error     = error | activate_tty_error;
-
+#if 0
   const int   waitactive_tty_error     = ioctl( vt->tty, VT_WAITACTIVE, vt->tty_ndx );
   const char* waitactive_tty_error_str = "Could not switch to tty";
 
   error_str = select_error_str( error, error_str, waitactive_tty_error, waitactive_tty_error_str );
   error     = error | waitactive_tty_error;
+#endif
 
   // From: http://opensolaris.org/os/project/vconsole/vt.7i.txt
   // (Close enough to Linux and a pretty good source of documentation.)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/old/framebuffer/fb_finish.c	Fri Oct 01 00:26:02 2010 +0900
@@ -0,0 +1,45 @@
+// fb_test.c 
+// Simple test application. Draw something to the frame buffer. 
+//
+// Copyright (c) 2006, Mike Acton <macton@cellperformance.com>
+// 
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
+// documentation files (the "Software"), to deal in the Software without restriction, including without
+// limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+// the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or substantial
+// portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
+// EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+// OR OTHER DEALINGS IN THE SOFTWARE.
+
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include "cp_vt.h"
+#include "cp_fb.h"
+
+void write_hline_gouraud_ABGR8888( int32_t x0, int32_t x1, uint32_t left_rgba, uint32_t right_rgba, void* dest_buffer, uint16_t stride );
+
+int 
+main( void )
+{
+    cp_vt vt;
+    cp_fb fb;
+
+    cp_vt_open_graphics(&vt);
+    cp_fb_open(&fb);
+
+
+    cp_vt_close(&vt);
+    cp_fb_close(&fb);
+
+    return (0);
+}
+