1 #ifndef __UC_OVERLAY_H__ 2 #define __UC_OVERLAY_H__ 3 4 #define UC_OVL_CAPS (DLCAPS_SURFACE | DLCAPS_OPACITY | DLCAPS_SCREEN_LOCATION \ 5 | DLCAPS_DEINTERLACING | DLCAPS_BRIGHTNESS | DLCAPS_CONTRAST \ 6 | DLCAPS_SATURATION | DLCAPS_HUE) 7 #define UC_OVL_OPTIONS (DLOP_DEINTERLACING) 8 9 #define ALIGN_TO(v, n) (((v) + (n-1)) & ~(n-1)) 10 #define UC_MAP_V1_FIFO_CONTROL(depth, pre_thr, thr) \ 11 (((depth)-1) | ((thr) << 8) | ((pre_thr) << 24)) 12 13 // Actions for uc_ovl_update() 14 15 #define UC_OVL_FLIP 1 16 #define UC_OVL_CHANGE 2 17 #define UC_OVL_FIELD 4 18 19 /** Overlay layer data. */ 20 struct uc_ovl_vinfo { 21 bool isenabled; // True when visible 22 DFBRectangle win; // Layer screen rectangle. 23 DFBDisplayLayerConfig cfg; // Layer configuration 24 int ox, oy; // Top-left visible corner (the offset) 25 // in the source surface 26 u8 opacity; // Layer opacity 27 int level; // Position in the DirectFB layer stack 28 // < 0 = underlay mode, > 0 = overlay mode 29 DFBColorAdjustment adj; // Color adjustment (brightness etc) 30 }; 31 32 typedef struct _UcOverlayData { 33 34 // TODO: initialize the variables!!! 35 36 u8 hwrev; // CLE266 revision 37 int scrwidth; // Current screen width 38 39 bool extfifo_on; // True when we're using the extended fifo. 40 u8 mclk_save[3]; 41 42 struct uc_ovl_vinfo v1; // Video overlay V1 43 44 bool deinterlace; 45 int field; 46 47 CoreSurface *surface; 48 49 CoreSurfaceBufferLock *lock; 50 } UcOverlayData; 51 52 53 // Video engine - mapping functions (uc_ovl_hwmap.c) 54 55 bool uc_ovl_map_vzoom(int sh, int dh, u32* zoom, u32* mini); 56 bool uc_ovl_map_hzoom(int sw, int dw, u32* zoom, u32* mini, 57 u32* falign, u32* dcount); 58 u32 uc_ovl_map_qwpitch(int falign, DFBSurfacePixelFormat format, int sw); 59 u32 uc_ovl_map_format(DFBSurfacePixelFormat format); 60 void uc_ovl_map_window(int scrw, int scrh, DFBRectangle* win, int sw, int sh, 61 u32* win_start, u32* win_end, int* ox, int* oy); 62 void uc_ovl_map_buffer(DFBSurfacePixelFormat format, u32 buf, 63 int x, int y, int w, int h, int pitch, int field, 64 u32* y_start, u32* u_start, u32* v_start); 65 u32 uc_ovl_map_alpha(int opacity); 66 void uc_ovl_map_v1_control(DFBSurfacePixelFormat format, int sw, 67 int hwrev, bool extfifo_on, 68 u32* control, u32* fifo); 69 u32 uc_ovl_map_fifo(u8 depth, u8 pre_thr, u8 thr); 70 void uc_ovl_map_adjustment(DFBColorAdjustment* adj, u32* a1, u32* a2); 71 72 // Video engine - setting functions (uc_ovl_hwset.c) 73 74 void uc_ovl_setup_fifo(UcOverlayData* ucovl, int scrwidth); 75 void uc_ovl_vcmd_wait(volatile u8* vio); 76 DFBResult uc_ovl_update(UcDriverData* ucdrv, 77 UcOverlayData* ucovl, int action, 78 CoreSurface* surface, 79 CoreSurfaceBufferLock* lock); 80 DFBResult uc_ovl_set_adjustment(CoreLayer *layer, 81 void *driver_data, 82 void *layer_data, 83 DFBColorAdjustment *adj); 84 85 #endif // __UC_OVERLAY_H__ 86