| 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_atomic_state; |
| 14 | struct intel_crtc; |
| 15 | struct intel_crtc_state; |
| 16 | struct intel_display; |
| 17 | struct intel_dsb; |
| 18 | |
| 19 | enum pipe; |
| 20 | |
| 21 | enum intel_dsb_id { |
| 22 | INTEL_DSB_0, |
| 23 | INTEL_DSB_1, |
| 24 | INTEL_DSB_2, |
| 25 | |
| 26 | I915_MAX_DSBS, |
| 27 | }; |
| 28 | |
| 29 | unsigned int intel_dsb_size(struct intel_dsb *dsb); |
| 30 | unsigned int intel_dsb_head(struct intel_dsb *dsb); |
| 31 | struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state, |
| 32 | struct intel_crtc *crtc, |
| 33 | enum intel_dsb_id dsb_id, |
| 34 | unsigned int max_cmds); |
| 35 | void intel_dsb_finish(struct intel_dsb *dsb); |
| 36 | void intel_dsb_gosub_finish(struct intel_dsb *dsb); |
| 37 | void intel_dsb_cleanup(struct intel_dsb *dsb); |
| 38 | int intel_dsb_exec_time_us(void); |
| 39 | void intel_dsb_reg_write(struct intel_dsb *dsb, |
| 40 | i915_reg_t reg, u32 val); |
| 41 | void intel_dsb_reg_write_indexed(struct intel_dsb *dsb, |
| 42 | i915_reg_t reg, u32 val); |
| 43 | void intel_dsb_reg_write_masked(struct intel_dsb *dsb, |
| 44 | i915_reg_t reg, u32 mask, u32 val); |
| 45 | void intel_dsb_noop(struct intel_dsb *dsb, int count); |
| 46 | void intel_dsb_nonpost_start(struct intel_dsb *dsb); |
| 47 | void intel_dsb_nonpost_end(struct intel_dsb *dsb); |
| 48 | void intel_dsb_interrupt(struct intel_dsb *dsb); |
| 49 | void intel_dsb_wait_usec(struct intel_dsb *dsb, int count); |
| 50 | void intel_dsb_wait_vblanks(struct intel_dsb *dsb, int count); |
| 51 | void intel_dsb_wait_for_delayed_vblank(struct intel_atomic_state *state, |
| 52 | struct intel_dsb *dsb); |
| 53 | void intel_dsb_wait_scanline_in(struct intel_atomic_state *state, |
| 54 | struct intel_dsb *dsb, |
| 55 | int lower, int upper); |
| 56 | void intel_dsb_wait_scanline_out(struct intel_atomic_state *state, |
| 57 | struct intel_dsb *dsb, |
| 58 | int lower, int upper); |
| 59 | void intel_dsb_vblank_evade(struct intel_atomic_state *state, |
| 60 | struct intel_dsb *dsb); |
| 61 | void intel_dsb_poll(struct intel_dsb *dsb, |
| 62 | i915_reg_t reg, u32 mask, u32 val, |
| 63 | int wait_us, int count); |
| 64 | void intel_dsb_gosub(struct intel_dsb *dsb, |
| 65 | struct intel_dsb *sub_dsb); |
| 66 | void intel_dsb_chain(struct intel_atomic_state *state, |
| 67 | struct intel_dsb *dsb, |
| 68 | struct intel_dsb *chained_dsb, |
| 69 | bool wait_for_vblank); |
| 70 | |
| 71 | void intel_dsb_commit(struct intel_dsb *dsb); |
| 72 | void intel_dsb_wait(struct intel_dsb *dsb); |
| 73 | |
| 74 | void intel_dsb_irq_handler(struct intel_display *display, |
| 75 | enum pipe pipe, enum intel_dsb_id dsb_id); |
| 76 | |
| 77 | #endif |
| 78 | |