1 #ifndef __SH7722__TYPES_H__ 2 #define __SH7722__TYPES_H__ 3 4 #include <core/layers.h> 5 6 #include <sh772x_gfx.h> 7 8 #include <shbeu/shbeu.h> 9 10 11 #define SH7722GFX_MAX_PREPARE 8192 12 13 14 typedef enum { 15 SH7722_LAYER_INPUT1, 16 SH7722_LAYER_INPUT2, 17 SH7722_LAYER_INPUT3, 18 SH7722_LAYER_MULTIWIN 19 } SH7722LayerID; 20 21 22 typedef struct { 23 SH7722LayerID layer; 24 } SH7722LayerData; 25 26 typedef struct { 27 int magic; 28 29 CoreLayerRegionConfig config; 30 31 CoreSurface *surface; 32 CorePalette *palette; 33 } SH7722RegionData; 34 35 36 typedef struct { 37 unsigned int added; 38 unsigned int visible; 39 } SH7722MultiLayerData; 40 41 typedef struct { 42 int magic; 43 44 int index; 45 CoreLayerRegionConfig config; 46 47 CoreSurface *surface; 48 CorePalette *palette; 49 } SH7722MultiRegionData; 50 51 52 typedef struct { 53 int sh772x; 54 55 int lcd_width; 56 int lcd_height; 57 int lcd_offset; 58 int lcd_pitch; 59 int lcd_size; 60 unsigned long lcd_phys; 61 DFBSurfacePixelFormat lcd_format; 62 63 /* state validation */ 64 int v_flags; 65 66 /* prepared register values */ 67 u32 ble_srcf; 68 u32 ble_dstf; 69 70 /* cached values */ 71 unsigned long dst_phys; 72 int dst_pitch; 73 int dst_bpp; 74 int dst_index; 75 76 unsigned long src_phys; 77 int src_pitch; 78 int src_bpp; 79 int src_index; 80 81 unsigned long mask_phys; 82 int mask_pitch; 83 DFBSurfacePixelFormat mask_format; 84 int mask_index; 85 DFBPoint mask_offset; 86 DFBSurfaceMaskFlags mask_flags; 87 88 DFBSurfaceDrawingFlags dflags; 89 DFBSurfaceBlittingFlags bflags; 90 DFBSurfaceRenderOptions render_options; 91 92 bool ckey_b_enabled; 93 bool color_change_enabled; 94 bool mask_enabled; 95 96 unsigned int input_mask; 97 98 s32 matrix[6]; 99 DFBColor color; 100 101 /* locking */ 102 FusionSkirmish beu_lock; 103 104 105 /* sh7723 */ 106 u32 rclr; 107 u32 color16; 108 109 /* libshbeu */ 110 struct shbeu_surface shbeu_src[3]; 111 struct shbeu_surface shbeu_dest; 112 113 } SH7722DeviceData; 114 115 116 typedef struct { 117 SH7722DeviceData *dev; 118 119 CoreDFB *core; 120 CoreGraphicsDevice *device; 121 122 CoreScreen *screen; 123 124 CoreLayer *multi; 125 CoreLayer *input1; 126 CoreLayer *input2; 127 CoreLayer *input3; 128 129 int gfx_fd; 130 SH772xGfxSharedArea *gfx_shared; 131 132 int prep_num; 133 __u32 prep_buf[SH7722GFX_MAX_PREPARE]; 134 135 volatile void *mmio_base; 136 137 int num_inputs; 138 139 volatile void *lcd_virt; 140 141 142 /* for libshbeu */ 143 SHBEU *shbeu; 144 145 } SH7722DriverData; 146 147 #endif 148 149