Commit 7752ccf8 authored by Mario Limonciello's avatar Mario Limonciello Committed by Alex Deucher

drm/amd: Update `update_pcie_parameters` functions to use uint8_t arguments

The matching values for `pcie_gen_cap` and `pcie_width_cap` when
fetched from powerplay tables are 1 byte, so narrow the arguments
to match to ensure min() and max() comparisons without casts.
Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent bc0b79ce
...@@ -1270,7 +1270,7 @@ static int smu_smc_hw_setup(struct smu_context *smu) ...@@ -1270,7 +1270,7 @@ static int smu_smc_hw_setup(struct smu_context *smu)
{ {
struct smu_feature *feature = &smu->smu_feature; struct smu_feature *feature = &smu->smu_feature;
struct amdgpu_device *adev = smu->adev; struct amdgpu_device *adev = smu->adev;
uint32_t pcie_gen = 0, pcie_width = 0; uint8_t pcie_gen = 0, pcie_width = 0;
uint64_t features_supported; uint64_t features_supported;
int ret = 0; int ret = 0;
......
...@@ -846,7 +846,7 @@ struct pptable_funcs { ...@@ -846,7 +846,7 @@ struct pptable_funcs {
* &pcie_gen_cap: Maximum allowed PCIe generation. * &pcie_gen_cap: Maximum allowed PCIe generation.
* &pcie_width_cap: Maximum allowed PCIe width. * &pcie_width_cap: Maximum allowed PCIe width.
*/ */
int (*update_pcie_parameters)(struct smu_context *smu, uint32_t pcie_gen_cap, uint32_t pcie_width_cap); int (*update_pcie_parameters)(struct smu_context *smu, uint8_t pcie_gen_cap, uint8_t pcie_width_cap);
/** /**
* @i2c_init: Initialize i2c. * @i2c_init: Initialize i2c.
......
...@@ -296,8 +296,8 @@ int smu_v13_0_get_pptable_from_firmware(struct smu_context *smu, ...@@ -296,8 +296,8 @@ int smu_v13_0_get_pptable_from_firmware(struct smu_context *smu,
uint32_t pptable_id); uint32_t pptable_id);
int smu_v13_0_update_pcie_parameters(struct smu_context *smu, int smu_v13_0_update_pcie_parameters(struct smu_context *smu,
uint32_t pcie_gen_cap, uint8_t pcie_gen_cap,
uint32_t pcie_width_cap); uint8_t pcie_width_cap);
#endif #endif
#endif #endif
...@@ -2380,8 +2380,8 @@ static int navi10_get_power_limit(struct smu_context *smu, ...@@ -2380,8 +2380,8 @@ static int navi10_get_power_limit(struct smu_context *smu,
} }
static int navi10_update_pcie_parameters(struct smu_context *smu, static int navi10_update_pcie_parameters(struct smu_context *smu,
uint32_t pcie_gen_cap, uint8_t pcie_gen_cap,
uint32_t pcie_width_cap) uint8_t pcie_width_cap)
{ {
struct smu_11_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context; struct smu_11_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context;
PPTable_t *pptable = smu->smu_table.driver_pptable; PPTable_t *pptable = smu->smu_table.driver_pptable;
......
...@@ -2092,14 +2092,14 @@ static int sienna_cichlid_display_disable_memory_clock_switch(struct smu_context ...@@ -2092,14 +2092,14 @@ static int sienna_cichlid_display_disable_memory_clock_switch(struct smu_context
#define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b))
static int sienna_cichlid_update_pcie_parameters(struct smu_context *smu, static int sienna_cichlid_update_pcie_parameters(struct smu_context *smu,
uint32_t pcie_gen_cap, uint8_t pcie_gen_cap,
uint32_t pcie_width_cap) uint8_t pcie_width_cap)
{ {
struct smu_11_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context; struct smu_11_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context;
struct smu_11_0_pcie_table *pcie_table = &dpm_context->dpm_tables.pcie_table; struct smu_11_0_pcie_table *pcie_table = &dpm_context->dpm_tables.pcie_table;
uint8_t *table_member1, *table_member2; uint8_t *table_member1, *table_member2;
uint32_t min_gen_speed, max_gen_speed; uint8_t min_gen_speed, max_gen_speed;
uint32_t min_lane_width, max_lane_width; uint8_t min_lane_width, max_lane_width;
uint32_t smu_pcie_arg; uint32_t smu_pcie_arg;
int ret, i; int ret, i;
......
...@@ -2420,8 +2420,8 @@ int smu_v13_0_mode1_reset(struct smu_context *smu) ...@@ -2420,8 +2420,8 @@ int smu_v13_0_mode1_reset(struct smu_context *smu)
} }
int smu_v13_0_update_pcie_parameters(struct smu_context *smu, int smu_v13_0_update_pcie_parameters(struct smu_context *smu,
uint32_t pcie_gen_cap, uint8_t pcie_gen_cap,
uint32_t pcie_width_cap) uint8_t pcie_width_cap)
{ {
struct smu_13_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context; struct smu_13_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context;
struct smu_13_0_pcie_table *pcie_table = struct smu_13_0_pcie_table *pcie_table =
......
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