From patchwork Fri Jul 16 14:14:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jason Ekstrand X-Patchwork-Id: 12382253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A924C12002 for ; Fri, 16 Jul 2021 14:14:41 +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 5A445601FC for ; Fri, 16 Jul 2021 14:14:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A445601FC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jlekstrand.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B5E36E9A9; Fri, 16 Jul 2021 14:14:36 +0000 (UTC) Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by gabe.freedesktop.org (Postfix) with ESMTPS id F34C96E9A5 for ; Fri, 16 Jul 2021 14:14:34 +0000 (UTC) Received: by mail-oi1-x22a.google.com with SMTP id p67so11054434oig.2 for ; Fri, 16 Jul 2021 07:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jlekstrand-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uJYyLhrHNY/60pPyCUIHdFgQDTsIyjquSlitH2b2X4g=; b=uNPPgiWdkNhmlqSoA5QOCBUeOBKa4ZDMKBKWhgypcjpHFfv+09hvaraLDgJM3HWnqY +5cv7pX5nyo+FVW3khtilH1KHvTwurhmE/dsufBbgBO9OdCptT94NT0J/vsa+XtPaO8D 6lntwsRCK9zYuAG68uTLxsbIkNPOh8i4lyPFRdOac6n0+MpsfXWRLuQHnq9qQNDHrAzH qNJgAekMMadKmnOv1xzJpm+0r5oaM0x9MpPXIg4NUv9In6VQvxCpN8MU4SpMJh5/Jse8 1vMwUH4BVYaocTNbBPl4C7d5M3uVNn2/USRY6Z9N7P5oHu8fLlnHTaWzCe73KAXsLuJq CxNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uJYyLhrHNY/60pPyCUIHdFgQDTsIyjquSlitH2b2X4g=; b=CRv3DTMNbHjUfXG8u1/rxYI3llr5sHpdh2PC7SC2HPlI/MEQtKycyBR4WK1ukTlEX7 uzh0yYi7XvE4Y9mMW0z8p9CtHNKI1lP+mopuiG0F+vxjvNHgPGU4zfowdQO17fgSo/35 Ekf2J8CB0aAAWnfKrWEb6xnTno2/xlx+ultznye8payc+vHOrL9Qahcjlv3IJ1yrTHSY 0sdkr1kQW92JDKJ5x3xBd6DPUJVisMpN9iH/sg5idPETEBkLnDwmLgpn/iTC8TIuT55N Nv9FRLwZzGsT/t1+UM47lNsEQzK9ELy1lrfRJJSmWhNpQuG1ZptUuczrD1nF3pygKuyU EydA== X-Gm-Message-State: AOAM533G2uuSxMp8sXsLT69mXR7PhTAMUYcF6sz0hrqMFR74vf7W2l5j w4PaVthkJASFcxzNNKdzr1dYI/PWJT1F3g== X-Google-Smtp-Source: ABdhPJyRS0w8dBnqCNmhjnA6w35YTKQcxxb52q7DNgU05voYfF/TrkHZ66VRvdn32tVG88Ebro4ARQ== X-Received: by 2002:aca:6203:: with SMTP id w3mr8414305oib.64.1626444874098; Fri, 16 Jul 2021 07:14:34 -0700 (PDT) Received: from omlet.lan ([68.203.99.148]) by smtp.gmail.com with ESMTPSA id v42sm1852266ott.70.2021.07.16.07.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 07:14:33 -0700 (PDT) From: Jason Ekstrand To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Fri, 16 Jul 2021 09:14:24 -0500 Message-Id: <20210716141426.1904528-6-jason@jlekstrand.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210716141426.1904528-1-jason@jlekstrand.net> References: <20210716141426.1904528-1-jason@jlekstrand.net> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 5/7] drm/i915/gem/ttm: Respect the objection region in placement_from_obj 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?Thomas_Hellstr=C3=B6m?= , Matthew Auld Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Whenever we had a user object (n_placements > 0), we were ignoring obj->mm.region and always putting obj->placements[0] as the requested region. For LMEM+SMEM objects, this was causing them to get shoved into LMEM on every i915_ttm_get_pages() even when SMEM was requested by, say, i915_gem_object_migrate(). Signed-off-by: Jason Ekstrand Cc: Thomas Hellström Cc: Matthew Auld Cc: Maarten Lankhorst Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c index 6589411396d3f..8eeb73c7c401c 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c @@ -150,8 +150,7 @@ i915_ttm_placement_from_obj(const struct drm_i915_gem_object *obj, unsigned int i; placement->num_placement = 1; - i915_ttm_place_from_region(num_allowed ? obj->mm.placements[0] : - obj->mm.region, requested, flags); + i915_ttm_place_from_region(obj->mm.region, requested, flags); /* Cache this on object? */ placement->num_busy_placement = num_allowed;