Skip to contentSkip to conversation

drm-intel-collector - update

PATCH In review Rodrigo Vivi 7 participants 25 messages Nov 4, 2014 – Nov 11, 2014

Subsystems (3)
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: Check the minimum pitch for the user framebuffer - Reviewer:
Patch drm/i915: Make the physical object coherent with GTT - Reviewer:
Patch drm/i915/chv: Use timeout mode for RC6 on chv - Reviewer:
Patch drm/i915: Specify bsd rings through exec flag - Reviewer:
Patch drm/i915: add I915_PARAM_HAS_BSD2 to i915_getparam - Reviewer:
Patch drm/i915: Enable vblank interrupts for CRC generation - Reviewer:
Patch drm/i915: Move the ban period onto the context - Reviewer:
Patch drm/i915: Add ioctl to set per-context parameters - Reviewer:
Patch drm/i915: Put logical pipe_control emission into a helper. - Reviewer:
Patch drm/i915: Add WaCsStallBeforeStateCacheInvalidate:bdw, chv to logical ring - Reviewer:

This update refers to five rounds between testing updates:
- Jul 25 to Aug 08
- Aug 08 to Aug 22
- Aug 22 to Sep 09
- Sep 09 to Sep 19
- Sep 19 to Oct 03

As always I just get standalone patches or series of 2 patches that had no obvious nacks or unfinished discussion. If you thinkg your patch should be here please let me know or rebase over -nightly and resubmit that I collect later.

Thanks,
Rodrigo.

Chris Wilson (5):
drm/i915: Check the minimum pitch for the user framebuffer drm/i915: Make the physical object coherent with GTT drm/i915: Enable vblank interrupts for CRC generation drm/i915: Move the ban period onto the context drm/i915: Add ioctl to set per-context parameters

Deepak S (1):
drm/i915/chv: Use timeout mode for RC6 on chv

Rodrigo Vivi (2):
drm/i915: Put logical pipe_control emission into a helper. drm/i915: Add WaCsStallBeforeStateCacheInvalidate:bdw, chv to logical
ring

Zhipeng Gong (2):
drm/i915: Specify bsd rings through exec flag drm/i915: add I915_PARAM_HAS_BSD2 to i915_getparam

 drivers/gpu/drm/i915/i915_debugfs.c        |   7 +
 drivers/gpu/drm/i915/i915_dma.c            |   8 ++
 drivers/gpu/drm/i915/i915_drv.h            |  15 ++-
 drivers/gpu/drm/i915/i915_gem.c            | 210 ++++++++++++++++++++---------
 drivers/gpu/drm/i915/i915_gem_context.c    |  71 ++++++++++
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |  19 ++-
 drivers/gpu/drm/i915/intel_display.c       |  11 ++
 drivers/gpu/drm/i915/intel_dp.c            |   3 +
 drivers/gpu/drm/i915/intel_lrc.c           |  41 ++++--
 drivers/gpu/drm/i915/intel_pm.c            |   4 +-
 include/uapi/drm/i915_drm.h                |  22 ++-
 11 files changed, 326 insertions(+), 85 deletions(-)
Signature · 6 lines
1.9.3

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

PATCH 1/10 drm/i915: Check the minimum pitch for the user framebuffer

From: Chris Wilson <[email protected]>

Compute the smallest pitch required for a linear framebuffer and assert that the user has declared a pitch that meets that minimum requirement.

---
 drivers/gpu/drm/i915/intel_display.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/drm/i915/intel_display.c +11 -0
index 7d891e5..0b1e193 100644
@@ -12414,6 +12414,8 @@ static int intel_framebuffer_init(struct drm_device *dev,
 {
 	int aligned_height;
 	int pitch_limit;
+	int depth;
+	int bpp;
 	int ret;
 
 	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
@@ -12429,6 +12431,15 @@ static int intel_framebuffer_init(struct drm_device *dev,
 		return -EINVAL;
 	}
 
+	drm_fb_get_bpp_depth(mode_cmd->pixel_format, &bpp, &depth);
+	if (mode_cmd->pitches[0] < intel_framebuffer_pitch_for_width(mode_cmd->width,
+								     bpp)) {
+		DRM_DEBUG("pitch (%d) must be at least the linear stride (%d)\n",
+			  mode_cmd->pitches[0],
+			  intel_framebuffer_pitch_for_width(mode_cmd->width, bpp));
+		return -EINVAL;
+	}
+
 	if (INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev)) {
 		pitch_limit = 32*1024;
 	} else if (INTEL_INFO(dev)->gen >= 4) {
Signature · 6 lines
1.9.3

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

PATCH 2/10 drm/i915: Make the physical object coherent with GTT

In reply to Rodrigo Vivi

From: Chris Wilson <[email protected]>

Currently objects for which the hardware needs a contiguous physical address are allocated a shadow backing storage to satisfy the contraint. This shadow buffer is not wired into the normal obj->pages and so the physical object is incoherent with accesses via the GPU, GTT and CPU. By setting up the appropriate scatter-gather table, we can allow userspace to access the physical object via either a GTT mmaping of or by rendering into the GEM bo. However, keeping the CPU mmap of the shmemfs backing storage coherent with the contiguous shadow is not yet possible. Fortuituously, CPU mmaps of objects requiring physical addresses are not expected to be coherent anyway.

This allows the physical constraint of the GEM object to be transparent to userspace and allow it to efficiently render into or update them via the GTT and GPU.

v2: Fix leak of pci handle spotted by Ville
v3: Remove the now duplicate call to detach_phys_object during free.
v4: Wait for rendering before pwrite. As this patch makes it possible to render into the phys object, we should make it correct as well!

---
 drivers/gpu/drm/i915/i915_dma.c |   3 +
 drivers/gpu/drm/i915/i915_drv.h |   6 +-
 drivers/gpu/drm/i915/i915_gem.c | 207 +++++++++++++++++++++++++++-------------
 include/uapi/drm/i915_drm.h     |   1 +
 4 files changed, 150 insertions(+), 67 deletions(-)
drivers/gpu/drm/i915/i915_dma.c +3 -0
index 9a73533..5dc37f0 100644
@@ -1027,6 +1027,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
 	case I915_PARAM_CMD_PARSER_VERSION:
 		value = i915_cmd_parser_get_version();
 		break;
+	case I915_PARAM_HAS_COHERENT_PHYS_GTT:
+		value = 1;
+		break;
 	default:
 		DRM_DEBUG("Unknown parameter %d\n", param->param);
 		return -EINVAL;
drivers/gpu/drm/i915/i915_drv.h +3 -3
index 059330c..929d78d 100644
@@ -1890,10 +1890,10 @@ struct drm_i915_gem_object {
 	unsigned long user_pin_count;
 	struct drm_file *pin_filp;
 
-	/** for phy allocated objects */
-	struct drm_dma_handle *phys_handle;
-
 	union {
+		/** for phy allocated objects */
+		struct drm_dma_handle *phys_handle;
+
 		struct i915_gem_userptr {
 			uintptr_t ptr;
 			unsigned read_only :1;
drivers/gpu/drm/i915/i915_gem.c +143 -64

279 lines not on this page · raw message

include/uapi/drm/i915_drm.h +1 -0
index ff57f07..c6b229f 100644
@@ -340,6 +340,7 @@ typedef struct drm_i915_irq_wait {
 #define I915_PARAM_HAS_EXEC_HANDLE_LUT   26
 #define I915_PARAM_HAS_WT     	 	 27
 #define I915_PARAM_CMD_PARSER_VERSION	 28
+#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
 
 typedef struct drm_i915_getparam {
 	int param;
Signature · 6 lines
1.9.3

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

PATCH 3/10 drm/i915/chv: Use timeout mode for RC6 on chv

In reply to Rodrigo Vivi

From: Deepak S <[email protected]>

Higher RC6 residency is observed using timeout mode instead of EI mode. It's Recommended to use TO Method for RC6.

---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +2 -2
index 7a69eba..0bfcd83 100644
@@ -4348,7 +4348,7 @@ static void cherryview_enable_rps(struct drm_device *dev)
 		I915_WRITE(RING_MAX_IDLE(ring->mmio_base), 10);
 	I915_WRITE(GEN6_RC_SLEEP, 0);
 
-	I915_WRITE(GEN6_RC6_THRESHOLD, 50000); /* 50/125ms per EI */
+	I915_WRITE(GEN6_RC6_THRESHOLD, 0x557);
 
 	/* allows RC6 residency counter to work */
 	I915_WRITE(VLV_COUNTER_CONTROL,
@@ -4364,7 +4364,7 @@ static void cherryview_enable_rps(struct drm_device *dev)
 	/* 3: Enable RC6 */
 	if ((intel_enable_rc6(dev) & INTEL_RC6_ENABLE) &&
 						(pcbr >> VLV_PCBR_ADDR_SHIFT))
-		rc6_mode = GEN6_RC_CTL_EI_MODE(1);
+		rc6_mode = GEN7_RC_CTL_TO_MODE;
 
 	I915_WRITE(GEN6_RC_CONTROL, rc6_mode);
 
Signature · 6 lines
1.9.3

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

Re: [PATCH 03/10] drm/i915/chv: Use timeout mode for RC6 on chv

Quoted 5 lines · Rodrigo Vivi

From: Deepak S <[email protected]>

Higher RC6 residency is observed using timeout mode instead of EI mode. It's Recommended to use TO Method for RC6.

[TOR:] My comments on the previous version of this patch are at
http://lists.freedesktop.org/archives/intel-gfx/2014-August/050203.html

Based on the understanding this patch will provide benefit on some pre-production CHV steppings and no benefit on the production CHV steppings, this patch should not be merged.

Quoted 35 lines
---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +2 -2
index 7a69eba..0bfcd83 100644
@@ -4348,7 +4348,7 @@ static void cherryview_enable_rps(struct drm_device *dev)
 		I915_WRITE(RING_MAX_IDLE(ring->mmio_base), 10);
 	I915_WRITE(GEN6_RC_SLEEP, 0);
 
-	I915_WRITE(GEN6_RC6_THRESHOLD, 50000); /* 50/125ms per EI */
+	I915_WRITE(GEN6_RC6_THRESHOLD, 0x557);
 
 	/* allows RC6 residency counter to work */
 	I915_WRITE(VLV_COUNTER_CONTROL,
@@ -4364,7 +4364,7 @@ static void cherryview_enable_rps(struct drm_device *dev)
 	/* 3: Enable RC6 */
 	if ((intel_enable_rc6(dev) & INTEL_RC6_ENABLE) &&
 						(pcbr >> VLV_PCBR_ADDR_SHIFT))
-		rc6_mode = GEN6_RC_CTL_EI_MODE(1);
+		rc6_mode = GEN7_RC_CTL_TO_MODE;
 
 	I915_WRITE(GEN6_RC_CONTROL, rc6_mode);
 
Signature · 6 lines
1.9.3

_______________________________________________
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/10 drm/i915: Specify bsd rings through exec flag

In reply to Rodrigo Vivi

From: Zhipeng Gong <[email protected]>

On Broadwell GT3 we have 2 Video Command Streamers (VCS), but userspace has no control when using VCS1 or VCS2. This patch introduces a mechanism to avoid the default ping-pong mode and use one specific ring through execution flag.

v2: fix whitespace (Rodrigo)

---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 19 +++++++++++++++++--
 drivers/gpu/drm/i915/intel_dp.c            |  3 +++
 include/uapi/drm/i915_drm.h                |  8 +++++++-
 3 files changed, 27 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_gem_execbuffer.c +17 -2
index 1a0611b..859e917 100644
@@ -1276,8 +1276,23 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 	else if ((args->flags & I915_EXEC_RING_MASK) == I915_EXEC_BSD) {
 		if (HAS_BSD2(dev)) {
 			int ring_id;
-			ring_id = gen8_dispatch_bsd_ring(dev, file);
-			ring = &dev_priv->ring[ring_id];
+
+			switch (args->flags & I915_EXEC_BSD_MASK) {
+			case I915_EXEC_BSD_DEFAULT:
+				ring_id = gen8_dispatch_bsd_ring(dev, file);
+				ring = &dev_priv->ring[ring_id];
+				break;
+			case I915_EXEC_BSD_RING1:
+				ring = &dev_priv->ring[VCS];
+				break;
+			case I915_EXEC_BSD_RING2:
+				ring = &dev_priv->ring[VCS2];
+				break;
+			default:
+				DRM_DEBUG("execbuf with unknown bsd ring: %d\n",
+					  (int)(args->flags & I915_EXEC_BSD_MASK));
+				return -EINVAL;
+			}
 		} else
 			ring = &dev_priv->ring[VCS];
 	} else
drivers/gpu/drm/i915/intel_dp.c +3 -0
index 4455009..76ca5c0 100644
@@ -4635,6 +4635,9 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
 		if (HAS_PCH_SPLIT(dev)) {
 			if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
 				goto mst_fail;
+		if (!intel_dp->output_reg)
+			goto mst_fail;
+
 		} else {
 			if (g4x_digital_port_connected(dev, intel_dig_port) != 1)
 				goto mst_fail;
include/uapi/drm/i915_drm.h +7 -1
index c6b229f..b8ed3c1 100644
@@ -737,7 +737,13 @@ struct drm_i915_gem_execbuffer2 {
  */
 #define I915_EXEC_HANDLE_LUT		(1<<12)
 
-#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_HANDLE_LUT<<1)
+/** Used for switching BSD rings on the platforms with two BSD rings */
+#define I915_EXEC_BSD_MASK		(3<<13)
+#define I915_EXEC_BSD_DEFAULT		(0<<13) /* default ping-pong mode */
+#define I915_EXEC_BSD_RING1		(1<<13)
+#define I915_EXEC_BSD_RING2		(2<<13)
+
+#define __I915_EXEC_UNKNOWN_FLAGS -(1<<15)
 
 #define I915_EXEC_CONTEXT_ID_MASK	(0xffffffff)
 #define i915_execbuffer2_set_context_id(eb2, context) \
Signature · 6 lines
1.9.3

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

PATCH 5/10 drm/i915: add I915_PARAM_HAS_BSD2 to i915_getparam

In reply to Rodrigo Vivi

From: Zhipeng Gong <[email protected]>

This will let userland only try to use the new ring when the appropriate kernel is present

---
 drivers/gpu/drm/i915/i915_dma.c | 3 +++
 include/uapi/drm/i915_drm.h     | 1 +
 2 files changed, 4 insertions(+)
drivers/gpu/drm/i915/i915_dma.c +3 -0
index 5dc37f0..1c145ed 100644
@@ -979,6 +979,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
 	case I915_PARAM_HAS_VEBOX:
 		value = intel_ring_initialized(&dev_priv->ring[VECS]);
 		break;
+	case I915_PARAM_HAS_BSD2:
+		value = intel_ring_initialized(&dev_priv->ring[VCS2]);
+		break;
 	case I915_PARAM_HAS_RELAXED_FENCING:
 		value = 1;
 		break;
include/uapi/drm/i915_drm.h +1 -0
index b8ed3c1..56007dc 100644
@@ -341,6 +341,7 @@ typedef struct drm_i915_irq_wait {
 #define I915_PARAM_HAS_WT     	 	 27
 #define I915_PARAM_CMD_PARSER_VERSION	 28
 #define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
+#define I915_PARAM_HAS_BSD2		 30
 
 typedef struct drm_i915_getparam {
 	int param;
Signature · 6 lines
1.9.3

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

PATCH 6/10 drm/i915: Enable vblank interrupts for CRC generation

In reply to Rodrigo Vivi

From: Chris Wilson <[email protected]>

Pineview requires this. But this changes the debug API...

References: https://bugs.freedesktop.org/show_bug.cgi?id=82280

---
 drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +7 -0
index e60d5c2..465a17b 100644
@@ -2711,10 +2711,15 @@ static int i915_pipe_crc_open(struct inode *inode, struct file *filep)
 	struct pipe_crc_info *info = inode->i_private;
 	struct drm_i915_private *dev_priv = info->dev->dev_private;
 	struct intel_pipe_crc *pipe_crc = &dev_priv->pipe_crc[info->pipe];
+	int ret;
 
 	if (info->pipe >= INTEL_INFO(info->dev)->num_pipes)
 		return -ENODEV;
 
+	ret = drm_vblank_get(dev_priv->dev, info->pipe);
+	if (ret)
+		return ret;
+
 	spin_lock_irq(&pipe_crc->lock);
 
 	if (pipe_crc->opened) {
@@ -2740,6 +2745,8 @@ static int i915_pipe_crc_release(struct inode *inode, struct file *filep)
 	pipe_crc->opened = false;
 	spin_unlock_irq(&pipe_crc->lock);
 
+	drm_vblank_put(dev_priv->dev, info->pipe);
+
 	return 0;
 }
 
Signature · 6 lines
1.9.3

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

Re: [PATCH 06/10] drm/i915: Enable vblank interrupts for CRC generation

Quoted 7 lines · Rodrigo Vivi

From: Chris Wilson <[email protected]>

Pineview requires this. But this changes the debug API...

References: https://bugs.freedesktop.org/show_bug.cgi?id=82280

Chris already retracted this patch.

Signature · 5 lines
Damien
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author maintainer
#9 lore raw

PATCH 7/10 drm/i915: Move the ban period onto the context

In reply to Rodrigo Vivi

From: Chris Wilson <[email protected]>

This will allow us to set per-file, or even per-context, periods in the future.

---
 drivers/gpu/drm/i915/i915_drv.h         | 5 +++++
 drivers/gpu/drm/i915/i915_gem.c         | 3 ++-
 drivers/gpu/drm/i915/i915_gem_context.c | 2 ++
 3 files changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +5 -0
index 929d78d..a76869c 100644
@@ -613,6 +613,11 @@ struct i915_ctx_hang_stats {
 	/* Time when this context was last blamed for a GPU reset */
 	unsigned long guilty_ts;
 
+	/* If the contexts causes a second GPU hang within this time,
+	 * it is permanently banned from submitting any more work.
+	 */
+	unsigned long ban_period_seconds;
+
 	/* This context is banned to submit more work */
 	bool banned;
 };
drivers/gpu/drm/i915/i915_gem.c +2 -1
index 5223e98..1da4a79 100644
@@ -2539,7 +2539,8 @@ static bool i915_context_is_banned(struct drm_i915_private *dev_priv,
 	if (ctx->hang_stats.banned)
 		return true;
 
-	if (elapsed <= DRM_I915_CTX_BAN_PERIOD) {
+	if (ctx->hang_stats.ban_period_seconds &&
+	    elapsed <= ctx->hang_stats.ban_period_seconds) {
 		if (!i915_gem_context_is_default(ctx)) {
 			DRM_DEBUG("context hanging too fast, banning!\n");
 			return true;
drivers/gpu/drm/i915/i915_gem_context.c +2 -0
index a5221d8..9da78d5 100644
@@ -219,6 +219,8 @@ __create_hw_context(struct drm_device *dev,
 	 * is no remap info, it will be a NOP. */
 	ctx->remap_slice = (1 << NUM_L3_SLICES(dev)) - 1;
 
+	ctx->hang_stats.ban_period_seconds = DRM_I915_CTX_BAN_PERIOD;
+
 	return ctx;
 
 err_out:
Signature · 6 lines
1.9.3

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

PATCH 8/10 drm/i915: Add ioctl to set per-context parameters

In reply to Rodrigo Vivi

From: Chris Wilson <[email protected]>

Sometimes we wish to tweak how an individual context behaves. Since we always create a context for every filp, this means that individual processes can fine tune their behaviour even if they do not explicitly create a context.

The first example parameter here is to enable multi-process GPU testing, but the interface should be able to cope with passing arbitrarily complex parameters.

---
 drivers/gpu/drm/i915/i915_dma.c         |  2 +
 drivers/gpu/drm/i915/i915_drv.h         |  4 ++
 drivers/gpu/drm/i915/i915_gem_context.c | 69 +++++++++++++++++++++++++++++++++
 include/uapi/drm/i915_drm.h             | 12 ++++++
 4 files changed, 87 insertions(+)
drivers/gpu/drm/i915/i915_dma.c +2 -0
index 1c145ed..04a6f77 100644
@@ -2042,6 +2042,8 @@ const struct drm_ioctl_desc i915_ioctls[] = {
 	DRM_IOCTL_DEF_DRV(I915_REG_READ, i915_reg_read_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
 	DRM_IOCTL_DEF_DRV(I915_GET_RESET_STATS, i915_get_reset_stats_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
 	DRM_IOCTL_DEF_DRV(I915_GEM_USERPTR, i915_gem_userptr_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
+	DRM_IOCTL_DEF_DRV(I915_GEM_CONTEXT_GETPARAM, i915_gem_context_getparam_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
+	DRM_IOCTL_DEF_DRV(I915_GEM_CONTEXT_SETPARAM, i915_gem_context_setparam_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
 };
 
 int i915_max_ioctl = ARRAY_SIZE(i915_ioctls);
drivers/gpu/drm/i915/i915_drv.h +4 -0
index a76869c..82af38e 100644
@@ -2679,6 +2679,10 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
 				  struct drm_file *file);
 int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
 				   struct drm_file *file);
+int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,
+				    struct drm_file *file_priv);
+int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data,
+				    struct drm_file *file_priv);
 
 /* i915_gem_evict.c */
 int __must_check i915_gem_evict_something(struct drm_device *dev,
drivers/gpu/drm/i915/i915_gem_context.c +69 -0

72 lines not on this page · raw message

include/uapi/drm/i915_drm.h +12 -0
index 56007dc..2403894 100644
@@ -224,6 +224,8 @@ typedef struct _drm_i915_sarea {
 #define DRM_I915_REG_READ		0x31
 #define DRM_I915_GET_RESET_STATS	0x32
 #define DRM_I915_GEM_USERPTR		0x33
+#define DRM_I915_GEM_CONTEXT_GETPARAM	0x34
+#define DRM_I915_GEM_CONTEXT_SETPARAM	0x35
 
 #define DRM_IOCTL_I915_INIT		DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
 #define DRM_IOCTL_I915_FLUSH		DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
@@ -275,6 +277,8 @@ typedef struct _drm_i915_sarea {
 #define DRM_IOCTL_I915_REG_READ			DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
 #define DRM_IOCTL_I915_GET_RESET_STATS		DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats)
 #define DRM_IOCTL_I915_GEM_USERPTR			DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr)
+#define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM	DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param)
+#define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM	DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param)
 
 /* Allow drivers to submit batchbuffers directly to hardware, relying
  * on the security mechanisms provided by hardware.
@@ -1074,4 +1078,12 @@ struct drm_i915_gem_userptr {
 	__u32 handle;
 };
 
+struct drm_i915_gem_context_param {
+	__u32 ctx_id;
+	__u32 size;
+	__u64 param;
+#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
+	__u64 value;
+};
+
 #endif /* _UAPI_I915_DRM_H_ */
Signature · 6 lines
1.9.3

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

PATCH 9/10 drm/i915: Put logical pipe_control emission into a helper.

In reply to Rodrigo Vivi

To be used for a Workaroud. Similar to:

commit 884ceacee308f0e4616d0c933518af2639f7b1d8

Author: Kenneth Graunke <[email protected]>
Date:   Sat Jun 28 02:04:20 2014 +0300

drm/i915: Refactor Broadwell PIPE_CONTROL emission into a helper.

---
 drivers/gpu/drm/i915/intel_lrc.c | 35 +++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/intel_lrc.c +21 -14
index cd74e5c..578a181 100644
@@ -1128,6 +1128,26 @@ static int gen8_emit_flush(struct intel_ringbuffer *ringbuf,
 	return 0;
 }
 
+static int gen8_emit_pipe_control(struct intel_ringbuffer *ringbuf,
+				  u32 flags, u32 scratch_addr)
+{
+	int ret;
+
+	ret = intel_logical_ring_begin(ringbuf, 6);
+	if (ret)
+		return ret;
+
+	intel_logical_ring_emit(ringbuf, GFX_OP_PIPE_CONTROL(6));
+	intel_logical_ring_emit(ringbuf, flags);
+	intel_logical_ring_emit(ringbuf, scratch_addr);
+	intel_logical_ring_emit(ringbuf, 0);
+	intel_logical_ring_emit(ringbuf, 0);
+	intel_logical_ring_emit(ringbuf, 0);
+	intel_logical_ring_advance(ringbuf);
+
+	return 0;
+}
+
 static int gen8_emit_flush_render(struct intel_ringbuffer *ringbuf,
 				  u32 invalidate_domains,
 				  u32 flush_domains)
@@ -1135,7 +1155,6 @@ static int gen8_emit_flush_render(struct intel_ringbuffer *ringbuf,
 	struct intel_engine_cs *ring = ringbuf->ring;
 	u32 scratch_addr = ring->scratch.gtt_offset + 2 * CACHELINE_BYTES;
 	u32 flags = 0;
-	int ret;
 
 	flags |= PIPE_CONTROL_CS_STALL;
 
@@ -1155,19 +1174,7 @@ static int gen8_emit_flush_render(struct intel_ringbuffer *ringbuf,
 		flags |= PIPE_CONTROL_GLOBAL_GTT_IVB;
 	}
 
-	ret = intel_logical_ring_begin(ringbuf, 6);
-	if (ret)
-		return ret;
-
-	intel_logical_ring_emit(ringbuf, GFX_OP_PIPE_CONTROL(6));
-	intel_logical_ring_emit(ringbuf, flags);
-	intel_logical_ring_emit(ringbuf, scratch_addr);
-	intel_logical_ring_emit(ringbuf, 0);
-	intel_logical_ring_emit(ringbuf, 0);
-	intel_logical_ring_emit(ringbuf, 0);
-	intel_logical_ring_advance(ringbuf);
-
-	return 0;
+	return gen8_emit_pipe_control(ringbuf, flags, scratch_addr);
 }
 
 static u32 gen8_get_seqno(struct intel_engine_cs *ring, bool lazy_coherency)
Signature · 6 lines
1.9.3

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

PATCH 10/10 drm/i915: Add WaCsStallBeforeStateCacheInvalidate:bdw, chv to logical ring

In reply to Rodrigo Vivi

Similar to:

commit 02c9f7e3cfe76a7f54ef03438c36aade86cc1c8b

Author: Kenneth Graunke <[email protected]>
Date:   Mon Jan 27 14:20:16 2014 -0800

drm/i915: Add the WaCsStallBeforeStateCacheInvalidate:bdw workaround.

On Broadwell, any PIPE_CONTROL with the "State Cache Invalidate" bit set must be preceded by a PIPE_CONTROL with the "CS Stall" bit set.

Documented on the BSpec 3D workarounds page.

---
 drivers/gpu/drm/i915/intel_lrc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/i915/intel_lrc.c +10 -0
index 578a181..485a5ee 100644
@@ -1155,6 +1155,7 @@ static int gen8_emit_flush_render(struct intel_ringbuffer *ringbuf,
 	struct intel_engine_cs *ring = ringbuf->ring;
 	u32 scratch_addr = ring->scratch.gtt_offset + 2 * CACHELINE_BYTES;
 	u32 flags = 0;
+	int ret;
 
 	flags |= PIPE_CONTROL_CS_STALL;
 
@@ -1172,6 +1173,15 @@ static int gen8_emit_flush_render(struct intel_ringbuffer *ringbuf,
 		flags |= PIPE_CONTROL_STATE_CACHE_INVALIDATE;
 		flags |= PIPE_CONTROL_QW_WRITE;
 		flags |= PIPE_CONTROL_GLOBAL_GTT_IVB;
+
+
+		/* WaCsStallBeforeStateCacheInvalidate:bdw,chv */
+		ret = gen8_emit_pipe_control(ring,
+					     PIPE_CONTROL_CS_STALL |
+					     PIPE_CONTROL_STALL_AT_SCOREBOARD,
+					     0);
+		if (ret)
+			return ret;
 	}
 
 	return gen8_emit_pipe_control(ringbuf, flags, scratch_addr);
Signature · 6 lines
1.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#13 lore raw
In reply to Rodrigo Vivi

Just a warning that this round collector had many differences on PRTS:

HSw:
Testing: http://tinderbox.sh.intel.com/PRTS_UI/prtsresult.php?task_id=3869
Collector: http://tinderbox.sh.intel.com/PRTS_UI/prtsresult.php?task_id=3874
Comparison: http://tinderbox.sh.intel.com/PRTS_UI/prtscompareresult.php?sub_task_id1=15868&sub_task_id2=15873

ILK:
Testing: http://tinderbox.sh.intel.com/PRTS_UI/prtsresult.php?task_id=3872
Collector: http://tinderbox.sh.intel.com/PRTS_UI/prtsresult.php?task_id=3870
Comparison: http://tinderbox.sh.intel.com/PRTS_UI/prtscompareresult.php?sub_task_id1=15871&sub_task_id2=15869

IVB:
Testing: http://tinderbox.sh.intel.com/PRTS_UI/prtsresult.php?task_id=3871
Collector: http://tinderbox.sh.intel.com/PRTS_UI/prtsresult.php?task_id=3873
Comparison: http://tinderbox.sh.intel.com/PRTS_UI/prtscompareresult.php?sub_task_id1=15870&sub_task_id2=15872

Most of differences related to kms_flip and kms_plane, gem_evic and gem_concurrent. And most breaking more stuff than fixing them.

Quoted 72 lines · Rodrigo Vivi

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: Check the minimum pitch for the user framebuffer - Reviewer:
Patch drm/i915: Make the physical object coherent with GTT - Reviewer:
Patch drm/i915/chv: Use timeout mode for RC6 on chv - Reviewer:
Patch drm/i915: Specify bsd rings through exec flag - Reviewer:
Patch drm/i915: add I915_PARAM_HAS_BSD2 to i915_getparam - Reviewer:
Patch drm/i915: Enable vblank interrupts for CRC generation - Reviewer:
Patch drm/i915: Move the ban period onto the context - Reviewer:
Patch drm/i915: Add ioctl to set per-context parameters - Reviewer:
Patch drm/i915: Put logical pipe_control emission into a helper. - Reviewer:
Patch drm/i915: Add WaCsStallBeforeStateCacheInvalidate:bdw, chv to logical ring - Reviewer:

This update refers to five rounds between testing updates:
- Jul 25 to Aug 08
- Aug 08 to Aug 22
- Aug 22 to Sep 09
- Sep 09 to Sep 19
- Sep 19 to Oct 03

As always I just get standalone patches or series of 2 patches that had no obvious nacks or unfinished discussion. If you thinkg your patch should be here please let me know or rebase over -nightly and resubmit that I collect later.

Thanks,
Rodrigo.

Chris Wilson (5):
drm/i915: Check the minimum pitch for the user framebuffer drm/i915: Make the physical object coherent with GTT drm/i915: Enable vblank interrupts for CRC generation drm/i915: Move the ban period onto the context drm/i915: Add ioctl to set per-context parameters

Deepak S (1):
drm/i915/chv: Use timeout mode for RC6 on chv

Rodrigo Vivi (2):
drm/i915: Put logical pipe_control emission into a helper. drm/i915: Add WaCsStallBeforeStateCacheInvalidate:bdw, chv to logical
ring

Zhipeng Gong (2):
drm/i915: Specify bsd rings through exec flag drm/i915: add I915_PARAM_HAS_BSD2 to i915_getparam

 drivers/gpu/drm/i915/i915_debugfs.c        |   7 +
 drivers/gpu/drm/i915/i915_dma.c            |   8 ++
 drivers/gpu/drm/i915/i915_drv.h            |  15 ++-
 drivers/gpu/drm/i915/i915_gem.c            | 210 ++++++++++++++++++++---------
 drivers/gpu/drm/i915/i915_gem_context.c    |  71 ++++++++++
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |  19 ++-
 drivers/gpu/drm/i915/intel_display.c       |  11 ++
 drivers/gpu/drm/i915/intel_dp.c            |   3 +
 drivers/gpu/drm/i915/intel_lrc.c           |  41 ++++--
 drivers/gpu/drm/i915/intel_pm.c            |   4 +-
 include/uapi/drm/i915_drm.h                |  22 ++-
 11 files changed, 326 insertions(+), 85 deletions(-)

--
1.9.3

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

Signature · 6 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#14 lore raw
In reply to Rodrigo Vivi
Quoted 7 lines · Rodrigo Vivi

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: Check the minimum pitch for the user framebuffer - Reviewer:

My comment still stands that the core checks should have caught this. Actually now I think about it, addfb didn't call framebuffer_check() until very recently, which could explain this. So the problem might be fixed by

commit 228f2cb32f0dbeef0b88dc97ea66a3c31b03de99

Author: Chuck Ebbert <[email protected]>
Date:   Wed Oct 8 11:40:34 2014 -0500

drm/crtc: Remove duplicated ioctl code

Quoted 1 line

Patch drm/i915: Make the physical object coherent with GTT - Reviewer:

Already has my r-b.

Quoted 1 line

Patch drm/i915: Enable vblank interrupts for CRC generation - Reviewer:

IIRC everyone agreed that this isn't needed.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#15 lore raw
Quoted 4 lines · Ville Syrjälä
Quoted 1 line · Rodrigo Vivi

Patch drm/i915: Make the physical object coherent with GTT - Reviewer:

Already has my r-b.

I still would like to see a little testcase here, e.g. a new mode to kms_cursor_crc which uses gtt mmap uploads instead of pwrite. -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
#16 lore raw
Quoted 8 lines · Daniel Vetter
Quoted 4 lines · Ville Syrjälä
Quoted 1 line · Rodrigo Vivi

Patch drm/i915: Make the physical object coherent with GTT - Reviewer:

Already has my r-b.

I still would like to see a little testcase here, e.g. a new mode to kms_cursor_crc which uses gtt mmap uploads instead of pwrite.

But that doesn't block this patch, as the kernel already exposes and userspace already uses gtt mmap updates to the cursor. The patch just removes the barrier to do so using early chipsets as well. -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#17 lore raw
Quoted 5 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter
Quoted 3 lines · Ville Syrjälä
Quoted 1 line · Rodrigo Vivi

Patch drm/i915: Make the physical object coherent with GTT - Reviewer:

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Already has my r-b.

I still would like to see a little testcase here, e.g. a new mode to kms_cursor_crc which uses gtt mmap uploads instead of pwrite.

But that doesn't block this patch, as the kernel already exposes and userspace already uses gtt mmap updates to the cursor. The patch just removes the barrier to do so using early chipsets as well.

Well yeah, but that existing code has piles of tests already to make sure that gtt writes are somewhat coherent with pwrite, and another test that pwrite is coherent with the actual cursor scanned out by hw.

This otoh adds new code, without igt test coverage. So there is a new test coverage gap.

Anyway I've decided that the cleanup is worth it on its own and the platform this applies to are too old to really care, so merged the patch without tests.
-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
#18 lore raw
Quoted 11 lines · Daniel Vetter
Quoted 10 lines · Chris Wilson
Quoted 8 lines · Daniel Vetter
Quoted 4 lines · Ville Syrjälä
Quoted 1 line · Rodrigo Vivi

Patch drm/i915: Make the physical object coherent with GTT - Reviewer:

Already has my r-b.

I still would like to see a little testcase here, e.g. a new mode to kms_cursor_crc which uses gtt mmap uploads instead of pwrite.

Quoted 7 lines
Quoted 3 lines

But that doesn't block this patch, as the kernel already exposes and userspace already uses gtt mmap updates to the cursor. The patch just removes the barrier to do so using early chipsets as well.

Well yeah, but that existing code has piles of tests already to make sure that gtt writes are somewhat coherent with pwrite, and another test that pwrite is coherent with the actual cursor scanned out by hw.

Really? I doubt the current coverage since I keep seeing cursor bugs... -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#19 lore raw
Quoted 16 lines · Chris Wilson
Quoted 15 lines · Daniel Vetter
Quoted 13 lines · Chris Wilson
Quoted 8 lines · Daniel Vetter
Quoted 4 lines · Ville Syrjälä
Quoted 1 line · Rodrigo Vivi

Patch drm/i915: Make the physical object coherent with GTT - Reviewer:

Already has my r-b.

I still would like to see a little testcase here, e.g. a new mode to kms_cursor_crc which uses gtt mmap uploads instead of pwrite.

But that doesn't block this patch, as the kernel already exposes and userspace already uses gtt mmap updates to the cursor. The patch just removes the barrier to do so using early chipsets as well.

Quoted 5 lines
Quoted 3 lines

Well yeah, but that existing code has piles of tests already to make sure that gtt writes are somewhat coherent with pwrite, and another test that pwrite is coherent with the actual cursor scanned out by hw.

Really? I doubt the current coverage since I keep seeing cursor bugs...

Well they do tend to randomly fail here. Not sure whether that's the same bug or a different one ... Ofc tests without people looking aren't too useful, but we have to start somewhere.
-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
#20 lore raw
In reply to Daniel Vetter
Quoted 11 lines · Daniel Vetter
Quoted 10 lines · Chris Wilson
Quoted 8 lines · Daniel Vetter
Quoted 4 lines · Ville Syrjälä
Quoted 1 line · Rodrigo Vivi

Patch drm/i915: Make the physical object coherent with GTT - Reviewer:

Already has my r-b.

I still would like to see a little testcase here, e.g. a new mode to kms_cursor_crc which uses gtt mmap uploads instead of pwrite.

Quoted 7 lines
Quoted 3 lines

But that doesn't block this patch, as the kernel already exposes and userspace already uses gtt mmap updates to the cursor. The patch just removes the barrier to do so using early chipsets as well.

Well yeah, but that existing code has piles of tests already to make sure that gtt writes are somewhat coherent with pwrite, and another test that pwrite is coherent with the actual cursor scanned out by hw.

Actually pwrite isn't coherent with scanout currently on LLC platforms if you do the pwrite when the bo already has cache_level==NONE but it's not yet pinned to the display. So seems our pwrite tests aren't entirely comprehensive currently if they don't hit this. I still haven't seen the fabled patch from Chris that would fix this.

Quoted 12 lines

This otoh adds new code, without igt test coverage. So there is a new test coverage gap.

Anyway I've decided that the cleanup is worth it on its own and the platform this applies to are too old to really care, so merged the patch without tests.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#21 lore raw
Quoted 20 lines · Ville Syrjälä
Quoted 11 lines · Daniel Vetter
Quoted 10 lines · Chris Wilson
Quoted 8 lines · Daniel Vetter
Quoted 4 lines · Ville Syrjälä
Quoted 1 line · Rodrigo Vivi

Patch drm/i915: Make the physical object coherent with GTT - Reviewer:

Already has my r-b.

I still would like to see a little testcase here, e.g. a new mode to kms_cursor_crc which uses gtt mmap uploads instead of pwrite.

Quoted 7 lines
Quoted 3 lines

But that doesn't block this patch, as the kernel already exposes and userspace already uses gtt mmap updates to the cursor. The patch just removes the barrier to do so using early chipsets as well.

Well yeah, but that existing code has piles of tests already to make sure that gtt writes are somewhat coherent with pwrite, and another test that pwrite is coherent with the actual cursor scanned out by hw.

Quoted 5 lines

Actually pwrite isn't coherent with scanout currently on LLC platforms if you do the pwrite when the bo already has cache_level==NONE but it's not yet pinned to the display. So seems our pwrite tests aren't entirely comprehensive currently if they don't hit this. I still haven't seen the fabled patch from Chris that would fix this.

This patch includes an unconditional clflush for phys writes (or at least this patch should be that patch) which is what I thought we were arguing about at the time.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#22 lore raw
Quoted 27 lines · Chris Wilson
Quoted 20 lines · Ville Syrjälä
Quoted 11 lines · Daniel Vetter
Quoted 10 lines · Chris Wilson
Quoted 8 lines · Daniel Vetter
Quoted 4 lines · Ville Syrjälä
Quoted 1 line · Rodrigo Vivi

Patch drm/i915: Make the physical object coherent with GTT - Reviewer:

Already has my r-b.

I still would like to see a little testcase here, e.g. a new mode to kms_cursor_crc which uses gtt mmap uploads instead of pwrite.

Quoted 7 lines
Quoted 3 lines

But that doesn't block this patch, as the kernel already exposes and userspace already uses gtt mmap updates to the cursor. The patch just removes the barrier to do so using early chipsets as well.

Well yeah, but that existing code has piles of tests already to make sure that gtt writes are somewhat coherent with pwrite, and another test that pwrite is coherent with the actual cursor scanned out by hw.

Quoted 5 lines

Actually pwrite isn't coherent with scanout currently on LLC platforms if you do the pwrite when the bo already has cache_level==NONE but it's not yet pinned to the display. So seems our pwrite tests aren't entirely comprehensive currently if they don't hit this. I still haven't seen the fabled patch from Chris that would fix this.

Quoted 3 lines

This patch includes an unconditional clflush for phys writes (or at least this patch should be that patch) which is what I thought we were arguing about at the time.

Ah, so there's no patch then? I must have misundestood. I do remember you had a quick hack to always flush in set_cache_level(), but I guess it never went beyond that.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#23 lore raw
Quoted 8 lines · Ville Syrjälä
Quoted 3 lines · Chris Wilson

This patch includes an unconditional clflush for phys writes (or at least this patch should be that patch) which is what I thought we were arguing about at the time.

Ah, so there's no patch then? I must have misundestood. I do remember you had a quick hack to always flush in set_cache_level(), but I guess it never went beyond that.

I have nothing in my tree. The last I remember on that subject was the obj->pin_display forcing the clflush.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#24 lore raw
In reply to Ville Syrjälä
Quoted 20 lines · Ville Syrjälä
Quoted 11 lines · Daniel Vetter
Quoted 10 lines · Chris Wilson
Quoted 8 lines · Daniel Vetter
Quoted 4 lines · Ville Syrjälä
Quoted 1 line · Rodrigo Vivi

Patch drm/i915: Make the physical object coherent with GTT - Reviewer:

Already has my r-b.

I still would like to see a little testcase here, e.g. a new mode to kms_cursor_crc which uses gtt mmap uploads instead of pwrite.

Quoted 7 lines
Quoted 3 lines

But that doesn't block this patch, as the kernel already exposes and userspace already uses gtt mmap updates to the cursor. The patch just removes the barrier to do so using early chipsets as well.

Well yeah, but that existing code has piles of tests already to make sure that gtt writes are somewhat coherent with pwrite, and another test that pwrite is coherent with the actual cursor scanned out by hw.

Quoted 5 lines

Actually pwrite isn't coherent with scanout currently on LLC platforms if you do the pwrite when the bo already has cache_level==NONE but it's not yet pinned to the display. So seems our pwrite tests aren't entirely comprehensive currently if they don't hit this. I still haven't seen the fabled patch from Chris that would fix this.

Yeah they don't check the display using CRCs for all corner cases, that seems to indeed be missing. But should be fairly simple to add a new subtest to kms_cursor_crc to rotate the color quadrants a bit with pwrite for each frame.
-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