Search
lxdream.org :: lxdream/src/pvr2/render.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/render.c
changeset 429:e581b90c3fb3
prev352:f0df7a6d4703
next477:9a373f2ff009
author nkeynes
date Mon Oct 08 11:52:13 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change Fix compilation warnings
file annotate diff log raw
1.1 --- a/src/pvr2/render.c Sun Feb 11 10:09:32 2007 +0000
1.2 +++ b/src/pvr2/render.c Mon Oct 08 11:52:13 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: render.c,v 1.24 2007-02-11 10:09:32 nkeynes Exp $
1.6 + * $Id: render.c,v 1.25 2007-10-08 11:52:13 nkeynes Exp $
1.7 *
1.8 * PVR2 Renderer support. This part is primarily
1.9 *
1.10 @@ -16,20 +16,23 @@
1.11 * GNU General Public License for more details.
1.12 */
1.13
1.14 +#include <sys/time.h>
1.15 +#include <time.h>
1.16 #include "pvr2/pvr2.h"
1.17 #include "asic.h"
1.18
1.19
1.20 -int pvr2_render_font_list = -1;
1.21 int pvr2_render_trace = 0;
1.22
1.23 +#if 0
1.24 +int pvr2_render_font_list = -1;
1.25 int glPrintf( int x, int y, const char *fmt, ... )
1.26 {
1.27 va_list ap; /* our argument pointer */
1.28 char buf[256];
1.29 int len;
1.30 if (fmt == NULL) /* if there is no string to draw do nothing */
1.31 - return;
1.32 + return 0;
1.33 va_start(ap, fmt);
1.34 len = vsnprintf(buf, sizeof(buf), fmt, ap);
1.35 va_end(ap);
1.36 @@ -49,6 +52,7 @@
1.37
1.38 return len;
1.39 }
1.40 +#endif
1.41
1.42 void glDrawGrid( int width, int height )
1.43 {
1.44 @@ -79,11 +83,11 @@
1.45 {
1.46 /* Select and initialize the render context */
1.47 display_driver->set_render_target(buffer);
1.48 -
1.49 +#if 0
1.50 if( pvr2_render_font_list == -1 ) {
1.51 pvr2_render_font_list = video_glx_load_font( "-*-helvetica-*-r-normal--16-*-*-*-p-*-iso8859-1");
1.52 }
1.53 -
1.54 +#endif
1.55 pvr2_check_palette_changed();
1.56
1.57 /* Setup the display model */
1.58 @@ -111,8 +115,9 @@
1.59 */
1.60 void pvr2_render_scene( render_buffer_t buffer )
1.61 {
1.62 - struct tile_descriptor *tile_desc =
1.63 - (struct tile_descriptor *)mem_get_region(PVR2_RAM_BASE + MMIO_READ( PVR2, RENDER_TILEBASE ));
1.64 + struct timeval tva, tvb;
1.65 +
1.66 + gettimeofday(&tva, NULL);
1.67
1.68 float bgplanez = 1/MMIO_READF( PVR2, RENDER_FARCLIP );
1.69 pvr2_render_prepare_context( buffer, bgplanez, 0 );
1.70 @@ -135,6 +140,9 @@
1.71
1.72 pvr2_render_tilebuffer( buffer->width, buffer->height, clip_x, clip_y,
1.73 clip_x + clip_width, clip_y + clip_height );
1.74 -
1.75 - DEBUG( "Rendered frame %d to %08X", pvr2_get_frame_count(), buffer->address );
1.76 +
1.77 + gettimeofday( &tvb, NULL );
1.78 + uint32_t ms = (tvb.tv_sec - tva.tv_sec) * 1000 +
1.79 + (tvb.tv_usec - tva.tv_usec)/1000;
1.80 + DEBUG( "Rendered frame %d to %08X in %dms", pvr2_get_frame_count(), buffer->address, ms );
1.81 }
.