drm/amd/display: program fbc for scatter/gather

Fixing screen flickering when FBC enabled on Stoney

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Roman Li 2017-08-25 16:44:20 -04:00 committed by Alex Deucher
parent 1e4cee77bb
commit 07fde11f27

View File

@ -189,7 +189,7 @@ void dce110_compressor_enable_fbc(
(!dce110_compressor_is_fbc_enabled_in_hw(compressor, NULL))) {
uint32_t addr;
uint32_t value;
uint32_t value, misc_value;
addr = mmFBC_CNTL;
@ -206,9 +206,23 @@ void dce110_compressor_enable_fbc(
compressor->attached_inst = params->inst;
cp110->offsets = reg_offsets[params->inst];
/*Toggle it as there is bug in HW */
/* Toggle it as there is bug in HW */
set_reg_field_value(value, 0, FBC_CNTL, FBC_GRPH_COMP_EN);
dm_write_reg(compressor->ctx, addr, value);
/* FBC usage with scatter & gather for dce110 */
misc_value = dm_read_reg(compressor->ctx, mmFBC_MISC);
set_reg_field_value(misc_value, 1,
FBC_MISC, FBC_INVALIDATE_ON_ERROR);
set_reg_field_value(misc_value, 1,
FBC_MISC, FBC_DECOMPRESS_ERROR_CLEAR);
set_reg_field_value(misc_value, 0x14,
FBC_MISC, FBC_SLOW_REQ_INTERVAL);
dm_write_reg(compressor->ctx, mmFBC_MISC, misc_value);
/* Enable FBC */
set_reg_field_value(value, 1, FBC_CNTL, FBC_GRPH_COMP_EN);
dm_write_reg(compressor->ctx, addr, value);