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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8AE3CC433EF for ; Thu, 12 May 2022 16:42:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AB6C10FFC0; Thu, 12 May 2022 16:42:13 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 592CC10FFC0; Thu, 12 May 2022 16:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652373732; x=1683909732; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=jCAWUPcGy3QX9OvjDrXfGEMvdus6MKvGcYde3Vn+2zI=; b=RzZMLMDxNMAF/zX/MtwzGKJcJZcUmnqniBoA78m6K+VUpbqrs7pugn26 QBST9YK/UncdWmxAcWtwHOEBn8++bAQzviLiMfYwNvFgRF4B422EmMC/z 2xW1BxvXaF2wgPiRIcllBmU4O3v4Wk+jITMb4qEo4MzIx2208bRigqW7h wpU/0TvFib6Y8Y335J3cIrHLxdajh7PN0DVJq+Gr7dFeo6fPDTjdxMpcU 1PXJgWWuajQVNLZnqHPHV41trMFBdBlfwpeNy1Nw3Fjy6fpAV8eC+0vi+ 5RWsIm2Gu8ebvntF8k2fgIRMXWvDrywBMRyH1z+aOfdeeWD7v0moJq+gP w==; X-IronPort-AV: E=McAfee;i="6400,9594,10345"; a="295305555" X-IronPort-AV: E=Sophos;i="5.91,220,1647327600"; d="scan'208";a="295305555" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2022 09:14:32 -0700 X-IronPort-AV: E=Sophos;i="5.91,220,1647327600"; d="scan'208";a="739748041" Received: from ianmurph-mobl.ger.corp.intel.com (HELO [10.252.2.2]) ([10.252.2.2]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2022 09:14:30 -0700 Message-ID: Date: Thu, 12 May 2022 17:14:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-GB To: Maarten Lankhorst , intel-gfx@lists.freedesktop.org References: <20220511115219.46507-1-maarten.lankhorst@linux.intel.com> <3dbe7c30-dfef-0cde-b9cb-2ffdcb460113@intel.com> <66e2bfe6-6053-9728-63ee-e4aad5a0f631@linux.intel.com> From: Matthew Auld In-Reply-To: <66e2bfe6-6053-9728-63ee-e4aad5a0f631@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH] drm/i915: Use i915_gem_object_ggtt_pin_ww for reloc_iomap 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: , Cc: =?UTF-8?Q?Mateusz_Jo=c5=84czyk?= , dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 11/05/2022 19:38, Maarten Lankhorst wrote: > Op 11-05-2022 om 20:23 schreef Matthew Auld: >> On 11/05/2022 12:52, Maarten Lankhorst wrote: >>> Instead of its own path, use the common path when it doesn't result >>> in evicting any vma. This fixes the case where we don't wait for >>> binding. >>> >> >> https://gitlab.freedesktop.org/drm/intel/-/issues/5806 >> >> If I'm reading that correctly waiting for the bind doesn't seem to help? > > I suspect the actual pinning there might do some stuff that we are not doing. > > It was working before the change, and manually calling pin caused the failure, so I reverted it back to what was working before. It was specifically the manual pin code that was failing. > > I can change the commit message if it helps. Hmm strange. With the commit message updated, Acked-by: Matthew Auld > > ~Maarten > >>> Fixes: b5cfe6f7a6e1 ("drm/i915: Remove short-term pins from execbuf, v6.") >>> Cc: Matthew Auld >>> Reported-by: Mateusz Jończyk >>> Tested-by: Hans de Goede >>> Signed-off-by: Maarten Lankhorst >>> --- >>>   drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 6 ++---- >>>   1 file changed, 2 insertions(+), 4 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c >>> index 498b458fd784..919d01082909 100644 >>> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c >>> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c >>> @@ -1262,14 +1262,12 @@ static void *reloc_iomap(struct i915_vma *batch, >>>            * Only attempt to pin the batch buffer to ggtt if the current batch >>>            * is not inside ggtt, or the batch buffer is not misplaced. >>>            */ >>> -        if (!i915_is_ggtt(batch->vm)) { >>> +        if (!i915_is_ggtt(batch->vm) || >>> +            !i915_vma_misplaced(batch, 0, 0, PIN_MAPPABLE)) { >>>               vma = i915_gem_object_ggtt_pin_ww(obj, &eb->ww, NULL, 0, 0, >>>                                 PIN_MAPPABLE | >>>                                 PIN_NONBLOCK /* NOWARN */ | >>>                                 PIN_NOEVICT); >>> -        } else if (i915_vma_is_map_and_fenceable(batch)) { >>> -            __i915_vma_pin(batch); >>> -            vma = batch; >>>           } >>>             if (vma == ERR_PTR(-EDEADLK)) > >