[Intel-gfx] [PATCH 3/5] drm/i915: Generate the engine name based on the instance number

Oscar Mateo oscar.mateo at intel.com
Fri Apr 7 12:08:55 UTC 2017



On 04/07/2017 10:11 AM, Chris Wilson wrote:
> On Fri, Apr 07, 2017 at 06:23:14PM +0200, Michal Wajdeczko wrote:
>> On Fri, Apr 07, 2017 at 02:15:47AM -0700, Oscar Mateo wrote:
>>> Not really needed, but makes the next change a little bit more compact.
>>>
>>> v2:
>>>    - Use zero-based numbering for engine names: xcs0, xcs1.. xcsN (Tvrtko, Chris)
>>>    - Make sure the mock engine name is null-terminated (Tvrtko, Chris)
>>>
>>> v3: Because I'm stupid (Chris)
>>>
>>> v4: Verify engine name wasn't truncated (Michal)
>>>
>>> Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
>>> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
>>> Cc: Chris Wilson <chris at chris-wilson.co.uk>
>>> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
>>> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>>> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
>>> Signed-off-by: Oscar Mateo <oscar.mateo at intel.com>
>>> ---
>> Reviewed-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> s/WARN_ON/GEM_WARN_ON/ ?
As in:

     if (GEM_WARN_ON(snprintf(engine->name, sizeof(engine->name), "%s%u",
             class_info->name, info->instance) >= sizeof(engine->name)))
         ;

or do you want to return an error? (I don't really see the need, but...)
> The WARN_ON in mock_engine.c is off-by-one, but really we don't care too
> much there so just kill that warn.
> -Chris
>



More information about the Intel-gfx mailing list