This source file includes following definitions.
- rcar_du_has
- rcar_du_needs
- rcar_du_read
- rcar_du_write
1
2
3
4
5
6
7
8
9
10 #ifndef __RCAR_DU_DRV_H__
11 #define __RCAR_DU_DRV_H__
12
13 #include <linux/kernel.h>
14 #include <linux/wait.h>
15
16 #include "rcar_du_crtc.h"
17 #include "rcar_du_group.h"
18 #include "rcar_du_vsp.h"
19
20 struct clk;
21 struct device;
22 struct drm_device;
23 struct drm_property;
24 struct rcar_du_device;
25 struct rcar_du_encoder;
26
27 #define RCAR_DU_FEATURE_CRTC_IRQ_CLOCK BIT(0)
28 #define RCAR_DU_FEATURE_VSP1_SOURCE BIT(1)
29 #define RCAR_DU_FEATURE_INTERLACED BIT(2)
30 #define RCAR_DU_FEATURE_TVM_SYNC BIT(3)
31
32 #define RCAR_DU_QUIRK_ALIGN_128B BIT(0)
33
34
35
36
37
38
39
40
41
42
43 struct rcar_du_output_routing {
44 unsigned int possible_crtcs;
45 unsigned int port;
46 };
47
48
49
50
51
52
53
54
55
56
57
58
59 struct rcar_du_device_info {
60 unsigned int gen;
61 unsigned int features;
62 unsigned int quirks;
63 unsigned int channels_mask;
64 struct rcar_du_output_routing routes[RCAR_DU_OUTPUT_MAX];
65 unsigned int num_lvds;
66 unsigned int dpll_mask;
67 unsigned int lvds_clk_mask;
68 };
69
70 #define RCAR_DU_MAX_CRTCS 4
71 #define RCAR_DU_MAX_GROUPS DIV_ROUND_UP(RCAR_DU_MAX_CRTCS, 2)
72 #define RCAR_DU_MAX_VSPS 4
73
74 struct rcar_du_device {
75 struct device *dev;
76 const struct rcar_du_device_info *info;
77
78 void __iomem *mmio;
79
80 struct drm_device *ddev;
81
82 struct rcar_du_crtc crtcs[RCAR_DU_MAX_CRTCS];
83 unsigned int num_crtcs;
84
85 struct rcar_du_encoder *encoders[RCAR_DU_OUTPUT_MAX];
86
87 struct rcar_du_group groups[RCAR_DU_MAX_GROUPS];
88 struct rcar_du_vsp vsps[RCAR_DU_MAX_VSPS];
89
90 struct {
91 struct drm_property *colorkey;
92 } props;
93
94 unsigned int dpad0_source;
95 unsigned int dpad1_source;
96 unsigned int vspd1_sink;
97 };
98
99 static inline bool rcar_du_has(struct rcar_du_device *rcdu,
100 unsigned int feature)
101 {
102 return rcdu->info->features & feature;
103 }
104
105 static inline bool rcar_du_needs(struct rcar_du_device *rcdu,
106 unsigned int quirk)
107 {
108 return rcdu->info->quirks & quirk;
109 }
110
111 static inline u32 rcar_du_read(struct rcar_du_device *rcdu, u32 reg)
112 {
113 return ioread32(rcdu->mmio + reg);
114 }
115
116 static inline void rcar_du_write(struct rcar_du_device *rcdu, u32 reg, u32 data)
117 {
118 iowrite32(data, rcdu->mmio + reg);
119 }
120
121 #endif