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()
|
||||||
|
|
|
||||||
|
|
@ -35,25 +35,28 @@ 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();
|
||||||
|
|
||||||
void getControl();
|
std::string GetName();
|
||||||
void setControl();
|
|
||||||
bool allZero(std::array<uint8_t, 4> colors);
|
|
||||||
void setZoneRGBW(uint8_t zone, uint8_t red, uint8_t green, uint8_t blue, uint8_t white, uint8_t brightness);
|
|
||||||
void setZoneRGB(uint8_t zone, uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness);
|
|
||||||
void setZone(uint8_t zone, uint8_t mode, NVIDIAIllumination_Config zone_config);
|
|
||||||
int getZoneColor(uint8_t zone_index);
|
|
||||||
std::vector<NV_GPU_CLIENT_ILLUM_ZONE_TYPE> getInfo();
|
|
||||||
|
|
||||||
private:
|
void getControl();
|
||||||
void checkNVAPIreturn();
|
void setControl();
|
||||||
|
bool allZero(std::array<uint8_t, 4> colors);
|
||||||
|
void setZoneRGBW(uint8_t zone, uint8_t red, uint8_t green, uint8_t blue, uint8_t white, uint8_t brightness);
|
||||||
|
void setZoneRGB(uint8_t zone, uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness);
|
||||||
|
void setZone(uint8_t zone, uint8_t mode, NVIDIAIllumination_Config zone_config);
|
||||||
|
int getZoneColor(uint8_t zone_index);
|
||||||
|
std::vector<NV_GPU_CLIENT_ILLUM_ZONE_TYPE> getInfo();
|
||||||
|
|
||||||
nvapi_accessor* nvapi;
|
private:
|
||||||
bool _treats_rgbw_as_rgb;
|
nvapi_accessor* nvapi;
|
||||||
NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS zone_params;
|
bool _treats_rgbw_as_rgb;
|
||||||
NV_STATUS nvapi_return = 0;
|
NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS zone_params;
|
||||||
const std::array<uint8_t, 4> all_zeros = {0, 0, 0, 0};
|
NV_STATUS nvapi_return = 0;
|
||||||
|
const std::array<uint8_t, 4> all_zeros = {0, 0, 0, 0};
|
||||||
|
std::string name;
|
||||||
|
|
||||||
|
void checkNVAPIreturn();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -50,37 +50,36 @@
|
||||||
|
|
||||||
RGBController_NVIDIAIlluminationV1::RGBController_NVIDIAIlluminationV1(NVIDIAIlluminationV1Controller* controller_ptr)
|
RGBController_NVIDIAIlluminationV1::RGBController_NVIDIAIlluminationV1(NVIDIAIlluminationV1Controller* controller_ptr)
|
||||||
{
|
{
|
||||||
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;
|
||||||
Off.name = "Off";
|
Off.name = "Off";
|
||||||
Off.value = NVIDIA_ILLUMINATION_OFF;
|
Off.value = NVIDIA_ILLUMINATION_OFF;
|
||||||
Off.color_mode = MODE_COLORS_NONE;
|
Off.color_mode = MODE_COLORS_NONE;
|
||||||
modes.push_back(Off);
|
modes.push_back(Off);
|
||||||
|
|
||||||
mode Static;
|
mode Static;
|
||||||
Static.name = "Direct";
|
Static.name = "Direct";
|
||||||
Static.value = NVIDIA_ILLUMINATION_DIRECT;
|
Static.value = NVIDIA_ILLUMINATION_DIRECT;
|
||||||
Static.flags = MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_PER_LED_COLOR;
|
Static.flags = MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_PER_LED_COLOR;
|
||||||
Static.color_mode = MODE_COLORS_PER_LED;
|
Static.color_mode = MODE_COLORS_PER_LED;
|
||||||
Static.colors_min = 1;
|
Static.colors_min = 1;
|
||||||
Static.colors_max = 1;
|
Static.colors_max = 1;
|
||||||
Static.brightness_min = 0;
|
Static.brightness_min = 0;
|
||||||
Static.brightness = 100;
|
Static.brightness = 100;
|
||||||
Static.brightness_max = 100;
|
Static.brightness_max = 100;
|
||||||
modes.push_back(Static);
|
modes.push_back(Static);
|
||||||
|
|
||||||
SetupZones();
|
SetupZones();
|
||||||
|
|
||||||
for(unsigned int i = 0; i < zones.size(); i++)
|
for(unsigned int i = 0; i < zones.size(); i++)
|
||||||
{
|
{
|
||||||
zones[i].colors[0] = controller->getZoneColor(i);
|
zones[i].colors[0] = controller->getZoneColor(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue