On 11/11/26 20:43, Dave Airlie via B4 Relay wrote:
> From: Dave Airlie <[email protected]>
>
> The only external reads of struct dc_config were five runtime-mutable
> options. Give each a purpose-built getter (dc_get_disable_ips,
> dc_get_enable_frl, dc_get_consolidated_dpia_dp_lt,
> dc_get_usb4_bw_alloc_support, dc_get_allow_edp_hotplug_detection,
> complementing the existing setter) and drop the dc_get_config view.
> KUnit tests install the options through dc_test_set_* setters.
>
> No code outside the dc directory references struct dc_config in
> production anymore.
>
> Part of making the struct dc sub-structures opaque outside DC.
>
> Signed-off-by: Dave Airlie <[email protected]>
> ---
<snip>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_test.c
> b/drivers/gpu/drm/amd/display/dc/core/dc_test.c
> index 04c799ae33d3..6431afb2b5b1 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_test.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_test.c
> @@ -105,17 +105,36 @@ void dc_test_set_idle_optimizations_allowed(struct dc
> *dc, bool allowed)
> }
> EXPORT_SYMBOL(dc_test_set_idle_optimizations_allowed);
>
> +void dc_test_set_disable_ips(struct dc *dc, unsigned int disable_ips)
> +{
> + dc->config.disable_ips = disable_ips;
> +}
> +EXPORT_SYMBOL(dc_test_set_disable_ips);
> +
> +void dc_test_set_enable_frl(struct dc *dc, bool enable)
> +{
> + dc->config.enable_frl = enable;
> +}
> +EXPORT_SYMBOL(dc_test_set_enable_frl);
> +
> +void dc_test_set_consolidated_dpia_dp_lt(struct dc *dc, bool enable)
> +{
> + dc->config.consolidated_dpia_dp_lt = enable;
> +}
> +EXPORT_SYMBOL(dc_test_set_consolidated_dpia_dp_lt);
> +
> +void dc_test_set_usb4_bw_alloc_support(struct dc *dc, bool enable)
> +{
> + dc->config.usb4_bw_alloc_support = enable;
> +}
> +EXPORT_SYMBOL(dc_test_set_usb4_bw_alloc_support);
> +
Similar to the comment on Patch 19/19, this creates a bit of API
bloat. Something like `dc_test_set_config(dc, config)` might be
better.
Harry