[mutter] kms/update: Add flags to plane assignment



commit 01bab81727e4960ffa4f02813edf5d1fbf25d60d
Author: Jonas Ådahl <jadahl gmail com>
Date:   Fri Nov 8 23:54:43 2019 +0100

    kms/update: Add flags to plane assignment
    
    Currently unused, but will used to let the implementation know when it
    can avoid setting the plane content (i.e. not call drmModeSetCursor()).
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/930

 src/backends/native/meta-crtc-kms.c           |  6 +++++-
 src/backends/native/meta-kms-update-private.h |  1 +
 src/backends/native/meta-kms-update.c         | 14 ++++++++------
 src/backends/native/meta-kms-update.h         | 18 ++++++++++++------
 4 files changed, 26 insertions(+), 13 deletions(-)
---
diff --git a/src/backends/native/meta-crtc-kms.c b/src/backends/native/meta-crtc-kms.c
index de49d6180..2bd6ccdf8 100644
--- a/src/backends/native/meta-crtc-kms.c
+++ b/src/backends/native/meta-crtc-kms.c
@@ -83,6 +83,7 @@ meta_crtc_kms_assign_primary_plane (MetaCrtc      *crtc,
   int x, y;
   MetaFixed16Rectangle src_rect;
   MetaFixed16Rectangle dst_rect;
+  MetaKmsAssignPlaneFlag flags;
   MetaKmsCrtc *kms_crtc;
   MetaKmsDevice *kms_device;
   MetaKmsPlane *primary_kms_plane;
@@ -105,6 +106,8 @@ meta_crtc_kms_assign_primary_plane (MetaCrtc      *crtc,
     .height = meta_fixed_16_from_int (crtc->rect.height),
   };
 
+  flags = META_KMS_ASSIGN_PLANE_FLAG_NONE;
+
   kms_crtc = meta_crtc_kms_get_kms_crtc (crtc);
   kms_device = meta_kms_crtc_get_device (kms_crtc);
   primary_kms_plane = meta_kms_device_get_primary_plane_for (kms_device,
@@ -114,7 +117,8 @@ meta_crtc_kms_assign_primary_plane (MetaCrtc      *crtc,
                                                    primary_kms_plane,
                                                    fb_id,
                                                    src_rect,
-                                                   dst_rect);
+                                                   dst_rect,
+                                                   flags);
   meta_crtc_kms_apply_transform (crtc, plane_assignment);
 }
 
diff --git a/src/backends/native/meta-kms-update-private.h b/src/backends/native/meta-kms-update-private.h
index df7737c9b..43f35c07a 100644
--- a/src/backends/native/meta-kms-update-private.h
+++ b/src/backends/native/meta-kms-update-private.h
@@ -40,6 +40,7 @@ typedef struct _MetaKmsPlaneAssignment
   uint32_t fb_id;
   MetaFixed16Rectangle src_rect;
   MetaFixed16Rectangle dst_rect;
+  MetaKmsAssignPlaneFlag flags;
 
   GList *plane_properties;
 } MetaKmsPlaneAssignment;
diff --git a/src/backends/native/meta-kms-update.c b/src/backends/native/meta-kms-update.c
index c2a5cc440..fca182079 100644
--- a/src/backends/native/meta-kms-update.c
+++ b/src/backends/native/meta-kms-update.c
@@ -75,12 +75,13 @@ meta_kms_mode_set_free (MetaKmsModeSet *mode_set)
 }
 
 MetaKmsPlaneAssignment *
-meta_kms_update_assign_plane (MetaKmsUpdate        *update,
-                              MetaKmsCrtc          *crtc,
-                              MetaKmsPlane         *plane,
-                              uint32_t              fb_id,
-                              MetaFixed16Rectangle  src_rect,
-                              MetaFixed16Rectangle  dst_rect)
+meta_kms_update_assign_plane (MetaKmsUpdate          *update,
+                              MetaKmsCrtc            *crtc,
+                              MetaKmsPlane           *plane,
+                              uint32_t                fb_id,
+                              MetaFixed16Rectangle    src_rect,
+                              MetaFixed16Rectangle    dst_rect,
+                              MetaKmsAssignPlaneFlag  flags)
 {
   MetaKmsPlaneAssignment *plane_assignment;
 
@@ -94,6 +95,7 @@ meta_kms_update_assign_plane (MetaKmsUpdate        *update,
     .fb_id = fb_id,
     .src_rect = src_rect,
     .dst_rect = dst_rect,
+    .flags = flags,
   };
 
   update->plane_assignments = g_list_prepend (update->plane_assignments,
diff --git a/src/backends/native/meta-kms-update.h b/src/backends/native/meta-kms-update.h
index bb663addb..96f0c5c5c 100644
--- a/src/backends/native/meta-kms-update.h
+++ b/src/backends/native/meta-kms-update.h
@@ -29,6 +29,11 @@
 #include "backends/native/meta-kms-types.h"
 #include "meta/boxes.h"
 
+typedef enum _MetaKmsAssignPlaneFlag
+{
+  META_KMS_ASSIGN_PLANE_FLAG_NONE = 0,
+} MetaKmsAssignPlaneFlag;
+
 struct _MetaKmsPageFlipFeedback
 {
   void (* flipped) (MetaKmsCrtc  *crtc,
@@ -59,12 +64,13 @@ void meta_kms_update_mode_set (MetaKmsUpdate   *update,
                                GList           *connectors,
                                drmModeModeInfo *drm_mode);
 
-MetaKmsPlaneAssignment * meta_kms_update_assign_plane (MetaKmsUpdate        *update,
-                                                       MetaKmsCrtc          *crtc,
-                                                       MetaKmsPlane         *plane,
-                                                       uint32_t              fb_id,
-                                                       MetaFixed16Rectangle  src_rect,
-                                                       MetaFixed16Rectangle  dst_rect);
+MetaKmsPlaneAssignment * meta_kms_update_assign_plane (MetaKmsUpdate          *update,
+                                                       MetaKmsCrtc            *crtc,
+                                                       MetaKmsPlane           *plane,
+                                                       uint32_t                fb_id,
+                                                       MetaFixed16Rectangle    src_rect,
+                                                       MetaFixed16Rectangle    dst_rect,
+                                                       MetaKmsAssignPlaneFlag  flags);
 
 MetaKmsPlaneAssignment * meta_kms_update_unassign_plane (MetaKmsUpdate *update,
                                                          MetaKmsCrtc   *crtc,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]