[mutter] crtc: Move renderer private to MetaKmsCrtc
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] crtc: Move renderer private to MetaKmsCrtc
- Date: Wed, 10 Jun 2020 19:19:30 +0000 (UTC)
commit 569a183828fd2505af8a528d647fb604fcff86ae
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Mon Feb 24 22:39:02 2020 +0100
crtc: Move renderer private to MetaKmsCrtc
It's used only by the native cursor renderer.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287
src/backends/meta-crtc.h | 3 ---
src/backends/native/meta-crtc-kms.c | 19 +++++++++++++++++++
src/backends/native/meta-crtc-kms.h | 5 +++++
src/backends/native/meta-cursor-renderer-native.c | 18 ++++++++++++------
4 files changed, 36 insertions(+), 9 deletions(-)
---
diff --git a/src/backends/meta-crtc.h b/src/backends/meta-crtc.h
index 0d12c51614..d9a47dc89a 100644
--- a/src/backends/meta-crtc.h
+++ b/src/backends/meta-crtc.h
@@ -70,9 +70,6 @@ struct _MetaCrtc
/* Used when changing configuration */
gboolean is_dirty;
- /* Used by cursor renderer backend */
- void *cursor_renderer_private;
-
gpointer driver_private;
GDestroyNotify driver_notify;
};
diff --git a/src/backends/native/meta-crtc-kms.c b/src/backends/native/meta-crtc-kms.c
index 2d570b2de0..3bff4e2b51 100644
--- a/src/backends/native/meta-crtc-kms.c
+++ b/src/backends/native/meta-crtc-kms.c
@@ -39,10 +39,29 @@ typedef struct _MetaCrtcKms
MetaKmsCrtc *kms_crtc;
MetaKmsPlane *primary_plane;
+
+ gpointer cursor_renderer_private;
} MetaCrtcKms;
static GQuark kms_crtc_crtc_kms_quark;
+gpointer
+meta_crtc_kms_get_cursor_renderer_private (MetaCrtc *crtc)
+{
+ MetaCrtcKms *crtc_kms = crtc->driver_private;
+
+ return crtc_kms->cursor_renderer_private;
+}
+
+void
+meta_crtc_kms_set_cursor_renderer_private (MetaCrtc *crtc,
+ gpointer cursor_renderer_private)
+{
+ MetaCrtcKms *crtc_kms = crtc->driver_private;
+
+ crtc_kms->cursor_renderer_private = cursor_renderer_private;
+}
+
gboolean
meta_crtc_kms_is_transform_handled (MetaCrtc *crtc,
MetaMonitorTransform transform)
diff --git a/src/backends/native/meta-crtc-kms.h b/src/backends/native/meta-crtc-kms.h
index 8986224786..4707635676 100644
--- a/src/backends/native/meta-crtc-kms.h
+++ b/src/backends/native/meta-crtc-kms.h
@@ -31,6 +31,11 @@
#include "backends/native/meta-gpu-kms.h"
#include "backends/native/meta-kms-crtc.h"
+gpointer meta_crtc_kms_get_cursor_renderer_private (MetaCrtc *crtc);
+
+void meta_crtc_kms_set_cursor_renderer_private (MetaCrtc *crtc,
+ gpointer cursor_renderer_private);
+
gboolean meta_crtc_kms_is_transform_handled (MetaCrtc *crtc,
MetaMonitorTransform transform);
diff --git a/src/backends/native/meta-cursor-renderer-native.c
b/src/backends/native/meta-cursor-renderer-native.c
index 8875ce15f4..34376b7ed9 100644
--- a/src/backends/native/meta-cursor-renderer-native.c
+++ b/src/backends/native/meta-cursor-renderer-native.c
@@ -272,6 +272,7 @@ set_crtc_cursor (MetaCursorRendererNative *native,
int cursor_width, cursor_height;
MetaFixed16Rectangle src_rect;
MetaFixed16Rectangle dst_rect;
+ struct gbm_bo *crtc_bo;
MetaKmsAssignPlaneFlag flags;
int cursor_hotspot_x;
int cursor_hotspot_y;
@@ -305,7 +306,8 @@ set_crtc_cursor (MetaCursorRendererNative *native,
};
flags = META_KMS_ASSIGN_PLANE_FLAG_NONE;
- if (!priv->hw_state_invalidated && bo == crtc->cursor_renderer_private)
+ crtc_bo = meta_crtc_kms_get_cursor_renderer_private (crtc);
+ if (!priv->hw_state_invalidated && bo == crtc_bo)
flags |= META_KMS_ASSIGN_PLANE_FLAG_FB_UNCHANGED;
plane_assignment = meta_kms_update_assign_plane (kms_update,
@@ -323,7 +325,7 @@ set_crtc_cursor (MetaCursorRendererNative *native,
cursor_hotspot_x,
cursor_hotspot_y);
- crtc->cursor_renderer_private = bo;
+ meta_crtc_kms_set_cursor_renderer_private (crtc, bo);
if (cursor_gpu_state->pending_bo_state == META_CURSOR_GBM_BO_STATE_SET)
{
@@ -343,8 +345,10 @@ unset_crtc_cursor (MetaCursorRendererNative *native,
MetaKmsCrtc *kms_crtc;
MetaKmsDevice *kms_device;
MetaKmsPlane *cursor_plane;
+ struct gbm_bo *crtc_bo;
- if (!priv->hw_state_invalidated && !crtc->cursor_renderer_private)
+ crtc_bo = meta_crtc_kms_get_cursor_renderer_private (crtc);
+ if (!priv->hw_state_invalidated && !crtc_bo)
return;
kms_crtc = meta_crtc_kms_get_kms_crtc (crtc);
@@ -354,7 +358,7 @@ unset_crtc_cursor (MetaCursorRendererNative *native,
if (cursor_plane)
meta_kms_update_unassign_plane (kms_update, kms_crtc, cursor_plane);
- crtc->cursor_renderer_private = NULL;
+ meta_crtc_kms_set_cursor_renderer_private (crtc, NULL);
}
static float
@@ -1050,9 +1054,11 @@ unset_crtc_cursor_renderer_privates (MetaGpu *gpu,
for (l = meta_gpu_get_crtcs (gpu); l; l = l->next)
{
MetaCrtc *crtc = l->data;
+ struct gbm_bo *crtc_bo;
- if (bo == crtc->cursor_renderer_private)
- crtc->cursor_renderer_private = NULL;
+ crtc_bo = meta_crtc_kms_get_cursor_renderer_private (crtc);
+ if (bo == crtc_bo)
+ meta_crtc_kms_set_cursor_renderer_private (crtc, NULL);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]