omapvrfb.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * VRFB Rotation Engine
  4. *
  5. * Copyright (C) 2009 Nokia Corporation
  6. * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
  7. */
  8. #ifndef __OMAP_VRFB_H__
  9. #define __OMAP_VRFB_H__
  10. #define OMAP_VRFB_LINE_LEN 2048
  11. struct vrfb {
  12. u8 context;
  13. void __iomem *vaddr[4];
  14. unsigned long paddr[4];
  15. u16 xres;
  16. u16 yres;
  17. u16 xoffset;
  18. u16 yoffset;
  19. u8 bytespp;
  20. bool yuv_mode;
  21. };
  22. #ifdef CONFIG_OMAP2_VRFB
  23. extern bool omap_vrfb_supported(void);
  24. extern int omap_vrfb_request_ctx(struct vrfb *vrfb);
  25. extern void omap_vrfb_release_ctx(struct vrfb *vrfb);
  26. extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
  27. u8 bytespp);
  28. extern u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp);
  29. extern u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp);
  30. extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
  31. u16 width, u16 height,
  32. unsigned bytespp, bool yuv_mode);
  33. extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot);
  34. extern void omap_vrfb_restore_context(void);
  35. #else
  36. static inline bool omap_vrfb_supported(void) { return false; }
  37. static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; }
  38. static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {}
  39. static inline void omap_vrfb_adjust_size(u16 *width, u16 *height,
  40. u8 bytespp) {}
  41. static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp)
  42. { return 0; }
  43. static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp)
  44. { return 0; }
  45. static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
  46. u16 width, u16 height, unsigned bytespp, bool yuv_mode) {}
  47. static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot)
  48. { return 0; }
  49. static inline void omap_vrfb_restore_context(void) {}
  50. #endif
  51. #endif /* __VRFB_H */