From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 591D6C433EF for ; Fri, 22 Oct 2021 09:47:28 +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 23F7560FED for ; Fri, 22 Oct 2021 09:47:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 23F7560FED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 311AD6E939; Fri, 22 Oct 2021 09:47:25 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 50F0B6E928; Fri, 22 Oct 2021 09:47:23 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10144"; a="229214191" X-IronPort-AV: E=Sophos;i="5.87,172,1631602800"; d="scan'208";a="229214191" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2021 02:47:22 -0700 X-IronPort-AV: E=Sophos;i="5.87,172,1631602800"; d="scan'208";a="445226439" Received: from bkokkula-mobl1.ger.corp.intel.com (HELO [10.252.0.159]) ([10.252.0.159]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2021 02:47:21 -0700 To: =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= , intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org References: <20211021125332.2455288-1-matthew.auld@intel.com> <20211021125332.2455288-2-matthew.auld@intel.com> From: Matthew Auld Message-ID: <337c653c-4074-9e67-e8c1-04d0d21830da@intel.com> Date: Fri, 22 Oct 2021 10:47:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/dmabuf: drop the flush on discrete X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 22/10/2021 10:26, Thomas Hellström wrote: > Hi, Matt > > On 10/21/21 14:53, Matthew Auld wrote: >> We were overzealous here; even though discrete is non-LLC, it should >> still be always coherent. >> >> Signed-off-by: Matthew Auld >> Cc: Thomas Hellström >> --- >>   drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 3 ++- >>   1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c >> b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c >> index a45d0ec2c5b6..848e81368043 100644 >> --- a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c >> +++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c >> @@ -251,7 +251,8 @@ static int i915_gem_object_get_pages_dmabuf(struct >> drm_i915_gem_object *obj) >>           return PTR_ERR(pages); >>       /* XXX: consider doing a vmap flush or something */ >> -    if (!HAS_LLC(i915) || i915_gem_object_can_bypass_llc(obj)) >> +    if ((!HAS_LLC(i915) && !IS_DGFX(i915)) || > > Q: I notice that DG1 at least has HAS_SNOOP. Would it be incorrect to > use that in this case? AFAIK DG1 is special in that CACHE_NONE will still snoop transactions, which is not the case for other HAS_SNOOP platforms. AFAIK that is part of the reason why we also just force CACHE_LLC everywhere on DG1. Could maybe do s/IS_DGFX/IS_DG1/ here? In case that changes on other discrete platforms. And then add a comment. > > /Thomas > > > >> +        i915_gem_object_can_bypass_llc(obj)) >>           wbinvd_on_all_cpus(); >>       sg_page_sizes = i915_sg_dma_sizes(pages->sgl);