Home | History | Annotate | Line # | Download | only in display
      1  1.1  riastrad /*	$NetBSD: intel_dsb.h,v 1.2 2021/12/18 23:45:30 riastradh Exp $	*/
      2  1.1  riastrad 
      3  1.1  riastrad /* SPDX-License-Identifier: MIT
      4  1.1  riastrad  *
      5  1.1  riastrad  * Copyright  2019 Intel Corporation
      6  1.1  riastrad  */
      7  1.1  riastrad 
      8  1.1  riastrad #ifndef _INTEL_DSB_H
      9  1.1  riastrad #define _INTEL_DSB_H
     10  1.1  riastrad 
     11  1.1  riastrad #include <linux/types.h>
     12  1.1  riastrad 
     13  1.1  riastrad #include "i915_reg.h"
     14  1.1  riastrad 
     15  1.1  riastrad struct intel_crtc;
     16  1.1  riastrad struct i915_vma;
     17  1.1  riastrad 
     18  1.1  riastrad enum dsb_id {
     19  1.1  riastrad 	INVALID_DSB = -1,
     20  1.1  riastrad 	DSB1,
     21  1.1  riastrad 	DSB2,
     22  1.1  riastrad 	DSB3,
     23  1.1  riastrad 	MAX_DSB_PER_PIPE
     24  1.1  riastrad };
     25  1.1  riastrad 
     26  1.1  riastrad struct intel_dsb {
     27  1.1  riastrad 	long refcount;
     28  1.1  riastrad 	enum dsb_id id;
     29  1.1  riastrad 	u32 *cmd_buf;
     30  1.1  riastrad 	struct i915_vma *vma;
     31  1.1  riastrad 
     32  1.1  riastrad 	/*
     33  1.1  riastrad 	 * free_pos will point the first free entry position
     34  1.1  riastrad 	 * and help in calculating tail of command buffer.
     35  1.1  riastrad 	 */
     36  1.1  riastrad 	int free_pos;
     37  1.1  riastrad 
     38  1.1  riastrad 	/*
     39  1.1  riastrad 	 * ins_start_offset will help to store start address of the dsb
     40  1.1  riastrad 	 * instuction and help in identifying the batch of auto-increment
     41  1.1  riastrad 	 * register.
     42  1.1  riastrad 	 */
     43  1.1  riastrad 	u32 ins_start_offset;
     44  1.1  riastrad };
     45  1.1  riastrad 
     46  1.1  riastrad struct intel_dsb *
     47  1.1  riastrad intel_dsb_get(struct intel_crtc *crtc);
     48  1.1  riastrad void intel_dsb_put(struct intel_dsb *dsb);
     49  1.1  riastrad void intel_dsb_reg_write(struct intel_dsb *dsb, i915_reg_t reg, u32 val);
     50  1.1  riastrad void intel_dsb_indexed_reg_write(struct intel_dsb *dsb, i915_reg_t reg,
     51  1.1  riastrad 				 u32 val);
     52  1.1  riastrad void intel_dsb_commit(struct intel_dsb *dsb);
     53  1.1  riastrad 
     54  1.1  riastrad #endif
     55