Commit a1f10541 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'amd-drm-fixes-5.12-2021-03-03' of...

Merge tag 'amd-drm-fixes-5.12-2021-03-03' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes

amd-drm-fixes-5.12-2021-03-03:

amdgpu:
- S0ix fix
- Handle new NV12 SKU
- Misc power fixes
- Display uninitialized value fix
- PCIE debugfs register access fix
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210304043255.3792-1-alexander.deucher@amd.com
parents a727df40 1aa46901
...@@ -903,10 +903,11 @@ void amdgpu_acpi_fini(struct amdgpu_device *adev) ...@@ -903,10 +903,11 @@ void amdgpu_acpi_fini(struct amdgpu_device *adev)
*/ */
bool amdgpu_acpi_is_s0ix_supported(struct amdgpu_device *adev) bool amdgpu_acpi_is_s0ix_supported(struct amdgpu_device *adev)
{ {
#if defined(CONFIG_AMD_PMC)
if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) { if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
if (adev->flags & AMD_IS_APU) if (adev->flags & AMD_IS_APU)
return true; return true;
} }
#endif
return false; return false;
} }
...@@ -357,7 +357,7 @@ static ssize_t amdgpu_debugfs_regs_pcie_read(struct file *f, char __user *buf, ...@@ -357,7 +357,7 @@ static ssize_t amdgpu_debugfs_regs_pcie_read(struct file *f, char __user *buf,
while (size) { while (size) {
uint32_t value; uint32_t value;
value = RREG32_PCIE(*pos >> 2); value = RREG32_PCIE(*pos);
r = put_user(value, (uint32_t *)buf); r = put_user(value, (uint32_t *)buf);
if (r) { if (r) {
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
...@@ -424,7 +424,7 @@ static ssize_t amdgpu_debugfs_regs_pcie_write(struct file *f, const char __user ...@@ -424,7 +424,7 @@ static ssize_t amdgpu_debugfs_regs_pcie_write(struct file *f, const char __user
return r; return r;
} }
WREG32_PCIE(*pos >> 2, value); WREG32_PCIE(*pos, value);
result += 4; result += 4;
buf += 4; buf += 4;
......
...@@ -173,8 +173,6 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags) ...@@ -173,8 +173,6 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags)
switch (adev->asic_type) { switch (adev->asic_type) {
case CHIP_VEGA20: case CHIP_VEGA20:
case CHIP_ARCTURUS: case CHIP_ARCTURUS:
case CHIP_SIENNA_CICHLID:
case CHIP_NAVY_FLOUNDER:
/* enable runpm if runpm=1 */ /* enable runpm if runpm=1 */
if (amdgpu_runtime_pm > 0) if (amdgpu_runtime_pm > 0)
adev->runpm = true; adev->runpm = true;
......
...@@ -558,7 +558,8 @@ static bool nv_is_headless_sku(struct pci_dev *pdev) ...@@ -558,7 +558,8 @@ static bool nv_is_headless_sku(struct pci_dev *pdev)
{ {
if ((pdev->device == 0x731E && if ((pdev->device == 0x731E &&
(pdev->revision == 0xC6 || pdev->revision == 0xC7)) || (pdev->revision == 0xC6 || pdev->revision == 0xC7)) ||
(pdev->device == 0x7340 && pdev->revision == 0xC9)) (pdev->device == 0x7340 && pdev->revision == 0xC9) ||
(pdev->device == 0x7360 && pdev->revision == 0xC7))
return true; return true;
return false; return false;
} }
...@@ -634,7 +635,8 @@ int nv_set_ip_blocks(struct amdgpu_device *adev) ...@@ -634,7 +635,8 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT && if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
!amdgpu_sriov_vf(adev)) !amdgpu_sriov_vf(adev))
amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block); amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
amdgpu_device_ip_block_add(adev, &vcn_v2_0_ip_block); if (!nv_is_headless_sku(adev->pdev))
amdgpu_device_ip_block_add(adev, &vcn_v2_0_ip_block);
if (!amdgpu_sriov_vf(adev)) if (!amdgpu_sriov_vf(adev))
amdgpu_device_ip_block_add(adev, &jpeg_v2_0_ip_block); amdgpu_device_ip_block_add(adev, &jpeg_v2_0_ip_block);
break; break;
......
...@@ -530,7 +530,7 @@ bool dm_helpers_dp_write_dsc_enable( ...@@ -530,7 +530,7 @@ bool dm_helpers_dp_write_dsc_enable(
{ {
uint8_t enable_dsc = enable ? 1 : 0; uint8_t enable_dsc = enable ? 1 : 0;
struct amdgpu_dm_connector *aconnector; struct amdgpu_dm_connector *aconnector;
uint8_t ret; uint8_t ret = 0;
if (!stream) if (!stream)
return false; return false;
......
...@@ -1322,7 +1322,7 @@ static int arcturus_set_power_profile_mode(struct smu_context *smu, ...@@ -1322,7 +1322,7 @@ static int arcturus_set_power_profile_mode(struct smu_context *smu,
CMN2ASIC_MAPPING_WORKLOAD, CMN2ASIC_MAPPING_WORKLOAD,
profile_mode); profile_mode);
if (workload_type < 0) { if (workload_type < 0) {
dev_err(smu->adev->dev, "Unsupported power profile mode %d on arcturus\n", profile_mode); dev_dbg(smu->adev->dev, "Unsupported power profile mode %d on arcturus\n", profile_mode);
return -EINVAL; return -EINVAL;
} }
......
...@@ -78,6 +78,9 @@ MODULE_FIRMWARE("amdgpu/dimgrey_cavefish_smc.bin"); ...@@ -78,6 +78,9 @@ MODULE_FIRMWARE("amdgpu/dimgrey_cavefish_smc.bin");
#define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE_MASK 0xC000 #define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE_MASK 0xC000
#define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE__SHIFT 0xE #define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE__SHIFT 0xE
#define mmTHM_BACO_CNTL_ARCT 0xA7
#define mmTHM_BACO_CNTL_ARCT_BASE_IDX 0
static int link_width[] = {0, 1, 2, 4, 8, 12, 16}; static int link_width[] = {0, 1, 2, 4, 8, 12, 16};
static int link_speed[] = {25, 50, 80, 160}; static int link_speed[] = {25, 50, 80, 160};
...@@ -1532,9 +1535,15 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state) ...@@ -1532,9 +1535,15 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state)
break; break;
default: default:
if (!ras || !ras->supported) { if (!ras || !ras->supported) {
data = RREG32_SOC15(THM, 0, mmTHM_BACO_CNTL); if (adev->asic_type == CHIP_ARCTURUS) {
data |= 0x80000000; data = RREG32_SOC15(THM, 0, mmTHM_BACO_CNTL_ARCT);
WREG32_SOC15(THM, 0, mmTHM_BACO_CNTL, data); data |= 0x80000000;
WREG32_SOC15(THM, 0, mmTHM_BACO_CNTL_ARCT, data);
} else {
data = RREG32_SOC15(THM, 0, mmTHM_BACO_CNTL);
data |= 0x80000000;
WREG32_SOC15(THM, 0, mmTHM_BACO_CNTL, data);
}
ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_EnterBaco, 0, NULL); ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_EnterBaco, 0, NULL);
} else { } else {
......
...@@ -810,7 +810,7 @@ static int vangogh_set_power_profile_mode(struct smu_context *smu, long *input, ...@@ -810,7 +810,7 @@ static int vangogh_set_power_profile_mode(struct smu_context *smu, long *input,
CMN2ASIC_MAPPING_WORKLOAD, CMN2ASIC_MAPPING_WORKLOAD,
profile_mode); profile_mode);
if (workload_type < 0) { if (workload_type < 0) {
dev_err_once(smu->adev->dev, "Unsupported power profile mode %d on VANGOGH\n", dev_dbg(smu->adev->dev, "Unsupported power profile mode %d on VANGOGH\n",
profile_mode); profile_mode);
return -EINVAL; return -EINVAL;
} }
...@@ -1685,9 +1685,9 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en) ...@@ -1685,9 +1685,9 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en)
uint32_t feature_mask[2]; uint32_t feature_mask[2];
int ret = 0; int ret = 0;
if (adev->pm.fw_version >= 0x43f1700) if (adev->pm.fw_version >= 0x43f1700 && !en)
ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_RlcPowerNotify, ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_RlcPowerNotify,
en ? RLC_STATUS_NORMAL : RLC_STATUS_OFF, NULL); RLC_STATUS_OFF, NULL);
bitmap_zero(feature->enabled, feature->feature_num); bitmap_zero(feature->enabled, feature->feature_num);
bitmap_zero(feature->supported, feature->feature_num); bitmap_zero(feature->supported, feature->feature_num);
......
...@@ -844,7 +844,7 @@ static int renoir_set_power_profile_mode(struct smu_context *smu, long *input, u ...@@ -844,7 +844,7 @@ static int renoir_set_power_profile_mode(struct smu_context *smu, long *input, u
* TODO: If some case need switch to powersave/default power mode * TODO: If some case need switch to powersave/default power mode
* then can consider enter WORKLOAD_COMPUTE/WORKLOAD_CUSTOM for power saving. * then can consider enter WORKLOAD_COMPUTE/WORKLOAD_CUSTOM for power saving.
*/ */
dev_err_once(smu->adev->dev, "Unsupported power profile mode %d on RENOIR\n", profile_mode); dev_dbg(smu->adev->dev, "Unsupported power profile mode %d on RENOIR\n", profile_mode);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment