All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/guc: Refactor the retrieval of guc_process_desc
@ 2017-03-23 23:00 Chris Wilson
  2017-03-24 10:34 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-03-24 12:11 ` [PATCH] " Michał Winiarski
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2017-03-23 23:00 UTC (permalink / raw)
  To: intel-gfx

Move the common "client->vaddr + client->proc_desc_offset" to its own
function, __get_process_desc() to match the newly established pattern.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_guc_submission.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
index 18fd36147dd5..6abf982ee594 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -280,6 +280,12 @@ static unsigned long __select_cacheline(struct intel_guc* guc)
 	return offset;
 }
 
+static inline struct guc_process_desc *
+__get_process_desc(struct i915_guc_client *client)
+{
+	return client->vaddr + client->proc_desc_offset;
+}
+
 /*
  * Initialise the process descriptor shared with the GuC firmware.
  */
@@ -288,9 +294,7 @@ static void guc_proc_desc_init(struct intel_guc *guc,
 {
 	struct guc_process_desc *desc;
 
-	desc = client->vaddr + client->proc_desc_offset;
-
-	memset(desc, 0, sizeof(*desc));
+	desc = memset(__get_process_desc(client), 0, sizeof(*desc));
 
 	/*
 	 * XXX: pDoorbell and WQVBaseAddress are pointers in process address
@@ -422,8 +426,7 @@ int i915_guc_wq_reserve(struct drm_i915_gem_request *request)
 {
 	const size_t wqi_size = sizeof(struct guc_wq_item);
 	struct i915_guc_client *client = request->i915->guc.execbuf_client;
-	struct guc_process_desc *desc = client->vaddr +
-					client->proc_desc_offset;
+	struct guc_process_desc *desc = __get_process_desc(client);
 	u32 freespace;
 	int ret;
 
@@ -468,12 +471,10 @@ static void guc_wq_item_append(struct i915_guc_client *client,
 	const size_t wqi_size = sizeof(struct guc_wq_item);
 	const u32 wqi_len = wqi_size/sizeof(u32) - 1;
 	struct intel_engine_cs *engine = rq->engine;
-	struct guc_process_desc *desc;
+	struct guc_process_desc *desc = __get_process_desc(client);
 	struct guc_wq_item *wqi;
 	u32 freespace, tail, wq_off;
 
-	desc = client->vaddr + client->proc_desc_offset;
-
 	/* Free space is guaranteed, see i915_guc_wq_reserve() above */
 	freespace = CIRC_SPACE(client->wq_tail, desc->head, client->wq_size);
 	GEM_BUG_ON(freespace < wqi_size);
@@ -519,8 +520,7 @@ static void guc_wq_item_append(struct i915_guc_client *client,
 
 static void guc_reset_wq(struct i915_guc_client *client)
 {
-	struct guc_process_desc *desc = client->vaddr +
-					client->proc_desc_offset;
+	struct guc_process_desc *desc = __get_process_desc(client);
 
 	desc->head = 0;
 	desc->tail = 0;
@@ -530,13 +530,11 @@ static void guc_reset_wq(struct i915_guc_client *client)
 
 static int guc_ring_doorbell(struct i915_guc_client *client)
 {
-	struct guc_process_desc *desc;
+	struct guc_process_desc *desc = __get_process_desc(client);
 	union guc_doorbell_qw db_cmp, db_exc, db_ret;
 	union guc_doorbell_qw *db;
 	int attempt = 2, ret = -EAGAIN;
 
-	desc = client->vaddr + client->proc_desc_offset;
-
 	/* Update the tail so it is visible to GuC */
 	desc->tail = client->wq_tail;
 
-- 
2.11.0

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/guc: Refactor the retrieval of guc_process_desc
  2017-03-23 23:00 [PATCH] drm/i915/guc: Refactor the retrieval of guc_process_desc Chris Wilson
@ 2017-03-24 10:34 ` Patchwork
  2017-03-24 12:11 ` [PATCH] " Michał Winiarski
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-03-24 10:34 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/guc: Refactor the retrieval of guc_process_desc
URL   : https://patchwork.freedesktop.org/series/21795/
State : success

== Summary ==

Series 21795v1 drm/i915/guc: Refactor the retrieval of guc_process_desc
https://patchwork.freedesktop.org/api/1.0/series/21795/revisions/1/mbox/

Test gem_exec_flush:
        Subgroup basic-batch-kernel-default-uc:
                pass       -> FAIL       (fi-snb-2600) fdo#100007

fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time: 455s
fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time: 454s
fi-bsw-n3050     total:278  pass:239  dwarn:0   dfail:0   fail:0   skip:39  time: 584s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time: 538s
fi-bxt-t5700     total:278  pass:258  dwarn:0   dfail:0   fail:0   skip:20  time: 579s
fi-byt-j1900     total:278  pass:251  dwarn:0   dfail:0   fail:0   skip:27  time: 506s
fi-byt-n2820     total:278  pass:247  dwarn:0   dfail:0   fail:0   skip:31  time: 505s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 437s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 436s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time: 444s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 512s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 494s
fi-kbl-7500u     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 484s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 494s
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17  time: 596s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time: 487s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 516s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time: 462s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time: 543s
fi-snb-2600      total:278  pass:248  dwarn:0   dfail:0   fail:1   skip:29  time: 422s

fd27e1e4c9b5dc11966b4953432bd6e0510da308 drm-tip: 2017y-03m-24d-08h-39m-20s UTC integration manifest
5a2e711 drm/i915/guc: Refactor the retrieval of guc_process_desc

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4285/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915/guc: Refactor the retrieval of guc_process_desc
  2017-03-23 23:00 [PATCH] drm/i915/guc: Refactor the retrieval of guc_process_desc Chris Wilson
  2017-03-24 10:34 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-03-24 12:11 ` Michał Winiarski
  2017-03-24 16:35   ` Chris Wilson
  1 sibling, 1 reply; 4+ messages in thread
From: Michał Winiarski @ 2017-03-24 12:11 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Thu, Mar 23, 2017 at 11:00:00PM +0000, Chris Wilson wrote:
> Move the common "client->vaddr + client->proc_desc_offset" to its own
> function, __get_process_desc() to match the newly established pattern.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>

-Michał

> ---
>  drivers/gpu/drm/i915/i915_guc_submission.c | 24 +++++++++++-------------
>  1 file changed, 11 insertions(+), 13 deletions(-)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915/guc: Refactor the retrieval of guc_process_desc
  2017-03-24 12:11 ` [PATCH] " Michał Winiarski
@ 2017-03-24 16:35   ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2017-03-24 16:35 UTC (permalink / raw)
  To: Michał Winiarski; +Cc: intel-gfx

On Fri, Mar 24, 2017 at 01:11:20PM +0100, Michał Winiarski wrote:
> On Thu, Mar 23, 2017 at 11:00:00PM +0000, Chris Wilson wrote:
> > Move the common "client->vaddr + client->proc_desc_offset" to its own
> > function, __get_process_desc() to match the newly established pattern.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
Applied, thanks.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-24 16:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-23 23:00 [PATCH] drm/i915/guc: Refactor the retrieval of guc_process_desc Chris Wilson
2017-03-24 10:34 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-03-24 12:11 ` [PATCH] " Michał Winiarski
2017-03-24 16:35   ` Chris Wilson

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.