[Intel-gfx] [RFC 3/7] drm/i915: Move all runtime modified device info fields into runtime info
Lucas De Marchi
lucas.de.marchi at gmail.com
Mon Nov 12 21:22:00 UTC 2018
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?
Lucas De Marchi
>
> - mkwrite_device_info(i915)->page_sizes =
> - I915_GTT_PAGE_SIZE_4K |
> - I915_GTT_PAGE_SIZE_64K |
> - I915_GTT_PAGE_SIZE_2M;
> + i915->runtime_info.page_sizes = I915_GTT_PAGE_SIZE_4K |
> + I915_GTT_PAGE_SIZE_64K |
> + I915_GTT_PAGE_SIZE_2M;
>
> mock_uncore_init(i915);
> i915_gem_init__mm(i915);
> @@ -231,7 +230,7 @@ struct drm_i915_private *mock_gem_device(void)
>
> mock_init_ggtt(i915);
>
> - mkwrite_device_info(i915)->ring_mask = BIT(0);
> + i915->runtime_info.ring_mask = BIT(0);
> i915->kernel_context = mock_context(i915, NULL);
> if (!i915->kernel_context)
> goto err_unlock;
> --
> 2.19.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
More information about the Intel-gfx
mailing list