Advertisement
Guest User

Untitled

a guest
Dec 15th, 2011
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. int get_ashmem_file(int fd, struct file **filp, unsigned long *start, unsigned long *len)
  2. {
  3. struct file *file = fget(fd);
  4. unsigned long *smi=0x00400000; //physical address SMI+4, 2mb for now
  5.  
  6. if (is_ashmem_file(file)) {
  7. struct ashmem_area *asma = file->private_data;
  8. *filp = file;
  9. *start = asma->file;
  10. *len = asma->size;
  11. memcpy((void *)MSM_ASHMEM_BLIT_BASE, asma->file, asma->size); //copy src img from virt to smi via iomem
  12. *start = smi; //change start addr to smi for blit
  13. return 0;
  14. }
  15. else
  16. fput(file);
  17.  
  18. return -1;
  19. }
  20. EXPORT_SYMBOL(get_ashmem_file);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement