diff mbox

[7/7] drm/i915: Mark elsps submitted when they are pushed to hw

Message ID 1435932578-32209-8-git-send-email-mika.kuoppala@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kuoppala July 3, 2015, 2:09 p.m. UTC
Now when we have requests this deep on call chain, we
can mark the elsp being submitted when it actually is.
While we are it, remove unnecessary temp assignment as
it is already initialized as zero.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Chris Wilson July 3, 2015, 3:36 p.m. UTC | #1
On Fri, Jul 03, 2015 at 05:09:38PM +0300, Mika Kuoppala wrote:
> Now when we have requests this deep on call chain, we
> can mark the elsp being submitted when it actually is.
> While we are it, remove unnecessary temp assignment as
> it is already initialized as zero.

Bah, which I think is bad practice (because when looking at patch contexts
like this, you have no idea if that is true or not as you can't see the
value). You could reduce the number of writes if you wanted to. Personally
I went with

        uint32_t desc[4];

        if (ring->execlist_port[1]) {
                desc[0] = execlists_request_write_tail(ring,
                                                       ring->execlist_port[1]);
                desc[1] = ring->execlist_port[1]->seqno;
        } else
                desc[1] = desc[0] = 0;

        desc[2] = execlists_request_write_tail(ring, ring->execlist_port[0]);
        desc[3] = ring->execlist_port[0]->seqno;
-Chris
Shuang He July 5, 2015, 3:34 a.m. UTC | #2
Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 6720
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
ILK                                  302/302              302/302
SNB                                  312/316              312/316
IVB                                  343/343              343/343
BYT                 -1              287/287              286/287
HSW                                  380/380              380/380
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*BYT  igt@gem_partial_pwrite_pread@reads-uncached      PASS(1)      FAIL(1)
Note: You need to pay more attention to line start with '*'
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 67ff460..8bf4acb 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -304,14 +304,16 @@  static void execlists_elsp_write(struct drm_i915_gem_request *rq0,
 	uint32_t desc[4];
 
 	/* XXX: You must always write both descriptors in the order below. */
-	if (rq1)
+	if (rq1) {
 		temp = execlists_ctx_descriptor(rq1);
-	else
-		temp = 0;
+		rq1->elsp_submitted++;
+	}
+
 	desc[1] = (u32)(temp >> 32);
 	desc[0] = (u32)temp;
 
 	temp = execlists_ctx_descriptor(rq0);
+	rq0->elsp_submitted++;
 	desc[3] = (u32)(temp >> 32);
 	desc[2] = (u32)temp;
 
@@ -433,10 +435,6 @@  static void execlists_context_unqueue(struct intel_engine_cs *ring)
 	WARN_ON(req1 && req1->elsp_submitted);
 
 	execlists_submit_requests(req0, req1);
-
-	req0->elsp_submitted++;
-	if (req1)
-		req1->elsp_submitted++;
 }
 
 static bool execlists_check_remove_request(struct intel_engine_cs *ring,