1#ifndef __S3CTVSCALER_H_
2 #define __S3CTVSCALER_H_
3
4 #include "plat/media.h"
5
6 #define TVSCALER_IOCTL_MAGIC 'S'
7
8 #define PPROC_SET_PARAMS _IO(TVSCALER_IOCTL_MAGIC, 0)
9 #define PPROC_START _IO(TVSCALER_IOCTL_MAGIC, 1)
10 #define PPROC_STOP _IO(TVSCALER_IOCTL_MAGIC, 2)
11 #define PPROC_INTERLACE_MODE _IO(TVSCALER_IOCTL_MAGIC, 3)
12 #define PPROC_PROGRESSIVE_MODE _IO(TVSCALER_IOCTL_MAGIC, 4)
13
14
15 #define QVGA_XSIZE 320
16 #define QVGA_YSIZE 240
17
18 #define LCD_XSIZE 320
19 #define LCD_YSIZE 240
20
21 #define SCALER_MINOR 251 // Just some number
22
23 //#define SYSTEM_RAM 0x08000000 // 128mb
24 #define SYSTEM_RAM 0x07800000 // 120mb
25 #define RESERVE_POST_MEM 8*1024*1024 // 8mb
26 #define PRE_BUFF_SIZE 4*1024*1024 //4 // 4mb
27 #define POST_BUFF_SIZE ( RESERVE_POST_MEM - PRE_BUFF_SIZE )
28
29 typedef unsigned int UINT32;
30
31 #define post_buff_base_addr 0x55B00000
32 #define POST_BUFF_BASE_ADDR (UINT32)s3c_get_media_memory(S3C_MDEV_TV)
33
34 #define USE_DEDICATED_MEM 1
35
36 typedef enum {
37 INTERLACE_MODE,
38 PROGRESSIVE_MODE
39 } s3c_scaler_scan_mode_t;
40
41 typedef enum {
42 POST_DMA, POST_FIFO
43 } s3c_scaler_path_t;
44
45 typedef enum {
46 ONE_SHOT, FREE_RUN
47 } s3c_scaler_run_mode_t;
48
49 typedef enum {
50 PAL1, PAL2, PAL4, PAL8,
51 RGB8, ARGB8, RGB16, ARGB16, RGB18, RGB24, RGB30, ARGB24,
52 YC420, YC422, // Non-interleave
53 CRYCBY, CBYCRY, YCRYCB, YCBYCR, YUV444 // Interleave
54 } cspace_t;
55
56 typedef enum
57 {
58 HCLK = 0, PLL_EXT = 1, EXT_27MHZ = 3
59 } scaler_clk_src_t;
60
61 typedef struct{
62 unsigned int SrcFullWidth; // Source Image Full Width(Virtual screen size)
63 unsigned int SrcFullHeight; // Source Image Full Height(Virtual screen size)
64 unsigned int SrcStartX; // Source Image Start width offset
65 unsigned int SrcStartY; // Source Image Start height offset
66 unsigned int SrcWidth; // Source Image Width
67 unsigned int SrcHeight; // Source Image Height
68 unsigned int SrcFrmSt; // Base Address of the Source Image : Physical Address
69 cspace_t SrcCSpace; // Color Space ot the Source Image
70
71 unsigned int DstFullWidth; // Source Image Full Width(Virtual screen size)
72 unsigned int DstFullHeight; // Source Image Full Height(Virtual screen size)
73 unsigned int DstStartX; // Source Image Start width offset
74 unsigned int DstStartY; // Source Image Start height offset
75 unsigned int DstWidth; // Source Image Width
76 unsigned int DstHeight; // Source Image Height
77 unsigned int DstFrmSt; // Base Address of the Source Image : Physical Address
78 cspace_t DstCSpace; // Color Space ot the Source Image
79
80 unsigned int SrcFrmBufNum; // Frame buffer number
81 s3c_scaler_run_mode_t Mode; // POST running mode(PER_FRAME or FREE_RUN)
82 s3c_scaler_path_t InPath; // Data path of the source image
83 s3c_scaler_path_t OutPath; // Data path of the desitination image
84
85 }scaler_params_t;
86
87 typedef struct{
88 unsigned int pre_phy_addr;
89 unsigned char *pre_virt_addr;
90
91 unsigned int post_phy_addr;
92 unsigned char *post_virt_addr;
93 } buff_addr_t;
94
95 #endif //__S3CTVSCALER_H_
2 #define __S3CTVSCALER_H_
3
4 #include "plat/media.h"
5
6 #define TVSCALER_IOCTL_MAGIC 'S'
7
8 #define PPROC_SET_PARAMS _IO(TVSCALER_IOCTL_MAGIC, 0)
9 #define PPROC_START _IO(TVSCALER_IOCTL_MAGIC, 1)
10 #define PPROC_STOP _IO(TVSCALER_IOCTL_MAGIC, 2)
11 #define PPROC_INTERLACE_MODE _IO(TVSCALER_IOCTL_MAGIC, 3)
12 #define PPROC_PROGRESSIVE_MODE _IO(TVSCALER_IOCTL_MAGIC, 4)
13
14
15 #define QVGA_XSIZE 320
16 #define QVGA_YSIZE 240
17
18 #define LCD_XSIZE 320
19 #define LCD_YSIZE 240
20
21 #define SCALER_MINOR 251 // Just some number
22
23 //#define SYSTEM_RAM 0x08000000 // 128mb
24 #define SYSTEM_RAM 0x07800000 // 120mb
25 #define RESERVE_POST_MEM 8*1024*1024 // 8mb
26 #define PRE_BUFF_SIZE 4*1024*1024 //4 // 4mb
27 #define POST_BUFF_SIZE ( RESERVE_POST_MEM - PRE_BUFF_SIZE )
28
29 typedef unsigned int UINT32;
30
31 #define post_buff_base_addr 0x55B00000
32 #define POST_BUFF_BASE_ADDR (UINT32)s3c_get_media_memory(S3C_MDEV_TV)
33
34 #define USE_DEDICATED_MEM 1
35
36 typedef enum {
37 INTERLACE_MODE,
38 PROGRESSIVE_MODE
39 } s3c_scaler_scan_mode_t;
40
41 typedef enum {
42 POST_DMA, POST_FIFO
43 } s3c_scaler_path_t;
44
45 typedef enum {
46 ONE_SHOT, FREE_RUN
47 } s3c_scaler_run_mode_t;
48
49 typedef enum {
50 PAL1, PAL2, PAL4, PAL8,
51 RGB8, ARGB8, RGB16, ARGB16, RGB18, RGB24, RGB30, ARGB24,
52 YC420, YC422, // Non-interleave
53 CRYCBY, CBYCRY, YCRYCB, YCBYCR, YUV444 // Interleave
54 } cspace_t;
55
56 typedef enum
57 {
58 HCLK = 0, PLL_EXT = 1, EXT_27MHZ = 3
59 } scaler_clk_src_t;
60
61 typedef struct{
62 unsigned int SrcFullWidth; // Source Image Full Width(Virtual screen size)
63 unsigned int SrcFullHeight; // Source Image Full Height(Virtual screen size)
64 unsigned int SrcStartX; // Source Image Start width offset
65 unsigned int SrcStartY; // Source Image Start height offset
66 unsigned int SrcWidth; // Source Image Width
67 unsigned int SrcHeight; // Source Image Height
68 unsigned int SrcFrmSt; // Base Address of the Source Image : Physical Address
69 cspace_t SrcCSpace; // Color Space ot the Source Image
70
71 unsigned int DstFullWidth; // Source Image Full Width(Virtual screen size)
72 unsigned int DstFullHeight; // Source Image Full Height(Virtual screen size)
73 unsigned int DstStartX; // Source Image Start width offset
74 unsigned int DstStartY; // Source Image Start height offset
75 unsigned int DstWidth; // Source Image Width
76 unsigned int DstHeight; // Source Image Height
77 unsigned int DstFrmSt; // Base Address of the Source Image : Physical Address
78 cspace_t DstCSpace; // Color Space ot the Source Image
79
80 unsigned int SrcFrmBufNum; // Frame buffer number
81 s3c_scaler_run_mode_t Mode; // POST running mode(PER_FRAME or FREE_RUN)
82 s3c_scaler_path_t InPath; // Data path of the source image
83 s3c_scaler_path_t OutPath; // Data path of the desitination image
84
85 }scaler_params_t;
86
87 typedef struct{
88 unsigned int pre_phy_addr;
89 unsigned char *pre_virt_addr;
90
91 unsigned int post_phy_addr;
92 unsigned char *post_virt_addr;
93 } buff_addr_t;
94
95 #endif //__S3CTVSCALER_H_