From patchwork Tue Aug 18 09:20:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11720449 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8D0A61392 for ; Tue, 18 Aug 2020 09:20:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6C62C2075E for ; Tue, 18 Aug 2020 09:20:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="V8+OBmir" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C62C2075E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E9A7F89D8D; Tue, 18 Aug 2020 09:20:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB99C89D8D for ; Tue, 18 Aug 2020 09:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597742427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=pw595Aj/46zo0ERIuwv1IEbY3YqPvqwxwOPHQJVu1hs=; b=V8+OBmirTOvWk2jZBoZf2EJPX8RuYHQiG7WYOUDbIe2Qt/2RSn7ONPFa+/tIKFPOAZnuXX I0g+IffWNPUdyAQ+alWM7Dt/oM4SRxybi1HvK4T57Mlkz8NFd/wUpgHFRgmWwqLcgpib9X T++gMFIuB6ON1RNa4JEsAS0zF5/1k7Q= 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-461-6GGjtExdPOycVoy0rIiN8w-1; Tue, 18 Aug 2020 05:20:24 -0400 X-MC-Unique: 6GGjtExdPOycVoy0rIiN8w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE0451007465; Tue, 18 Aug 2020 09:20:22 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-195.ams2.redhat.com [10.36.112.195]) by smtp.corp.redhat.com (Postfix) with ESMTP id 203131001901; Tue, 18 Aug 2020 09:20:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4BEEB9AE3; Tue, 18 Aug 2020 11:20:18 +0200 (CEST) From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 2/2] drm/virtio: set max_segment Date: Tue, 18 Aug 2020 11:20:17 +0200 Message-Id: <20200818092017.26290-3-kraxel@redhat.com> In-Reply-To: <20200818092017.26290-1-kraxel@redhat.com> References: <20200818092017.26290-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , open list , "open list:VIRTIO GPU DRIVER" , Gerd Hoffmann , christian.koenig@amd.com MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When initializing call virtio_max_dma_size() to figure the scatter list limit. Needed to make virtio-gpu work properly with SEV. v2: place max_segment in drm driver not gem object. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_kms.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c index bf060c69850f..5a4364c00fae 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c @@ -114,6 +114,7 @@ int virtio_gpu_init(struct drm_device *dev) vgdev->ddev = dev; dev->dev_private = vgdev; + dev->max_segment = virtio_max_dma_size(vgdev->vdev); vgdev->vdev = dev_to_virtio(dev->dev); vgdev->dev = dev->dev;