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%.
This commit is contained in:
dec05eba
2023-04-14 09:36:24 +02:00
committed by dec05eba
parent 5c714ea714
commit f6107a0c5d
16 changed files with 863 additions and 259 deletions

View File

@@ -1,8 +1,9 @@
#ifndef GSR_CAPTURE_KMS_VAAPI_H
#define GSR_CAPTURE_KMS_VAAPI_H
#include "capture.h"
#include "../vec2.h"
#include "../utils.h"
#include "capture.h"
#include <X11/X.h>
typedef struct _XDisplay Display;
@@ -10,6 +11,7 @@ typedef struct _XDisplay Display;
typedef struct {
Display *dpy;
const char *display_to_capture; /* if this is "screen", then the entire x11 screen is captured (all displays). A copy is made of this */
gsr_gpu_info gpu_inf;
} gsr_capture_kms_vaapi_params;
gsr_capture* gsr_capture_kms_vaapi_create(const gsr_capture_kms_vaapi_params *params);