sh_mobile_meram.h 928 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef __sh_mobile_meram_h__
  2. #define __sh_mobile_meram_h__
  3. #include <linux/mutex.h>
  4. #include <video/sh_mobile_meram.h>
  5. /*
  6. * MERAM private
  7. */
  8. #define MERAM_ICB_Y 0x1
  9. #define MERAM_ICB_C 0x2
  10. /* MERAM cache size */
  11. #define SH_MOBILE_MERAM_ICB_NUM 32
  12. #define SH_MOBILE_MERAM_CACHE_OFFSET(p) ((p) >> 16)
  13. #define SH_MOBILE_MERAM_CACHE_SIZE(p) ((p) & 0xffff)
  14. struct sh_mobile_meram_priv {
  15. void __iomem *base;
  16. struct mutex lock;
  17. unsigned long used_icb;
  18. int used_meram_cache_regions;
  19. unsigned long used_meram_cache[SH_MOBILE_MERAM_ICB_NUM];
  20. };
  21. int sh_mobile_meram_alloc_icb(const struct sh_mobile_meram_cfg *cfg,
  22. int xres,
  23. int yres,
  24. unsigned int base_addr,
  25. int yuv_mode,
  26. int *marker_icb,
  27. int *out_pitch);
  28. void sh_mobile_meram_free_icb(int marker_icb);
  29. #define SH_MOBILE_MERAM_START(ind, ab) \
  30. (0xC0000000 | ((ab & 0x1) << 23) | ((ind & 0x1F) << 24))
  31. #endif /* !__sh_mobile_meram_h__ */