From patchwork Thu Jul 15 22:38:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jason Ekstrand X-Patchwork-Id: 12381189 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=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 5F000C636C8 for ; Thu, 15 Jul 2021 22:39:09 +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 0B75E613D4 for ; Thu, 15 Jul 2021 22:39:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B75E613D4 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 A7D7189362; Thu, 15 Jul 2021 22:39:08 +0000 (UTC) Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7474B89362 for ; Thu, 15 Jul 2021 22:39:08 +0000 (UTC) Received: by mail-pf1-x431.google.com with SMTP id b12so7015401pfv.6 for ; Thu, 15 Jul 2021 15:39:08 -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:mime-version :content-transfer-encoding; bh=G1Lpom/liCFd7FkPda8eG+Ob59hWafgxm9MVZyipJKo=; b=0hy8UNQn6b8g3IZrpVAd8Q9Obk69uJrHeqzA3FUwOB0ty1FC0JRHimil0TRxjH1lK8 D7txpJzPQx9dM/dSQCBqF12E6+OtyH2mBquV+lmrjoW7lTeg19saD47m3Nfaq+gI5ka7 nY/Y7DrZCBjvxD6BaJft5F76PAD90IO2PL+mpA8sDAZvWfswD1WXfGdj0VlFZmPJBC5X Cvw0IUxZoD4F0DKF6dmVEKbwid3HdOeJKI6MaSx1BWe9gHdI2FFg9GjZVgJoKj3Zl1Li eNYOIJ9HKiLgf+VNcIK+mcmJLhKVlBR2DaGHxj3mFivXSy3tvv73kApxawJ7kch2iMis 4ndg== 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:mime-version :content-transfer-encoding; bh=G1Lpom/liCFd7FkPda8eG+Ob59hWafgxm9MVZyipJKo=; b=AeIEsJa4ggFiR2mCuzAMgcPZD89dm+wtQ9Cyt+boS4RKIvv6qv5ZOJXuslKbGOHEB1 ytdOOQfC5Q0dHO1LAFc1IjCOHTHzbHI8bS3NKd+HrjHWpTRmei9BS9X6xl/hg09Y4y/r BnFStVV3MfDEtaC0lu3gsw9rBWa1Xr0pXjVe76ZiNqajUbuIXaCIkkh3MdWFcHQvR5fn epLLhl0/CEOSQ2iVJRFdmSnroAwIk5jEZCw/ebOuwwMwUantnc/JXpy2gclTXfD4a536 kZpL8oA3rGUQGKvVsIGiTPU9tkviF+b2MKKlWP5xguW5nuuYmJma0NdZJlF/cdkEJxJg 0A+A== X-Gm-Message-State: AOAM533xj82UH7UpuT8o/x6RbRCeR+oqrNk+S1azcWhl8RUfDyBh/gox msWMUrhAxeeu25EjdP8rxT+KT0bawB+qfw== X-Google-Smtp-Source: ABdhPJzDILL7sndS34R3iOTTaSbyM8hR+PBuVhZinzcqPzSNlp9xv8k+9pOlFG5FKA+2DCiEfRiexQ== X-Received: by 2002:a05:6a00:84d:b029:329:a067:b1bf with SMTP id q13-20020a056a00084db0290329a067b1bfmr6883158pfk.47.1626388747488; Thu, 15 Jul 2021 15:39:07 -0700 (PDT) Received: from omlet.com ([134.134.137.87]) by smtp.gmail.com with ESMTPSA id ft7sm9959459pjb.32.2021.07.15.15.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 15:39:06 -0700 (PDT) From: Jason Ekstrand To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Thu, 15 Jul 2021 17:38:53 -0500 Message-Id: <20210715223900.1840576-1-jason@jlekstrand.net> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 0/7] drm/i915: Migrate memory to SMEM when imported cross-device 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" This patch series fixes an issue with discrete graphics on Intel where we allowed dma-buf import while leaving the object in local memory. This breaks down pretty badly if the import happened on a different physical device. Jason Ekstrand (5): drm/i915/gem: Check object_can_migrate from object_migrate drm/i915/gem: Refactor placement setup for i915_gem_object_create* drm/i915/gem: Unify user object creation drm/i915/gem/ttm: Place new BOs in the requested region drm/i915/gem/ttm: Respect the objection region in placement_from_obj Thomas Hellström (2): drm/i915/gem: Correct the locking and pin pattern for dma-buf (v6) drm/i915/gem: Migrate to system at dma-buf attach time (v6) drivers/gpu/drm/i915/gem/i915_gem_create.c | 159 ++++++++------- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 64 ++++-- drivers/gpu/drm/i915/gem/i915_gem_object.c | 13 +- drivers/gpu/drm/i915/gem/i915_gem_object.h | 4 + drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 11 +- .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 184 +++++++++++++++++- .../drm/i915/gem/selftests/i915_gem_migrate.c | 15 -- 7 files changed, 324 insertions(+), 126 deletions(-)