Merge tag 'amd-drm-next-5.6-2020-01-09' of git://people.freedesktop.org/~agd5f/linux into drm-next
amd-drm-next-5.6-2020-01-09: amdgpu: - Enable DCN support on POWER - Enable GFXOFF for Raven1 refresh - Clean up MM engine idle handlers - HDMI 2.0 audio fixes - Fixes for some 10 bpc EDP panels - Watermark fixes for renoir - SR-IOV fixes - Runtime pm robustness fixes - Arcturus VCN fixes - RAS fixes - BACO fixes for Arcturus - Stable pstate fixes for swSMU - HDCP fixes - PSP cleanup - HDMI fixes - Misc cleanups amdkfd: - Spread interrupt work across cores to reduce latency - Topology fixes for APUs - GPU reset improvements UAPI: - Enable DRIVER_SYNCOBJ_TIMELINE for vulkan - Return better error values for kfd process ioctl Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexdeucher@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200109230338.8022-1-alexander.deucher@amd.com
This commit is contained in:
@@ -364,8 +364,10 @@ static struct fixed31_32 translate_from_linear_space(
|
||||
scratch_2 = dc_fixpt_mul(gamma_of_2,
|
||||
pow_buffer[pow_buffer_ptr%16]);
|
||||
|
||||
pow_buffer[pow_buffer_ptr%16] = scratch_2;
|
||||
pow_buffer_ptr++;
|
||||
if (pow_buffer_ptr != -1) {
|
||||
pow_buffer[pow_buffer_ptr%16] = scratch_2;
|
||||
pow_buffer_ptr++;
|
||||
}
|
||||
|
||||
scratch_1 = dc_fixpt_mul(scratch_1, scratch_2);
|
||||
scratch_1 = dc_fixpt_sub(scratch_1, args->a2);
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
#define STATIC_SCREEN_RAMP_DELTA_REFRESH_RATE_PER_FRAME ((1000 / 60) * 65)
|
||||
/* Number of elements in the render times cache array */
|
||||
#define RENDER_TIMES_MAX_COUNT 10
|
||||
/* Threshold to exit BTR (to avoid frequent enter-exits at the lower limit) */
|
||||
#define BTR_EXIT_MARGIN 2000
|
||||
/* Threshold to exit/exit BTR (to avoid frequent enter-exits at the lower limit) */
|
||||
#define BTR_MAX_MARGIN 2500
|
||||
/* Threshold to change BTR multiplier (to avoid frequent changes) */
|
||||
#define BTR_DRIFT_MARGIN 2000
|
||||
/*Threshold to exit fixed refresh rate*/
|
||||
@@ -254,24 +254,22 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
|
||||
unsigned int delta_from_mid_point_in_us_1 = 0xFFFFFFFF;
|
||||
unsigned int delta_from_mid_point_in_us_2 = 0xFFFFFFFF;
|
||||
unsigned int frames_to_insert = 0;
|
||||
unsigned int min_frame_duration_in_ns = 0;
|
||||
unsigned int max_render_time_in_us = in_out_vrr->max_duration_in_us;
|
||||
unsigned int delta_from_mid_point_delta_in_us;
|
||||
|
||||
min_frame_duration_in_ns = ((unsigned int) (div64_u64(
|
||||
(1000000000ULL * 1000000),
|
||||
in_out_vrr->max_refresh_in_uhz)));
|
||||
unsigned int max_render_time_in_us =
|
||||
in_out_vrr->max_duration_in_us - in_out_vrr->btr.margin_in_us;
|
||||
|
||||
/* Program BTR */
|
||||
if (last_render_time_in_us + BTR_EXIT_MARGIN < max_render_time_in_us) {
|
||||
if ((last_render_time_in_us + in_out_vrr->btr.margin_in_us / 2) < max_render_time_in_us) {
|
||||
/* Exit Below the Range */
|
||||
if (in_out_vrr->btr.btr_active) {
|
||||
in_out_vrr->btr.frame_counter = 0;
|
||||
in_out_vrr->btr.btr_active = false;
|
||||
}
|
||||
} else if (last_render_time_in_us > max_render_time_in_us) {
|
||||
} else if (last_render_time_in_us > (max_render_time_in_us + in_out_vrr->btr.margin_in_us / 2)) {
|
||||
/* Enter Below the Range */
|
||||
in_out_vrr->btr.btr_active = true;
|
||||
if (!in_out_vrr->btr.btr_active) {
|
||||
in_out_vrr->btr.btr_active = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* BTR set to "not active" so disengage */
|
||||
@@ -327,7 +325,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
|
||||
/* Choose number of frames to insert based on how close it
|
||||
* can get to the mid point of the variable range.
|
||||
*/
|
||||
if (delta_from_mid_point_in_us_1 < delta_from_mid_point_in_us_2) {
|
||||
if ((frame_time_in_us / mid_point_frames_ceil) > in_out_vrr->min_duration_in_us &&
|
||||
(delta_from_mid_point_in_us_1 < delta_from_mid_point_in_us_2 ||
|
||||
mid_point_frames_floor < 2)) {
|
||||
frames_to_insert = mid_point_frames_ceil;
|
||||
delta_from_mid_point_delta_in_us = delta_from_mid_point_in_us_2 -
|
||||
delta_from_mid_point_in_us_1;
|
||||
@@ -343,7 +343,7 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
|
||||
if (in_out_vrr->btr.frames_to_insert != 0 &&
|
||||
delta_from_mid_point_delta_in_us < BTR_DRIFT_MARGIN) {
|
||||
if (((last_render_time_in_us / in_out_vrr->btr.frames_to_insert) <
|
||||
in_out_vrr->max_duration_in_us) &&
|
||||
max_render_time_in_us) &&
|
||||
((last_render_time_in_us / in_out_vrr->btr.frames_to_insert) >
|
||||
in_out_vrr->min_duration_in_us))
|
||||
frames_to_insert = in_out_vrr->btr.frames_to_insert;
|
||||
@@ -796,6 +796,11 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
|
||||
refresh_range = in_out_vrr->max_refresh_in_uhz -
|
||||
in_out_vrr->min_refresh_in_uhz;
|
||||
|
||||
in_out_vrr->btr.margin_in_us = in_out_vrr->max_duration_in_us -
|
||||
2 * in_out_vrr->min_duration_in_us;
|
||||
if (in_out_vrr->btr.margin_in_us > BTR_MAX_MARGIN)
|
||||
in_out_vrr->btr.margin_in_us = BTR_MAX_MARGIN;
|
||||
|
||||
in_out_vrr->supported = true;
|
||||
}
|
||||
|
||||
@@ -811,6 +816,7 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
|
||||
in_out_vrr->btr.inserted_duration_in_us = 0;
|
||||
in_out_vrr->btr.frames_to_insert = 0;
|
||||
in_out_vrr->btr.frame_counter = 0;
|
||||
|
||||
in_out_vrr->btr.mid_point_in_us =
|
||||
(in_out_vrr->min_duration_in_us +
|
||||
in_out_vrr->max_duration_in_us) / 2;
|
||||
|
||||
@@ -67,11 +67,19 @@ enum mod_hdcp_status mod_hdcp_hdcp1_transition(struct mod_hdcp *hdcp,
|
||||
break;
|
||||
case H1_A2_COMPUTATIONS_A3_VALIDATE_RX_A6_TEST_FOR_REPEATER:
|
||||
if (input->bcaps_read != PASS ||
|
||||
input->r0p_read != PASS ||
|
||||
input->rx_validation != PASS ||
|
||||
(!conn->is_repeater && input->encryption != PASS)) {
|
||||
input->r0p_read != PASS) {
|
||||
fail_and_restart_in_ms(0, &status, output);
|
||||
break;
|
||||
} else if (input->rx_validation != PASS) {
|
||||
/* 1A-06: consider invalid r0' a failure */
|
||||
/* 1A-08: consider bksv listed in SRM a failure */
|
||||
/*
|
||||
* some slow RX will fail rx validation when it is
|
||||
* not ready. give it more time to react before retry.
|
||||
*/
|
||||
fail_and_restart_in_ms(1000, &status, output);
|
||||
break;
|
||||
} else if (!conn->is_repeater && input->encryption != PASS) {
|
||||
fail_and_restart_in_ms(0, &status, output);
|
||||
break;
|
||||
}
|
||||
@@ -212,7 +220,11 @@ enum mod_hdcp_status mod_hdcp_hdcp1_dp_transition(struct mod_hdcp *hdcp,
|
||||
* after 3 attempts.
|
||||
* 1A-08: consider bksv listed in SRM a failure
|
||||
*/
|
||||
fail_and_restart_in_ms(0, &status, output);
|
||||
/*
|
||||
* some slow RX will fail rx validation when it is
|
||||
* not ready. give it more time to react before retry.
|
||||
*/
|
||||
fail_and_restart_in_ms(1000, &status, output);
|
||||
}
|
||||
break;
|
||||
} else if ((!conn->is_repeater && input->encryption != PASS) ||
|
||||
|
||||
@@ -114,7 +114,7 @@ enum mod_hdcp_status mod_hdcp_hdcp2_transition(struct mod_hdcp *hdcp,
|
||||
if (event_ctx->event ==
|
||||
MOD_HDCP_EVENT_WATCHDOG_TIMEOUT) {
|
||||
/* 1A-11-3: consider h' timeout a failure */
|
||||
fail_and_restart_in_ms(0, &status, output);
|
||||
fail_and_restart_in_ms(1000, &status, output);
|
||||
} else {
|
||||
/* continue h' polling */
|
||||
callback_in_ms(100, output);
|
||||
@@ -166,7 +166,7 @@ enum mod_hdcp_status mod_hdcp_hdcp2_transition(struct mod_hdcp *hdcp,
|
||||
if (event_ctx->event ==
|
||||
MOD_HDCP_EVENT_WATCHDOG_TIMEOUT) {
|
||||
/* 1A-11-2: consider h' timeout a failure */
|
||||
fail_and_restart_in_ms(0, &status, output);
|
||||
fail_and_restart_in_ms(1000, &status, output);
|
||||
} else {
|
||||
/* continue h' polling */
|
||||
callback_in_ms(20, output);
|
||||
@@ -439,7 +439,7 @@ enum mod_hdcp_status mod_hdcp_hdcp2_dp_transition(struct mod_hdcp *hdcp,
|
||||
if (event_ctx->event ==
|
||||
MOD_HDCP_EVENT_WATCHDOG_TIMEOUT)
|
||||
/* 1A-10-3: consider h' timeout a failure */
|
||||
fail_and_restart_in_ms(0, &status, output);
|
||||
fail_and_restart_in_ms(1000, &status, output);
|
||||
else
|
||||
increment_stay_counter(hdcp);
|
||||
break;
|
||||
@@ -484,7 +484,7 @@ enum mod_hdcp_status mod_hdcp_hdcp2_dp_transition(struct mod_hdcp *hdcp,
|
||||
if (event_ctx->event ==
|
||||
MOD_HDCP_EVENT_WATCHDOG_TIMEOUT)
|
||||
/* 1A-10-2: consider h' timeout a failure */
|
||||
fail_and_restart_in_ms(0, &status, output);
|
||||
fail_and_restart_in_ms(1000, &status, output);
|
||||
else
|
||||
increment_stay_counter(hdcp);
|
||||
break;
|
||||
@@ -630,7 +630,10 @@ enum mod_hdcp_status mod_hdcp_hdcp2_dp_transition(struct mod_hdcp *hdcp,
|
||||
break;
|
||||
} else if (input->prepare_stream_manage != PASS ||
|
||||
input->stream_manage_write != PASS) {
|
||||
fail_and_restart_in_ms(0, &status, output);
|
||||
if (event_ctx->event == MOD_HDCP_EVENT_CALLBACK)
|
||||
fail_and_restart_in_ms(0, &status, output);
|
||||
else
|
||||
increment_stay_counter(hdcp);
|
||||
break;
|
||||
}
|
||||
callback_in_ms(100, output);
|
||||
@@ -655,10 +658,12 @@ enum mod_hdcp_status mod_hdcp_hdcp2_dp_transition(struct mod_hdcp *hdcp,
|
||||
*/
|
||||
if (hdcp->auth.count.stream_management_retry_count > 10) {
|
||||
fail_and_restart_in_ms(0, &status, output);
|
||||
} else {
|
||||
} else if (event_ctx->event == MOD_HDCP_EVENT_CALLBACK) {
|
||||
hdcp->auth.count.stream_management_retry_count++;
|
||||
callback_in_ms(0, output);
|
||||
set_state_id(hdcp, output, D2_A9_SEND_STREAM_MANAGEMENT);
|
||||
} else {
|
||||
increment_stay_counter(hdcp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -145,10 +145,11 @@ enum mod_hdcp_status mod_hdcp_hdcp1_create_session(struct mod_hdcp *hdcp)
|
||||
|
||||
psp_hdcp_invoke(psp, hdcp_cmd->cmd_id);
|
||||
|
||||
hdcp->auth.id = hdcp_cmd->out_msg.hdcp1_create_session.session_handle;
|
||||
|
||||
if (hdcp_cmd->hdcp_status != TA_HDCP_STATUS__SUCCESS)
|
||||
return MOD_HDCP_STATUS_HDCP1_CREATE_SESSION_FAILURE;
|
||||
|
||||
hdcp->auth.id = hdcp_cmd->out_msg.hdcp1_create_session.session_handle;
|
||||
hdcp->auth.msg.hdcp1.ainfo = hdcp_cmd->out_msg.hdcp1_create_session.ainfo_primary;
|
||||
memcpy(hdcp->auth.msg.hdcp1.aksv, hdcp_cmd->out_msg.hdcp1_create_session.aksv_primary,
|
||||
sizeof(hdcp->auth.msg.hdcp1.aksv));
|
||||
@@ -510,7 +511,7 @@ enum mod_hdcp_status mod_hdcp_hdcp2_validate_h_prime(struct mod_hdcp *hdcp)
|
||||
psp_hdcp_invoke(psp, hdcp_cmd->cmd_id);
|
||||
|
||||
if (hdcp_cmd->hdcp_status != TA_HDCP_STATUS__SUCCESS)
|
||||
return MOD_HDCP_STATUS_HDCP2_VALIDATE_AKE_CERT_FAILURE;
|
||||
return MOD_HDCP_STATUS_HDCP2_VALIDATE_H_PRIME_FAILURE;
|
||||
|
||||
if (msg_out->process.msg1_status != TA_HDCP2_MSG_AUTHENTICATION_STATUS__SUCCESS)
|
||||
return MOD_HDCP_STATUS_HDCP2_VALIDATE_H_PRIME_FAILURE;
|
||||
@@ -794,7 +795,7 @@ enum mod_hdcp_status mod_hdcp_hdcp2_validate_stream_ready(struct mod_hdcp *hdcp)
|
||||
hdcp_cmd->cmd_id = TA_HDCP_COMMAND__HDCP2_PREPARE_PROCESS_AUTHENTICATION_MSG_V2;
|
||||
psp_hdcp_invoke(psp, hdcp_cmd->cmd_id);
|
||||
|
||||
return (hdcp_cmd->hdcp_status != TA_HDCP_STATUS__SUCCESS) &&
|
||||
return (hdcp_cmd->hdcp_status == TA_HDCP_STATUS__SUCCESS) &&
|
||||
(msg_out->process.msg1_status == TA_HDCP2_MSG_AUTHENTICATION_STATUS__SUCCESS)
|
||||
? MOD_HDCP_STATUS_SUCCESS
|
||||
: MOD_HDCP_STATUS_HDCP2_VALIDATE_STREAM_READY_FAILURE;
|
||||
|
||||
@@ -92,6 +92,7 @@ struct mod_vrr_params_btr {
|
||||
uint32_t inserted_duration_in_us;
|
||||
uint32_t frames_to_insert;
|
||||
uint32_t frame_counter;
|
||||
uint32_t margin_in_us;
|
||||
};
|
||||
|
||||
struct mod_vrr_params_fixed_refresh {
|
||||
|
||||
Reference in New Issue
Block a user