Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/json_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2053,6 +2053,7 @@
"enum": [
"integrated",
"discrete",
"unknown",
"none"
],
"default": "none"
Expand Down
3 changes: 2 additions & 1 deletion src/data/help.json
Original file line number Diff line number Diff line change
Expand Up @@ -1139,12 +1139,13 @@
},
{
"long": "gpu-hide-type",
"desc": "Specify which types of GPUs should not be displayed",
"desc": "Specify which types of GPUs should not be displayed (default: all GPUs are shown, regardless of recognition)",
"arg": {
"type": "enum",
"enum": {
"integrated": "Hide integrated GPUs",
"discrete": "Hide discrete GPUs",
"unknown": "Hide unknown (unrecognized) GPUs",
"none": "Do not hide any GPUs"
},
"default": "none"
Expand Down
14 changes: 11 additions & 3 deletions src/modules/gpu/gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ void ffPrintGPU(FFGPUOptions* options)

FF_LIST_FOR_EACH(FFGPUResult, gpu, gpus)
{
if(gpu->type == FF_GPU_TYPE_UNKNOWN && options->hideType == FF_GPU_TYPE_UNKNOWN)
continue;

if(gpu->type == FF_GPU_TYPE_INTEGRATED && options->hideType == FF_GPU_TYPE_INTEGRATED)
continue;

Expand Down Expand Up @@ -230,7 +233,8 @@ bool ffParseGPUCommandOptions(FFGPUOptions* options, const char* key, const char
if (ffStrEqualsIgnCase(subKey, "hide-type"))
{
options->hideType = (FFGPUType) ffOptionParseEnum(key, value, (FFKeyValuePair[]) {
{ "none", FF_GPU_TYPE_UNKNOWN },
{ "none", FF_GPU_TYPE_NONE },
{ "unknown", FF_GPU_TYPE_UNKNOWN },
{ "integrated", FF_GPU_TYPE_INTEGRATED },
{ "discrete", FF_GPU_TYPE_DISCRETE },
{},
Expand Down Expand Up @@ -288,7 +292,8 @@ void ffParseGPUJsonObject(FFGPUOptions* options, yyjson_val* module)
{
int value;
const char* error = ffJsonConfigParseEnum(val, &value, (FFKeyValuePair[]) {
{ "none", FF_GPU_TYPE_UNKNOWN },
{ "none", FF_GPU_TYPE_NONE },
{ "unknown", FF_GPU_TYPE_UNKNOWN },
{ "integrated", FF_GPU_TYPE_INTEGRATED },
{ "discrete", FF_GPU_TYPE_DISCRETE },
{},
Expand Down Expand Up @@ -345,9 +350,12 @@ void ffGenerateGPUJsonConfig(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_
{
switch (options->hideType)
{
case FF_GPU_TYPE_UNKNOWN:
case FF_GPU_TYPE_NONE:
yyjson_mut_obj_add_str(doc, module, "hideType", "none");
break;
case FF_GPU_TYPE_UNKNOWN:
yyjson_mut_obj_add_str(doc, module, "hideType", "unknown");
break;
case FF_GPU_TYPE_INTEGRATED:
yyjson_mut_obj_add_str(doc, module, "hideType", "integrated");
break;
Expand Down
3 changes: 2 additions & 1 deletion src/modules/gpu/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

typedef enum __attribute__((__packed__)) FFGPUType
{
FF_GPU_TYPE_UNKNOWN,
FF_GPU_TYPE_NONE, // Indicates no specific GPU type. Useful as a hide filter only.
Copy link

Copilot AI May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider clarifying this comment to state that selecting FF_GPU_TYPE_NONE restores the old behavior (i.e., not hiding any GPUs) to avoid potential confusion with the new 'unknown' behavior.

Suggested change
FF_GPU_TYPE_NONE, // Indicates no specific GPU type. Useful as a hide filter only.
FF_GPU_TYPE_NONE, // Indicates no specific GPU type. Restores the old behavior of not hiding any GPUs. Useful as a hide filter only.

Copilot uses AI. Check for mistakes.
FF_GPU_TYPE_UNKNOWN, // Indicates an unknown or unrecognized GPU type.
FF_GPU_TYPE_INTEGRATED,
FF_GPU_TYPE_DISCRETE,
} FFGPUType;
Expand Down
Loading