]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - drivers/gpu/drm/i915/intel_guc.h
drm/i915: Enable GuC firmware log
[mirror_ubuntu-zesty-kernel.git] / drivers / gpu / drm / i915 / intel_guc.h
1 /*
2 * Copyright © 2014 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 *
23 */
24 #ifndef _INTEL_GUC_H_
25 #define _INTEL_GUC_H_
26
27 #include "intel_guc_fwif.h"
28 #include "i915_guc_reg.h"
29
30 enum intel_guc_fw_status {
31 GUC_FIRMWARE_FAIL = -1,
32 GUC_FIRMWARE_NONE = 0,
33 GUC_FIRMWARE_PENDING,
34 GUC_FIRMWARE_SUCCESS
35 };
36
37 /*
38 * This structure encapsulates all the data needed during the process
39 * of fetching, caching, and loading the firmware image into the GuC.
40 */
41 struct intel_guc_fw {
42 struct drm_device * guc_dev;
43 const char * guc_fw_path;
44 size_t guc_fw_size;
45 struct drm_i915_gem_object * guc_fw_obj;
46 enum intel_guc_fw_status guc_fw_fetch_status;
47 enum intel_guc_fw_status guc_fw_load_status;
48
49 uint16_t guc_fw_major_wanted;
50 uint16_t guc_fw_minor_wanted;
51 uint16_t guc_fw_major_found;
52 uint16_t guc_fw_minor_found;
53 };
54
55 struct intel_guc {
56 struct intel_guc_fw guc_fw;
57
58 uint32_t log_flags;
59 struct drm_i915_gem_object *log_obj;
60
61 struct drm_i915_gem_object *ctx_pool_obj;
62 struct ida ctx_ids;
63 };
64
65 /* intel_guc_loader.c */
66 extern void intel_guc_ucode_init(struct drm_device *dev);
67 extern int intel_guc_ucode_load(struct drm_device *dev);
68 extern void intel_guc_ucode_fini(struct drm_device *dev);
69 extern const char *intel_guc_fw_status_repr(enum intel_guc_fw_status status);
70
71 /* i915_guc_submission.c */
72 int i915_guc_submission_init(struct drm_device *dev);
73 void i915_guc_submission_fini(struct drm_device *dev);
74
75 #endif