mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-09 16:41:16 +00:00
drm/amd/display: Add warmup escape call support
Add warmup escape support, for diags, in a way that is possible to choose a new or an existing sequence. For achieving this goal, this commit adds separated MCIF buffer as VCN request. Signed-off-by: Charlene Liu <charlene.liu@amd.com> Reviewed-by: Chris Park <Chris.Park@amd.com> Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
d87dedb1ec
commit
6a652f6d12
@ -406,6 +406,12 @@ bool dc_stream_add_writeback(struct dc *dc,
|
|||||||
stream->writeback_info[stream->num_wb_info++] = *wb_info;
|
stream->writeback_info[stream->num_wb_info++] = *wb_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dc->hwss.enable_writeback) {
|
||||||
|
struct dc_stream_status *stream_status = dc_stream_get_status(stream);
|
||||||
|
struct dwbc *dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst];
|
||||||
|
dwb->otg_inst = stream_status->primary_otg_inst;
|
||||||
|
}
|
||||||
|
if (IS_DIAG_DC(dc->ctx->dce_environment)) {
|
||||||
if (!dc->hwss.update_bandwidth(dc, dc->current_state)) {
|
if (!dc->hwss.update_bandwidth(dc, dc->current_state)) {
|
||||||
dm_error("DC: update_bandwidth failed!\n");
|
dm_error("DC: update_bandwidth failed!\n");
|
||||||
return false;
|
return false;
|
||||||
@ -413,18 +419,17 @@ bool dc_stream_add_writeback(struct dc *dc,
|
|||||||
|
|
||||||
/* enable writeback */
|
/* enable writeback */
|
||||||
if (dc->hwss.enable_writeback) {
|
if (dc->hwss.enable_writeback) {
|
||||||
struct dc_stream_status *stream_status = dc_stream_get_status(stream);
|
|
||||||
struct dwbc *dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst];
|
struct dwbc *dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst];
|
||||||
|
|
||||||
if (dwb->funcs->is_enabled(dwb)) {
|
if (dwb->funcs->is_enabled(dwb)) {
|
||||||
/* writeback pipe already enabled, only need to update */
|
/* writeback pipe already enabled, only need to update */
|
||||||
dc->hwss.update_writeback(dc, stream_status, wb_info, dc->current_state);
|
dc->hwss.update_writeback(dc, wb_info, dc->current_state);
|
||||||
} else {
|
} else {
|
||||||
/* Enable writeback pipe from scratch*/
|
/* Enable writeback pipe from scratch*/
|
||||||
dc->hwss.enable_writeback(dc, stream_status, wb_info, dc->current_state);
|
dc->hwss.enable_writeback(dc, wb_info, dc->current_state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,6 +468,7 @@ bool dc_stream_remove_writeback(struct dc *dc,
|
|||||||
}
|
}
|
||||||
stream->num_wb_info = j;
|
stream->num_wb_info = j;
|
||||||
|
|
||||||
|
if (IS_DIAG_DC(dc->ctx->dce_environment)) {
|
||||||
/* recalculate and apply DML parameters */
|
/* recalculate and apply DML parameters */
|
||||||
if (!dc->hwss.update_bandwidth(dc, dc->current_state)) {
|
if (!dc->hwss.update_bandwidth(dc, dc->current_state)) {
|
||||||
dm_error("DC: update_bandwidth failed!\n");
|
dm_error("DC: update_bandwidth failed!\n");
|
||||||
@ -472,10 +478,19 @@ bool dc_stream_remove_writeback(struct dc *dc,
|
|||||||
/* disable writeback */
|
/* disable writeback */
|
||||||
if (dc->hwss.disable_writeback)
|
if (dc->hwss.disable_writeback)
|
||||||
dc->hwss.disable_writeback(dc, dwb_pipe_inst);
|
dc->hwss.disable_writeback(dc, dwb_pipe_inst);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool dc_stream_warmup_writeback(struct dc *dc,
|
||||||
|
int num_dwb,
|
||||||
|
struct dc_writeback_info *wb_info)
|
||||||
|
{
|
||||||
|
if (dc->hwss.mmhubbub_warmup)
|
||||||
|
return dc->hwss.mmhubbub_warmup(dc, num_dwb, wb_info);
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
uint32_t dc_stream_get_vblank_counter(const struct dc_stream_state *stream)
|
uint32_t dc_stream_get_vblank_counter(const struct dc_stream_state *stream)
|
||||||
{
|
{
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
@ -344,10 +344,17 @@ bool dc_add_all_planes_for_stream(
|
|||||||
bool dc_stream_add_writeback(struct dc *dc,
|
bool dc_stream_add_writeback(struct dc *dc,
|
||||||
struct dc_stream_state *stream,
|
struct dc_stream_state *stream,
|
||||||
struct dc_writeback_info *wb_info);
|
struct dc_writeback_info *wb_info);
|
||||||
|
|
||||||
bool dc_stream_remove_writeback(struct dc *dc,
|
bool dc_stream_remove_writeback(struct dc *dc,
|
||||||
struct dc_stream_state *stream,
|
struct dc_stream_state *stream,
|
||||||
uint32_t dwb_pipe_inst);
|
uint32_t dwb_pipe_inst);
|
||||||
|
|
||||||
|
bool dc_stream_warmup_writeback(struct dc *dc,
|
||||||
|
int num_dwb,
|
||||||
|
struct dc_writeback_info *wb_info);
|
||||||
|
|
||||||
bool dc_stream_dmdata_status_done(struct dc *dc, struct dc_stream_state *stream);
|
bool dc_stream_dmdata_status_done(struct dc *dc, struct dc_stream_state *stream);
|
||||||
|
|
||||||
bool dc_stream_set_dynamic_metadata(struct dc *dc,
|
bool dc_stream_set_dynamic_metadata(struct dc *dc,
|
||||||
struct dc_stream_state *stream,
|
struct dc_stream_state *stream,
|
||||||
struct dc_dmdata_attributes *dmdata_attr);
|
struct dc_dmdata_attributes *dmdata_attr);
|
||||||
|
@ -1740,7 +1740,6 @@ bool dcn20_update_bandwidth(
|
|||||||
|
|
||||||
void dcn20_enable_writeback(
|
void dcn20_enable_writeback(
|
||||||
struct dc *dc,
|
struct dc *dc,
|
||||||
const struct dc_stream_status *stream_status,
|
|
||||||
struct dc_writeback_info *wb_info,
|
struct dc_writeback_info *wb_info,
|
||||||
struct dc_state *context)
|
struct dc_state *context)
|
||||||
{
|
{
|
||||||
@ -1754,8 +1753,7 @@ void dcn20_enable_writeback(
|
|||||||
mcif_wb = dc->res_pool->mcif_wb[wb_info->dwb_pipe_inst];
|
mcif_wb = dc->res_pool->mcif_wb[wb_info->dwb_pipe_inst];
|
||||||
|
|
||||||
/* set the OPTC source mux */
|
/* set the OPTC source mux */
|
||||||
ASSERT(stream_status->primary_otg_inst < MAX_PIPES);
|
optc = dc->res_pool->timing_generators[dwb->otg_inst];
|
||||||
optc = dc->res_pool->timing_generators[stream_status->primary_otg_inst];
|
|
||||||
optc->funcs->set_dwb_source(optc, wb_info->dwb_pipe_inst);
|
optc->funcs->set_dwb_source(optc, wb_info->dwb_pipe_inst);
|
||||||
/* set MCIF_WB buffer and arbitration configuration */
|
/* set MCIF_WB buffer and arbitration configuration */
|
||||||
mcif_wb->funcs->config_mcif_buf(mcif_wb, &wb_info->mcif_buf_params, wb_info->dwb_params.dest_height);
|
mcif_wb->funcs->config_mcif_buf(mcif_wb, &wb_info->mcif_buf_params, wb_info->dwb_params.dest_height);
|
||||||
|
@ -104,7 +104,6 @@ void dcn20_program_triple_buffer(
|
|||||||
bool enable_triple_buffer);
|
bool enable_triple_buffer);
|
||||||
void dcn20_enable_writeback(
|
void dcn20_enable_writeback(
|
||||||
struct dc *dc,
|
struct dc *dc,
|
||||||
const struct dc_stream_status *stream_status,
|
|
||||||
struct dc_writeback_info *wb_info,
|
struct dc_writeback_info *wb_info,
|
||||||
struct dc_state *context);
|
struct dc_state *context);
|
||||||
void dcn20_disable_writeback(
|
void dcn20_disable_writeback(
|
||||||
|
@ -113,7 +113,8 @@ struct dwbc {
|
|||||||
int wb_src_plane_inst;/*hubp, mpcc, inst*/
|
int wb_src_plane_inst;/*hubp, mpcc, inst*/
|
||||||
bool update_privacymask;
|
bool update_privacymask;
|
||||||
uint32_t mask_id;
|
uint32_t mask_id;
|
||||||
|
int otg_inst;
|
||||||
|
bool mvc_cfg;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dwbc_funcs {
|
struct dwbc_funcs {
|
||||||
|
@ -149,16 +149,18 @@ struct hw_sequencer_funcs {
|
|||||||
|
|
||||||
/* Writeback Related */
|
/* Writeback Related */
|
||||||
void (*update_writeback)(struct dc *dc,
|
void (*update_writeback)(struct dc *dc,
|
||||||
const struct dc_stream_status *stream_status,
|
|
||||||
struct dc_writeback_info *wb_info,
|
struct dc_writeback_info *wb_info,
|
||||||
struct dc_state *context);
|
struct dc_state *context);
|
||||||
void (*enable_writeback)(struct dc *dc,
|
void (*enable_writeback)(struct dc *dc,
|
||||||
const struct dc_stream_status *stream_status,
|
|
||||||
struct dc_writeback_info *wb_info,
|
struct dc_writeback_info *wb_info,
|
||||||
struct dc_state *context);
|
struct dc_state *context);
|
||||||
void (*disable_writeback)(struct dc *dc,
|
void (*disable_writeback)(struct dc *dc,
|
||||||
unsigned int dwb_pipe_inst);
|
unsigned int dwb_pipe_inst);
|
||||||
|
|
||||||
|
bool (*mmhubbub_warmup)(struct dc *dc,
|
||||||
|
unsigned int num_dwb,
|
||||||
|
struct dc_writeback_info *wb_info);
|
||||||
|
|
||||||
/* Clock Related */
|
/* Clock Related */
|
||||||
enum dc_status (*set_clock)(struct dc *dc,
|
enum dc_status (*set_clock)(struct dc *dc,
|
||||||
enum dc_clock_type clock_type,
|
enum dc_clock_type clock_type,
|
||||||
|
@ -138,10 +138,14 @@
|
|||||||
#define RAVEN2_15D8_REV_E4 0xE4
|
#define RAVEN2_15D8_REV_E4 0xE4
|
||||||
#define RAVEN1_F0 0xF0
|
#define RAVEN1_F0 0xF0
|
||||||
#define RAVEN_UNKNOWN 0xFF
|
#define RAVEN_UNKNOWN 0xFF
|
||||||
|
#ifndef ASICREV_IS_RAVEN
|
||||||
#define ASICREV_IS_RAVEN(eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < RAVEN_UNKNOWN)
|
#define ASICREV_IS_RAVEN(eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < RAVEN_UNKNOWN)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ASICREV_IS_PICASSO(eChipRev) ((eChipRev >= PICASSO_A0) && (eChipRev < RAVEN2_A0))
|
#define ASICREV_IS_PICASSO(eChipRev) ((eChipRev >= PICASSO_A0) && (eChipRev < RAVEN2_A0))
|
||||||
|
#ifndef ASICREV_IS_RAVEN2
|
||||||
#define ASICREV_IS_RAVEN2(eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < RAVEN1_F0))
|
#define ASICREV_IS_RAVEN2(eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < RAVEN1_F0))
|
||||||
|
#endif
|
||||||
#define ASICREV_IS_RV1_F0(eChipRev) ((eChipRev >= RAVEN1_F0) && (eChipRev < RAVEN_UNKNOWN))
|
#define ASICREV_IS_RV1_F0(eChipRev) ((eChipRev >= RAVEN1_F0) && (eChipRev < RAVEN_UNKNOWN))
|
||||||
#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_REV_E3) \
|
#define ASICREV_IS_DALI(eChipRev) ((eChipRev == RAVEN2_15D8_REV_E3) \
|
||||||
|| (eChipRev == RAVEN2_15D8_REV_E4))
|
|| (eChipRev == RAVEN2_15D8_REV_E4))
|
||||||
|
Loading…
Reference in New Issue
Block a user