diff --git a/src/video_display/dummy.cpp b/src/video_display/dummy.cpp index ed1c2ca2a..45c61963f 100644 --- a/src/video_display/dummy.cpp +++ b/src/video_display/dummy.cpp @@ -82,7 +82,8 @@ struct dummy_display_state { size_t dump_bytes = 0; bool dump_to_file = false; int dump_to_file_skip_frames = 0; - bool cuda_managed = false; + bool cuda_host = false; + bool cuda_managed = true; struct rtp *rtp; }; @@ -91,13 +92,13 @@ static auto display_dummy_init(struct module * /* parent */, const char *cfg, un { if ("help"s == cfg) { cout << "Usage:\n"; - cout << "\t" << style::bold << fg::red << "-d dummy" << fg::reset << "[:codec=][:rgb_shift=,,][:hexdump[=]][:dump_to_file[=skip=]][:managed]\n" << style::reset; + cout << "\t" << style::bold << fg::red << "-d dummy" << fg::reset << "[:codec=][:rgb_shift=,,][:hexdump[=]][:dump_to_file[=skip=]][:managed|:host]\n" << style::reset; cout << "where\n"; cout << "\t" << style::bold << "" << style::reset << " - force the use of a codec instead of default set\n"; cout << "\t" << style::bold << "rgb_shift" << style::reset << " - if using output codec RGBA, use specified shifts instead of default (0, 8, 16)\n"; cout << "\t" << style::bold << "hexdump[=]" << style::reset << " - dump first n (default " << DEFAULT_DUMP_LEN << ") bytes of every frame in hexadecimal format\n"; cout << "\t" << style::bold << "dump_to_file" << style::reset << " - dump first frame to file dummy. (optionally skip first frames)\n"; - cout << "\t" << style::bold << "managed" << style::reset << " - use managed memory for CUDA codecs instead of \n"; + cout << "\t" << style::bold << "managed|host" << style::reset << " - use managed/host memory for CUDA codecs instead of \n"; return static_cast(&display_init_noerr); } auto s = make_unique(); @@ -113,6 +114,8 @@ static auto display_dummy_init(struct module * /* parent */, const char *cfg, un LOG(LOG_LEVEL_ERROR) << MOD_NAME << "Wrong codec spec!\n"; return nullptr; } + } else if (strstr(item, "host") != nullptr) { + s->cuda_managed = false; } else if (strstr(item, "managed") != nullptr) { s->cuda_managed = true; } else if (strstr(item, "dump_to_file") != nullptr) { diff --git a/src/video_display/vrg.cpp b/src/video_display/vrg.cpp index 481f9d7f7..e8734f4a1 100644 --- a/src/video_display/vrg.cpp +++ b/src/video_display/vrg.cpp @@ -132,7 +132,7 @@ struct state_vrg { uint32_t magic; struct video_desc saved_desc; #ifdef HAVE_CUDA - video_frame_pool pool{0, vrg_cuda_allocator()}; + video_frame_pool pool{0, vrg_cuda_allocator()}; #else video_frame_pool pool{0, vrg_cuda_allocator()}; #endif @@ -162,7 +162,7 @@ static void *display_vrg_init(struct module *parent, const char *fmt, unsigned i UNUSED(flags); UNUSED(parent); if ("help"s == fmt) { - cout << "Usage:\n\t-d vrg[:managed|:malloc]\n"; + cout << "Usage:\n\t-d vrg[:host|:managed|:malloc]\n"; cout << "where\n\tmanaged - use managed memory\n"; return NULL; } @@ -173,7 +173,11 @@ static void *display_vrg_init(struct module *parent, const char *fmt, unsigned i } s->magic = MAGIC_VRG; - if ("managed"s == fmt) { + if ("host"s == fmt) { +#ifdef HAVE_CUDA + s->pool.replace_allocator(vrg_cuda_allocator()); +#endif + } else if ("managed"s == fmt) { #ifdef HAVE_CUDA s->pool.replace_allocator(vrg_cuda_allocator()); #endif