diff mbox

[v4,07/13] drm/i915/guc: Use better name for helper wait function

Message ID 20180323144728.61548-8-michal.wajdeczko@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Wajdeczko March 23, 2018, 2:47 p.m. UTC
In next patch we will introduce another way of waiting for the response
that will use RECV buffer. To avoid misleading names, rename old wait
function to reflect the fact that it is based on descriptor update.

v2: fix comment style (Michal)

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/i915/intel_guc_ct.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

Comments

Michel Thierry March 23, 2018, 10:35 p.m. UTC | #1
On 3/23/2018 7:47 AM, Michal Wajdeczko wrote:
> In next patch we will introduce another way of waiting for the response
> that will use RECV buffer. To avoid misleading names, rename old wait
> function to reflect the fact that it is based on descriptor update.
> 
> v2: fix comment style (Michal)
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_guc_ct.c | 23 +++++++++++++++--------
>   1 file changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_guc_ct.c b/drivers/gpu/drm/i915/intel_guc_ct.c
> index f029ff3..b1ab28f 100644
> --- a/drivers/gpu/drm/i915/intel_guc_ct.c
> +++ b/drivers/gpu/drm/i915/intel_guc_ct.c
> @@ -332,16 +332,23 @@ static int ctb_write(struct intel_guc_ct_buffer *ctb,
>          return 0;
>   }
> 
> -/* Wait for the response from the GuC.
> +/**
> + * wait_for_desc_update - Wait for the descriptor update.
> + * @desc:      buffer descriptor
>    * @fence:     response fence
>    * @status:    placeholder for status
> - * return:     0 response received (status is valid)
> - *             -ETIMEDOUT no response within hardcoded timeout
> - *             -EPROTO no response, ct buffer was in error
> + *
> + * Guc will update descriptor with new fence and status
> + * after processing the command.
> + *
> + * Return:
> + * *   0 response received (status is valid)
> + * *   -ETIMEDOUT no response within hardcoded timeout
> + * *   -EPROTO no response, ct buffer is in error
>    */
> -static int wait_for_response(struct guc_ct_buffer_desc *desc,
> -                            u32 fence,
> -                            u32 *status)
> +static int wait_for_desc_update(struct guc_ct_buffer_desc *desc,

Would you consider 'wait_for_ctb_desc_update'?
I know this is only used with-in the guc_ct.c file, but there's so many 
other descriptors already.

With or without that,

Reviewed-by: Michel Thierry <michel.thierry@intel.com>

> +                               u32 fence,
> +                               u32 *status)
>   {
>          int err;
> 
> @@ -395,7 +402,7 @@ static int ctch_send(struct intel_guc *guc,
> 
>          intel_guc_notify(guc);
> 
> -       err = wait_for_response(desc, fence, status);
> +       err = wait_for_desc_update(desc, fence, status);
>          if (unlikely(err))
>                  return err;
>          if (!INTEL_GUC_MSG_IS_RESPONSE_SUCCESS(*status))
> --
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_guc_ct.c b/drivers/gpu/drm/i915/intel_guc_ct.c
index f029ff3..b1ab28f 100644
--- a/drivers/gpu/drm/i915/intel_guc_ct.c
+++ b/drivers/gpu/drm/i915/intel_guc_ct.c
@@ -332,16 +332,23 @@  static int ctb_write(struct intel_guc_ct_buffer *ctb,
 	return 0;
 }
 
-/* Wait for the response from the GuC.
+/**
+ * wait_for_desc_update - Wait for the descriptor update.
+ * @desc:	buffer descriptor
  * @fence:	response fence
  * @status:	placeholder for status
- * return:	0 response received (status is valid)
- *		-ETIMEDOUT no response within hardcoded timeout
- *		-EPROTO no response, ct buffer was in error
+ *
+ * Guc will update descriptor with new fence and status
+ * after processing the command.
+ *
+ * Return:
+ * *	0 response received (status is valid)
+ * *	-ETIMEDOUT no response within hardcoded timeout
+ * *	-EPROTO no response, ct buffer is in error
  */
-static int wait_for_response(struct guc_ct_buffer_desc *desc,
-			     u32 fence,
-			     u32 *status)
+static int wait_for_desc_update(struct guc_ct_buffer_desc *desc,
+				u32 fence,
+				u32 *status)
 {
 	int err;
 
@@ -395,7 +402,7 @@  static int ctch_send(struct intel_guc *guc,
 
 	intel_guc_notify(guc);
 
-	err = wait_for_response(desc, fence, status);
+	err = wait_for_desc_update(desc, fence, status);
 	if (unlikely(err))
 		return err;
 	if (!INTEL_GUC_MSG_IS_RESPONSE_SUCCESS(*status))