diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-03-17 17:17:14 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-03-17 17:17:14 +0100 |
commit | 93cb6593a642018e3373fb7099e1c0687b367176 (patch) | |
tree | 63d24dc3a9a03e71857ef793929f6000f75cc3db /include/xnvctrl.h | |
parent | 8cbdb596ebf79587a432ed40583630b6cd39ed88 (diff) |
Add overclocking option -oc to workaround a NVIDIA driver bug (forcefully set to p2 state when using cuda)
Diffstat (limited to 'include/xnvctrl.h')
-rw-r--r-- | include/xnvctrl.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/xnvctrl.h b/include/xnvctrl.h new file mode 100644 index 0000000..8e026c4 --- /dev/null +++ b/include/xnvctrl.h @@ -0,0 +1,43 @@ +#ifndef GSR_XNVCTRL_H +#define GSR_XNVCTRL_H + +#include <stdbool.h> +#include <stdint.h> + +#define NV_CTRL_GPU_MEM_TRANSFER_RATE_OFFSET 410 +#define NV_CTRL_GPU_MEM_TRANSFER_RATE_OFFSET_ALL_PERFORMANCE_LEVELS 425 + +#define NV_CTRL_TARGET_TYPE_GPU 1 + +#define NV_CTRL_STRING_PERFORMANCE_MODES 29 + +typedef struct _XDisplay Display; + +typedef struct { + int type; + union { + struct { + int64_t min; + int64_t max; + } range; + struct { + unsigned int ints; + } bits; + } u; + unsigned int permissions; +} NVCTRLAttributeValidValuesRec; + +typedef struct { + Display *display; + void *library; + + int (*XNVCTRLQueryExtension)(Display *dpy, int *event_basep, int *error_basep); + int (*XNVCTRLSetTargetAttributeAndGetStatus)(Display *dpy, int target_type, int target_id, unsigned int display_mask, unsigned int attribute, int value); + int (*XNVCTRLQueryValidTargetAttributeValues)(Display *dpy, int target_type, int target_id, unsigned int display_mask, unsigned int attribute, NVCTRLAttributeValidValuesRec *values); + int (*XNVCTRLQueryTargetStringAttribute)(Display *dpy, int target_type, int target_id, unsigned int display_mask, unsigned int attribute, char **ptr); +} gsr_xnvctrl; + +bool gsr_xnvctrl_load(gsr_xnvctrl *self, Display *display); +void gsr_xnvctrl_unload(gsr_xnvctrl *self); + +#endif /* GSR_XNVCTRL_H */ |