Rev 2131 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2131 | Rev 2424 | ||
---|---|---|---|
Line 753... | Line 753... | ||
753 | 753 | ||
754 | switch (IPC_GET_METHOD(*call)) { |
754 | switch (IPC_GET_METHOD(*call)) { |
755 | case IPC_M_AS_AREA_SEND: |
755 | case IPC_M_AS_AREA_SEND: |
756 | /* We accept one area for data interchange */ |
756 | /* We accept one area for data interchange */ |
757 | if (IPC_GET_ARG1(*call) == shm_id) { |
757 | if (IPC_GET_ARG1(*call) == shm_id) { |
758 | void *dest = as_get_mappable_page(IPC_GET_ARG2(*call), |
758 | void *dest = as_get_mappable_page(IPC_GET_ARG2(*call)); |
759 | PAGE_COLOR(IPC_GET_ARG1(*call))); |
- | |
760 | shm_size = IPC_GET_ARG2(*call); |
759 | shm_size = IPC_GET_ARG2(*call); |
761 | if (!ipc_answer_fast(callid, 0, (sysarg_t) dest, 0)) |
760 | if (!ipc_answer_fast(callid, 0, (sysarg_t) dest, 0)) |
762 | shm = dest; |
761 | shm = dest; |
763 | else |
762 | else |
764 | shm_id = 0; |
763 | shm_id = 0; |
Line 832... | Line 831... | ||
832 | 831 | ||
833 | static void |
832 | static void |
834 | copy_vp_to_pixmap(viewport_t *vport, pixmap_t *pmap) |
833 | copy_vp_to_pixmap(viewport_t *vport, pixmap_t *pmap) |
835 | { |
834 | { |
836 | int y; |
835 | int y; |
837 | int rowsize; |
836 | int tmp, srcrowsize; |
838 | int tmp; |
837 | int realwidth, realheight, realrowsize; |
839 | int width = vport->width; |
838 | int width = vport->width; |
840 | int height = vport->height; |
839 | int height = vport->height; |
841 | 840 | ||
842 | if (width + vport->x > screen.xres) |
841 | if (width + vport->x > screen.xres) |
843 | width = screen.xres - vport->x; |
842 | width = screen.xres - vport->x; |
844 | if (height + vport->y > screen.yres) |
843 | if (height + vport->y > screen.yres) |
845 | height = screen.yres - vport->y; |
844 | height = screen.yres - vport->y; |
846 | 845 | ||
847 | rowsize = width * screen.pixelbytes; |
846 | realwidth = pmap->width <= width ? pmap->width : width; |
- | 847 | realheight = pmap->height <= height ? pmap->height : height; |
|
848 | 848 | ||
- | 849 | srcrowsize = vport->width * screen.pixelbytes; |
|
- | 850 | realrowsize = realwidth * screen.pixelbytes; |
|
- | 851 | ||
849 | for (y = 0; y < height; y++) { |
852 | for (y = 0; y < realheight; y++) { |
850 | tmp = (vport->y + y) * screen.scanline + |
853 | tmp = (vport->y + y) * screen.scanline + |
851 | vport->x * screen.pixelbytes; |
854 | vport->x * screen.pixelbytes; |
852 | memcpy(pmap->data + rowsize * y, screen.fbaddress + tmp, |
855 | memcpy(pmap->data + srcrowsize * y, screen.fbaddress + tmp, |
853 | rowsize); |
856 | realrowsize); |
854 | } |
857 | } |
855 | } |
858 | } |
856 | 859 | ||
857 | /** Save viewport to pixmap */ |
860 | /** Save viewport to pixmap */ |
858 | static int |
861 | static int |
Line 1367... | Line 1370... | ||
1367 | fb_scanline = sysinfo_value("fb.scanline"); |
1370 | fb_scanline = sysinfo_value("fb.scanline"); |
1368 | fb_visual = sysinfo_value("fb.visual"); |
1371 | fb_visual = sysinfo_value("fb.visual"); |
1369 | fb_invert_colors = sysinfo_value("fb.invert-colors"); |
1372 | fb_invert_colors = sysinfo_value("fb.invert-colors"); |
1370 | 1373 | ||
1371 | asz = fb_scanline * fb_height; |
1374 | asz = fb_scanline * fb_height; |
1372 | fb_addr = as_get_mappable_page(asz, (int) |
1375 | fb_addr = as_get_mappable_page(asz); |
1373 | sysinfo_value("fb.address.color")); |
- | |
1374 | 1376 | ||
1375 | physmem_map(fb_ph_addr, fb_addr, ALIGN_UP(asz, PAGE_SIZE) >> |
1377 | physmem_map(fb_ph_addr, fb_addr, ALIGN_UP(asz, PAGE_SIZE) >> |
1376 | PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE); |
1378 | PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE); |
1377 | 1379 | ||
1378 | if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual, |
1380 | if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual, |