1 /*
2  * SPDX-License-Identifier: MIT
3  *
4  * Copyright © 2014-2018 Intel Corporation
5  */
6 
7 #ifndef _INTEL_WORKAROUNDS_H_
8 #define _INTEL_WORKAROUNDS_H_
9 
10 #include <linux/slab.h>
11 
12 #include "intel_workarounds_types.h"
13 
14 struct drm_i915_private;
15 struct i915_request;
16 struct intel_engine_cs;
17 
18 static inline void intel_wa_list_free(struct i915_wa_list *wal)
19 {
20 	kfree(wal->list);
21 	memset(wal, 0, sizeof(*wal));
22 }
23 
24 void intel_engine_init_ctx_wa(struct intel_engine_cs *engine);
25 int intel_engine_emit_ctx_wa(struct i915_request *rq);
26 
27 void intel_gt_init_workarounds(struct drm_i915_private *i915);
28 void intel_gt_apply_workarounds(struct drm_i915_private *i915);
29 bool intel_gt_verify_workarounds(struct drm_i915_private *i915,
30 				 const char *from);
31 
32 void intel_engine_init_whitelist(struct intel_engine_cs *engine);
33 void intel_engine_apply_whitelist(struct intel_engine_cs *engine);
34 
35 void intel_engine_init_workarounds(struct intel_engine_cs *engine);
36 void intel_engine_apply_workarounds(struct intel_engine_cs *engine);
37 int intel_engine_verify_workarounds(struct intel_engine_cs *engine,
38 				    const char *from);
39 
40 #endif
41