Commit dded93ff authored by Dave Airlie's avatar Dave Airlie

Merge tag 'amd-drm-fixes-5.9-2020-10-08' of...

Merge tag 'amd-drm-fixes-5.9-2020-10-08' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

amd-drm-fixes-5.9-2020-10-08:

amdgpu:
- Fix a crash on renoir if you override the IP discovery parameter
- Fix the build on ARC platforms
- Display fix for Sienna Cichlid
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201009024917.3984-1-alexander.deucher@amd.com
parents d10285a2 33c8256b
...@@ -694,12 +694,12 @@ static void soc15_reg_base_init(struct amdgpu_device *adev) ...@@ -694,12 +694,12 @@ static void soc15_reg_base_init(struct amdgpu_device *adev)
* it doesn't support SRIOV. */ * it doesn't support SRIOV. */
if (amdgpu_discovery) { if (amdgpu_discovery) {
r = amdgpu_discovery_reg_base_init(adev); r = amdgpu_discovery_reg_base_init(adev);
if (r) { if (r == 0)
DRM_WARN("failed to init reg base from ip discovery table, " break;
"fallback to legacy init method\n"); DRM_WARN("failed to init reg base from ip discovery table, "
vega10_reg_base_init(adev); "fallback to legacy init method\n");
}
} }
vega10_reg_base_init(adev);
break; break;
case CHIP_VEGA20: case CHIP_VEGA20:
vega20_reg_base_init(adev); vega20_reg_base_init(adev);
......
...@@ -1409,7 +1409,7 @@ static int dm_late_init(void *handle) ...@@ -1409,7 +1409,7 @@ static int dm_late_init(void *handle)
if (dmcu) if (dmcu)
ret = dmcu_load_iram(dmcu, params); ret = dmcu_load_iram(dmcu, params);
else if (adev->dm.dc->ctx->dmub_srv) else if (adev->dm.dc->ctx->dmub_srv)
ret = dmub_init_abm_config(adev->dm.dc->res_pool->abm, params); ret = dmub_init_abm_config(adev->dm.dc->res_pool, params);
if (!ret) if (!ret)
return -EINVAL; return -EINVAL;
......
...@@ -657,7 +657,7 @@ void fill_iram_v_2_3(struct iram_table_v_2_2 *ram_table, struct dmcu_iram_parame ...@@ -657,7 +657,7 @@ void fill_iram_v_2_3(struct iram_table_v_2_2 *ram_table, struct dmcu_iram_parame
params, ram_table, big_endian); params, ram_table, big_endian);
} }
bool dmub_init_abm_config(struct abm *abm, bool dmub_init_abm_config(struct resource_pool *res_pool,
struct dmcu_iram_parameters params) struct dmcu_iram_parameters params)
{ {
struct iram_table_v_2_2 ram_table; struct iram_table_v_2_2 ram_table;
...@@ -665,8 +665,13 @@ bool dmub_init_abm_config(struct abm *abm, ...@@ -665,8 +665,13 @@ bool dmub_init_abm_config(struct abm *abm,
bool result = false; bool result = false;
uint32_t i, j = 0; uint32_t i, j = 0;
if (abm == NULL) #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
if (res_pool->abm == NULL && res_pool->multiple_abms[0] == NULL)
return false; return false;
#else
if (res_pool->abm == NULL)
return false;
#endif
memset(&ram_table, 0, sizeof(ram_table)); memset(&ram_table, 0, sizeof(ram_table));
memset(&config, 0, sizeof(config)); memset(&config, 0, sizeof(config));
...@@ -707,8 +712,14 @@ bool dmub_init_abm_config(struct abm *abm, ...@@ -707,8 +712,14 @@ bool dmub_init_abm_config(struct abm *abm,
config.min_abm_backlight = ram_table.min_abm_backlight; config.min_abm_backlight = ram_table.min_abm_backlight;
result = abm->funcs->init_abm_config( #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
abm, (char *)(&config), sizeof(struct abm_config_table)); if (res_pool->multiple_abms[0]) {
result = res_pool->multiple_abms[0]->funcs->init_abm_config(
res_pool->multiple_abms[0], (char *)(&config), sizeof(struct abm_config_table));
} else
#endif
result = res_pool->abm->funcs->init_abm_config(
res_pool->abm, (char *)(&config), sizeof(struct abm_config_table));
return result; return result;
} }
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include "dc/inc/hw/dmcu.h" #include "dc/inc/hw/dmcu.h"
#include "dc/inc/hw/abm.h" #include "dc/inc/hw/abm.h"
struct resource_pool;
enum abm_defines { enum abm_defines {
abm_defines_max_level = 4, abm_defines_max_level = 4,
...@@ -45,7 +47,7 @@ struct dmcu_iram_parameters { ...@@ -45,7 +47,7 @@ struct dmcu_iram_parameters {
bool dmcu_load_iram(struct dmcu *dmcu, bool dmcu_load_iram(struct dmcu *dmcu,
struct dmcu_iram_parameters params); struct dmcu_iram_parameters params);
bool dmub_init_abm_config(struct abm *abm, bool dmub_init_abm_config(struct resource_pool *res_pool,
struct dmcu_iram_parameters params); struct dmcu_iram_parameters params);
#endif /* MODULES_POWER_POWER_HELPERS_H_ */ #endif /* MODULES_POWER_POWER_HELPERS_H_ */
...@@ -2265,8 +2265,6 @@ static void navi10_fill_i2c_req(SwI2cRequest_t *req, bool write, ...@@ -2265,8 +2265,6 @@ static void navi10_fill_i2c_req(SwI2cRequest_t *req, bool write,
{ {
int i; int i;
BUG_ON(numbytes > MAX_SW_I2C_COMMANDS);
req->I2CcontrollerPort = 0; req->I2CcontrollerPort = 0;
req->I2CSpeed = 2; req->I2CSpeed = 2;
req->SlaveAddress = address; req->SlaveAddress = address;
...@@ -2304,6 +2302,12 @@ static int navi10_i2c_read_data(struct i2c_adapter *control, ...@@ -2304,6 +2302,12 @@ static int navi10_i2c_read_data(struct i2c_adapter *control,
struct smu_table_context *smu_table = &adev->smu.smu_table; struct smu_table_context *smu_table = &adev->smu.smu_table;
struct smu_table *table = &smu_table->driver_table; struct smu_table *table = &smu_table->driver_table;
if (numbytes > MAX_SW_I2C_COMMANDS) {
dev_err(adev->dev, "numbytes requested %d is over max allowed %d\n",
numbytes, MAX_SW_I2C_COMMANDS);
return -EINVAL;
}
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
navi10_fill_i2c_req(&req, false, address, numbytes, data); navi10_fill_i2c_req(&req, false, address, numbytes, data);
...@@ -2340,6 +2344,12 @@ static int navi10_i2c_write_data(struct i2c_adapter *control, ...@@ -2340,6 +2344,12 @@ static int navi10_i2c_write_data(struct i2c_adapter *control,
SwI2cRequest_t req; SwI2cRequest_t req;
struct amdgpu_device *adev = to_amdgpu_device(control); struct amdgpu_device *adev = to_amdgpu_device(control);
if (numbytes > MAX_SW_I2C_COMMANDS) {
dev_err(adev->dev, "numbytes requested %d is over max allowed %d\n",
numbytes, MAX_SW_I2C_COMMANDS);
return -EINVAL;
}
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
navi10_fill_i2c_req(&req, true, address, numbytes, data); navi10_fill_i2c_req(&req, true, address, numbytes, data);
......
...@@ -2445,8 +2445,6 @@ static void sienna_cichlid_fill_i2c_req(SwI2cRequest_t *req, bool write, ...@@ -2445,8 +2445,6 @@ static void sienna_cichlid_fill_i2c_req(SwI2cRequest_t *req, bool write,
{ {
int i; int i;
BUG_ON(numbytes > MAX_SW_I2C_COMMANDS);
req->I2CcontrollerPort = 0; req->I2CcontrollerPort = 0;
req->I2CSpeed = 2; req->I2CSpeed = 2;
req->SlaveAddress = address; req->SlaveAddress = address;
...@@ -2484,6 +2482,12 @@ static int sienna_cichlid_i2c_read_data(struct i2c_adapter *control, ...@@ -2484,6 +2482,12 @@ static int sienna_cichlid_i2c_read_data(struct i2c_adapter *control,
struct smu_table_context *smu_table = &adev->smu.smu_table; struct smu_table_context *smu_table = &adev->smu.smu_table;
struct smu_table *table = &smu_table->driver_table; struct smu_table *table = &smu_table->driver_table;
if (numbytes > MAX_SW_I2C_COMMANDS) {
dev_err(adev->dev, "numbytes requested %d is over max allowed %d\n",
numbytes, MAX_SW_I2C_COMMANDS);
return -EINVAL;
}
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
sienna_cichlid_fill_i2c_req(&req, false, address, numbytes, data); sienna_cichlid_fill_i2c_req(&req, false, address, numbytes, data);
...@@ -2520,6 +2524,12 @@ static int sienna_cichlid_i2c_write_data(struct i2c_adapter *control, ...@@ -2520,6 +2524,12 @@ static int sienna_cichlid_i2c_write_data(struct i2c_adapter *control,
SwI2cRequest_t req; SwI2cRequest_t req;
struct amdgpu_device *adev = to_amdgpu_device(control); struct amdgpu_device *adev = to_amdgpu_device(control);
if (numbytes > MAX_SW_I2C_COMMANDS) {
dev_err(adev->dev, "numbytes requested %d is over max allowed %d\n",
numbytes, MAX_SW_I2C_COMMANDS);
return -EINVAL;
}
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
sienna_cichlid_fill_i2c_req(&req, true, address, numbytes, data); sienna_cichlid_fill_i2c_req(&req, true, address, numbytes, data);
......
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