From mboxrd@z Thu Jan 1 00:00:00 1970 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 13E33C4332F for ; Wed, 18 May 2022 06:51:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 01A2A10E20F; Wed, 18 May 2022 06:51:43 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF34F10E0F5; Wed, 18 May 2022 06:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652856701; x=1684392701; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=JVjJoL/kB24+LI3isyatzAgJIVLilwo26EY3gDvQSho=; b=kOGkCcr5h5qJoe5IiJGer4XKB41WwNuiSqS2iaXig0nOhPQUpaPblco5 o5GET58wY9PTg8sb+Fk8gTAl5U6JuV9gEpvNgFP81LVZ0Xc4a9MMqaszb P9lN2x91jN0qFeES3i9fbFyPcrqG6dRzzweg/8TzeOo7FSpqp7eHSi+t5 xlt1KZS2E/M5ZN1s7XmG1g3ortPJUMy+9fx+k0ZVMaZMMTBFVjevpaetQ +w0bEAk1s0YqbpxqpZ3vlSK1lJWGqgrQxaDKg2iF8GGo4Gb3q7Bbr4mRZ PFlTc9N7HFDeWzy5h3nnOyzO5ve2qWUb7Eufo371bqLdQabYq1ZYq42dL A==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="269095567" X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="269095567" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 23:51:38 -0700 X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="545286123" Received: from ramaling-i9x.iind.intel.com (HELO intel.com) ([10.203.144.108]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 23:51:34 -0700 Date: Wed, 18 May 2022 12:22:46 +0530 From: Ramalingam C To: Jordan Justen Subject: Re: [PATCH v3] uapi/drm/i915: Document memory residency and Flat-CCS capability of obj Message-ID: <20220518065245.GA9500@intel.com> References: <20220502141508.2327-1-ramalingam.c@intel.com> <08039c07-a32e-7725-bc98-db49eefb3e86@intel.com> <165247597144.852381.16262736277926454494@jljusten-skl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <165247597144.852381.16262736277926454494@jljusten-skl> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tony Ye , Thomas Hellstrom , Nanley Chery , Daniel Vetter , intel-gfx , dri-devel , Kenneth Graunke , Jon Bloomfield , Lionel Landwerlin , mesa-dev@lists.freedesktop.org, Matthew Auld Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 2022-05-13 at 14:06:11 -0700, Jordan Justen wrote: > On 2022-05-13 05:31:00, Lionel Landwerlin wrote: > > On 02/05/2022 17:15, Ramalingam C wrote: > > > Capture the impact of memory region preference list of the objects, on > > > their memory residency and Flat-CCS capability. > > > > > > v2: > > > Fix the Flat-CCS capability of an obj with {lmem, smem} preference > > > list [Thomas] > > > v3: > > > Reworded the doc [Matt] > > > > > > Signed-off-by: Ramalingam C > > > cc: Matthew Auld > > > cc: Thomas Hellstrom > > > cc: Daniel Vetter > > > cc: Jon Bloomfield > > > cc: Lionel Landwerlin > > > cc: Kenneth Graunke > > > cc: mesa-dev@lists.freedesktop.org > > > cc: Jordan Justen > > > cc: Tony Ye > > > Reviewed-by: Matthew Auld > > > --- > > > include/uapi/drm/i915_drm.h | 16 ++++++++++++++++ > > > 1 file changed, 16 insertions(+) > > > > > > diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h > > > index a2def7b27009..b7e1c2fe08dc 100644 > > > --- a/include/uapi/drm/i915_drm.h > > > +++ b/include/uapi/drm/i915_drm.h > > > @@ -3443,6 +3443,22 @@ 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. > > > + * > > > + * Note that userspace has no means of knowing the current backing region > > > + * for objects where @num_regions is larger than one. The kernel will only > > > + * ensure that the priority order of the @regions array is honoured, either > > > + * when initially placing the object, or when moving memory around due to > > > + * memory pressure > > > + * > > > + * 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 @regions 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 dosen't 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. > > > > I think it's fine to assume Flat-CSS surface will always be in lmem. > > > > I see no issue for the Anv Vulkan driver. > > > > Maybe Nanley or Ken can speak for the Iris GL driver? > > > > Acked-by: Jordan Justen Thank you Jordan for the Ack! Ram > > I think Nanley has accounted for this on iris with: > > https://gitlab.freedesktop.org/mesa/mesa/-/commit/42a865730ef72574e179b56a314f30fdccc6cba8 > > -Jordan From mboxrd@z Thu Jan 1 00:00:00 1970 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 383C7C433F5 for ; Wed, 18 May 2022 06:51:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 32A5910FFC0; Wed, 18 May 2022 06:51:43 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF34F10E0F5; Wed, 18 May 2022 06:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652856701; x=1684392701; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=JVjJoL/kB24+LI3isyatzAgJIVLilwo26EY3gDvQSho=; b=kOGkCcr5h5qJoe5IiJGer4XKB41WwNuiSqS2iaXig0nOhPQUpaPblco5 o5GET58wY9PTg8sb+Fk8gTAl5U6JuV9gEpvNgFP81LVZ0Xc4a9MMqaszb P9lN2x91jN0qFeES3i9fbFyPcrqG6dRzzweg/8TzeOo7FSpqp7eHSi+t5 xlt1KZS2E/M5ZN1s7XmG1g3ortPJUMy+9fx+k0ZVMaZMMTBFVjevpaetQ +w0bEAk1s0YqbpxqpZ3vlSK1lJWGqgrQxaDKg2iF8GGo4Gb3q7Bbr4mRZ PFlTc9N7HFDeWzy5h3nnOyzO5ve2qWUb7Eufo371bqLdQabYq1ZYq42dL A==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="269095567" X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="269095567" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 23:51:38 -0700 X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="545286123" Received: from ramaling-i9x.iind.intel.com (HELO intel.com) ([10.203.144.108]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 23:51:34 -0700 Date: Wed, 18 May 2022 12:22:46 +0530 From: Ramalingam C To: Jordan Justen Message-ID: <20220518065245.GA9500@intel.com> References: <20220502141508.2327-1-ramalingam.c@intel.com> <08039c07-a32e-7725-bc98-db49eefb3e86@intel.com> <165247597144.852381.16262736277926454494@jljusten-skl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <165247597144.852381.16262736277926454494@jljusten-skl> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [Intel-gfx] [PATCH v3] 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: Thomas Hellstrom , Daniel Vetter , intel-gfx , dri-devel , Kenneth Graunke , mesa-dev@lists.freedesktop.org, Matthew Auld Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 2022-05-13 at 14:06:11 -0700, Jordan Justen wrote: > On 2022-05-13 05:31:00, Lionel Landwerlin wrote: > > On 02/05/2022 17:15, Ramalingam C wrote: > > > Capture the impact of memory region preference list of the objects, on > > > their memory residency and Flat-CCS capability. > > > > > > v2: > > > Fix the Flat-CCS capability of an obj with {lmem, smem} preference > > > list [Thomas] > > > v3: > > > Reworded the doc [Matt] > > > > > > Signed-off-by: Ramalingam C > > > cc: Matthew Auld > > > cc: Thomas Hellstrom > > > cc: Daniel Vetter > > > cc: Jon Bloomfield > > > cc: Lionel Landwerlin > > > cc: Kenneth Graunke > > > cc: mesa-dev@lists.freedesktop.org > > > cc: Jordan Justen > > > cc: Tony Ye > > > Reviewed-by: Matthew Auld > > > --- > > > include/uapi/drm/i915_drm.h | 16 ++++++++++++++++ > > > 1 file changed, 16 insertions(+) > > > > > > diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h > > > index a2def7b27009..b7e1c2fe08dc 100644 > > > --- a/include/uapi/drm/i915_drm.h > > > +++ b/include/uapi/drm/i915_drm.h > > > @@ -3443,6 +3443,22 @@ 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. > > > + * > > > + * Note that userspace has no means of knowing the current backing region > > > + * for objects where @num_regions is larger than one. The kernel will only > > > + * ensure that the priority order of the @regions array is honoured, either > > > + * when initially placing the object, or when moving memory around due to > > > + * memory pressure > > > + * > > > + * 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 @regions 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 dosen't 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. > > > > I think it's fine to assume Flat-CSS surface will always be in lmem. > > > > I see no issue for the Anv Vulkan driver. > > > > Maybe Nanley or Ken can speak for the Iris GL driver? > > > > Acked-by: Jordan Justen Thank you Jordan for the Ack! Ram > > I think Nanley has accounted for this on iris with: > > https://gitlab.freedesktop.org/mesa/mesa/-/commit/42a865730ef72574e179b56a314f30fdccc6cba8 > > -Jordan