From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 6/6] drm/i915/guc: Move GuC declarations and functions into dedicated files
Date: Tue, 03 Oct 2017 11:29:13 +0300 [thread overview]
Message-ID: <1507019353.4728.39.camel@linux.intel.com> (raw)
In-Reply-To: <20171002140109.52844-7-michal.wajdeczko@intel.com>
On Mon, 2017-10-02 at 14:01 +0000, Michal Wajdeczko wrote:
> We want to keep GuC specific code in separated files.
>
> v2: move all functions in single patch (Joonas)
> fix old checkpatch issues (Sagar)
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
> Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com> #1
<SNIP>
> +++ b/drivers/gpu/drm/i915/intel_guc.c
> @@ -0,0 +1,262 @@
> +/*
> + * Copyright © 2014-2017 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
We do want to include "intel_guc.h" first and then other headers. After
all, all this effort is to get rid of i915_drv.h eventually so that
inter-file dependencies are called out more explicitly.
> +#include "i915_drv.h"
> +
<SNIP>
> +static
> +inline int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len)
> +{
> + return guc->send(guc, action, len);
> +}
> +
> +static inline void intel_guc_notify(struct intel_guc *guc)
> +{
> + guc->notify(guc);
> +}
> +
> +static inline u32 guc_ggtt_offset(struct i915_vma *vma)
> +{
> + u32 offset = i915_ggtt_offset(vma);
> +
> + GEM_BUG_ON(offset < GUC_WOPCM_TOP);
> + GEM_BUG_ON(range_overflows_t(u64, offset, vma->size, GUC_GGTT_TOP));
> +
> + return offset;
> +}
Have these inline functions in their natural spots below. Them being
inline or not is bound to change.
> +
> +/* intel_guc.c */
This should be obvious, comment can be dropped.
> +void intel_guc_init_early(struct intel_guc *guc);
> +void intel_guc_init_send_regs(struct intel_guc *guc);
> +int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32 len);
> +int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len);
> +int intel_guc_sample_forcewake(struct intel_guc *guc);
> +int intel_guc_auth_huc(struct intel_guc *guc, u32 rsa_offset);
> +int intel_guc_suspend(struct drm_i915_private *dev_priv);
> +int intel_guc_resume(struct drm_i915_private *dev_priv);
> +struct i915_vma *intel_guc_allocate_vma(struct intel_guc *guc, u32 size);
> +
> +/* intel_guc_loader.c */
These belong to intel_guc.c, so this comment can be dropped.
> +int intel_guc_select_fw(struct intel_guc *guc);
> +int intel_guc_init_hw(struct intel_guc *guc);
This goes under init_early at least, init_send_regs seems overly
specific and is not it like guc_init_mmio? Could be renamed later.
> +u32 intel_guc_wopcm_size(struct drm_i915_private *dev_priv);
> +
> +/* i915_guc_submission.c */
A separate header for these.
> +int i915_guc_submission_init(struct drm_i915_private *dev_priv);
> +int i915_guc_submission_enable(struct drm_i915_private *dev_priv);
> +void i915_guc_submission_disable(struct drm_i915_private *dev_priv);
> +void i915_guc_submission_fini(struct drm_i915_private *dev_priv);
> +
> +/* intel_guc_log.c */
Ditto.
> +int intel_guc_log_create(struct intel_guc *guc);
> +void intel_guc_log_destroy(struct intel_guc *guc);
> +int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val);
> +void i915_guc_log_register(struct drm_i915_private *dev_priv);
> +void i915_guc_log_unregister(struct drm_i915_private *dev_priv);
> +
> +#endif
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-10-03 8:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-02 14:01 [PATCH v2 0/6] drm/i915: Guc code reorg Michal Wajdeczko
2017-10-02 14:01 ` [PATCH v2 1/6] drm/i915/uc: Drop unnecessary forward declaration Michal Wajdeczko
2017-10-02 14:01 ` [PATCH v2 2/6] drm/i915/uc: Move uC fw helper code into dedicated files Michal Wajdeczko
2017-10-03 7:48 ` Joonas Lahtinen
2017-10-02 14:01 ` [PATCH v2 3/6] drm/i915/uc: Create intel_uc_init_mmio Michal Wajdeczko
2017-10-03 5:58 ` Sagar Arun Kamble
2017-10-03 8:05 ` Joonas Lahtinen
2017-10-03 7:57 ` Joonas Lahtinen
2017-10-02 14:01 ` [PATCH v2 4/6] drm/i915/huc: Move HuC declarations into dedicated header Michal Wajdeczko
2017-10-03 8:10 ` Joonas Lahtinen
2017-10-02 14:01 ` [PATCH v2 5/6] drm/i915/guc: Move Guc early init into own function Michal Wajdeczko
2017-10-03 6:26 ` Sagar Arun Kamble
2017-10-02 14:01 ` [PATCH v2 6/6] drm/i915/guc: Move GuC declarations and functions into dedicated files Michal Wajdeczko
2017-10-03 6:35 ` Sagar Arun Kamble
2017-10-03 8:29 ` Joonas Lahtinen [this message]
2017-10-02 14:39 ` ✗ Fi.CI.BAT: failure for drm/i915: Guc code reorg Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1507019353.4728.39.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=michal.wajdeczko@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.