/* in case we don't get a value from the register, use default */
if (clk_mgr->base.dentist_vco_freq_khz == 0)
clk_mgr->base.dentist_vco_freq_khz = 3650000;
+
/* Convert dprefclk units from MHz to KHz */
/* Value already divided by 10, some resolution lost */
int slice_idx, dpp_idx, plane_idx, slice_count, dpp_count;
bool is_primary;
- DC_LOGGER_INIT(dc->ctx->logger);
slice_count = resource_get_opp_heads_for_otg_master(otg_master,
&state->res_ctx, opp_heads);
#include "amdgpu_dm_trace.h"
-#define TRACE_DC_PIPE_STATE(pipe_ctx, index, max_pipes) \
- for (index = 0; index < max_pipes; ++index) { \
+#define TRACE_DC_PIPE_STATE(pipe_ctx, max_pipes) \
+ for (int index = 0; index < max_pipes; ++index) { \
struct pipe_ctx *pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[index]; \
if (pipe_ctx->plane_state) \
trace_amdgpu_dm_dc_pipe_state(pipe_ctx->pipe_idx, pipe_ctx->plane_state, \
{
struct dcn20_hubbub *hubbub2 = TO_DCN20_HUBBUB(hubbub);
- unsigned int cur_compbuf_size_seg = 0;
-
if (safe_to_increase || compbuf_size_seg <= hubbub2->compbuf_size_segments) {
if (compbuf_size_seg > hubbub2->compbuf_size_segments) {
REG_WAIT(DCHUBBUB_DET0_CTRL, DET0_SIZE_CURRENT, hubbub2->det0_size, 1, 100);
+ hubbub2->det3_size + compbuf_size_seg <= hubbub2->crb_size_segs);
REG_UPDATE(DCHUBBUB_COMPBUF_CTRL, COMPBUF_SIZE, compbuf_size_seg);
hubbub2->compbuf_size_segments = compbuf_size_seg;
-
- ASSERT(REG_GET(DCHUBBUB_COMPBUF_CTRL, CONFIG_ERROR, &cur_compbuf_size_seg) && !cur_compbuf_size_seg);
}
}
hws->ctx
#define DC_LOGGER \
- ctx->logger
-#define DC_LOGGER_INIT() \
- struct dc_context *ctx = dc->ctx
+ dc_ctx->logger
+#define DC_LOGGER_INIT(ctx) \
+ struct dc_context *dc_ctx = ctx
#define REG(reg)\
hws->regs->reg
.pixel_clock = timing ? timing->pix_clk_100hz / 10 : 300000,
.color_depth = timing ? timing->display_color_depth : COLOR_DEPTH_888,
};
- DC_LOGGER_INIT();
+ DC_LOGGER_INIT(dc->ctx);
bp_result = bios->funcs->external_encoder_control(bios, &ext_cntl);
struct dc_link *link,
bool power_up)
{
- struct dc_context *ctx = link->ctx;
struct graphics_object_id connector = link->link_enc->connector;
bool edp_hpd_high = false;
uint32_t time_elapsed = 0;
uint32_t timeout = power_up ?
PANEL_POWER_UP_TIMEOUT : PANEL_POWER_DOWN_TIMEOUT;
+ DC_LOGGER_INIT(link->ctx);
+
if (dal_graphics_object_id_get_connector_id(connector)
!= CONNECTOR_ID_EDP) {
BREAK_TO_DEBUGGER();
enum bp_result bp_result;
uint8_t pwrseq_instance;
+ DC_LOGGER_INIT(ctx);
if (dal_graphics_object_id_get_connector_id(link->link_enc->connector)
!= CONNECTOR_ID_EDP) {
unsigned int pre_T11_delay = (link->dpcd_sink_ext_caps.bits.oled ? OLED_PRE_T11_DELAY : 0);
unsigned int post_T7_delay = (link->dpcd_sink_ext_caps.bits.oled ? OLED_POST_T7_DELAY : 0);
+ DC_LOGGER_INIT(ctx);
+
if (dal_graphics_object_id_get_connector_id(link->link_enc->connector)
!= CONNECTOR_ID_EDP) {
BREAK_TO_DEBUGGER();
bool keep_edp_vdd_on = false;
bool should_clean_dsc_block = true;
struct dc_bios *dcb = dc->ctx->dc_bios;
- DC_LOGGER_INIT();
-
+ DC_LOGGER_INIT(dc->ctx);
get_edp_links_with_sink(dc, edp_links_with_sink, &edp_with_sink_num);
dc_get_edp_links(dc, edp_links, &edp_num);
struct dc_context *dc_ctx,
struct timing_generator *tg)
{
- struct dc_context *ctx = dc_ctx;
bool rc = false;
/* To avoid endless loop we wait at most
int group_size,
struct pipe_ctx *grouped_pipes[])
{
- struct dc_context *dc_ctx = dc->ctx;
struct dcp_gsl_params gsl_params = { 0 };
int i;
- DC_LOGGER_INIT();
+ DC_LOGGER_INIT(dc->ctx);
DC_SYNC_INFO("GSL: Setting-up...\n");
int group_size,
struct pipe_ctx *grouped_pipes[])
{
- struct dc_context *dc_ctx = dc->ctx;
struct dcp_gsl_params gsl_params = { 0 };
int i;
- DC_LOGGER_INIT();
+ DC_LOGGER_INIT(dc->ctx);
gsl_params.gsl_group = 0;
gsl_params.gsl_master = 0;
#include "dc_state_priv.h"
#define DC_LOGGER \
- dc_logger
-#define DC_LOGGER_INIT(logger) \
- struct dal_logger *dc_logger = logger
+ dc_ctx->logger
+#define DC_LOGGER_INIT(ctx) \
+ struct dc_context *dc_ctx = ctx
#define CTX \
hws->ctx
struct dce_hwseq *hws,
int plane_id)
{
- DC_LOGGER_INIT(hws->ctx->logger);
+ DC_LOGGER_INIT(hws->ctx);
if (hws->funcs.dpp_root_clock_control)
hws->funcs.dpp_root_clock_control(hws, plane_id, true);
{
int i;
struct dc_link *link;
- DC_LOGGER_INIT(dc->ctx->logger);
+ DC_LOGGER_INIT(dc->ctx);
if (pipe_ctx->stream_res.stream_enc == NULL) {
pipe_ctx->stream = NULL;
return;
return;
if (!hubbub->funcs->verify_allow_pstate_change_high(hubbub)) {
- int i = 0;
-
if (should_log_hw_state)
dcn10_log_hw_state(dc, NULL);
- TRACE_DC_PIPE_STATE(pipe_ctx, i, MAX_PIPES);
+ TRACE_DC_PIPE_STATE(pipe_ctx, MAX_PIPES);
BREAK_TO_DEBUGGER();
if (dcn10_hw_wa_force_recovery(dc)) {
/*check again*/
struct hubp *hubp)
{
struct dce_hwseq *hws = dc->hwseq;
- DC_LOGGER_INIT(dc->ctx->logger);
+ DC_LOGGER_INIT(dc->ctx);
if (REG(DC_IP_REQUEST_CNTL)) {
REG_SET(DC_IP_REQUEST_CNTL, 0,
void dcn10_disable_plane(struct dc *dc, struct dc_state *state, struct pipe_ctx *pipe_ctx)
{
struct dce_hwseq *hws = dc->hwseq;
- DC_LOGGER_INIT(dc->ctx->logger);
+ DC_LOGGER_INIT(dc->ctx);
if (!pipe_ctx->plane_res.hubp || pipe_ctx->plane_res.hubp->power_gated)
return;
{
bool rc = false;
- DC_LOGGER_INIT(dc_ctx->logger);
-
/* To avoid endless loop we wait at most
* frames_to_wait_on_triggered_reset frames for the reset to occur. */
const uint32_t frames_to_wait_on_triggered_reset = 10;
static int dcn10_align_pixel_clocks(struct dc *dc, int group_size,
struct pipe_ctx *grouped_pipes[])
{
- struct dc_context *dc_ctx = dc->ctx;
int i, master = -1, embedded = -1;
struct dc_crtc_timing *hw_crtc_timing;
uint64_t phase[MAX_PIPES];
uint32_t dp_ref_clk_100hz =
dc->res_pool->dp_clock_source->ctx->dc->clk_mgr->dprefclk_khz*10;
- DC_LOGGER_INIT(dc_ctx->logger);
+ DC_LOGGER_INIT(dc->ctx);
hw_crtc_timing = kzalloc_objs(*hw_crtc_timing, MAX_PIPES);
if (!hw_crtc_timing)
int group_size,
struct pipe_ctx *grouped_pipes[])
{
- struct dc_context *dc_ctx = dc->ctx;
struct output_pixel_processor *opp;
struct timing_generator *tg;
int i, width = 0, height = 0, master;
- DC_LOGGER_INIT(dc_ctx->logger);
+ DC_LOGGER_INIT(dc->ctx);
for (i = 1; i < group_size; i++) {
opp = grouped_pipes[i]->stream_res.opp;
int group_size,
struct pipe_ctx *grouped_pipes[])
{
- struct dc_context *dc_ctx = dc->ctx;
struct output_pixel_processor *opp;
struct timing_generator *tg;
int i, width = 0, height = 0;
- DC_LOGGER_INIT(dc_ctx->logger);
+ DC_LOGGER_INIT(dc->ctx);
DC_SYNC_INFO("Setting up OTG reset trigger\n");
int group_size,
struct pipe_ctx *grouped_pipes[])
{
- struct dc_context *dc_ctx = dc->ctx;
int i;
- DC_LOGGER_INIT(dc_ctx->logger);
+ DC_LOGGER_INIT(dc->ctx);
DC_SYNC_INFO("Setting up\n");
for (i = 0; i < group_size; i++)
{
struct dc_link *link;
- DC_LOGGER_INIT(dc->ctx->logger);
if (pipe_ctx->stream_res.stream_enc == NULL) {
pipe_ctx->stream = NULL;
return;
#include "dcn20/dcn20_hwseq.h"
#include "dc_state_priv.h"
-#define DC_LOGGER_INIT(logger) \
- struct dal_logger *dc_logger = logger
+#define DC_LOGGER \
+ dc_ctx->logger
+#define DC_LOGGER_INIT(ctx) \
+ struct dc_context *dc_ctx = ctx
#define CTX \
hws->ctx
#define REG(reg)\
hws->regs->reg
-#define DC_LOGGER \
- dc_logger
#undef FN
struct pipe_ctx *odm_pipe;
int opp_cnt = 1;
- DC_LOGGER_INIT(stream->ctx->logger);
+ DC_LOGGER_INIT(stream->ctx);
ASSERT(dsc);
for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe)
bool is_phantom = dc_state_get_pipe_subvp_type(state, pipe_ctx) == SUBVP_PHANTOM;
struct timing_generator *tg = is_phantom ? pipe_ctx->stream_res.tg : NULL;
- DC_LOGGER_INIT(dc->ctx->logger);
+ DC_LOGGER_INIT(dc->ctx);
if (!pipe_ctx->plane_res.hubp || pipe_ctx->plane_res.hubp->power_gated)
return;
struct dc_link *link = pipe_ctx->stream->link;
const struct link_hwss *link_hwss = get_link_hwss(link, &pipe_ctx->link_res);
- DC_LOGGER_INIT(dc->ctx->logger);
if (pipe_ctx->stream_res.stream_enc == NULL) {
pipe_ctx->stream = NULL;
return;
struct dce_hwseq *hws = dc->hwseq;
struct pipe_ctx *pipe = NULL;
- DC_LOGGER_INIT(dc->ctx->logger);
-
if (resource_is_pipe_topology_changed(dc->current_state, context))
resource_log_pipe_topology_update(dc, context);
struct dce_hwseq *hwseq = dc->hwseq;
int i;
- DC_LOGGER_INIT(dc->ctx->logger);
-
for (i = 0; i < dc->res_pool->pipe_count; i++)
if (resource_is_pipe_type(&dc->current_state->res_ctx.pipe_ctx[i], OPP_HEAD) &&
!resource_is_pipe_type(&context->res_ctx.pipe_ctx[i], OPP_HEAD))
struct dce_hwseq *hws = dc->hwseq;
uint32_t org_ip_request_cntl = 0;
- DC_LOGGER_INIT(dc->ctx->logger);
-
if (REG(DC_IP_REQUEST_CNTL)) {
REG_GET(DC_IP_REQUEST_CNTL, IP_REQUEST_EN, &org_ip_request_cntl);
if (org_ip_request_cntl == 0)
struct dce_hwseq *hws = dc->hwseq;
uint32_t org_ip_request_cntl = 0;
- DC_LOGGER_INIT(dc->ctx->logger);
-
/* Check and set DC_IP_REQUEST_CNTL if needed */
if (REG(DC_IP_REQUEST_CNTL)) {
REG_GET(DC_IP_REQUEST_CNTL, IP_REQUEST_EN, &org_ip_request_cntl);
*dongle = DISPLAY_DONGLE_DP_DVI_DONGLE;
sink_cap->max_hdmi_pixel_clock = DP_ADAPTOR_DVI_MAX_TMDS_CLK;
- CONN_DATA_DETECT(ddc->link, type2_dongle_buf, sizeof(type2_dongle_buf),
+ CONN_DATA_DETECT(link, type2_dongle_buf, sizeof(type2_dongle_buf),
"DP-DVI passive dongle %dMhz: ",
DP_ADAPTOR_DVI_MAX_TMDS_CLK / 1000);
return;
unsigned long long time_taken_in_ns;
int tries_taken;
- DC_LOGGER_INIT(link->ctx->logger);
-
/**
* this function will only exist if we are on dcn21 (is_in_alt_mode is a
* function pointer, so checking to see if it is equal to 0 is the same
static bool discover_dp_mst_topology(struct dc_link *link, enum dc_detect_reason reason)
{
- DC_LOGGER_INIT(link->ctx->logger);
-
LINK_INFO("link=%d, mst branch is now Connected\n",
link->link_index);
bool link_reset_cur_dp_mst_topology(struct dc_link *link)
{
- DC_LOGGER_INIT(link->ctx->logger);
-
LINK_INFO("link=%d, mst branch is now Disconnected\n",
link->link_index);
enum dc_connection_type new_connection_type = dc_connection_none;
const uint32_t post_oui_delay = 30; // 30ms
- DC_LOGGER_INIT(link->ctx->logger);
-
if (dc_is_virtual_signal(link->connector_signal))
return false;
bool is_delegated_to_mst_top_mgr = false;
enum dc_connection_type pre_link_type = link->type;
- DC_LOGGER_INIT(link->ctx->logger);
-
is_local_sink_detect_success = detect_link_and_local_sink(link, reason);
if (is_local_sink_detect_success && link->local_sink)
if (!replay)
return false;
- DC_LOGGER_INIT(link->ctx->logger);
-
if (dp_pr_get_panel_inst(dc, link, &panel_inst))
cmd_data->panel_inst = panel_inst;
else {
struct mpcc *mpc1_get_mpcc(struct mpc *mpc, int mpcc_id)
{
- struct dcn10_mpc *mpc10 = TO_DCN10_MPC(mpc);
-
- ASSERT(mpcc_id < mpc10->num_mpcc);
+ ASSERT(mpcc_id < TO_DCN10_MPC(mpc)->num_mpcc);
return &(mpc->mpcc_array[mpcc_id]);
}
struct _vcs_dpi_ip_params_st *loaded_ip =
get_asic_rev_ip_params(dc->ctx->asic_id.hw_internal_rev);
- DC_LOGGER_INIT(dc->ctx->logger);
-
if (pool->base.pp_smu) {
struct pp_smu_nv_clock_table max_clocks = {0};
unsigned int uclk_states[8] = {0};