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