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 B89B2C433F5 for ; Thu, 14 Oct 2021 13:33:42 +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 8125C610D0 for ; Thu, 14 Oct 2021 13:33:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8125C610D0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch 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 0CFA26E893; Thu, 14 Oct 2021 13:33:42 +0000 (UTC) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 635946E893 for ; Thu, 14 Oct 2021 13:33:41 +0000 (UTC) Received: by mail-ed1-x52c.google.com with SMTP id r18so24264427edv.12 for ; Thu, 14 Oct 2021 06:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tDsYb2O9ylqW7Ss2K5s9nrfev8gLYMTY+dJxMjCccFQ=; b=kDNfZGo2NEt0QtAc/c+G2Ufi9IuL17iXy14SOD4Vl+e7OceIH4hUBbvmmr5xT1Jl18 xG2KL5bQJnW+Ts1+JNU42S3cgcMO7yog2LsFBK8WzKDkFugPJWSvBKCAq8JqwNgQx532 zvYY+6/ylC+N55pdevszAUfOhm41sr7Ud+X1w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tDsYb2O9ylqW7Ss2K5s9nrfev8gLYMTY+dJxMjCccFQ=; b=Ia7ecyWZ9QimRJWMjUzifFmGivlkz2hvboNIrRDRWJvpdtxFkk7araIIWeSYvJXUj3 KnFU1V5q10ITTY31bLLgeonc1v/ig77c1nh20O8he6gBPt3oQJJAtSVjtgP2zIfIHNDy APGQ780baWU/1VIpfYCi/JIxgPRhCgBTdjZrhq2AtfYenYDranjHqsUgoW+hr49KeBJp Jtb2ABdmLVqs7Gc4U8GqXXmqKJBZp7vIs3FliwTbCXYRDrNJjEI9cALyEX/izZLStloI ryfzeQDKtW6mlyJApDngIZM+V0JrvH/+VyjBfMawkAzhWgUIfkpLa3fo6Ul/CudRHwA1 8KxA== X-Gm-Message-State: AOAM531ym/m7PvvHdWQeMpWr5HDVVteUw+cpf8fQopzrtKEhu6nSzJwe IV5G8BLrjiIA6zzMFXjhCZWbkg== X-Google-Smtp-Source: ABdhPJwXNnfZWYWi6Hjvai8ksKalaS/LTYSmEW6CB192bNoUPnhJ+orKQtU+9qqEf30Brzn83f67DA== X-Received: by 2002:a17:907:628d:: with SMTP id nd13mr4004601ejc.7.1634218410796; Thu, 14 Oct 2021 06:33:30 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id e7sm2703638edz.95.2021.10.14.06.33.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 06:33:30 -0700 (PDT) Date: Thu, 14 Oct 2021 15:33:28 +0200 From: Daniel Vetter To: Matthew Auld Cc: Daniel Vetter , Ramalingam C , dri-devel , intel-gfx , CQ Tang , Hellstrom Thomas , Joonas Lahtinen , Rodrigo Vivi Message-ID: References: <20211011161155.6397-1-ramalingam.c@intel.com> <20211011161155.6397-4-ramalingam.c@intel.com> <50362606-46a1-0a41-8063-5dca5ac99b98@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50362606-46a1-0a41-8063-5dca5ac99b98@intel.com> X-Operating-System: Linux phenom 5.10.0-8-amd64 Subject: Re: [Intel-gfx] [PATCH 03/14] drm/i915/xehpsdv: enforce min GTT alignment 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 Wed, Oct 13, 2021 at 03:13:33PM +0100, Matthew Auld wrote: > On 13/10/2021 14:38, Daniel Vetter wrote: > > On Mon, Oct 11, 2021 at 09:41:44PM +0530, Ramalingam C wrote: > > > From: Matthew Auld > > > > > > For local-memory objects we need to align the GTT addresses to 64K, both > > > for the ppgtt and ggtt. > > > > > > Signed-off-by: Matthew Auld > > > Signed-off-by: Stuart Summers > > > Signed-off-by: Ramalingam C > > > Cc: Joonas Lahtinen > > > Cc: Rodrigo Vivi > > > > Do we still need this with relocations removed? Userspace is picking all > > the addresses for us, so all we have to check is whether userspace got it > > right. > > Yeah, for OFFSET_FIXED this just validates that the provided address is > correctly aligned to 64K, while for the in-kernel insertion stuff we still > need to allocate an address that is aligned to 64K. Setting the alignment > here handles both cases. Can't we just teach any in-kernel allocators to align to 2M and call it a day? Ofc the code can still validate we don't have bugs (always good to check your work). Ofc if the benefits is "no code can be removed anyway since we still need to check" then ofc no point :-) Just want to make sure we're not carrying complexity around for nothing, since this predates the relocation removal. -Daniel > > > -Daniel > > > > > > > --- > > > drivers/gpu/drm/i915/i915_vma.c | 9 +++++++-- > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c > > > index 4b7fc4647e46..1ea1fa08efdf 100644 > > > --- a/drivers/gpu/drm/i915/i915_vma.c > > > +++ b/drivers/gpu/drm/i915/i915_vma.c > > > @@ -670,8 +670,13 @@ i915_vma_insert(struct i915_vma *vma, u64 size, u64 alignment, u64 flags) > > > } > > > color = 0; > > > - if (vma->obj && i915_vm_has_cache_coloring(vma->vm)) > > > - color = vma->obj->cache_level; > > > + if (vma->obj) { > > > + if (HAS_64K_PAGES(vma->vm->i915) && i915_gem_object_is_lmem(vma->obj)) > > > + alignment = max(alignment, I915_GTT_PAGE_SIZE_64K); > > > + > > > + if (i915_vm_has_cache_coloring(vma->vm)) > > > + color = vma->obj->cache_level; > > > + } > > > if (flags & PIN_OFFSET_FIXED) { > > > u64 offset = flags & PIN_OFFSET_MASK; > > > -- > > > 2.20.1 > > > > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch