- Timestamp:
- 2006-05-18T21:45:16Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 35f3b8c
- Parents:
- 59477e3
- Location:
- genarch
- Files:
-
- 2 edited
-
include/fb/fb.h (modified) (1 diff)
-
src/fb/fb.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
genarch/include/fb/fb.h
r59477e3 r8424198 35 35 extern spinlock_t fb_lock; 36 36 void fb_init(__address addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan); 37 void fb_register(void);38 37 39 38 #endif -
genarch/src/fb/fb.c
r59477e3 r8424198 33 33 #include <sysinfo/sysinfo.h> 34 34 #include <mm/slab.h> 35 #include <mm/as.h> 36 #include <bitops.h> 37 #include <align.h> 35 38 #include <panic.h> 36 39 #include <memstr.h> … … 313 316 /** Initialize framebuffer as a chardev output device 314 317 * 315 * @param addr Address of theframebuffer318 * @param addr Physical address of the framebuffer 316 319 * @param x Screen width in pixels 317 320 * @param y Screen height in pixels … … 346 349 panic("Unsupported bpp"); 347 350 } 348 349 fbaddress = (unsigned char *) addr; 351 352 unsigned int fbsize = scan * y; 353 unsigned int fborder; 354 355 if (fbsize <= FRAME_SIZE) 356 fborder = 0; 357 else 358 fborder = (fnzb32(fbsize - 1) + 1) - FRAME_WIDTH; 359 360 /* Map the framebuffer */ 361 fbaddress = (__u8 *) PA2KA(PFN2ADDR(frame_alloc(fborder, FRAME_KA))); 362 363 pfn_t i; 364 for (i = 0; i < ADDR2PFN(ALIGN_UP(fbsize, PAGE_SIZE)); i++) 365 page_mapping_insert(AS_KERNEL, (__address) fbaddress + PFN2ADDR(i), addr + PFN2ADDR(i), PAGE_NOT_CACHEABLE); 366 350 367 xres = x; 351 368 yres = y; … … 362 379 chardev_initialize("fb", &framebuffer, &fb_ops); 363 380 stdout = &framebuffer; 364 } 365 366 367 /** Register framebuffer in sysinfo 368 * 369 */ 370 void fb_register(void) 371 { 381 372 382 sysinfo_set_item_val("fb", NULL, true); 373 sysinfo_set_item_val("fb.width", NULL, x res);374 sysinfo_set_item_val("fb.height", NULL, y res);375 sysinfo_set_item_val("fb. scanline", NULL, scanline);376 sysinfo_set_item_val("fb. bpp", NULL, bitspp);377 sysinfo_set_item_val("fb.address. virtual", NULL, (__address) fbaddress);378 } 383 sysinfo_set_item_val("fb.width", NULL, x); 384 sysinfo_set_item_val("fb.height", NULL, y); 385 sysinfo_set_item_val("fb.bpp", NULL, bpp); 386 sysinfo_set_item_val("fb.scanline", NULL, scan); 387 sysinfo_set_item_val("fb.address.physical", NULL, addr); 388 }
Note:
See TracChangeset
for help on using the changeset viewer.
