From patchwork Mon Apr 25 16:24:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramalingam C X-Patchwork-Id: 12825932 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 266BFC433F5 for ; Mon, 25 Apr 2022 16:23:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA37310E845; Mon, 25 Apr 2022 16:23:44 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id F035510E7E4; Mon, 25 Apr 2022 16:23:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650903823; x=1682439823; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Hvgf+M/7SbHFav0/RuR27C0dZYU4H+m1q9kHGxJE5gs=; b=Oetqp7/s27JKtPsG+rwVMhugUieIev+uW7ypH0qJKot56QhPbhuskfKf RBpppzA8lsl3S3tRiPxSO/hnoq8f1F4Bw4tf+Q5kbuGNFrBL33ReYnpGD PtLtmCFIJOkVHzwhspHCe9hAp1b6Gd8MZx2xS1tHTmi3ZLclxpAi5tyMl QXiQfpa7ZvqJd4J9Xft4wi5O2EExA7fuVuCmZkPSvGJKovQz5CzEw9BBj M7kOs45jyQrCPCGbrq1ZedS8MyySkMwYF+L6Cp/YEPwjU/gp5U2zbyFmw LwUj4xOFkH5hvqNEpIHl5fnwzUcZqamPyEMg4ORMRdbyDekiJ89U7hDk3 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10328"; a="290434383" X-IronPort-AV: E=Sophos;i="5.90,288,1643702400"; d="scan'208";a="290434383" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2022 09:23:42 -0700 X-IronPort-AV: E=Sophos;i="5.90,288,1643702400"; d="scan'208";a="677290995" Received: from ramaling-i9x.iind.intel.com ([10.203.144.108]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2022 09:23:40 -0700 From: Ramalingam C To: intel-gfx , dri-devel Date: Mon, 25 Apr 2022 21:54:30 +0530 Message-Id: <20220425162430.28844-5-ramalingam.c@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220425162430.28844-1-ramalingam.c@intel.com> References: <20220425162430.28844-1-ramalingam.c@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 4/4] uapi/drm/i915: Document memory residency and Flat-CCS capability of 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: Hellstrom Thomas , Matthew Auld , Thomas Hellstrom Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Capture the impact of memory region preference list of an object, on their memory residency and Flat-CCS capability of the objects. v2: Fix the Flat-CCS capability of an obj with {lmem, smem} preference list [Thomas] Signed-off-by: Ramalingam C cc: Matthew Auld cc: Thomas Hellstrom Reviewed-by: Matthew Auld --- include/uapi/drm/i915_drm.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 35ca528803fd..ad191ed6547c 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h @@ -3393,6 +3393,24 @@ struct drm_i915_gem_create_ext { * At which point we get the object handle in &drm_i915_gem_create_ext.handle, * along with the final object size in &drm_i915_gem_create_ext.size, which * should account for any rounding up, if required. + * + * Objects with multiple memory regions in the preference list will be backed + * by one of the memory regions mentioned in the preference list. Though I915 + * tries to honour the order of the memory regions in the preference list, + * based on the memory pressure of the regions, objects' backing region + * will be selected. + * + * Userspace has no means of knowing the backing region for such objects. + * + * On Flat-CCS capable HW, compression is supported for the objects residing + * in I915_MEMORY_CLASS_DEVICE. When such objects (compressed) has other + * memory class in preference list and migrated (by I915, due to memory + * constrain) to the non I915_MEMORY_CLASS_DEVICE region, then I915 needs to + * decompress the content. But I915 dont have the required information to + * decompress the userspace compressed objects. + * + * So I915 supports Flat-CCS, only on the objects which can reside only on + * I915_MEMORY_CLASS_DEVICE regions. */ struct drm_i915_gem_create_ext_memory_regions { /** @base: Extension link. See struct i915_user_extension. */