From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 937AF6E45D for ; Thu, 10 Jun 2021 05:18:16 +0000 (UTC) Date: Wed, 09 Jun 2021 22:12:48 -0700 Message-ID: <877dj2nvzj.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20210609173632.248880-10-jason@jlekstrand.net> References: <20210609173632.248880-1-jason@jlekstrand.net> <20210609173632.248880-10-jason@jlekstrand.net> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Subject: Re: [igt-dev] [PATCH i-g-t 09/93] lib: Add an intel_ctx wrapper struct and helpers (v5) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Jason Ekstrand Cc: igt-dev@lists.freedesktop.org List-ID: On Wed, 09 Jun 2021 10:35:52 -0700, Jason Ekstrand wrote: > > diff --git a/lib/intel_ctx.c b/lib/intel_ctx.c > > +/** > + * SECTION:intel_ctx > + * @short_description: Wrapper structs for dealing with contexts > + * @title: Intel Context Wrapper > + * > + * This helper library contains a couple of wrapper structs for easier > + * dealing with GEM contexts. This includes a context configuration struct > + * which represents important context construction parameters and a context > + * struct which contains the context ID and its configuration. This makes > + * it easier to pass around a context without loosing the context create losing Running kernel checkpatch on IGT patches shows interesting things including a free spell-check :) > +static const intel_ctx_t __intel_ctx_0 = {}; > + > +/** > + * intel_ctx_0: > + * @fd: open i915 drm file descriptor > + * > + * Returns an intel_ctx_t representing the default context. > + */ > +const intel_ctx_t *intel_ctx_0(int fd) > +{ > + (void)fd; > + return &__intel_ctx_0; > +} OK, so this really is just a "representation" of ctx 0 since num_engines etc. are not what they are for the actual ctx 0 (even with just the legacy engines). > diff --git a/lib/intel_ctx.h b/lib/intel_ctx.h > new file mode 100644 > index 00000000..3e059478 > --- /dev/null > +++ b/lib/intel_ctx.h > @@ -0,0 +1,57 @@ > +// SPDX-License-Identifier: MIT Annoyingly the comment style for source and header files are actually a bit different: https://www.kernel.org/doc/html/v4.18/process/license-rules.html#license-identifier-syntax _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev