Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afcd526b authored by Joshua Aberback's avatar Joshua Aberback Committed by Alex Deucher
Browse files

drm/amd/display: Add fast_validate parameter



Add a fast_validate parameter in dc_validate_global_state for future use

Signed-off-by: default avatarJoshua Aberback <joshua.aberback@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarBhawanpreet Lakha &lt;Bhawanpreet <Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c14a005c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6647,7 +6647,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
		if (ret)
			goto fail;

		if (dc_validate_global_state(dc, dm_state->context) != DC_OK) {
		if (dc_validate_global_state(dc, dm_state->context, false) != DC_OK) {
			ret = -EINVAL;
			goto fail;
		}
+4 −2
Original line number Diff line number Diff line
@@ -701,7 +701,8 @@ static void hack_bounding_box(struct dcn_bw_internal_vars *v,

bool dcn_validate_bandwidth(
		struct dc *dc,
		struct dc_state *context)
		struct dc_state *context,
		bool fast_validate)
{
	const struct resource_pool *pool = dc->res_pool;
	struct dcn_bw_internal_vars *v = &context->dcn_bw_vars;
@@ -1013,8 +1014,9 @@ bool dcn_validate_bandwidth(
		mode_support_and_system_configuration(v);
	}

	if (v->voltage_level != 5) {
	if (v->voltage_level != number_of_states_plus_one && !fast_validate) {
		float bw_consumed = v->total_bandwidth_consumed_gbyte_per_second;

		if (bw_consumed < v->fabric_and_dram_bandwidth_vmin0p65)
			bw_consumed = v->fabric_and_dram_bandwidth_vmin0p65;
		else if (bw_consumed < v->fabric_and_dram_bandwidth_vmid0p72)
+4 −2
Original line number Diff line number Diff line
@@ -2067,12 +2067,14 @@ void dc_resource_state_construct(
 * Checks HW resource availability and bandwidth requirement.
 * @dc: dc struct for this driver
 * @new_ctx: state to be validated
 * @fast_validate: set to true if only yes/no to support matters
 *
 * Return: DC_OK if the result can be programmed.  Otherwise, an error code.
 */
enum dc_status dc_validate_global_state(
		struct dc *dc,
		struct dc_state *new_ctx)
		struct dc_state *new_ctx,
		bool fast_validate)
{
	enum dc_status result = DC_ERROR_UNEXPECTED;
	int i, j;
@@ -2127,7 +2129,7 @@ enum dc_status dc_validate_global_state(
	result = resource_build_scaling_params_for_context(dc, new_ctx);

	if (result == DC_OK)
		if (!dc->res_pool->funcs->validate_bandwidth(dc, new_ctx))
		if (!dc->res_pool->funcs->validate_bandwidth(dc, new_ctx, fast_validate))
			result = DC_FAIL_BANDWIDTH_VALIDATE;

	return result;
+6 −1
Original line number Diff line number Diff line
@@ -658,9 +658,14 @@ enum dc_status dc_validate_plane(struct dc *dc, const struct dc_plane_state *pla

void get_clock_requirements_for_state(struct dc_state *state, struct AsicStateEx *info);

/*
 * fast_validate: we return after determining if we can support the new state,
 * but before we populate the programming info
 */
enum dc_status dc_validate_global_state(
		struct dc *dc,
		struct dc_state *new_ctx);
		struct dc_state *new_ctx,
		bool fast_validate);


void dc_resource_state_construct(
+2 −1
Original line number Diff line number Diff line
@@ -778,7 +778,8 @@ static enum dc_status build_mapped_resource(

bool dce100_validate_bandwidth(
	struct dc  *dc,
	struct dc_state *context)
	struct dc_state *context,
	bool fast_validate)
{
	int i;
	bool at_least_one_pipe = false;
Loading