sync
This commit is contained in:
parent
25f3a6cfac
commit
bfc16459ac
143 changed files with 3115 additions and 4613 deletions
|
@ -4596,7 +4596,11 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev)
|
|||
dev_info(adev->dev, "recover vram bo from shadow start\n");
|
||||
mutex_lock(&adev->shadow_list_lock);
|
||||
list_for_each_entry(vmbo, &adev->shadow_list, shadow_list) {
|
||||
shadow = &vmbo->bo;
|
||||
/* If vm is compute context or adev is APU, shadow will be NULL */
|
||||
if (!vmbo->shadow)
|
||||
continue;
|
||||
shadow = vmbo->shadow;
|
||||
|
||||
/* No need to recover an evicted BO */
|
||||
if (shadow->tbo.resource->mem_type != TTM_PL_TT ||
|
||||
shadow->tbo.resource->start == AMDGPU_BO_INVALID_OFFSET ||
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <linux/firmware.h>
|
||||
|
||||
#include "amdgpu_mes.h"
|
||||
#include "amdgpu.h"
|
||||
#include "soc15_common.h"
|
||||
|
@ -1423,3 +1425,60 @@ error_pasid:
|
|||
kfree(vm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int amdgpu_mes_init_microcode(struct amdgpu_device *adev, int pipe)
|
||||
{
|
||||
const struct mes_firmware_header_v1_0 *mes_hdr;
|
||||
struct amdgpu_firmware_info *info;
|
||||
char ucode_prefix[30];
|
||||
char fw_name[40];
|
||||
int r;
|
||||
|
||||
amdgpu_ucode_ip_version_decode(adev, GC_HWIP, ucode_prefix, sizeof(ucode_prefix));
|
||||
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
|
||||
ucode_prefix,
|
||||
pipe == AMDGPU_MES_SCHED_PIPE ? "" : "1");
|
||||
r = amdgpu_ucode_request(adev, &adev->mes.fw[pipe], fw_name);
|
||||
if (r)
|
||||
goto out;
|
||||
|
||||
mes_hdr = (const struct mes_firmware_header_v1_0 *)
|
||||
adev->mes.fw[pipe]->data;
|
||||
adev->mes.uc_start_addr[pipe] =
|
||||
le32_to_cpu(mes_hdr->mes_uc_start_addr_lo) |
|
||||
((uint64_t)(le32_to_cpu(mes_hdr->mes_uc_start_addr_hi)) << 32);
|
||||
adev->mes.data_start_addr[pipe] =
|
||||
le32_to_cpu(mes_hdr->mes_data_start_addr_lo) |
|
||||
((uint64_t)(le32_to_cpu(mes_hdr->mes_data_start_addr_hi)) << 32);
|
||||
|
||||
if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
|
||||
int ucode, ucode_data;
|
||||
|
||||
if (pipe == AMDGPU_MES_SCHED_PIPE) {
|
||||
ucode = AMDGPU_UCODE_ID_CP_MES;
|
||||
ucode_data = AMDGPU_UCODE_ID_CP_MES_DATA;
|
||||
} else {
|
||||
ucode = AMDGPU_UCODE_ID_CP_MES1;
|
||||
ucode_data = AMDGPU_UCODE_ID_CP_MES1_DATA;
|
||||
}
|
||||
|
||||
info = &adev->firmware.ucode[ucode];
|
||||
info->ucode_id = ucode;
|
||||
info->fw = adev->mes.fw[pipe];
|
||||
adev->firmware.fw_size +=
|
||||
roundup2(le32_to_cpu(mes_hdr->mes_ucode_size_bytes),
|
||||
PAGE_SIZE);
|
||||
|
||||
info = &adev->firmware.ucode[ucode_data];
|
||||
info->ucode_id = ucode_data;
|
||||
info->fw = adev->mes.fw[pipe];
|
||||
adev->firmware.fw_size +=
|
||||
roundup2(le32_to_cpu(mes_hdr->mes_ucode_data_size_bytes),
|
||||
PAGE_SIZE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
out:
|
||||
amdgpu_ucode_release(&adev->mes.fw[pipe]);
|
||||
return r;
|
||||
}
|
||||
|
|
|
@ -91,14 +91,12 @@ struct amdgpu_mes {
|
|||
struct amdgpu_bo *ucode_fw_obj[AMDGPU_MAX_MES_PIPES];
|
||||
uint64_t ucode_fw_gpu_addr[AMDGPU_MAX_MES_PIPES];
|
||||
uint32_t *ucode_fw_ptr[AMDGPU_MAX_MES_PIPES];
|
||||
uint32_t ucode_fw_version[AMDGPU_MAX_MES_PIPES];
|
||||
uint64_t uc_start_addr[AMDGPU_MAX_MES_PIPES];
|
||||
|
||||
/* mes ucode data */
|
||||
struct amdgpu_bo *data_fw_obj[AMDGPU_MAX_MES_PIPES];
|
||||
uint64_t data_fw_gpu_addr[AMDGPU_MAX_MES_PIPES];
|
||||
uint32_t *data_fw_ptr[AMDGPU_MAX_MES_PIPES];
|
||||
uint32_t data_fw_version[AMDGPU_MAX_MES_PIPES];
|
||||
uint64_t data_start_addr[AMDGPU_MAX_MES_PIPES];
|
||||
|
||||
/* eop gpu obj */
|
||||
|
@ -310,6 +308,7 @@ struct amdgpu_mes_funcs {
|
|||
|
||||
int amdgpu_mes_ctx_get_offs(struct amdgpu_ring *ring, unsigned int id_offs);
|
||||
|
||||
int amdgpu_mes_init_microcode(struct amdgpu_device *adev, int pipe);
|
||||
int amdgpu_mes_init(struct amdgpu_device *adev);
|
||||
void amdgpu_mes_fini(struct amdgpu_device *adev);
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ static int amdgpu_sched_process_priority_override(struct amdgpu_device *adev,
|
|||
#ifdef notyet
|
||||
struct fd f = fdget(fd);
|
||||
struct amdgpu_fpriv *fpriv;
|
||||
struct amdgpu_ctx_mgr *mgr;
|
||||
struct amdgpu_ctx *ctx;
|
||||
uint32_t id;
|
||||
int r;
|
||||
|
@ -54,8 +55,11 @@ static int amdgpu_sched_process_priority_override(struct amdgpu_device *adev,
|
|||
return r;
|
||||
}
|
||||
|
||||
idr_for_each_entry(&fpriv->ctx_mgr.ctx_handles, ctx, id)
|
||||
mgr = &fpriv->ctx_mgr;
|
||||
mutex_lock(&mgr->lock);
|
||||
idr_for_each_entry(&mgr->ctx_handles, ctx, id)
|
||||
amdgpu_ctx_priority_override(ctx, priority);
|
||||
mutex_unlock(&mgr->lock);
|
||||
|
||||
fdput(f);
|
||||
return 0;
|
||||
|
|
|
@ -1095,3 +1095,39 @@ void amdgpu_ucode_ip_version_decode(struct amdgpu_device *adev, int block_type,
|
|||
|
||||
snprintf(ucode_prefix, len, "%s_%d_%d_%d", ip_name, maj, min, rev);
|
||||
}
|
||||
|
||||
/*
|
||||
* amdgpu_ucode_request - Fetch and validate amdgpu microcode
|
||||
*
|
||||
* @adev: amdgpu device
|
||||
* @fw: pointer to load firmware to
|
||||
* @fw_name: firmware to load
|
||||
*
|
||||
* This is a helper that will use request_firmware and amdgpu_ucode_validate
|
||||
* to load and run basic validation on firmware. If the load fails, remap
|
||||
* the error code to -ENODEV, so that early_init functions will fail to load.
|
||||
*/
|
||||
int amdgpu_ucode_request(struct amdgpu_device *adev, const struct firmware **fw,
|
||||
const char *fw_name)
|
||||
{
|
||||
int err = request_firmware(fw, fw_name, adev->dev);
|
||||
|
||||
if (err)
|
||||
return -ENODEV;
|
||||
err = amdgpu_ucode_validate(*fw);
|
||||
if (err)
|
||||
dev_dbg(adev->dev, "\"%s\" failed to validate\n", fw_name);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* amdgpu_ucode_release - Release firmware microcode
|
||||
*
|
||||
* @fw: pointer to firmware to release
|
||||
*/
|
||||
void amdgpu_ucode_release(const struct firmware **fw)
|
||||
{
|
||||
release_firmware(*fw);
|
||||
*fw = NULL;
|
||||
}
|
||||
|
|
|
@ -543,6 +543,9 @@ void amdgpu_ucode_print_sdma_hdr(const struct common_firmware_header *hdr);
|
|||
void amdgpu_ucode_print_psp_hdr(const struct common_firmware_header *hdr);
|
||||
void amdgpu_ucode_print_gpu_info_hdr(const struct common_firmware_header *hdr);
|
||||
int amdgpu_ucode_validate(const struct firmware *fw);
|
||||
int amdgpu_ucode_request(struct amdgpu_device *adev, const struct firmware **fw,
|
||||
const char *fw_name);
|
||||
void amdgpu_ucode_release(const struct firmware **fw);
|
||||
bool amdgpu_ucode_hdr_version(union amdgpu_firmware_header *hdr,
|
||||
uint16_t hdr_major, uint16_t hdr_minor);
|
||||
|
||||
|
|
|
@ -3798,7 +3798,8 @@ static int gfx_v9_0_hw_fini(void *handle)
|
|||
{
|
||||
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
|
||||
|
||||
amdgpu_irq_put(adev, &adev->gfx.cp_ecc_error_irq, 0);
|
||||
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX))
|
||||
amdgpu_irq_put(adev, &adev->gfx.cp_ecc_error_irq, 0);
|
||||
amdgpu_irq_put(adev, &adev->gfx.priv_reg_irq, 0);
|
||||
amdgpu_irq_put(adev, &adev->gfx.priv_inst_irq, 0);
|
||||
|
||||
|
|
|
@ -1143,7 +1143,6 @@ static int gmc_v10_0_hw_fini(void *handle)
|
|||
return 0;
|
||||
}
|
||||
|
||||
amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);
|
||||
amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -932,7 +932,6 @@ static int gmc_v11_0_hw_fini(void *handle)
|
|||
return 0;
|
||||
}
|
||||
|
||||
amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);
|
||||
amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);
|
||||
gmc_v11_0_gart_disable(adev);
|
||||
|
||||
|
|
|
@ -1900,7 +1900,6 @@ static int gmc_v9_0_hw_fini(void *handle)
|
|||
if (adev->mmhub.funcs->update_power_gating)
|
||||
adev->mmhub.funcs->update_power_gating(adev, false);
|
||||
|
||||
amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);
|
||||
amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -54,6 +54,7 @@ static int jpeg_v3_0_early_init(void *handle)
|
|||
|
||||
switch (adev->ip_versions[UVD_HWIP][0]) {
|
||||
case IP_VERSION(3, 1, 1):
|
||||
case IP_VERSION(3, 1, 2):
|
||||
break;
|
||||
default:
|
||||
harvest = RREG32_SOC15(JPEG, 0, mmCC_UVD_HARVESTING);
|
||||
|
|
|
@ -375,93 +375,6 @@ static const struct amdgpu_mes_funcs mes_v10_1_funcs = {
|
|||
.resume_gang = mes_v10_1_resume_gang,
|
||||
};
|
||||
|
||||
static int mes_v10_1_init_microcode(struct amdgpu_device *adev,
|
||||
enum admgpu_mes_pipe pipe)
|
||||
{
|
||||
const char *chip_name;
|
||||
char fw_name[30];
|
||||
int err;
|
||||
const struct mes_firmware_header_v1_0 *mes_hdr;
|
||||
struct amdgpu_firmware_info *info;
|
||||
|
||||
switch (adev->ip_versions[GC_HWIP][0]) {
|
||||
case IP_VERSION(10, 1, 10):
|
||||
chip_name = "navi10";
|
||||
break;
|
||||
case IP_VERSION(10, 3, 0):
|
||||
chip_name = "sienna_cichlid";
|
||||
break;
|
||||
default:
|
||||
BUG();
|
||||
}
|
||||
|
||||
if (pipe == AMDGPU_MES_SCHED_PIPE)
|
||||
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes.bin",
|
||||
chip_name);
|
||||
else
|
||||
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes1.bin",
|
||||
chip_name);
|
||||
|
||||
err = request_firmware(&adev->mes.fw[pipe], fw_name, adev->dev);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = amdgpu_ucode_validate(adev->mes.fw[pipe]);
|
||||
if (err) {
|
||||
release_firmware(adev->mes.fw[pipe]);
|
||||
adev->mes.fw[pipe] = NULL;
|
||||
return err;
|
||||
}
|
||||
|
||||
mes_hdr = (const struct mes_firmware_header_v1_0 *)
|
||||
adev->mes.fw[pipe]->data;
|
||||
adev->mes.ucode_fw_version[pipe] =
|
||||
le32_to_cpu(mes_hdr->mes_ucode_version);
|
||||
adev->mes.ucode_fw_version[pipe] =
|
||||
le32_to_cpu(mes_hdr->mes_ucode_data_version);
|
||||
adev->mes.uc_start_addr[pipe] =
|
||||
le32_to_cpu(mes_hdr->mes_uc_start_addr_lo) |
|
||||
((uint64_t)(le32_to_cpu(mes_hdr->mes_uc_start_addr_hi)) << 32);
|
||||
adev->mes.data_start_addr[pipe] =
|
||||
le32_to_cpu(mes_hdr->mes_data_start_addr_lo) |
|
||||
((uint64_t)(le32_to_cpu(mes_hdr->mes_data_start_addr_hi)) << 32);
|
||||
|
||||
if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
|
||||
int ucode, ucode_data;
|
||||
|
||||
if (pipe == AMDGPU_MES_SCHED_PIPE) {
|
||||
ucode = AMDGPU_UCODE_ID_CP_MES;
|
||||
ucode_data = AMDGPU_UCODE_ID_CP_MES_DATA;
|
||||
} else {
|
||||
ucode = AMDGPU_UCODE_ID_CP_MES1;
|
||||
ucode_data = AMDGPU_UCODE_ID_CP_MES1_DATA;
|
||||
}
|
||||
|
||||
info = &adev->firmware.ucode[ucode];
|
||||
info->ucode_id = ucode;
|
||||
info->fw = adev->mes.fw[pipe];
|
||||
adev->firmware.fw_size +=
|
||||
roundup2(le32_to_cpu(mes_hdr->mes_ucode_size_bytes),
|
||||
PAGE_SIZE);
|
||||
|
||||
info = &adev->firmware.ucode[ucode_data];
|
||||
info->ucode_id = ucode_data;
|
||||
info->fw = adev->mes.fw[pipe];
|
||||
adev->firmware.fw_size +=
|
||||
roundup2(le32_to_cpu(mes_hdr->mes_ucode_data_size_bytes),
|
||||
PAGE_SIZE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mes_v10_1_free_microcode(struct amdgpu_device *adev,
|
||||
enum admgpu_mes_pipe pipe)
|
||||
{
|
||||
release_firmware(adev->mes.fw[pipe]);
|
||||
adev->mes.fw[pipe] = NULL;
|
||||
}
|
||||
|
||||
static int mes_v10_1_allocate_ucode_buffer(struct amdgpu_device *adev,
|
||||
enum admgpu_mes_pipe pipe)
|
||||
{
|
||||
|
@ -1019,10 +932,6 @@ static int mes_v10_1_sw_init(void *handle)
|
|||
if (!adev->enable_mes_kiq && pipe == AMDGPU_MES_KIQ_PIPE)
|
||||
continue;
|
||||
|
||||
r = mes_v10_1_init_microcode(adev, pipe);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
r = mes_v10_1_allocate_eop_buf(adev, pipe);
|
||||
if (r)
|
||||
return r;
|
||||
|
@ -1059,8 +968,7 @@ static int mes_v10_1_sw_fini(void *handle)
|
|||
amdgpu_bo_free_kernel(&adev->mes.eop_gpu_obj[pipe],
|
||||
&adev->mes.eop_gpu_addr[pipe],
|
||||
NULL);
|
||||
|
||||
mes_v10_1_free_microcode(adev, pipe);
|
||||
amdgpu_ucode_release(&adev->mes.fw[pipe]);
|
||||
}
|
||||
|
||||
amdgpu_bo_free_kernel(&adev->gfx.kiq.ring.mqd_obj,
|
||||
|
@ -1229,6 +1137,22 @@ static int mes_v10_1_resume(void *handle)
|
|||
return amdgpu_mes_resume(adev);
|
||||
}
|
||||
|
||||
static int mes_v10_0_early_init(void *handle)
|
||||
{
|
||||
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
|
||||
int pipe, r;
|
||||
|
||||
for (pipe = 0; pipe < AMDGPU_MAX_MES_PIPES; pipe++) {
|
||||
if (!adev->enable_mes_kiq && pipe == AMDGPU_MES_KIQ_PIPE)
|
||||
continue;
|
||||
r = amdgpu_mes_init_microcode(adev, pipe);
|
||||
if (r)
|
||||
return r;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mes_v10_0_late_init(void *handle)
|
||||
{
|
||||
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
|
||||
|
@ -1241,6 +1165,7 @@ static int mes_v10_0_late_init(void *handle)
|
|||
|
||||
static const struct amd_ip_funcs mes_v10_1_ip_funcs = {
|
||||
.name = "mes_v10_1",
|
||||
.early_init = mes_v10_0_early_init,
|
||||
.late_init = mes_v10_0_late_init,
|
||||
.sw_init = mes_v10_1_sw_init,
|
||||
.sw_fini = mes_v10_1_sw_fini,
|
||||
|
|
|
@ -453,84 +453,6 @@ static const struct amdgpu_mes_funcs mes_v11_0_funcs = {
|
|||
.misc_op = mes_v11_0_misc_op,
|
||||
};
|
||||
|
||||
static int mes_v11_0_init_microcode(struct amdgpu_device *adev,
|
||||
enum admgpu_mes_pipe pipe)
|
||||
{
|
||||
char fw_name[30];
|
||||
char ucode_prefix[30];
|
||||
int err;
|
||||
const struct mes_firmware_header_v1_0 *mes_hdr;
|
||||
struct amdgpu_firmware_info *info;
|
||||
|
||||
amdgpu_ucode_ip_version_decode(adev, GC_HWIP, ucode_prefix, sizeof(ucode_prefix));
|
||||
|
||||
if (pipe == AMDGPU_MES_SCHED_PIPE)
|
||||
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes.bin",
|
||||
ucode_prefix);
|
||||
else
|
||||
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes1.bin",
|
||||
ucode_prefix);
|
||||
|
||||
err = request_firmware(&adev->mes.fw[pipe], fw_name, adev->dev);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = amdgpu_ucode_validate(adev->mes.fw[pipe]);
|
||||
if (err) {
|
||||
release_firmware(adev->mes.fw[pipe]);
|
||||
adev->mes.fw[pipe] = NULL;
|
||||
return err;
|
||||
}
|
||||
|
||||
mes_hdr = (const struct mes_firmware_header_v1_0 *)
|
||||
adev->mes.fw[pipe]->data;
|
||||
adev->mes.ucode_fw_version[pipe] =
|
||||
le32_to_cpu(mes_hdr->mes_ucode_version);
|
||||
adev->mes.ucode_fw_version[pipe] =
|
||||
le32_to_cpu(mes_hdr->mes_ucode_data_version);
|
||||
adev->mes.uc_start_addr[pipe] =
|
||||
le32_to_cpu(mes_hdr->mes_uc_start_addr_lo) |
|
||||
((uint64_t)(le32_to_cpu(mes_hdr->mes_uc_start_addr_hi)) << 32);
|
||||
adev->mes.data_start_addr[pipe] =
|
||||
le32_to_cpu(mes_hdr->mes_data_start_addr_lo) |
|
||||
((uint64_t)(le32_to_cpu(mes_hdr->mes_data_start_addr_hi)) << 32);
|
||||
|
||||
if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
|
||||
int ucode, ucode_data;
|
||||
|
||||
if (pipe == AMDGPU_MES_SCHED_PIPE) {
|
||||
ucode = AMDGPU_UCODE_ID_CP_MES;
|
||||
ucode_data = AMDGPU_UCODE_ID_CP_MES_DATA;
|
||||
} else {
|
||||
ucode = AMDGPU_UCODE_ID_CP_MES1;
|
||||
ucode_data = AMDGPU_UCODE_ID_CP_MES1_DATA;
|
||||
}
|
||||
|
||||
info = &adev->firmware.ucode[ucode];
|
||||
info->ucode_id = ucode;
|
||||
info->fw = adev->mes.fw[pipe];
|
||||
adev->firmware.fw_size +=
|
||||
roundup2(le32_to_cpu(mes_hdr->mes_ucode_size_bytes),
|
||||
PAGE_SIZE);
|
||||
|
||||
info = &adev->firmware.ucode[ucode_data];
|
||||
info->ucode_id = ucode_data;
|
||||
info->fw = adev->mes.fw[pipe];
|
||||
adev->firmware.fw_size +=
|
||||
roundup2(le32_to_cpu(mes_hdr->mes_ucode_data_size_bytes),
|
||||
PAGE_SIZE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mes_v11_0_free_microcode(struct amdgpu_device *adev,
|
||||
enum admgpu_mes_pipe pipe)
|
||||
{
|
||||
release_firmware(adev->mes.fw[pipe]);
|
||||
adev->mes.fw[pipe] = NULL;
|
||||
}
|
||||
|
||||
static int mes_v11_0_allocate_ucode_buffer(struct amdgpu_device *adev,
|
||||
enum admgpu_mes_pipe pipe)
|
||||
{
|
||||
|
@ -1098,10 +1020,6 @@ static int mes_v11_0_sw_init(void *handle)
|
|||
if (!adev->enable_mes_kiq && pipe == AMDGPU_MES_KIQ_PIPE)
|
||||
continue;
|
||||
|
||||
r = mes_v11_0_init_microcode(adev, pipe);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
r = mes_v11_0_allocate_eop_buf(adev, pipe);
|
||||
if (r)
|
||||
return r;
|
||||
|
@ -1138,8 +1056,7 @@ static int mes_v11_0_sw_fini(void *handle)
|
|||
amdgpu_bo_free_kernel(&adev->mes.eop_gpu_obj[pipe],
|
||||
&adev->mes.eop_gpu_addr[pipe],
|
||||
NULL);
|
||||
|
||||
mes_v11_0_free_microcode(adev, pipe);
|
||||
amdgpu_ucode_release(&adev->mes.fw[pipe]);
|
||||
}
|
||||
|
||||
amdgpu_bo_free_kernel(&adev->gfx.kiq.ring.mqd_obj,
|
||||
|
@ -1334,6 +1251,22 @@ static int mes_v11_0_resume(void *handle)
|
|||
return amdgpu_mes_resume(adev);
|
||||
}
|
||||
|
||||
static int mes_v11_0_early_init(void *handle)
|
||||
{
|
||||
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
|
||||
int pipe, r;
|
||||
|
||||
for (pipe = 0; pipe < AMDGPU_MAX_MES_PIPES; pipe++) {
|
||||
if (!adev->enable_mes_kiq && pipe == AMDGPU_MES_KIQ_PIPE)
|
||||
continue;
|
||||
r = amdgpu_mes_init_microcode(adev, pipe);
|
||||
if (r)
|
||||
return r;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mes_v11_0_late_init(void *handle)
|
||||
{
|
||||
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
|
||||
|
@ -1348,6 +1281,7 @@ static int mes_v11_0_late_init(void *handle)
|
|||
|
||||
static const struct amd_ip_funcs mes_v11_0_ip_funcs = {
|
||||
.name = "mes_v11_0",
|
||||
.early_init = mes_v11_0_early_init,
|
||||
.late_init = mes_v11_0_late_init,
|
||||
.sw_init = mes_v11_0_sw_init,
|
||||
.sw_fini = mes_v11_0_sw_fini,
|
||||
|
|
|
@ -1941,9 +1941,11 @@ static int sdma_v4_0_hw_fini(void *handle)
|
|||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < adev->sdma.num_instances; i++) {
|
||||
amdgpu_irq_put(adev, &adev->sdma.ecc_irq,
|
||||
AMDGPU_SDMA_IRQ_INSTANCE0 + i);
|
||||
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__SDMA)) {
|
||||
for (i = 0; i < adev->sdma.num_instances; i++) {
|
||||
amdgpu_irq_put(adev, &adev->sdma.ecc_irq,
|
||||
AMDGPU_SDMA_IRQ_INSTANCE0 + i);
|
||||
}
|
||||
}
|
||||
|
||||
sdma_v4_0_ctx_switch_enable(adev, false);
|
||||
|
|
|
@ -715,7 +715,7 @@ static int soc21_common_early_init(void *handle)
|
|||
AMD_PG_SUPPORT_VCN_DPG |
|
||||
AMD_PG_SUPPORT_GFX_PG |
|
||||
AMD_PG_SUPPORT_JPEG;
|
||||
adev->external_rev_id = adev->rev_id + 0x1;
|
||||
adev->external_rev_id = adev->rev_id + 0x80;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "dc/dc_edid_parser.h"
|
||||
#include "dc/dc_stat.h"
|
||||
#include "amdgpu_dm_trace.h"
|
||||
#include "dc/inc/dc_link_ddc.h"
|
||||
|
||||
#include "vid.h"
|
||||
#include "amdgpu.h"
|
||||
|
@ -2256,6 +2257,14 @@ static void s3_handle_mst(struct drm_device *dev, bool suspend)
|
|||
if (suspend) {
|
||||
drm_dp_mst_topology_mgr_suspend(mgr);
|
||||
} else {
|
||||
/* if extended timeout is supported in hardware,
|
||||
* default to LTTPR timeout (3.2ms) first as a W/A for DP link layer
|
||||
* CTS 4.2.1.1 regression introduced by CTS specs requirement update.
|
||||
*/
|
||||
dc_link_aux_try_to_configure_timeout(aconnector->dc_link->ddc, LINK_AUX_DEFAULT_LTTPR_TIMEOUT_PERIOD);
|
||||
if (!dp_is_lttpr_present(aconnector->dc_link))
|
||||
dc_link_aux_try_to_configure_timeout(aconnector->dc_link->ddc, LINK_AUX_DEFAULT_TIMEOUT_PERIOD);
|
||||
|
||||
ret = drm_dp_mst_topology_mgr_resume(mgr, true);
|
||||
if (ret < 0) {
|
||||
dm_helpers_dp_mst_stop_top_mgr(aconnector->dc_link->ctx,
|
||||
|
@ -7588,6 +7597,13 @@ static void amdgpu_dm_commit_cursors(struct drm_atomic_state *state)
|
|||
handle_cursor_update(plane, old_plane_state);
|
||||
}
|
||||
|
||||
static inline uint32_t get_mem_type(struct drm_framebuffer *fb)
|
||||
{
|
||||
struct amdgpu_bo *abo = gem_to_amdgpu_bo(fb->obj[0]);
|
||||
|
||||
return abo->tbo.resource ? abo->tbo.resource->mem_type : 0;
|
||||
}
|
||||
|
||||
static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
|
||||
struct dc_state *dc_state,
|
||||
struct drm_device *dev,
|
||||
|
@ -7661,6 +7677,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
|
|||
continue;
|
||||
|
||||
dc_plane = dm_new_plane_state->dc_state;
|
||||
if (!dc_plane)
|
||||
continue;
|
||||
|
||||
bundle->surface_updates[planes_count].surface = dc_plane;
|
||||
if (new_pcrtc_state->color_mgmt_changed) {
|
||||
|
@ -7705,11 +7723,13 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
|
|||
|
||||
/*
|
||||
* Only allow immediate flips for fast updates that don't
|
||||
* change FB pitch, DCC state, rotation or mirroing.
|
||||
* change memory domain, FB pitch, DCC state, rotation or
|
||||
* mirroring.
|
||||
*/
|
||||
bundle->flip_addrs[planes_count].flip_immediate =
|
||||
crtc->state->async_flip &&
|
||||
acrtc_state->update_type == UPDATE_TYPE_FAST;
|
||||
acrtc_state->update_type == UPDATE_TYPE_FAST &&
|
||||
get_mem_type(old_plane_state->fb) == get_mem_type(fb);
|
||||
|
||||
timestamp_ns = ktime_get_ns();
|
||||
bundle->flip_addrs[planes_count].flip_timestamp_in_us = div_u64(timestamp_ns, 1000);
|
||||
|
@ -9203,8 +9223,9 @@ static int dm_update_plane_state(struct dc *dc,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (dm_old_plane_state->dc_state)
|
||||
dc_plane_state_release(dm_old_plane_state->dc_state);
|
||||
|
||||
dc_plane_state_release(dm_old_plane_state->dc_state);
|
||||
dm_new_plane_state->dc_state = NULL;
|
||||
|
||||
*lock_and_validation_needed = true;
|
||||
|
@ -9741,6 +9762,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
|
|||
ret = compute_mst_dsc_configs_for_state(state, dm_state->context, vars);
|
||||
if (ret) {
|
||||
DRM_DEBUG_DRIVER("compute_mst_dsc_configs_for_state() failed\n");
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
|
@ -1368,6 +1368,7 @@ int pre_validate_dsc(struct drm_atomic_state *state,
|
|||
ret = pre_compute_mst_dsc_configs_for_state(state, local_dc_state, vars);
|
||||
if (ret != 0) {
|
||||
DRM_INFO_ONCE("pre_compute_mst_dsc_configs_for_state() failed\n");
|
||||
ret = -EINVAL;
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -333,8 +333,8 @@ void dcn31_smu_set_zstate_support(struct clk_mgr_internal *clk_mgr, enum dcn_zst
|
|||
(support == DCN_ZSTATE_SUPPORT_ALLOW_Z10_ONLY))
|
||||
support = DCN_ZSTATE_SUPPORT_DISALLOW;
|
||||
|
||||
|
||||
if (support == DCN_ZSTATE_SUPPORT_ALLOW_Z10_ONLY)
|
||||
if (support == DCN_ZSTATE_SUPPORT_ALLOW_Z10_ONLY ||
|
||||
support == DCN_ZSTATE_SUPPORT_ALLOW_Z8_Z10_ONLY)
|
||||
param = 1;
|
||||
else
|
||||
param = 0;
|
||||
|
|
|
@ -349,8 +349,6 @@ void dcn314_smu_set_zstate_support(struct clk_mgr_internal *clk_mgr, enum dcn_zs
|
|||
if (!clk_mgr->smu_present)
|
||||
return;
|
||||
|
||||
// Arg[15:0] = 8/9/0 for Z8/Z9/disallow -> existing bits
|
||||
// Arg[16] = Disallow Z9 -> new bit
|
||||
switch (support) {
|
||||
|
||||
case DCN_ZSTATE_SUPPORT_ALLOW:
|
||||
|
@ -369,6 +367,16 @@ void dcn314_smu_set_zstate_support(struct clk_mgr_internal *clk_mgr, enum dcn_zs
|
|||
param = (1 << 10);
|
||||
break;
|
||||
|
||||
case DCN_ZSTATE_SUPPORT_ALLOW_Z8_Z10_ONLY:
|
||||
msg_id = VBIOSSMC_MSG_AllowZstatesEntry;
|
||||
param = (1 << 10) | (1 << 8);
|
||||
break;
|
||||
|
||||
case DCN_ZSTATE_SUPPORT_ALLOW_Z8_ONLY:
|
||||
msg_id = VBIOSSMC_MSG_AllowZstatesEntry;
|
||||
param = (1 << 8);
|
||||
break;
|
||||
|
||||
default: //DCN_ZSTATE_SUPPORT_UNKNOWN
|
||||
msg_id = VBIOSSMC_MSG_AllowZstatesEntry;
|
||||
param = 0;
|
||||
|
|
|
@ -756,6 +756,8 @@ void dcn32_clk_mgr_construct(
|
|||
struct pp_smu_funcs *pp_smu,
|
||||
struct dccg *dccg)
|
||||
{
|
||||
struct clk_log_info log_info = {0};
|
||||
|
||||
clk_mgr->base.ctx = ctx;
|
||||
clk_mgr->base.funcs = &dcn32_funcs;
|
||||
if (ASICREV_IS_GC_11_0_2(clk_mgr->base.ctx->asic_id.hw_internal_rev)) {
|
||||
|
@ -789,6 +791,7 @@ void dcn32_clk_mgr_construct(
|
|||
clk_mgr->base.clks.ref_dtbclk_khz = 268750;
|
||||
}
|
||||
|
||||
|
||||
/* integer part is now VCO frequency in kHz */
|
||||
clk_mgr->base.dentist_vco_freq_khz = dcn32_get_vco_frequency_from_reg(clk_mgr);
|
||||
|
||||
|
@ -796,6 +799,8 @@ void dcn32_clk_mgr_construct(
|
|||
if (clk_mgr->base.dentist_vco_freq_khz == 0)
|
||||
clk_mgr->base.dentist_vco_freq_khz = 4300000; /* Updated as per HW docs */
|
||||
|
||||
dcn32_dump_clk_registers(&clk_mgr->base.boot_snapshot, &clk_mgr->base, &log_info);
|
||||
|
||||
if (ctx->dc->debug.disable_dtb_ref_clk_switch &&
|
||||
clk_mgr->base.clks.ref_dtbclk_khz != clk_mgr->base.boot_snapshot.dtbclk) {
|
||||
clk_mgr->base.clks.ref_dtbclk_khz = clk_mgr->base.boot_snapshot.dtbclk;
|
||||
|
|
|
@ -3381,7 +3381,7 @@ bool dc_link_setup_psr(struct dc_link *link,
|
|||
case FAMILY_YELLOW_CARP:
|
||||
case AMDGPU_FAMILY_GC_10_3_6:
|
||||
case AMDGPU_FAMILY_GC_11_0_1:
|
||||
if (dc->debug.disable_z10)
|
||||
if (dc->debug.disable_z10 || dc->debug.psr_skip_crtc_disable)
|
||||
psr_context->psr_level.bits.SKIP_CRTC_DISABLE = true;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -1707,6 +1707,9 @@ bool dc_remove_plane_from_context(
|
|||
struct dc_stream_status *stream_status = NULL;
|
||||
struct resource_pool *pool = dc->res_pool;
|
||||
|
||||
if (!plane_state)
|
||||
return true;
|
||||
|
||||
for (i = 0; i < context->stream_count; i++)
|
||||
if (context->streams[i] == stream) {
|
||||
stream_status = &context->stream_status[i];
|
||||
|
|
|
@ -491,6 +491,8 @@ enum dcn_pwr_state {
|
|||
enum dcn_zstate_support_state {
|
||||
DCN_ZSTATE_SUPPORT_UNKNOWN,
|
||||
DCN_ZSTATE_SUPPORT_ALLOW,
|
||||
DCN_ZSTATE_SUPPORT_ALLOW_Z8_ONLY,
|
||||
DCN_ZSTATE_SUPPORT_ALLOW_Z8_Z10_ONLY,
|
||||
DCN_ZSTATE_SUPPORT_ALLOW_Z10_ONLY,
|
||||
DCN_ZSTATE_SUPPORT_DISALLOW,
|
||||
};
|
||||
|
@ -764,7 +766,6 @@ struct dc_debug_options {
|
|||
bool disable_mem_low_power;
|
||||
bool pstate_enabled;
|
||||
bool disable_dmcu;
|
||||
bool disable_psr;
|
||||
bool force_abm_enable;
|
||||
bool disable_stereo_support;
|
||||
bool vsr_support;
|
||||
|
@ -780,6 +781,7 @@ struct dc_debug_options {
|
|||
unsigned int force_odm_combine; //bit vector based on otg inst
|
||||
unsigned int seamless_boot_odm_combine;
|
||||
unsigned int force_odm_combine_4to1; //bit vector based on otg inst
|
||||
int minimum_z8_residency_time;
|
||||
bool disable_z9_mpc;
|
||||
unsigned int force_fclk_khz;
|
||||
bool enable_tri_buf;
|
||||
|
@ -828,6 +830,7 @@ struct dc_debug_options {
|
|||
int crb_alloc_policy_min_disp_count;
|
||||
bool disable_z10;
|
||||
bool enable_z9_disable_interface;
|
||||
bool psr_skip_crtc_disable;
|
||||
union dpia_debug_options dpia_debug;
|
||||
bool disable_fixed_vs_aux_timeout_wa;
|
||||
bool force_disable_subvp;
|
||||
|
|
|
@ -117,7 +117,7 @@ struct psr_settings {
|
|||
* Add a struct dc_panel_config under dc_link
|
||||
*/
|
||||
struct dc_panel_config {
|
||||
// extra panel power sequence parameters
|
||||
/* extra panel power sequence parameters */
|
||||
struct pps {
|
||||
unsigned int extra_t3_ms;
|
||||
unsigned int extra_t7_ms;
|
||||
|
@ -127,13 +127,21 @@ struct dc_panel_config {
|
|||
unsigned int extra_t12_ms;
|
||||
unsigned int extra_post_OUI_ms;
|
||||
} pps;
|
||||
// ABM
|
||||
/* PSR */
|
||||
struct psr {
|
||||
bool disable_psr;
|
||||
bool disallow_psrsu;
|
||||
bool rc_disable;
|
||||
bool rc_allow_static_screen;
|
||||
bool rc_allow_fullscreen_VPB;
|
||||
} psr;
|
||||
/* ABM */
|
||||
struct varib {
|
||||
unsigned int varibright_feature_enable;
|
||||
unsigned int def_varibright_level;
|
||||
unsigned int abm_config_setting;
|
||||
} varib;
|
||||
// edp DSC
|
||||
/* edp DSC */
|
||||
struct dsc {
|
||||
bool disable_dsc_edp;
|
||||
unsigned int force_dsc_edp_policy;
|
||||
|
|
|
@ -726,11 +726,15 @@ void dcn10_hubp_pg_control(
|
|||
}
|
||||
}
|
||||
|
||||
static void power_on_plane(
|
||||
static void power_on_plane_resources(
|
||||
struct dce_hwseq *hws,
|
||||
int plane_id)
|
||||
{
|
||||
DC_LOGGER_INIT(hws->ctx->logger);
|
||||
|
||||
if (hws->funcs.dpp_root_clock_control)
|
||||
hws->funcs.dpp_root_clock_control(hws, plane_id, true);
|
||||
|
||||
if (REG(DC_IP_REQUEST_CNTL)) {
|
||||
REG_SET(DC_IP_REQUEST_CNTL, 0,
|
||||
IP_REQUEST_EN, 1);
|
||||
|
@ -1237,11 +1241,15 @@ void dcn10_plane_atomic_power_down(struct dc *dc,
|
|||
hws->funcs.hubp_pg_control(hws, hubp->inst, false);
|
||||
|
||||
dpp->funcs->dpp_reset(dpp);
|
||||
|
||||
REG_SET(DC_IP_REQUEST_CNTL, 0,
|
||||
IP_REQUEST_EN, 0);
|
||||
DC_LOG_DEBUG(
|
||||
"Power gated front end %d\n", hubp->inst);
|
||||
}
|
||||
|
||||
if (hws->funcs.dpp_root_clock_control)
|
||||
hws->funcs.dpp_root_clock_control(hws, dpp->inst, false);
|
||||
}
|
||||
|
||||
/* disable HW used by plane.
|
||||
|
@ -2450,7 +2458,7 @@ static void dcn10_enable_plane(
|
|||
|
||||
undo_DEGVIDCN10_253_wa(dc);
|
||||
|
||||
power_on_plane(dc->hwseq,
|
||||
power_on_plane_resources(dc->hwseq,
|
||||
pipe_ctx->plane_res.hubp->inst);
|
||||
|
||||
/* enable DCFCLK current DCHUB */
|
||||
|
@ -3369,7 +3377,9 @@ static bool dcn10_can_pipe_disable_cursor(struct pipe_ctx *pipe_ctx)
|
|||
for (test_pipe = pipe_ctx->top_pipe; test_pipe;
|
||||
test_pipe = test_pipe->top_pipe) {
|
||||
// Skip invisible layer and pipe-split plane on same layer
|
||||
if (!test_pipe->plane_state->visible || test_pipe->plane_state->layer_index == cur_layer)
|
||||
if (!test_pipe->plane_state ||
|
||||
!test_pipe->plane_state->visible ||
|
||||
test_pipe->plane_state->layer_index == cur_layer)
|
||||
continue;
|
||||
|
||||
r2 = test_pipe->plane_res.scl_data.recout;
|
||||
|
|
|
@ -1087,11 +1087,15 @@ void dcn20_blank_pixel_data(
|
|||
}
|
||||
|
||||
|
||||
static void dcn20_power_on_plane(
|
||||
static void dcn20_power_on_plane_resources(
|
||||
struct dce_hwseq *hws,
|
||||
struct pipe_ctx *pipe_ctx)
|
||||
{
|
||||
DC_LOGGER_INIT(hws->ctx->logger);
|
||||
|
||||
if (hws->funcs.dpp_root_clock_control)
|
||||
hws->funcs.dpp_root_clock_control(hws, pipe_ctx->plane_res.dpp->inst, true);
|
||||
|
||||
if (REG(DC_IP_REQUEST_CNTL)) {
|
||||
REG_SET(DC_IP_REQUEST_CNTL, 0,
|
||||
IP_REQUEST_EN, 1);
|
||||
|
@ -1115,7 +1119,7 @@ static void dcn20_enable_plane(struct dc *dc, struct pipe_ctx *pipe_ctx,
|
|||
//if (dc->debug.sanity_checks) {
|
||||
// dcn10_verify_allow_pstate_change_high(dc);
|
||||
//}
|
||||
dcn20_power_on_plane(dc->hwseq, pipe_ctx);
|
||||
dcn20_power_on_plane_resources(dc->hwseq, pipe_ctx);
|
||||
|
||||
/* enable DCFCLK current DCHUB */
|
||||
pipe_ctx->plane_res.hubp->funcs->hubp_clk_cntl(pipe_ctx->plane_res.hubp, true);
|
||||
|
|
|
@ -671,12 +671,15 @@ static const struct dc_debug_options debug_defaults_diags = {
|
|||
.disable_pplib_wm_range = true,
|
||||
.disable_stutter = true,
|
||||
.disable_48mhz_pwrdwn = true,
|
||||
.disable_psr = true,
|
||||
.enable_tri_buf = true,
|
||||
.use_max_lb = true
|
||||
};
|
||||
|
||||
static const struct dc_panel_config panel_config_defaults = {
|
||||
.psr = {
|
||||
.disable_psr = false,
|
||||
.disallow_psrsu = false,
|
||||
},
|
||||
.ilr = {
|
||||
.optimize_edp_link_rate = true,
|
||||
},
|
||||
|
|
|
@ -723,7 +723,6 @@ static const struct dc_debug_options debug_defaults_drv = {
|
|||
.underflow_assert_delay_us = 0xFFFFFFFF,
|
||||
.dwb_fi_phase = -1, // -1 = disable,
|
||||
.dmub_command_table = true,
|
||||
.disable_psr = false,
|
||||
.use_max_lb = true,
|
||||
.exit_idle_opt_for_cursor_updates = true
|
||||
};
|
||||
|
@ -742,11 +741,17 @@ static const struct dc_debug_options debug_defaults_diags = {
|
|||
.scl_reset_length10 = true,
|
||||
.dwb_fi_phase = -1, // -1 = disable
|
||||
.dmub_command_table = true,
|
||||
.disable_psr = true,
|
||||
.enable_tri_buf = true,
|
||||
.use_max_lb = true
|
||||
};
|
||||
|
||||
static const struct dc_panel_config panel_config_defaults = {
|
||||
.psr = {
|
||||
.disable_psr = false,
|
||||
.disallow_psrsu = false,
|
||||
},
|
||||
};
|
||||
|
||||
static void dcn30_dpp_destroy(struct dpp **dpp)
|
||||
{
|
||||
kfree(TO_DCN20_DPP(*dpp));
|
||||
|
@ -2214,6 +2219,11 @@ void dcn30_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params
|
|||
}
|
||||
}
|
||||
|
||||
static void dcn30_get_panel_config_defaults(struct dc_panel_config *panel_config)
|
||||
{
|
||||
*panel_config = panel_config_defaults;
|
||||
}
|
||||
|
||||
static const struct resource_funcs dcn30_res_pool_funcs = {
|
||||
.destroy = dcn30_destroy_resource_pool,
|
||||
.link_enc_create = dcn30_link_encoder_create,
|
||||
|
@ -2233,6 +2243,7 @@ static const struct resource_funcs dcn30_res_pool_funcs = {
|
|||
.release_post_bldn_3dlut = dcn30_release_post_bldn_3dlut,
|
||||
.update_bw_bounding_box = dcn30_update_bw_bounding_box,
|
||||
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
|
||||
.get_panel_config_defaults = dcn30_get_panel_config_defaults,
|
||||
};
|
||||
|
||||
#define CTX ctx
|
||||
|
|
|
@ -112,10 +112,16 @@ static const struct dc_debug_options debug_defaults_diags = {
|
|||
.dwb_fi_phase = -1, // -1 = disable
|
||||
.dmub_command_table = true,
|
||||
.enable_tri_buf = true,
|
||||
.disable_psr = true,
|
||||
.use_max_lb = true
|
||||
};
|
||||
|
||||
static const struct dc_panel_config panel_config_defaults = {
|
||||
.psr = {
|
||||
.disable_psr = false,
|
||||
.disallow_psrsu = false,
|
||||
},
|
||||
};
|
||||
|
||||
enum dcn302_clk_src_array_id {
|
||||
DCN302_CLK_SRC_PLL0,
|
||||
DCN302_CLK_SRC_PLL1,
|
||||
|
@ -1132,6 +1138,11 @@ void dcn302_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param
|
|||
DC_FP_END();
|
||||
}
|
||||
|
||||
static void dcn302_get_panel_config_defaults(struct dc_panel_config *panel_config)
|
||||
{
|
||||
*panel_config = panel_config_defaults;
|
||||
}
|
||||
|
||||
static struct resource_funcs dcn302_res_pool_funcs = {
|
||||
.destroy = dcn302_destroy_resource_pool,
|
||||
.link_enc_create = dcn302_link_encoder_create,
|
||||
|
@ -1151,6 +1162,7 @@ static struct resource_funcs dcn302_res_pool_funcs = {
|
|||
.release_post_bldn_3dlut = dcn30_release_post_bldn_3dlut,
|
||||
.update_bw_bounding_box = dcn302_update_bw_bounding_box,
|
||||
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
|
||||
.get_panel_config_defaults = dcn302_get_panel_config_defaults,
|
||||
};
|
||||
|
||||
static struct dc_cap_funcs cap_funcs = {
|
||||
|
|
|
@ -96,7 +96,13 @@ static const struct dc_debug_options debug_defaults_diags = {
|
|||
.dwb_fi_phase = -1, // -1 = disable
|
||||
.dmub_command_table = true,
|
||||
.enable_tri_buf = true,
|
||||
.disable_psr = true,
|
||||
};
|
||||
|
||||
static const struct dc_panel_config panel_config_defaults = {
|
||||
.psr = {
|
||||
.disable_psr = false,
|
||||
.disallow_psrsu = false,
|
||||
},
|
||||
};
|
||||
|
||||
enum dcn303_clk_src_array_id {
|
||||
|
@ -1055,6 +1061,10 @@ static void dcn303_destroy_resource_pool(struct resource_pool **pool)
|
|||
*pool = NULL;
|
||||
}
|
||||
|
||||
static void dcn303_get_panel_config_defaults(struct dc_panel_config *panel_config)
|
||||
{
|
||||
*panel_config = panel_config_defaults;
|
||||
}
|
||||
|
||||
void dcn303_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params)
|
||||
{
|
||||
|
@ -1082,6 +1092,7 @@ static struct resource_funcs dcn303_res_pool_funcs = {
|
|||
.release_post_bldn_3dlut = dcn30_release_post_bldn_3dlut,
|
||||
.update_bw_bounding_box = dcn303_update_bw_bounding_box,
|
||||
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
|
||||
.get_panel_config_defaults = dcn303_get_panel_config_defaults,
|
||||
};
|
||||
|
||||
static struct dc_cap_funcs cap_funcs = {
|
||||
|
|
|
@ -66,17 +66,8 @@ void dccg31_update_dpp_dto(struct dccg *dccg, int dpp_inst, int req_dppclk)
|
|||
REG_UPDATE(DPPCLK_DTO_CTRL,
|
||||
DPPCLK_DTO_ENABLE[dpp_inst], 1);
|
||||
} else {
|
||||
//DTO must be enabled to generate a 0Hz clock output
|
||||
if (dccg->ctx->dc->debug.root_clock_optimization.bits.dpp) {
|
||||
REG_UPDATE(DPPCLK_DTO_CTRL,
|
||||
DPPCLK_DTO_ENABLE[dpp_inst], 1);
|
||||
REG_SET_2(DPPCLK_DTO_PARAM[dpp_inst], 0,
|
||||
DPPCLK0_DTO_PHASE, 0,
|
||||
DPPCLK0_DTO_MODULO, 1);
|
||||
} else {
|
||||
REG_UPDATE(DPPCLK_DTO_CTRL,
|
||||
DPPCLK_DTO_ENABLE[dpp_inst], 0);
|
||||
}
|
||||
REG_UPDATE(DPPCLK_DTO_CTRL,
|
||||
DPPCLK_DTO_ENABLE[dpp_inst], 0);
|
||||
}
|
||||
dccg->pipe_dppclk_khz[dpp_inst] = req_dppclk;
|
||||
}
|
||||
|
|
|
@ -911,6 +911,10 @@ static const struct dc_debug_options debug_defaults_diags = {
|
|||
};
|
||||
|
||||
static const struct dc_panel_config panel_config_defaults = {
|
||||
.psr = {
|
||||
.disable_psr = false,
|
||||
.disallow_psrsu = false,
|
||||
},
|
||||
.ilr = {
|
||||
.optimize_edp_link_rate = true,
|
||||
},
|
||||
|
|
|
@ -289,8 +289,31 @@ static void dccg314_set_valid_pixel_rate(
|
|||
dccg314_set_dtbclk_dto(dccg, &dto_params);
|
||||
}
|
||||
|
||||
static void dccg314_dpp_root_clock_control(
|
||||
struct dccg *dccg,
|
||||
unsigned int dpp_inst,
|
||||
bool clock_on)
|
||||
{
|
||||
struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
|
||||
|
||||
if (clock_on) {
|
||||
/* turn off the DTO and leave phase/modulo at max */
|
||||
REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_ENABLE[dpp_inst], 0);
|
||||
REG_SET_2(DPPCLK_DTO_PARAM[dpp_inst], 0,
|
||||
DPPCLK0_DTO_PHASE, 0xFF,
|
||||
DPPCLK0_DTO_MODULO, 0xFF);
|
||||
} else {
|
||||
/* turn on the DTO to generate a 0hz clock */
|
||||
REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_ENABLE[dpp_inst], 1);
|
||||
REG_SET_2(DPPCLK_DTO_PARAM[dpp_inst], 0,
|
||||
DPPCLK0_DTO_PHASE, 0,
|
||||
DPPCLK0_DTO_MODULO, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct dccg_funcs dccg314_funcs = {
|
||||
.update_dpp_dto = dccg31_update_dpp_dto,
|
||||
.dpp_root_clock_control = dccg314_dpp_root_clock_control,
|
||||
.get_dccg_ref_freq = dccg31_get_dccg_ref_freq,
|
||||
.dccg_init = dccg31_init,
|
||||
.set_dpstreamclk = dccg314_set_dpstreamclk,
|
||||
|
|
|
@ -392,6 +392,16 @@ void dcn314_set_pixels_per_cycle(struct pipe_ctx *pipe_ctx)
|
|||
pix_per_cycle);
|
||||
}
|
||||
|
||||
void dcn314_dpp_root_clock_control(struct dce_hwseq *hws, unsigned int dpp_inst, bool clock_on)
|
||||
{
|
||||
if (!hws->ctx->dc->debug.root_clock_optimization.bits.dpp)
|
||||
return;
|
||||
|
||||
if (hws->ctx->dc->res_pool->dccg->funcs->dpp_root_clock_control)
|
||||
hws->ctx->dc->res_pool->dccg->funcs->dpp_root_clock_control(
|
||||
hws->ctx->dc->res_pool->dccg, dpp_inst, clock_on);
|
||||
}
|
||||
|
||||
void dcn314_hubp_pg_control(struct dce_hwseq *hws, unsigned int hubp_inst, bool power_on)
|
||||
{
|
||||
struct dc_context *ctx = hws->ctx;
|
||||
|
|
|
@ -43,4 +43,6 @@ void dcn314_set_pixels_per_cycle(struct pipe_ctx *pipe_ctx);
|
|||
|
||||
void dcn314_hubp_pg_control(struct dce_hwseq *hws, unsigned int hubp_inst, bool power_on);
|
||||
|
||||
void dcn314_dpp_root_clock_control(struct dce_hwseq *hws, unsigned int dpp_inst, bool clock_on);
|
||||
|
||||
#endif /* __DC_HWSS_DCN314_H__ */
|
||||
|
|
|
@ -137,6 +137,7 @@ static const struct hwseq_private_funcs dcn314_private_funcs = {
|
|||
.plane_atomic_disable = dcn20_plane_atomic_disable,
|
||||
.plane_atomic_power_down = dcn10_plane_atomic_power_down,
|
||||
.enable_power_gating_plane = dcn314_enable_power_gating_plane,
|
||||
.dpp_root_clock_control = dcn314_dpp_root_clock_control,
|
||||
.hubp_pg_control = dcn314_hubp_pg_control,
|
||||
.program_all_writeback_pipes_in_tree = dcn30_program_all_writeback_pipes_in_tree,
|
||||
.update_odm = dcn314_update_odm,
|
||||
|
|
|
@ -884,6 +884,8 @@ static const struct dc_plane_cap plane_cap = {
|
|||
static const struct dc_debug_options debug_defaults_drv = {
|
||||
.disable_z10 = false,
|
||||
.enable_z9_disable_interface = true,
|
||||
.minimum_z8_residency_time = 2000,
|
||||
.psr_skip_crtc_disable = true,
|
||||
.disable_dmcu = true,
|
||||
.force_abm_enable = false,
|
||||
.timing_trace = false,
|
||||
|
@ -940,6 +942,10 @@ static const struct dc_debug_options debug_defaults_diags = {
|
|||
};
|
||||
|
||||
static const struct dc_panel_config panel_config_defaults = {
|
||||
.psr = {
|
||||
.disable_psr = false,
|
||||
.disallow_psrsu = false,
|
||||
},
|
||||
.ilr = {
|
||||
.optimize_edp_link_rate = true,
|
||||
},
|
||||
|
|
|
@ -907,6 +907,10 @@ static const struct dc_debug_options debug_defaults_diags = {
|
|||
};
|
||||
|
||||
static const struct dc_panel_config panel_config_defaults = {
|
||||
.psr = {
|
||||
.disable_psr = false,
|
||||
.disallow_psrsu = false,
|
||||
},
|
||||
.ilr = {
|
||||
.optimize_edp_link_rate = true,
|
||||
},
|
||||
|
|
|
@ -906,6 +906,10 @@ static const struct dc_debug_options debug_defaults_diags = {
|
|||
};
|
||||
|
||||
static const struct dc_panel_config panel_config_defaults = {
|
||||
.psr = {
|
||||
.disable_psr = false,
|
||||
.disallow_psrsu = false,
|
||||
},
|
||||
.ilr = {
|
||||
.optimize_edp_link_rate = true,
|
||||
},
|
||||
|
|
|
@ -984,6 +984,7 @@ void dcn32_init_hw(struct dc *dc)
|
|||
if (dc->ctx->dmub_srv) {
|
||||
dc_dmub_srv_query_caps_cmd(dc->ctx->dmub_srv->dmub);
|
||||
dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr;
|
||||
dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch;
|
||||
}
|
||||
|
||||
/* Enable support for ODM and windowed MPO if policy flag is set */
|
||||
|
|
|
@ -1984,7 +1984,7 @@ int dcn32_populate_dml_pipes_from_context(
|
|||
// In general cases we want to keep the dram clock change requirement
|
||||
// (prefer configs that support MCLK switch). Only override to false
|
||||
// for SubVP
|
||||
if (subvp_in_use)
|
||||
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || subvp_in_use)
|
||||
context->bw_ctx.dml.soc.dram_clock_change_requirement_final = false;
|
||||
else
|
||||
context->bw_ctx.dml.soc.dram_clock_change_requirement_final = true;
|
||||
|
@ -2037,6 +2037,14 @@ static struct resource_funcs dcn32_res_pool_funcs = {
|
|||
.remove_phantom_pipes = dcn32_remove_phantom_pipes,
|
||||
};
|
||||
|
||||
static uint32_t read_pipe_fuses(struct dc_context *ctx)
|
||||
{
|
||||
uint32_t value = REG_READ(CC_DC_PIPE_DIS);
|
||||
/* DCN32 support max 4 pipes */
|
||||
value = value & 0xf;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
static bool dcn32_resource_construct(
|
||||
uint8_t num_virtual_links,
|
||||
|
@ -2079,7 +2087,7 @@ static bool dcn32_resource_construct(
|
|||
pool->base.res_cap = &res_cap_dcn32;
|
||||
/* max number of pipes for ASIC before checking for pipe fuses */
|
||||
num_pipes = pool->base.res_cap->num_timing_generator;
|
||||
pipe_fuses = REG_READ(CC_DC_PIPE_DIS);
|
||||
pipe_fuses = read_pipe_fuses(ctx);
|
||||
|
||||
for (i = 0; i < pool->base.res_cap->num_timing_generator; i++)
|
||||
if (pipe_fuses & 1 << i)
|
||||
|
|
|
@ -1621,6 +1621,14 @@ static struct resource_funcs dcn321_res_pool_funcs = {
|
|||
.remove_phantom_pipes = dcn32_remove_phantom_pipes,
|
||||
};
|
||||
|
||||
static uint32_t read_pipe_fuses(struct dc_context *ctx)
|
||||
{
|
||||
uint32_t value = REG_READ(CC_DC_PIPE_DIS);
|
||||
/* DCN321 support max 4 pipes */
|
||||
value = value & 0xf;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
static bool dcn321_resource_construct(
|
||||
uint8_t num_virtual_links,
|
||||
|
@ -1663,7 +1671,7 @@ static bool dcn321_resource_construct(
|
|||
pool->base.res_cap = &res_cap_dcn321;
|
||||
/* max number of pipes for ASIC before checking for pipe fuses */
|
||||
num_pipes = pool->base.res_cap->num_timing_generator;
|
||||
pipe_fuses = REG_READ(CC_DC_PIPE_DIS);
|
||||
pipe_fuses = read_pipe_fuses(ctx);
|
||||
|
||||
for (i = 0; i < pool->base.res_cap->num_timing_generator; i++)
|
||||
if (pipe_fuses & 1 << i)
|
||||
|
|
|
@ -963,6 +963,8 @@ static enum dcn_zstate_support_state decide_zstate_support(struct dc *dc, struc
|
|||
* 2. single eDP, on link 0, 1 plane and stutter period > 5ms
|
||||
* Z10 only cases:
|
||||
* 1. single eDP, on link 0, 1 plane and stutter period >= 5ms
|
||||
* Z8 cases:
|
||||
* 1. stutter period sufficient
|
||||
* Zstate not allowed cases:
|
||||
* 1. Everything else
|
||||
*/
|
||||
|
@ -971,6 +973,9 @@ static enum dcn_zstate_support_state decide_zstate_support(struct dc *dc, struc
|
|||
else if (context->stream_count == 1 && context->streams[0]->signal == SIGNAL_TYPE_EDP) {
|
||||
struct dc_link *link = context->streams[0]->sink->link;
|
||||
struct dc_stream_status *stream_status = &context->stream_status[0];
|
||||
int minmum_z8_residency = dc->debug.minimum_z8_residency_time > 0 ? dc->debug.minimum_z8_residency_time : 1000;
|
||||
bool allow_z8 = context->bw_ctx.dml.vba.StutterPeriod > (double)minmum_z8_residency;
|
||||
bool is_pwrseq0 = link->link_index == 0;
|
||||
|
||||
if (dc_extended_blank_supported(dc)) {
|
||||
for (i = 0; i < dc->res_pool->pipe_count; i++) {
|
||||
|
@ -983,18 +988,20 @@ static enum dcn_zstate_support_state decide_zstate_support(struct dc *dc, struc
|
|||
}
|
||||
}
|
||||
}
|
||||
/* zstate only supported on PWRSEQ0 and when there's <2 planes*/
|
||||
if (link->link_index != 0 || stream_status->plane_count > 1)
|
||||
|
||||
/* Don't support multi-plane configurations */
|
||||
if (stream_status->plane_count > 1)
|
||||
return DCN_ZSTATE_SUPPORT_DISALLOW;
|
||||
|
||||
if (context->bw_ctx.dml.vba.StutterPeriod > 5000.0 || optimized_min_dst_y_next_start_us > 5000)
|
||||
if (is_pwrseq0 && (context->bw_ctx.dml.vba.StutterPeriod > 5000.0 || optimized_min_dst_y_next_start_us > 5000))
|
||||
return DCN_ZSTATE_SUPPORT_ALLOW;
|
||||
else if (link->psr_settings.psr_version == DC_PSR_VERSION_1 && !dc->debug.disable_psr)
|
||||
return DCN_ZSTATE_SUPPORT_ALLOW_Z10_ONLY;
|
||||
else if (is_pwrseq0 && link->psr_settings.psr_version == DC_PSR_VERSION_1 && !link->panel_config.psr.disable_psr)
|
||||
return allow_z8 ? DCN_ZSTATE_SUPPORT_ALLOW_Z8_Z10_ONLY : DCN_ZSTATE_SUPPORT_ALLOW_Z10_ONLY;
|
||||
else
|
||||
return DCN_ZSTATE_SUPPORT_DISALLOW;
|
||||
} else
|
||||
return allow_z8 ? DCN_ZSTATE_SUPPORT_ALLOW_Z8_ONLY : DCN_ZSTATE_SUPPORT_DISALLOW;
|
||||
} else {
|
||||
return DCN_ZSTATE_SUPPORT_DISALLOW;
|
||||
}
|
||||
}
|
||||
|
||||
void dcn20_calculate_dlg_params(
|
||||
|
|
|
@ -368,7 +368,9 @@ void dcn30_fpu_update_soc_for_wm_a(struct dc *dc, struct dc_state *context)
|
|||
dc_assert_fp_enabled();
|
||||
|
||||
if (dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].valid) {
|
||||
context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us;
|
||||
if (!context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching ||
|
||||
context->bw_ctx.dml.soc.dram_clock_change_latency_us == 0)
|
||||
context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us;
|
||||
context->bw_ctx.dml.soc.sr_enter_plus_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.sr_enter_plus_exit_time_us;
|
||||
context->bw_ctx.dml.soc.sr_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.sr_exit_time_us;
|
||||
}
|
||||
|
@ -520,9 +522,21 @@ void dcn30_fpu_calculate_wm_and_dlg(
|
|||
pipe_idx++;
|
||||
}
|
||||
|
||||
DC_FP_START();
|
||||
// WA: restrict FPO to use first non-strobe mode (NV24 BW issue)
|
||||
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching &&
|
||||
dc->dml.soc.num_chans <= 4 &&
|
||||
context->bw_ctx.dml.vba.DRAMSpeed <= 1700 &&
|
||||
context->bw_ctx.dml.vba.DRAMSpeed >= 1500) {
|
||||
|
||||
for (i = 0; i < dc->dml.soc.num_states; i++) {
|
||||
if (dc->dml.soc.clock_limits[i].dram_speed_mts > 1700) {
|
||||
context->bw_ctx.dml.vba.DRAMSpeed = dc->dml.soc.clock_limits[i].dram_speed_mts;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dcn20_calculate_dlg_params(dc, context, pipes, pipe_cnt, vlevel);
|
||||
DC_FP_END();
|
||||
|
||||
if (!pstate_en)
|
||||
/* Restore full p-state latency */
|
||||
|
|
|
@ -148,8 +148,8 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_14_soc = {
|
|||
.num_states = 5,
|
||||
.sr_exit_time_us = 16.5,
|
||||
.sr_enter_plus_exit_time_us = 18.5,
|
||||
.sr_exit_z8_time_us = 442.0,
|
||||
.sr_enter_plus_exit_z8_time_us = 560.0,
|
||||
.sr_exit_z8_time_us = 268.0,
|
||||
.sr_enter_plus_exit_z8_time_us = 393.0,
|
||||
.writeback_latency_us = 12.0,
|
||||
.dram_channel_width_bytes = 4,
|
||||
.round_trip_ping_latency_dcfclk_cycles = 106,
|
||||
|
|
|
@ -1200,9 +1200,7 @@ static void dcn32_full_validate_bw_helper(struct dc *dc,
|
|||
}
|
||||
} else {
|
||||
// Most populate phantom DLG params before programming hardware / timing for phantom pipe
|
||||
DC_FP_START();
|
||||
dcn32_helper_populate_phantom_dlg_params(dc, context, pipes, *pipe_cnt);
|
||||
DC_FP_END();
|
||||
|
||||
/* Call validate_apply_pipe_split flags after calling DML getters for
|
||||
* phantom dlg params, or some of the VBA params indicating pipe split
|
||||
|
@ -1503,11 +1501,8 @@ bool dcn32_internal_validate_bw(struct dc *dc,
|
|||
|
||||
dml_log_pipe_params(&context->bw_ctx.dml, pipes, pipe_cnt);
|
||||
|
||||
if (!fast_validate) {
|
||||
DC_FP_START();
|
||||
if (!fast_validate)
|
||||
dcn32_full_validate_bw_helper(dc, context, pipes, &vlevel, split, merge, &pipe_cnt);
|
||||
DC_FP_END();
|
||||
}
|
||||
|
||||
if (fast_validate ||
|
||||
(dc->debug.dml_disallow_alternate_prefetch_modes &&
|
||||
|
@ -2172,9 +2167,7 @@ static int build_synthetic_soc_states(struct clk_bw_params *bw_params,
|
|||
entry.fabricclk_mhz = 0;
|
||||
entry.dram_speed_mts = 0;
|
||||
|
||||
DC_FP_START();
|
||||
insert_entry_into_table_sorted(table, num_entries, &entry);
|
||||
DC_FP_END();
|
||||
}
|
||||
|
||||
// Insert the max DCFCLK
|
||||
|
@ -2182,9 +2175,7 @@ static int build_synthetic_soc_states(struct clk_bw_params *bw_params,
|
|||
entry.fabricclk_mhz = 0;
|
||||
entry.dram_speed_mts = 0;
|
||||
|
||||
DC_FP_START();
|
||||
insert_entry_into_table_sorted(table, num_entries, &entry);
|
||||
DC_FP_END();
|
||||
|
||||
// Insert the UCLK DPMS
|
||||
for (i = 0; i < num_uclk_dpms; i++) {
|
||||
|
@ -2192,9 +2183,7 @@ static int build_synthetic_soc_states(struct clk_bw_params *bw_params,
|
|||
entry.fabricclk_mhz = 0;
|
||||
entry.dram_speed_mts = bw_params->clk_table.entries[i].memclk_mhz * 16;
|
||||
|
||||
DC_FP_START();
|
||||
insert_entry_into_table_sorted(table, num_entries, &entry);
|
||||
DC_FP_END();
|
||||
}
|
||||
|
||||
// If FCLK is coarse grained, insert individual DPMs.
|
||||
|
@ -2204,9 +2193,7 @@ static int build_synthetic_soc_states(struct clk_bw_params *bw_params,
|
|||
entry.fabricclk_mhz = bw_params->clk_table.entries[i].fclk_mhz;
|
||||
entry.dram_speed_mts = 0;
|
||||
|
||||
DC_FP_START();
|
||||
insert_entry_into_table_sorted(table, num_entries, &entry);
|
||||
DC_FP_END();
|
||||
}
|
||||
}
|
||||
// If FCLK fine grained, only insert max
|
||||
|
@ -2215,9 +2202,7 @@ static int build_synthetic_soc_states(struct clk_bw_params *bw_params,
|
|||
entry.fabricclk_mhz = max_fclk_mhz;
|
||||
entry.dram_speed_mts = 0;
|
||||
|
||||
DC_FP_START();
|
||||
insert_entry_into_table_sorted(table, num_entries, &entry);
|
||||
DC_FP_END();
|
||||
}
|
||||
|
||||
// At this point, the table contains all "points of interest" based on
|
||||
|
|
|
@ -807,7 +807,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
|
|||
v->SwathHeightY[k],
|
||||
v->SwathHeightC[k],
|
||||
TWait,
|
||||
v->DRAMSpeedPerState[mode_lib->vba.VoltageLevel] <= MEM_STROBE_FREQ_MHZ ?
|
||||
(v->DRAMSpeedPerState[mode_lib->vba.VoltageLevel] <= MEM_STROBE_FREQ_MHZ ||
|
||||
v->DCFCLKPerState[mode_lib->vba.VoltageLevel] <= MIN_DCFCLK_FREQ_MHZ) ?
|
||||
mode_lib->vba.ip.min_prefetch_in_strobe_us : 0,
|
||||
/* Output */
|
||||
&v->DSTXAfterScaler[k],
|
||||
|
@ -3288,7 +3289,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
|
|||
v->swath_width_chroma_ub_this_state[k],
|
||||
v->SwathHeightYThisState[k],
|
||||
v->SwathHeightCThisState[k], v->TWait,
|
||||
v->DRAMSpeedPerState[i] <= MEM_STROBE_FREQ_MHZ ?
|
||||
(v->DRAMSpeedPerState[i] <= MEM_STROBE_FREQ_MHZ || v->DCFCLKState[i][j] <= MIN_DCFCLK_FREQ_MHZ) ?
|
||||
mode_lib->vba.ip.min_prefetch_in_strobe_us : 0,
|
||||
|
||||
/* Output */
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
#define BPP_BLENDED_PIPE 0xffffffff
|
||||
|
||||
#define MEM_STROBE_FREQ_MHZ 1600
|
||||
#define MIN_DCFCLK_FREQ_MHZ 200
|
||||
#define MEM_STROBE_MAX_DELIVERY_TIME_US 60.0
|
||||
|
||||
struct display_mode_lib;
|
||||
|
|
|
@ -106,16 +106,16 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_21_soc = {
|
|||
.clock_limits = {
|
||||
{
|
||||
.state = 0,
|
||||
.dcfclk_mhz = 1564.0,
|
||||
.fabricclk_mhz = 400.0,
|
||||
.dispclk_mhz = 2150.0,
|
||||
.dppclk_mhz = 2150.0,
|
||||
.dcfclk_mhz = 1434.0,
|
||||
.fabricclk_mhz = 2250.0,
|
||||
.dispclk_mhz = 1720.0,
|
||||
.dppclk_mhz = 1720.0,
|
||||
.phyclk_mhz = 810.0,
|
||||
.phyclk_d18_mhz = 667.0,
|
||||
.phyclk_d32_mhz = 625.0,
|
||||
.phyclk_d32_mhz = 313.0,
|
||||
.socclk_mhz = 1200.0,
|
||||
.dscclk_mhz = 716.667,
|
||||
.dram_speed_mts = 1600.0,
|
||||
.dscclk_mhz = 573.333,
|
||||
.dram_speed_mts = 16000.0,
|
||||
.dtbclk_mhz = 1564.0,
|
||||
},
|
||||
},
|
||||
|
@ -125,14 +125,14 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_21_soc = {
|
|||
.sr_exit_z8_time_us = 285.0,
|
||||
.sr_enter_plus_exit_z8_time_us = 320,
|
||||
.writeback_latency_us = 12.0,
|
||||
.round_trip_ping_latency_dcfclk_cycles = 263,
|
||||
.round_trip_ping_latency_dcfclk_cycles = 207,
|
||||
.urgent_latency_pixel_data_only_us = 4,
|
||||
.urgent_latency_pixel_mixed_with_vm_data_us = 4,
|
||||
.urgent_latency_vm_data_only_us = 4,
|
||||
.fclk_change_latency_us = 20,
|
||||
.usr_retraining_latency_us = 2,
|
||||
.smn_latency_us = 2,
|
||||
.mall_allocated_for_dcn_mbytes = 64,
|
||||
.fclk_change_latency_us = 7,
|
||||
.usr_retraining_latency_us = 0,
|
||||
.smn_latency_us = 0,
|
||||
.mall_allocated_for_dcn_mbytes = 32,
|
||||
.urgent_out_of_order_return_per_channel_pixel_only_bytes = 4096,
|
||||
.urgent_out_of_order_return_per_channel_pixel_and_vm_bytes = 4096,
|
||||
.urgent_out_of_order_return_per_channel_vm_only_bytes = 4096,
|
||||
|
|
|
@ -148,18 +148,21 @@ struct dccg_funcs {
|
|||
struct dccg *dccg,
|
||||
int inst);
|
||||
|
||||
void (*set_pixel_rate_div)(
|
||||
struct dccg *dccg,
|
||||
uint32_t otg_inst,
|
||||
enum pixel_rate_div k1,
|
||||
enum pixel_rate_div k2);
|
||||
void (*set_pixel_rate_div)(struct dccg *dccg,
|
||||
uint32_t otg_inst,
|
||||
enum pixel_rate_div k1,
|
||||
enum pixel_rate_div k2);
|
||||
|
||||
void (*set_valid_pixel_rate)(
|
||||
struct dccg *dccg,
|
||||
int ref_dtbclk_khz,
|
||||
int otg_inst,
|
||||
int pixclk_khz);
|
||||
void (*set_valid_pixel_rate)(
|
||||
struct dccg *dccg,
|
||||
int ref_dtbclk_khz,
|
||||
int otg_inst,
|
||||
int pixclk_khz);
|
||||
|
||||
void (*dpp_root_clock_control)(
|
||||
struct dccg *dccg,
|
||||
unsigned int dpp_inst,
|
||||
bool clock_on);
|
||||
};
|
||||
|
||||
#endif //__DAL_DCCG_H__
|
||||
|
|
|
@ -115,6 +115,10 @@ struct hwseq_private_funcs {
|
|||
void (*plane_atomic_disable)(struct dc *dc, struct pipe_ctx *pipe_ctx);
|
||||
void (*enable_power_gating_plane)(struct dce_hwseq *hws,
|
||||
bool enable);
|
||||
void (*dpp_root_clock_control)(
|
||||
struct dce_hwseq *hws,
|
||||
unsigned int dpp_inst,
|
||||
bool clock_on);
|
||||
void (*dpp_pg_control)(struct dce_hwseq *hws,
|
||||
unsigned int dpp_inst,
|
||||
bool power_on);
|
||||
|
|
|
@ -130,12 +130,13 @@ void dmub_dcn32_reset(struct dmub_srv *dmub)
|
|||
REG_WRITE(DMCUB_INBOX1_WPTR, 0);
|
||||
REG_WRITE(DMCUB_OUTBOX1_RPTR, 0);
|
||||
REG_WRITE(DMCUB_OUTBOX1_WPTR, 0);
|
||||
REG_WRITE(DMCUB_OUTBOX0_RPTR, 0);
|
||||
REG_WRITE(DMCUB_OUTBOX0_WPTR, 0);
|
||||
REG_WRITE(DMCUB_SCRATCH0, 0);
|
||||
}
|
||||
|
||||
void dmub_dcn32_reset_release(struct dmub_srv *dmub)
|
||||
{
|
||||
REG_WRITE(DMCUB_GPINT_DATAIN1, 0);
|
||||
REG_UPDATE(MMHUBBUB_SOFT_RESET, DMUIF_SOFT_RESET, 0);
|
||||
REG_WRITE(DMCUB_SCRATCH15, dmub->psp_version & 0x001100FF);
|
||||
REG_UPDATE_2(DMCUB_CNTL, DMCUB_ENABLE, 1, DMCUB_TRACEPORT_EN, 1);
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
#define amdgpu_dpm_enable_bapm(adev, e) \
|
||||
((adev)->powerplay.pp_funcs->enable_bapm((adev)->powerplay.pp_handle, (e)))
|
||||
|
||||
#define amdgpu_dpm_is_legacy_dpm(adev) ((adev)->powerplay.pp_handle == (adev))
|
||||
|
||||
int amdgpu_dpm_get_sclk(struct amdgpu_device *adev, bool low)
|
||||
{
|
||||
const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
|
||||
|
@ -1414,15 +1416,24 @@ int amdgpu_dpm_get_smu_prv_buf_details(struct amdgpu_device *adev,
|
|||
|
||||
int amdgpu_dpm_is_overdrive_supported(struct amdgpu_device *adev)
|
||||
{
|
||||
struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
|
||||
struct smu_context *smu = adev->powerplay.pp_handle;
|
||||
if (is_support_sw_smu(adev)) {
|
||||
struct smu_context *smu = adev->powerplay.pp_handle;
|
||||
|
||||
if ((is_support_sw_smu(adev) && smu->od_enabled) ||
|
||||
(is_support_sw_smu(adev) && smu->is_apu) ||
|
||||
(!is_support_sw_smu(adev) && hwmgr->od_enabled))
|
||||
return true;
|
||||
return (smu->od_enabled || smu->is_apu);
|
||||
} else {
|
||||
struct pp_hwmgr *hwmgr;
|
||||
|
||||
return false;
|
||||
/*
|
||||
* dpm on some legacy asics don't carry od_enabled member
|
||||
* as its pp_handle is casted directly from adev.
|
||||
*/
|
||||
if (amdgpu_dpm_is_legacy_dpm(adev))
|
||||
return false;
|
||||
|
||||
hwmgr = (struct pp_hwmgr *)adev->powerplay.pp_handle;
|
||||
|
||||
return hwmgr->od_enabled;
|
||||
}
|
||||
}
|
||||
|
||||
int amdgpu_dpm_set_pp_table(struct amdgpu_device *adev,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue