Skip to content

Commit 53f1095

Browse files
stefan11111metux
authored andcommitted
modesetting: Fix leak when disabling hw cursor
Signed-off-by: stefan11111 <[email protected]>
1 parent bd540a8 commit 53f1095

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

hw/xfree86/drivers/video/modesetting/driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ CloseScreen(ScreenPtr pScreen)
22682268
ms->drmmode.shadow_fb2 = NULL;
22692269
}
22702270

2271-
if (!ms->drmmode.sw_cursor) {
2271+
if (!ms->drmmode.sw_cursor || ms->drmmode.set_cursor_failed) {
22722272
xf86_cursors_fini(pScreen);
22732273
}
22742274

hw/xfree86/drivers/video/modesetting/drmmode_display.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,7 @@ drmmode_set_cursor(xf86CrtcPtr crtc, int width, int height)
18431843

18441844
cursor_info->MaxWidth = cursor_info->MaxHeight = 0;
18451845
drmmode_crtc->drmmode->sw_cursor = TRUE;
1846+
drmmode_crtc->drmmode->set_cursor_failed = TRUE;
18461847
}
18471848

18481849
if (ret) {

hw/xfree86/drivers/video/modesetting/drmmode_display.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ typedef struct {
104104
drmEventContext event_context;
105105
drmmode_bo front_bo;
106106
Bool sw_cursor;
107+
Bool set_cursor_failed;
107108

108109
/* Broken-out options. */
109110
OptionInfoPtr Options;

0 commit comments

Comments
 (0)