Palit GPU Cleanup - Merge Palit, Gainward, and PNY - V1 and V2
This commit is contained in:
@@ -1,103 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| GainwardGPUControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Gainward GPU |
|
||||
| |
|
||||
| TheRogueZeta 05 Nov 2020 |
|
||||
| KundaPanda 04 Jan 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "DetectionManager.h"
|
||||
#include "GainwardGPUv1Controller.h"
|
||||
#include "GainwardGPUv2Controller.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include "pci_ids.h"
|
||||
#include "RGBController_GainwardGPUv1.h"
|
||||
#include "RGBController_GainwardGPUv2.h"
|
||||
|
||||
bool TestForGainwardGPUController(i2c_smbus_interface* bus, uint8_t i2c_addr)
|
||||
{
|
||||
bool pass = false;
|
||||
|
||||
switch(i2c_addr)
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| V1 Controller |
|
||||
\*-------------------------------------------------*/
|
||||
case 0x08:
|
||||
pass = bus->i2c_smbus_write_quick(i2c_addr, I2C_SMBUS_WRITE);
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| V2 Controller |
|
||||
\*-------------------------------------------------*/
|
||||
case 0x49:
|
||||
/*---------------------------------------------*\
|
||||
| This detection might need some modifications |
|
||||
| Reading 0x6F*0x73 and comparing to 0x64 might |
|
||||
| be a possibility |
|
||||
\*---------------------------------------------*/
|
||||
s32 data = bus->i2c_smbus_read_byte_data(i2c_addr, 0x0);
|
||||
s32 mode_data = bus->i2c_smbus_read_byte_data(i2c_addr, 0xe0);
|
||||
pass = (data == 0x0) && (mode_data < 0x5);
|
||||
break;
|
||||
}
|
||||
|
||||
return(pass);
|
||||
}
|
||||
|
||||
DetectedControllers DetectGainwardGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
if(TestForGainwardGPUController(bus, i2c_addr))
|
||||
{
|
||||
switch(i2c_addr)
|
||||
{
|
||||
/*---------------------------------------------*\
|
||||
| V1 Controller |
|
||||
\*---------------------------------------------*/
|
||||
case 0x08:
|
||||
{
|
||||
GainwardGPUv1Controller* controller = new GainwardGPUv1Controller(bus, i2c_addr, name);
|
||||
RGBController_GainwardGPUv1* rgb_controller = new RGBController_GainwardGPUv1(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
break;
|
||||
|
||||
/*---------------------------------------------*\
|
||||
| V2 Controller |
|
||||
\*---------------------------------------------*/
|
||||
case 0x49:
|
||||
{
|
||||
GainwardGPUv2Controller* controller = new GainwardGPUv2Controller(bus, i2c_addr, name);
|
||||
RGBController_GainwardGPUv2* rgb_controller = new RGBController_GainwardGPUv2(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce GTX 1080 Phoenix", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_GTX1080_DEV, GAINWARD_SUB_VEN, GAINWARD_GTX_1080_PHOENIX, 0x08);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce GTX 1080 Ti Phoenix", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_GTX1080TI_DEV, GAINWARD_SUB_VEN, GAINWARD_GTX_1080TI_PHOENIX, 0x08);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce GTX 1660 SUPER Ghost", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_GTX1660S_DEV, NVIDIA_SUB_VEN, NVIDIA_GTX1660S_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 2070 SUPER Phantom", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX2070S_OC_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 2080 Phoenix GS", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX2080_A_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3060 Pegasus 12G", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_DEV, NVIDIA_SUB_VEN, NVIDIA_RTX3060_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3070 Phantom", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, GAINWARD_SUB_VEN, GAINWARD_RTX_3070_PHANTOM, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3070 Phoenix", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX3070_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3070 Ti Phoenix", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070TI_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX3070TI_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3080 Phoenix", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX3080_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX3080_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3080 Ti Phoenix", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX3080TI_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3090 Phoenix", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX3090_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3090 Ti Phantom", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090TI_DEV, GAINWARD_SUB_VEN, GAINWARD_RTX_3090TI_PHANTOM, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 4080 Phantom GS", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, GAINWARD_SUB_VEN, GAINWARD_RTX_4080_PHANTOM_GS_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 5080 Phoenix", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GAINWARD_SUB_VEN, GAINWARD_RTX_5080_PHOENIX_SUB_DEV, 0x49);
|
||||
@@ -1,78 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| GainwardGPUv1Controller.cpp |
|
||||
| |
|
||||
| Driver for Gainward v1 GPU |
|
||||
| |
|
||||
| TheRogueZeta 05 Nov 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include "GainwardGPUv1Controller.h"
|
||||
|
||||
GainwardGPUv1Controller::GainwardGPUv1Controller(i2c_smbus_interface* bus, gainward_gpu_dev_id dev, std::string dev_name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->name = dev_name;
|
||||
}
|
||||
|
||||
GainwardGPUv1Controller::~GainwardGPUv1Controller()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string GainwardGPUv1Controller::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
return_string.append(addr);
|
||||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string GainwardGPUv1Controller::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
unsigned char GainwardGPUv1Controller::GetLEDRed()
|
||||
{
|
||||
return(GainwardGPURegisterRead(GAINWARD_RED_REGISTER));
|
||||
}
|
||||
|
||||
unsigned char GainwardGPUv1Controller::GetLEDGreen()
|
||||
{
|
||||
return(GainwardGPURegisterRead(GAINWARD_GREEN_REGISTER));
|
||||
}
|
||||
|
||||
unsigned char GainwardGPUv1Controller::GetLEDBlue()
|
||||
{
|
||||
return(GainwardGPURegisterRead(GAINWARD_BLUE_REGISTER));
|
||||
}
|
||||
|
||||
void GainwardGPUv1Controller::SetLEDColors(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
GainwardGPURegisterWrite(GAINWARD_RED_REGISTER, red);
|
||||
GainwardGPURegisterWrite(GAINWARD_GREEN_REGISTER, green);
|
||||
GainwardGPURegisterWrite(GAINWARD_BLUE_REGISTER, blue);
|
||||
GainwardGPURegisterWrite(GAINWARD_06_REGISTER, 0xFF);
|
||||
}
|
||||
|
||||
void GainwardGPUv1Controller::SetMode()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
unsigned char GainwardGPUv1Controller::GainwardGPURegisterRead(unsigned char reg)
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, reg));
|
||||
}
|
||||
|
||||
void GainwardGPUv1Controller::GainwardGPURegisterWrite(unsigned char reg, unsigned char val)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, reg, val);
|
||||
}
|
||||
-115
@@ -1,115 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_GainwardGPUv1.cpp |
|
||||
| |
|
||||
| RGBController for Gainward v1 GPU |
|
||||
| |
|
||||
| TheRogueZeta 05 Nov 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_GainwardGPUv1.h"
|
||||
|
||||
int RGBController_GainwardGPUv1::GetDeviceMode()
|
||||
{
|
||||
active_mode = 1;
|
||||
return(active_mode);
|
||||
}
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Gainward GPU v1
|
||||
@category GPU
|
||||
@type I2C
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :x:
|
||||
@detectors DetectGainwardGPUControllers
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_GainwardGPUv1::RGBController_GainwardGPUv1(GainwardGPUv1Controller* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Gainward";
|
||||
type = DEVICE_TYPE_GPU;
|
||||
description = "Gainward GPU V1 Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 1;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_GainwardGPUv1::~RGBController_GainwardGPUv1()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_GainwardGPUv1::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up zone |
|
||||
\*---------------------------------------------------------*/
|
||||
zone gainward_gpu_zone;
|
||||
gainward_gpu_zone.name = "GPU";
|
||||
gainward_gpu_zone.type = ZONE_TYPE_SINGLE;
|
||||
gainward_gpu_zone.leds_min = 1;
|
||||
gainward_gpu_zone.leds_max = 1;
|
||||
gainward_gpu_zone.leds_count = 1;
|
||||
zones.push_back(gainward_gpu_zone);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up LED |
|
||||
\*---------------------------------------------------------*/
|
||||
led gainward_gpu_led;
|
||||
gainward_gpu_led.name = "GPU";
|
||||
leds.push_back(gainward_gpu_led);
|
||||
|
||||
SetupColors();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Initialize color |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char red = controller->GetLEDRed();
|
||||
unsigned char grn = controller->GetLEDGreen();
|
||||
unsigned char blu = controller->GetLEDBlue();
|
||||
|
||||
colors[0] = ToRGBColor(red, grn, blu);
|
||||
}
|
||||
|
||||
void RGBController_GainwardGPUv1::DeviceUpdateLEDs()
|
||||
{
|
||||
for(std::size_t led = 0; led < colors.size(); led++)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(colors[led]);
|
||||
unsigned char grn = RGBGetGValue(colors[led]);
|
||||
unsigned char blu = RGBGetBValue(colors[led]);
|
||||
|
||||
controller->SetLEDColors(red, grn, blu);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_GainwardGPUv1::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_GainwardGPUv1::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_GainwardGPUv1::DeviceUpdateMode()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| GainwardGPUv2Controller.cpp |
|
||||
| |
|
||||
| Driver for Gainward v2 GPU |
|
||||
| |
|
||||
| KundaPanda 04 Jan 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include "GainwardGPUv2Controller.h"
|
||||
|
||||
GainwardGPUv2Controller::GainwardGPUv2Controller(i2c_smbus_interface* bus, gainward_gpu_dev_id dev, std::string dev_name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->name = dev_name;
|
||||
}
|
||||
|
||||
GainwardGPUv2Controller::~GainwardGPUv2Controller() = default;
|
||||
|
||||
std::string GainwardGPUv2Controller::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
return_string.append(addr);
|
||||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string GainwardGPUv2Controller::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
unsigned char GainwardGPUv2Controller::GetLEDRed()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, GAINWARD_V2_RED_REGISTER));
|
||||
}
|
||||
|
||||
unsigned char GainwardGPUv2Controller::GetLEDGreen()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, GAINWARD_V2_GREEN_REGISTER));
|
||||
}
|
||||
|
||||
unsigned char GainwardGPUv2Controller::GetLEDBlue()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, GAINWARD_V2_BLUE_REGISTER));
|
||||
}
|
||||
|
||||
void GainwardGPUv2Controller::SetLEDColors(unsigned char red, unsigned char green, unsigned char blue, unsigned char color_register)
|
||||
{
|
||||
switch (color_register)
|
||||
{
|
||||
default:
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_RED_REGISTER, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_GREEN_REGISTER, green);
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_BLUE_REGISTER, blue);
|
||||
break;
|
||||
case GAINWARD_V2_COLOR_REGISTER_SECONDARY:
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_RED_SECONDARY_REGISTER, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_GREEN_SECONDARY_REGISTER, green);
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_BLUE_SECONDARY_REGISTER, blue);
|
||||
break;
|
||||
case GAINWARD_V2_COLOR_REGISTER_TERTIARY:
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_RED_TERTIARY_REGISTER, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_GREEN_TERTIARY_REGISTER, green);
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_BLUE_TERTIARY_REGISTER, blue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GainwardGPUv2Controller::SetMode(unsigned char mode, unsigned char speed, unsigned char static_mode)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_MODE_REGISTER, mode);
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_STATIC_CONTROL_REGISTER, static_mode);
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_SPEED_REGISTER, speed);
|
||||
}
|
||||
|
||||
void GainwardGPUv2Controller::SetDirection(unsigned char direction)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_MODE_DIRECTION_REGISTER, direction);
|
||||
}
|
||||
|
||||
void GainwardGPUv2Controller::SetBreathingSpeed(unsigned int speed)
|
||||
{
|
||||
unsigned char lower = speed & 0xFF;
|
||||
unsigned char upper = (speed >> 2 * 4) & 0xFF;
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_BREATHE_SPEED_REGISTER_A, lower);
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_BREATHE_SPEED_SECONDARY_REGISTER_A, lower);
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_BREATHE_SPEED_REGISTER_B, upper);
|
||||
bus->i2c_smbus_write_byte_data(dev, GAINWARD_V2_BREATHE_SPEED_SECONDARY_REGISTER_B, upper);
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| GainwardGPUv2Controller.h |
|
||||
| |
|
||||
| Driver for Gainward v2 GPU |
|
||||
| |
|
||||
| KundaPanda 04 Jan 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
typedef unsigned char gainward_gpu_dev_id;
|
||||
|
||||
/*---------------------------------------------------------------------------------*\
|
||||
| Newer Gainward models seem to use addresses very similar to those used by EVGA |
|
||||
\*-------------------------------------------------------------------------------**/
|
||||
|
||||
enum
|
||||
{
|
||||
/* RGB Registers */
|
||||
GAINWARD_V2_RED_REGISTER = 0x6C, /* Red Register */
|
||||
GAINWARD_V2_GREEN_REGISTER = 0x6D, /* Green Register */
|
||||
GAINWARD_V2_BLUE_REGISTER = 0x6E, /* Blue Register */
|
||||
GAINWARD_V2_RED_SECONDARY_REGISTER = 0x70, /* Red Register 2 */
|
||||
GAINWARD_V2_GREEN_SECONDARY_REGISTER = 0x71, /* Green Register 2 */
|
||||
GAINWARD_V2_BLUE_SECONDARY_REGISTER = 0x72, /* Blue Register 2 */
|
||||
GAINWARD_V2_RED_TERTIARY_REGISTER = 0xE4, /* Red Register 3 */
|
||||
GAINWARD_V2_GREEN_TERTIARY_REGISTER = 0xE5, /* Green Register 3 */
|
||||
GAINWARD_V2_BLUE_TERTIARY_REGISTER = 0xE6, /* Blue Register 3 */
|
||||
GAINWARD_V2_MODE_REGISTER = 0xE0, /* Mode Register */
|
||||
/* Direct mode switch register
|
||||
* 0x1 Software control
|
||||
* 0x22 Breathing */
|
||||
GAINWARD_V2_STATIC_CONTROL_REGISTER = 0x60,
|
||||
GAINWARD_V2_BREATHE_SPEED_REGISTER_A = 0x62, /* Lower part of speed control for breathe effect */
|
||||
GAINWARD_V2_BREATHE_SPEED_REGISTER_B = 0x63, /* Upper part of speed control for breathe effect */
|
||||
GAINWARD_V2_BREATHE_SPEED_SECONDARY_REGISTER_A = 0x64, /* Lower part of speed control for breathe effect - prob. secondary color */
|
||||
GAINWARD_V2_BREATHE_SPEED_SECONDARY_REGISTER_B = 0x65, /* Upper part of speed control for breathe effect - prob. secondary color */
|
||||
/* Mode direction Register
|
||||
* 0x0
|
||||
* 0x1 */
|
||||
GAINWARD_V2_MODE_DIRECTION_REGISTER = 0xE1,
|
||||
/* Mode speed Register
|
||||
* 0x0 MAX
|
||||
* 0xF MIN */
|
||||
GAINWARD_V2_SPEED_REGISTER = 0xE2,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
/* Manual color selection using primary registers */
|
||||
GAINWARD_V2_MODE_STATIC = 0x00,
|
||||
/* Rainbow cycling with direction and speed controls */
|
||||
GAINWARD_V2_MODE_CYCLE = 0x01,
|
||||
/* One strobing color running around the fan
|
||||
* Color using primary registers, direction and speed control */
|
||||
GAINWARD_V2_MODE_STROBE = 0x02,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
GAINWARD_V2_COLOR_REGISTER_PRIMARY,
|
||||
GAINWARD_V2_COLOR_REGISTER_SECONDARY,
|
||||
GAINWARD_V2_COLOR_REGISTER_TERTIARY,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
/* Software controlled direct mode */
|
||||
GAINWARD_V2_STATIC_SOFTWARE = 0x01,
|
||||
/* GPU controlled direct mode with breathing effect */
|
||||
GAINWARD_V2_STATIC_BREATHING = 0x22,
|
||||
};
|
||||
|
||||
class GainwardGPUv2Controller
|
||||
{
|
||||
public:
|
||||
GainwardGPUv2Controller(i2c_smbus_interface* bus, gainward_gpu_dev_id, std::string dev_name);
|
||||
~GainwardGPUv2Controller();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
|
||||
unsigned char GetLEDRed();
|
||||
unsigned char GetLEDGreen();
|
||||
unsigned char GetLEDBlue();
|
||||
void SetLEDColors(unsigned char red, unsigned char green, unsigned char blue, unsigned char color_register = GAINWARD_V2_COLOR_REGISTER_PRIMARY);
|
||||
void SetMode(unsigned char mode, unsigned char speed, unsigned char direct_mode = GAINWARD_V2_STATIC_SOFTWARE);
|
||||
void SetBreathingSpeed(unsigned int speed);
|
||||
void SetDirection(unsigned char direction);
|
||||
|
||||
private:
|
||||
i2c_smbus_interface * bus;
|
||||
gainward_gpu_dev_id dev;
|
||||
std::string name;
|
||||
};
|
||||
-187
@@ -1,187 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_GainwardGPUv2.cpp |
|
||||
| |
|
||||
| RGBController for Gainward v2 GPU |
|
||||
| |
|
||||
| KundaPanda 04 Jan 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_GainwardGPUv2.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Gainward GPU v2
|
||||
@category GPU
|
||||
@type I2C
|
||||
@save :x:
|
||||
@direct :x:
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectGainwardGPUControllers
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_GainwardGPUv2::RGBController_GainwardGPUv2(GainwardGPUv2Controller* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Gainward";
|
||||
type = DEVICE_TYPE_GPU;
|
||||
description = "Gainward GPU V2 Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = GAINWARD_V2_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Static.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Breathe;
|
||||
Breathe.name = "Breathing";
|
||||
Breathe.value = GAINWARD_V2_MODE_STATIC;
|
||||
Breathe.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Breathe.speed_max = 0x000a;
|
||||
Breathe.speed_min = 0x1324;
|
||||
Breathe.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathe.colors_min = 2;
|
||||
Breathe.colors_max = 2;
|
||||
Breathe.colors.resize(2);
|
||||
modes.push_back(Breathe);
|
||||
|
||||
mode RainbowWave;
|
||||
RainbowWave.name = "Rainbow Wave";
|
||||
RainbowWave.value = GAINWARD_V2_MODE_CYCLE;
|
||||
RainbowWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR;
|
||||
RainbowWave.speed_max = 0x0;
|
||||
RainbowWave.speed_min = 0xF;
|
||||
RainbowWave.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(RainbowWave);
|
||||
|
||||
mode Strobe;
|
||||
Strobe.name = "Strobe";
|
||||
Strobe.value = GAINWARD_V2_MODE_STROBE;
|
||||
Strobe.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Strobe.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Strobe.colors_min = 1;
|
||||
Strobe.colors_max = 1;
|
||||
Strobe.colors.resize(1);
|
||||
Strobe.speed_max = 0x0;
|
||||
Strobe.speed_min = 0xF;
|
||||
modes.push_back(Strobe);
|
||||
|
||||
SetupZones();
|
||||
|
||||
/*-------------------------*\
|
||||
| Initialize active mode |
|
||||
\*-------------------------*/
|
||||
active_mode = 0;
|
||||
}
|
||||
|
||||
RGBController_GainwardGPUv2::~RGBController_GainwardGPUv2()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_GainwardGPUv2::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up zone |
|
||||
\*---------------------------------------------------------*/
|
||||
zone gainward_gpu_zone;
|
||||
gainward_gpu_zone.name = "GPU";
|
||||
gainward_gpu_zone.type = ZONE_TYPE_SINGLE;
|
||||
gainward_gpu_zone.leds_min = 1;
|
||||
gainward_gpu_zone.leds_max = 1;
|
||||
gainward_gpu_zone.leds_count = 1;
|
||||
zones.push_back(gainward_gpu_zone);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up LED |
|
||||
\*---------------------------------------------------------*/
|
||||
led gainward_gpu_led;
|
||||
gainward_gpu_led.name = "GPU";
|
||||
leds.push_back(gainward_gpu_led);
|
||||
|
||||
SetupColors();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Initialize color |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char red = controller->GetLEDRed();
|
||||
unsigned char grn = controller->GetLEDGreen();
|
||||
unsigned char blu = controller->GetLEDBlue();
|
||||
|
||||
colors[0] = ToRGBColor(red, grn, blu);
|
||||
}
|
||||
|
||||
void RGBController_GainwardGPUv2::DeviceUpdateLEDs()
|
||||
{
|
||||
for(unsigned int color : colors)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
|
||||
controller->SetLEDColors(red, grn, blu);
|
||||
controller->SetMode(GAINWARD_V2_MODE_STATIC, 0x2);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_GainwardGPUv2::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_GainwardGPUv2::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_GainwardGPUv2::DeviceUpdateMode()
|
||||
{
|
||||
mode current_mode = modes[(unsigned int)active_mode];
|
||||
switch (active_mode)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
controller->SetBreathingSpeed(current_mode.speed);
|
||||
|
||||
unsigned char r1 = RGBGetRValue(current_mode.colors[0]);
|
||||
unsigned char g1 = RGBGetGValue(current_mode.colors[0]);
|
||||
unsigned char b1 = RGBGetBValue(current_mode.colors[0]);
|
||||
controller->SetLEDColors(r1, g1, b1);
|
||||
|
||||
unsigned char r2 = RGBGetRValue(current_mode.colors[1]);
|
||||
unsigned char g2 = RGBGetGValue(current_mode.colors[1]);
|
||||
unsigned char b2 = RGBGetBValue(current_mode.colors[1]);
|
||||
controller->SetLEDColors(r2, g2, b2, GAINWARD_V2_COLOR_REGISTER_SECONDARY);
|
||||
controller->SetMode(GAINWARD_V2_MODE_STATIC, 0x2, GAINWARD_V2_STATIC_BREATHING);
|
||||
}
|
||||
break;
|
||||
|
||||
/*---------------------------------------------*\
|
||||
| Case 3 intentionally falls through to case 2 |
|
||||
\*---------------------------------------------*/
|
||||
case 3:
|
||||
{
|
||||
unsigned char r = RGBGetRValue(current_mode.colors[0]);
|
||||
unsigned char g = RGBGetGValue(current_mode.colors[0]);
|
||||
unsigned char b = RGBGetBValue(current_mode.colors[0]);
|
||||
controller->SetLEDColors(r, g, b, GAINWARD_V2_COLOR_REGISTER_TERTIARY);
|
||||
}
|
||||
|
||||
case 2:
|
||||
controller->SetMode((unsigned char)(current_mode.value), (unsigned char)(current_mode.speed));
|
||||
controller->SetDirection(current_mode.direction);
|
||||
break;
|
||||
|
||||
default:
|
||||
controller->SetMode((unsigned char)(current_mode.value), (unsigned char)(current_mode.speed));
|
||||
break;
|
||||
}
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_GainwardGPUv2.h |
|
||||
| |
|
||||
| RGBController for Gainward v2 GPU |
|
||||
| |
|
||||
| KundaPanda 04 Jan 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "GainwardGPUv2Controller.h"
|
||||
|
||||
class RGBController_GainwardGPUv2 : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_GainwardGPUv2(GainwardGPUv2Controller* controller_ptr);
|
||||
~RGBController_GainwardGPUv2();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
GainwardGPUv2Controller* controller;
|
||||
};
|
||||
@@ -1,112 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| PNYGPUController.cpp |
|
||||
| |
|
||||
| Driver for PNY Turing GPU |
|
||||
| |
|
||||
| KendallMorgan 17 Oct 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "PNYGPUController.h"
|
||||
|
||||
PNYGPUController::PNYGPUController(i2c_smbus_interface* bus, pny_dev_id dev, std::string name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->name = name;
|
||||
}
|
||||
|
||||
PNYGPUController::~PNYGPUController()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string PNYGPUController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string PNYGPUController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
return_string.append(addr);
|
||||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
void PNYGPUController::WriteI2CData(u8 command, u8 length, u8* data)
|
||||
{
|
||||
//Simulating i2c_smbus_write_i2c_block_data(command, length, data);
|
||||
for (u8 i = 0; i < length; i++)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, command+i, data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char PNYGPUController::GetMode()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, PNY_GPU_MODE_OFF));
|
||||
}
|
||||
|
||||
unsigned char PNYGPUController::GetRed()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, PNY_GPU_REG_COLOR_RED));
|
||||
}
|
||||
|
||||
unsigned char PNYGPUController::GetGreen()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, PNY_GPU_REG_COLOR_GREEN));
|
||||
}
|
||||
|
||||
unsigned char PNYGPUController::GetBlue()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, PNY_GPU_REG_COLOR_BLUE));
|
||||
}
|
||||
|
||||
void PNYGPUController::SetOff()
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, PNY_GPU_REG_CONTROL, 0);
|
||||
bus->i2c_smbus_write_byte_data(dev, PNY_GPU_REG_MODE, 0x00);
|
||||
}
|
||||
|
||||
void PNYGPUController::SetCycle(unsigned char speed)
|
||||
{
|
||||
u8 loop[] = {
|
||||
0x01, // Direction
|
||||
0x00, // ??
|
||||
speed, // Speed
|
||||
0x1F // Somehow related to speed
|
||||
};
|
||||
loop[2] = speed;
|
||||
WriteI2CData(PNY_GPU_REG_CONTROL, sizeof(loop), loop);
|
||||
}
|
||||
|
||||
void PNYGPUController::SetStrobe(unsigned char r, unsigned char g, unsigned char b, unsigned char speed, unsigned char brightness)
|
||||
{
|
||||
u8 strobe[] = {
|
||||
0x02, // Strobe
|
||||
0x00, // Rise speed
|
||||
speed, // Cycle length/2
|
||||
0x00, // Off delay
|
||||
r, // R
|
||||
g, // G
|
||||
b, // B
|
||||
brightness, // Peak brightness
|
||||
0x05 // Fade speed
|
||||
};
|
||||
WriteI2CData(PNY_GPU_REG_CONTROL, sizeof(strobe), strobe);
|
||||
}
|
||||
|
||||
void PNYGPUController::SetDirect(unsigned char red, unsigned char green, unsigned char blue, unsigned char brightness)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, PNY_GPU_REG_CONTROL, 0);
|
||||
bus->i2c_smbus_write_byte_data(dev, PNY_GPU_REG_MODE, 0x01);
|
||||
bus->i2c_smbus_write_byte_data(dev, PNY_GPU_REG_COLOR_RED, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, PNY_GPU_REG_COLOR_BLUE, blue);
|
||||
bus->i2c_smbus_write_byte_data(dev, PNY_GPU_REG_COLOR_GREEN, green);
|
||||
bus->i2c_smbus_write_byte_data(dev, PNY_GPU_REG_COLOR_BRIGHTNESS, brightness);
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| PNYGPUController.h |
|
||||
| |
|
||||
| Driver for PNY Turing GPU |
|
||||
| |
|
||||
| KendallMorgan 17 Oct 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
typedef unsigned char pny_dev_id;
|
||||
|
||||
enum
|
||||
{
|
||||
PNY_GPU_REG_CONTROL = 0xE0,
|
||||
PNY_GPU_REG_MODE = 0x60,
|
||||
PNY_GPU_REG_COLOR_RED = 0x6C,
|
||||
PNY_GPU_REG_COLOR_GREEN = 0x6D,
|
||||
PNY_GPU_REG_COLOR_BLUE = 0x6E,
|
||||
PNY_GPU_REG_COLOR_BRIGHTNESS = 0x6F,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PNY_GPU_MODE_OFF = 0x00,
|
||||
PNY_GPU_MODE_DIRECT = 0x01,
|
||||
PNY_GPU_MODE_CYCLE = 0x02,
|
||||
PNY_GPU_MODE_STROBE = 0x03,
|
||||
};
|
||||
|
||||
class PNYGPUController
|
||||
{
|
||||
public:
|
||||
PNYGPUController(i2c_smbus_interface* bus, pny_dev_id dev, std::string name);
|
||||
~PNYGPUController();
|
||||
|
||||
std::string GetDeviceName();
|
||||
std::string GetDeviceLocation();
|
||||
|
||||
void SetOff();
|
||||
void SetCycle(unsigned char speed);
|
||||
void SetStrobe(unsigned char r, unsigned char g, unsigned char b, unsigned char speed, unsigned char brightness);
|
||||
void SetDirect(unsigned char red, unsigned char green, unsigned char blue, unsigned char brightness);
|
||||
|
||||
private:
|
||||
i2c_smbus_interface* bus;
|
||||
pny_dev_id dev;
|
||||
std::string name;
|
||||
|
||||
void WriteI2CData(u8 command, u8 length, u8* data);
|
||||
unsigned char GetMode();
|
||||
unsigned char GetRed();
|
||||
unsigned char GetGreen();
|
||||
unsigned char GetBlue();
|
||||
|
||||
};
|
||||
@@ -1,76 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| PNYGPUControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for PNY Turing GPU |
|
||||
| |
|
||||
| KendallMorgan 17 Oct 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "DetectionManager.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include "pci_ids.h"
|
||||
#include "PNYGPUController.h"
|
||||
#include "RGBController_PNYGPU.h"
|
||||
|
||||
DetectedControllers DetectPNYGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
if(bus->info.port_id == 1)
|
||||
{
|
||||
PNYGPUController* controller = new PNYGPUController(bus, i2c_addr, name);
|
||||
RGBController_PNYGPU* rgb_controller = new RGBController_PNYGPU(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 2060 XLR8 OC EDITION", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX2060_TU104_DEV, PNY_SUB_VEN, PNY_RTX_2060_XLR8_OC_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3060 XLR8 Revel EPIC-X", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_DEV, PNY_SUB_VEN, PNY_RTX_3060_XLR8_REVEL_EPIC_X_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3070 XLR8 Revel EPIC-X", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, PNY_SUB_VEN, PNY_RTX_3070_XLR8_REVEL_EPIC_X_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3070 XLR8 Revel EPIC-X LHR", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_LHR_DEV, PNY_SUB_VEN, PNY_RTX_3070_XLR8_REVEL_EPIC_X_LHR_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3080 XLR8 Revel EPIC-X", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3080_DEV, PNY_SUB_VEN, PNY_RTX_3080_XLR8_REVEL_EPIC_X_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3080 Ti XLR8 Revel EPIC-X", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, PNY_SUB_VEN, PNY_RTX_3080TI_XLR8_REVEL_EPIC_X_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3090 XLR8 Revel EPIC-X", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, PNY_SUB_VEN, PNY_RTX_3090_XLR8_REVEL_EPIC_X_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 2070 SUPER Jetstream", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, NVIDIA_SUB_VEN, NVIDIA_RTX2070S_OC_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3060", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_DEV, PALIT_SUB_VEN, PALIT_RTX3060_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3060 LHR", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, PALIT_SUB_VEN, PALIT_RTX3060_LHR_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3060 Ti", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_DEV, PALIT_SUB_VEN, PALIT_RTX3060TI_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3060 Ti LHR", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, PALIT_SUB_VEN, NVIDIA_RTX3060TI_LHR_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3060 Ti Dual", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_DEV, NVIDIA_SUB_VEN, PALIT_RTX3060TI_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3070", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, PALIT_SUB_VEN, PALIT_RTX3070_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3070 LHR", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_LHR_DEV, PALIT_SUB_VEN, PALIT_RTX3070_LHR_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3070 Gamerock LHR", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070_LHR_DEV, PALIT_SUB_VEN, PALIT_RTX3070_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3070 Ti", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070TI_DEV, PALIT_SUB_VEN, PALIT_RTX3070TI_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3070 Ti GamingPro", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3070TI_DEV, PALIT_SUB_VEN, PALIT_RTX3070TI_GAMING_PRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3080", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3080_DEV, PALIT_SUB_VEN, PALIT_RTX3080_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3080 LHR", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3080_LHR_DEV, PALIT_SUB_VEN, PALIT_RTX3080_LHR_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3080 Gamerock", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3080_DEV, PALIT_SUB_VEN, PALIT_RTX3080_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3080 Gamerock LHR", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3080_LHR_DEV, PALIT_SUB_VEN, PALIT_RTX3080_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3080 12GB GamingPro", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3080_12G_LHR_DEV, PALIT_SUB_VEN, PALIT_RTX3080_GAMINGPRO_12G_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3080 Ti", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, PALIT_SUB_VEN, PALIT_RTX3080TI_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3080 Ti Gamerock", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, PALIT_SUB_VEN, PALIT_RTX3080TI_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3090", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, PALIT_SUB_VEN, PALIT_RTX3090_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3090 Gamerock", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, PALIT_SUB_VEN, PALIT_RTX3090_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3090 Ti Gamerock", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090TI_DEV, PALIT_SUB_VEN, PALIT_RTX3090TI_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 4070 Ti", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070TI_DEV, PALIT_SUB_VEN, PALIT_RTX4070TI_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 4070 Ti Gamerock", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070TI_DEV, PALIT_SUB_VEN, PALIT_RTX4070TI_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 4070 Ti SUPER GamingPro", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070TIS_DEV, PALIT_SUB_VEN, PALIT_RTX4080_GAMINGPRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 4080 GamingPro", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, PALIT_SUB_VEN, PALIT_RTX4080_GAMINGPRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 4080 SUPER GamingPro", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080S_DEV, PALIT_SUB_VEN, PALIT_RTX4080_GAMINGPRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 4090 Gamerock", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, PALIT_SUB_VEN, PALIT_RTX4090_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5060 Ti White OC 16GB", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, PALIT_SUB_VEN, PALIT_RTX5060TI_WHITE_OC_16G_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5070 GamingPro", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, PALIT_SUB_VEN, PALIT_RTX5070_GAMINGPRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5070 Ti GameRock", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, PALIT_SUB_VEN, PALIT_RTX5070TI_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5070 Ti GamingPro", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, PALIT_SUB_VEN, PALIT_RTX5070TI_GAMINGPRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5070 Ti GamingPro-S", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, PALIT_SUB_VEN, PALIT_RTX5070TI_GAMINGPRO_S_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5080 GameRock", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, PALIT_SUB_VEN, PALIT_RTX5080_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5080 GamingPro", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, PALIT_SUB_VEN, PALIT_RTX5080_GAMINGPRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5090 Gamerock", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, PALIT_SUB_VEN, PALIT_RTX5090_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("NVIDIA GeForce RTX 2060 SUPER", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX2060_TU106_DEV, NVIDIA_SUB_VEN, NVIDIA_RTX2060_TU106_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("NVIDIA GeForce RTX 2080 SUPER", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX2080S_DEV, NVIDIA_SUB_VEN, NVIDIA_RTX2080S_DEV, 0x49);
|
||||
@@ -1,161 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_PNYGPU.cpp |
|
||||
| |
|
||||
| RGBController for PNY Turing GPU |
|
||||
| |
|
||||
| KendallMorgan 17 Oct 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_PNYGPU.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name PNY GPU
|
||||
@category GPU
|
||||
@type I2C
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectPNYGPUControllers
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_PNYGPU::RGBController_PNYGPU(PNYGPUController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = name.substr(0, name.find(' '));
|
||||
description = "PNY/Palit RGB GPU Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
type = DEVICE_TYPE_GPU;
|
||||
|
||||
mode Off;
|
||||
Off.name = "Off";
|
||||
Off.value = PNY_GPU_MODE_OFF;
|
||||
Off.flags = 0;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Off);
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = PNY_GPU_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR| MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Direct.brightness = 255;
|
||||
Direct.brightness_min = 0;
|
||||
Direct.brightness_max = 100;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Cycle;
|
||||
Cycle.name = "Cycle";
|
||||
Cycle.value = PNY_GPU_MODE_CYCLE;
|
||||
Cycle.flags = MODE_FLAG_HAS_SPEED;
|
||||
Cycle.speed = 3;
|
||||
Cycle.speed_max = 0;
|
||||
Cycle.speed_max = 100;
|
||||
Cycle.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Cycle);
|
||||
|
||||
mode Strobe;
|
||||
Strobe.name = "Strobe";
|
||||
Strobe.value = PNY_GPU_MODE_STROBE;
|
||||
Strobe.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Strobe.speed = 2;
|
||||
Strobe.speed_max = 0;
|
||||
Strobe.speed_max = 255;
|
||||
Strobe.brightness = 255;
|
||||
Strobe.brightness_min = 0;
|
||||
Strobe.brightness_max = 100;
|
||||
Strobe.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Strobe);
|
||||
|
||||
|
||||
SetupZones();
|
||||
|
||||
// Initialize active mode
|
||||
active_mode = 0;
|
||||
}
|
||||
|
||||
RGBController_PNYGPU::~RGBController_PNYGPU()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_PNYGPU::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device only has one LED, so create a single zone and |
|
||||
| LED for it |
|
||||
\*---------------------------------------------------------*/
|
||||
zone* new_zone = new zone();
|
||||
led* new_led = new led();
|
||||
|
||||
new_zone->name = "GPU Zone";
|
||||
new_zone->type = ZONE_TYPE_SINGLE;
|
||||
new_zone->leds_min = 1;
|
||||
new_zone->leds_max = 1;
|
||||
new_zone->leds_count = 1;
|
||||
|
||||
new_led->name = "GPU LED";
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Push the zone and LED on to device vectors |
|
||||
\*---------------------------------------------------------*/
|
||||
leds.push_back(*new_led);
|
||||
zones.push_back(*new_zone);
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_PNYGPU::DeviceUpdateLEDs()
|
||||
{
|
||||
DeviceUpdateMode();
|
||||
}
|
||||
|
||||
void RGBController_PNYGPU::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_PNYGPU::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_PNYGPU::DeviceUpdateMode()
|
||||
{
|
||||
RGBColor color = colors[0];
|
||||
unsigned char r = RGBGetRValue(color);
|
||||
unsigned char g = RGBGetGValue(color);
|
||||
unsigned char b = RGBGetBValue(color);
|
||||
unsigned char speed, brightness;
|
||||
switch(modes[active_mode].value)
|
||||
{
|
||||
case PNY_GPU_MODE_OFF:
|
||||
controller->SetOff();
|
||||
break;
|
||||
|
||||
case PNY_GPU_MODE_DIRECT:
|
||||
brightness = modes[active_mode].brightness;
|
||||
controller->SetDirect(r, g, b, brightness);
|
||||
break;
|
||||
|
||||
case PNY_GPU_MODE_CYCLE:
|
||||
speed = modes[active_mode].speed;
|
||||
controller->SetCycle(speed);
|
||||
break;
|
||||
|
||||
case PNY_GPU_MODE_STROBE:
|
||||
speed = modes[active_mode].speed;
|
||||
brightness = modes[active_mode].brightness;
|
||||
controller->SetStrobe(r, g, b, speed, brightness);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| PalitGPUController.cpp |
|
||||
| |
|
||||
| Driver for Palit GPU |
|
||||
| |
|
||||
| Manatsawin Hanmongkolchai 11 Apr 2023 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "PalitGPUController.h"
|
||||
|
||||
PalitGPUController::PalitGPUController(i2c_smbus_interface* bus, palit_dev_id dev, std::string dev_name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->name = dev_name;
|
||||
}
|
||||
|
||||
PalitGPUController::~PalitGPUController()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string PalitGPUController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
return_string.append(addr);
|
||||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string PalitGPUController::GetName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
void PalitGPUController::SetDirect(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
// NvAPI_I2CWriteEx: Dev: 0x08 RegSize: 0x01 Reg: 0x03 Size: 0x04 Data: 0xFF 0x00 0x00 0xFF
|
||||
uint8_t values[] = {red, green, blue, 0xFF};
|
||||
bus->i2c_smbus_write_i2c_block_data(dev, PALIT_GPU_REG_LED, sizeof(values), values);
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| PalitGPUController.h |
|
||||
| |
|
||||
| Driver for Palit GPU |
|
||||
| |
|
||||
| Manatsawin Hanmongkolchai 11 Apr 2023 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
typedef unsigned char palit_dev_id;
|
||||
|
||||
enum
|
||||
{
|
||||
PALIT_GPU_MODE_DIRECT = 0x00,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PALIT_GPU_REG_LED = 0x03,
|
||||
};
|
||||
|
||||
class PalitGPUController
|
||||
{
|
||||
public:
|
||||
PalitGPUController(i2c_smbus_interface* bus, palit_dev_id dev, std::string dev_name);
|
||||
~PalitGPUController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetName();
|
||||
|
||||
void SetDirect(unsigned char red, unsigned char green, unsigned char blue);
|
||||
|
||||
private:
|
||||
i2c_smbus_interface* bus;
|
||||
palit_dev_id dev;
|
||||
std::string name;
|
||||
};
|
||||
@@ -4,6 +4,9 @@
|
||||
| Detector for Palit GPU |
|
||||
| |
|
||||
| Manatsawin Hanmongkolchai 11 Apr 2023 |
|
||||
| TheRogueZeta 05 Nov 2020 |
|
||||
| KundaPanda 04 Jan 2021 |
|
||||
| KendallMorgan 17 Oct 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
@@ -13,46 +16,144 @@
|
||||
#include <stdlib.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include "PalitGPUController.h"
|
||||
#include "PalitGPUv1Controller.h"
|
||||
#include "PalitGPUv2Controller.h"
|
||||
#include "pci_ids.h"
|
||||
#include "RGBController_PalitGPU.h"
|
||||
#include "RGBController_PalitGPUv1.h"
|
||||
#include "RGBController_PalitGPUv2.h"
|
||||
|
||||
DetectedControllers DetectPalitGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, const std::string& name)
|
||||
bool TestForPalitGPUv1Controller(i2c_smbus_interface* bus, uint8_t i2c_addr)
|
||||
{
|
||||
bool pass = false;
|
||||
|
||||
switch(i2c_addr)
|
||||
{
|
||||
case 0x08:
|
||||
pass = bus->i2c_smbus_write_quick(i2c_addr, I2C_SMBUS_WRITE);
|
||||
break;
|
||||
}
|
||||
|
||||
return(pass);
|
||||
}
|
||||
|
||||
bool TestForPalitGPUv2Controller(i2c_smbus_interface* bus, uint8_t i2c_addr)
|
||||
{
|
||||
bool pass = false;
|
||||
|
||||
switch(i2c_addr)
|
||||
{
|
||||
case 0x49:
|
||||
s32 data = bus->i2c_smbus_read_byte_data(i2c_addr, 0x0);
|
||||
s32 mode_data = bus->i2c_smbus_read_byte_data(i2c_addr, 0xe0);
|
||||
pass = (data == 0x0) && (mode_data < 0x5);
|
||||
break;
|
||||
}
|
||||
|
||||
return(pass);
|
||||
}
|
||||
|
||||
DetectedControllers DetectPalitGPUv1Controllers(i2c_smbus_interface* bus, uint8_t i2c_addr, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
if(bus->info.port_id == 1)
|
||||
if(TestForPalitGPUv1Controller(bus, i2c_addr))
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Check for PALIT string |
|
||||
\*-----------------------------------------------------*/
|
||||
const uint8_t palit[] = {'P', 'A', 'L', 'I', 'T'};
|
||||
bool match = true;
|
||||
PalitGPUv1Controller* controller = new PalitGPUv1Controller(bus, i2c_addr, name);
|
||||
RGBController_PalitGPUv1* rgb_controller = new RGBController_PalitGPUv1(controller);
|
||||
|
||||
for(size_t i = 0; i < sizeof(palit); i++)
|
||||
{
|
||||
int32_t letter = bus->i2c_smbus_read_byte_data(i2c_addr, 0x07 + (u8)i);
|
||||
|
||||
if(palit[i] != letter)
|
||||
{
|
||||
match = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(match)
|
||||
{
|
||||
PalitGPUController* controller = new PalitGPUController(bus, i2c_addr, name);
|
||||
RGBController_PalitGPU* rgb_controller = new RGBController_PalitGPU(controller);
|
||||
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce GTX 1060", DetectPalitGPUControllers, NVIDIA_VEN, NVIDIA_GTX1060_DEV, NVIDIA_SUB_VEN, NVIDIA_GTX1060_DEV, 0x08);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce GTX 1070", DetectPalitGPUControllers, NVIDIA_VEN, NVIDIA_GTX1070_DEV, NVIDIA_SUB_VEN, NVIDIA_GTX1070_DEV, 0x08);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce GTX 1070 Ti", DetectPalitGPUControllers, NVIDIA_VEN, NVIDIA_GTX1070TI_DEV, NVIDIA_SUB_VEN, NVIDIA_GTX1070TI_DEV, 0x08);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce GTX 1080", DetectPalitGPUControllers, NVIDIA_VEN, NVIDIA_GTX1080_DEV, NVIDIA_SUB_VEN, NVIDIA_GTX1080_DEV, 0x08);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce GTX 1080 Ti", DetectPalitGPUControllers, NVIDIA_VEN, NVIDIA_GTX1080TI_DEV, NVIDIA_SUB_VEN, NVIDIA_GTX1080TI_DEV, 0x08);
|
||||
DetectedControllers DetectPalitGPUv2Controllers(i2c_smbus_interface* bus, uint8_t i2c_addr, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
if(TestForPalitGPUv2Controller(bus, i2c_addr))
|
||||
{
|
||||
PalitGPUv2Controller* controller = new PalitGPUv2Controller(bus, i2c_addr, name);
|
||||
RGBController_PalitGPUv2* rgb_controller = new RGBController_PalitGPUv2(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Register detectors for Palit GPU controllers |
|
||||
| Uses the unified PalitGPUv1Controllers for all V1 protocol|
|
||||
| devices ( Gainward and Palit branded) |
|
||||
\*---------------------------------------------------------*/
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce GTX 1060", DetectPalitGPUv1Controllers, NVIDIA_VEN, NVIDIA_GTX1060_DEV, NVIDIA_SUB_VEN, NVIDIA_GTX1060_DEV, 0x08);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce GTX 1070", DetectPalitGPUv1Controllers, NVIDIA_VEN, NVIDIA_GTX1070_DEV, NVIDIA_SUB_VEN, NVIDIA_GTX1070_DEV, 0x08);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce GTX 1070 Ti", DetectPalitGPUv1Controllers, NVIDIA_VEN, NVIDIA_GTX1070TI_DEV, NVIDIA_SUB_VEN, NVIDIA_GTX1070TI_DEV, 0x08);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce GTX 1080", DetectPalitGPUv1Controllers, NVIDIA_VEN, NVIDIA_GTX1080_DEV, NVIDIA_SUB_VEN, NVIDIA_GTX1080_DEV, 0x08);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce GTX 1080 Ti", DetectPalitGPUv1Controllers, NVIDIA_VEN, NVIDIA_GTX1080TI_DEV, NVIDIA_SUB_VEN, NVIDIA_GTX1080TI_DEV, 0x08);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce GTX 1080 Phoenix", DetectPalitGPUv1Controllers, NVIDIA_VEN, NVIDIA_GTX1080_DEV, GAINWARD_SUB_VEN, GAINWARD_GTX_1080_PHOENIX, 0x08);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce GTX 1080 Ti Phoenix", DetectPalitGPUv1Controllers, NVIDIA_VEN, NVIDIA_GTX1080TI_DEV, GAINWARD_SUB_VEN, GAINWARD_GTX_1080TI_PHOENIX, 0x08);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Register detectors for Palit V2 GPU controllers |
|
||||
| (Gainward and PNY branded cards) |
|
||||
\*---------------------------------------------------------*/
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce GTX 1660 SUPER Ghost", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_GTX1660S_DEV, NVIDIA_SUB_VEN, NVIDIA_GTX1660S_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 2070 SUPER Phantom", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX2070S_OC_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 2080 Phoenix GS", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX2080_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX2080_A_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3060 Pegasus 12G", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3060_DEV, NVIDIA_SUB_VEN, NVIDIA_RTX3060_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3070 Phantom", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, GAINWARD_SUB_VEN, GAINWARD_RTX_3070_PHANTOM, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3070 Phoenix", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX3070_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3070 Ti Phoenix", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3070TI_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX3070TI_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3080 Phoenix", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3080_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX3080_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3080 Ti Phoenix", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX3080TI_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3090 Phoenix", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX3090_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3090 Ti Phantom", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3090TI_DEV, GAINWARD_SUB_VEN, GAINWARD_RTX_3090TI_PHANTOM, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 4080 Phantom GS", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, GAINWARD_SUB_VEN, GAINWARD_RTX_4080_PHANTOM_GS_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 5080 Phoenix", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GAINWARD_SUB_VEN, GAINWARD_RTX_5080_PHOENIX_SUB_DEV, 0x49);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| PNY GPU controllers (also Palit-manufactured) |
|
||||
\*---------------------------------------------------------*/
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 2060 XLR8 OC EDITION", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX2060_TU104_DEV, PNY_SUB_VEN, PNY_RTX_2060_XLR8_OC_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3060 XLR8 Revel EPIC-X", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3060_DEV, PNY_SUB_VEN, PNY_RTX_3060_XLR8_REVEL_EPIC_X_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3070 XLR8 Revel EPIC-X", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, PNY_SUB_VEN, PNY_RTX_3070_XLR8_REVEL_EPIC_X_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3070 XLR8 Revel EPIC-X LHR", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3070_LHR_DEV, PNY_SUB_VEN, PNY_RTX_3070_XLR8_REVEL_EPIC_X_LHR_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3080 XLR8 Revel EPIC-X", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3080_DEV, PNY_SUB_VEN, PNY_RTX_3080_XLR8_REVEL_EPIC_X_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3080 Ti XLR8 Revel EPIC-X", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, PNY_SUB_VEN, PNY_RTX_3080TI_XLR8_REVEL_EPIC_X_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3090 XLR8 Revel EPIC-X", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, PNY_SUB_VEN, PNY_RTX_3090_XLR8_REVEL_EPIC_X_SUB_DEV, 0x49);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Palit GPU controllers detected via PNY detector |
|
||||
\*---------------------------------------------------------*/
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 2070 SUPER Jetstream", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, NVIDIA_SUB_VEN, NVIDIA_RTX2070S_OC_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3060", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3060_DEV, PALIT_SUB_VEN, PALIT_RTX3060_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3060 LHR", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, PALIT_SUB_VEN, PALIT_RTX3060_LHR_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3060 Ti", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3060TI_DEV, PALIT_SUB_VEN, PALIT_RTX3060TI_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3060 Ti LHR", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, PALIT_SUB_VEN, NVIDIA_RTX3060TI_LHR_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3070", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3070_DEV, PALIT_SUB_VEN, PALIT_RTX3070_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3070 LHR", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3070_LHR_DEV, PALIT_SUB_VEN, PALIT_RTX3070_LHR_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3070 Ti", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3070TI_DEV, PALIT_SUB_VEN, PALIT_RTX3070TI_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3080", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3080_DEV, PALIT_SUB_VEN, PALIT_RTX3080_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3080 LHR", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3080_LHR_DEV, PALIT_SUB_VEN, PALIT_RTX3080_LHR_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3080 Ti", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, PALIT_SUB_VEN, PALIT_RTX3080TI_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3090", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, PALIT_SUB_VEN, PALIT_RTX3090_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3090 Gamerock", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, PALIT_SUB_VEN, PALIT_RTX3090_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 3090 Ti Gamerock", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX3090TI_DEV, PALIT_SUB_VEN, PALIT_RTX3090TI_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 4070 Ti", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX4070TI_DEV, PALIT_SUB_VEN, PALIT_RTX4070TI_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 4070 Ti Gamerock", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX4070TI_DEV, PALIT_SUB_VEN, PALIT_RTX4070TI_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 4070 Ti SUPER GamingPro", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX4070TIS_DEV, PALIT_SUB_VEN, PALIT_RTX4080_GAMINGPRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 4080 GamingPro", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, PALIT_SUB_VEN, PALIT_RTX4080_GAMINGPRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 4080 SUPER GamingPro", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX4080S_DEV, PALIT_SUB_VEN, PALIT_RTX4080_GAMINGPRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 4090 Gamerock", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, PALIT_SUB_VEN, PALIT_RTX4090_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5060 Ti White OC 16GB", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, PALIT_SUB_VEN, PALIT_RTX5060TI_WHITE_OC_16G_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5070 GamingPro", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, PALIT_SUB_VEN, PALIT_RTX5070_GAMINGPRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5070 Ti GameRock", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, PALIT_SUB_VEN, PALIT_RTX5070TI_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5070 Ti GamingPro", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, PALIT_SUB_VEN, PALIT_RTX5070TI_GAMINGPRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5070 Ti GamingPro-S", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, PALIT_SUB_VEN, PALIT_RTX5070TI_GAMINGPRO_S_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5080 GameRock", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, PALIT_SUB_VEN, PALIT_RTX5080_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5080 GamingPro", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, PALIT_SUB_VEN, PALIT_RTX5080_GAMINGPRO_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Palit GeForce RTX 5090 Gamerock", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, PALIT_SUB_VEN, PALIT_RTX5090_GAMEROCK_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("NVIDIA GeForce RTX 2060 SUPER", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX2060_TU106_DEV, NVIDIA_SUB_VEN, NVIDIA_RTX2060_TU106_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("NVIDIA GeForce RTX 2080 SUPER", DetectPalitGPUv2Controllers, NVIDIA_VEN, NVIDIA_RTX2080S_DEV, NVIDIA_SUB_VEN, NVIDIA_RTX2080S_DEV, 0x49);
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| PalitGPUv1Controller.cpp |
|
||||
| |
|
||||
| Driver for Palit v1 GPU |
|
||||
| |
|
||||
| TheRogueZeta 05 Nov 2020 |
|
||||
| Manatsawin Hanmongkolchai 11 Apr 2023 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include "PalitGPUv1Controller.h"
|
||||
|
||||
PalitGPUv1Controller::PalitGPUv1Controller(i2c_smbus_interface* bus, palit_gpu_dev_id dev, std::string dev_name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->name = dev_name;
|
||||
}
|
||||
|
||||
PalitGPUv1Controller::~PalitGPUv1Controller()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string PalitGPUv1Controller::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
return_string.append(addr);
|
||||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string PalitGPUv1Controller::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
unsigned char PalitGPUv1Controller::GetLEDRed()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Read red color from register 0x03 |
|
||||
\*-----------------------------------------------------*/
|
||||
return(bus->i2c_smbus_read_byte_data(dev, PALIT_V1_RED_REGISTER));
|
||||
}
|
||||
|
||||
unsigned char PalitGPUv1Controller::GetLEDGreen()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Read green color from register 0x04 |
|
||||
\*-----------------------------------------------------*/
|
||||
return(bus->i2c_smbus_read_byte_data(dev, PALIT_V1_RED_REGISTER + 1));
|
||||
}
|
||||
|
||||
unsigned char PalitGPUv1Controller::GetLEDBlue()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Read blue color from register 0x05 |
|
||||
\*-----------------------------------------------------*/
|
||||
return(bus->i2c_smbus_read_byte_data(dev, PALIT_V1_RED_REGISTER + 2));
|
||||
}
|
||||
|
||||
void PalitGPUv1Controller::SetLEDColors(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Write RGB colors and control byte using individual |
|
||||
| writes to registers 0x03, 0x04, 0x05, 0x06 |
|
||||
\*-----------------------------------------------------*/
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V1_RED_REGISTER, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V1_RED_REGISTER + 1, green);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V1_RED_REGISTER + 2, blue);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V1_RED_REGISTER + 3, 0xFF);
|
||||
}
|
||||
+9
-15
@@ -1,9 +1,10 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| GainwardGPUv1Controller.h |
|
||||
| PalitGPUv1Controller.h |
|
||||
| |
|
||||
| Driver for Gainward v1 GPU |
|
||||
| Driver for Palit v1 GPU |
|
||||
| |
|
||||
| TheRogueZeta 05 Nov 2020 |
|
||||
| Manatsawin Hanmongkolchai 11 Apr 2023 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
@@ -14,22 +15,19 @@
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
typedef unsigned char gainward_gpu_dev_id;
|
||||
typedef unsigned char palit_gpu_dev_id;
|
||||
|
||||
enum
|
||||
{
|
||||
/* RGB Registers */
|
||||
GAINWARD_RED_REGISTER = 0x03, /* Red Register */
|
||||
GAINWARD_GREEN_REGISTER = 0x04, /* Green Register */
|
||||
GAINWARD_BLUE_REGISTER = 0x05, /* Blue Register */
|
||||
GAINWARD_06_REGISTER = 0x06, /* Unknown (Brightness/Mode?) Register */
|
||||
PALIT_V1_RED_REGISTER = 0x03, /* Red Register */
|
||||
};
|
||||
|
||||
class GainwardGPUv1Controller
|
||||
class PalitGPUv1Controller
|
||||
{
|
||||
public:
|
||||
GainwardGPUv1Controller(i2c_smbus_interface* bus, gainward_gpu_dev_id, std::string dev_name);
|
||||
~GainwardGPUv1Controller();
|
||||
PalitGPUv1Controller(i2c_smbus_interface* bus, palit_gpu_dev_id, std::string dev_name);
|
||||
~PalitGPUv1Controller();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
@@ -38,13 +36,9 @@ public:
|
||||
unsigned char GetLEDGreen();
|
||||
unsigned char GetLEDBlue();
|
||||
void SetLEDColors(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetMode();
|
||||
|
||||
unsigned char GainwardGPURegisterRead(unsigned char reg);
|
||||
void GainwardGPURegisterWrite(unsigned char reg, unsigned char val);
|
||||
|
||||
private:
|
||||
i2c_smbus_interface * bus;
|
||||
gainward_gpu_dev_id dev;
|
||||
palit_gpu_dev_id dev;
|
||||
std::string name;
|
||||
};
|
||||
@@ -0,0 +1,154 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| PalitGPUv2Controller.cpp |
|
||||
| |
|
||||
| Driver for Palit v2 GPU (merged from Gainward v2 and |
|
||||
| PNY controllers) |
|
||||
| |
|
||||
| KundaPanda 04 Jan 2021 |
|
||||
| KendallMorgan 17 Oct 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include "PalitGPUv2Controller.h"
|
||||
|
||||
PalitGPUv2Controller::PalitGPUv2Controller(i2c_smbus_interface* bus, palit_gpu_dev_id dev, std::string dev_name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->name = dev_name;
|
||||
}
|
||||
|
||||
PalitGPUv2Controller::~PalitGPUv2Controller()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string PalitGPUv2Controller::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
return_string.append(addr);
|
||||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string PalitGPUv2Controller::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
unsigned char PalitGPUv2Controller::GetLEDRed()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, PALIT_V2_RED_REGISTER));
|
||||
}
|
||||
|
||||
unsigned char PalitGPUv2Controller::GetLEDGreen()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, PALIT_V2_GREEN_REGISTER));
|
||||
}
|
||||
|
||||
unsigned char PalitGPUv2Controller::GetLEDBlue()
|
||||
{
|
||||
return(bus->i2c_smbus_read_byte_data(dev, PALIT_V2_BLUE_REGISTER));
|
||||
}
|
||||
|
||||
void PalitGPUv2Controller::WriteI2CData(u8 command, u8 length, u8* data)
|
||||
{
|
||||
for (u8 i = 0; i < length; i++)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, command + i, data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void PalitGPUv2Controller::SetLEDColors(unsigned char red, unsigned char green, unsigned char blue, unsigned char color_register)
|
||||
{
|
||||
switch (color_register)
|
||||
{
|
||||
default:
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_RED_REGISTER, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_GREEN_REGISTER, green);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_BLUE_REGISTER, blue);
|
||||
break;
|
||||
case PALIT_V2_COLOR_REGISTER_SECONDARY:
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_RED_SECONDARY_REGISTER, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_GREEN_SECONDARY_REGISTER, green);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_BLUE_SECONDARY_REGISTER, blue);
|
||||
break;
|
||||
case PALIT_V2_COLOR_REGISTER_TERTIARY:
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_RED_TERTIARY_REGISTER, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_GREEN_TERTIARY_REGISTER, green);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_BLUE_TERTIARY_REGISTER, blue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PalitGPUv2Controller::SetMode(unsigned char mode, unsigned char speed, unsigned char control_mode)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_MODE_REGISTER, mode);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_CONTROL_REGISTER, control_mode);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_SPEED_REGISTER, speed);
|
||||
}
|
||||
|
||||
void PalitGPUv2Controller::SetDirection(unsigned char direction)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_MODE_DIRECTION_REGISTER, direction);
|
||||
}
|
||||
|
||||
void PalitGPUv2Controller::SetBreathingSpeed(unsigned int speed)
|
||||
{
|
||||
unsigned char lower = speed & 0xFF;
|
||||
unsigned char upper = (speed >> 2 * 4) & 0xFF;
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_BREATHE_SPEED_REGISTER_A, lower);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_BREATHE_SPEED_SECONDARY_REGISTER_A, lower);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_BREATHE_SPEED_REGISTER_B, upper);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_BREATHE_SPEED_SECONDARY_REGISTER_B, upper);
|
||||
}
|
||||
|
||||
void PalitGPUv2Controller::SetOff()
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_MODE_REGISTER, 0);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_CONTROL_REGISTER, 0x00);
|
||||
}
|
||||
|
||||
void PalitGPUv2Controller::SetCycle(unsigned char speed)
|
||||
{
|
||||
u8 loop[] = {
|
||||
0x01, // Direction
|
||||
0x00, // ??
|
||||
speed, // Speed
|
||||
0x1F // Somehow related to speed
|
||||
};
|
||||
loop[2] = speed;
|
||||
WriteI2CData(PALIT_V2_MODE_REGISTER, sizeof(loop), loop);
|
||||
}
|
||||
|
||||
void PalitGPUv2Controller::SetStrobe(unsigned char r, unsigned char g, unsigned char b, unsigned char speed, unsigned char brightness)
|
||||
{
|
||||
u8 strobe[] = {
|
||||
0x02, // Strobe
|
||||
0x00, // Rise speed
|
||||
speed, // Cycle length/2
|
||||
0x00, // Off delay
|
||||
r, // R
|
||||
g, // G
|
||||
b, // B
|
||||
brightness, // Peak brightness
|
||||
0x05 // Fade speed
|
||||
};
|
||||
WriteI2CData(PALIT_V2_MODE_REGISTER, sizeof(strobe), strobe);
|
||||
}
|
||||
|
||||
void PalitGPUv2Controller::SetDirect(unsigned char red, unsigned char green, unsigned char blue, unsigned char brightness)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_MODE_REGISTER, 0);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_CONTROL_REGISTER, 0x01);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_RED_REGISTER, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_BLUE_REGISTER, blue);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_GREEN_REGISTER, green);
|
||||
bus->i2c_smbus_write_byte_data(dev, PALIT_V2_BRIGHTNESS_REGISTER, brightness);
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| PalitGPUv2Controller.h |
|
||||
| |
|
||||
| Driver for Palit v2 GPU (merged from Gainward v2 and |
|
||||
| PNY controllers) |
|
||||
| |
|
||||
| KundaPanda 04 Jan 2021 |
|
||||
| KendallMorgan 17 Oct 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
typedef unsigned char palit_gpu_dev_id;
|
||||
|
||||
enum
|
||||
{
|
||||
/* Control Registers */
|
||||
PALIT_V2_CONTROL_REGISTER = 0x60, /* Control Register (direct mode / software control) */
|
||||
|
||||
/* Breathing speed registers */
|
||||
PALIT_V2_BREATHE_SPEED_REGISTER_A = 0x62, /* Lower part of speed control for breathe effect */
|
||||
PALIT_V2_BREATHE_SPEED_REGISTER_B = 0x63, /* Upper part of speed control for breathe effect */
|
||||
PALIT_V2_BREATHE_SPEED_SECONDARY_REGISTER_A = 0x64, /* Lower part of speed control for breathe effect - prob. secondary color */
|
||||
PALIT_V2_BREATHE_SPEED_SECONDARY_REGISTER_B = 0x65, /* Upper part of speed control for breathe effect - prob. secondary color */
|
||||
|
||||
/* RGB Registers - Primary color */
|
||||
PALIT_V2_RED_REGISTER = 0x6C, /* Red Register */
|
||||
PALIT_V2_GREEN_REGISTER = 0x6D, /* Green Register */
|
||||
PALIT_V2_BLUE_REGISTER = 0x6E, /* Blue Register */
|
||||
PALIT_V2_BRIGHTNESS_REGISTER = 0x6F, /* Brightness Register */
|
||||
|
||||
/* RGB Registers - Secondary color */
|
||||
PALIT_V2_RED_SECONDARY_REGISTER = 0x70, /* Red Register 2 */
|
||||
PALIT_V2_GREEN_SECONDARY_REGISTER = 0x71, /* Green Register 2 */
|
||||
PALIT_V2_BLUE_SECONDARY_REGISTER = 0x72, /* Blue Register 2 */
|
||||
|
||||
/* Mode Registers */
|
||||
PALIT_V2_MODE_REGISTER = 0xE0, /* Mode Register */
|
||||
PALIT_V2_MODE_DIRECTION_REGISTER = 0xE1, /* Mode direction Register */
|
||||
PALIT_V2_SPEED_REGISTER = 0xE2, /* Mode speed Register */
|
||||
|
||||
/* RGB Registers - Tertiary color */
|
||||
PALIT_V2_RED_TERTIARY_REGISTER = 0xE4, /* Red Register 3 */
|
||||
PALIT_V2_GREEN_TERTIARY_REGISTER = 0xE5, /* Green Register 3 */
|
||||
PALIT_V2_BLUE_TERTIARY_REGISTER = 0xE6, /* Blue Register 3 */
|
||||
};
|
||||
|
||||
/* Mode values for the hardware mode register */
|
||||
enum
|
||||
{
|
||||
PALIT_V2_MODE_OFF = 0x00,
|
||||
PALIT_V2_MODE_STATIC = 0x00,
|
||||
PALIT_V2_MODE_CYCLE = 0x01,
|
||||
PALIT_V2_MODE_STROBE = 0x02,
|
||||
};
|
||||
|
||||
/* Mode identifiers for RGBController (unique values for switch statements) */
|
||||
enum
|
||||
{
|
||||
PALIT_V2_MODE_ID_OFF = 0,
|
||||
PALIT_V2_MODE_ID_DIRECT = 1,
|
||||
PALIT_V2_MODE_ID_BREATHING = 2,
|
||||
PALIT_V2_MODE_ID_CYCLE = 3,
|
||||
PALIT_V2_MODE_ID_STROBE = 4,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PALIT_V2_COLOR_REGISTER_PRIMARY,
|
||||
PALIT_V2_COLOR_REGISTER_SECONDARY,
|
||||
PALIT_V2_COLOR_REGISTER_TERTIARY,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
/* Software controlled direct mode */
|
||||
PALIT_V2_STATIC_SOFTWARE = 0x01,
|
||||
/* GPU controlled direct mode with breathing effect */
|
||||
PALIT_V2_STATIC_BREATHING = 0x22,
|
||||
};
|
||||
|
||||
class PalitGPUv2Controller
|
||||
{
|
||||
public:
|
||||
PalitGPUv2Controller(i2c_smbus_interface* bus, palit_gpu_dev_id, std::string dev_name);
|
||||
~PalitGPUv2Controller();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
|
||||
unsigned char GetLEDRed();
|
||||
unsigned char GetLEDGreen();
|
||||
unsigned char GetLEDBlue();
|
||||
void SetLEDColors(unsigned char red, unsigned char green, unsigned char blue, unsigned char color_register = PALIT_V2_COLOR_REGISTER_PRIMARY);
|
||||
void SetMode(unsigned char mode, unsigned char speed, unsigned char direct_mode = PALIT_V2_STATIC_SOFTWARE);
|
||||
void SetBreathingSpeed(unsigned int speed);
|
||||
void SetDirection(unsigned char direction);
|
||||
void SetOff();
|
||||
void SetCycle(unsigned char speed);
|
||||
void SetStrobe(unsigned char r, unsigned char g, unsigned char b, unsigned char speed, unsigned char brightness);
|
||||
void SetDirect(unsigned char red, unsigned char green, unsigned char blue, unsigned char brightness);
|
||||
|
||||
private:
|
||||
i2c_smbus_interface * bus;
|
||||
palit_gpu_dev_id dev;
|
||||
std::string name;
|
||||
|
||||
void WriteI2CData(u8 command, u8 length, u8* data);
|
||||
};
|
||||
@@ -1,112 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_PalitGPU.cpp |
|
||||
| |
|
||||
| RGBController for Palit GPU |
|
||||
| |
|
||||
| Manatsawin Hanmongkolchai 11 Apr 2023 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_PalitGPU.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Palit GPU
|
||||
@category GPU
|
||||
@type I2C
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :x:
|
||||
@detectors DetectPalitGPUControllers
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_PalitGPU::RGBController_PalitGPU(PalitGPUController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetName();
|
||||
vendor = "Palit";
|
||||
description = "Legacy Palit RGB GPU Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
type = DEVICE_TYPE_GPU;
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = PALIT_GPU_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
|
||||
// Initialize active mode
|
||||
active_mode = 0;
|
||||
}
|
||||
|
||||
RGBController_PalitGPU::~RGBController_PalitGPU()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_PalitGPU::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device only has one LED, so create a single zone and |
|
||||
| LED for it |
|
||||
\*---------------------------------------------------------*/
|
||||
zone* new_zone = new zone();
|
||||
led* new_led = new led();
|
||||
|
||||
new_zone->name = "GPU Zone";
|
||||
new_zone->type = ZONE_TYPE_SINGLE;
|
||||
new_zone->leds_min = 1;
|
||||
new_zone->leds_max = 1;
|
||||
new_zone->leds_count = 1;
|
||||
|
||||
new_led->name = "GPU LED";
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Push the zone and LED on to device vectors |
|
||||
\*---------------------------------------------------------*/
|
||||
leds.push_back(*new_led);
|
||||
zones.push_back(*new_zone);
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_PalitGPU::DeviceUpdateLEDs()
|
||||
{
|
||||
DeviceUpdateMode();
|
||||
}
|
||||
|
||||
void RGBController_PalitGPU::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_PalitGPU::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_PalitGPU::DeviceUpdateMode()
|
||||
{
|
||||
RGBColor color = colors[0];
|
||||
unsigned char r = RGBGetRValue(color);
|
||||
unsigned char g = RGBGetGValue(color);
|
||||
unsigned char b = RGBGetBValue(color);
|
||||
|
||||
switch(modes[active_mode].value)
|
||||
{
|
||||
case PALIT_GPU_MODE_DIRECT:
|
||||
controller->SetDirect(r, g, b);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_PalitGPU.h |
|
||||
| |
|
||||
| RGBController for Palit GPU |
|
||||
| |
|
||||
| Manatsawin Hanmongkolchai 11 Apr 2023 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "PalitGPUController.h"
|
||||
|
||||
class RGBController_PalitGPU : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_PalitGPU(PalitGPUController* controller_ptr);
|
||||
~RGBController_PalitGPU();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
PalitGPUController* controller;
|
||||
};
|
||||
@@ -0,0 +1,110 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_PalitGPUv1.cpp |
|
||||
| |
|
||||
| RGBController for Palit v1 GPU |
|
||||
| |
|
||||
| TheRogueZeta 05 Nov 2020 |
|
||||
| Manatsawin Hanmongkolchai 11 Apr 2023 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_PalitGPUv1.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Palit GPU v1
|
||||
@category GPU
|
||||
@type I2C
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :x:
|
||||
@detectors DetectPalitGPUControllers
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_PalitGPUv1::RGBController_PalitGPUv1(PalitGPUv1Controller* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Palit";
|
||||
type = DEVICE_TYPE_GPU;
|
||||
description = "Palit GPU V1 Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 1;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_PalitGPUv1::~RGBController_PalitGPUv1()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_PalitGPUv1::SetupZones()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up zone |
|
||||
\*-----------------------------------------------------*/
|
||||
zone palit_gpu_zone;
|
||||
palit_gpu_zone.name = "GPU";
|
||||
palit_gpu_zone.type = ZONE_TYPE_SINGLE;
|
||||
palit_gpu_zone.leds_min = 1;
|
||||
palit_gpu_zone.leds_max = 1;
|
||||
palit_gpu_zone.leds_count = 1;
|
||||
zones.push_back(palit_gpu_zone);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up LED |
|
||||
\*-----------------------------------------------------*/
|
||||
led palit_gpu_led;
|
||||
palit_gpu_led.name = "GPU";
|
||||
leds.push_back(palit_gpu_led);
|
||||
|
||||
SetupColors();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Initialize color |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned char red = controller->GetLEDRed();
|
||||
unsigned char grn = controller->GetLEDGreen();
|
||||
unsigned char blu = controller->GetLEDBlue();
|
||||
|
||||
colors[0] = ToRGBColor(red, grn, blu);
|
||||
}
|
||||
|
||||
void RGBController_PalitGPUv1::DeviceUpdateLEDs()
|
||||
{
|
||||
for(std::size_t led = 0; led < colors.size(); led++)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(colors[led]);
|
||||
unsigned char grn = RGBGetGValue(colors[led]);
|
||||
unsigned char blu = RGBGetBValue(colors[led]);
|
||||
|
||||
controller->SetLEDColors(red, grn, blu);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_PalitGPUv1::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_PalitGPUv1::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_PalitGPUv1::DeviceUpdateMode()
|
||||
{
|
||||
|
||||
}
|
||||
+36
-35
@@ -1,35 +1,36 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_GainwardGPUv1.h |
|
||||
| |
|
||||
| RGBController for Gainward v1 GPU |
|
||||
| |
|
||||
| TheRogueZeta 05 Nov 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "GainwardGPUv1Controller.h"
|
||||
|
||||
class RGBController_GainwardGPUv1 : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_GainwardGPUv1(GainwardGPUv1Controller* controller_ptr);
|
||||
~RGBController_GainwardGPUv1();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
GainwardGPUv1Controller* controller;
|
||||
|
||||
int GetDeviceMode();
|
||||
};
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_PalitGPUv1.h |
|
||||
| |
|
||||
| RGBController for Palit v1 GPU |
|
||||
| |
|
||||
| TheRogueZeta 05 Nov 2020 |
|
||||
| Manatsawin Hanmongkolchai 11 Apr 2023 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "PalitGPUv1Controller.h"
|
||||
|
||||
class RGBController_PalitGPUv1 : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_PalitGPUv1(PalitGPUv1Controller* controller_ptr);
|
||||
~RGBController_PalitGPUv1();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
PalitGPUv1Controller* controller;
|
||||
|
||||
int GetDeviceMode();
|
||||
};
|
||||
@@ -0,0 +1,219 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_PalitGPUv2.cpp |
|
||||
| |
|
||||
| RGBController for Palit v2 GPU |
|
||||
| |
|
||||
| KundaPanda 04 Jan 2021 |
|
||||
| KendallMorgan 17 Oct 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_PalitGPUv2.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Palit GPU v2
|
||||
@category GPU
|
||||
@type I2C
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectPalitGPUControllers
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_PalitGPUv2::RGBController_PalitGPUv2(PalitGPUv2Controller* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Palit";
|
||||
type = DEVICE_TYPE_GPU;
|
||||
description = "Palit GPU V2 Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Off mode |
|
||||
\*-----------------------------------------------------*/
|
||||
mode Off;
|
||||
Off.name = "Off";
|
||||
Off.value = PALIT_V2_MODE_ID_OFF;
|
||||
Off.flags = 0;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Off);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Direct mode |
|
||||
\*-----------------------------------------------------*/
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = PALIT_V2_MODE_ID_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Direct.brightness = 255;
|
||||
Direct.brightness_min = 0;
|
||||
Direct.brightness_max = 100;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Breathing mode |
|
||||
\*-----------------------------------------------------*/
|
||||
mode Breathe;
|
||||
Breathe.name = "Breathing";
|
||||
Breathe.value = PALIT_V2_MODE_ID_BREATHING;
|
||||
Breathe.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Breathe.speed_max = 0x000a;
|
||||
Breathe.speed_min = 0x1324;
|
||||
Breathe.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathe.colors_min = 2;
|
||||
Breathe.colors_max = 2;
|
||||
Breathe.colors.resize(2);
|
||||
modes.push_back(Breathe);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Spectrum Cycle mode |
|
||||
\*-----------------------------------------------------*/
|
||||
mode SpectrumCycle;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = PALIT_V2_MODE_ID_CYCLE;
|
||||
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR;
|
||||
SpectrumCycle.speed = 3;
|
||||
SpectrumCycle.speed_max = 0;
|
||||
SpectrumCycle.speed_min = 100;
|
||||
SpectrumCycle.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(SpectrumCycle);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Strobe mode |
|
||||
\*-----------------------------------------------------*/
|
||||
mode Strobe;
|
||||
Strobe.name = "Strobe";
|
||||
Strobe.value = PALIT_V2_MODE_ID_STROBE;
|
||||
Strobe.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Strobe.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Strobe.colors_min = 1;
|
||||
Strobe.colors_max = 1;
|
||||
Strobe.colors.resize(1);
|
||||
Strobe.speed_max = 0x0;
|
||||
Strobe.speed_min = 0xF;
|
||||
modes.push_back(Strobe);
|
||||
|
||||
SetupZones();
|
||||
|
||||
active_mode = 0;
|
||||
}
|
||||
|
||||
RGBController_PalitGPUv2::~RGBController_PalitGPUv2()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_PalitGPUv2::SetupZones()
|
||||
{
|
||||
zone* new_zone = new zone();
|
||||
led* new_led = new led();
|
||||
|
||||
new_zone->name = "GPU Zone";
|
||||
new_zone->type = ZONE_TYPE_SINGLE;
|
||||
new_zone->leds_min = 1;
|
||||
new_zone->leds_max = 1;
|
||||
new_zone->leds_count = 1;
|
||||
|
||||
new_led->name = "GPU LED";
|
||||
|
||||
leds.push_back(*new_led);
|
||||
zones.push_back(*new_zone);
|
||||
SetupColors();
|
||||
|
||||
unsigned char red = controller->GetLEDRed();
|
||||
unsigned char grn = controller->GetLEDGreen();
|
||||
unsigned char blu = controller->GetLEDBlue();
|
||||
|
||||
colors[0] = ToRGBColor(red, grn, blu);
|
||||
}
|
||||
|
||||
void RGBController_PalitGPUv2::DeviceUpdateLEDs()
|
||||
{
|
||||
for(unsigned int color : colors)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
|
||||
controller->SetLEDColors(red, grn, blu);
|
||||
controller->SetMode(PALIT_V2_MODE_STATIC, 0x2);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_PalitGPUv2::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_PalitGPUv2::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_PalitGPUv2::DeviceUpdateMode()
|
||||
{
|
||||
RGBColor color = colors[0];
|
||||
unsigned char r = RGBGetRValue(color);
|
||||
unsigned char g = RGBGetGValue(color);
|
||||
unsigned char b = RGBGetBValue(color);
|
||||
unsigned char speed, brightness;
|
||||
|
||||
switch(modes[active_mode].value)
|
||||
{
|
||||
case PALIT_V2_MODE_ID_OFF:
|
||||
controller->SetOff();
|
||||
break;
|
||||
|
||||
case PALIT_V2_MODE_ID_DIRECT:
|
||||
brightness = modes[active_mode].brightness;
|
||||
controller->SetDirect(r, g, b, brightness);
|
||||
break;
|
||||
|
||||
case PALIT_V2_MODE_ID_BREATHING:
|
||||
{
|
||||
controller->SetBreathingSpeed(modes[active_mode].speed);
|
||||
|
||||
unsigned char r1 = RGBGetRValue(modes[active_mode].colors[0]);
|
||||
unsigned char g1 = RGBGetGValue(modes[active_mode].colors[0]);
|
||||
unsigned char b1 = RGBGetBValue(modes[active_mode].colors[0]);
|
||||
controller->SetLEDColors(r1, g1, b1);
|
||||
|
||||
unsigned char r2 = RGBGetRValue(modes[active_mode].colors[1]);
|
||||
unsigned char g2 = RGBGetGValue(modes[active_mode].colors[1]);
|
||||
unsigned char b2 = RGBGetBValue(modes[active_mode].colors[1]);
|
||||
controller->SetLEDColors(r2, g2, b2, PALIT_V2_COLOR_REGISTER_SECONDARY);
|
||||
controller->SetMode(PALIT_V2_MODE_STATIC, 0x2, PALIT_V2_STATIC_BREATHING);
|
||||
}
|
||||
break;
|
||||
|
||||
case PALIT_V2_MODE_ID_CYCLE:
|
||||
controller->SetMode(PALIT_V2_MODE_CYCLE, (unsigned char)(modes[active_mode].speed));
|
||||
controller->SetDirection(modes[active_mode].direction);
|
||||
break;
|
||||
|
||||
case PALIT_V2_MODE_ID_STROBE:
|
||||
{
|
||||
mode current_mode = modes[(unsigned int)active_mode];
|
||||
|
||||
unsigned char r_strobe = RGBGetRValue(current_mode.colors[0]);
|
||||
unsigned char g_strobe = RGBGetGValue(current_mode.colors[0]);
|
||||
unsigned char b_strobe = RGBGetBValue(current_mode.colors[0]);
|
||||
controller->SetLEDColors(r_strobe, g_strobe, b_strobe, PALIT_V2_COLOR_REGISTER_TERTIARY);
|
||||
|
||||
controller->SetMode(PALIT_V2_MODE_STROBE, (unsigned char)(current_mode.speed));
|
||||
controller->SetDirection(current_mode.direction);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
+9
-8
@@ -1,8 +1,9 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_PNYGPU.h |
|
||||
| RGBController_PalitGPUv2.h |
|
||||
| |
|
||||
| RGBController for PNY Turing GPU |
|
||||
| RGBController for Palit v2 GPU |
|
||||
| |
|
||||
| KundaPanda 04 Jan 2021 |
|
||||
| KendallMorgan 17 Oct 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
@@ -12,13 +13,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "PNYGPUController.h"
|
||||
#include "PalitGPUv2Controller.h"
|
||||
|
||||
class RGBController_PNYGPU : public RGBController
|
||||
class RGBController_PalitGPUv2 : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_PNYGPU(PNYGPUController* controller_ptr);
|
||||
~RGBController_PNYGPU();
|
||||
RGBController_PalitGPUv2(PalitGPUv2Controller* controller_ptr);
|
||||
~RGBController_PalitGPUv2();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
@@ -29,5 +30,5 @@ public:
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
PNYGPUController* controller;
|
||||
};
|
||||
PalitGPUv2Controller* controller;
|
||||
};
|
||||
Reference in New Issue
Block a user