[Intel-gfx] [PATCH] drm/i915: avoid concurrent writes to aux_inv

Yang, Fei fei.yang at intel.com
Wed Mar 16 18:25:36 UTC 2022


>> diff --git a/drivers/gpu/drm/i915/gt/gen2_engine_cs.c 
>> b/drivers/gpu/drm/i915/gt/gen2_engine_cs.c
>> index 1c82caf525c3..0ec4986e4805 100644
>> --- a/drivers/gpu/drm/i915/gt/gen2_engine_cs.c
>> +++ b/drivers/gpu/drm/i915/gt/gen2_engine_cs.c
>> @@ -37,6 +37,9 @@ int gen2_emit_flush(struct i915_request *rq, u32 
>> mode)
>>   
>>   	intel_ring_advance(rq, cs);
>>   
>> +	/* hsdes: 1809175790. No fixup needed for gen2 */
>> +	rq->aux_inv_fixup = NULL;
>
> Same thing that Stuart mentioned - would it not work for instance to initialize this in __i915_request_create?

I didn't try __i915_request_create because there is code like the following in the driver, and I'm not sure how many such allocation is there. I will give it a shot.
struct measure_breadcrumb {
        struct i915_request rq;
        struct intel_ring ring;
        u32 cs[2048];
};

static int measure_breadcrumb_dw(struct intel_context *ce)
{
        struct intel_engine_cs *engine = ce->engine;
        struct measure_breadcrumb *frame;
        int dw;

        GEM_BUG_ON(!engine->gt->scratch);

        frame = kzalloc(sizeof(*frame), GFP_KERNEL);
        if (!frame)
                return -ENOMEM;

        frame->rq.engine = engine;
        frame->rq.context = ce;
        ...
}
>> +
>>   	return 0;
>>   }
>>   


More information about the Intel-gfx mailing list