Rev 4375 | Rev 4501 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4375 | Rev 4377 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | #include "compiler.h" |
44 | #include "compiler.h" |
45 | #include "sna.h" |
45 | #include "sna.h" |
46 | #include "sna_reg.h" |
46 | #include "sna_reg.h" |
Line 47... | Line 47... | ||
47 | 47 | ||
- | 48 | #include |
|
- | 49 | #include "../pixdriver.h" |
|
48 | #include |
50 | |
Line 49... | Line 51... | ||
49 | #include |
51 | #include |
Line 50... | Line 52... | ||
50 | 52 | ||
Line 55... | Line 57... | ||
55 | int t; |
57 | int t; |
56 | int r; |
58 | int r; |
57 | int b; |
59 | int b; |
58 | } rect_t; |
60 | } rect_t; |
Line 59... | Line -... | ||
59 | - | ||
60 | struct pix_driver |
- | |
61 | { |
- | |
62 | char *name; |
- | |
63 | - | ||
64 | int (*create_bitmap)(bitmap_t * bitmap); |
- | |
65 | int (*destroy_bitmap)(bitmap_t * bitmap); |
- | |
66 | int (*lock_bitmap)(bitmap_t * bitmap); |
- | |
67 | int (*blit)(bitmap_t * bitmap, bool scale, int dst_x, int dst_y, |
- | |
68 | int w, int h, int src_x, int src_y); |
- | |
69 | int (*resize_bitmap)(bitmap_t * bitmap); |
- | |
70 | void (*fini)(void); |
- | |
71 | }; |
- | |
72 | - | ||
73 | 61 | ||
74 | static struct sna_fb sna_fb; |
62 | static struct sna_fb sna_fb; |
Line 75... | Line 63... | ||
75 | static int tls_mask; |
63 | static int tls_mask; |
Line 689... | Line 677... | ||
689 | if (y2 <= y1 + 4) |
677 | if (y2 <= y1 + 4) |
690 | return false; |
678 | return false; |
Line 691... | Line 679... | ||
691 | 679 | ||
Line 692... | Line 680... | ||
692 | full_height = y1 == 0 && y2 == crtc->b - crtc->t; |
680 | full_height = y1 == 0 && y2 == crtc->b - crtc->t; |
693 | 681 | ||
694 | pipe = 0; |
682 | pipe = sna_fb.pipe; |
Line 695... | Line 683... | ||
695 | DBG(("%s: pipe=%d, y1=%d, y2=%d, full_height?=%d\n", |
683 | DBG(("%s: pipe=%d, y1=%d, y2=%d, full_height?=%d\n", |
696 | __FUNCTION__, pipe, y1, y2, full_height)); |
684 | __FUNCTION__, pipe, y1, y2, full_height)); |
Line 1090... | Line 1078... | ||
1090 | return -1; |
1078 | return -1; |
1091 | }; |
1079 | }; |
Line 1092... | Line 1080... | ||
1092 | 1080 | ||
1093 | 1081 | ||
Line 1094... | Line 1082... | ||
1094 | 1082 | ||
1095 | int sna_blit_tex(bitmap_t *bitmap, bool scale, int dst_x, int dst_y, |
1083 | int sna_blit_tex(bitmap_t *bitmap, int scale, int vsync, |
Line 1096... | Line 1084... | ||
1096 | int w, int h, int src_x, int src_y) |
1084 | int dst_x, int dst_y,int w, int h, int src_x, int src_y) |
Line 1163... | Line 1151... | ||
1163 | 1151 | ||
Line 1164... | Line 1152... | ||
1164 | src_bo = sf->bo; |
1152 | src_bo = sf->bo; |
Line 1165... | Line 1153... | ||
1165 | 1153 | ||
1166 | __lock_acquire_recursive(__sna_lock); |
1154 | __lock_acquire_recursive(__sna_lock); |
1167 | 1155 | ||
Line 1168... | Line 1156... | ||
1168 | #if 0 |
1156 | if(vsync) |
1169 | { |
1157 | { |
Line 1180... | Line 1168... | ||
1180 | clip.b = clip.t+h-1; |
1168 | clip.b = clip.t+h-1; |
Line 1181... | Line 1169... | ||
1181 | 1169 | ||
1182 | kgem_set_mode(&sna_device->kgem, KGEM_RENDER, sna_fb.fb_bo); |
1170 | kgem_set_mode(&sna_device->kgem, KGEM_RENDER, sna_fb.fb_bo); |
1183 | sna_wait_for_scanline(sna_device, &crtc, &clip); |
1171 | sna_wait_for_scanline(sna_device, &crtc, &clip); |
1184 | } |
- | |
Line 1185... | Line 1172... | ||
1185 | #endif |
1172 | } |
1186 | 1173 | ||
1187 | if( sna_device->render.blit_tex(sna_device, PictOpSrc,scale, |
1174 | if( sna_device->render.blit_tex(sna_device, PictOpSrc,scale, |
1188 | &src, src_bo, |
1175 | &src, src_bo, |
Line 1221... | Line 1208... | ||
1221 | } |
1208 | } |
Line 1222... | Line 1209... | ||
1222 | 1209 | ||
1223 | 1210 | ||
1224 | static void sna_fini() |
- | |
1225 | { |
- | |
1226 | ENTER(); |
1211 | static void sna_fini() |
1227 | 1212 | { |
|
1228 | if( sna_device ) |
1213 | if( sna_device ) |
Line 1229... | Line 1214... | ||
1229 | { |
1214 | { |
Line 1240... | Line 1225... | ||
1240 | kgem_cleanup_cache(&sna_device->kgem); |
1225 | kgem_cleanup_cache(&sna_device->kgem); |
Line 1241... | Line 1226... | ||
1241 | 1226 | ||
1242 | sna_device = NULL; |
1227 | sna_device = NULL; |
1243 | __lock_release_recursive(__sna_lock); |
1228 | __lock_release_recursive(__sna_lock); |
1244 | }; |
- | |
1245 | LEAVE(); |
1229 | }; |
Line 1246... | Line 1230... | ||
1246 | } |
1230 | } |
1247 | 1231 | ||
1248 | uint32_t DrvInit(uint32_t service, struct pix_driver *driver) |
1232 | uint32_t DrvInit(uint32_t service, struct pix_driver *driver) |