* [PATCH] qxl: don't unref cursor bo inside atomic section (release mapping).
@ 2018-06-18 2:32 Dave Airlie
2018-06-18 7:39 ` Daniel Vetter
0 siblings, 1 reply; 2+ messages in thread
From: Dave Airlie @ 2018-06-18 2:32 UTC (permalink / raw)
To: dri-devel
From: Dave Airlie <airlied@redhat.com>
Fixes: 9428088c (drm/qxl: reapply cursor after resetting primary)
Reported-by: Mike Galbraith <efault@gmx.de>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/qxl/qxl_display.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index b8cda9449241..768207fbbae3 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -623,7 +623,7 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane,
struct qxl_cursor_cmd *cmd;
struct qxl_cursor *cursor;
struct drm_gem_object *obj;
- struct qxl_bo *cursor_bo = NULL, *user_bo = NULL;
+ struct qxl_bo *cursor_bo = NULL, *user_bo = NULL, *old_cursor_bo = NULL;
int ret;
void *user_ptr;
int size = 64*64*4;
@@ -677,7 +677,7 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane,
cursor_bo, 0);
cmd->type = QXL_CURSOR_SET;
- qxl_bo_unref(&qcrtc->cursor_bo);
+ old_cursor_bo = qcrtc->cursor_bo;
qcrtc->cursor_bo = cursor_bo;
cursor_bo = NULL;
} else {
@@ -697,6 +697,9 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane,
qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
qxl_release_fence_buffer_objects(release);
+ if (old_cursor_bo)
+ qxl_bo_unref(&old_cursor_bo);
+
qxl_bo_unref(&cursor_bo);
return;
--
2.17.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] qxl: don't unref cursor bo inside atomic section (release mapping).
2018-06-18 2:32 [PATCH] qxl: don't unref cursor bo inside atomic section (release mapping) Dave Airlie
@ 2018-06-18 7:39 ` Daniel Vetter
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2018-06-18 7:39 UTC (permalink / raw)
To: Dave Airlie; +Cc: dri-devel
On Mon, Jun 18, 2018 at 12:32:29PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
>
> Fixes: 9428088c (drm/qxl: reapply cursor after resetting primary)
> Reported-by: Mike Galbraith <efault@gmx.de>
> Cc: stable@vger.kernel.org
> Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/qxl/qxl_display.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> index b8cda9449241..768207fbbae3 100644
> --- a/drivers/gpu/drm/qxl/qxl_display.c
> +++ b/drivers/gpu/drm/qxl/qxl_display.c
> @@ -623,7 +623,7 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane,
> struct qxl_cursor_cmd *cmd;
> struct qxl_cursor *cursor;
> struct drm_gem_object *obj;
> - struct qxl_bo *cursor_bo = NULL, *user_bo = NULL;
> + struct qxl_bo *cursor_bo = NULL, *user_bo = NULL, *old_cursor_bo = NULL;
> int ret;
> void *user_ptr;
> int size = 64*64*4;
> @@ -677,7 +677,7 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane,
> cursor_bo, 0);
> cmd->type = QXL_CURSOR_SET;
>
> - qxl_bo_unref(&qcrtc->cursor_bo);
> + old_cursor_bo = qcrtc->cursor_bo;
> qcrtc->cursor_bo = cursor_bo;
> cursor_bo = NULL;
> } else {
> @@ -697,6 +697,9 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane,
> qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
> qxl_release_fence_buffer_objects(release);
>
> + if (old_cursor_bo)
> + qxl_bo_unref(&old_cursor_bo);
> +
> qxl_bo_unref(&cursor_bo);
>
> return;
> --
> 2.17.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-18 7:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 2:32 [PATCH] qxl: don't unref cursor bo inside atomic section (release mapping) Dave Airlie
2018-06-18 7:39 ` Daniel Vetter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.