Skip to content

Commit

Permalink
重新启用通告分辨率加速常驻VDD的切换
Browse files Browse the repository at this point in the history
  • Loading branch information
qiin2333 committed Sep 15, 2024
1 parent 159ce9a commit 1a28b15
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
12 changes: 1 addition & 11 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,19 +427,9 @@ namespace config {
"1920x1200"s,
"3840x2160"s,
"3840x1600"s,
"2316x1080"s,
"2340x1080"s,
"2388x1668"s,
"2480x1116"s,
"2670x1200"s,
"2800x1260"s,
"2880x1920"s,
"3200x1440"s,
"5120x2880"s,
"7680x4320"s,
}, // supported resolutions

{ 30, 60, 90, 120, 165, 240 }, // supported fps
{ 60, 90, 120, 144 }, // supported fps
};

input_t input {
Expand Down
12 changes: 7 additions & 5 deletions src/display_device/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ namespace display_device {

void
session_t::prepare_vdd(parsed_config_t &config, const rtsp_stream::launch_session_t &session) {
// std::lock_guard lock { mutex };
// resolutions and fps from parsed
bool is_cached_res { false };
bool is_cached_fps { false };
Expand All @@ -244,15 +245,13 @@ namespace display_device {

for (auto &res : config::nvhttp.resolutions) {
write_resolutions << res << ",";
BOOST_LOG(info) << "res == to_string(*config.resolution)" << res << "," << to_string(*config.resolution);
if (res == to_string(*config.resolution)) {
is_cached_res = true;
}
}

for (auto &fps : config::nvhttp.fps) {
write_fps << fps << ",";
BOOST_LOG(info) << "fps == to_string(*config.refresh_rate)" << fps << "," << to_string(*config.refresh_rate);
if (std::to_string(fps) == to_string(*config.refresh_rate)) {
is_cached_fps = true;
}
Expand Down Expand Up @@ -282,21 +281,24 @@ namespace display_device {
}

bool should_reset_zako_hdr = false;
int retry_count = 0;
auto device_zako = display_device::find_device_by_friendlyname(zako_name);
if (device_zako.empty()) {
session_t::get().enable_vdd();
}
else if (should_toggle_vdd) {
session_t::get().disable_vdd();
Sleep(2333);
std::this_thread::sleep_for(2333ms);
session_t::get().enable_vdd();
should_reset_zako_hdr = true;
}

device_zako = display_device::find_device_by_friendlyname(zako_name);
while (device_zako.empty()) {
while (device_zako.empty() && retry_count < 30) {
BOOST_LOG(info) << "Find zako retry_count : "sv << retry_count;
retry_count += 1;
device_zako = display_device::find_device_by_friendlyname(zako_name);
Sleep(233);
std::this_thread::sleep_for(233ms);
}

if (!device_zako.empty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/platform/windows/display_device/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ namespace display_device {
display_device::session_t::get().disable_vdd();
}
}
else {
else if (vdd_devices.empty()) {
BOOST_LOG(info) << "Vdd resident so turning on it";
display_device::session_t::get().enable_vdd();
}
Expand Down
4 changes: 2 additions & 2 deletions src_assets/common/assets/web/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ <h1 class="my-4">{{ $t('config.configuration') }}</h1>
hdr_prep: "automatic",
display_mode_remapping: "[]",
resolutions:
"[1280x720,1920x1080,2560x1080,2560x1440,2560x1600,3440x1440,1920x1200,3840x2160,3840x1600,2316x1080,2388x1668,2480x1116,2670x1200,2800x1260,2880x1920,3200x1440,5120x2880,7680x4320]",
fps: "[30,60,90,120]",
"[1280x720,1920x1080,2560x1080,2560x1440,2560x1600,3440x1440,3840x2160]",
fps: "[60,90,120,144]",
min_fps_factor: 1,
},
},
Expand Down

0 comments on commit 1a28b15

Please sign in to comment.