mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
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:
parent
f3cdc9906c
commit
438f75e6b3
@ -1252,8 +1252,8 @@ init_hw_cursor_support (MetaCursorRendererNative *cursor_renderer_native)
|
|||||||
for (l = gpus; l; l = l->next)
|
for (l = gpus; l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaGpuKms *gpu_kms = l->data;
|
MetaGpuKms *gpu_kms = l->data;
|
||||||
|
MetaKmsDevice *kms_device = meta_gpu_kms_get_kms_device (gpu_kms);
|
||||||
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
|
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
|
||||||
int kms_fd;
|
|
||||||
struct gbm_device *gbm_device;
|
struct gbm_device *gbm_device;
|
||||||
uint64_t width, height;
|
uint64_t width, height;
|
||||||
|
|
||||||
@ -1264,18 +1264,14 @@ init_hw_cursor_support (MetaCursorRendererNative *cursor_renderer_native)
|
|||||||
cursor_renderer_gpu_data =
|
cursor_renderer_gpu_data =
|
||||||
meta_create_cursor_renderer_native_gpu_data (gpu_kms);
|
meta_create_cursor_renderer_native_gpu_data (gpu_kms);
|
||||||
|
|
||||||
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
|
if (!meta_kms_device_get_cursor_size (kms_device, &width, &height))
|
||||||
if (drmGetCap (kms_fd, DRM_CAP_CURSOR_WIDTH, &width) == 0 &&
|
|
||||||
drmGetCap (kms_fd, DRM_CAP_CURSOR_HEIGHT, &height) == 0)
|
|
||||||
{
|
{
|
||||||
cursor_renderer_gpu_data->cursor_width = width;
|
width = 64;
|
||||||
cursor_renderer_gpu_data->cursor_height = height;
|
height = 64;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cursor_renderer_gpu_data->cursor_width = 64;
|
|
||||||
cursor_renderer_gpu_data->cursor_height = 64;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cursor_renderer_gpu_data->cursor_width = width;
|
||||||
|
cursor_renderer_gpu_data->cursor_height = height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user