From ffe99f031035e4cb64d16350bd542dda461ea4b3 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Sat, 1 Jun 2024 20:11:03 -0500 Subject: [PATCH] Update NVIDIA Illumination controller files to new standardized header comment --- ...IAIlluminationControllerDetect_Windows.cpp | 26 +++++++-------- ...NVIDIAIlluminationV1Controller_Windows.cpp | 33 ++++++++++--------- .../NVIDIAIlluminationV1Controller_Windows.h | 25 +++++++------- ...BController_NVIDIAIllumination_Windows.cpp | 26 +++++++-------- ...RGBController_NVIDIAIllumination_Windows.h | 21 ++++++------ .../nvapi_accessor_Windows.cpp | 22 +++++++------ .../nvapi_accessor_Windows.h | 18 +++++----- 7 files changed, 89 insertions(+), 82 deletions(-) diff --git a/Controllers/NVIDIAIlluminationController/NVIDIAIlluminationControllerDetect_Windows.cpp b/Controllers/NVIDIAIlluminationController/NVIDIAIlluminationControllerDetect_Windows.cpp index 1ad1a879..827e516f 100644 --- a/Controllers/NVIDIAIlluminationController/NVIDIAIlluminationControllerDetect_Windows.cpp +++ b/Controllers/NVIDIAIlluminationController/NVIDIAIlluminationControllerDetect_Windows.cpp @@ -1,22 +1,22 @@ -/*----------------------------------------------*\ -| NVIDIAIlluminationControllerDetect.cpp | -| | -| Detect GPUS that are controlled by the direct | -| NVIDIA Illumination controller. | -| | -| Carter Miller (GingerRunner) 1/4/2022 | -\*----------------------------------------------*/ +/*---------------------------------------------------------*\ +| NVIDIAIlluminationControllerDetect_Windows.cpp | +| | +| Detector for NVIDIA Illumination GPU | +| | +| Carter Miller (GingerRunner) 04 Jan 2022 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ +#include +#include +#include #include "Detector.h" - #include "LogManager.h" #include "RGBController.h" #include "RGBController_NVIDIAIllumination_Windows.h" - #include "pci_ids.h" -#include -#include -#include enum { diff --git a/Controllers/NVIDIAIlluminationController/NVIDIAIlluminationV1Controller_Windows.cpp b/Controllers/NVIDIAIlluminationController/NVIDIAIlluminationV1Controller_Windows.cpp index b64c1706..b85307b8 100644 --- a/Controllers/NVIDIAIlluminationController/NVIDIAIlluminationV1Controller_Windows.cpp +++ b/Controllers/NVIDIAIlluminationController/NVIDIAIlluminationV1Controller_Windows.cpp @@ -1,10 +1,13 @@ -/*-----------------------------------------------*\ -| NVIDIAIlluminationV1Controller.cpp | -| | -| Driver for NVIDIA Illumination controlled GPUs | -| | -| Carter Miller (GingerRunner) 1/5/2022 | -\*-----------------------------------------------*/ +/*---------------------------------------------------------*\ +| NVIDIAIlluminationV1Controller_Windows.cpp | +| | +| Driver for NVIDIA Illumination V1 GPU | +| | +| Carter Miller (GingerRunner) 05 Jan 2022 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ #include "NVIDIAIlluminationV1Controller_Windows.h" @@ -126,17 +129,17 @@ void NVIDIAIlluminationV1Controller::setZone(uint8_t zone, uint8_t mode, NVIDIAI \*----------------------------------------------------------------------------------------------------*/ if(!_treats_rgbw_as_rgb) { - uint8_t min_rgb_value = 0xFF; + uint8_t min_rgb_value = 0xFF; uint8_t max_rgb_value = 0; - min_rgb_value = ((red < 0xFF) ? red : min_rgb_value); - min_rgb_value = ((green < min_rgb_value) ? green : min_rgb_value); - min_rgb_value = ((blue < min_rgb_value) ? blue : min_rgb_value); - max_rgb_value = ((red > 0) ? red : max_rgb_value); - max_rgb_value = ((green > max_rgb_value) ? green : max_rgb_value); - max_rgb_value = ((blue > max_rgb_value) ? blue : max_rgb_value); + min_rgb_value = ((red < 0xFF) ? red : min_rgb_value); + min_rgb_value = ((green < min_rgb_value) ? green : min_rgb_value); + min_rgb_value = ((blue < min_rgb_value) ? blue : min_rgb_value); + max_rgb_value = ((red > 0) ? red : max_rgb_value); + max_rgb_value = ((green > max_rgb_value) ? green : max_rgb_value); + max_rgb_value = ((blue > max_rgb_value) ? blue : max_rgb_value); /*---------------------------------------------------------------------------------------------------*\ | If difference between the highest and lowest RGB values is 10 or lower, set the white value only, | - | zero out the rest, this logic was found via tedious examination | + | zero out the rest, this logic was found via tedious examination | \*---------------------------------------------------------------------------------------------------*/ if (max_rgb_value - min_rgb_value <= 10) { diff --git a/Controllers/NVIDIAIlluminationController/NVIDIAIlluminationV1Controller_Windows.h b/Controllers/NVIDIAIlluminationController/NVIDIAIlluminationV1Controller_Windows.h index ca52cfea..08635f9a 100644 --- a/Controllers/NVIDIAIlluminationController/NVIDIAIlluminationV1Controller_Windows.h +++ b/Controllers/NVIDIAIlluminationController/NVIDIAIlluminationV1Controller_Windows.h @@ -1,23 +1,23 @@ -/*-----------------------------------------*\ -| NVIDIAIlluminationV1Controller.h | -| | -| Definitions and types for direct NVIDIA | -| Illumination-based NVIDIA GPUs' RGB | -| controller | -| | -| Carter Miller (GingerRunner) 1/4/2022 | -\*-----------------------------------------*/ +/*---------------------------------------------------------*\ +| NVIDIAIlluminationV1Controller_Windows.h | +| | +| Driver for NVIDIA Illumination V1 GPU | +| | +| Carter Miller (GingerRunner) 04 Jan 2022 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ +#pragma once +#include #include #include -#include #include "nvapi_accessor_Windows.h" #include "RGBController.h" #include "LogManager.h" -#pragma once - #define NVIDIA_ILLUMINATION_V1_CONTROLLER_NAME "NVIDIA_ILLUMINATION_V1" #define NVAPI_OK 0 @@ -56,5 +56,4 @@ class NVIDIAIlluminationV1Controller NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS zone_params; NV_STATUS nvapi_return = 0; const std::array all_zeros = {0, 0, 0, 0}; - }; diff --git a/Controllers/NVIDIAIlluminationController/RGBController_NVIDIAIllumination_Windows.cpp b/Controllers/NVIDIAIlluminationController/RGBController_NVIDIAIllumination_Windows.cpp index 3a9fa8b5..e18c8d1e 100644 --- a/Controllers/NVIDIAIlluminationController/RGBController_NVIDIAIllumination_Windows.cpp +++ b/Controllers/NVIDIAIlluminationController/RGBController_NVIDIAIllumination_Windows.cpp @@ -1,12 +1,16 @@ -/*--------------------------------------------*\ -| RGBController_NVIDIAIllumination.cpp | -| | -| Generic RGB Interface for OpenRGB direct | -| NVIDIA Illumination controller NVIDIA GPUs. | -| Note that this works for Windows only. | -| | -| Carter Miller (GingerRunner) 1/4/2022 | -\*--------------------------------------------*/ +/*---------------------------------------------------------*\ +| RGBController_NVIDIAIllumination.cpp | +| | +| RGBController for NVIDIA Illumination GPU | +| | +| Carter Miller (GingerRunner) 04 Jan 2022 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ + +#include +#include "RGBController_NVIDIAIllumination_Windows.h" /**------------------------------------------------------------------*\ @name NVIDIA Illumination @@ -44,10 +48,6 @@ standard RGB). \*-------------------------------------------------------------------*/ - -#include "RGBController_NVIDIAIllumination_Windows.h" -#include - RGBController_NVIDIAIlluminationV1::RGBController_NVIDIAIlluminationV1(NVIDIAIlluminationV1Controller* controller_ptr) { controller = controller_ptr; diff --git a/Controllers/NVIDIAIlluminationController/RGBController_NVIDIAIllumination_Windows.h b/Controllers/NVIDIAIlluminationController/RGBController_NVIDIAIllumination_Windows.h index 66bb3026..dbe5da83 100644 --- a/Controllers/NVIDIAIlluminationController/RGBController_NVIDIAIllumination_Windows.h +++ b/Controllers/NVIDIAIlluminationController/RGBController_NVIDIAIllumination_Windows.h @@ -1,18 +1,19 @@ -/*-----------------------------------------*\ -| RGBController_NVIDIAIllumination.h | -| | -| NVIDIA Illumination Generic RGB Interface| -| for OpenRGB | -| | -| Carter Miller (GingerRunner) 1/4/2022 | -\*-----------------------------------------*/ - +/*---------------------------------------------------------*\ +| RGBController_NVIDIAIllumination.h | +| | +| RGBController for NVIDIA Illumination GPU | +| | +| Carter Miller (GingerRunner) 04 Jan 2022 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ #pragma once +#include #include "RGBController.h" #include "NVIDIAIlluminationV1Controller_Windows.h" -#include #define NVIDIA_FOUNDERS_V1_CONTROLLER_NAME "NVIDIA_FOUNDERS_V1" diff --git a/Controllers/NVIDIAIlluminationController/nvapi_accessor_Windows.cpp b/Controllers/NVIDIAIlluminationController/nvapi_accessor_Windows.cpp index c92ecbb2..e2b84b2e 100644 --- a/Controllers/NVIDIAIlluminationController/nvapi_accessor_Windows.cpp +++ b/Controllers/NVIDIAIlluminationController/nvapi_accessor_Windows.cpp @@ -1,15 +1,17 @@ -/*-----------------------------------------*\ -| nvapi_accessor.cpp | -| | -| Definitions and for Nvidia NvAPI | -| direct access class | -| | -| Carter Miller (GingerRunner) 6/20/2022 | -\*-----------------------------------------*/ +/*---------------------------------------------------------*\ +| nvapi_accessor_Windows.cpp | +| | +| NVAPI accessor for NVIDIA NVAPI illumination API | +| | +| Carter Miller (GingerRunner) 20 Jun 2022 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ -#include "nvapi_accessor_Windows.h" -#include #include +#include +#include "nvapi_accessor_Windows.h" nvapi_accessor::nvapi_accessor(NV_PHYSICAL_GPU_HANDLE handle) { diff --git a/Controllers/NVIDIAIlluminationController/nvapi_accessor_Windows.h b/Controllers/NVIDIAIlluminationController/nvapi_accessor_Windows.h index 57f6c713..9b130e05 100644 --- a/Controllers/NVIDIAIlluminationController/nvapi_accessor_Windows.h +++ b/Controllers/NVIDIAIlluminationController/nvapi_accessor_Windows.h @@ -1,11 +1,13 @@ -/*-----------------------------------------*\ -| nvapi_accessor.h | -| | -| Definitions and types for Nvidia NvAPI | -| direct access class | -| | -| Carter Miller (GingerRunner) 6/20/2022 | -\*-----------------------------------------*/ +/*---------------------------------------------------------*\ +| nvapi_accessor_Windows.h | +| | +| NVAPI accessor for NVIDIA NVAPI illumination API | +| | +| Carter Miller (GingerRunner) 20 Jun 2022 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ #include "nvapi.h"