[Intel-gfx] [PATCH 6/7] drm/i915: Add module param for enabling TTM in sysmem region
Jani Nikula
jani.nikula at linux.intel.com
Tue Aug 9 16:50:57 UTC 2022
On Tue, 09 Aug 2022, Adrian Larumbe <adrian.larumbe at collabora.com> wrote:
> On 03.08.2022 17:22, Jani Nikula wrote:
>>On Tue, 02 Aug 2022, Adrian Larumbe <adrian.larumbe at collabora.com> wrote:
>>> Introduces a new module parameter, 'use_pool_alloc', which defaults to
>>> 'false'. Its goal is to make the driver fall back on TTM for setting up
>>> the system memory region, so that object allocation will be done through
>>> the TTM subsystem rather than shmem objects.
>>>
>>> This commit only brings in the new kernel module param, which will be
>>> used by successive commits.
>>>
>>> Signed-off-by: Adrian Larumbe <adrian.larumbe at collabora.com>
>>> ---
>>> drivers/gpu/drm/i915/i915_params.c | 6 ++++++
>>> drivers/gpu/drm/i915/i915_params.h | 3 ++-
>>> 2 files changed, 8 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
>>> index 6fc475a5db61..1af11f030ab1 100644
>>> --- a/drivers/gpu/drm/i915/i915_params.c
>>> +++ b/drivers/gpu/drm/i915/i915_params.c
>>> @@ -207,6 +207,12 @@ i915_param_named_unsafe(lmem_size, uint, 0400,
>>> i915_param_named_unsafe(lmem_bar_size, uint, 0400,
>>> "Set the lmem bar size(in MiB).");
>>>
>>> +i915_param_named_unsafe(use_pool_alloc, bool, 0600,
>>
>>Do you expect to be able to change this runtime? Or the device specific
>>debugfs parameter knob?
>
> No, it's a driver load-time setting and doesn't change unless you unload the
> driver module and load it back without setting the parameter.
>
> Does that mean I would have to use a different param declaration macro?
No, just different mode, 0400 instead of 0600.
>
>>> + "Force the driver to use TTM's pool allocator API for smem objects. "
>>> + "This will cause TTM to take over BO allocation even in integrated platforms. "
>>> + "(default: false)");
>>> +
>>> +
>>
>>Superfluous newline.
>>
>>> static __always_inline void _print_param(struct drm_printer *p,
>>> const char *name,
>>> const char *type,
>>> diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
>>> index 2733cb6cfe09..992ee2a4947d 100644
>>> --- a/drivers/gpu/drm/i915/i915_params.h
>>> +++ b/drivers/gpu/drm/i915/i915_params.h
>>> @@ -84,7 +84,8 @@ struct drm_printer;
>>> param(bool, verbose_state_checks, true, 0) \
>>> param(bool, nuclear_pageflip, false, 0400) \
>>> param(bool, enable_dp_mst, true, 0600) \
>>> - param(bool, enable_gvt, false, IS_ENABLED(CONFIG_DRM_I915_GVT) ? 0400 : 0)
>>> + param(bool, enable_gvt, false, IS_ENABLED(CONFIG_DRM_I915_GVT) ? 0400 : 0) \
>>> + param(bool, use_pool_alloc, false, 0600)
>>>
>>> #define MEMBER(T, member, ...) T member;
>>> struct i915_params {
>>
>>--
>>Jani Nikula, Intel Open Source Graphics Center
>
> Adrian Larumbe
--
Jani Nikula, Intel Open Source Graphics Center
More information about the Intel-gfx
mailing list