From patchwork Tue Mar 27 10:26:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kevin.rogovin@intel.com X-Patchwork-Id: 10309701 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 15BFF600F6 for ; Tue, 27 Mar 2018 10:26:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01CDF29BE6 for ; Tue, 27 Mar 2018 10:26:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAD6C29BE8; Tue, 27 Mar 2018 10:26:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A844029BE6 for ; Tue, 27 Mar 2018 10:26:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F20B76E5DE; Tue, 27 Mar 2018 10:26:52 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1F5E66E5D9 for ; Tue, 27 Mar 2018 10:26:44 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2018 03:26:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,367,1517904000"; d="scan'208";a="38466886" Received: from sinekoff-mobl1.ger.corp.intel.com (HELO LittleBigTrouble.ger.corp.intel.com) ([10.252.34.146]) by orsmga003.jf.intel.com with ESMTP; 27 Mar 2018 03:26:27 -0700 From: kevin.rogovin@intel.com To: intel-gfx@lists.freedesktop.org, abdiel.janulgue@linux.intel.com, joonas.lahtinen@linux.intel.com Date: Tue, 27 Mar 2018 13:26:17 +0300 Message-Id: <1522146379-9358-4-git-send-email-kevin.rogovin@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522146379-9358-1-git-send-email-kevin.rogovin@intel.com> References: <1522146379-9358-1-git-send-email-kevin.rogovin@intel.com> Subject: [Intel-gfx] [PATCH v3 3/5] i915: add documentation for a bit on batchbuffer submission backend X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Rogovin MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Kevin Rogovin Signed-off-by: Kevin Rogovin --- drivers/gpu/drm/i915/intel_ringbuffer.h | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h index 62d3a22..2f8908e 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.h +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h @@ -350,6 +350,44 @@ struct intel_engine_execlists { * the ringbuffer. */ +/** + * DOC: Batchbuffer Submission Backend + * + * The core logic of submitting a batchbuffer for the GPU to execute + * is shared across all engines for all GPU generations. Through the use + * of functions pointers, we can customize submission to different GPU + * capabilities. The struct ``intel_engine_cs`` has the following member + * function pointers for the following purposes in the scope of batchbuffer + * submission. + * + * - context_pin + * pins the context and also returns to what ``intel_ringbuffer`` + * to write to submit a batchbuffer. + * + * - request_alloc + * is used to reserve space in an ``intel_ringbuffer`` + * for submitting a batchbuffer to the GPU. + * + * - emit_flush + * writes a pipeline flush command and/or invalidate caches + * command to the ring buffer. + * + * - emit_bb_start + * writes the batchbuffer start command to the ringer buffer. + * + * - emit_breadcrumb + * writes to the ring buffer both the regiser write of the + * request ID (`i915_request::global_seqno`) and the command to + * issue an interrupt. + * + * - submit_request + * See the comment on this member in ``intel_engine_cs``, declared + * in intel_ringbuffer.h. + * + * In addition, the struct i915_request is used to track requests' + * dependency tree. + */ + struct intel_engine_cs { struct drm_i915_private *i915; char name[INTEL_ENGINE_CS_MAX_NAME];