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

Commit 2e9d6a57 authored by Yongqiang Sun's avatar Yongqiang Sun Committed by Alex Deucher
Browse files

drm/amd/display: Check opplist in pipe ctx not in res pool.

parent 978cc972
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -600,13 +600,13 @@ static void plane_atomic_disconnect(struct dc *dc, struct pipe_ctx *pipe_ctx)
	struct hubp *hubp = pipe_ctx->plane_res.hubp;
	struct hubp *hubp = pipe_ctx->plane_res.hubp;
	int dpp_id = pipe_ctx->plane_res.dpp->inst;
	int dpp_id = pipe_ctx->plane_res.dpp->inst;
	struct mpc *mpc = dc->res_pool->mpc;
	struct mpc *mpc = dc->res_pool->mpc;
	int opp_id;
	int pipe_idx;
	struct mpc_tree *mpc_tree_params;
	struct mpc_tree *mpc_tree_params;
	struct mpcc *mpcc_to_remove = NULL;
	struct mpcc *mpcc_to_remove = NULL;


	/* look at tree rather than mi here to know if we already reset */
	/* look at tree rather than mi here to know if we already reset */
	for (opp_id = 0; opp_id < dc->res_pool->pipe_count; opp_id++) {
	for (pipe_idx = 0; pipe_idx < dc->res_pool->pipe_count; pipe_idx++) {
		struct output_pixel_processor *opp = dc->res_pool->opps[opp_id];
		struct output_pixel_processor *opp = dc->res_pool->opps[pipe_idx];


		mpc_tree_params = &(opp->mpc_tree_params);
		mpc_tree_params = &(opp->mpc_tree_params);
		mpcc_to_remove = mpc->funcs->get_mpcc_for_dpp(mpc_tree_params, dpp_id);
		mpcc_to_remove = mpc->funcs->get_mpcc_for_dpp(mpc_tree_params, dpp_id);
@@ -615,11 +615,11 @@ static void plane_atomic_disconnect(struct dc *dc, struct pipe_ctx *pipe_ctx)
	}
	}


	/*Already reset*/
	/*Already reset*/
	if (opp_id == dc->res_pool->pipe_count)
	if (pipe_idx == dc->res_pool->pipe_count)
		return;
		return;


	mpc->funcs->remove_mpcc(mpc, mpc_tree_params, mpcc_to_remove);
	mpc->funcs->remove_mpcc(mpc, mpc_tree_params, mpcc_to_remove);
	dc->res_pool->opps[opp_id]->mpcc_disconnect_pending[pipe_ctx->plane_res.mpcc_inst] = true;
	dc->res_pool->opps[pipe_idx]->mpcc_disconnect_pending[pipe_ctx->plane_res.mpcc_inst] = true;


	dc->optimized_required = true;
	dc->optimized_required = true;


@@ -665,7 +665,7 @@ static void plane_atomic_disable(struct dc *dc, struct pipe_ctx *pipe_ctx)
	REG_UPDATE(DPP_CONTROL[dpp_id],
	REG_UPDATE(DPP_CONTROL[dpp_id],
			DPP_CLOCK_ENABLE, 0);
			DPP_CLOCK_ENABLE, 0);


	if (opp_id != 0xf && dc->res_pool->opps[opp_id]->mpc_tree_params.opp_list == NULL)
	if (opp_id != 0xf && pipe_ctx->stream_res.opp->mpc_tree_params.opp_list == NULL)
		REG_UPDATE(OPP_PIPE_CONTROL[opp_id],
		REG_UPDATE(OPP_PIPE_CONTROL[opp_id],
				OPP_PIPE_CLOCK_EN, 0);
				OPP_PIPE_CLOCK_EN, 0);