public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Move golden context init into ->init_context
@ 2014-12-02 15:19 Daniel Vetter
  2014-12-03  2:54 ` shuang.he
  2014-12-08 13:51 ` Dave Gordon
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Vetter @ 2014-12-02 15:19 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, 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.

Cc: Dave Gordon <david.s.gordon@intel.com>
Cc: Thomas Daniel <thomas.daniel@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_context.c |  4 ----
 drivers/gpu/drm/i915/intel_ringbuffer.c | 18 +++++++++++++++++-
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 5cd2b97aa76e..2acf5803cf32 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -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;
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 79b4ca5dc65f..79fe3d0a6442 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -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;
-- 
1.9.3

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

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

* Re: [PATCH] drm/i915: Move golden context init into ->init_context
  2014-12-02 15:19 [PATCH] drm/i915: Move golden context init into ->init_context Daniel Vetter
@ 2014-12-03  2:54 ` shuang.he
  2014-12-08 13:51 ` Dave Gordon
  1 sibling, 0 replies; 4+ messages in thread
From: shuang.he @ 2014-12-03  2:54 UTC (permalink / raw)
  To: shuang.he, intel-gfx, daniel.vetter

Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
-------------------------------------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
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Move golden context init into ->init_context
  2014-12-02 15:19 [PATCH] drm/i915: Move golden context init into ->init_context Daniel Vetter
  2014-12-03  2:54 ` shuang.he
@ 2014-12-08 13:51 ` Dave Gordon
  2014-12-08 14:19   ` Daniel Vetter
  1 sibling, 1 reply; 4+ messages in thread
From: Dave Gordon @ 2014-12-08 13:51 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics Development; +Cc: Daniel Vetter

On 02/12/14 15:19, Daniel Vetter wrote:
> 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 <david.s.gordon@intel.com>
> Cc: Thomas Daniel <thomas.daniel@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  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 :)
Reviewed-by: Dave Gordon <david.s.gordon@intel.com>

> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index 5cd2b97aa76e..2acf5803cf32 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -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;
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 79b4ca5dc65f..79fe3d0a6442 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -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;
> 

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

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

* Re: [PATCH] drm/i915: Move golden context init into ->init_context
  2014-12-08 13:51 ` Dave Gordon
@ 2014-12-08 14:19   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2014-12-08 14:19 UTC (permalink / raw)
  To: Dave Gordon; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

On Mon, Dec 08, 2014 at 01:51:01PM +0000, Dave Gordon wrote:
> On 02/12/14 15:19, Daniel Vetter wrote:
> > 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 <david.s.gordon@intel.com>
> > Cc: Thomas Daniel <thomas.daniel@intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  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 :)
> Reviewed-by: Dave Gordon <david.s.gordon@intel.com>

Queued for -next, thanks for the review.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2014-12-08 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-02 15:19 [PATCH] drm/i915: Move golden context init into ->init_context Daniel Vetter
2014-12-03  2:54 ` shuang.he
2014-12-08 13:51 ` Dave Gordon
2014-12-08 14:19   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox