From: jsg Date: Thu, 21 Dec 2023 03:09:08 +0000 (+0000) Subject: use strnstr paths in amdgpu X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=930af38e4f6e911653775db94e3db2c797f06ccf;p=openbsd use strnstr paths in amdgpu --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_fru_eeprom.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_fru_eeprom.c index 5192ac4ff3e..e325150879d 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_fru_eeprom.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_fru_eeprom.c @@ -53,7 +53,6 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev) */ switch (adev->asic_type) { case CHIP_VEGA20: -#ifdef notyet /* D161 and D163 are the VG20 server SKUs */ if (strnstr(atom_ctx->vbios_version, "D161", sizeof(atom_ctx->vbios_version)) || @@ -61,13 +60,11 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev) sizeof(atom_ctx->vbios_version))) return true; else -#endif return false; case CHIP_ALDEBARAN: /* All Aldebaran SKUs have the FRU */ return true; case CHIP_SIENNA_CICHLID: -#ifdef notyet if (strnstr(atom_ctx->vbios_version, "D603", sizeof(atom_ctx->vbios_version))) { if (strnstr(atom_ctx->vbios_version, "D603GLXE", @@ -78,9 +75,6 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev) } else { return false; } -#else - return false; -#endif default: return false; } diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c index fe48628a0aa..7a301dd9fb6 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c @@ -2327,13 +2327,11 @@ static void amdgpu_ras_get_quirks(struct amdgpu_device *adev) if (!ctx) return; -#ifdef notyet if (strnstr(ctx->vbios_version, "D16406", sizeof(ctx->vbios_version)) || strnstr(ctx->vbios_version, "D36002", sizeof(ctx->vbios_version))) adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__GFX); -#endif } /* diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras_eeprom.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras_eeprom.c index 444799557fb..e967135530e 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras_eeprom.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras_eeprom.c @@ -149,44 +149,29 @@ static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev, /* VEGA20 and ARCTURUS */ if (adev->asic_type == CHIP_VEGA20) control->i2c_address = EEPROM_I2C_MADDR_0; -#ifdef notyet else if (strnstr(atom_ctx->vbios_version, "D342", sizeof(atom_ctx->vbios_version))) control->i2c_address = EEPROM_I2C_MADDR_0; else control->i2c_address = EEPROM_I2C_MADDR_4; -#else - STUB(); - control->i2c_address = EEPROM_I2C_MADDR_4; -#endif return true; case IP_VERSION(11, 0, 7): control->i2c_address = EEPROM_I2C_MADDR_0; return true; case IP_VERSION(13, 0, 2): -#ifdef notyet if (strnstr(atom_ctx->vbios_version, "D673", sizeof(atom_ctx->vbios_version))) control->i2c_address = EEPROM_I2C_MADDR_4; else control->i2c_address = EEPROM_I2C_MADDR_0; -#else - STUB(); - control->i2c_address = EEPROM_I2C_MADDR_0; -#endif return true; case IP_VERSION(13, 0, 0): -#ifdef notyet if (strnstr(atom_ctx->vbios_pn, "D707", sizeof(atom_ctx->vbios_pn))) control->i2c_address = EEPROM_I2C_MADDR_0; else control->i2c_address = EEPROM_I2C_MADDR_4; -#else - STUB(); - control->i2c_address = EEPROM_I2C_MADDR_4; -#endif return true; case IP_VERSION(13, 0, 6): case IP_VERSION(13, 0, 10):