From: jsg Date: Tue, 14 Feb 2023 11:34:32 +0000 (+0000) Subject: use pragma pack around PPTable_t definitions X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=715494ad5ddd403f95178514b85cd1a5948d783c;p=openbsd use pragma pack around PPTable_t definitions Avoids warnings about alignment changing when embedded inside of a packed struct (such as _ATOM_VEGA20_POWERPLAYTABLE) seen with clang 15 on arm64. reported and compile tested by tb@ sent upstream to amd-gfx list --- diff --git a/sys/dev/pci/drm/amd/pm/powerplay/inc/smu11_driver_if.h b/sys/dev/pci/drm/amd/pm/powerplay/inc/smu11_driver_if.h index fdc6b7a57bc..c2efc70ef28 100644 --- a/sys/dev/pci/drm/amd/pm/powerplay/inc/smu11_driver_if.h +++ b/sys/dev/pci/drm/amd/pm/powerplay/inc/smu11_driver_if.h @@ -358,6 +358,7 @@ typedef struct { QuadraticInt_t SsCurve; } DpmDescriptor_t; +#pragma pack(push, 1) typedef struct { uint32_t Version; @@ -609,6 +610,7 @@ typedef struct { uint32_t MmHubPadding[8]; } PPTable_t; +#pragma pack(pop) typedef struct { diff --git a/sys/dev/pci/drm/amd/pm/powerplay/inc/smu9_driver_if.h b/sys/dev/pci/drm/amd/pm/powerplay/inc/smu9_driver_if.h index 2818c98ff5c..faae4b918d9 100644 --- a/sys/dev/pci/drm/amd/pm/powerplay/inc/smu9_driver_if.h +++ b/sys/dev/pci/drm/amd/pm/powerplay/inc/smu9_driver_if.h @@ -122,6 +122,7 @@ typedef struct { uint16_t Vid; /* min voltage in SVI2 VID */ } DisplayClockTable_t; +#pragma pack(push, 1) typedef struct { /* PowerTune */ uint16_t SocketPowerLimit; /* Watts */ @@ -323,6 +324,7 @@ typedef struct { uint32_t MmHubPadding[3]; /* SMU internal use */ } PPTable_t; +#pragma pack(pop) typedef struct { uint16_t MinClock; // This is either DCEFCLK or SOCCLK (in MHz) diff --git a/sys/dev/pci/drm/amd/pm/powerplay/inc/vega12/smu9_driver_if.h b/sys/dev/pci/drm/amd/pm/powerplay/inc/vega12/smu9_driver_if.h index b6ffd08784e..6456bea5d2d 100644 --- a/sys/dev/pci/drm/amd/pm/powerplay/inc/vega12/smu9_driver_if.h +++ b/sys/dev/pci/drm/amd/pm/powerplay/inc/vega12/smu9_driver_if.h @@ -245,6 +245,7 @@ typedef struct { QuadraticInt_t SsCurve; } DpmDescriptor_t; +#pragma pack(push, 1) typedef struct { uint32_t Version; @@ -508,6 +509,7 @@ typedef struct { uint32_t MmHubPadding[7]; } PPTable_t; +#pragma pack(pop) typedef struct { diff --git a/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_arcturus.h b/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_arcturus.h index 43d43d6addc..d518dee18e1 100644 --- a/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_arcturus.h +++ b/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_arcturus.h @@ -464,6 +464,7 @@ typedef struct { uint16_t Padding16; } DpmDescriptor_t; +#pragma pack(push, 1) typedef struct { uint32_t Version; @@ -733,6 +734,7 @@ typedef struct { uint32_t MmHubPadding[8]; // SMU internal use } PPTable_t; +#pragma pack(pop) typedef struct { // Time constant parameters for clock averages in ms diff --git a/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_navi10.h b/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_navi10.h index 04752ade101..c5c1943fb6a 100644 --- a/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_navi10.h +++ b/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_navi10.h @@ -515,6 +515,7 @@ typedef struct { uint32_t BoardLevelEnergyAccumulator; } OutOfBandMonitor_t; +#pragma pack(push, 1) typedef struct { uint32_t Version; @@ -814,6 +815,7 @@ typedef struct { uint32_t MmHubPadding[8]; // SMU internal use } PPTable_t; +#pragma pack(pop) typedef struct { // Time constant parameters for clock averages in ms diff --git a/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_sienna_cichlid.h b/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_sienna_cichlid.h index 351a4af429b..aa6d29de400 100644 --- a/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_sienna_cichlid.h +++ b/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_sienna_cichlid.h @@ -599,6 +599,7 @@ typedef struct { uint16_t Fmax; } UclkDpmChangeRange_t; +#pragma pack(push, 1) typedef struct { // MAJOR SECTION: SKU PARAMETERS @@ -957,6 +958,7 @@ typedef struct { uint32_t MmHubPadding[8]; // SMU internal use } PPTable_t; +#pragma pack(pop) typedef struct { // MAJOR SECTION: SKU PARAMETERS diff --git a/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_aldebaran.h b/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_aldebaran.h index 7a6075daa7b..90200f31ff5 100644 --- a/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_aldebaran.h +++ b/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_aldebaran.h @@ -267,6 +267,7 @@ typedef struct { QuadraticInt_t SsCurve; // Slow-slow curve (GHz->V) } DpmDescriptor_t; +#pragma pack(push, 1) typedef struct { uint32_t Version; @@ -448,6 +449,7 @@ typedef struct { uint32_t reserved[14]; } PPTable_t; +#pragma pack(pop) typedef struct { // Time constant parameters for clock averages in ms diff --git a/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h b/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h index d6b964cf73b..6b09d66f61b 100644 --- a/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h +++ b/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h @@ -1346,10 +1346,12 @@ typedef struct { uint32_t MmHubPadding[8]; } BoardTable_t; +#pragma pack(push, 1) typedef struct { SkuTable_t SkuTable; BoardTable_t BoardTable; } PPTable_t; +#pragma pack(pop) typedef struct { // Time constant parameters for clock averages in ms diff --git a/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h b/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h index d6b13933a98..476a5b325b6 100644 --- a/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h +++ b/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h @@ -1379,10 +1379,12 @@ typedef struct { uint32_t MmHubPadding[8]; } BoardTable_t; +#pragma pack(push, 1) typedef struct { SkuTable_t SkuTable; BoardTable_t BoardTable; } PPTable_t; +#pragma pack(pop) typedef struct { // Time constant parameters for clock averages in ms