[Intel-gfx] [PATCH v7 11/12] drm/i915/perf: execute OA configuration from command stream
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Tue Jul 9 11:16:26 UTC 2019
On 09/07/2019 14:04, Lionel Landwerlin wrote:
> 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
When with locking around the global pin.
-Lionel
More information about the Intel-gfx
mailing list