mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-18 20:53:51 +00:00
Use global mutex to ensure driver access are sequential
This commit is contained in:
parent
a1a438c3f8
commit
f7e3e70c2b
6 changed files with 148 additions and 74 deletions
|
|
@ -51,21 +51,25 @@ namespace PowerControl.Helpers.GPU
|
|||
return true;
|
||||
}
|
||||
|
||||
public VangoghGPU? Open()
|
||||
public VangoghGPU? Open(bool validateSMU = true)
|
||||
{
|
||||
var gpu = VangoghGPU.OpenMMIO(MMIOAddress, MMIOSize);
|
||||
if (gpu == null)
|
||||
return null;
|
||||
|
||||
// Check supported SMU version
|
||||
var smuVersion = gpu.SMUVersion;
|
||||
if (smuVersion != SMUVersion)
|
||||
if (validateSMU)
|
||||
{
|
||||
Log("SMU: {0:X8} => not supported", smuVersion);
|
||||
return null;
|
||||
// Check supported SMU version
|
||||
var smuVersion = gpu.SMUVersion;
|
||||
if (smuVersion != SMUVersion)
|
||||
{
|
||||
Log("SMU: {0:X8} => not supported", smuVersion);
|
||||
return null;
|
||||
}
|
||||
|
||||
Log("SMU: {0:X8} => detected", smuVersion);
|
||||
}
|
||||
|
||||
Log("SMU: {0:X8} => detected", smuVersion);
|
||||
return gpu;
|
||||
}
|
||||
};
|
||||
|
|
@ -85,7 +89,7 @@ namespace PowerControl.Helpers.GPU
|
|||
|
||||
public static VangoghGPU? Open()
|
||||
{
|
||||
return DetectedDevice?.Open();
|
||||
return DetectedDevice?.Open(false);
|
||||
}
|
||||
|
||||
public static bool Detect()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue