[mutter] kms/impl: Dont discard page flips in callback when failed up front
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] kms/impl: Dont discard page flips in callback when failed up front
- Date: Fri, 22 Jan 2021 17:08:29 +0000 (UTC)
commit a2b86685446dd5a328bd429ce1b83ec406c8ae73
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Fri Oct 2 10:11:39 2020 +0200
kms/impl: Dont discard page flips in callback when failed up front
If posting an update resulted in an immediate error, don't communicate
this failure using the page flip feedback callbacks, but directly as a
return value.
This makes it possible for the direct client buffer scanout path not to
pass around flags triggering this behavior, meaning we can handle such
direct scanouts better.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1488>
src/backends/native/meta-kms-impl-device-simple.c | 28 -----------------------
src/backends/native/meta-kms-update-private.h | 1 -
src/backends/native/meta-kms-update.c | 2 --
src/backends/native/meta-kms-update.h | 7 ------
src/backends/native/meta-renderer-native.c | 19 ++++++---------
5 files changed, 7 insertions(+), 50 deletions(-)
---
diff --git a/src/backends/native/meta-kms-impl-device-simple.c
b/src/backends/native/meta-kms-impl-device-simple.c
index 49bd890739..da2df2d617 100644
--- a/src/backends/native/meta-kms-impl-device-simple.c
+++ b/src/backends/native/meta-kms-impl-device-simple.c
@@ -814,23 +814,6 @@ process_page_flip (MetaKmsImplDevice *impl_device,
return TRUE;
}
-static void
-discard_page_flip (MetaKmsImplDevice *impl_device,
- MetaKmsUpdate *update,
- MetaKmsPageFlip *page_flip)
-{
- MetaKmsCrtc *crtc;
- MetaKmsPageFlipData *page_flip_data;
-
- crtc = page_flip->crtc;
- page_flip_data = meta_kms_page_flip_data_new (impl_device,
- crtc,
- page_flip->feedback,
- page_flip->user_data);
- meta_kms_page_flip_data_discard_in_impl (page_flip_data, NULL);
- meta_kms_page_flip_data_unref (page_flip_data);
-}
-
static gboolean
process_entries (MetaKmsImplDevice *impl_device,
MetaKmsUpdate *update,
@@ -1029,7 +1012,6 @@ meta_kms_impl_device_simple_process_update (MetaKmsImplDevice *impl_device,
{
GError *error = NULL;
GList *failed_planes;
- GList *l;
if (!process_entries (impl_device,
update,
@@ -1073,16 +1055,6 @@ err_planes_not_assigned:
failed_planes = generate_all_failed_feedbacks (update);
err_planes_assigned:
- for (l = meta_kms_update_get_page_flips (update); l; l = l->next)
- {
- MetaKmsPageFlip *page_flip = l->data;
-
- if (page_flip->flags & META_KMS_PAGE_FLIP_FLAG_NO_DISCARD_FEEDBACK)
- continue;
-
- discard_page_flip (impl_device, update, page_flip);
- }
-
return meta_kms_feedback_new_failed (failed_planes, error);
}
diff --git a/src/backends/native/meta-kms-update-private.h b/src/backends/native/meta-kms-update-private.h
index 90fb475fe8..463aaf0cfd 100644
--- a/src/backends/native/meta-kms-update-private.h
+++ b/src/backends/native/meta-kms-update-private.h
@@ -90,7 +90,6 @@ typedef struct _MetaKmsPageFlip
{
MetaKmsCrtc *crtc;
const MetaKmsPageFlipFeedback *feedback;
- MetaKmsPageFlipFlag flags;
gpointer user_data;
} MetaKmsPageFlip;
diff --git a/src/backends/native/meta-kms-update.c b/src/backends/native/meta-kms-update.c
index 0436a1d3da..527c6ef12f 100644
--- a/src/backends/native/meta-kms-update.c
+++ b/src/backends/native/meta-kms-update.c
@@ -325,7 +325,6 @@ void
meta_kms_update_page_flip (MetaKmsUpdate *update,
MetaKmsCrtc *crtc,
const MetaKmsPageFlipFeedback *feedback,
- MetaKmsPageFlipFlag flags,
gpointer user_data)
{
MetaKmsPageFlip *page_flip;
@@ -337,7 +336,6 @@ meta_kms_update_page_flip (MetaKmsUpdate *update,
*page_flip = (MetaKmsPageFlip) {
.crtc = crtc,
.feedback = feedback,
- .flags = flags,
.user_data = user_data,
};
diff --git a/src/backends/native/meta-kms-update.h b/src/backends/native/meta-kms-update.h
index cb5c5b08be..afd82b3a0e 100644
--- a/src/backends/native/meta-kms-update.h
+++ b/src/backends/native/meta-kms-update.h
@@ -42,12 +42,6 @@ typedef enum _MetaKmsAssignPlaneFlag
META_KMS_ASSIGN_PLANE_FLAG_FB_UNCHANGED = 1 << 0,
} MetaKmsAssignPlaneFlag;
-typedef enum _MetaKmsPageFlipFlag
-{
- META_KMS_PAGE_FLIP_FLAG_NONE = 0,
- META_KMS_PAGE_FLIP_FLAG_NO_DISCARD_FEEDBACK = 1 << 0,
-} MetaKmsPageFlipFlag;
-
struct _MetaKmsPageFlipFeedback
{
void (* flipped) (MetaKmsCrtc *crtc,
@@ -125,7 +119,6 @@ MetaKmsPlaneAssignment * meta_kms_update_unassign_plane (MetaKmsUpdate *update,
void meta_kms_update_page_flip (MetaKmsUpdate *update,
MetaKmsCrtc *crtc,
const MetaKmsPageFlipFeedback *feedback,
- MetaKmsPageFlipFlag flags,
gpointer user_data);
void meta_kms_update_set_custom_page_flip (MetaKmsUpdate *update,
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index d49076303f..6b6c59f623 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -1250,10 +1250,9 @@ queue_dummy_power_save_page_flip (CoglOnscreen *onscreen)
}
static void
-meta_onscreen_native_flip_crtc (CoglOnscreen *onscreen,
- MetaRendererView *view,
- MetaCrtc *crtc,
- MetaKmsPageFlipFlag flags)
+meta_onscreen_native_flip_crtc (CoglOnscreen *onscreen,
+ MetaRendererView *view,
+ MetaCrtc *crtc)
{
CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
MetaOnscreenNative *onscreen_native = onscreen_egl->platform;
@@ -1305,7 +1304,6 @@ meta_onscreen_native_flip_crtc (CoglOnscreen *onscreen,
meta_kms_update_page_flip (kms_update,
meta_crtc_kms_get_kms_crtc (crtc_kms),
&page_flip_feedback,
- flags,
g_object_ref (view));
}
@@ -1348,8 +1346,7 @@ meta_onscreen_native_set_crtc_mode (CoglOnscreen *onscreen,
}
static void
-meta_onscreen_native_flip_crtcs (CoglOnscreen *onscreen,
- MetaKmsPageFlipFlag flags)
+meta_onscreen_native_flip_crtcs (CoglOnscreen *onscreen)
{
CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
MetaOnscreenNative *onscreen_native = onscreen_egl->platform;
@@ -1358,8 +1355,7 @@ meta_onscreen_native_flip_crtcs (CoglOnscreen *onscreen,
COGL_TRACE_BEGIN_SCOPED (MetaOnscreenNativeFlipCrtcs,
"Onscreen (flip CRTCs)");
- meta_onscreen_native_flip_crtc (onscreen, view, onscreen_native->crtc,
- flags);
+ meta_onscreen_native_flip_crtc (onscreen, view, onscreen_native->crtc);
}
static gboolean
@@ -1988,7 +1984,7 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
if (power_save_mode == META_POWER_SAVE_ON)
{
ensure_crtc_modes (onscreen);
- meta_onscreen_native_flip_crtcs (onscreen, META_KMS_PAGE_FLIP_FLAG_NONE);
+ meta_onscreen_native_flip_crtcs (onscreen);
}
else
{
@@ -2192,8 +2188,7 @@ meta_onscreen_native_direct_scanout (CoglOnscreen *onscreen,
g_set_object (&onscreen_native->gbm.next_fb, META_DRM_BUFFER (scanout));
ensure_crtc_modes (onscreen);
- meta_onscreen_native_flip_crtcs (onscreen,
- META_KMS_PAGE_FLIP_FLAG_NO_DISCARD_FEEDBACK);
+ meta_onscreen_native_flip_crtcs (onscreen);
kms_crtc = meta_crtc_kms_get_kms_crtc (META_CRTC_KMS (onscreen_native->crtc));
kms_device = meta_kms_crtc_get_device (kms_crtc);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]