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
This commit is contained in:
Jonas Ådahl 2019-11-09 11:47:34 +01:00
parent f3cdc9906c
commit 438f75e6b3

View File

@ -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;
}
}