• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2 /*
3  * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
4  */
5 
6 #ifndef __MSM_ROTATOR_H__
7 #define __MSM_ROTATOR_H__
8 
9 #include <linux/types.h>
10 #include <linux/msm_mdp.h>
11 
12 #define MSM_ROTATOR_IOCTL_MAGIC 'R'
13 
14 #define MSM_ROTATOR_IOCTL_START   \
15 		_IOWR(MSM_ROTATOR_IOCTL_MAGIC, 1, struct msm_rotator_img_info)
16 #define MSM_ROTATOR_IOCTL_ROTATE   \
17 		_IOW(MSM_ROTATOR_IOCTL_MAGIC, 2, struct msm_rotator_data_info)
18 #define MSM_ROTATOR_IOCTL_FINISH   \
19 		_IOW(MSM_ROTATOR_IOCTL_MAGIC, 3, int)
20 
21 #define ROTATOR_VERSION_01	0xA5B4C301
22 
23 enum rotator_clk_type {
24 	ROTATOR_CORE_CLK,
25 	ROTATOR_PCLK,
26 	ROTATOR_IMEM_CLK
27 };
28 
29 struct msm_rotator_img_info {
30 	unsigned int session_id;
31 	struct msmfb_img  src;
32 	struct msmfb_img  dst;
33 	struct mdp_rect src_rect;
34 	unsigned int    dst_x;
35 	unsigned int    dst_y;
36 	unsigned char   rotations;
37 	int enable;
38 	unsigned int	downscale_ratio;
39 	unsigned int secure;
40 };
41 
42 struct msm_rotator_data_info {
43 	int session_id;
44 	struct msmfb_data src;
45 	struct msmfb_data dst;
46 	unsigned int version_key;
47 	struct msmfb_data src_chroma;
48 	struct msmfb_data dst_chroma;
49 };
50 
51 struct msm_rot_clocks {
52 	const char *clk_name;
53 	enum rotator_clk_type clk_type;
54 	unsigned int clk_rate;
55 };
56 
57 struct msm_rotator_platform_data {
58 	unsigned int number_of_clocks;
59 	unsigned int hardware_version_number;
60 	struct msm_rot_clocks *rotator_clks;
61 	struct msm_bus_scale_pdata *bus_scale_table;
62 	char rot_iommu_split_domain;
63 };
64 #endif
65 
66