Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1554621pxb; Thu, 4 Feb 2021 16:38:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJydl+sDukcrBNLqOzBe7E+w3OZrnvT1LJysG8jMb7X7MiOEYrMmzodeMoXUbqCIxqMf7L93 X-Received: by 2002:a17:906:589:: with SMTP id 9mr1614559ejn.229.1612485524949; Thu, 04 Feb 2021 16:38:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612485524; cv=none; d=google.com; s=arc-20160816; b=0ZQubkjaKIGrupweGi+Qn108rjHhGdRmPrKzvDFLUMBzKuvBnoMnToyCAua6Pj2hXV xj+IGCCavtTb+NA4FevdYgk7LgSpg8Pscys7RVoot/aCX6ZA2SvqmpmpxAjBmTv8cMtB o86hs+63fk0q3mUkudipFMflTI292T1sLbm+vd8UipBknY/McE40N2AdqaDMzcvA6Uwb GO5T9Q6rcMQ0zWHHl2tOfzQt0tHUGVbhz4M5q2G53mMKsn/cxe3d/rT4viBdBxbiLKM0 yvpMFusuphqrhrAlXqg8C0INO+mzZ6fyOSFGyD301vcdtsTd/2qHn4McWEtlHdluj6r0 kU9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EA/nqaRotJYvNBeiSlgDMpuTxEUgkrxx00l2lNqSnQk=; b=cYu1XKApmpDSwh9Plu18KhieXfxInYAWluYraUUakvnE5G4HQzWobqs5GvI0W3UBaz YH0eFHXIL3SNwg2ION1U5RT3YLUNm1d9sksQAyF6ow1B//MgSVVzrJH3LPXrJkvKQqpI USpKdKzpEmoP6WDUgyXKW7vtsR4tW0q9JzL+eCHUjBbh1/QbOy+//m7hS9D3sByHO9t7 kN3uFsQSZzMl2j0/IxgITeyOemP8lp7xptyHDbQyr2QluQIfsyIcPUmBE9BULMr9pf5H yBf38s6ft8m2b4tIMyZY77gPIsMnXW8Zg+HwX80d7g/imMe4PhfoHI5D6k8S6wW8tsi0 y5GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dLMjopbK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si4102712eda.391.2021.02.04.16.38.20; Thu, 04 Feb 2021 16:38:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dLMjopbK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236995AbhBDPDN (ORCPT + 99 others); Thu, 4 Feb 2021 10:03:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47068 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237071AbhBDO6s (ORCPT ); Thu, 4 Feb 2021 09:58:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612450642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EA/nqaRotJYvNBeiSlgDMpuTxEUgkrxx00l2lNqSnQk=; b=dLMjopbKAhqcXOXMtbwcmT5i6yFrYQaJMUlFaw5Ao/14C4SJ+HElKP5w8KgCWIe0ZbvrmN 4mUcGbiTJB3AywoBmA05butUkx9YnmU+CK1uMbG27vzJRON4F3IJdtzeeQzg7BZ/c1064h tGsYdZcQkyWBvaBKc1HKxovNKiD9JVM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-40-FOeDsbq6PK-AybmChuKnxg-1; Thu, 04 Feb 2021 09:57:20 -0500 X-MC-Unique: FOeDsbq6PK-AybmChuKnxg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3B03C80402E; Thu, 4 Feb 2021 14:57:19 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-108.ams2.redhat.com [10.36.113.108]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EFCE45D6D7; Thu, 4 Feb 2021 14:57:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C26801801022; Thu, 4 Feb 2021 15:57:12 +0100 (CET) From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org Cc: Gerd Hoffmann , Thomas Zimmermann , Dave Airlie , David Airlie , Daniel Vetter , virtualization@lists.linux-foundation.org (open list:DRM DRIVER FOR QXL VIRTUAL GPU), spice-devel@lists.freedesktop.org (open list:DRM DRIVER FOR QXL VIRTUAL GPU), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v6 06/10] drm/qxl: properly pin/unpin shadow Date: Thu, 4 Feb 2021 15:57:07 +0100 Message-Id: <20210204145712.1531203-7-kraxel@redhat.com> In-Reply-To: <20210204145712.1531203-1-kraxel@redhat.com> References: <20210204145712.1531203-1-kraxel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Suggested-by: Thomas Zimmermann Signed-off-by: Gerd Hoffmann --- 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