Changeset 40591
- Timestamp:
- 07/04/17 18:47:36 (5 years ago)
- Location:
- titan/titan
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/fb.h
r40590 r40591 3 3 4 4 #ifdef CONFIG_ION 5 int m_accel_fd; 6 #endif 5 #define ION_HEAP_TYPE_BMEM (ION_HEAP_TYPE_CUSTOM + 1) 6 #define ION_HEAP_ID_MASK (1 << ION_HEAP_TYPE_BMEM) 7 #define ACCEL_MEM_SIZE (32*1024*1024) 8 int m_accel_fd; 9 #endif 10 11 12 7 13 8 14 struct fb* getfb(char *name) … … 34 40 35 41 #ifndef NOFB 42 43 #ifndef CONFIG_ION 36 44 if(ioctl(fb->fd, FBIOGET_FSCREENINFO, &fix_screeninfo) == -1) 37 45 { … … 39 47 return 0; 40 48 } 49 #else 50 fix_screeninfo.smem_len = ACCEL_MEM_SIZE; 51 #endif 52 41 53 #else 42 54 fix_screeninfo.smem_len = 16*1024*1024; … … 258 270 struct ion_phys_data phys_data; 259 271 int ret; 260 unsigned char *lfb; 261 272 262 273 debug(444,"Using ION allocator"); 263 274 -
titan/titan/mipselport.h
r40580 r40591 96 96 { 97 97 unsigned char tmp = 1; 98 #ifndef CONFIG_ION 98 99 if (ioctl(fb->fd, FBIO_SET_MANUAL_BLIT, &tmp)<0) 99 100 perror("FBIO_SET_MANUAL_BLIT"); 100 101 else 101 102 g_manual_blit = 1; 103 #endif 102 104 } 103 105 … … 105 107 { 106 108 unsigned char tmp = 0; 109 #ifndef CONFIG_ION 107 110 if (ioctl(fb->fd, FBIO_SET_MANUAL_BLIT, &tmp)<0) 108 111 perror("FBIO_SET_MANUAL_BLIT"); 109 112 else 110 113 g_manual_blit = 0; 114 #endif 111 115 } 112 116 113 117 void blit() 114 118 { 119 #if !defined(CONFIG_ION) 115 120 if (g_manual_blit == 1) { 116 121 if (ioctl(fb->fd, FBIO_BLIT) < 0) 117 122 perror("FBIO_BLIT"); 118 123 } 124 #endif 119 125 } 120 126 … … 1654 1660 } 1655 1661 1656 #endif 1662 #ifdef CONFIG_ION 1663 void SetMode() 1664 { 1665 struct fb_var_screeninfo var_screeninfo; 1666 1667 lfb = fb->fb; 1668 /* unmap old framebuffer with old size */ 1669 if (lfb) 1670 munmap(lfb, stride * screeninfo.yres_virtual); 1671 1672 var_screeninfo.xres_virtual = fb->width; 1673 var_screeninfo.xres = fb->width; 1674 var_screeninfo.yres_virtual = fb->height * 2; 1675 var_screeninfo.yres = fb->height; 1676 var_screeninfo.height = 0; 1677 var_screeninfo.width = 0; 1678 var_screeninfo.xoffset = 0; 1679 var_screeninfo.yoffset = 0; 1680 var_screeninfo.bits_per_pixel = fb->colbytes * 8; 1681 1682 switch(fb->colbytes) 1683 { 1684 case 2: 1685 var_screeninfo.transp.offset = 15; 1686 var_screeninfo.transp.length = 1; 1687 var_screeninfo.red.offset = 10; 1688 var_screeninfo.red.length = 5; 1689 var_screeninfo.green.offset = 5; 1690 var_screeninfo.green.length = 5; 1691 var_screeninfo.blue.offset = 0; 1692 var_screeninfo.blue.length = 5; 1693 break; 1694 case 4: 1695 var_screeninfo.transp.offset = 24; 1696 var_screeninfo.transp.length = 8; 1697 var_screeninfo.red.offset = 16; 1698 var_screeninfo.red.length = 8; 1699 var_screeninfo.green.offset = 8; 1700 var_screeninfo.green.length = 8; 1701 var_screeninfo.blue.offset = 0; 1702 var_screeninfo.blue.length = 8; 1703 break; 1704 } 1705 1706 debug(444, "FB: line_length %d", fix_screeninfo.line_length); 1707 debug(444, "FB: var_screeninfo.xres %d", var_screeninfo.xres); 1708 debug(444, "FB: var_screeninfo.yres %d", var_screeninfo.yres); 1709 debug(444, "FB: var_screeninfo.xres_virt %d", var_screeninfo.xres_virtual); 1710 debug(444, "FB: var_screeninfo.yres_virt %d", var_screeninfo.yres_virtual); 1711 debug(444, "FB: var_screeninfo.xoffset %d", var_screeninfo.xoffset); 1712 debug(444, "FB: var_screeninfo.yoffset %d", var_screeninfo.yoffset); 1713 debug(444, "FB: var_screeninfo.bits_per_pixel %d", var_screeninfo.bits_per_pixel); 1714 debug(444, "FB: var_screeninfo.grayscale %d", var_screeninfo.grayscale); 1715 1716 if(ioctl(fb->fd, FBIOPUT_VSCREENINFO, &var_screeninfo) < 0) 1717 { 1718 var_screeninfo.yres_virtual = fb->height; 1719 if(ioctl(fb->fd, FBIOPUT_VSCREENINFO, &var_screeninfo) < 0) 1720 { 1721 perr("FBIOPUT_VSCREENINFO"); 1722 } 1723 debug(444, "FB: double buffering not available"); 1724 } 1725 else 1726 { 1727 debug(444, "FB: double buffering available!"); 1728 } 1729 1730 ioctl(fb->fd, FBIOGET_VSCREENINFO, &var_screeninfo); 1731 if ((var_screeninfo.xres!=fb->width) && (var_screeninfo.yres!=fb->height) && (var_screeninfo.bits_per_pixel!=fb->colbytes)) 1732 { 1733 debug(444, "SetMode failed: wanted: %dx%dx%d, got %dx%dx%d", 1734 fb->width, fb->height, fb->colbytes, 1735 var_screeninfo.xres, var_screeninfo.yres, var_screeninfo.bits_per_pixel); 1736 } 1737 fb_fix_screeninfo fix; 1738 if (ioctl(fb->fd, FBIOGET_FSCREENINFO, &fix)<0) 1739 { 1740 perror("FBIOGET_FSCREENINFO"); 1741 printf("fb failed\n"); 1742 } 1743 /* map new framebuffer */ 1744 lfb=(unsigned char*)mmap(0, fix.line_length * screeninfo.yres_virtual, PROT_WRITE|PROT_READ, MAP_SHARED, fb->fd, 0); 1745 fb->fb = lfb; 1746 fb->fblong = (unsigned long*)fb->fb; 1747 memset(lfb, 0, fix.line_length * screeninfo.yres_virtual); 1748 blit(); 1749 } 1750 #endif 1751 1752 1753 #endif -
titan/titan/titan.c
r40577 r40591 839 839 } 840 840 } 841 #ifdef CONFIG_ION 842 SetMode(); 843 #endif 841 844 #endif 842 845 }
Note: See TracChangeset
for help on using the changeset viewer.