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 C83B6C3DA4A for ; Tue, 20 Aug 2024 01:24:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 898D710E370; Tue, 20 Aug 2024 01:24:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="lFO664n5"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id DAF0110E370 for ; Tue, 20 Aug 2024 01:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724117090; x=1755653090; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=XayxI6B/1HLoWMJnHBad6veFnwPrj1okVHl7ij/sJZI=; b=lFO664n5PAEx/Y7ykGn4eMxJ/SNGt4qk59zf9BICtKUAbP9Z7U+xvH2V 71VVBtPolqM71yXIsW9MTFhagdrqaYTISOZdPCkVSvw53V+FOE9UVMhG2 TL6u0Ldzdvi76381PvHsSIbQf2jfWUi50hmP++OeX3fCruWwDIwZd1Wj9 XfLQlBoFaylA+723XeVbXISctdlMJqcRyyPtYFLgaSFho4bO9ZdFQg3Zt PydVGe2tDYD2F1U7pG4RCCMlnxWrnK0+1qWWF6rv31RakW78fWOvoZmF8 sY6skgMJIw5gxQMmiK6bZkMUtBYzi2fXDcy+ctNmKcrRucN82nyBqLACn w==; X-CSE-ConnectionGUID: XGWEXWfdQzC7fmiHgM1J5g== X-CSE-MsgGUID: N65CN5sTRoaUDSPJwMVxKQ== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="22014578" X-IronPort-AV: E=Sophos;i="6.10,160,1719903600"; d="scan'208";a="22014578" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 18:24:49 -0700 X-CSE-ConnectionGUID: nQLwNIcCQkKidZEgsXKZ5g== X-CSE-MsgGUID: 6s7mr884Tj6AHKZm96Dh6Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,160,1719903600"; d="scan'208";a="60254015" Received: from peterval-mobl1.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.124.114.37]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 18:24:49 -0700 Date: Mon, 19 Aug 2024 18:05:51 -0700 Message-ID: <87jzgcdmvk.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: "Cavitt, Jonathan" Cc: "intel-xe@lists.freedesktop.org" , "Nerlige Ramappa, Umesh" , "Souza, Jose" , "Landwerlin, Lionel G" Subject: Re: [PATCH 4/8] drm/xe/oa: Add input fence dependencies In-Reply-To: References: <20240808174139.4027534-1-ashutosh.dixit@intel.com> <20240808174139.4027534-5-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/29.4 (x86_64-pc-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 Thu, 08 Aug 2024 14:09:24 -0700, Cavitt, Jonathan wrote: > > -----Original Message----- > From: Intel-xe On Behalf Of Ashutosh Dixit > Sent: Thursday, August 8, 2024 10:42 AM > To: intel-xe@lists.freedesktop.org > Cc: Nerlige Ramappa, Umesh ; Souza, Jose ; Landwerlin, Lionel G > Subject: [PATCH 4/8] drm/xe/oa: Add input fence dependencies > > > > Add input fence dependencies which will make OA configuration wait till > > these dependencies are met (till input fences signal). > > > > Signed-off-by: Ashutosh Dixit > > --- > > drivers/gpu/drm/xe/xe_oa.c | 24 +++++++++++++++++++----- > > 1 file changed, 19 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c > > index ba8f2e9d95b7f..416e031ac454b 100644 > > --- a/drivers/gpu/drm/xe/xe_oa.c > > +++ b/drivers/gpu/drm/xe/xe_oa.c > > @@ -578,10 +578,10 @@ static __poll_t xe_oa_poll(struct file *file, poll_table *wait) > > } > > > > static int xe_oa_submit_bb(struct xe_oa_stream *stream, struct xe_bb *bb, > > - struct dma_fence **fence) > > + bool add_deps, struct dma_fence **fence) > > { > > struct xe_sched_job *job; > > - int err = 0; > > + int i, err = 0; > > > > /* Kernel configuration is issued on stream->k_exec_q, not stream->exec_q */ > > job = xe_bb_create_job(stream->k_exec_q, bb); > > @@ -590,9 +590,23 @@ static int xe_oa_submit_bb(struct xe_oa_stream *stream, struct xe_bb *bb, > > goto exit; > > } > > > > + if (add_deps) { > > Non-blocking suggestion: > Maybe declare int "i" here instead of with err, since "i" seems to > only be used here. Done. > > Otherwise: > Reviewed-by: Jonathan Cavitt Thanks. > -Jonathan Cavitt > > > + for (i = 0; i < stream->num_syncs && !err; i++) > > + err = xe_sync_entry_add_deps(&stream->syncs[i], job); > > + if (err) { > > + drm_dbg(&stream->oa->xe->drm, "xe_sync_entry_add_deps err %d\n", err); > > + goto err_put_job; > > + } > > + } > > + > > xe_sched_job_arm(job); > > *fence = dma_fence_get(&job->drm.s_fence->finished); > > xe_sched_job_push(job); > > + > > + return 0; > > + > > +err_put_job: > > + xe_sched_job_put(job); > > exit: > > return err; > > } > > @@ -670,7 +684,7 @@ static int xe_oa_modify_ctx_image(struct xe_oa_stream *stream, struct xe_lrc *lr > > > > xe_oa_store_flex(stream, lrc, bb, flex, count); > > > > - err = xe_oa_submit_bb(stream, bb, &fence); > > + err = xe_oa_submit_bb(stream, bb, false, &fence); > > xe_bb_free(bb, fence); > > dma_fence_put(fence); > > exit: > > @@ -691,7 +705,7 @@ static int xe_oa_load_with_lri(struct xe_oa_stream *stream, struct xe_oa_reg *re > > > > write_cs_mi_lri(bb, reg_lri, 1); > > > > - err = xe_oa_submit_bb(stream, bb, &fence); > > + err = xe_oa_submit_bb(stream, bb, false, &fence); > > xe_bb_free(bb, fence); > > dma_fence_put(fence); > > exit: > > @@ -971,7 +985,7 @@ static int xe_oa_emit_oa_config(struct xe_oa_stream *stream, struct xe_oa_config > > goto exit; > > } > > > > - err = xe_oa_submit_bb(stream, oa_bo->bb, &fence); > > + err = xe_oa_submit_bb(stream, oa_bo->bb, true, &fence); > > if (err) > > goto exit; > > > > -- > > 2.41.0 > > > >