All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Re-order some checks to do the unlikely one first
@ 2015-02-16 18:25 Damien Lespiau
  2015-02-16 18:25 ` [PATCH 2/2] drm/i915: Don't try to set INSTPM for the _ABSOLUTE constant buffer address Damien Lespiau
  2015-02-16 21:03 ` [PATCH 1/2] drm/i915: Re-order some checks to do the unlikely one first Chris Wilson
  0 siblings, 2 replies; 8+ messages in thread
From: Damien Lespiau @ 2015-02-16 18:25 UTC (permalink / raw)
  To: intel-gfx

instpm_mode != relative_constants_mode is quite unlikely to happen, so
we can test it first to use C's && short-circuiting and not test on
'ring'.

I know, probably a useless micro-optimisation in the big scheme of
things, but I'm going to add another test here, so might as well do it.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index aafcef3..896641a 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -691,8 +691,8 @@ int intel_execlists_submission(struct drm_device *dev, struct drm_file *file,
 	if (ret)
 		return ret;
 
-	if (ring == &dev_priv->ring[RCS] &&
-	    instp_mode != dev_priv->relative_constants_mode) {
+	if (instp_mode != dev_priv->relative_constants_mode &&
+	    ring == &dev_priv->ring[RCS]) {
 		ret = intel_logical_ring_begin(ringbuf, ctx, 4);
 		if (ret)
 			return ret;
-- 
1.8.3.1

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

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

end of thread, other threads:[~2015-02-23 23:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-16 18:25 [PATCH 1/2] drm/i915: Re-order some checks to do the unlikely one first Damien Lespiau
2015-02-16 18:25 ` [PATCH 2/2] drm/i915: Don't try to set INSTPM for the _ABSOLUTE constant buffer address Damien Lespiau
2015-02-17  5:45   ` shuang.he
2015-02-23 23:24   ` Daniel Vetter
2015-02-16 21:03 ` [PATCH 1/2] drm/i915: Re-order some checks to do the unlikely one first Chris Wilson
2015-02-17 11:48   ` Damien Lespiau
2015-02-17 21:10     ` Chris Wilson
2015-02-19 10:26   ` Dave Gordon

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.