Commit 6a7fd76b authored by Sung Lee's avatar Sung Lee Committed by Alex Deucher
Browse files

drm/amd/display: Add option to retrieve detile buffer size



[WHY]
For better power profiling knowing the detile
buffer size at a given point in time
would be useful.

[HOW]
Add interface to retrieve detile buffer from
dc state.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: default avatarAric Cyr <aric.cyr@amd.com>
Signed-off-by: default avatarSung Lee <Sung.Lee@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 63e7ee67
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -6109,3 +6109,21 @@ struct dc_power_profile dc_get_power_profile_for_dc_state(const struct dc_state
		profile.power_level = dc->res_pool->funcs->get_power_profile(context);
	return profile;
}

/*
 **********************************************************************************
 * dc_get_det_buffer_size_from_state() - extracts detile buffer size from dc state
 *
 * Called when DM wants to log detile buffer size from dc_state
 *
 **********************************************************************************
 */
unsigned int dc_get_det_buffer_size_from_state(const struct dc_state *context)
{
	struct dc *dc = context->clk_mgr->ctx->dc;

	if (dc->res_pool->funcs->get_det_buffer_size)
		return dc->res_pool->funcs->get_det_buffer_size(context);
	else
		return 0;
}
+2 −0
Original line number Diff line number Diff line
@@ -2550,6 +2550,8 @@ struct dc_power_profile {

struct dc_power_profile dc_get_power_profile_for_dc_state(const struct dc_state *context);

unsigned int dc_get_det_buffer_size_from_state(const struct dc_state *context);

/* DSC Interfaces */
#include "dc_dsc.h"

+1 −0
Original line number Diff line number Diff line
@@ -219,6 +219,7 @@ struct resource_funcs {
	 * Get indicator of power from a context that went through full validation
	 */
	int (*get_power_profile)(const struct dc_state *context);
	unsigned int (*get_det_buffer_size)(const struct dc_state *context);
};

struct audio_support{
+7 −0
Original line number Diff line number Diff line
@@ -1720,6 +1720,12 @@ int dcn31_populate_dml_pipes_from_context(
	return pipe_cnt;
}

unsigned int dcn31_get_det_buffer_size(
	const struct dc_state *context)
{
	return context->bw_ctx.dml.ip.det_buffer_size_kbytes;
}

void dcn31_calculate_wm_and_dlg(
		struct dc *dc, struct dc_state *context,
		display_e2e_pipe_params_st *pipes,
@@ -1842,6 +1848,7 @@ static struct resource_funcs dcn31_res_pool_funcs = {
	.update_bw_bounding_box = dcn31_update_bw_bounding_box,
	.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
	.get_panel_config_defaults = dcn31_get_panel_config_defaults,
	.get_det_buffer_size = dcn31_get_det_buffer_size,
};

static struct clock_source *dcn30_clock_source_create(
+3 −0
Original line number Diff line number Diff line
@@ -63,6 +63,9 @@ struct resource_pool *dcn31_create_resource_pool(
		const struct dc_init_data *init_data,
		struct dc *dc);

unsigned int dcn31_get_det_buffer_size(
	const struct dc_state *context);

/*temp: B0 specific before switch to dcn313 headers*/
#ifndef regPHYPLLF_PIXCLK_RESYNC_CNTL
#define regPHYPLLF_PIXCLK_RESYNC_CNTL 0x007e
Loading