Home | History | Annotate | Download | only in ps2gs

Lines Matching defs:hwdata

78 	struct private_yuvhwdata *hwdata;
132 hwdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *hwdata);
133 overlay->hwdata = hwdata;
134 if ( hwdata == NULL ) {
139 hwdata->ipu_fd = -1;
140 hwdata->pixels = (Uint8 *)SDL_malloc(width*height*2);
141 if ( hwdata->pixels == NULL ) {
146 hwdata->macroblocks = (width/16) * (height/16);
149 overlay->pitches = hwdata->pitches;
150 overlay->pixels = hwdata->planes;
157 overlay->pixels[0] = hwdata->pixels;
174 hwdata->ipu_fd = open("/dev/ps2ipu", O_RDWR);
175 if ( hwdata->ipu_fd < 0 ) {
184 hwdata->dma_len = hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8) +
186 hwdata->macroblocks * (16 * sizeof(long long)) +
188 hwdata->dma_mem = mmap(0, hwdata->dma_len, PROT_READ|PROT_WRITE,
190 if ( hwdata->dma_mem == MAP_FAILED ) {
191 hwdata->ipu_imem = (caddr_t)0;
193 SDL_SetError("Unable to map %d bytes for DMA", hwdata->dma_len);
196 hwdata->ipu_imem = hwdata->dma_mem;
197 hwdata->ipu_omem = hwdata->ipu_imem +
198 hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8);
199 hwdata->dma_tags = hwdata->ipu_omem + width * height * bpp;
202 hwdata->plist.num = hwdata->macroblocks * 4 + 1;
203 hwdata->plist.packet = (struct ps2_packet *)SDL_malloc(
204 hwdata->plist.num*sizeof(struct ps2_packet));
205 if ( ! hwdata->plist.packet ) {
211 packet = hwdata->plist.packet;
214 tags = (unsigned long long *)hwdata->dma_tags;
215 base = hwdata->ipu_omem;
296 hwdata->stretch_x1y1 = &tags[6];
302 hwdata->stretch_x2y2 = &tags[10];
320 struct private_yuvhwdata *hwdata;
333 hwdata = overlay->hwdata;
348 dstp = (Uint32 *)hwdata->ipu_imem;
394 packet.ptr = hwdata->ipu_imem;
395 packet.len = hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8);
396 ioctl(hwdata->ipu_fd, PS2IOC_SENDA, &packet);
402 cmd = (7 << 28) + hwdata->macroblocks;
407 ioctl(hwdata->ipu_fd, PS2IOC_SIPUCMD, &cmd);
413 packet.ptr = hwdata->ipu_omem;
416 ioctl(hwdata->ipu_fd, PS2IOC_RECV, &packet);
434 *hwdata->stretch_x1y1 = (x * 16) + ((y * 16) << 16);
437 *hwdata->stretch_x2y2 = (x * 16) + ((y * 16) << 16);
438 return ioctl(console_fd, PS2IOC_SENDL, &hwdata->plist);
443 struct private_yuvhwdata *hwdata;
445 hwdata = overlay->hwdata;
446 if ( hwdata ) {
447 if ( hwdata->ipu_fd >= 0 ) {
448 close(hwdata->ipu_fd);
450 if ( hwdata->dma_mem ) {
451 munmap(hwdata->dma_mem, hwdata->dma_len);
453 if ( hwdata->plist.packet ) {
454 SDL_free(hwdata->plist.packet);
456 if ( hwdata->pixels ) {
457 SDL_free(hwdata->pixels);
459 SDL_free(hwdata);