9
9
10
10
#define DSB_BUF_SIZE (2 * PAGE_SIZE)
11
11
12
+ /**
13
+ * DOC: DSB
14
+ *
15
+ * A DSB (Display State Buffer) is a queue of MMIO instructions in the memory
16
+ * which can be offloaded to DSB HW in Display Controller. DSB HW is a DMA
17
+ * engine that can be programmed to download the DSB from memory.
18
+ * It allows driver to batch submit display HW programming. This helps to
19
+ * reduce loading time and CPU activity, thereby making the context switch
20
+ * faster. DSB Support added from Gen12 Intel graphics based platform.
21
+ *
22
+ * DSB's can access only the pipe, plane, and transcoder Data Island Packet
23
+ * registers.
24
+ *
25
+ * DSB HW can support only register writes (both indexed and direct MMIO
26
+ * writes). There are no registers reads possible with DSB HW engine.
27
+ */
28
+
12
29
/* DSB opcodes. */
13
30
#define DSB_OPCODE_SHIFT 24
14
31
#define DSB_OPCODE_MMIO_WRITE 0x1
@@ -66,6 +83,17 @@ static inline bool intel_dsb_disable_engine(struct intel_dsb *dsb)
66
83
return true;
67
84
}
68
85
86
+ /**
87
+ * intel_dsb_get() - Allocate DSB context and return a DSB instance.
88
+ * @crtc: intel_crtc structure to get pipe info.
89
+ *
90
+ * This function provides handle of a DSB instance, for the further DSB
91
+ * operations.
92
+ *
93
+ * Returns: address of Intel_dsb instance requested for.
94
+ * Failure: Returns the same DSB instance, but without a command buffer.
95
+ */
96
+
69
97
struct intel_dsb *
70
98
intel_dsb_get (struct intel_crtc * crtc )
71
99
{
@@ -116,6 +144,14 @@ intel_dsb_get(struct intel_crtc *crtc)
116
144
return dsb ;
117
145
}
118
146
147
+ /**
148
+ * intel_dsb_put() - To destroy DSB context.
149
+ * @dsb: intel_dsb structure.
150
+ *
151
+ * This function destroys the DSB context allocated by a dsb_get(), by
152
+ * unpinning and releasing the VMA object associated with it.
153
+ */
154
+
119
155
void intel_dsb_put (struct intel_dsb * dsb )
120
156
{
121
157
struct intel_crtc * crtc = container_of (dsb , typeof (* crtc ), dsb );
@@ -138,6 +174,19 @@ void intel_dsb_put(struct intel_dsb *dsb)
138
174
}
139
175
}
140
176
177
+ /**
178
+ * intel_dsb_indexed_reg_write() -Write to the DSB context for auto
179
+ * increment register.
180
+ * @dsb: intel_dsb structure.
181
+ * @reg: register address.
182
+ * @val: value.
183
+ *
184
+ * This function is used for writing register-value pair in command
185
+ * buffer of DSB for auto-increment register. During command buffer overflow,
186
+ * a warning is thrown and rest all erroneous condition register programming
187
+ * is done through mmio write.
188
+ */
189
+
141
190
void intel_dsb_indexed_reg_write (struct intel_dsb * dsb , i915_reg_t reg ,
142
191
u32 val )
143
192
{
@@ -202,6 +251,18 @@ void intel_dsb_indexed_reg_write(struct intel_dsb *dsb, i915_reg_t reg,
202
251
buf [dsb -> free_pos ] = 0 ;
203
252
}
204
253
254
+ /**
255
+ * intel_dsb_reg_write() -Write to the DSB context for normal
256
+ * register.
257
+ * @dsb: intel_dsb structure.
258
+ * @reg: register address.
259
+ * @val: value.
260
+ *
261
+ * This function is used for writing register-value pair in command
262
+ * buffer of DSB. During command buffer overflow, a warning is thrown
263
+ * and rest all erroneous condition register programming is done
264
+ * through mmio write.
265
+ */
205
266
void intel_dsb_reg_write (struct intel_dsb * dsb , i915_reg_t reg , u32 val )
206
267
{
207
268
struct intel_crtc * crtc = container_of (dsb , typeof (* crtc ), dsb );
@@ -225,6 +286,13 @@ void intel_dsb_reg_write(struct intel_dsb *dsb, i915_reg_t reg, u32 val)
225
286
i915_mmio_reg_offset (reg );
226
287
}
227
288
289
+ /**
290
+ * intel_dsb_commit() - Trigger workload execution of DSB.
291
+ * @dsb: intel_dsb structure.
292
+ *
293
+ * This function is used to do actual write to hardware using DSB.
294
+ * On errors, fall back to MMIO. Also this function help to reset the context.
295
+ */
228
296
void intel_dsb_commit (struct intel_dsb * dsb )
229
297
{
230
298
struct intel_crtc * crtc = container_of (dsb , typeof (* crtc ), dsb );
0 commit comments