Suggested-by: Thomas Zimmermann <tzimmermann at suse.de> Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> --- drivers/gpu/drm/qxl/qxl_display.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 60331e31861a..d25fd3acc891 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -802,12 +802,14 @@ static int qxl_plane_prepare_fb(struct drm_plane *plane, } if (user_bo->shadow != qdev->dumb_shadow_bo) { if (user_bo->shadow) { + qxl_bo_unpin(user_bo->shadow); drm_gem_object_put (&user_bo->shadow->tbo.base); user_bo->shadow = NULL; } drm_gem_object_get(&qdev->dumb_shadow_bo->tbo.base); user_bo->shadow = qdev->dumb_shadow_bo; + qxl_bo_pin(user_bo->shadow); } } @@ -833,6 +835,7 @@ static void qxl_plane_cleanup_fb(struct drm_plane *plane, qxl_bo_unpin(user_bo); if (old_state->fb != plane->state->fb && user_bo->shadow) { + qxl_bo_unpin(user_bo->shadow); drm_gem_object_put(&user_bo->shadow->tbo.base); user_bo->shadow = NULL; } @@ -1230,6 +1233,7 @@ int qxl_modeset_init(struct qxl_device *qdev) void qxl_modeset_fini(struct qxl_device *qdev) { if (qdev->dumb_shadow_bo) { + qxl_bo_unpin(qdev->dumb_shadow_bo); drm_gem_object_put(&qdev->dumb_shadow_bo->tbo.base); qdev->dumb_shadow_bo = NULL; } -- 2.29.2
Thomas Zimmermann
2021-Feb-04 18:18 UTC
[PATCH v6 06/10] drm/qxl: properly pin/unpin shadow
Am 04.02.21 um 15:57 schrieb Gerd Hoffmann:> Suggested-by: Thomas Zimmermann <tzimmermann at suse.de> > Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>Thanks for this. Acked-by: Thomas Zimmermann <tzimmermann at suse.de>> --- > drivers/gpu/drm/qxl/qxl_display.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c > index 60331e31861a..d25fd3acc891 100644 > --- a/drivers/gpu/drm/qxl/qxl_display.c > +++ b/drivers/gpu/drm/qxl/qxl_display.c > @@ -802,12 +802,14 @@ static int qxl_plane_prepare_fb(struct drm_plane *plane, > } > if (user_bo->shadow != qdev->dumb_shadow_bo) { > if (user_bo->shadow) { > + qxl_bo_unpin(user_bo->shadow); > drm_gem_object_put > (&user_bo->shadow->tbo.base); > user_bo->shadow = NULL; > } > drm_gem_object_get(&qdev->dumb_shadow_bo->tbo.base); > user_bo->shadow = qdev->dumb_shadow_bo; > + qxl_bo_pin(user_bo->shadow); > } > } > > @@ -833,6 +835,7 @@ static void qxl_plane_cleanup_fb(struct drm_plane *plane, > qxl_bo_unpin(user_bo); > > if (old_state->fb != plane->state->fb && user_bo->shadow) { > + qxl_bo_unpin(user_bo->shadow); > drm_gem_object_put(&user_bo->shadow->tbo.base); > user_bo->shadow = NULL; > } > @@ -1230,6 +1233,7 @@ int qxl_modeset_init(struct qxl_device *qdev) > void qxl_modeset_fini(struct qxl_device *qdev) > { > if (qdev->dumb_shadow_bo) { > + qxl_bo_unpin(qdev->dumb_shadow_bo); > drm_gem_object_put(&qdev->dumb_shadow_bo->tbo.base); > qdev->dumb_shadow_bo = NULL; > } >-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N?rnberg, Germany (HRB 36809, AG N?rnberg) Gesch?ftsf?hrer: Felix Imend?rffer -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 840 bytes Desc: OpenPGP digital signature URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20210204/854955f4/attachment.sig>