[mutter] cursor-renderer-native: Get cursor size from MetaKmsDevice



commit 438f75e6b30fe42cf1013687b761970ec622e554
Author: Jonas Ådahl <jadahl gmail com>
Date:   Sat Nov 9 11:47:34 2019 +0100

    cursor-renderer-native: Get cursor size from MetaKmsDevice
    
    It now provides this information, so don't get it ourself.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/930

 src/backends/native/meta-cursor-renderer-native.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/src/backends/native/meta-cursor-renderer-native.c 
b/src/backends/native/meta-cursor-renderer-native.c
index 2f1996dcc..4195b60a0 100644
--- a/src/backends/native/meta-cursor-renderer-native.c
+++ b/src/backends/native/meta-cursor-renderer-native.c
@@ -1252,8 +1252,8 @@ init_hw_cursor_support (MetaCursorRendererNative *cursor_renderer_native)
   for (l = gpus; l; l = l->next)
     {
       MetaGpuKms *gpu_kms = l->data;
+      MetaKmsDevice *kms_device = meta_gpu_kms_get_kms_device (gpu_kms);
       MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
-      int kms_fd;
       struct gbm_device *gbm_device;
       uint64_t width, height;
 
@@ -1264,18 +1264,14 @@ init_hw_cursor_support (MetaCursorRendererNative *cursor_renderer_native)
       cursor_renderer_gpu_data =
         meta_create_cursor_renderer_native_gpu_data (gpu_kms);
 
-      kms_fd = meta_gpu_kms_get_fd (gpu_kms);
-      if (drmGetCap (kms_fd, DRM_CAP_CURSOR_WIDTH, &width) == 0 &&
-          drmGetCap (kms_fd, DRM_CAP_CURSOR_HEIGHT, &height) == 0)
+      if (!meta_kms_device_get_cursor_size (kms_device, &width, &height))
         {
-          cursor_renderer_gpu_data->cursor_width = width;
-          cursor_renderer_gpu_data->cursor_height = height;
-        }
-      else
-        {
-          cursor_renderer_gpu_data->cursor_width = 64;
-          cursor_renderer_gpu_data->cursor_height = 64;
+          width = 64;
+          height = 64;
         }
+
+      cursor_renderer_gpu_data->cursor_width = width;
+      cursor_renderer_gpu_data->cursor_height = height;
     }
 }
 


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