mirror of
https://github.com/torvalds/linux.git
synced 2026-05-01 21:12:29 -04:00
Merge tag 'drm-next-5.5-2019-10-25' of git://people.freedesktop.org/~agd5f/linux into drm-next
drm-next-5.5-2019-10-25: amdgpu: - BACO support for CI and VI asics - Quick memory training support for navi - MSI-X support - RAS fixes - Display AVI infoframe fixes - Display ref clock fixes for renoir - Fix number of audio endpoints in renoir - Fix for discovery tables - Powerplay fixes - Documentation fixes - Misc cleanups radeon: - revert a PPC fix which broke x86 Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexdeucher@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191025221020.203546-1-alexander.deucher@amd.com
This commit is contained in:
@@ -3396,7 +3396,8 @@ static void fill_stream_properties_from_drm_display_mode(
|
||||
struct dc_crtc_timing *timing_out = &stream->timing;
|
||||
const struct drm_display_info *info = &connector->display_info;
|
||||
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
|
||||
memset(timing_out, 0, sizeof(struct dc_crtc_timing));
|
||||
struct hdmi_vendor_infoframe hv_frame;
|
||||
struct hdmi_avi_infoframe avi_frame;
|
||||
|
||||
timing_out->h_border_left = 0;
|
||||
timing_out->h_border_right = 0;
|
||||
@@ -3433,6 +3434,13 @@ static void fill_stream_properties_from_drm_display_mode(
|
||||
timing_out->flags.VSYNC_POSITIVE_POLARITY = 1;
|
||||
}
|
||||
|
||||
if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) {
|
||||
drm_hdmi_avi_infoframe_from_display_mode(&avi_frame, (struct drm_connector *)connector, mode_in);
|
||||
timing_out->vic = avi_frame.video_code;
|
||||
drm_hdmi_vendor_infoframe_from_display_mode(&hv_frame, (struct drm_connector *)connector, mode_in);
|
||||
timing_out->hdmi_vic = hv_frame.vic;
|
||||
}
|
||||
|
||||
timing_out->h_addressable = mode_in->crtc_hdisplay;
|
||||
timing_out->h_total = mode_in->crtc_htotal;
|
||||
timing_out->h_sync_width =
|
||||
@@ -3653,6 +3661,9 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
|
||||
|
||||
stream->dm_stream_context = aconnector;
|
||||
|
||||
stream->timing.flags.LTE_340MCSC_SCRAMBLE =
|
||||
drm_connector->display_info.hdmi.scdc.scrambling.low_rates;
|
||||
|
||||
list_for_each_entry(preferred_mode, &aconnector->base.modes, head) {
|
||||
/* Search for preferred mode */
|
||||
if (preferred_mode->type & DRM_MODE_TYPE_PREFERRED) {
|
||||
@@ -3727,6 +3738,9 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
|
||||
|
||||
update_stream_signal(stream, sink);
|
||||
|
||||
if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A)
|
||||
mod_build_hf_vsif_infopacket(stream, &stream->vsp_infopacket, false, false);
|
||||
|
||||
finish:
|
||||
dc_sink_release(sink);
|
||||
|
||||
|
||||
@@ -122,11 +122,16 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,
|
||||
}
|
||||
|
||||
/* Configure dithering */
|
||||
if (!dm_need_crc_dither(source))
|
||||
if (!dm_need_crc_dither(source)) {
|
||||
dc_stream_set_dither_option(stream_state, DITHER_OPTION_TRUN8);
|
||||
else
|
||||
dc_stream_set_dyn_expansion(stream_state->ctx->dc, stream_state,
|
||||
DYN_EXPANSION_DISABLE);
|
||||
} else {
|
||||
dc_stream_set_dither_option(stream_state,
|
||||
DITHER_OPTION_DEFAULT);
|
||||
dc_stream_set_dyn_expansion(stream_state->ctx->dc, stream_state,
|
||||
DYN_EXPANSION_AUTO);
|
||||
}
|
||||
|
||||
unlock:
|
||||
mutex_unlock(&adev->dm.dc_lock);
|
||||
|
||||
@@ -589,10 +589,9 @@ void pp_rv_set_wm_ranges(struct pp_smu *pp,
|
||||
if (pp_funcs && pp_funcs->set_watermarks_for_clocks_ranges)
|
||||
pp_funcs->set_watermarks_for_clocks_ranges(pp_handle,
|
||||
&wm_with_clock_ranges);
|
||||
else if (adev->smu.funcs &&
|
||||
adev->smu.funcs->set_watermarks_for_clock_ranges)
|
||||
else
|
||||
smu_set_watermarks_for_clock_ranges(&adev->smu,
|
||||
&wm_with_clock_ranges);
|
||||
&wm_with_clock_ranges);
|
||||
}
|
||||
|
||||
void pp_rv_set_pme_wa_enable(struct pp_smu *pp)
|
||||
@@ -665,7 +664,6 @@ enum pp_smu_status pp_nv_set_wm_ranges(struct pp_smu *pp,
|
||||
{
|
||||
const struct dc_context *ctx = pp->dm;
|
||||
struct amdgpu_device *adev = ctx->driver_context;
|
||||
struct smu_context *smu = &adev->smu;
|
||||
struct dm_pp_wm_sets_with_clock_ranges_soc15 wm_with_clock_ranges;
|
||||
struct dm_pp_clock_range_for_dmif_wm_set_soc15 *wm_dce_clocks =
|
||||
wm_with_clock_ranges.wm_dmif_clocks_ranges;
|
||||
@@ -708,15 +706,7 @@ enum pp_smu_status pp_nv_set_wm_ranges(struct pp_smu *pp,
|
||||
ranges->writer_wm_sets[i].min_drain_clk_mhz * 1000;
|
||||
}
|
||||
|
||||
if (!smu->funcs)
|
||||
return PP_SMU_RESULT_UNSUPPORTED;
|
||||
|
||||
/* 0: successful or smu.funcs->set_watermarks_for_clock_ranges = NULL;
|
||||
* 1: fail
|
||||
*/
|
||||
if (smu_set_watermarks_for_clock_ranges(&adev->smu,
|
||||
&wm_with_clock_ranges))
|
||||
return PP_SMU_RESULT_UNSUPPORTED;
|
||||
smu_set_watermarks_for_clock_ranges(&adev->smu, &wm_with_clock_ranges);
|
||||
|
||||
return PP_SMU_RESULT_OK;
|
||||
}
|
||||
@@ -901,6 +891,90 @@ enum pp_smu_status pp_nv_get_uclk_dpm_states(struct pp_smu *pp,
|
||||
return PP_SMU_RESULT_FAIL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DRM_AMD_DC_DCN2_1
|
||||
enum pp_smu_status pp_rn_get_dpm_clock_table(
|
||||
struct pp_smu *pp, struct dpm_clocks *clock_table)
|
||||
{
|
||||
const struct dc_context *ctx = pp->dm;
|
||||
struct amdgpu_device *adev = ctx->driver_context;
|
||||
struct smu_context *smu = &adev->smu;
|
||||
|
||||
if (!smu->ppt_funcs)
|
||||
return PP_SMU_RESULT_UNSUPPORTED;
|
||||
|
||||
if (!smu->ppt_funcs->get_dpm_clock_table)
|
||||
return PP_SMU_RESULT_UNSUPPORTED;
|
||||
|
||||
if (!smu->ppt_funcs->get_dpm_clock_table(smu, clock_table))
|
||||
return PP_SMU_RESULT_OK;
|
||||
|
||||
return PP_SMU_RESULT_FAIL;
|
||||
}
|
||||
|
||||
enum pp_smu_status pp_rn_set_wm_ranges(struct pp_smu *pp,
|
||||
struct pp_smu_wm_range_sets *ranges)
|
||||
{
|
||||
const struct dc_context *ctx = pp->dm;
|
||||
struct amdgpu_device *adev = ctx->driver_context;
|
||||
struct smu_context *smu = &adev->smu;
|
||||
struct dm_pp_wm_sets_with_clock_ranges_soc15 wm_with_clock_ranges;
|
||||
struct dm_pp_clock_range_for_dmif_wm_set_soc15 *wm_dce_clocks =
|
||||
wm_with_clock_ranges.wm_dmif_clocks_ranges;
|
||||
struct dm_pp_clock_range_for_mcif_wm_set_soc15 *wm_soc_clocks =
|
||||
wm_with_clock_ranges.wm_mcif_clocks_ranges;
|
||||
int32_t i;
|
||||
|
||||
if (!smu->funcs)
|
||||
return PP_SMU_RESULT_UNSUPPORTED;
|
||||
|
||||
wm_with_clock_ranges.num_wm_dmif_sets = ranges->num_reader_wm_sets;
|
||||
wm_with_clock_ranges.num_wm_mcif_sets = ranges->num_writer_wm_sets;
|
||||
|
||||
for (i = 0; i < wm_with_clock_ranges.num_wm_dmif_sets; i++) {
|
||||
if (ranges->reader_wm_sets[i].wm_inst > 3)
|
||||
wm_dce_clocks[i].wm_set_id = WM_SET_A;
|
||||
else
|
||||
wm_dce_clocks[i].wm_set_id =
|
||||
ranges->reader_wm_sets[i].wm_inst;
|
||||
|
||||
wm_dce_clocks[i].wm_min_dcfclk_clk_in_khz =
|
||||
ranges->reader_wm_sets[i].min_drain_clk_mhz;
|
||||
|
||||
wm_dce_clocks[i].wm_max_dcfclk_clk_in_khz =
|
||||
ranges->reader_wm_sets[i].max_drain_clk_mhz;
|
||||
|
||||
wm_dce_clocks[i].wm_min_mem_clk_in_khz =
|
||||
ranges->reader_wm_sets[i].min_fill_clk_mhz;
|
||||
|
||||
wm_dce_clocks[i].wm_max_mem_clk_in_khz =
|
||||
ranges->reader_wm_sets[i].max_fill_clk_mhz;
|
||||
}
|
||||
|
||||
for (i = 0; i < wm_with_clock_ranges.num_wm_mcif_sets; i++) {
|
||||
if (ranges->writer_wm_sets[i].wm_inst > 3)
|
||||
wm_soc_clocks[i].wm_set_id = WM_SET_A;
|
||||
else
|
||||
wm_soc_clocks[i].wm_set_id =
|
||||
ranges->writer_wm_sets[i].wm_inst;
|
||||
wm_soc_clocks[i].wm_min_socclk_clk_in_khz =
|
||||
ranges->writer_wm_sets[i].min_fill_clk_mhz;
|
||||
|
||||
wm_soc_clocks[i].wm_max_socclk_clk_in_khz =
|
||||
ranges->writer_wm_sets[i].max_fill_clk_mhz;
|
||||
|
||||
wm_soc_clocks[i].wm_min_mem_clk_in_khz =
|
||||
ranges->writer_wm_sets[i].min_drain_clk_mhz;
|
||||
|
||||
wm_soc_clocks[i].wm_max_mem_clk_in_khz =
|
||||
ranges->writer_wm_sets[i].max_drain_clk_mhz;
|
||||
}
|
||||
|
||||
smu_set_watermarks_for_clock_ranges(&adev->smu, &wm_with_clock_ranges);
|
||||
|
||||
return PP_SMU_RESULT_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
void dm_pp_get_funcs(
|
||||
struct dc_context *ctx,
|
||||
struct pp_smu_funcs *funcs)
|
||||
@@ -945,6 +1019,15 @@ void dm_pp_get_funcs(
|
||||
funcs->nv_funcs.set_pstate_handshake_support = pp_nv_set_pstate_handshake_support;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DRM_AMD_DC_DCN2_1
|
||||
case DCN_VERSION_2_1:
|
||||
funcs->ctx.ver = PP_SMU_VER_RN;
|
||||
funcs->rn_funcs.pp_smu.dm = ctx;
|
||||
funcs->rn_funcs.set_wm_ranges = pp_rn_set_wm_ranges;
|
||||
funcs->rn_funcs.get_dpm_clock_table = pp_rn_get_dpm_clock_table;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
DRM_ERROR("smu version is not supported !\n");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user