From patchwork Tue Jun 21 10:29:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthew Auld X-Patchwork-Id: 12888990 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 9E2F1C43334 for ; Tue, 21 Jun 2022 10:30:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C61E10EE76; Tue, 21 Jun 2022 10:30:39 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id C68A410E757; Tue, 21 Jun 2022 10:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655807437; x=1687343437; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jfAmqb1dthI7paSz0YGOo7/6U7hEbwBWAqRUCGjchtk=; b=J0vpKSVGpemfUdccd3dU+ynJ3iRE6PlN1b5rjKWuCvLkzQ1661GrtNW4 UUqzEkwg0+UmW1X2ZP+19PXSjCOobEUFbIVHDHlUzmXFdWFIPxEfkX0FR u8sOOK8ZCSnSo5dDmIhtAAp/zwhpLJG1UGa10bGJ+38tvrNRMt3LbKC7P rGCcsApCATfCK2KdZT+2sbpyrJPAGGI4pcsTodNYBuKIt0HbXgFQKkIK6 7fXJ0oOUMt4IyIlEXBzMJ9F2zTUEC1jPzaPzf9Z9FmZG/5jukjPegWeJf uLc5WnVxVn06bCU15lwIQgqwF202kh6IZXmxpjVw1TeimJYtgwnTYz0sj w==; X-IronPort-AV: E=McAfee;i="6400,9594,10384"; a="280816916" X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="280816916" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2022 03:30:13 -0700 X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="591596184" Received: from jasonmor-mobl1.ger.corp.intel.com (HELO mwauld-desk1.intel.com) ([10.213.200.10]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2022 03:30:12 -0700 From: Matthew Auld To: igt-dev@lists.freedesktop.org Date: Tue, 21 Jun 2022 11:29:53 +0100 Message-Id: <20220621103001.184373-2-matthew.auld@intel.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220621103001.184373-1-matthew.auld@intel.com> References: <20220621103001.184373-1-matthew.auld@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t v2 1/9] lib/i915_drm_local: Add I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS 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?= , intel-gfx@lists.freedesktop.org, Nirmoy Das Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" For now dump into i915_drm_local.h. Once the uapi on the kernel side is merged, and is part of drm-next, we can sync the kernel headers and remove this. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das --- lib/i915/i915_drm_local.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/i915/i915_drm_local.h b/lib/i915/i915_drm_local.h index 9a2273c4..ac35abf6 100644 --- a/lib/i915/i915_drm_local.h +++ b/lib/i915/i915_drm_local.h @@ -23,6 +23,27 @@ extern "C" { #define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6 +/* + * Signal to the kernel that the object will need to be accessed via + * the CPU. + * + * Only valid when placing objects in I915_MEMORY_CLASS_DEVICE, and only + * strictly required on platforms where only some of the device memory + * is directly visible or mappable through the CPU, like on DG2+. + * + * One of the placements MUST also be I915_MEMORY_CLASS_SYSTEM, to + * ensure we can always spill the allocation to system memory, if we + * can't place the object in the mappable part of + * I915_MEMORY_CLASS_DEVICE. + * + * Without this hint, the kernel will assume that non-mappable + * I915_MEMORY_CLASS_DEVICE is preferred for this object. Note that the + * kernel can still migrate the object to the mappable part, as a last + * resort, if userspace ever CPU faults this object, but this might be + * expensive, and so ideally should be avoided. + */ +#define I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS (1 << 0) + #if defined(__cplusplus) } #endif