Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10542312imu; Thu, 6 Dec 2018 02:58:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/XI5pEWBALjMC/XCQiFkfqgYOG44PdQxqqDco+vmATZgFnMSNcpcL33LlCO0p43ci+A9qLs X-Received: by 2002:a17:902:64c1:: with SMTP id y1mr27488092pli.64.1544093906465; Thu, 06 Dec 2018 02:58:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544093906; cv=none; d=google.com; s=arc-20160816; b=k0lLkUummGWcrT/TKWiV15sWTt769rOXUx0wfTrNvxSRGhUfZiU5dS9+1Quq2mGbjl FXDQUJY257d8JJDERyq/bxdohZS3PJa5+NlFXJmGPeRvBYQVVuaBlda5uiXkG1Rxhp3K Pj4aysCch+LqoviQXid73f9rTGeGn0q/FY+YvRMGlOdOq/USs1n+rtAp/eN4w9BnbdGO R6Qhhltuuwolqa5r8UgbCU6Phh6q3fHFZ60bPT08Y7G+ZEuE7JEmKgLOrE0iSFhhOoGv yAT0u/c4bJXk32msQE1ksoukwVSRhlHRlFEGuVFuVhiSdZMWl41FLJ3YFvytVz5YYe8B qfMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=E/UKwQVDIis2Qw7Y1aey9jl2vUT4nlsTMWQ1AI2CZ+M=; b=nKXm1B5FnXf2XXSsRp52Q6NUxZNB9TSdgwBkipWasue/NOI+YuQm6CZ46PR+Lejtzu stEQuWpAhutJLFpUM9PsutqPLwALRDyS1ideGkTyGgMMztF8v2OpOw1IAJ1391orCO9o 9A7gWGwJCVdq5O/cCGPTjWQsKlOLP4G0mWrq4iLoIGystZA2FokOmAfvpjcFATX3SNBb rp4UfBugdsfgqwCof+RRixYU5Sd9EbKmC/c6CJ/V4LLcNOebXwM3B+HhYUF4uHNuBMqU lrq/vMl1jWdvx51zRxLGWWoykwq2qw7cAd82UQc3wRszfXekcrhrjSVqjSeBCNe3Q7wS M3Cw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8si20826plp.215.2018.12.06.02.58.10; Thu, 06 Dec 2018 02:58:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729444AbeLFK4A (ORCPT + 99 others); Thu, 6 Dec 2018 05:56:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57272 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727763AbeLFKz7 (ORCPT ); Thu, 6 Dec 2018 05:55:59 -0500 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 mx1.redhat.com (Postfix) with ESMTPS id 857E53082A34; Thu, 6 Dec 2018 10:55:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 78AFF5D6A6; Thu, 6 Dec 2018 10:55:59 +0000 (UTC) Received: from zmail25.collab.prod.int.phx2.redhat.com (zmail25.collab.prod.int.phx2.redhat.com [10.5.83.31]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5715E3F6E4; Thu, 6 Dec 2018 10:55:59 +0000 (UTC) Date: Thu, 6 Dec 2018 05:55:58 -0500 (EST) From: Frediano Ziglio To: Gerd Hoffmann Cc: dri-devel@lists.freedesktop.org, David Airlie , David Airlie , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , open list , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" Message-ID: <1897496108.48579647.1544093758850.JavaMail.zimbra@redhat.com> In-Reply-To: <20181206104638.23330-2-kraxel@redhat.com> References: <20181206104638.23330-1-kraxel@redhat.com> <20181206104638.23330-2-kraxel@redhat.com> Subject: Re: [Spice-devel] [PATCH 1/3] drm/qxl: allow both PRIV and VRAM placement for QXL_GEM_DOMAIN_SURFACE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.33.32.16, 10.4.195.26] Thread-Topic: drm/qxl: allow both PRIV and VRAM placement for QXL_GEM_DOMAIN_SURFACE Thread-Index: 9S5T4qEzv8vQxy3NLdtcuo4mK/4vLA== X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 06 Dec 2018 10:55:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > qxl surfaces (used for framebuffers and gem objects) can live in both > VRAM and PRIV ttm domains. Update placement setup to include both. Put > PRIV first in the list so it is preferred, so VRAM will have more room > for objects which must be allocated there. > > Signed-off-by: Gerd Hoffmann I remember these kind of changes in the past made migration fails. I proposed similar patches years ago and they were rejected for these reasons. Why now they are safe? Looks like we are improving QXL, so that means we are actively working on it. Should we not then thinking about moving feature in the proper places (like spice-server for atomic mode setting instead of implementin work around) ?? > --- > drivers/gpu/drm/qxl/qxl_object.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/qxl/qxl_object.c > b/drivers/gpu/drm/qxl/qxl_object.c > index 91f3bbc73e..f7f9f4f4fe 100644 > --- a/drivers/gpu/drm/qxl/qxl_object.c > +++ b/drivers/gpu/drm/qxl/qxl_object.c > @@ -58,10 +58,10 @@ void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, > u32 domain, bool pinned) > > qbo->placement.placement = qbo->placements; > qbo->placement.busy_placement = qbo->placements; > - if (domain == QXL_GEM_DOMAIN_VRAM) > - qbo->placements[c++].flags = TTM_PL_FLAG_CACHED | TTM_PL_FLAG_VRAM | > pflag; > if (domain == QXL_GEM_DOMAIN_SURFACE) > qbo->placements[c++].flags = TTM_PL_FLAG_CACHED | TTM_PL_FLAG_PRIV | > pflag; > + if (domain == QXL_GEM_DOMAIN_SURFACE || domain == QXL_GEM_DOMAIN_VRAM) > + qbo->placements[c++].flags = TTM_PL_FLAG_CACHED | TTM_PL_FLAG_VRAM | > pflag; > if (domain == QXL_GEM_DOMAIN_CPU) > qbo->placements[c++].flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM | > pflag; > if (!c) Frediano