Re: [PATCH] drm/i915/guc: Unify parameters of public CT functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 20 Mar 2018 08:24:14 +0100, Sagar Arun Kamble <sagar.a.kamble@xxxxxxxxx> wrote:



On 3/19/2018 8:58 PM, Michal Wajdeczko wrote:
There is no need to mix parameter types in public CT functions
as we can always accept intel_guc_ct.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx>
Cc: Sagar Arun Kamble <sagar.a.kamble@xxxxxxxxx>
Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
drivers/gpu/drm/i915/intel_guc_ct.c | 34 ++++++++++++++++++++++++----------
  drivers/gpu/drm/i915/intel_guc_ct.h |  6 ++----
  drivers/gpu/drm/i915/intel_uc.c     |  4 ++--
  3 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_guc_ct.c b/drivers/gpu/drm/i915/intel_guc_ct.c
index 0a0d3d5..7dd7de0 100644
--- a/drivers/gpu/drm/i915/intel_guc_ct.c
+++ b/drivers/gpu/drm/i915/intel_guc_ct.c
@@ -28,12 +28,21 @@
    enum { CTB_OWNER_HOST = 0 };
  +/**
+ * intel_guc_ct_init_early - Initialize CT state without requiring device access
+ * @ct: pointer to CT struct
+ */
  void intel_guc_ct_init_early(struct intel_guc_ct *ct)
  {
  	/* we're using static channel owners */
  	ct->host_channel.owner = CTB_OWNER_HOST;
  }
  +static inline struct intel_guc *ct_to_guc(struct intel_guc_ct *ct)
+{
+	return container_of(ct, struct intel_guc, ct);
+}
+
  static inline const char *guc_ct_buffer_type_to_str(u32 type)
  {
  	switch (type) {
@@ -416,16 +425,19 @@ static int intel_guc_send_ct(struct intel_guc *guc, const u32 *action, u32 len)
  }
    /**
- * Enable buffer based command transport
+ * intel_guc_ct_enable - Enable buffer based command transport.
+ * @ct: pointer to CT struct
+ *
   * Shall only be called for platforms with HAS_GUC_CT.
- * @guc:	the guc
- * return:	0 on success
- *		non-zero on failure
+ *
+ * Returns:
+ * 0 on success, a negative errno code on failure.
Should be
      * Return: 0 on sucess ...

hmm, I'm not so sure:

$ grep -r "\* Return: .*" drivers/gpu/drm/* | wc -l
153

$ grep -r "\* Returns:$" drivers/gpu/drm/* | wc -l
344

   */
-int intel_guc_enable_ct(struct intel_guc *guc)
+int intel_guc_ct_enable(struct intel_guc_ct *ct)
  {
+	struct intel_guc *guc = ct_to_guc(ct);
  	struct drm_i915_private *dev_priv = guc_to_i915(guc);
change to *i915 as part of this patch itself? :) similar for disable.

sure

Otherwise LGTM
Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@xxxxxxxxx>

thanks
/m

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux