mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-14 20:49:56 +01:00
WIP
This commit is contained in:
parent
4899325fa4
commit
70c58dd568
|
|
@ -4,6 +4,29 @@ namespace PowerControl.Helpers.AMD
|
|||
{
|
||||
internal class ModeTiming
|
||||
{
|
||||
internal readonly static ADLDisplayModeInfo Mode1280x800p40 = new ADLDisplayModeInfo()
|
||||
{
|
||||
iPelsHeight = 1280,
|
||||
iPelsWidth = 800,
|
||||
iPossibleStandard = 43,
|
||||
iRefreshRate = 40,
|
||||
iTimingStandard = 1,
|
||||
sDetailedTiming = new ADLDetailedTiming()
|
||||
{
|
||||
iSize = 96,
|
||||
sHDisplay = 800,
|
||||
sHSyncStart = 848,
|
||||
sHSyncWidth = 80,
|
||||
sHTotal = 1056,
|
||||
sPixelClock = 5525,
|
||||
sTimingFlags = 4100,
|
||||
sVDisplay = 1280,
|
||||
sVSyncStart = 1283,
|
||||
sVSyncWidth = 10,
|
||||
sVTotal = 1312
|
||||
}
|
||||
};
|
||||
|
||||
internal static bool AddAndSetTiming(ADLDisplayModeX2 displayMode)
|
||||
{
|
||||
RemoveTiming(displayMode);
|
||||
|
|
@ -36,6 +59,22 @@ namespace PowerControl.Helpers.AMD
|
|||
return AddTiming(displayMode);
|
||||
}
|
||||
|
||||
internal static bool AddTiming(ADLDisplayModeInfo displayMode)
|
||||
{
|
||||
return Helpers.AMD.ADLContext.WithSafe((context) =>
|
||||
{
|
||||
int res = ADL.ADL2_Display_ModeTimingOverride_Set(
|
||||
context.Context,
|
||||
Helpers.AMD.ADL.ADL_DEFAULT_ADAPTER,
|
||||
0,
|
||||
ref displayMode,
|
||||
1
|
||||
);
|
||||
|
||||
return res == 0;
|
||||
});
|
||||
}
|
||||
|
||||
internal static bool AddTiming(ADLDisplayModeX2 displayMode)
|
||||
{
|
||||
return Helpers.AMD.ADLContext.WithSafe((context) =>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,17 @@ namespace PowerControl.Options
|
|||
|
||||
var modes = ModeTiming.GetAllModes();
|
||||
|
||||
ModeTiming.ReplaceTiming(new Helpers.AMD.ADLDisplayModeX2()
|
||||
// ModeTiming.ReplaceTiming(new Helpers.AMD.ADLDisplayModeX2()
|
||||
// {
|
||||
// PelsWidth = currentResolution.Value.Width,
|
||||
// PelsHeight = currentResolution.Value.Height,
|
||||
// RefreshRate = selectedRefreshRate,
|
||||
// TimingStandard = Helpers.AMD.ADL.ADL_DL_MODETIMING_STANDARD_CVT,
|
||||
// });
|
||||
|
||||
ModeTiming.AddTiming(ModeTiming.Mode1280x800p40);
|
||||
|
||||
ModeTiming.SetTiming(new Helpers.AMD.ADLDisplayModeX2()
|
||||
{
|
||||
PelsWidth = currentResolution.Value.Width,
|
||||
PelsHeight = currentResolution.Value.Height,
|
||||
|
|
@ -44,8 +54,10 @@ namespace PowerControl.Options
|
|||
TimingStandard = Helpers.AMD.ADL.ADL_DL_MODETIMING_STANDARD_CVT,
|
||||
});
|
||||
}
|
||||
|
||||
DisplayResolutionController.SetRefreshRate(selectedRefreshRate);
|
||||
else
|
||||
{
|
||||
DisplayResolutionController.SetRefreshRate(selectedRefreshRate);
|
||||
}
|
||||
|
||||
return DisplayResolutionController.GetRefreshRate().ToString();
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue