Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3400278pxj; Tue, 11 May 2021 03:46:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9TSS4h2zJgr6RxVuxcIY4oaNbn7byzz9mmH7zHtX6ATU5obnWW8u6Rc+b3S1fJIFRZLmd X-Received: by 2002:a05:6e02:20c1:: with SMTP id 1mr24424751ilq.71.1620730017332; Tue, 11 May 2021 03:46:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620730017; cv=none; d=google.com; s=arc-20160816; b=meBE4ird+rD7nBdETKB5gk1bY2HkY1ZxDCbz5sOq9HUd9IhXVh60CqG/00T2jjRmGz U1j3jsXH21kpEkbSCZGOgOiU8p+zet0C6qjxI/s6BwxjLwiwV/u2MtZOOlcyBNGyKkiv fRAPAf3rn+bsmq6tUyGx7GuOwK2AA8AIrIcKxHnW993bH7iNzS3hi38Ag8qOYAx82tJM hbhwPeamBZoGQaS+Ctox8K5AghvRY9kIgHPG+CmdPjuUzY1xTt2qtSvpUqA+D+YolOhd xeaHmf6wXI8NBHL3lCTggIxUCuk894xMIMcoeXsFZQx4E6YMayJ2K5q0LtYsZ3gaxoCJ LNrw== 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=fz6APZgVVSzyZ2NvuvgdrfUOBc1EEiPUznfJ8AorQ6Y=; b=IR/RUDsIgifbYrGWR80DFAvNG43hKrIXWcCnljqfGpRvQ7sWlvwA/JpgfOL5UsP3vo KJT16PGEgLI8xxhH81wNeTdljpeQmO7tkDU/n2RysX1abky1o5lxUf85qxHjA4XdaW42 cqJj8xL0ks3TkeIMNX1lI3OxW+Rcf2nJ9cjGQXw74Z999Js/O9QXQ7dMqCALUPG1C5qM fBQp7Z4WFKsNKNMYT8ecgY0R34NZadPIAHC8H95/x9HhbA7QUsEcU9aIOHpUSBOZ6PGi uYATWW277iPVUZW2RXI9gYr2E8bkmbBSr3z+iu0e6i0XDAVFxACJJIpHRhhjqMBF29QW pkLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P1IyKn2k; 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 l11si13411229jah.65.2021.05.11.03.46.45; Tue, 11 May 2021 03:46:57 -0700 (PDT) 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=P1IyKn2k; 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 S231392AbhEKKqr (ORCPT + 99 others); Tue, 11 May 2021 06:46:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52154 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231386AbhEKKql (ORCPT ); Tue, 11 May 2021 06:46:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620729934; 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=fz6APZgVVSzyZ2NvuvgdrfUOBc1EEiPUznfJ8AorQ6Y=; b=P1IyKn2kq6O4SYE9rvB/v9k7toqO+g5gtnaNC6srUHipr87TovfFarZXfhTXdX/xrfAKgH dTAcxd/dv1VUDtsQswILCQFylVd1YuVkqz01vWEoFgfgqhW1bbU+adO9e+0ljP8J80tUU0 omJDtp2MnfFbFef5kvUVTibe6ik0SvU= 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-46-_56KFLUAMf2Yly7CyqlIag-1; Tue, 11 May 2021 06:45:33 -0400 X-MC-Unique: _56KFLUAMf2Yly7CyqlIag-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 9C0F5100670E; Tue, 11 May 2021 10:45:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-11.ams2.redhat.com [10.36.112.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0BA3462499; Tue, 11 May 2021 10:45:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 577201800904; Tue, 11 May 2021 12:45:22 +0200 (CEST) From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org Cc: Gerd Hoffmann , 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 2/2] drm/qxl: balance dumb_shadow_bo pin Date: Tue, 11 May 2021 12:45:22 +0200 Message-Id: <20210511104522.2694803-3-kraxel@redhat.com> In-Reply-To: <20210511104522.2694803-1-kraxel@redhat.com> References: <20210511104522.2694803-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 The shadow bo is created in pinned state, so we have to unpin it when dropping the reference. Otherwise ttm is unhappy and throws a WARN() on release. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index be5183733c1b..9e0a1e836011 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -801,6 +801,7 @@ static void qxl_prepare_shadow(struct qxl_device *qdev, struct qxl_bo *user_bo, qdev->dumb_shadow_bo->surf.width != surf.width || qdev->dumb_shadow_bo->surf.height != surf.height) { 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.31.1