2 * Copyright (C) 2012 Spreadtrum Communications Inc.
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 #ifndef _SPRD_SCALE_H_
14 #define _SPRD_SCALE_H_
26 enum scale_data_endian_e {
30 SCALE_ENDIAN_HALFLITTLE,
35 SCALE_MODE_NORMAL = 0,
37 SCALE_MODE_SLICE_READDR,
41 enum scale_process_e {
42 SCALE_PROCESS_SUCCESS = 0,
43 SCALE_PROCESS_EXIT = -1,
44 SCALE_PROCESS_SYS_BUSY = -2,
45 SCALE_PROCESS_MAX = 0xFF
66 struct scale_endian_sel_t {
73 struct scale_slice_param_t {
74 uint32_t slice_height;
75 struct scale_rect_t input_rect;
76 struct scale_addr_t input_addr;
77 struct scale_addr_t output_addr;
80 struct scale_frame_param_t {
81 struct scale_size_t input_size;
82 struct scale_rect_t input_rect;
83 enum scale_fmt_e input_format;
84 struct scale_addr_t input_addr;
85 struct scale_endian_sel_t input_endian;
86 struct scale_size_t output_size;
87 enum scale_fmt_e output_format;
88 struct scale_addr_t output_addr;
89 struct scale_endian_sel_t output_endian;
90 enum scale_mode_e scale_mode;
91 uint32_t slice_height;
95 struct scale_frame_info_t {
106 struct scale_endian_sel_t endian;
107 enum scale_process_e scale_result;
111 #define SCALE_IO_MAGIC 'S'
113 #define SCALE_IO_START _IOW(SCALE_IO_MAGIC, 0, struct scale_frame_param_t)
114 #define SCALE_IO_CONTINUE _IOW(SCALE_IO_MAGIC, 1, struct scale_slice_param_t)
115 #define SCALE_IO_DONE _IOW(SCALE_IO_MAGIC, 2, struct scale_slice_param_t)