Skip to contentSkip to conversation

drm-intel-collector - update

PATCH In review Rodrigo Vivi 3 participants 8 messages Mar 16, 2015 – Mar 18, 2015

Subsystems (2)
lore
Share & tools
lore

Rodrigo Vivi

author maintainer
#0 lore raw

cover drm-intel-collector - update

This is another drm-intel-collector updated notice:
http://cgit.freedesktop.org/~vivijim/drm-intel/log/?h=drm-intel-collector

Here goes the update list in order for better reviewers assignment:

Patch drm/i915: Remove pinned check from madvise_ioctl - Reviewer:
Patch drm/i915/vlv: check port in infoframe_enabled v2 - Reviewer:
Patch drm/i915: vlv: fix save/restore of GFX_MAX_REQ_COUNT reg - Reviewer:
Patch drm/i915: Remove unused head member in request struct - Reviewer:
Patch drm/i915: Remove unneeded check on execlist ringbuf alloc - Reviewer:

3 rounds at once but just few patches collected this time.

Thanks,
Rodrigo.

Chris Wilson (1):
drm/i915: Remove pinned check from madvise_ioctl

Imre Deak (1):
drm/i915: vlv: fix save/restore of GFX_MAX_REQ_COUNT reg

Jesse Barnes (1):
drm/i915/vlv: check port in infoframe_enabled v2

Mika Kuoppala (2):
drm/i915: Remove unused head member in request struct drm/i915: Remove unneeded check on execlist ringbuf alloc

 drivers/gpu/drm/i915/i915_drv.c   |  4 ++--
 drivers/gpu/drm/i915/i915_drv.h   |  3 ---
 drivers/gpu/drm/i915/i915_gem.c   |  9 ---------
 drivers/gpu/drm/i915/intel_hdmi.c |  7 ++++++-
 drivers/gpu/drm/i915/intel_lrc.c  | 29 +++++++++++++----------------
 5 files changed, 21 insertions(+), 31 deletions(-)
Signature · 6 lines
2.1.0

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

PATCH 1/5 drm/i915: Remove pinned check from madvise_ioctl

From: Chris Wilson <[email protected]>

We don't need to incur the overhead of checking whether the object is pinned prior to changing its madvise. If the object is pinned, the madvise will not take effect until it is unpinned and so we cannot free the pages being pointed at by hardware. Marking a pinned object with allocated pages as DONTNEED will not trigger any undue warnings. The check is therefore superfluous, and by removing it we can remove a linear walk over all the vma the object has.

---
 drivers/gpu/drm/i915/i915_gem.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +0 -6
index 0fe313d..b0e4a33 100644
@@ -4366,11 +4366,6 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
 		goto unlock;
 	}
 
-	if (i915_gem_obj_is_pinned(obj)) {
-		ret = -EINVAL;
-		goto out;
-	}
-
 	if (obj->pages &&
 	    obj->tiling_mode != I915_TILING_NONE &&
 	    dev_priv->quirks & QUIRK_PIN_SWIZZLED_PAGES) {
@@ -4389,7 +4384,6 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
 
 	args->retained = obj->madv != __I915_MADV_PURGED;
 
-out:
 	drm_gem_object_unreference(&obj->base);
 unlock:
 	mutex_unlock(&dev->struct_mutex);
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author maintainer
#2 lore raw

PATCH 2/5 drm/i915/vlv: check port in infoframe_enabled v2

In reply to Rodrigo Vivi

From: Jesse Barnes <[email protected]>

Same as IBX and G4x, they all share the same genetic material.

v2: we all need a bit more port in our lives

---
 drivers/gpu/drm/i915/intel_hdmi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_hdmi.c +6 -1
index 995c5b2..815a50f 100644
@@ -324,10 +324,15 @@ static bool vlv_infoframe_enabled(struct drm_encoder *encoder)
 	struct drm_device *dev = encoder->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
+	struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
 	int reg = VLV_TVIDEO_DIP_CTL(intel_crtc->pipe);
 	u32 val = I915_READ(reg);
+	u32 port = intel_dig_port->port;
 
-	return val & VIDEO_DIP_ENABLE;
+	if (port == (val & VIDEO_DIP_PORT_MASK))
+		return val & VIDEO_DIP_ENABLE;
+
+	return false;
 }
 
 static void hsw_write_infoframe(struct drm_encoder *encoder,
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author maintainer
#3 lore raw

PATCH 3/5 drm/i915: vlv: fix save/restore of GFX_MAX_REQ_COUNT reg

In reply to Rodrigo Vivi

From: Imre Deak <[email protected]>

Due this typo we don't save/restore the GFX_MAX_REQ_COUNT register across suspend/resume, so fix this.

This was introduced in

commit ddeea5b0c36f3665446518c609be91f9336ef674

Author: Imre Deak <[email protected]>
Date:   Mon May 5 15:19:56 2014 +0300

drm/i915: vlv: add runtime PM support

I noticed this only by reading the code. To my knowledge it shouldn't cause any real problems at the moment, since the power well backing this register remains on across a runtime s/r. This may change once system-wide s0ix functionality is enabled in the kernel.

v2:
- resend after a missing git add -u :/

---
 drivers/gpu/drm/i915/i915_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -2
index 82f8be4..9cc953e 100644
@@ -1038,7 +1038,7 @@ static void vlv_save_gunit_s0ix_state(struct drm_i915_private *dev_priv)
 		s->lra_limits[i] = I915_READ(GEN7_LRA_LIMITS_BASE + i * 4);
 
 	s->media_max_req_count	= I915_READ(GEN7_MEDIA_MAX_REQ_COUNT);
-	s->gfx_max_req_count	= I915_READ(GEN7_MEDIA_MAX_REQ_COUNT);
+	s->gfx_max_req_count	= I915_READ(GEN7_GFX_MAX_REQ_COUNT);
 
 	s->render_hwsp		= I915_READ(RENDER_HWS_PGA_GEN7);
 	s->ecochk		= I915_READ(GAM_ECOCHK);
@@ -1119,7 +1119,7 @@ static void vlv_restore_gunit_s0ix_state(struct drm_i915_private *dev_priv)
 		I915_WRITE(GEN7_LRA_LIMITS_BASE + i * 4, s->lra_limits[i]);
 
 	I915_WRITE(GEN7_MEDIA_MAX_REQ_COUNT, s->media_max_req_count);
-	I915_WRITE(GEN7_MEDIA_MAX_REQ_COUNT, s->gfx_max_req_count);
+	I915_WRITE(GEN7_GFX_MAX_REQ_COUNT, s->gfx_max_req_count);
 
 	I915_WRITE(RENDER_HWS_PGA_GEN7,	s->render_hwsp);
 	I915_WRITE(GAM_ECOCHK,		s->ecochk);
Signature · 6 lines
2.1.0

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

Re: [PATCH 3/5] drm/i915: vlv: fix save/restore of GFX_MAX_REQ_COUNT reg

Quoted 18 lines · Rodrigo Vivi

From: Imre Deak <[email protected]>

Due this typo we don't save/restore the GFX_MAX_REQ_COUNT register across suspend/resume, so fix this.

This was introduced in

commit ddeea5b0c36f3665446518c609be91f9336ef674

Author: Imre Deak <[email protected]>
Date:   Mon May 5 15:19:56 2014 +0300

drm/i915: vlv: add runtime PM support

I noticed this only by reading the code. To my knowledge it shouldn't cause any real problems at the moment, since the power well backing this register remains on across a runtime s/r. This may change once system-wide s0ix functionality is enabled in the kernel.

Quoted 6 lines

v2:
- resend after a missing git add -u :/

Quoted 33 lines
---
 drivers/gpu/drm/i915/i915_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -2
index 82f8be4..9cc953e 100644
@@ -1038,7 +1038,7 @@ static void vlv_save_gunit_s0ix_state(struct drm_i915_private *dev_priv)
 		s->lra_limits[i] = I915_READ(GEN7_LRA_LIMITS_BASE + i * 4);
 
 	s->media_max_req_count	= I915_READ(GEN7_MEDIA_MAX_REQ_COUNT);
-	s->gfx_max_req_count	= I915_READ(GEN7_MEDIA_MAX_REQ_COUNT);
+	s->gfx_max_req_count	= I915_READ(GEN7_GFX_MAX_REQ_COUNT);
 
 	s->render_hwsp		= I915_READ(RENDER_HWS_PGA_GEN7);
 	s->ecochk		= I915_READ(GAM_ECOCHK);
@@ -1119,7 +1119,7 @@ static void vlv_restore_gunit_s0ix_state(struct drm_i915_private *dev_priv)
 		I915_WRITE(GEN7_LRA_LIMITS_BASE + i * 4, s->lra_limits[i]);
 
 	I915_WRITE(GEN7_MEDIA_MAX_REQ_COUNT, s->media_max_req_count);
-	I915_WRITE(GEN7_MEDIA_MAX_REQ_COUNT, s->gfx_max_req_count);
+	I915_WRITE(GEN7_GFX_MAX_REQ_COUNT, s->gfx_max_req_count);
 
 	I915_WRITE(RENDER_HWS_PGA_GEN7,	s->render_hwsp);
 	I915_WRITE(GAM_ECOCHK,		s->ecochk);
Signature · 6 lines
2.1.0

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

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

author maintainer
#5 lore raw

PATCH 4/5 drm/i915: Remove unused head member in request struct

In reply to Rodrigo Vivi

From: Mika Kuoppala <[email protected]>

commit 939fd762083f988be271da8c96398178daf9baf0

Author: Mika Kuoppala <[email protected]>
Date:   Thu Jan 30 19:04:44 2014 +0200

drm/i915: Get rid of acthd based guilty batch search

Failed to cleanup properly as it made the head obsolete.

---
 drivers/gpu/drm/i915/i915_drv.h | 3 ---
 drivers/gpu/drm/i915/i915_gem.c | 3 ---
 2 files changed, 6 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +0 -3
index a76c6ee..ed6585e 100644
@@ -2049,9 +2049,6 @@ struct drm_i915_gem_request {
 	/** GEM sequence number associated with this request. */
 	uint32_t seqno;
 
-	/** Position in the ringbuffer of the start of the request */
-	u32 head;
-
 	/**
 	 * Position in the ringbuffer of the start of the postfix.
 	 * This is required to calculate the maximum available ringbuffer
drivers/gpu/drm/i915/i915_gem.c +0 -3
index b0e4a33..2986890 100644
@@ -2427,7 +2427,6 @@ int __i915_add_request(struct intel_engine_cs *ring,
 	struct drm_i915_private *dev_priv = ring->dev->dev_private;
 	struct drm_i915_gem_request *request;
 	struct intel_ringbuffer *ringbuf;
-	u32 request_start;
 	int ret;
 
 	request = ring->outstanding_lazy_request;
@@ -2439,7 +2438,6 @@ int __i915_add_request(struct intel_engine_cs *ring,
 	} else
 		ringbuf = ring->buffer;
 
-	request_start = intel_ring_get_tail(ringbuf);
 	/*
 	 * Emit any outstanding flushes - execbuf can fail to emit the flush
 	 * after having emitted the batchbuffer command. Hence we need to fix
@@ -2474,7 +2472,6 @@ int __i915_add_request(struct intel_engine_cs *ring,
 			return ret;
 	}
 
-	request->head = request_start;
 	request->tail = intel_ring_get_tail(ringbuf);
 
 	/* Whilst this request exists, batch_obj will be on the
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author maintainer
#6 lore raw

PATCH 5/5 drm/i915: Remove unneeded check on execlist ringbuf alloc

In reply to Rodrigo Vivi

From: Mika Kuoppala <[email protected]>

We just allocated the intel_ringbuffer with kzalloc. There is no chance of the ringbuf->obj being other than NULL so remove the redudant check.

---
 drivers/gpu/drm/i915/intel_lrc.c | 29 +++++++++++++----------------
 1 file changed, 13 insertions(+), 16 deletions(-)
drivers/gpu/drm/i915/intel_lrc.c +13 -16
index fcb074b..48795b2 100644
@@ -1931,25 +1931,22 @@ int intel_lr_context_deferred_create(struct intel_context *ctx,
 	ringbuf->last_retired_head = -1;
 	intel_ring_update_space(ringbuf);
 
-	if (ringbuf->obj == NULL) {
-		ret = intel_alloc_ringbuffer_obj(dev, ringbuf);
+	ret = intel_alloc_ringbuffer_obj(dev, ringbuf);
+	if (ret) {
+		DRM_DEBUG_DRIVER(
+			"Failed to allocate ringbuffer obj %s: %d\n",
+			ring->name, ret);
+		goto error_free_rbuf;
+	}
+
+	if (is_global_default_ctx) {
+		ret = intel_pin_and_map_ringbuffer_obj(dev, ringbuf);
 		if (ret) {
-			DRM_DEBUG_DRIVER(
-				"Failed to allocate ringbuffer obj %s: %d\n",
+			DRM_ERROR(
+				"Failed to pin and map ringbuffer %s: %d\n",
 				ring->name, ret);
-			goto error_free_rbuf;
+			goto error_destroy_rbuf;
 		}
-
-		if (is_global_default_ctx) {
-			ret = intel_pin_and_map_ringbuffer_obj(dev, ringbuf);
-			if (ret) {
-				DRM_ERROR(
-					"Failed to pin and map ringbuffer %s: %d\n",
-					ring->name, ret);
-				goto error_destroy_rbuf;
-			}
-		}
-
 	}
 
 	ret = populate_lr_context(ctx, ctx_obj, ring, ringbuf);
Signature · 6 lines
2.1.0

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

Re: [PATCH 5/5] drm/i915: Remove unneeded check on execlist ringbuf alloc

Task id: 5966 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
PNV -2 275/275 273/275

ILK                                  303/303              303/303
SNB                                  279/279              279/279
IVB                 -1              343/343              342/343
BYT                 -2              287/287              285/287
HSW                                  361/361              361/361
BDW                                  308/308              308/308
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*PNV  igt_drv_debugfs_reader      PASS(3)      DMESG_WARN(1)PASS(1)
*PNV  igt_drv_hangman_error-state-sysfs-entry      PASS(3)      TIMEOUT(1)PASS(1)
*IVB  igt_gem_evict_everything_minor-normal      PASS(2)      DMESG_WARN(1)PASS(1)
*BYT  igt_kms_setmode_clone-exclusive-crtc      PASS(2)      DMESG_WARN(2)
*BYT  igt_kms_setmode_clone-single-crtc      PASS(2)      DMESG_WARN(2)

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