guillaumezin / nvidiabl

/!\ Please note that I don't maintain this repository anymore, please have a look at forked projects. /!\
82 stars 82 forks source link

NV5X_PDISPLAY_SOR0_BRIGHTNESS offsets not working for newer GPUs (GTX970M) #112

Open jrocnuck opened 7 years ago

jrocnuck commented 7 years ago

Currently at f94dfa927190619ed70b20a548a7090a142e717f

the 2 NV5X SOR0 BRIGHTNESS OFFSETS are 0xc084 and 0xd084

in the nouveau driver there is a macro for the offsets that looks like this: #define NV50_PDISP_SOR_PWM_CTL(i) (0x0061c084 + (i) * 0x800)

in my case, using a GTX 970M, the correct offset to have the backlight controls work is 0xc884, which would be the value for i==1 in the nouveau macro.

It appears that nouveau is a bit more complicated and actually queries the device to determine the 'screen type' basically solving for i in the macro.

It might be worthwhile to at least add this third hard coded offset to the #defines and add additional logic to the nv5x_map function to check all 3 offsets when the screen type is not defined (i.e. auto)

For the GTX 970M, I have the driver working with the above 0xc884 offset in place + the fix for issue #111 with the following identifiers for my Sager laptop:

/* GeForce GTX 970M */
NVIDIABL_DECLARE_GPU_MODEL(0x13d8, nv5x_driver_data),
NVIDIABL_DECLARE_LAPTOP_MODEL("Notebook", "P65_P67RGRERA", PCI_ANY_ID, NVIDIABL_SC_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO), 
guillaumezin commented 7 years ago

Hello,

Sorry, this repository is not maintained anymore, because, at least for my GPU, backlight is now supported by nvidia drivers.

Guillaume