Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/dist/drm/radeon fix shadowing for min(...
details: https://anonhg.NetBSD.org/src/rev/ef418c0a052e
branches: trunk
changeset: 333404:ef418c0a052e
user: christos <christos%NetBSD.org@localhost>
date: Sat Nov 01 21:46:10 2014 +0000
description:
fix shadowing for min() and max() from libkern
diffstat:
sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c | 34 ++++++++++----------
sys/external/bsd/drm2/dist/drm/radeon/evergreen_cs.c | 8 ++--
sys/external/bsd/drm2/dist/drm/radeon/rv770_dpm.c | 10 ++--
sys/external/bsd/drm2/dist/drm/radeon/si_dpm.c | 28 ++++++++--------
sys/external/bsd/drm2/dist/drm/radeon/sumo_dpm.c | 6 +-
sys/external/bsd/drm2/dist/drm/radeon/trinity_dpm.c | 6 +-
6 files changed, 46 insertions(+), 46 deletions(-)
diffs (239 lines):
diff -r 7a257b27173d -r ef418c0a052e sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c Sat Nov 01 21:45:31 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c Sat Nov 01 21:46:10 2014 +0000
@@ -361,29 +361,29 @@
struct ci_power_info *pi = ci_get_pi(rdev);
u8 *hi_vid = pi->smc_powertune_table.BapmVddCVidHiSidd;
u8 *lo_vid = pi->smc_powertune_table.BapmVddCVidLoSidd;
- int i, min, max;
-
- min = max = hi_vid[0];
+ int i, vmin, vmax;
+
+ vmin = vmax = hi_vid[0];
for (i = 0; i < 8; i++) {
if (0 != hi_vid[i]) {
- if (min > hi_vid[i])
- min = hi_vid[i];
- if (max < hi_vid[i])
- max = hi_vid[i];
+ if (vmin > hi_vid[i])
+ vmin = hi_vid[i];
+ if (vmax < hi_vid[i])
+ vmax = hi_vid[i];
}
if (0 != lo_vid[i]) {
- if (min > lo_vid[i])
- min = lo_vid[i];
- if (max < lo_vid[i])
- max = lo_vid[i];
+ if (vmin > lo_vid[i])
+ vmin = lo_vid[i];
+ if (vmax < lo_vid[i])
+ vmax = lo_vid[i];
}
}
- if ((min == 0) || (max == 0))
+ if ((vmin == 0) || (vmax == 0))
return -EINVAL;
- pi->smc_powertune_table.GnbLPMLMaxVid = (u8)max;
- pi->smc_powertune_table.GnbLPMLMinVid = (u8)min;
+ pi->smc_powertune_table.GnbLPMLMaxVid = (u8)vmax;
+ pi->smc_powertune_table.GnbLPMLMinVid = (u8)vmin;
return 0;
}
@@ -2028,15 +2028,15 @@
{
u32 i;
u32 tmp;
- u32 min = (min_sclk_in_sr > CISLAND_MINIMUM_ENGINE_CLOCK) ?
+ u32 vmin = (min_sclk_in_sr > CISLAND_MINIMUM_ENGINE_CLOCK) ?
min_sclk_in_sr : CISLAND_MINIMUM_ENGINE_CLOCK;
- if (sclk < min)
+ if (sclk < vmin)
return 0;
for (i = CISLAND_MAX_DEEPSLEEP_DIVIDER_ID; ; i--) {
tmp = sclk / (1 << i);
- if (tmp >= min || i == 0)
+ if (tmp >= vmin || i == 0)
break;
}
diff -r 7a257b27173d -r ef418c0a052e sys/external/bsd/drm2/dist/drm/radeon/evergreen_cs.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/evergreen_cs.c Sat Nov 01 21:45:31 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/evergreen_cs.c Sat Nov 01 21:46:10 2014 +0000
@@ -446,21 +446,21 @@
*/
if (!surf.mode) {
volatile u32 *ib = p->ib.ptr;
- unsigned long tmp, nby, bsize, size, min = 0;
+ unsigned long tmp, nby, bsize, size, vmin = 0;
/* find the height the ddx wants */
if (surf.nby > 8) {
- min = surf.nby - 8;
+ vmin = surf.nby - 8;
}
bsize = radeon_bo_size(track->cb_color_bo[id]);
tmp = track->cb_color_bo_offset[id] << 8;
- for (nby = surf.nby; nby > min; nby--) {
+ for (nby = surf.nby; nby > vmin; nby--) {
size = nby * surf.nbx * surf.bpe * surf.nsamples;
if ((tmp + size * mslice) <= bsize) {
break;
}
}
- if (nby > min) {
+ if (nby > vmin) {
surf.nby = nby;
slice = ((nby * surf.nbx) / 64) - 1;
if (!evergreen_surface_check(p, &surf, "cb")) {
diff -r 7a257b27173d -r ef418c0a052e sys/external/bsd/drm2/dist/drm/radeon/rv770_dpm.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/rv770_dpm.c Sat Nov 01 21:45:31 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/rv770_dpm.c Sat Nov 01 21:46:10 2014 +0000
@@ -1229,16 +1229,16 @@
static int rv770_construct_vddc_table(struct radeon_device *rdev)
{
struct rv7xx_power_info *pi = rv770_get_pi(rdev);
- u16 min, max, step;
+ u16 vmin, vmax, step;
u32 steps = 0;
u8 vddc_index = 0;
u32 i;
- radeon_atom_get_min_voltage(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC, &min);
- radeon_atom_get_max_voltage(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC, &max);
+ radeon_atom_get_min_voltage(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC, &vmin);
+ radeon_atom_get_max_voltage(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC, &vmax);
radeon_atom_get_voltage_step(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC, &step);
- steps = (max - min) / step + 1;
+ steps = (vmax - vmin) / step + 1;
if (steps > MAX_NO_VREG_STEPS)
return -EINVAL;
@@ -1246,7 +1246,7 @@
for (i = 0; i < steps; i++) {
u32 gpio_pins, gpio_mask;
- pi->vddc_table[i].vddc = (u16)(min + i * step);
+ pi->vddc_table[i].vddc = (u16)(vmin + i * step);
radeon_atom_get_voltage_gpio_settings(rdev,
pi->vddc_table[i].vddc,
SET_VOLTAGE_TYPE_ASIC_VDDC,
diff -r 7a257b27173d -r ef418c0a052e sys/external/bsd/drm2/dist/drm/radeon/si_dpm.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/si_dpm.c Sat Nov 01 21:45:31 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/si_dpm.c Sat Nov 01 21:46:10 2014 +0000
@@ -2518,7 +2518,7 @@
}
static int si_get_cac_std_voltage_max_min(struct radeon_device *rdev,
- u16 *max, u16 *min)
+ u16 *vmax, u16 *vmin)
{
struct si_power_info *si_pi = si_get_pi(rdev);
struct radeon_cac_leakage_table *table =
@@ -2530,35 +2530,35 @@
if (table == NULL)
return -EINVAL;
- *max = 0;
- *min = 0xFFFF;
+ *vmax = 0;
+ *vmin = 0xFFFF;
for (i = 0; i < table->count; i++) {
- if (table->entries[i].vddc > *max)
- *max = table->entries[i].vddc;
- if (table->entries[i].vddc < *min)
- *min = table->entries[i].vddc;
+ if (table->entries[i].vddc > *vmax)
+ *vmax = table->entries[i].vddc;
+ if (table->entries[i].vddc < *vmin)
+ *vmin = table->entries[i].vddc;
}
if (si_pi->powertune_data->lkge_lut_v0_percent > 100)
return -EINVAL;
- v0_loadline = (*min) * (100 - si_pi->powertune_data->lkge_lut_v0_percent) / 100;
+ v0_loadline = (*vmin) * (100 - si_pi->powertune_data->lkge_lut_v0_percent) / 100;
if (v0_loadline > 0xFFFFUL)
return -EINVAL;
- *min = (u16)v0_loadline;
-
- if ((*min > *max) || (*max == 0) || (*min == 0))
+ *vmin = (u16)v0_loadline;
+
+ if ((*vmin > *vmax) || (*vmax == 0) || (*vmin == 0))
return -EINVAL;
return 0;
}
-static u16 si_get_cac_std_voltage_step(u16 max, u16 min)
-{
- return ((max - min) + (SMC_SISLANDS_LKGE_LUT_NUM_OF_VOLT_ENTRIES - 1)) /
+static u16 si_get_cac_std_voltage_step(u16 vmax, u16 vmin)
+{
+ return ((vmax - vmin) + (SMC_SISLANDS_LKGE_LUT_NUM_OF_VOLT_ENTRIES - 1)) /
SMC_SISLANDS_LKGE_LUT_NUM_OF_VOLT_ENTRIES;
}
diff -r 7a257b27173d -r ef418c0a052e sys/external/bsd/drm2/dist/drm/radeon/sumo_dpm.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/sumo_dpm.c Sat Nov 01 21:45:31 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/sumo_dpm.c Sat Nov 01 21:46:10 2014 +0000
@@ -1007,10 +1007,10 @@
struct sumo_power_info *pi = sumo_get_pi(rdev);
u32 i;
u32 temp;
- u32 min = (min_sclk_in_sr > SUMO_MINIMUM_ENGINE_CLOCK) ?
+ u32 vmin = (min_sclk_in_sr > SUMO_MINIMUM_ENGINE_CLOCK) ?
min_sclk_in_sr : SUMO_MINIMUM_ENGINE_CLOCK;
- if (sclk < min)
+ if (sclk < vmin)
return 0;
if (!pi->enable_sclk_ds)
@@ -1019,7 +1019,7 @@
for (i = SUMO_MAX_DEEPSLEEP_DIVIDER_ID; ; i--) {
temp = sclk / sumo_get_sleep_divider_from_id(i);
- if (temp >= min || i == 0)
+ if (temp >= vmin || i == 0)
break;
}
return i;
diff -r 7a257b27173d -r ef418c0a052e sys/external/bsd/drm2/dist/drm/radeon/trinity_dpm.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/trinity_dpm.c Sat Nov 01 21:45:31 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/trinity_dpm.c Sat Nov 01 21:46:10 2014 +0000
@@ -1339,10 +1339,10 @@
struct trinity_power_info *pi = trinity_get_pi(rdev);
u32 i;
u32 temp;
- u32 min = (min_sclk_in_sr > TRINITY_MINIMUM_ENGINE_CLOCK) ?
+ u32 vmin = (min_sclk_in_sr > TRINITY_MINIMUM_ENGINE_CLOCK) ?
min_sclk_in_sr : TRINITY_MINIMUM_ENGINE_CLOCK;
- if (sclk < min)
+ if (sclk < vmin)
return 0;
if (!pi->enable_sclk_ds)
@@ -1350,7 +1350,7 @@
for (i = TRINITY_MAX_DEEPSLEEP_DIVIDER_ID; ; i--) {
temp = sclk / sumo_get_sleep_divider_from_id(i);
- if (temp >= min || i == 0)
+ if (temp >= vmin || i == 0)
break;
}
Home |
Main Index |
Thread Index |
Old Index