drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c
Extension
.c
Size
94849 bytes
Lines
2918
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (feature_enabled) {
			smu_v14_0_2_get_od_setting_limits(smu, PP_OD_FEATURE_FAN_CURVE_TEMP,
							  &min_value, &max_value);
			if (!min_value && !max_value) {
				feature_enabled = false;
				goto out;
			}

			smu_v14_0_2_get_od_setting_limits(smu, PP_OD_FEATURE_FAN_CURVE_PWM,
							  &min_value, &max_value);
			if (!min_value && !max_value) {
				feature_enabled = false;
				goto out;
			}
		}
		break;
	default:
		feature_enabled = !!(overdrive_upperlimits->FeatureCtrlMask & (1U << od_feature_bit));
		break;
	}

out:
	return feature_enabled;
}

static void smu_v14_0_2_get_od_setting_limits(struct smu_context *smu,
					      int od_feature_bit,
					      int32_t *min,
					      int32_t *max)
{
	PPTable_t *pptable = smu->smu_table.driver_pptable;
	const OverDriveLimits_t * const overdrive_upperlimits =
				&pptable->SkuTable.OverDriveLimitsBasicMax;
	const OverDriveLimits_t * const overdrive_lowerlimits =
				&pptable->SkuTable.OverDriveLimitsBasicMin;
	int32_t od_min_setting, od_max_setting;

	switch (od_feature_bit) {
	case PP_OD_FEATURE_GFXCLK_FMIN:
	case PP_OD_FEATURE_GFXCLK_FMAX:
		od_min_setting = overdrive_lowerlimits->GfxclkFoffset;
		od_max_setting = overdrive_upperlimits->GfxclkFoffset;
		break;
	case PP_OD_FEATURE_UCLK_FMIN:
		od_min_setting = overdrive_lowerlimits->UclkFmin;
		od_max_setting = overdrive_upperlimits->UclkFmin;
		break;
	case PP_OD_FEATURE_UCLK_FMAX:
		od_min_setting = overdrive_lowerlimits->UclkFmax;
		od_max_setting = overdrive_upperlimits->UclkFmax;
		break;
	case PP_OD_FEATURE_GFX_VF_CURVE:
		od_min_setting = overdrive_lowerlimits->VoltageOffsetPerZoneBoundary[0];
		od_max_setting = overdrive_upperlimits->VoltageOffsetPerZoneBoundary[0];
		break;
	case PP_OD_FEATURE_FAN_CURVE_TEMP:
		od_min_setting = overdrive_lowerlimits->FanLinearTempPoints[0];
		od_max_setting = overdrive_upperlimits->FanLinearTempPoints[0];
		break;
	case PP_OD_FEATURE_FAN_CURVE_PWM:
		od_min_setting = overdrive_lowerlimits->FanLinearPwmPoints[0];
		od_max_setting = overdrive_upperlimits->FanLinearPwmPoints[0];
		break;
	case PP_OD_FEATURE_FAN_ACOUSTIC_LIMIT:
		od_min_setting = overdrive_lowerlimits->AcousticLimitRpmThreshold;
		od_max_setting = overdrive_upperlimits->AcousticLimitRpmThreshold;
		break;
	case PP_OD_FEATURE_FAN_ACOUSTIC_TARGET:
		od_min_setting = overdrive_lowerlimits->AcousticTargetRpmThreshold;
		od_max_setting = overdrive_upperlimits->AcousticTargetRpmThreshold;
		break;
	case PP_OD_FEATURE_FAN_TARGET_TEMPERATURE:
		od_min_setting = overdrive_lowerlimits->FanTargetTemperature;
		od_max_setting = overdrive_upperlimits->FanTargetTemperature;
		break;
	case PP_OD_FEATURE_FAN_MINIMUM_PWM:
		od_min_setting = overdrive_lowerlimits->FanMinimumPwm;
		od_max_setting = overdrive_upperlimits->FanMinimumPwm;
		break;
	case PP_OD_FEATURE_FAN_ZERO_RPM_ENABLE:
		od_min_setting = overdrive_lowerlimits->FanZeroRpmEnable;
		od_max_setting = overdrive_upperlimits->FanZeroRpmEnable;
		break;
	default:
		od_min_setting = od_max_setting = INT_MAX;
		break;
	}

	if (min)
		*min = od_min_setting;

Annotation

Implementation Notes