[Intel-gfx] [PATCH v7 2/4] drm/i915/perf: stop using the kernel context
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Tue Apr 28 11:04:59 UTC 2020
On 28/04/2020 13:19, Chris Wilson wrote:
> Quoting Lionel Landwerlin (2020-04-28 11:08:14)
>> @@ -2837,6 +2851,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
>> {
>> struct drm_i915_private *i915 = stream->perf->i915;
>> struct i915_perf *perf = stream->perf;
>> + struct intel_timeline *timeline;
>> int format_size;
>> int ret;
>>
>> @@ -2946,10 +2961,30 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
>>
>> stream->ops = &i915_oa_stream_ops;
>>
>> + timeline = intel_timeline_create(stream->engine->gt, NULL);
>> + if (IS_ERR(timeline)) {
>> + ret = PTR_ERR(timeline);
>> + goto err_timeline;
>> + }
>> +
>> + stream->config_context = intel_context_create(stream->engine);
>> + if (IS_ERR(stream->config_context)) {
>> + intel_timeline_put(timeline);
>> + ret = PTR_ERR(stream->config_context);
>> + goto err_timeline;
>> + }
>> +
>> + stream->config_context->sseu = props->sseu;
>> + stream->config_context->timeline = timeline;
> Timeline?
>
>> +
>> + ret = intel_context_pin(stream->config_context);
> One is created for the context here [via intel_context_alloc].
I don't see it :
static struct intel_context *intel_context_alloc(void)
{
return kmem_cache_zalloc(global.slab_ce, GFP_KERNEL);
}
>
> I was intrigued as I thought you might have had something special planned
> with multiple contexts sharing a timeline
>
> Do we need to permanently pin the context? We can fail the OA config
> change request, right?
You're right, it doesn't need to pinned all the time.
Thanks,
-Lionel
> -Chris
More information about the Intel-gfx
mailing list