Changeset 26471
- Timestamp:
- 02/25/14 22:46:21 (9 years ago)
- Location:
- titan/titan
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/fb.h
r26467 r26471 225 225 } 226 226 227 printf("[Framebuffer] %dk video mem\n", fix_screeninfo.smem_len/1024);228 227 if(!(mmapfb = (unsigned char*)mmap(0, fix_screeninfo.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0))) 229 228 { … … 232 231 return NULL; 233 232 } 233 234 debug(100, "%dk video mem", fix_screeninfo.smem_len/1024); 235 236 lfb = (unsigned char*)mmap(0, fix_screeninfo.smem_len, PROT_WRITE|PROT_READ, MAP_SHARED, fd, 0); 237 if (!lfb) 238 { 239 perror("mmap"); 240 goto nolfb; 241 } 242 243 if (checkbox("ATEMIO5000") == 1 && var_screeninfo.bits_per_pixel != 32) 244 { 245 debug(100, "Only 32 bit per pixel supported. Framebuffer currently use %d", var_screeninfo.bits_per_pixel); 246 closefb(); 247 return 0; 248 } 249 234 250 235 251 if(devnr == 0) … … 257 273 } 258 274 259 printf("framebuffer not available.\n"); 275 debug(100, "framebuffer not available."); 276 260 277 return 0; 261 278 // blinking work end … … 264 281 void closefb() 265 282 { 266 267 283 if(checkbox("ATEMIO5000") == 1) 268 284 { 269 285 if(lfb) 270 286 { 271 printf("33\n");287 debug(100, "ms_sync"); 272 288 msync(lfb, fix_screeninfo.smem_len, MS_SYNC); 273 289 munmap(lfb, fix_screeninfo.smem_len); … … 275 291 if(fb->fd >= 0) 276 292 { 277 printf("44\n");293 debug(100, "close"); 278 294 disablemanualblit(); 279 295 close(fb->fd); … … 320 336 void changefbresolution(char *value, int flag) 321 337 { 338 debug(100, "fb->colbytes: %d", fb->colbytes); 339 if(checkbox("ATEMIO5000") == 1) return; 340 322 341 if(ostrcmp("pal", value) == 0) 323 342 { 324 343 fb->width = 720; 325 344 fb->height = 576; 326 if(checkbox("ATEMIO5000") == 1) 327 fb->pitch = fb->width * (fb->colbytes * 8); 328 else 329 fb->pitch = fb->width * fb->colbytes; 345 fb->pitch = fb->width * fb->colbytes; 330 346 } 331 347 else if(ostrncmp("576", value, 3) == 0) … … 333 349 fb->width = 720; 334 350 fb->height = 576; 335 if(checkbox("ATEMIO5000") == 1) 336 fb->pitch = fb->width * (fb->colbytes * 8); 337 else 338 fb->pitch = fb->width * fb->colbytes; 339 351 fb->pitch = fb->width * fb->colbytes; 340 352 } 341 353 else if(ostrncmp("720", value, 3) == 0) … … 343 355 fb->width = 1280; 344 356 fb->height = 720; 345 if(checkbox("ATEMIO5000") == 1) 346 fb->pitch = fb->width * (fb->colbytes * 8); 347 else 348 fb->pitch = fb->width * fb->colbytes; 349 357 fb->pitch = fb->width * fb->colbytes; 350 358 } 351 359 else if(ostrncmp("1080", value, 4) == 0) … … 353 361 fb->width = 1920; 354 362 fb->height = 1080; 355 if(checkbox("ATEMIO5000") == 1) 356 fb->pitch = fb->width * (fb->colbytes * 8); 357 else 358 fb->pitch = fb->width * fb->colbytes; 359 363 fb->pitch = fb->width * fb->colbytes; 360 364 } 361 365 if(skinfb == fb) -
titan/titan/mipselport.h
r26464 r26471 15 15 int g_manual_blit = 0; 16 16 struct fb_fix_screeninfo fix_screeninfo; 17 struct fb_var_screeninfo var_screeninfo; 17 18 18 19 int setmixer(struct dvbdev* node, int left, int right) … … 63 64 if(newnode != NULL) 64 65 newnode->varfbsize = 1920 * 1080 * newnode->colbytes; 66 // newnode->varfbsize = 1920 * 1080 * (newnode->colbytes * 8); 67 65 68 } 66 69 … … 81 84 else 82 85 g_manual_blit = 0; 86 } 87 88 void blit() 89 { 90 if (g_manual_blit == 1) { 91 if (ioctl(fb->fd, FBIO_BLIT) < 0) 92 perror("FBIO_BLIT"); 93 } 83 94 } 84 95 … … 117 128 var_screeninfo.yoffset = 0; 118 129 var_screeninfo.bits_per_pixel = fb->colbytes * 8; 119 130 120 131 switch(fb->colbytes) 121 132 { … … 142 153 } 143 154 155 debug(100, "FB: line_length %d", fix_screeninfo.line_length); 156 debug(100, "FB: var_screeninfo.xres %d", var_screeninfo.xres); 157 debug(100, "FB: var_screeninfo.yres %d", var_screeninfo.yres); 158 debug(100, "FB: var_screeninfo.xres_virt %d", var_screeninfo.xres_virtual); 159 debug(100, "FB: var_screeninfo.yres_virt %d", var_screeninfo.yres_virtual); 160 debug(100, "FB: var_screeninfo.xoffset %d", var_screeninfo.xoffset); 161 debug(100, "FB: var_screeninfo.yoffset %d", var_screeninfo.yoffset); 162 debug(100, "FB: var_screeninfo.bits_per_pixel %d", var_screeninfo.bits_per_pixel); 163 debug(100, "FB: var_screeninfo.grayscale %d", var_screeninfo.grayscale); 144 164 145 165 if(ioctl(fb->fd, FBIOPUT_VSCREENINFO, &var_screeninfo) < 0) … … 150 170 perr("FBIOPUT_VSCREENINFO"); 151 171 } 152 } 153 154 if (g_manual_blit == 1) { 155 if (ioctl(fb->fd, FBIO_BLIT) < 0) 156 perr("FBIO_BLIT"); 157 } 158 172 debug(100, "FB: double buffering not available"); 173 } 174 else 175 { 176 debug(100, "FB: double buffering available!"); 177 } 178 179 ioctl(fb->fd, FBIOGET_VSCREENINFO, &var_screeninfo); 180 // if ((var_screeninfo.xres!=fb->width) && (var_screeninfo.yres!=fb->height) && (var_screeninfo.bits_per_pixel!=fb->colbytes)) 181 // { 182 debug(100, "SetMode failed: wanted: %dx%dx%d, got %dx%dx%d", 183 fb->width, fb->height, fb->colbytes, 184 var_screeninfo.xres, var_screeninfo.yres, var_screeninfo.bits_per_pixel); 185 // } 186 /* 187 int xRes, yRes, stride, bpp; 188 189 xRes=var_screeninfo.xres; 190 yRes=var_screeninfo.yres; 191 bpp=var_screeninfo.bits_per_pixel; 192 // fb_fix_screeninfo fix; 193 // struct fb_fix_screeninfo fix_screeninfo; 194 if (ioctl(fb->fd, FBIOGET_FSCREENINFO, &fix_screeninfo)<0) 195 { 196 perror("FBIOGET_FSCREENINFO"); 197 printf("fb failed\n"); 198 } 199 stride=fix_screeninfo.line_length; 200 memset(lfb, 0, stride*yRes); 201 */ 202 blit(); 203 159 204 /* 160 205 int i = 0, max = 1, wstep = 0, hstep = 0, ret = 0;
Note: See TracChangeset
for help on using the changeset viewer.