Skip to content

Conversation

@SimSaladin
Copy link
Contributor

The hide-type option now actually hides any unknown GPUs by default (hide-type == "unknown"). The old behavior (not hiding any GPUs) can be restored with "none".

Probably something of an edge-case, fastfetch would not hide a secondary GPU that is "recognized" as type == unknown (integrated in reality, but the kernel module is blacklisted because it messes things up otherwise).

@CarterLi CarterLi requested a review from Copilot May 7, 2025 05:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request updates the GPU module to change the behavior of the hide-type option so that unknown GPUs are hidden by default. Key changes include:

  • Adding a new enum value (FF_GPU_TYPE_NONE) to represent the "none" option.
  • Updating option parsing from command line and JSON to correctly map string values to the corresponding enum.
  • Adjusting JSON configuration generation to output the revised enum mapping.

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/modules/gpu/option.h Added new enum value FF_GPU_TYPE_NONE to support "none".
src/modules/gpu/gpu.c Updated option parsing and JSON configuration to use new enum mappings.
Files not reviewed (2)
  • doc/json_schema.json: Language not supported
  • src/data/help.json: Language not supported

@CarterLi
Copy link
Member

CarterLi commented May 7, 2025

Please don't change the default behavior. The GPU type being set to unknown usually means the type detection is not supported on that platform. Your change will effectively hides all GPUs on those platforms.

The current default behavior of not hiding any GPUs is retained. The new
feature of hiding unknown or unrecognized GPUs can be enabled with
hide-type = "unknown".
@SimSaladin SimSaladin force-pushed the gpu-hide-type-fix branch from c6e9a0f to c3bd301 Compare May 7, 2025 08:11
@SimSaladin
Copy link
Contributor Author

The default will now remain as it was, ensuring that no GPUs are hidden by default. The new feature to hide unknown/unrecognized GPUs can still be enabled with hide-type = "unknown" for those who need it.

@CarterLi CarterLi requested a review from Copilot May 7, 2025 13:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the behavior of the GPU hide filter so that unknown GPUs are hidden when the "unknown" option is selected, while the old behavior (not hiding any GPUs) is restored using "none".

  • Updates enum definitions in option.h to distinguish between "none" and "unknown".
  • Adjusts command-line and JSON option parsing in gpu.c to correctly map the new enum values.

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/modules/gpu/option.h Modified enum values to set distinct roles for "none" and "unknown".
src/modules/gpu/gpu.c Updated option parsing and JSON config generation to reflect the new enum mappings.
Files not reviewed (2)
  • doc/json_schema.json: Language not supported
  • src/data/help.json: Language not supported

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.
@CarterLi CarterLi merged commit 484e05e into fastfetch-cli:dev May 7, 2025
19 checks passed
CarterLi added a commit that referenced this pull request May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants