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 struct intel_gt;
18 
19 static inline void intel_wa_list_free(struct i915_wa_list *wal)
20 {
21 	kfree(wal->list);
22 	memset(wal, 0, sizeof(*wal));
23 }
24 
25 void intel_engine_init_ctx_wa(struct intel_engine_cs *engine);
26 int intel_engine_emit_ctx_wa(struct i915_request *rq);
27 
28 void intel_gt_init_workarounds(struct drm_i915_private *i915);
29 void intel_gt_apply_workarounds(struct intel_gt *gt);
30 bool intel_gt_verify_workarounds(struct intel_gt *gt, 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