cursor-renderer-native: Don't retry forever after GBM cursor functions fail
This avoids flooding the log with every cursor change: ``` (gnome-shell:19923): libmutter-WARNING **: 10:15:23.404: Realizing HW cursor failed: Failed to allocate gbm_bo: Invalid argument (gnome-shell:19923): libmutter-WARNING **: 10:15:23.450: Realizing HW cursor failed: Failed to allocate gbm_bo: Invalid argument (gnome-shell:19923): libmutter-WARNING **: 10:15:23.451: Realizing HW cursor failed: Failed to allocate gbm_bo: Invalid argument ``` Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2354 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2520>
This commit is contained in:
parent
c430731436
commit
2a725f0bd9
@ -502,12 +502,9 @@ unset_crtc_cursor (MetaCursorRendererNative *native,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
disable_hw_cursor_for_crtc (MetaKmsCrtc *kms_crtc,
|
disable_hw_cursor_for_gpu (MetaGpuKms *gpu_kms,
|
||||||
const GError *error)
|
const GError *error)
|
||||||
{
|
{
|
||||||
MetaCrtcKms *crtc_kms = meta_crtc_kms_from_kms_crtc (kms_crtc);
|
|
||||||
MetaCrtc *crtc = META_CRTC (crtc_kms);
|
|
||||||
MetaGpuKms *gpu_kms = META_GPU_KMS (meta_crtc_get_gpu (crtc));
|
|
||||||
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data =
|
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data =
|
||||||
meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms);
|
meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms);
|
||||||
|
|
||||||
@ -517,6 +514,17 @@ disable_hw_cursor_for_crtc (MetaKmsCrtc *kms_crtc,
|
|||||||
cursor_renderer_gpu_data->hw_cursor_broken = TRUE;
|
cursor_renderer_gpu_data->hw_cursor_broken = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
disable_hw_cursor_for_crtc (MetaKmsCrtc *kms_crtc,
|
||||||
|
const GError *error)
|
||||||
|
{
|
||||||
|
MetaCrtcKms *crtc_kms = meta_crtc_kms_from_kms_crtc (kms_crtc);
|
||||||
|
MetaCrtc *crtc = META_CRTC (crtc_kms);
|
||||||
|
MetaGpuKms *gpu_kms = META_GPU_KMS (meta_crtc_get_gpu (crtc));
|
||||||
|
|
||||||
|
disable_hw_cursor_for_gpu (gpu_kms, error);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_cursor_renderer_native_prepare_frame (MetaCursorRendererNative *cursor_renderer_native,
|
meta_cursor_renderer_native_prepare_frame (MetaCursorRendererNative *cursor_renderer_native,
|
||||||
MetaRendererView *view)
|
MetaRendererView *view)
|
||||||
@ -1384,6 +1392,7 @@ load_cursor_sprite_gbm_buffer_for_gpu (MetaCursorRendererNative *native,
|
|||||||
g_warning ("Failed to open '%s' for updating the cursor: %s",
|
g_warning ("Failed to open '%s' for updating the cursor: %s",
|
||||||
meta_gpu_kms_get_file_path (gpu_kms),
|
meta_gpu_kms_get_file_path (gpu_kms),
|
||||||
error->message);
|
error->message);
|
||||||
|
disable_hw_cursor_for_gpu (gpu_kms, error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1397,6 +1406,7 @@ load_cursor_sprite_gbm_buffer_for_gpu (MetaCursorRendererNative *native,
|
|||||||
if (!buffer)
|
if (!buffer)
|
||||||
{
|
{
|
||||||
g_warning ("Realizing HW cursor failed: %s", error->message);
|
g_warning ("Realizing HW cursor failed: %s", error->message);
|
||||||
|
disable_hw_cursor_for_gpu (gpu_kms, error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user