fbdev/amifb: Correct check for video memory size
[linux-2.6.git] / drivers / video / sh_mobile_meram.h
1 #ifndef __sh_mobile_meram_h__
2 #define __sh_mobile_meram_h__
3
4 #include <linux/mutex.h>
5 #include <video/sh_mobile_meram.h>
6
7 /*
8  * MERAM private
9  */
10
11 #define MERAM_ICB_Y 0x1
12 #define MERAM_ICB_C 0x2
13
14 /* MERAM cache size */
15 #define SH_MOBILE_MERAM_ICB_NUM         32
16
17 #define SH_MOBILE_MERAM_CACHE_OFFSET(p) ((p) >> 16)
18 #define SH_MOBILE_MERAM_CACHE_SIZE(p)   ((p) & 0xffff)
19
20 struct sh_mobile_meram_priv {
21         void __iomem    *base;
22         struct mutex    lock;
23         unsigned long   used_icb;
24         int             used_meram_cache_regions;
25         unsigned long   used_meram_cache[SH_MOBILE_MERAM_ICB_NUM];
26 };
27
28 int sh_mobile_meram_alloc_icb(const struct sh_mobile_meram_cfg *cfg,
29                    int xres,
30                    int yres,
31                    unsigned int base_addr,
32                    int yuv_mode,
33                    int *marker_icb,
34                    int *out_pitch);
35
36 void sh_mobile_meram_free_icb(int marker_icb);
37
38 #define SH_MOBILE_MERAM_START(ind, ab) \
39         (0xC0000000 | ((ab & 0x1) << 23) | ((ind & 0x1F) << 24))
40
41 #endif /* !__sh_mobile_meram_h__ */