[Intel-gfx] [RFC 3/7] drm/i915: Move all runtime modified device info fields into runtime info

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Tue Nov 13 09:19:38 UTC 2018


On 12/11/2018 21:22, Lucas De Marchi wrote:
> On Mon, Nov 12, 2018 at 05:12:38PM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>>
>> After the previous change which cleared the static tables from effectively
>> unused storage, we now replicate entries which have defaults set from
>> there, but can be overriden at runtime.
>>
>> For this class of variables all accessor macros and call sites are changed
>> to use the runtime version. Therefore at driver load we need to copy over
>> these variables from static to the runtime table.
>>
>> We add double prefixes to the affected device info members to signify they
>> are special and to catch all current and future users.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>> Cc: Chris Wilson <chris at chris-wilson.co.uk>
>> Cc: Jani Nikula <jani.nikula at intel.com>
>> ---
> 
> [...]
> 
>> diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
>> index 43ed8b28aeaa..b6849ca11e01 100644
>> --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
>> +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
>> @@ -174,12 +174,11 @@ struct drm_i915_private *mock_gem_device(void)
>>   	/* Using the global GTT may ask questions about KMS users, so prepare */
>>   	drm_mode_config_init(&i915->drm);
>>   
>> -	mkwrite_device_info(i915)->gen = -1;
>> +	i915->runtime_info.gen = -1;
> 
> this seems the only place that is setting gen to something not statically
> defined. And it also misses that it'd need to set gen_mask, too.
> 
> Could we rather define a device_info for the mock device with the
> proper values rather than doing this?

That would be indeed preferable and I hated the runtime edit of the gen 
myself. For the RFC I just did not spend the time to investigate why the 
mock device needs this etc. Marking as TODO.

Regards,

Tvrtko


More information about the Intel-gfx mailing list