Skip to contentSkip to conversation

drm/i915: Move golden context init into ->init_context

PATCH Applied Daniel Vetter 4 participants 4 messages Dec 2, 2014 – Dec 8, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Move golden context init into ->init_context

Similar to a patch from Thomas Daniel for lrc contexts. This keeps both sides somewhat in sync and should make Dave Gordon happy.

Note that both the wa and the golden context init code suffer a bit from an inssuficient split into driver load and hw init code. Which means we have a bunch of tests all over the place to check whether the one-time initialization has been done already or not.

All that one-tim code should be moved into the one-time ring setup code, but that's work for later.

Cc Dave Gordon <[email protected]>
Cc Thomas Daniel <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem_context.c |  4 ----
 drivers/gpu/drm/i915/intel_ringbuffer.c | 18 +++++++++++++++++-
 2 files changed, 17 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_gem_context.c +0 -4
index 5cd2b97aa76e..2acf5803cf32 100644
@@ -651,10 +651,6 @@ done:
 			if (ret)
 				DRM_ERROR("ring init context: %d\n", ret);
 		}
-
-		ret = i915_gem_render_state_init(ring);
-		if (ret)
-			DRM_ERROR("init render state: %d\n", ret);
 	}
 
 	return 0;
drivers/gpu/drm/i915/intel_ringbuffer.c +17 -1
index 79b4ca5dc65f..79fe3d0a6442 100644
@@ -710,6 +710,22 @@ static int intel_ring_workarounds_emit(struct intel_engine_cs *ring,
 	return 0;
 }
 
+static int intel_rcs_ctx_init(struct intel_engine_cs *ring,
+			      struct intel_context *ctx)
+{
+	int ret;
+
+	ret = intel_ring_workarounds_emit(ring, ctx);
+	if (ret != 0)
+		return ret;
+
+	ret = i915_gem_render_state_init(ring);
+	if (ret)
+		DRM_ERROR("init render state: %d\n", ret);
+
+	return ret;
+}
+
 static int wa_add(struct drm_i915_private *dev_priv,
 		  const u32 addr, const u32 val, const u32 mask)
 {
@@ -2341,7 +2357,7 @@ int intel_init_render_ring_buffer(struct drm_device *dev)
 			}
 		}
 
-		ring->init_context = intel_ring_workarounds_emit;
+		ring->init_context = intel_rcs_ctx_init;
 		ring->add_request = gen6_add_request;
 		ring->flush = gen8_render_ring_flush;
 		ring->irq_get = gen8_ring_get_irq;
Signature · 6 lines
1.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 1/1
#1 lore raw

-------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

PNV                 -1              364/364              363/364
ILK                 -4              365/366              361/366
SNB                                  450/450              450/450
IVB                 -2              498/498              496/498
BYT                                  289/289              289/289
HSW                                  564/564              564/564
BDW                                  417/417              417/417
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*PNV  igt_kms_sysfs_edid_timing      PASS(4, M25M7)      FAIL(1, M7)
*ILK  igt_drv_suspend_fence-restore-tiled2untiled      PASS(2, M26)      DMESG_WARN(1, M26)
*ILK  igt_kms_flip_bcs-flip-vs-modeset-interruptible      DMESG_WARN(1, M26)PASS(7, M26)      NSPT(1, M26)
*ILK  igt_kms_flip_flip-vs-dpms-interruptible      PASS(4, M26)      DMESG_WARN(1, M26)
 ILK  igt_kms_flip_wf_vblank-vs-modeset-interruptible      DMESG_WARN(2, M26)PASS(4, M26)      DMESG_WARN(1, M26)
*IVB  igt_kms_cursor_crc_cursor-64x64-offscreen      NSPT(4, M34)PASS(2, M34M21)      DMESG_WARN(1, M21)
*IVB  igt_kms_cursor_crc_cursor-64x64-sliding      FAIL(1, M21)NSPT(4, M34)PASS(1, M34)      DMESG_WARN(1, M21)

Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel Vetter
Quoted 11 lines · Daniel Vetter

Similar to a patch from Thomas Daniel for lrc contexts. This keeps both sides somewhat in sync and should make Dave Gordon happy.

Note that both the wa and the golden context init code suffer a bit from an inssuficient split into driver load and hw init code. Which means we have a bunch of tests all over the place to check whether the one-time initialization has been done already or not.

All that one-tim code should be moved into the one-time ring setup code, but that's work for later.

Quoted 7 lines
Cc Dave Gordon <[email protected]>
Cc Thomas Daniel <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem_context.c |  4 ----
 drivers/gpu/drm/i915/intel_ringbuffer.c | 18 +++++++++++++++++-
 2 files changed, 17 insertions(+), 5 deletions(-)

LGTM :)

Quoted 44 lines
drivers/gpu/drm/i915/i915_gem_context.c +0 -4
index 5cd2b97aa76e..2acf5803cf32 100644
@@ -651,10 +651,6 @@ done:
 			if (ret)
 				DRM_ERROR("ring init context: %d\n", ret);
 		}
-
-		ret = i915_gem_render_state_init(ring);
-		if (ret)
-			DRM_ERROR("init render state: %d\n", ret);
 	}
 
 	return 0;
drivers/gpu/drm/i915/intel_ringbuffer.c +16 -0
index 79b4ca5dc65f..79fe3d0a6442 100644
@@ -710,6 +710,22 @@ static int intel_ring_workarounds_emit(struct intel_engine_cs *ring,
 	return 0;
 }
 
+static int intel_rcs_ctx_init(struct intel_engine_cs *ring,
+			      struct intel_context *ctx)
+{
+	int ret;
+
+	ret = intel_ring_workarounds_emit(ring, ctx);
+	if (ret != 0)
+		return ret;
+
+	ret = i915_gem_render_state_init(ring);
+	if (ret)
+		DRM_ERROR("init render state: %d\n", ret);
+
+	return ret;
+}
+
 static int wa_add(struct drm_i915_private *dev_priv,
 		  const u32 addr, const u32 val, const u32 mask)
 {

drivers/gpu/drm/i915/intel_ringbuffer.c int intel_init_render_ring_buffer(struct drm_device *dev) · line 2363

Quoted 8 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -1
@@ -2341,7 +2357,7 @@ int intel_init_render_ring_buffer(struct drm_device *dev)
 			}
 		}
 
-		ring->init_context = intel_ring_workarounds_emit;
+		ring->init_context = intel_rcs_ctx_init;
 		ring->add_request = gen6_add_request;
 		ring->flush = gen8_render_ring_flush;
 		ring->irq_get = gen8_ring_get_irq;

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 20 lines · Dave Gordon
Quoted 11 lines · Daniel Vetter

Similar to a patch from Thomas Daniel for lrc contexts. This keeps both sides somewhat in sync and should make Dave Gordon happy.

Note that both the wa and the golden context init code suffer a bit from an inssuficient split into driver load and hw init code. Which means we have a bunch of tests all over the place to check whether the one-time initialization has been done already or not.

All that one-tim code should be moved into the one-time ring setup code, but that's work for later.

Quoted 7 lines
Cc Dave Gordon <[email protected]>
Cc Thomas Daniel <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem_context.c |  4 ----
 drivers/gpu/drm/i915/intel_ringbuffer.c | 18 +++++++++++++++++-
 2 files changed, 17 insertions(+), 5 deletions(-)
Quoted 2 lines

LGTM :)

Queued for -next, thanks for the review.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx