xref: /linux/drivers/gpu/drm/i915/display/intel_dsb.h (revision 429508c84d95811dd1300181dfe84743caff9a38)
1 /* SPDX-License-Identifier: MIT
2  *
3  * Copyright © 2019 Intel Corporation
4  */
5 
6 #ifndef _INTEL_DSB_H
7 #define _INTEL_DSB_H
8 
9 #include <linux/types.h>
10 
11 #include "i915_reg_defs.h"
12 
13 struct intel_crtc;
14 struct intel_crtc_state;
15 struct intel_dsb;
16 
17 enum intel_dsb_id {
18 	INTEL_DSB_0,
19 	INTEL_DSB_1,
20 	INTEL_DSB_2,
21 
22 	I915_MAX_DSBS,
23 };
24 
25 struct intel_dsb *intel_dsb_prepare(const struct intel_crtc_state *crtc_state,
26 				    enum intel_dsb_id dsb_id,
27 				    unsigned int max_cmds);
28 void intel_dsb_finish(struct intel_dsb *dsb);
29 void intel_dsb_cleanup(struct intel_dsb *dsb);
30 void intel_dsb_reg_write(struct intel_dsb *dsb,
31 			 i915_reg_t reg, u32 val);
32 void intel_dsb_reg_write_masked(struct intel_dsb *dsb,
33 				i915_reg_t reg, u32 mask, u32 val);
34 void intel_dsb_noop(struct intel_dsb *dsb, int count);
35 void intel_dsb_nonpost_start(struct intel_dsb *dsb);
36 void intel_dsb_nonpost_end(struct intel_dsb *dsb);
37 
38 void intel_dsb_commit(struct intel_dsb *dsb,
39 		      bool wait_for_vblank);
40 void intel_dsb_wait(struct intel_dsb *dsb);
41 
42 #endif
43