From patchwork Fri Jul 23 17:21:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jason Ekstrand X-Patchwork-Id: 12396439 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,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 8CD51C4338F for ; Fri, 23 Jul 2021 17:21:52 +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 5E5BD60EB5 for ; Fri, 23 Jul 2021 17:21:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5E5BD60EB5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jlekstrand.net 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 AABFE6F5F7; Fri, 23 Jul 2021 17:21:47 +0000 (UTC) Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by gabe.freedesktop.org (Postfix) with ESMTPS id BD8546F415 for ; Fri, 23 Jul 2021 17:21:46 +0000 (UTC) Received: by mail-pj1-x1031.google.com with SMTP id k4-20020a17090a5144b02901731c776526so9870534pjm.4 for ; Fri, 23 Jul 2021 10:21:46 -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=8/v8CdglWrt6v9ASQleiVlFYsqJirNYOdm0j1r50y5o=; b=Ugw7xGFYfPEw0IRclD4WO7V8j/hnEgvfh+vuO5XhoPkyKvSGDN9U/rFwt086FVN5s4 EW01+EvZu59SCZ5lhD7DerKBHnrojhR3dKWsNvC9JSogBXtD+slATvQKi2k1EWZEWE2C 3OvDzl5TPXMBufSQTXxPbYioEtLoBaskUaz4kAWIuehxnIZvCp4IE1X/81DOaF6pEBHf ybKlbYHRtViWtoa2zfCR9T9YoecwcxVZKXWAwnMeSqBI6L1f9OXK9o9rw3qbDrz0tyRI NSM0+uHPWi/n8iJw15Cf+8CgXpSN8qIPKTn2+mD0LuITGvfynbanMoNyX8ceVEM5YZxT QbvA== 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=8/v8CdglWrt6v9ASQleiVlFYsqJirNYOdm0j1r50y5o=; b=SH88g7gai+9BDC4F+ejBA9fvlY2z8UJi5fr/zIEoH8xBtEAnHXko9XDWdRH9KMCgqD KH7mfrlxPB6hsazgu+IIYhCLmLfgeRW09PGgEqjJjjaUjcn4I65ccoJ2wv2WUz8mCwmn dzWobLqtf/kDWh64Bf3WIVcA4nD5A7y2QLnX0UgO4YLlApJbpBBuVfblqM/1uGpDD9B8 1lxzMtBHARK56L9IhmZPFwfoHkTLCJ6bgyp6y/KKe1cTkfkFCb9/BG0M97RI3ltpJhYY mSRAiNCJbYLSiXnSeHVFHFhUVILe2tHmgLwyzyw0v8cwVoNAYbgBY4U0XriWYPDqXtxg Rgpg== X-Gm-Message-State: AOAM532jYU642ReqJeu1E6a6D0s6slqlfutBjTACVYBw4WKleMYScNkP sKUuqj6kpnKB+0S67HUG5a1Pia6tf0eeRg== X-Google-Smtp-Source: ABdhPJxotkdALrFhEzQAPeeJamAQOkTxvoN/FO0eYvgxddk3Prij1WgdvgRHqDNZpcgbYz8SfN34tg== X-Received: by 2002:a62:c501:0:b029:32a:dfe9:8648 with SMTP id j1-20020a62c5010000b029032adfe98648mr5698070pfg.28.1627060906021; Fri, 23 Jul 2021 10:21:46 -0700 (PDT) Received: from omlet.lan ([134.134.137.86]) by smtp.gmail.com with ESMTPSA id s36sm24288648pgl.8.2021.07.23.10.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jul 2021 10:21:45 -0700 (PDT) From: Jason Ekstrand To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Fri, 23 Jul 2021 12:21:34 -0500 Message-Id: <20210723172142.3273510-1-jason@jlekstrand.net> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 0/8] drm/i915: Migrate memory to SMEM when imported cross-device (v8) 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. v7: - Drop "drm/i915/gem/ttm: Place new BOs in the requested region" - Add a new "drm/i915/gem: Call i915_gem_flush_free_objects() in i915_gem_dumb_create()" - Misc. review feedback from Matthew Auld v8: - Misc. review feedback from Matthew Auld v9: - Replace the i915/ttm patch with two that are hopefully more correct Jason Ekstrand (6): drm/i915/gem: Check object_can_migrate from object_migrate drm/i915/gem: Refactor placement setup for i915_gem_object_create* (v2) drm/i915/gem: Call i915_gem_flush_free_objects() in i915_gem_dumb_create() drm/i915/gem: Unify user object creation (v3) drm/i915/gem/ttm: Only call __i915_gem_object_set_pages if needed drm/i915/gem: Always call obj->ops->migrate unless can_migrate fails Thomas Hellström (2): drm/i915/gem: Correct the locking and pin pattern for dma-buf (v8) drm/i915/gem: Migrate to system at dma-buf attach time (v7) drivers/gpu/drm/i915/gem/i915_gem_create.c | 177 ++++++++-------- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 58 ++++-- drivers/gpu/drm/i915/gem/i915_gem_object.c | 20 +- drivers/gpu/drm/i915/gem/i915_gem_object.h | 4 + drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 13 +- .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 190 +++++++++++++++++- .../drm/i915/gem/selftests/i915_gem_migrate.c | 15 -- 7 files changed, 341 insertions(+), 136 deletions(-)