Skip to content

Commit 5dd85e7

Browse files
animesh-mannajnikula
authored andcommitted
drm/i915/dsb: Documentation for DSB.
Added docbook info regarding Display State Buffer(DSB) which is added from gen12 onwards to batch submit display HW programming. v1: Initial version as RFC. Cc: Jani Nikula <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Shashank Sharma <[email protected]> Reviewed-by: Shashank Sharma <[email protected]> Signed-off-by: Animesh Manna <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent dfaa6f2 commit 5dd85e7

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

Documentation/gpu/i915.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@ Display PLLs
246246
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_dpll_mgr.h
247247
:internal:
248248

249+
Display State Buffer
250+
--------------------
251+
252+
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_dsb.c
253+
:doc: DSB
254+
255+
.. kernel-doc:: drivers/gpu/drm/i915/display/intel_dsb.c
256+
:internal:
257+
249258
Memory Management and Command Submission
250259
========================================
251260

drivers/gpu/drm/i915/display/intel_dsb.c

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@
99

1010
#define DSB_BUF_SIZE (2 * PAGE_SIZE)
1111

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+
1229
/* DSB opcodes. */
1330
#define DSB_OPCODE_SHIFT 24
1431
#define DSB_OPCODE_MMIO_WRITE 0x1
@@ -66,6 +83,17 @@ static inline bool intel_dsb_disable_engine(struct intel_dsb *dsb)
6683
return true;
6784
}
6885

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+
6997
struct intel_dsb *
7098
intel_dsb_get(struct intel_crtc *crtc)
7199
{
@@ -116,6 +144,14 @@ intel_dsb_get(struct intel_crtc *crtc)
116144
return dsb;
117145
}
118146

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+
119155
void intel_dsb_put(struct intel_dsb *dsb)
120156
{
121157
struct intel_crtc *crtc = container_of(dsb, typeof(*crtc), dsb);
@@ -138,6 +174,19 @@ void intel_dsb_put(struct intel_dsb *dsb)
138174
}
139175
}
140176

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+
141190
void intel_dsb_indexed_reg_write(struct intel_dsb *dsb, i915_reg_t reg,
142191
u32 val)
143192
{
@@ -202,6 +251,18 @@ void intel_dsb_indexed_reg_write(struct intel_dsb *dsb, i915_reg_t reg,
202251
buf[dsb->free_pos] = 0;
203252
}
204253

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+
*/
205266
void intel_dsb_reg_write(struct intel_dsb *dsb, i915_reg_t reg, u32 val)
206267
{
207268
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)
225286
i915_mmio_reg_offset(reg);
226287
}
227288

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+
*/
228296
void intel_dsb_commit(struct intel_dsb *dsb)
229297
{
230298
struct intel_crtc *crtc = container_of(dsb, typeof(*crtc), dsb);

0 commit comments

Comments
 (0)