changeset 96:32be65e25785

*** empty log message ***
author akira
date Thu, 28 Feb 2008 20:05:23 +0900
parents 6315da182c66
children 21958f9a31c7
files TaskManager/Test/simple_render/test/LoadTexture/Makefile TaskManager/Test/simple_render/test/LoadTexture/fb.cpp TaskManager/Test/simple_render/test/LoadTexture/polygon.cpp TaskManager/Test/simple_render/test/LoadTexture/spe/Load_Texture.cpp TaskManager/Test/simple_render/test/LoadTexture/spe/Makefile
diffstat 5 files changed, 36 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Test/simple_render/test/LoadTexture/Makefile	Thu Feb 28 18:04:06 2008 +0900
+++ b/TaskManager/Test/simple_render/test/LoadTexture/Makefile	Thu Feb 28 20:05:23 2008 +0900
@@ -6,8 +6,8 @@
 TASK_OBJS = $(TASK_SRCS:.cpp=.o)
 
 CC      = g++
-CFLAGS  = -O9  -g -Wall -DDEBUG
-INCLUDE = -I../../../../include/TaskManager -I.
+CFLAGS  =  -g -O9 -Wall -DDEBUG
+INCLUDE = -I../../../../../include/TaskManager -I.
 
 EXTRA_CFLAGS = `sdl-config --cflags` `xml2-config --cflags`\
 
@@ -15,7 +15,7 @@
 #EXTRA_LIBS = -lFifoManager
 
 LIBS = `sdl-config --libs` -lSDL_image -lGL \
-       `xml2-config --libs` -L../../.. $(EXTRA_LIBS)
+       `xml2-config --libs` -L../../../.. $(EXTRA_LIBS)
 
 .SUFFIXES: .cpp .o
 
--- a/TaskManager/Test/simple_render/test/LoadTexture/fb.cpp	Thu Feb 28 18:04:06 2008 +0900
+++ b/TaskManager/Test/simple_render/test/LoadTexture/fb.cpp	Thu Feb 28 20:05:23 2008 +0900
@@ -39,13 +39,10 @@
 	struct fb_var_screeninfo vinfo;
 	struct fb_fix_screeninfo finfo;
 	long int screensize ;
-	long int location;
 	char *fbptr ;
 	char tmp[DIV_BYTE*10];
 
-	int x , y ;
 	int xres,yres,vbpp,line_len;
-	unsigned short tcolor ;
 
 	/* 読み書き用にファイルを開く */
 	fd_framebuffer = open( DEVICE_NAME , O_RDWR);
@@ -84,7 +81,7 @@
 	}
 	send_current_information("The framebuffer device was mapped !");
 
-	printf("fb: %x \n",fbptr);
+	printf("fb: %x \n",(unsigned int)fbptr);
 	return (int)fbptr;
 	//munmap(fbptr,screensize);
 	//close(fd_framebuffer);
--- a/TaskManager/Test/simple_render/test/LoadTexture/polygon.cpp	Thu Feb 28 18:04:06 2008 +0900
+++ b/TaskManager/Test/simple_render/test/LoadTexture/polygon.cpp	Thu Feb 28 20:05:23 2008 +0900
@@ -19,7 +19,7 @@
 
 extern int decode(char *cont, FILE *outfile);
 
-#define LOAD_TEXTURE_SIZE 128*128*3/4
+#define LOAD_TEXTURE_SIZE 128*128*3
 
 void Polygon::set_data(char *file_name)
 {
@@ -96,7 +96,6 @@
 
 	//void *_pixels = new Uint32[width*height*32/8];
 	void *_pixels;
-	SDL_Surface *screen;
 	posix_memalign((void**)&_pixels, 16, 3*128*128);
 	
 	memcpy(_pixels, texture_image->pixels, 3*128*128);
--- a/TaskManager/Test/simple_render/test/LoadTexture/spe/Load_Texture.cpp	Thu Feb 28 18:04:06 2008 +0900
+++ b/TaskManager/Test/simple_render/test/LoadTexture/spe/Load_Texture.cpp	Thu Feb 28 20:05:23 2008 +0900
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <spu_intrinsics.h>
+#include <spu_mfcio.h>
 #include "Load_Texture.h"
 #include "error.h"
 #include "SchedTask.h"
@@ -7,6 +8,7 @@
 #include "SchedNop2Ready.h"
 #include "DmaManager.h"
 #include "TaskManager.h"
+using namespace std;
 
 #define height 128
 #define width  128
@@ -17,26 +19,42 @@
 LoadTexture::run(void *rbuf , void *wbuf) 
 {
 	//int rgb;
-	for(int y = 0; y < height; y++) {
-		for(int x = 0; x < width; x++) {
-			//linebuf[x] = get_rgb(x,y);
-		}
-	}
-	printf("hoge\n");
+    __debug("[SchedTask:%s]\n", __FUNCTION__);
+	printf("%x\n",(int)*rbuf);
+	printf("run\n");
 }
 
 // byteperpixel = 3 width = 128 dma_height= 32
 #define LOAD_SIZE 3*128*32
+#define MAX_LOAD_SIZE 16384      
+#define USE_ARRAY 3
 
 void 
 LoadTexture::read(void) 
 {
     __debug("[SchedTask:%s]\n", __FUNCTION__);
-    connector->dma_load(readbuf,task->in_addr,LOAD_SIZE,DMA_READ);
-	connector->dma_load((void*)((int)readbuf+LOAD_SIZE),task->in_addr+LOAD_SIZE,LOAD_SIZE,DMA_READ);
-	connector->dma_load((void*)((int)readbuf+LOAD_SIZE*2),task->in_addr+LOAD_SIZE*2,LOAD_SIZE,DMA_READ);
-	connector->dma_load((void*)((int)readbuf+LOAD_SIZE*3),task->in_addr+LOAD_SIZE*3,LOAD_SIZE,DMA_READ);
+#if 1
+    connector->dma_load(readbuf,task->in_addr,MAX_LOAD_SIZE,DMA_READ);
+    connector->dma_load((void*)((int)readbuf + MAX_LOAD_SIZE),
+	          task->in_addr + MAX_LOAD_SIZE ,MAX_LOAD_SIZE,DMA_READ + 1);
+    connector->dma_load((void*)((int)readbuf + MAX_LOAD_SIZE*2) ,
+          task->in_addr + MAX_LOAD_SIZE * 2,MAX_LOAD_SIZE,DMA_READ + 2);
+    printf("readbuf: %x\n", readbuf);
+	printf("readbuf2:%x\n", (int)readbuf + MAX_LOAD_SIZE);
+	printf("readbuf3:%x\n", (int)readbuf + MAX_LOAD_SIZE*2);
+#else 
+	mfc_list_element buf[USE_ARRAY];
+	for(int i = 0; i < USE_ARRAY; i++) {
+		buf[i].notify = 0;
+		buf[i].reserved = 0;
+		buf[i].size = MAX_LOAD_SIZE;
+		buf[i].eal = task->in_addr + i*MAX_LOAD_SIZE;
+	}
+	printf("set_load_info\n");
+	connector->dma_load(readbuf, (unsigned int)buf, MAX_LOAD_SIZE, DMA_READ);
+	printf("dma_load_finish\n");
 
+#endif
 }
 
 void 
--- a/TaskManager/Test/simple_render/test/LoadTexture/spe/Makefile	Thu Feb 28 18:04:06 2008 +0900
+++ b/TaskManager/Test/simple_render/test/LoadTexture/spe/Makefile	Thu Feb 28 20:05:23 2008 +0900
@@ -4,9 +4,9 @@
 OBJS = $(SRCS:.cpp=.o)
 
 CC      = spu-g++
-CFLAGS  = -O9 #-g -Wall# -DDEBUG
-INCLUDE = -I../../../../../include/TaskManager -I. -I..
-LIBS    = -L../../../.. -lspemanager# -lm
+CFLAGS  = -g  -DDEBUG
+INCLUDE = -I../../../../../../include/TaskManager -I. -I..
+LIBS    = -L../../../../.. -lspemanager# -lm
 
 .SUFFIXES: .cpp .o