On 09/07/2019 13:02, Chris Wilson wrote:
Quoting Lionel Landwerlin (2019-07-09 10:32:07)
+static int emit_oa_config(struct drm_i915_private *i915,
+ struct i915_perf_stream *stream)
{
- u32 i;
+ struct i915_oa_config *oa_config = stream->oa_config;
+ struct i915_request *rq = stream->initial_config_rq;
+ struct i915_vma *vma;
+ u32 *cs;
+ int err;
- for (i = 0; i < n_regs; i++) {
- const struct i915_oa_reg *reg = regs + i;
+ vma = i915_vma_instance(oa_config->obj, &i915->ggtt.vm, NULL);
+ if (unlikely(IS_ERR(vma)))
+ return PTR_ERR(vma);
+
+ err = i915_vma_pin(vma, 0, 0, PIN_GLOBAL);
+ if (err)
+ return err;
Hmm, still a lock inversion here as we will not be allowed to pin from
underneath rq->timeline->mutex.
-Chris
I can put this function back under the i915->drm.struct_mutex.
We still drop the lock to do the wait.
Sounds ok?
-Lionel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx