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 367D4C25B78 for ; Tue, 28 May 2024 06:17:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C2F0D10E5B8; Tue, 28 May 2024 06:17:52 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="aH4KBV7u"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id B9F5E10E5B8 for ; Tue, 28 May 2024 06:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716877069; x=1748413069; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=iSDmKrFEiW7kZTFri1y6IALnQ1JbI1s8D2NeHmQ4x78=; b=aH4KBV7uyEmyQa8EzMdOeMMbyJUxvGsUn9WO+zx+qr0Jyywr0DIG8Tj9 rIMSv4cxe9Ac1DNzt0ckIf4dodk0faBfxjIhXQn4tsUmakUVZOxyICn5g x4j7fpymL+18xvOFMAzURLeLlt7mjAO4XyF6U26PoC0giJIZ0iln+eQI/ ng1gfjT0pNbHycfAv+Gd14YrfO/YlZ34eYTEcLRbu/hvUyQPIMqKgVKwl VpYSKz5ZW5AvyHfUyNPAeLWgIXttWBB5D4ch+fSWZT2zRTJaR7jlCRfCI zcgJqb4htPduQ9jOYEbR8FQqa6giuf8tWgTKaWVLeR5NT1X/ebQn/+LQG Q==; X-CSE-ConnectionGUID: BCICbRn5QJa6rfoduX4StQ== X-CSE-MsgGUID: i0TSzyklSHCqhZVFRXZgsQ== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13389270" X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="13389270" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 23:17:47 -0700 X-CSE-ConnectionGUID: 79eoId/AQFWGBcrkQsi9cw== X-CSE-MsgGUID: 8EjlSVm/QaOmR1wTl4uZQw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="35556710" Received: from orsosgc001.jf.intel.com (HELO orsosgc001.intel.com) ([10.165.21.138]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 23:17:47 -0700 Date: Mon, 27 May 2024 23:17:47 -0700 Message-ID: <855xuyjw8k.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Lionel Landwerlin Cc: intel-xe@lists.freedesktop.org Subject: Re: [PATCH 07/17] drm/xe/oa: OA stream initialization (OAG) In-Reply-To: References: <20240527014333.603914-1-ashutosh.dixit@intel.com> <20240527014333.603914-8-ashutosh.dixit@intel.com> <0cd6f261-2345-4cc5-b95c-b2c28dc79fa5@intel.com> <8734q2pkus.wl-ashutosh.dixit@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-redhat-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Mon, 27 May 2024 22:47:13 -0700, Lionel Landwerlin wrote: > Hi Lionel, > On 28/05/2024 08:27, Dixit, Ashutosh wrote: > > On Mon, 27 May 2024 00:04:21 -0700, Lionel Landwerlin wrote: > > > >>> +static int xe_oa_stream_init(struct xe_oa_stream *stream, > >>> + struct xe_oa_open_param *param) > >>> +{ > > /snip/ > > > >>> + stream->k_exec_q = xe_exec_queue_create(stream->oa->xe, NULL, > >>> + BIT(stream->hwe->logical_instance), 1, > >>> + stream->hwe, EXEC_QUEUE_FLAG_KERNEL, 0); > >> > >> Hi Ashutosh, > >> > >> On i915 the changes of configuration were pipelined in the application's > >> execution just like any other submission. > >> > >> Creating another queue completely unsynchronized from the application's > >> submissions makes this non usable in my opinion. > > As we discussed previously, the plan here is to provide a drm_xe_sync array, > > through stream properties, which can use to synchronize OA programming with > > workload submisson. > > > > Would that not work? If not, we can do what was done in i915. But note that > > i915 still has unresolved hangs, which I believe are due to the spinner > > running on the application engine (iirc repeatedly opening/closing an OA > > stream will hang in i915, though it could be due to other i915 > > complexity). That is why thought using drm_xe_sync array is both safer and > > more standard way of doing what we want to achieve. > > > > Basically the output sync object will be signalled after registers are > > programmed and also any additional OA programming delay (which is > > implemented in i915 using the spinner). > > > > This would be done both for OA stream open and changing OA stream > > configuration. That is true. But now that I have other stuff like gpuvis wrapped up, I plan to start looking these couple of missing uapi pieces (hold preemption and synchronization, likely in that order). Because synchronization is not implemented I add the delay below: static int xe_oa_emit_oa_config(struct xe_oa_stream *stream) { #define NOA_PROGRAM_ADDITIONAL_DELAY_US 500 struct xe_oa_config_bo *oa_bo; int err, us = NOA_PROGRAM_ADDITIONAL_DELAY_US; oa_bo = xe_oa_alloc_config_buffer(stream); if (IS_ERR(oa_bo)) { err = PTR_ERR(oa_bo); goto exit; } err = xe_oa_submit_bb(stream, oa_bo->bb); /* Additional empirical delay needed for NOA programming after registers are written */ usleep_range(us, 2 * us); exit: return err; } I need understand this is temporaty band-aid, since it stalls the submission pipeline and needs to be replaced by proper synchronization. > Just letting you know, because we cannot use the current ioctl because it > doesn't behave as we expect You wouldn't be able to merge the Mesa PR as per the current uapi now and then add additional Mesa patches, when we implement these couple of missing uapi features in KMD? Thanks. -- Ashutosh