source: titan/titan/mipselport.h @ 15169

Last change on this file since 15169 was 15169, checked in by nit, 12 years ago

[titan] add mipsel port

File size: 17.3 KB
Line 
1#ifndef MIPSELPORT_H
2#define MIPSELPORT_H
3
4#ifndef FBIO_BLIT
5#define FBIO_SET_MANUAL_BLIT _IOW('F', 0x20, __u32)
6#define FBIO_BLIT 0x22
7#endif
8
9void enablemanualblit()
10{
11        int mblit = 1;
12
13        if(ioctl(fb->fd, FBIO_SET_MANUAL_BLIT, &mblit) < 0)
14        {
15                perr("FBIO_SET_MANUAL_BLIT");
16        }
17}
18
19void fbsetoffset(int x, int y)
20{
21        struct fb_var_screeninfo var_screeninfo;
22
23        var_screeninfo.xoffset = x;
24        var_screeninfo.yoffset = y;
25
26        if(ioctl(fb->fd, FBIOPAN_DISPLAY, &var_screeninfo) < 0)
27        {
28                perr("FBIOPAN_DISPLAY");
29        }
30}
31
32//flag 0 = no animation
33//flag 1 = animation
34void blitfb2(struct fb* fbnode, int flag)
35{
36        struct fb_var_screeninfo var_screeninfo;
37
38        var_screeninfo.xres_virtual = fb->width;
39        var_screeninfo.xres = fb->width;
40        var_screeninfo.yres_virtual = fb->height * 2;
41        var_screeninfo.yres = fb->height;
42        var_screeninfo.height = 0;
43        var_screeninfo.width = 0;
44        var_screeninfo.xoffset = 0;
45        var_screeninfo.yoffset = 0;
46        var_screeninfo.bits_per_pixel = fb->colbytes * 8;
47
48        switch(fb->colbytes)
49        {
50                case 2:
51                        var_screeninfo.transp.offset = 15;
52                        var_screeninfo.transp.length = 1;
53                        var_screeninfo.red.offset = 10;
54                        var_screeninfo.red.length = 5;
55                        var_screeninfo.green.offset = 5;
56                        var_screeninfo.green.length = 5;
57                        var_screeninfo.blue.offset = 0;
58                        var_screeninfo.blue.length = 5;
59                        break;
60                case 4:
61                        var_screeninfo.transp.offset = 24;
62                        var_screeninfo.transp.length = 8;
63                        var_screeninfo.red.offset = 16;
64                        var_screeninfo.red.length = 8;
65                        var_screeninfo.green.offset = 8;
66                        var_screeninfo.green.length = 8;
67                        var_screeninfo.blue.offset = 0;
68                        var_screeninfo.blue.length = 8;
69                        break;
70        }
71       
72
73        if(ioctl(fb->fd, FBIOPUT_VSCREENINFO, &var_screeninfo) < 0)
74        {
75                var_screeninfo.yres_virtual = fb->height;
76                if(ioctl(fb->fd, FBIOPUT_VSCREENINFO, &var_screeninfo) < 0)
77                {
78                        perr("FBIOPUT_VSCREENINFO");
79                }
80        }
81
82        if(ioctl(fb->fd, FBIO_BLIT) < 0)
83        {
84                perr("FBIO_BLIT");
85        }
86
87/*
88        int i = 0, max = 1, wstep = 0, hstep = 0, ret = 0;
89        unsigned char buf[10];
90
91        if(fbnode == NULL) return;
92#ifndef NOHWBLIT
93        if(fbnode == fb) return;
94
95        if(status.rguidfd > -1)
96        {
97                m_lock(&status.accelfbmutex, 16);
98               
99                int zlen = 0;
100                char* zbuf = NULL;
101                blitscale(0, 0, fbnode->width, fbnode->height, 440, 330, 1);
102                ret = zip((char*)accelfb->fb, 440 * 330 * 4, &zbuf, &zlen, 1);
103
104                if(ret == 0)
105                {
106                        memset(buf, 0, 10);
107                        char* tmpnr = oitoa(zlen);
108                        memcpy(buf, tmpnr, strlen(tmpnr));
109                        free(tmpnr); tmpnr = NULL;
110                        socksend(&status.rguidfd, buf, 10, 5000 * 1000);
111                        socksend(&status.rguidfd, (unsigned char*)zbuf, zlen, 5000 * 1000);
112                }
113                free(zbuf); zbuf = NULL;
114                zlen = 0;
115
116                m_unlock(&status.accelfbmutex, 16);
117        }
118
119        if(status.write_png == 1 && status.infobaraktiv == 0)
120        {
121                m_lock(&status.accelfbmutex, 16);
122                blitscale(0, 0, fbnode->width, fbnode->height, 320, 240, 1);
123                if(writeFBfile.ActBuf == NULL)
124                {
125                        writeFBfile.buf1 = malloc(4 * 320 * 240);
126                        writeFBfile.ActBuf = writeFBfile.buf1;
127                        memcpy(writeFBfile.buf1, accelfb->fb, 4 * 320 * 240);
128                        addtimer(&fb2png_thread, START, 10000, 1, NULL, NULL, NULL);
129                }
130                else if(writeFBfile.buf1 == writeFBfile.ActBuf)
131                {
132                        if(writeFBfile.buf2 == NULL)
133                                writeFBfile.buf2 = malloc(4 * 320 * 240);
134                        memcpy(writeFBfile.buf2, accelfb->fb, 4 * 320 * 240);
135                }
136                else if(writeFBfile.buf2 == writeFBfile.ActBuf)
137                {
138                        if(writeFBfile.buf1 == NULL)
139                                writeFBfile.buf1 = malloc(4 * 320 * 240);
140                        memcpy(writeFBfile.buf1, accelfb->fb, 4 * 320 * 240);
141                }
142                m_unlock(&status.accelfbmutex, 16);
143        }
144
145        int mode3d = 0, leftoffset = 0, rightoffset = 0, topoffset = 0, bottomoffset = 0;
146        char* mode3dstr = NULL;
147
148        if(status.leftoffset != 0) blitrect(0, 0, status.leftoffset, fb->height, 0, 255, 2);
149        if(status.rightoffset != 0) blitrect(fb->width - status.rightoffset, 0, status.rightoffset, fb->height, 0, 255, 2);
150        if(status.topoffset != 0) blitrect(0, 0, fb->width, status.topoffset, 0, 255, 2);
151        if(status.bottomoffset != 0) blitrect(0, fb->height - status.bottomoffset, fb->width, status.bottomoffset, 0, 255, 2);
152
153        mode3dstr = getconfig("av_mode3d", NULL);
154        if(ostrcmp(mode3dstr, "sbs") == 0)
155                mode3d = 1;
156        else if(ostrcmp(mode3dstr, "tab") == 0)
157                mode3d = 2;
158
159        STMFBIO_BLT_DATA  bltData;
160        memset(&bltData, 0, sizeof(STMFBIO_BLT_DATA));
161
162        bltData.operation  = BLT_OP_COPY;
163        bltData.srcOffset  = fbnode->fb - fb->fb;
164        bltData.srcPitch   = fbnode->pitch;
165        bltData.src_top    = 0;
166        bltData.src_left   = 0;
167        bltData.src_right  = fbnode->width;
168        bltData.src_bottom = fbnode->height;
169        bltData.srcFormat  = SURF_BGRA8888;
170        bltData.srcMemBase = STMFBGP_FRAMEBUFFER;
171
172        bltData.dstOffset  = 0;
173        bltData.dstPitch   = fb->pitch;
174        bltData.dst_left   = status.leftoffset;
175        bltData.dst_top    = status.topoffset;
176        if(mode3d == 1)
177                bltData.dst_right = (fb->width - status.rightoffset) / 2;
178        else
179                bltData.dst_right = fb->width - status.rightoffset;
180        if(mode3d == 2)
181                bltData.dst_bottom = (fb->height - status.bottomoffset) / 2;
182        else
183                bltData.dst_bottom = fb->height - status.bottomoffset;
184        bltData.dstFormat  = SURF_BGRA8888;
185        bltData.dstMemBase = STMFBGP_FRAMEBUFFER;
186
187        if(flag == 1 && status.screenanim > 0 && mode3d == 0)
188        {
189                int width = (fb->width - status.rightoffset) - status.leftoffset;
190                int height = (fb->height - status.topoffset) - status.bottomoffset;
191                max = 25;
192                if(status.screenanim == 1 || status.screenanim == 3)
193                {
194                        bltData.dst_left = (width / 2) - 1;
195                        bltData.dst_right = (width / 2) + 1;
196                }
197                if(status.screenanim == 2 || status.screenanim == 3)
198                {
199                        bltData.dst_top = (height / 2) - 1;
200                        bltData.dst_bottom = (height / 2) + 1;
201                }
202                wstep = width / max;
203                hstep = height / max;
204        }
205
206        for(i = 0; i < max; i++)
207        {
208
209                if(status.screenanim == 1 || status.screenanim == 3)
210                {
211                        int tmpleft = bltData.dst_left - wstep;
212                        int tmpright = bltData.dst_right + wstep;
213                        if(tmpleft < status.leftoffset)
214                                tmpleft = status.leftoffset;
215                        if(tmpright > fb->width - status.rightoffset)
216                                tmpright = fb->width - status.rightoffset;
217                        bltData.dst_left = tmpleft;
218                        bltData.dst_right = tmpright;
219                }
220
221                if(status.screenanim == 2 || status.screenanim == 3)
222                {
223                        int tmptop = bltData.dst_top - hstep;
224                        int tmpbottom = bltData.dst_bottom + hstep;
225                        if(tmptop < status.topoffset)
226                                tmptop = status.topoffset;
227                        if(tmpbottom > fb->height - status.bottomoffset)
228                                tmpbottom = fb->height - status.bottomoffset;
229                        bltData.dst_top = tmptop;
230                        bltData.dst_bottom = tmpbottom;
231                }
232
233                if(status.screenanim > 0) usleep(status.screenanimspeed * 1000);
234
235                if (ioctl(fb->fd, STMFBIO_BLT, &bltData) < 0)
236                {
237                        perr("ioctl STMFBIO_BLT");
238                }
239                if(ioctl(fb->fd, STMFBIO_SYNC_BLITTER) < 0)
240                {
241                        perr("ioctl STMFBIO_SYNC_BLITTER");
242                }
243
244                if(mode3d != 0)
245                {
246                        if(mode3d == 1)
247                                bltData.dst_left = 0 + status.leftoffset + ((fb->width - status.rightoffset) / 2);
248                        if(mode3d == 2)
249                                bltData.dst_top = 0 + status.topoffset + ((fb->height - status.bottomoffset) / 2);
250                        bltData.dst_right  = fb->width - status.rightoffset;
251                        bltData.dst_bottom = fb->height - status.bottomoffset;
252
253                        if (ioctl(fb->fd, STMFBIO_BLT, &bltData) < 0)
254                        {
255                                perr("ioctl STMFBIO_BLT");
256                        }
257                        if(ioctl(fb->fd, STMFBIO_SYNC_BLITTER) < 0)
258                        {
259                                perr("ioctl STMFBIO_SYNC_BLITTER");
260                        }
261                }
262        }
263#else
264#ifdef NOFB
265        if(status.rguidfd > -1)
266        {
267                char* buf = NULL;
268                buf = scale(fbnode->fb, fbnode->width, fbnode->height, 4, 320, 240, 0);
269                if(buf != NULL)
270                {
271                        socksend(&status.rguidfd, (unsigned char*)buf, 320 * 240 * 4, 5000 * 1000);
272                        free(buf); buf = NULL;
273                }
274        }
275        if(status.write_png == 1 && status.infobaraktiv == 0)
276        {
277                char* buf = NULL;
278                buf = scale(fbnode->fb, fbnode->width, fbnode->height, 4, 320, 240, 0);
279                if(buf != NULL)
280                {
281                        if(writeFBfile.ActBuf == NULL)
282                        {
283                                writeFBfile.buf1 = malloc(4 * 320 * 240);
284                                writeFBfile.ActBuf = writeFBfile.buf1;
285                                memcpy(writeFBfile.buf1, (unsigned char*)buf, 4 * 320 * 240);
286                                addtimer(&fb2png_thread, START, 10000, 1, NULL, NULL, NULL);
287                        }
288                        else if(writeFBfile.buf1 == writeFBfile.ActBuf)
289                        {
290                                if(writeFBfile.buf2 == NULL)
291                                        writeFBfile.buf2 = malloc(4 * 320 * 240);
292                                memcpy(writeFBfile.buf2, (unsigned char*)buf, 4 * 320 * 240);
293                        }
294                        else if(writeFBfile.buf2 == writeFBfile.ActBuf)
295                        {
296                                if(writeFBfile.buf1 == NULL)
297                                        writeFBfile.buf1 = malloc(4 * 320 * 240);
298                                memcpy(writeFBfile.buf1, (unsigned char*)buf, 4 * 320 * 240);
299                        }
300                        //fb2png((unsigned char*)buf, 320, 240, "/tmp/titanlcd.png");
301                        free(buf); buf = NULL;
302                }
303        }
304
305        if(fbnode != fb)
306        {
307                for(i = 0; i < fbnode->height; i++)
308                {
309                        memcpy(fb->fb + (i * fb->pitch), fbnode->fb + (i * fbnode->pitch), fbnode->width * fbnode->colbytes);
310                }
311        }
312        system("killall -9 xloadimage");
313
314        FILE *fd;
315        fd=fopen("titan.png", "w");
316        fwrite(fb->fb, fb->varfbsize, 1, fd);
317        fclose(fd);
318
319        system("fbgrab -f titan.png -w 1280 -h 720 -b 32 titan1.png > /dev/null");
320        system("xloadimage titan1.png > /dev/null &");
321#endif
322#endif
323*/
324}
325
326void setfbtransparent(int value)
327{
328/*
329#ifndef SIMULATE
330        struct stmfbio_var_screeninfo_ex varEx = {0};
331
332        varEx.layerid  = 0;
333        varEx.activate = STMFBIO_ACTIVATE_IMMEDIATE;
334        varEx.caps = STMFBIO_VAR_CAPS_OPACITY;
335        varEx.opacity = value;
336
337
338        if(ioctl(fb->fd, STMFBIO_SET_VAR_SCREENINFO_EX, &varEx) < 0)
339                perr("STMFBIO_SET_VAR_SCREENINFO_EX");
340#endif
341*/
342}
343
344int allocbpamem(size_t size, int *memfd, unsigned char **mem)
345{
346        return -1;
347}
348
349void freebpamem(int memfd, unsigned char* mem, size_t len)
350{
351}
352
353//mode 0: with fill (draw to skinfb)
354//mode 1: without fill (draw to skinfb)
355//mode 2: with fill (draw to fb)
356//mode 3: without fill (draw to fb)
357void blitrect(int posx, int posy, int width, int height, long color, int transparent, int mode)
358{
359        //debug(1000, "in");
360        int y, x;
361        unsigned long tmpcol;
362       
363        if(posx < 0) posx = 0;
364        if(posx > skinfb->width) posx = skinfb->width;
365        if(posy < 0) posy = 0;
366        if(posy > skinfb->height) posy = skinfb->height;
367        if(posx + width > skinfb->width) width = skinfb->width - posx;
368        if(posy + height > skinfb->height) height = skinfb->height - posy;
369
370        if(width <= 0 || height <= 0) return;
371
372        transparent = (transparent - 255) * -1;
373        tmpcol = color | ((transparent & 0xff) << 24);
374
375        if(mode == 0 || mode == 2)
376        {
377                for(y = 0; y < height; y++)
378                {
379                        for(x = 0; x < width; x++)
380                        {
381                                drawpixel(posx + x, posy + y, tmpcol);
382                        }
383                }
384        }
385        else if(mode == 1 || mode == 3)
386        {
387                //topline
388                for(x = 0; x < width; x++)
389                        drawpixel(posx + x, posy, tmpcol);
390                //bottomline
391                for(x = 0; x < width; x++)
392                        drawpixel(posx + x, posy + height - 1, tmpcol);
393                //leftline
394                for(y = 0; y < height; y++)
395                        drawpixel(posx, posy + y, tmpcol);
396                //rightline
397                for(y = 0; y < height; y++)
398                        drawpixel(posx + width - 1, posy + y, tmpcol);
399        }
400        //debug(1000, "out");
401
402/*
403        unsigned long tmpcol;
404
405        transparent = (transparent - 255) * -1;
406        tmpcol = color | ((transparent & 0xff) << 24);
407
408        STMFBIO_BLT_DATA  bltData;
409        memset(&bltData, 0, sizeof(STMFBIO_BLT_DATA));
410
411        if(posx < 0) posx = 0;
412        if(posy < 0) posy = 0;
413        if(mode < 2)
414        {
415                if(posx > skinfb->width) posx = skinfb->width;
416                if(posy > skinfb->height) posy = skinfb->height;
417                if(posx + width > skinfb->width) width = skinfb->width - posx;
418                if(posy + height > skinfb->height) height = skinfb->height - posy;
419        }
420        else
421        {
422                if(posx > fb->width) posx = fb->width;
423                if(posy > fb->height) posy = fb->height;
424                if(posx + width > fb->width) width = fb->width - posx;
425                if(posy + height > fb->height) height = fb->height - posy;
426        }
427
428        if(width <= 0 || height <= 0) return;
429
430        if(mode == 0 || mode == 2)
431                bltData.operation  = BLT_OP_FILL;
432        else if(mode == 1 || mode == 3)
433                bltData.operation  = BLT_OP_DRAW_RECTANGLE;
434        bltData.colour     = tmpcol;
435        bltData.srcFormat  = SURF_ARGB8888;
436        bltData.srcMemBase = STMFBGP_FRAMEBUFFER;
437
438        if(status.usedirectfb == 1)
439                bltData.dstOffset  = 0;
440        else
441        {
442                if(mode < 2)
443                        bltData.dstOffset  = fb->varfbsize;
444                else
445                        bltData.dstOffset  = 0;
446        }
447        if(mode < 2)
448                bltData.dstPitch   = skinfb->pitch;
449        else
450                bltData.dstPitch   = fb->pitch;
451        bltData.dst_top    = posy;
452        bltData.dst_left   = posx;
453        bltData.dst_bottom = posy + height;
454        bltData.dst_right  = posx + width;
455        bltData.dstFormat  = SURF_ARGB8888;
456        bltData.dstMemBase = STMFBGP_FRAMEBUFFER;
457
458        if(ioctl(fb->fd, STMFBIO_BLT, &bltData) < 0)
459        {
460                perr("ioctl STMFBIO_BLT");
461        }
462        if(ioctl(fb->fd, STMFBIO_SYNC_BLITTER) < 0)
463        {
464                perr("ioctl STMFBIO_SYNC_BLITTER");
465        }
466*/
467}
468
469int readjpg(const char* filename, unsigned long* width, unsigned long* height, unsigned long* rowbytes, int* channels, unsigned char **mem, int *memfd)
470{
471/*
472#ifndef SIMULATE
473        FILE *fp;
474        unsigned int temp1, temp2;
475
476        if(filename == NULL) return -1;
477
478        debug(200, "hardware decode picture (%s)...", filename);
479
480        if (!(fp = fopen(filename, "rb")))
481                return -1;
482         
483        if(get_jpeg_img_size(fp, &temp1, &temp2) != LIBMMEIMG_SUCCESS)
484                return -1;
485       
486        *width = temp1;
487        *height = temp2;
488        *channels = 3;
489        *rowbytes = *channels * temp1;
490       
491        if(allocbpamem(temp1 * temp2 * (*channels), memfd, mem) != 0)
492        {
493                fclose(fp);
494                return -1;
495        }
496               
497        if(decode_jpeg_noalloc(fp, temp1, temp2, temp1, temp2, (char *)*mem, 1) == LIBMMEIMG_SUCCESS)
498        {
499                fclose(fp);
500                return 0;
501        }
502       
503        fclose(fp);
504        freebpamem(*memfd, *mem, temp1 * temp2 * (*channels));
505        err("hardware decode error");
506#endif
507        return -1;
508*/
509}
510
511//flag 0: blit from accelfb to skinfb
512//flag 1: blit from skinfb to accelfb
513void blitscale(int posx, int posy, int width, int height, int scalewidth, int scaleheight, int flag)
514{
515/*
516#ifndef SIMULATE
517        STMFBIO_BLT_DATA  blt_data;
518        memset(&blt_data, 0, sizeof(STMFBIO_BLT_DATA));
519
520        if(scalewidth == 0) scalewidth = width;
521        if(scaleheight == 0) scaleheight = height;
522
523        if(posx < 0) posx = 0;
524        if(posx > skinfb->width) posx = skinfb->width;
525        if(posy < 0) posy = 0;
526        if(posy > skinfb->height) posy = skinfb->height;
527        if(posx + scalewidth > skinfb->width) scalewidth = skinfb->width - posx;
528        if(posy + scaleheight > skinfb->height) scaleheight = skinfb->height - posy;
529       
530        if(width <= 0 || height <= 0 || scalewidth <= 0 || scaleheight <= 0) return;
531       
532        if(flag == 1 && (scalewidth * scaleheight * 4) > accelfb->varfbsize)
533        {
534                err("accelfb to small %d -> %lu ", scalewidth * scaleheight * 4, accelfb->varfbsize);
535                return;
536        }
537
538        blt_data.operation  = BLT_OP_COPY;
539       
540        if(flag == 0)
541        {
542                if(status.usedirectfb == 1)
543                        blt_data.srcOffset  = fb->varfbsize;
544                else
545                        blt_data.srcOffset  = fb->varfbsize + skinfb->varfbsize;
546        }
547        else
548        {
549                if(status.usedirectfb == 1)
550                        blt_data.srcOffset  = 0;
551                else
552                        blt_data.srcOffset  = fb->varfbsize;
553        }
554       
555        blt_data.srcPitch   = width * 4;
556        blt_data.src_top    = 0;
557        blt_data.src_left   = 0;
558        blt_data.src_right  = width;
559        blt_data.src_bottom = height;
560        blt_data.srcFormat  = SURF_ARGB8888;
561        blt_data.srcMemBase = STMFBGP_FRAMEBUFFER;
562       
563        if(flag == 0)
564        {
565                if(status.usedirectfb == 1)
566                {
567                        blt_data.dstOffset  = 0;
568                        blt_data.dstPitch   = fb->pitch;
569                }
570                else
571                {
572                        blt_data.dstOffset  = fb->varfbsize;
573                        blt_data.dstPitch   = skinfb->pitch;
574                }
575        }
576        else
577        {
578                if(status.usedirectfb == 1)
579                {
580                        blt_data.dstOffset  = fb->varfbsize;
581                        blt_data.dstPitch   = skinfb->pitch;
582                }
583                else
584                {
585                        blt_data.dstOffset  = fb->varfbsize + skinfb->varfbsize;
586                        blt_data.dstPitch   = scalewidth * 4;
587                }
588        }
589       
590        blt_data.dst_left   = posx;
591        blt_data.dst_top    = posy;
592        blt_data.dst_right  = posx + scalewidth;
593        blt_data.dst_bottom = posy + scaleheight;
594        blt_data.dstFormat  = SURF_ARGB8888;
595        blt_data.dstMemBase = STMFBGP_FRAMEBUFFER;
596       
597        if (ioctl(fb->fd, STMFBIO_BLT, &blt_data) < 0)
598        {
599                perr("ioctl STMFBIO_BLT");
600        }
601        if(ioctl(fb->fd, STMFBIO_SYNC_BLITTER) < 0)
602        {
603                perr("ioctl STMFBIO_SYNC_BLITTER");
604        }
605#endif
606*/
607}
608
609void blitjpg(unsigned char* buf, int posx, int posy, int width, int height, int scalewidth, int scaleheight)
610{
611/*
612#ifndef SIMULATE
613        STMFBIO_BLT_EXTERN_DATA blt_data;
614        memset(&blt_data, 0, sizeof(STMFBIO_BLT_EXTERN_DATA));
615
616        blt_data.operation  = BLT_OP_COPY;
617        blt_data.ulFlags    = 0;
618        blt_data.srcOffset  = 0;
619        blt_data.srcPitch   = width * 3;
620        blt_data.dstOffset  = 0;
621        blt_data.dstPitch   = skinfb->pitch;
622        blt_data.src_top    = 0;
623        blt_data.src_left   = 0;
624        blt_data.src_right  = width;
625        blt_data.src_bottom = height;
626        blt_data.dst_left   = posx;
627        blt_data.dst_top    = posy;
628       
629        if(scalewidth == 0)  scalewidth = width;
630        if(scaleheight == 0) scaleheight = height;
631       
632        blt_data.dst_right  = posx + scalewidth;
633        blt_data.dst_bottom = posy + scaleheight;
634        blt_data.srcFormat  = SURF_BGR888;
635        blt_data.dstFormat  = SURF_ARGB8888;
636        blt_data.srcMemBase = (char *)buf;
637        blt_data.dstMemBase = (char *)skinfb->fb;
638        blt_data.srcMemSize = width * height * 3;
639        blt_data.dstMemSize = skinfb->pitch * skinfb->height;
640       
641        if(ioctl(skinfb->fd, STMFBIO_BLT_EXTERN, &blt_data) < 0)
642        {
643                err("ioctl STMFBIO_BLT_EXTERN");
644        }
645        if(ioctl(fb->fd, STMFBIO_SYNC_BLITTER) < 0)
646        {
647                perr("ioctl STMFBIO_SYNC_BLITTER");
648        }
649#endif
650*/
651}
652
653void sighandler(int sig, struct sigcontext ctx)
654{
655/*
656        debug(1000, "in");
657        switch(sig)
658        {
659                case SIGUSR1:
660                {
661                        //todo all configs
662                        reloadconfig(status.configfile);
663                        reloadconfig(getconfig("ownconfig", NULL));
664                        break;
665                }
666                case SIGSEGV:
667                case SIGBUS:
668                case SIGABRT:
669                {
670#ifdef SIMULATE
671                        //intel
672                        debugstack((void *)ctx.eip, NULL);
673                        err("got signal %d, fault address 0x%lx from 0x%lx", sig, ctx.cr2, ctx.eip);
674#else
675                        // sh4
676                        //unsigned long sc_regs[16];
677                        //unsigned long sc_pc; //programm counter register
678                        //unsigned long sc_pr; //procedure register
679                        //unsigned long sc_sr; //status register
680                        //unsigned long sc_gbr;
681                        //unsigned long sc_mach;
682                        //unsigned long sc_macl;
683
684                        debugstack((void *)ctx.sc_pr, (void *)ctx.sc_pc);
685                        err("got signal %d, programm counter reg: 0x%lx,  procedure reg: 0x%lx", sig, ctx.sc_pc, ctx.sc_pr);
686#endif
687                        if(getconfigint("saverun", NULL) == 1 && status.longjumpbuf != NULL)
688                                siglongjmp(status.longjumpbuf, 1);
689                        else
690                                exit(100);
691                        break;
692                }
693        }
694        debug(1000, "out");
695*/
696}
697
698#endif
Note: See TracBrowser for help on using the repository browser.