omapvrfb.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * VRFB Rotation Engine
  3. *
  4. * Copyright (C) 2009 Nokia Corporation
  5. * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. */
  20. #ifndef __OMAP_VRFB_H__
  21. #define __OMAP_VRFB_H__
  22. #define OMAP_VRFB_LINE_LEN 2048
  23. struct vrfb {
  24. u8 context;
  25. void __iomem *vaddr[4];
  26. unsigned long paddr[4];
  27. u16 xres;
  28. u16 yres;
  29. u16 xoffset;
  30. u16 yoffset;
  31. u8 bytespp;
  32. bool yuv_mode;
  33. };
  34. #ifdef CONFIG_OMAP2_VRFB
  35. extern bool omap_vrfb_supported(void);
  36. extern int omap_vrfb_request_ctx(struct vrfb *vrfb);
  37. extern void omap_vrfb_release_ctx(struct vrfb *vrfb);
  38. extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
  39. u8 bytespp);
  40. extern u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp);
  41. extern u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp);
  42. extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
  43. u16 width, u16 height,
  44. unsigned bytespp, bool yuv_mode);
  45. extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot);
  46. extern void omap_vrfb_restore_context(void);
  47. #else
  48. static inline bool omap_vrfb_supported(void) { return false; }
  49. static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; }
  50. static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {}
  51. static inline void omap_vrfb_adjust_size(u16 *width, u16 *height,
  52. u8 bytespp) {}
  53. static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp)
  54. { return 0; }
  55. static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp)
  56. { return 0; }
  57. static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
  58. u16 width, u16 height, unsigned bytespp, bool yuv_mode) {}
  59. static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot)
  60. { return 0; }
  61. static inline void omap_vrfb_restore_context(void) {}
  62. #endif
  63. #endif /* __VRFB_H */