| @@ -75,26 +75,27 @@ | | | @@ -75,26 +75,27 @@ |
75 | * The "current context" means the context which is currently running on the | | 75 | * The "current context" means the context which is currently running on the |
76 | * GPU. The GPU has loaded it's state already and has stored away the gtt | | 76 | * GPU. The GPU has loaded it's state already and has stored away the gtt |
77 | * offset of the BO. The GPU is not actively referencing the data at this | | 77 | * offset of the BO. The GPU is not actively referencing the data at this |
78 | * offset, but it will on the next context switch. The only way to avoid this | | 78 | * offset, but it will on the next context switch. The only way to avoid this |
79 | * is to do a GPU reset. | | 79 | * is to do a GPU reset. |
80 | * | | 80 | * |
81 | * An "active context' is one which was previously the "current context" and is | | 81 | * An "active context' is one which was previously the "current context" and is |
82 | * on the active list waiting for the next context switch to occur. Until this | | 82 | * on the active list waiting for the next context switch to occur. Until this |
83 | * happens, the object must remain at the same gtt offset. It is therefore | | 83 | * happens, the object must remain at the same gtt offset. It is therefore |
84 | * possible to destroy a context, but it is still active. | | 84 | * possible to destroy a context, but it is still active. |
85 | * | | 85 | * |
86 | */ | | 86 | */ |
87 | | | 87 | |
| | | 88 | #include <linux/err.h> |
88 | #include <drm/drmP.h> | | 89 | #include <drm/drmP.h> |
89 | #include <drm/i915_drm.h> | | 90 | #include <drm/i915_drm.h> |
90 | #include "i915_drv.h" | | 91 | #include "i915_drv.h" |
91 | | | 92 | |
92 | /* This is a HW constraint. The value below is the largest known requirement | | 93 | /* This is a HW constraint. The value below is the largest known requirement |
93 | * I've seen in a spec to date, and that was a workaround for a non-shipping | | 94 | * I've seen in a spec to date, and that was a workaround for a non-shipping |
94 | * part. It should be safe to decrease this, but it's more future proof as is. | | 95 | * part. It should be safe to decrease this, but it's more future proof as is. |
95 | */ | | 96 | */ |
96 | #define CONTEXT_ALIGN (64<<10) | | 97 | #define CONTEXT_ALIGN (64<<10) |
97 | | | 98 | |
98 | static struct i915_hw_context * | | 99 | static struct i915_hw_context * |
99 | i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id); | | 100 | i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id); |
100 | static int do_switch(struct i915_hw_context *to); | | 101 | static int do_switch(struct i915_hw_context *to); |