diff mbox series

[3/5] i915/drm/guc: Don't pass CTB while reading

Message ID 20200115140822.55756-4-michal.wajdeczko@intel.com (mailing list archive)
State New, archived
Headers show
Series Misc GuC CT improvements - part II | expand

Commit Message

Michal Wajdeczko Jan. 15, 2020, 2:08 p.m. UTC
Since we only have one RECV buffer we don't need to explicitly pass
it to the read function.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Daniele Ceraolo Spurio Jan. 16, 2020, 7:20 p.m. UTC | #1
On 1/15/20 6:08 AM, Michal Wajdeczko wrote:
> Since we only have one RECV buffer we don't need to explicitly pass
> it to the read function.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

Daniele

> ---
>   drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> index dedbf3b8ab01..8c466308ad08 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> @@ -576,8 +576,9 @@ static inline bool ct_header_is_response(u32 header)
>   	return !!(header & GUC_CT_MSG_IS_RESPONSE);
>   }
>   
> -static int ctb_read(struct intel_guc_ct_buffer *ctb, u32 *data)
> +static int ct_read(struct intel_guc_ct *ct, u32 *data)
>   {
> +	struct intel_guc_ct_buffer *ctb = &ct->ctbs[CTB_RECV];
>   	struct guc_ct_buffer_desc *desc = ctb->desc;
>   	u32 head = desc->head;
>   	u32 tail = desc->tail;
> @@ -834,7 +835,6 @@ static int ct_handle_request(struct intel_guc_ct *ct, const u32 *msg)
>    */
>   void intel_guc_ct_event_handler(struct intel_guc_ct *ct)
>   {
> -	struct intel_guc_ct_buffer *ctb = &ct->ctbs[CTB_RECV];
>   	u32 msg[GUC_CT_MSG_LEN_MASK + 1]; /* one extra dw for the header */
>   	int err = 0;
>   
> @@ -844,7 +844,7 @@ void intel_guc_ct_event_handler(struct intel_guc_ct *ct)
>   	}
>   
>   	do {
> -		err = ctb_read(ctb, msg);
> +		err = ct_read(ct, msg);
>   		if (err)
>   			break;
>   
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
index dedbf3b8ab01..8c466308ad08 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
@@ -576,8 +576,9 @@  static inline bool ct_header_is_response(u32 header)
 	return !!(header & GUC_CT_MSG_IS_RESPONSE);
 }
 
-static int ctb_read(struct intel_guc_ct_buffer *ctb, u32 *data)
+static int ct_read(struct intel_guc_ct *ct, u32 *data)
 {
+	struct intel_guc_ct_buffer *ctb = &ct->ctbs[CTB_RECV];
 	struct guc_ct_buffer_desc *desc = ctb->desc;
 	u32 head = desc->head;
 	u32 tail = desc->tail;
@@ -834,7 +835,6 @@  static int ct_handle_request(struct intel_guc_ct *ct, const u32 *msg)
  */
 void intel_guc_ct_event_handler(struct intel_guc_ct *ct)
 {
-	struct intel_guc_ct_buffer *ctb = &ct->ctbs[CTB_RECV];
 	u32 msg[GUC_CT_MSG_LEN_MASK + 1]; /* one extra dw for the header */
 	int err = 0;
 
@@ -844,7 +844,7 @@  void intel_guc_ct_event_handler(struct intel_guc_ct *ct)
 	}
 
 	do {
-		err = ctb_read(ctb, msg);
+		err = ct_read(ct, msg);
 		if (err)
 			break;