Guest User

RadeonPriority.asl

a guest
Oct 30th, 2022
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.68 KB | None | 0 0
  1. DefinitionBlock ("", "SSDT", 2, "ACDT", "AMDGPU", 0x00001000)
  2. {
  3. External (_SB_.PCI0, DeviceObj)
  4. External (_SB_.PCI0.GFX0, DeviceObj)
  5. External (_SB_.PCI0.PEG0, DeviceObj)
  6. External (_SB_.PCI0.PEG0.PEGP, DeviceObj)
  7.  
  8. Scope (\_SB.PCI0)
  9. {
  10. // Follow your motherboard structure regarding the scope hierarchy. This example contains:
  11. // PEG0 -> PEGP (GPU #1) and HDAU (HDMI audio for GPU #1)
  12. // PEG1 -> PEGP (GPU #2) not installed
  13. // PEG2 -> PEGP (GPU #3) not installed
  14. // PEG3 -> PEGP (GPU #4) not installed
  15. // IMEI (Intel IMEI device required for proper hardware video decoding functioning)
  16. // GFX0 (disabled original IGPU name)
  17. // IGPU (Intel GPU with a connector-less frame used for hardware video decoding)
  18. //
  19. // Depending on your method you may rename PEGP to GFX0.
  20. Scope (PEG0)
  21. {
  22. Scope (PEGP)
  23. {
  24. Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
  25. {
  26. Store (Package ()
  27. {
  28. // Write the preferred GPU index here (1-4)
  29. "AAPL,slot-name",
  30. Buffer ()
  31. {
  32. "Slot-1"
  33. },
  34.  
  35. // Write the main main monitor index (currently 0) here, the value does not matter
  36. "@0,AAPL,boot-display",
  37. Buffer (Zero) {},
  38.  
  39. /*
  40.  
  41. // Only use this if your GPU device identifier is not natively supported in macOS kexts
  42. "device-id",
  43. Buffer (0x04)
  44. {
  45. 0x12, 0x34, 0x00, 0x00
  46. },
  47.  
  48. // Only use this if automatic detection fails or you are faking your GPU device-id
  49. "model",
  50. Buffer ()
  51. {
  52. "AMD Radeon HD 6450"
  53. },
  54.  
  55. // Only use this if you are not satisfied with automatic HDMI injection
  56. // Make sure not to write the same onboard index for each installed GPU
  57. "hda-gfx",
  58. Buffer ()
  59. {
  60. "onboard-1"
  61. },
  62.  
  63. // Only use this if you need special connectors that are incompatible with the automatic connector detection
  64. "connectors",
  65. Buffer ()
  66. {
  67. 0x00, 0x04, 0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x12, 0x04, 0x04, 0x01,
  68. 0x00, 0x08, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x22, 0x05, 0x01, 0x03,
  69. 0x04, 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x10, 0x00, 0x05, 0x06,
  70. 0x04, 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x11, 0x02, 0x06, 0x05
  71. },
  72.  
  73. // You may only specify this with connectors property when the amount of connectors differs from autodetected
  74. "connector-count",
  75. Buffer ()
  76. {
  77. 0x04, 0x00, 0x00, 0x00
  78. },
  79.  
  80.  
  81. */
  82.  
  83. // Only use this with automatic connector detection when you need manual priority.
  84. // Each value is a sense id to get a higher priority.
  85. // Automatic ordering is done by type: LVDS, DVI, HDMI, DP, VGA.
  86. // You may leave this empty to order all the connectors by type.
  87. // Assume autodetected connectors: 0x03 DP, 0x02 DVI_D, 0x06 HDMI, 0x05 DVI_D, 0x04 VGA
  88. // With the value pri will become: 0x0005 , 0x0001 , 0x0004 , 0x0003 , 0x0002
  89. "connector-priority",
  90. Buffer ()
  91. {
  92. 0x03, 0x06
  93. }
  94.  
  95.  
  96. /*
  97.  
  98. // The properties below allow you to configure aty_config, aty_properties, cail_properties
  99.  
  100. // This will change CAIL_DisableDrmdmaPowerGating in cail_properties to false
  101. // Note: buffer of 1 byte long with 0x01 / 0x00 values is transormed into boolean
  102. "CAIL,CAIL_DisableDrmdmaPowerGating",
  103. Buffer ()
  104. {
  105. 0x01
  106. },
  107.  
  108. // This will change CFG_FB_LIMIT in aty_config to 6
  109. // Starting with 10.13.2 AAPL hardcodes framebuffer limit in certain kexts.
  110. // In particular, for AMD9500Controller the value is 6.
  111. // This is not correct for some GPUs (e.g. Radeon Pro, which has 3), so you are to specify
  112. // the correct value right here.
  113. "CFG,CFG_FB_LIMIT",
  114. 0x06,
  115.  
  116. // This will change HELLO_WORLD in aty_properties to <01 02 03 04>
  117. "PP,HELLO_WORLD",
  118. Buffer ()
  119. {
  120. 0x01, 0x02, 0x03, 0x04
  121. }
  122.  
  123. // The properties below are usually relevant to mobile ATI/AMD GPUs
  124.  
  125. // Most mobile GPUs fail to provide their VBIOS
  126. // Dump it and inject it here.
  127. // You must cut or pad it by 64 KB (GOP is not relevant).
  128. "ATY,bin_image",
  129. Buffer (0x00010000)
  130. {
  131. // Put your VBIOS here (you could extract it with Linux or Windows)
  132. },
  133.  
  134. // Works as AAPL%02X,override-no-connect, where %02X is display index e.g. 00
  135. "AAPL00,override-no-connect",
  136. Buffer (0x80)
  137. {
  138. // Put your EDID here (you could extract it with Linux or Windows)
  139. // Note that in some cases the extracted EDID may not be compatible and
  140. // as a result you may see visual glitches.
  141. // After you got at least something to show you could use edid-fix.sh script
  142. // (based on pokenguyen's work) to generate a compatible EDID.
  143. },
  144.  
  145. // Just like AAPL00, @0 represents your display index (from the connectors).
  146. // From there on only @X notation could be used for displays other than 0.
  147. // I.e. AAPL01,override-no-connect is OK but AAPL01,DualLink is NOT.
  148.  
  149. // Equal to AAPL00,DualLink, only supported for LVDS displays.
  150. // Required bandwidth speed is calculated as follows:
  151. // BITS_PER_PIXEL * WIDTH * HEIGHT * FREQUENCY / (1024 * 1024) = N Mbps/s
  152. // It depends on hardware but you could commonly assume 800 Mbit/s per link
  153. // If calculated N is above this value, you may require the property below.
  154. "@0,display-dual-link",
  155. Buffer ()
  156. {
  157. 0x01, 0x00, 0x00, 0x00
  158. },
  159.  
  160. // Equal to AAPL00,LinkFormat = 0 (0 - 6 bits, 1 - 8 bits)
  161. // Most laptop displays do not support 24-bit (32) colour but only 18-bit.
  162. // This property must be used if you see "gradient" glitches.
  163. "@0,display-link-component-bits",
  164. Buffer () {
  165. 0x06, 0x00, 0x00, 0x00
  166. },
  167.  
  168. // Equal to AAPL00,PixelFormat = 0 (0 - 6 bits, 1 - 8 bits)
  169. // Similar to display-link-component-bits
  170. "@0,display-pixel-component-bits",
  171. Buffer ()
  172. {
  173. 0x06, 0x00, 0x00, 0x00
  174. },
  175.  
  176. // Equal to AAPL00,Dither
  177. // In general you should avoid this property, since it most likely will decrease
  178. // visual quality. However, on some displays you may get slightly better picture
  179. // with this property set to 1.
  180. "@0,display-dither-support",
  181. Buffer ()
  182. {
  183. 0x01, 0x00, 0x00, 0x00
  184. }
  185.  
  186. */
  187. }, Local0)
  188. DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
  189. Return (Local0)
  190. }
  191. }
  192.  
  193. /*
  194.  
  195. // Only use this if you are not satisfied with automatic HDMI injection
  196. Device (HDAU)
  197. {
  198. Name (_ADR, One) // _ADR: Address
  199. Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
  200. {
  201. If (LEqual (Arg2, Zero))
  202. {
  203. Return (Buffer (One)
  204. {
  205. 0x03
  206. })
  207. }
  208.  
  209. Return (Package ()
  210. {
  211. // layout-id should be defined, though the value is unused
  212.  
  213. "layout-id",
  214. Buffer (0x04)
  215. {
  216. 0x01, 0x00, 0x00, 0x00
  217. },
  218.  
  219. "hda-gfx",
  220. Buffer ()
  221. {
  222. "onboard-1"
  223. }
  224. })
  225. }
  226. }
  227.  
  228. */
  229. }
  230.  
  231. // Below goes an example for IGPU injection useful for enabling hardware video decoding and other stuff.
  232.  
  233. Device (IMEI)
  234. {
  235. Name (_ADR, 0x00160000) // _ADR: Address
  236. }
  237.  
  238. Scope (GFX0)
  239. {
  240. Name (_STA, Zero) // _STA: Status
  241. }
  242.  
  243. Device (IGPU)
  244. {
  245. Name (_ADR, 0x00020000) // _ADR: Address
  246. Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
  247. {
  248. Store (Package ()
  249. {
  250. "name",
  251. Buffer ()
  252. {
  253. "display"
  254. },
  255.  
  256. // This is a connector-less frame for Azul HD 4600
  257.  
  258. "AAPL,ig-platform-id",
  259. Buffer (0x04)
  260. {
  261. 0x04, 0x00, 0x12, 0x04
  262. },
  263.  
  264. // This is an override for built-in device-id
  265.  
  266. "device-id",
  267. Buffer (0x04)
  268. {
  269. 0x12, 0x04, 0x00, 0x00
  270. }
  271. }, Local0)
  272. DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
  273. Return (Local0)
  274. }
  275. }
  276.  
  277. Method (DTGP, 5, NotSerialized)
  278. {
  279. If (LEqual (Arg0, ToUUID ("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))
  280. {
  281. If (LEqual (Arg1, One))
  282. {
  283. If (LEqual (Arg2, Zero))
  284. {
  285. Store (Buffer (One)
  286. {
  287. 0x03
  288. }, Arg4)
  289. Return (One)
  290. }
  291.  
  292. If (LEqual (Arg2, One))
  293. {
  294. Return (One)
  295. }
  296. }
  297. }
  298.  
  299. Store (Buffer (One)
  300. {
  301. 0x00
  302. }, Arg4)
  303. Return (Zero)
  304. }
  305. }
  306. }
  307.  
Advertisement
Add Comment
Please, Sign In to add comment