Store name in NVIDIAIlluminationController to avoid setting it in detector
This commit is contained in:
parent
9470cb69fd
commit
a34d796059
4 changed files with 49 additions and 41 deletions
|
|
@ -116,9 +116,8 @@ void DetectNVIDIAIllumGPUs()
|
||||||
case NVIDIA_ILLUMINATION_V1:
|
case NVIDIA_ILLUMINATION_V1:
|
||||||
{
|
{
|
||||||
nvapi_accessor* new_nvapi = new nvapi_accessor(gpu_handles[gpu_idx]);
|
nvapi_accessor* new_nvapi = new nvapi_accessor(gpu_handles[gpu_idx]);
|
||||||
NVIDIAIlluminationV1Controller* controller = new NVIDIAIlluminationV1Controller(new_nvapi, device_list[dev_idx].treats_rgbw_as_rgb);
|
NVIDIAIlluminationV1Controller* controller = new NVIDIAIlluminationV1Controller(new_nvapi, device_list[dev_idx].treats_rgbw_as_rgb, device_list[dev_idx].name);
|
||||||
RGBController_NVIDIAIlluminationV1* rgb_controller = new RGBController_NVIDIAIlluminationV1(controller);
|
RGBController_NVIDIAIlluminationV1* rgb_controller = new RGBController_NVIDIAIlluminationV1(controller);
|
||||||
rgb_controller->name = device_list[dev_idx].name;
|
|
||||||
|
|
||||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,21 @@
|
||||||
|
|
||||||
#include "NVIDIAIlluminationV1Controller_Windows_Linux.h"
|
#include "NVIDIAIlluminationV1Controller_Windows_Linux.h"
|
||||||
|
|
||||||
NVIDIAIlluminationV1Controller::NVIDIAIlluminationV1Controller(nvapi_accessor* nvapi_ptr, bool treats_rgbw_as_rgb)
|
NVIDIAIlluminationV1Controller::NVIDIAIlluminationV1Controller(nvapi_accessor* nvapi_ptr, bool treats_rgbw_as_rgb, std::string dev_name)
|
||||||
{
|
{
|
||||||
nvapi = nvapi_ptr;
|
nvapi = nvapi_ptr;
|
||||||
_treats_rgbw_as_rgb = treats_rgbw_as_rgb;
|
_treats_rgbw_as_rgb = treats_rgbw_as_rgb;
|
||||||
|
name = dev_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
NVIDIAIlluminationV1Controller::~NVIDIAIlluminationV1Controller()
|
NVIDIAIlluminationV1Controller::~NVIDIAIlluminationV1Controller()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string NVIDIAIlluminationV1Controller::GetName()
|
||||||
|
{
|
||||||
|
return(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NVIDIAIlluminationV1Controller::checkNVAPIreturn()
|
void NVIDIAIlluminationV1Controller::checkNVAPIreturn()
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,11 @@ enum
|
||||||
class NVIDIAIlluminationV1Controller
|
class NVIDIAIlluminationV1Controller
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NVIDIAIlluminationV1Controller(nvapi_accessor* nvapi_ptr, bool treats_rgbw_as_rgb);
|
NVIDIAIlluminationV1Controller(nvapi_accessor* nvapi_ptr, bool treats_rgbw_as_rgb, std::string dev_name);
|
||||||
~NVIDIAIlluminationV1Controller();
|
~NVIDIAIlluminationV1Controller();
|
||||||
|
|
||||||
|
std::string GetName();
|
||||||
|
|
||||||
void getControl();
|
void getControl();
|
||||||
void setControl();
|
void setControl();
|
||||||
bool allZero(std::array<uint8_t, 4> colors);
|
bool allZero(std::array<uint8_t, 4> colors);
|
||||||
|
|
@ -49,11 +51,12 @@ class NVIDIAIlluminationV1Controller
|
||||||
std::vector<NV_GPU_CLIENT_ILLUM_ZONE_TYPE> getInfo();
|
std::vector<NV_GPU_CLIENT_ILLUM_ZONE_TYPE> getInfo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void checkNVAPIreturn();
|
|
||||||
|
|
||||||
nvapi_accessor* nvapi;
|
nvapi_accessor* nvapi;
|
||||||
bool _treats_rgbw_as_rgb;
|
bool _treats_rgbw_as_rgb;
|
||||||
NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS zone_params;
|
NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS zone_params;
|
||||||
NV_STATUS nvapi_return = 0;
|
NV_STATUS nvapi_return = 0;
|
||||||
const std::array<uint8_t, 4> all_zeros = {0, 0, 0, 0};
|
const std::array<uint8_t, 4> all_zeros = {0, 0, 0, 0};
|
||||||
|
std::string name;
|
||||||
|
|
||||||
|
void checkNVAPIreturn();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -52,10 +52,9 @@ RGBController_NVIDIAIlluminationV1::RGBController_NVIDIAIlluminationV1(NVIDIAIll
|
||||||
{
|
{
|
||||||
controller = controller_ptr;
|
controller = controller_ptr;
|
||||||
|
|
||||||
name = "NVIDIA Illumination GPU";
|
name = controller->GetName();
|
||||||
vendor = "NVIDIA";
|
vendor = "NVIDIA";
|
||||||
description = "NVIDIA Illumination RGB GPU Device";
|
description = "NVIDIA Illumination RGB GPU Device";
|
||||||
|
|
||||||
type = DEVICE_TYPE_GPU;
|
type = DEVICE_TYPE_GPU;
|
||||||
|
|
||||||
mode Off;
|
mode Off;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue