[mutter] output: Add max_bpc support



commit 6ff0d600c3d0fcc945489428b5b1a2d1aca68bfe
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Thu Jun 9 18:44:46 2022 +0800

    output: Add max_bpc support
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2412>

 src/backends/meta-output.c | 19 +++++++++++++++++++
 src/backends/meta-output.h |  7 +++++++
 2 files changed, 26 insertions(+)
---
diff --git a/src/backends/meta-output.c b/src/backends/meta-output.c
index 9d9454fdfe..a02feca90f 100644
--- a/src/backends/meta-output.c
+++ b/src/backends/meta-output.c
@@ -55,6 +55,9 @@ typedef struct _MetaOutputPrivate
 
   gboolean is_underscanning;
 
+  gboolean has_max_bpc;
+  unsigned int max_bpc;
+
   int backlight;
 } MetaOutputPrivate;
 
@@ -177,6 +180,18 @@ meta_output_is_underscanning (MetaOutput *output)
   return priv->is_underscanning;
 }
 
+gboolean
+meta_output_get_max_bpc (MetaOutput   *output,
+                         unsigned int *max_bpc)
+{
+  MetaOutputPrivate *priv = meta_output_get_instance_private (output);
+
+  if (priv->has_max_bpc && max_bpc)
+    *max_bpc = priv->max_bpc;
+
+  return priv->has_max_bpc;
+}
+
 void
 meta_output_set_backlight (MetaOutput *output,
                            int         backlight)
@@ -235,6 +250,10 @@ meta_output_assign_crtc (MetaOutput                 *output,
   priv->is_primary = output_assignment->is_primary;
   priv->is_presentation = output_assignment->is_presentation;
   priv->is_underscanning = output_assignment->is_underscanning;
+
+  priv->has_max_bpc = output_assignment->has_max_bpc;
+  if (priv->has_max_bpc)
+    priv->max_bpc = output_assignment->max_bpc;
 }
 
 void
diff --git a/src/backends/meta-output.h b/src/backends/meta-output.h
index cbacabace9..9970a7a450 100644
--- a/src/backends/meta-output.h
+++ b/src/backends/meta-output.h
@@ -107,6 +107,9 @@ typedef struct _MetaOutputInfo
   gboolean supports_underscanning;
   gboolean supports_color_transform;
 
+  unsigned int max_bpc_min;
+  unsigned int max_bpc_max;
+
   /*
    * Get a new preferred mode on hotplug events, to handle dynamic guest
    * resizing.
@@ -182,6 +185,10 @@ gboolean meta_output_is_presentation (MetaOutput *output);
 META_EXPORT_TEST
 gboolean meta_output_is_underscanning (MetaOutput *output);
 
+META_EXPORT_TEST
+gboolean meta_output_get_max_bpc (MetaOutput   *output,
+                                  unsigned int *max_bpc);
+
 void meta_output_set_backlight (MetaOutput *output,
                                 int         backlight);
 


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