diff options
author | dec05eba <dec05eba®protonmail.com> | 2023-04-14 09:36:24 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-04-15 19:06:08 +0200 |
commit | f6107a0c5d41aa9fbaa41d64e2f6a5681f9237cc (patch) | |
tree | 8fae2bf69dd325d1da0ab1e475a58f32435768cf /include/utils.h | |
parent | 5c714ea7142272b7b95b95019501df1d49691db1 (diff) |
Fix AMD single monitor rotated display being rotated in recording
If there is only one monitor connected and it's rotated then
the drm buf will also be rotated. This only the case with AMD and
only when using one monitor!
To fix this, we perform color conversion with an opengl shader
which allows us to also rotate the texture.
VAAPI supports rotation but it's not implemented by AMD at least.
Performance seems to be the same as when using VAAPI, even when
GPU usage is 100%.
Diffstat (limited to 'include/utils.h')
-rw-r--r-- | include/utils.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/utils.h b/include/utils.h index f4925e5..fb1365b 100644 --- a/include/utils.h +++ b/include/utils.h @@ -5,6 +5,17 @@ #include <stdbool.h> #include <X11/extensions/Xrandr.h> +typedef enum { + GSR_GPU_VENDOR_AMD, + GSR_GPU_VENDOR_INTEL, + GSR_GPU_VENDOR_NVIDIA +} gsr_gpu_vendor; + +typedef struct { + gsr_gpu_vendor vendor; + int gpu_version; /* 0 if unknown */ +} gsr_gpu_info; + typedef struct { vec2i pos; vec2i size; @@ -23,4 +34,6 @@ typedef void (*active_monitor_callback)(const XRROutputInfo *output_info, const void for_each_active_monitor_output(Display *display, active_monitor_callback callback, void *userdata); bool get_monitor_by_name(Display *display, const char *name, gsr_monitor *monitor); +bool gl_get_gpu_info(Display *dpy, gsr_gpu_info *info); + #endif /* GSR_UTILS_H */ |