From 9ca5b8ec3a818454ebb139ae9007184584aa2f5e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 22 Jul 2023 20:12:41 +0200 Subject: Fix cursor offset in kms grab (amd/intel), disable wlroots capture until its fixed --- src/capture/kms_vaapi.c | 17 +++-------------- src/egl.c | 4 +++- 2 files changed, 6 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/capture/kms_vaapi.c b/src/capture/kms_vaapi.c index 00404a6..cc9aad9 100644 --- a/src/capture/kms_vaapi.c +++ b/src/capture/kms_vaapi.c @@ -388,15 +388,6 @@ static gsr_kms_response_fd* find_cursor_drm(gsr_kms_response *kms_response) { return NULL; } -static int count_non_cursor_planes(gsr_kms_response *kms_response) { - int result = 0; - for(int i = 0; i < kms_response->num_fds; ++i) { - if(!kms_response->fds[i].is_cursor) - result++; - } - return result; -} - static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) { (void)frame; gsr_capture_kms_vaapi *cap_kms = cap->priv; @@ -460,19 +451,17 @@ static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) { drm_fd = find_first_combined_drm(&cap_kms->kms_response); if(!drm_fd) drm_fd = find_largest_drm(&cap_kms->kms_response); + capture_is_combined_plane = true; } cursor_drm_fd = find_cursor_drm(&cap_kms->kms_response); - capture_is_combined_plane = (drm_fd && drm_fd->is_combined_plane) || count_non_cursor_planes(&cap_kms->kms_response) == 1; } if(!drm_fd) return -1; - /* Hide cursor when it's on another display */ - // TODO: - //if(!capture_is_combined_plane && cursor_drm_fd && cursor_drm_fd->connector_id != drm_fd->connector_id) - // cursor_drm_fd = NULL; + if(!capture_is_combined_plane && cursor_drm_fd && cursor_drm_fd->connector_id != drm_fd->connector_id) + cursor_drm_fd = NULL; // TODO: This causes a crash sometimes on steam deck, why? is it a driver bug? a vaapi pure version doesn't cause a crash. // Even ffmpeg kmsgrab causes this crash. The error is: diff --git a/src/egl.c b/src/egl.c index d15a3ea..3bcb6fe 100644 --- a/src/egl.c +++ b/src/egl.c @@ -536,7 +536,9 @@ void gsr_egl_unload(gsr_egl *self) { } bool gsr_egl_supports_wayland_capture(gsr_egl *self) { - return !!self->wayland.export_manager && self->wayland.num_outputs > 0; + (void)self; + return false; + //return !!self->wayland.export_manager && self->wayland.num_outputs > 0; } bool gsr_egl_start_capture(gsr_egl *self, const char *monitor_to_capture) { -- cgit v1.2.3