Re: [Intel-gfx] [PATCH v4 6/9] drm/i915: Make use of indexed write GMBUS feature

2017-12-07 Thread Daniel Vetter
On Wed, Dec 06, 2017 at 07:00:09PM -0500, Sean Paul wrote:
> This patch enables the indexed write feature of the GMBUS to concatenate
> 2 consecutive messages into one. The criteria for an indexed write is
> that both messages are writes, the first is length == 1, and the second
> is length > 0. The first message is sent out by the GMBUS as the slave
> command, and the second one is sent via the GMBUS FIFO as usual.
> 
> Changes in v3:
> - Added to series
> Changes in v4:
> - Combine indexed reads and writes (Ville)
> 
> Cc: Daniel Vetter 
> Suggested-by: Ville Syrjälä 
> Signed-off-by: Sean Paul 

Even prettier!

Reviewed-by: Daniel Vetter 

> ---
>  drivers/gpu/drm/i915/intel_i2c.c | 34 --
>  1 file changed, 20 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_i2c.c 
> b/drivers/gpu/drm/i915/intel_i2c.c
> index 49fdf09f9919..d78ce758fbfa 100644
> --- a/drivers/gpu/drm/i915/intel_i2c.c
> +++ b/drivers/gpu/drm/i915/intel_i2c.c
> @@ -373,7 +373,8 @@ gmbus_xfer_read(struct drm_i915_private *dev_priv, struct 
> i2c_msg *msg,
>  
>  static int
>  gmbus_xfer_write_chunk(struct drm_i915_private *dev_priv,
> -unsigned short addr, u8 *buf, unsigned int len)
> +unsigned short addr, u8 *buf, unsigned int len,
> +u32 gmbus1_index)
>  {
>   unsigned int chunk_size = len;
>   u32 val, loop;
> @@ -386,7 +387,7 @@ gmbus_xfer_write_chunk(struct drm_i915_private *dev_priv,
>  
>   I915_WRITE_FW(GMBUS3, val);
>   I915_WRITE_FW(GMBUS1,
> -   GMBUS_CYCLE_WAIT |
> +   gmbus1_index | GMBUS_CYCLE_WAIT |
> (chunk_size << GMBUS_BYTE_COUNT_SHIFT) |
> (addr << GMBUS_SLAVE_ADDR_SHIFT) |
> GMBUS_SLAVE_WRITE | GMBUS_SW_RDY);
> @@ -409,7 +410,8 @@ gmbus_xfer_write_chunk(struct drm_i915_private *dev_priv,
>  }
>  
>  static int
> -gmbus_xfer_write(struct drm_i915_private *dev_priv, struct i2c_msg *msg)
> +gmbus_xfer_write(struct drm_i915_private *dev_priv, struct i2c_msg *msg,
> +  u32 gmbus1_index)
>  {
>   u8 *buf = msg->buf;
>   unsigned int tx_size = msg->len;
> @@ -419,7 +421,8 @@ gmbus_xfer_write(struct drm_i915_private *dev_priv, 
> struct i2c_msg *msg)
>   do {
>   len = min(tx_size, GMBUS_BYTE_COUNT_MAX);
>  
> - ret = gmbus_xfer_write_chunk(dev_priv, msg->addr, buf, len);
> + ret = gmbus_xfer_write_chunk(dev_priv, msg->addr, buf, len,
> +  gmbus1_index);
>   if (ret)
>   return ret;
>  
> @@ -431,21 +434,21 @@ gmbus_xfer_write(struct drm_i915_private *dev_priv, 
> struct i2c_msg *msg)
>  }
>  
>  /*
> - * The gmbus controller can combine a 1 or 2 byte write with a read that
> - * immediately follows it by using an "INDEX" cycle.
> + * The gmbus controller can combine a 1 or 2 byte write with another 
> read/write
> + * that immediately follows it by using an "INDEX" cycle.
>   */
>  static bool
> -gmbus_is_index_read(struct i2c_msg *msgs, int i, int num)
> +gmbus_is_index_xfer(struct i2c_msg *msgs, int i, int num)
>  {
>   return (i + 1 < num &&
>   msgs[i].addr == msgs[i + 1].addr &&
>   !(msgs[i].flags & I2C_M_RD) &&
>   (msgs[i].len == 1 || msgs[i].len == 2) &&
> - (msgs[i + 1].flags & I2C_M_RD));
> + msgs[i + 1].len > 0);
>  }
>  
>  static int
> -gmbus_xfer_index_read(struct drm_i915_private *dev_priv, struct i2c_msg 
> *msgs)
> +gmbus_index_xfer(struct drm_i915_private *dev_priv, struct i2c_msg *msgs)
>  {
>   u32 gmbus1_index = 0;
>   u32 gmbus5 = 0;
> @@ -462,7 +465,10 @@ gmbus_xfer_index_read(struct drm_i915_private *dev_priv, 
> struct i2c_msg *msgs)
>   if (gmbus5)
>   I915_WRITE_FW(GMBUS5, gmbus5);
>  
> - ret = gmbus_xfer_read(dev_priv, &msgs[1], gmbus1_index);
> + if (msgs[1].flags & I2C_M_RD)
> + ret = gmbus_xfer_read(dev_priv, &msgs[1], gmbus1_index);
> + else
> + ret = gmbus_xfer_write(dev_priv, &msgs[1], gmbus1_index);
>  
>   /* Clear GMBUS5 after each index transfer */
>   if (gmbus5)
> @@ -486,13 +492,13 @@ do_gmbus_xfer(struct i2c_adapter *adapter, struct 
> i2c_msg *msgs, int num)
>  
>   for (; i < num; i += inc) {
>   inc = 1;
> - if (gmbus_is_index_read(msgs, i, num)) {
> - ret = gmbus_xfer_index_read(dev_priv, &msgs[i]);
> - inc = 2; /* an index read is two msgs */
> + if (gmbus_is_index_xfer(msgs, i, num)) {
> + ret = gmbus_index_xfer(dev_priv, &msgs[i]);
> + inc = 2; /* an index transmission is two msgs */
>   } else if (msgs[i].flags & I2C_M_RD) {
>   ret = gmbus_xfer_read(dev_priv, &msgs[i], 0);
>   } else {
> - ret = gmbus_xfer_write(d

Re: [Intel-gfx] [PATCH v6 0/5] drm/i915: Expose more GPU properties through sysfs

2017-12-07 Thread Tvrtko Ursulin


On 04/12/2017 15:02, Lionel Landwerlin wrote:

Hi,

After discussion with Chris, Joonas & Tvrtko, this series adds an
additional commit to link the render node back to the card through a
symlink. Making it obvious from an application using a render node to
know where to get the information it needs.


Important thing to mention as well is that it is trivial to get from the 
master drm fd to the sysfs root, via fstat and opendir 
/sys/dev/char/:. With the addition of the card symlink to 
render nodes it is trivial for render node fd as well.


I am happy with this approach - it is extensible, flexible and avoids 
issues with ioctl versioning or whatnot. With one value per file it is 
trivial for userspace to access.


So for what I'm concerned, given how gputop would use all of this and so 
be the userspace, if everyone else is happy, I think we could do a 
detailed review and prehaps also think about including gputop in some 
distribution to make the case 100% straightforward.


Regards,

Tvrtko



Cheers,

Lionel Landwerlin (5):
   drm: add card symlink in render sysfs directory
   drm/i915: store all subslice masks
   drm/i915/debugfs: reuse max slice/subslices already stored in sseu
   drm/i915: expose engine availability through sysfs
   drm/i915: expose EU topology through sysfs

  drivers/gpu/drm/drm_drv.c|  11 +
  drivers/gpu/drm/i915/i915_debugfs.c  |  50 ++--
  drivers/gpu/drm/i915/i915_drv.c  |   2 +-
  drivers/gpu/drm/i915/i915_drv.h  |  56 -
  drivers/gpu/drm/i915/i915_sysfs.c| 386 +++
  drivers/gpu/drm/i915/intel_device_info.c | 169 ++
  drivers/gpu/drm/i915/intel_engine_cs.c   |  12 +
  drivers/gpu/drm/i915/intel_lrc.c |   2 +-
  drivers/gpu/drm/i915/intel_ringbuffer.h  |   6 +-
  9 files changed, 617 insertions(+), 77 deletions(-)

--
2.15.1
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm/i915: Increase max texture to 16k for gen9+

2017-12-07 Thread Alex Tu
Rrefer to another patch [1] on mesa to extend width/height to 16384.
For issue :
 - https://bugs.freedesktop.org/show_bug.cgi?id=102508
 - LP: #1714178 Triple monitor display failed with Dell Dock (HiDPI)

[1] https://patchwork.freedesktop.org/patch/124918/

Signed-off-by: Alex Tu 
---
 drivers/gpu/drm/i915/intel_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index 47a2f6acee50..556fa57b18b8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13905,7 +13905,7 @@ u32 intel_fb_pitch_limit(struct drm_i915_private 
*dev_priv,
/* "The stride in bytes must not exceed the of the size of 8K
 *  pixels and 32K bytes."
 */
-   return min(8192 * cpp, 32768);
+   return min(16384 * cpp, 65536);
} else if (gen >= 5 && !HAS_GMCH_DISPLAY(dev_priv)) {
return 32*1024;
} else if (gen >= 4) {
@@ -14604,8 +14604,8 @@ int intel_modeset_init(struct drm_device *dev)
dev->mode_config.max_width = 4096;
dev->mode_config.max_height = 4096;
} else {
-   dev->mode_config.max_width = 8192;
-   dev->mode_config.max_height = 8192;
+   dev->mode_config.max_width = 16384;
+   dev->mode_config.max_height = 16384;
}
 
if (IS_I845G(dev_priv) || IS_I865G(dev_priv)) {
-- 
2.11.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: Increase max texture to 16k for gen9+

2017-12-07 Thread Chris Wilson
Quoting Alex Tu (2017-12-07 09:26:00)
> Rrefer to another patch [1] on mesa to extend width/height to 16384.
> For issue :
>  - https://bugs.freedesktop.org/show_bug.cgi?id=102508
>  - LP: #1714178 Triple monitor display failed with Dell Dock (HiDPI)
> 
> [1] https://patchwork.freedesktop.org/patch/124918/
> 
> Signed-off-by: Alex Tu 
> ---
>  drivers/gpu/drm/i915/intel_display.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c 
> b/drivers/gpu/drm/i915/intel_display.c
> index 47a2f6acee50..556fa57b18b8 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13905,7 +13905,7 @@ u32 intel_fb_pitch_limit(struct drm_i915_private 
> *dev_priv,
> /* "The stride in bytes must not exceed the of the size of 8K
>  *  pixels and 32K bytes."
>  */
> -   return min(8192 * cpp, 32768);
> +   return min(16384 * cpp, 65536);
> } else if (gen >= 5 && !HAS_GMCH_DISPLAY(dev_priv)) {
> return 32*1024;
> } else if (gen >= 4) {
> @@ -14604,8 +14604,8 @@ int intel_modeset_init(struct drm_device *dev)
> dev->mode_config.max_width = 4096;
> dev->mode_config.max_height = 4096;
> } else {
> -   dev->mode_config.max_width = 8192;
> -   dev->mode_config.max_height = 8192;
> +   dev->mode_config.max_width = 16384;
> +   dev->mode_config.max_height = 16384;

These are nothing to do with texture size, but single CRTC bounds.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] drm-intel/for-linux-next disabled on linux-next?

2017-12-07 Thread Stephen Rothwell
Hi Daniel,

On Wed, 6 Dec 2017 10:52:05 +0100 Daniel Vetter  wrote:
>
> next-20171205 didn't have any of the patches in drm-intel/for-linux-next
> that weren't already in the drm-next branch. My for-linux-next was at
> 
> commit 39ccc9852e2b46964c9c44eba52db57413ba6d27 (HEAD -> 
> drm-intel-next-queued)
> Author: Anusha Srivatsa 
> Date:   Thu Nov 9 17:18:32 2017 -0800
> 
> drm/i915/skl: DMC firmware for skylake v1.27
> 
> when I did that check. The linux-next you just pushed out has it all
> again.

I fetch your tree every morning and several times during the day (up
until the point it gets merged), so I have no idea what happened.  You
do remember that I am in a very different time zone, right?

Just in case, I am fetching the for-linux-next-fixes and for-linux-next
branches of git://anongit.freedesktop.org/drm-intel

-- 
Cheers,
Stephen Rothwell
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH igt 1/2] lib/draw: Use more typical form for computing swizzle addresses

2017-12-07 Thread Chris Wilson
Actually use the XOR operation rather than open coding it with three
bitwise operators (including XOR itself).

Signed-off-by: Chris Wilson 
---
 lib/igt_draw.c | 35 +++
 1 file changed, 15 insertions(+), 20 deletions(-)

diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 76ffb6c2d..8f8238292 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -97,29 +97,28 @@ const char *igt_draw_get_method_name(enum igt_draw_method 
method)
}
 }
 
-#define BIT(num, bit) ((num >> bit) & 1)
-
-static int swizzle_addr(int addr, int swizzle)
+static unsigned long swizzle_bit(unsigned int bit, unsigned long offset)
 {
-   int bit6;
+   return (offset & (1ul << bit)) >> (bit - 6);
+}
 
+static int swizzle_addr(unsigned long addr, int swizzle)
+{
switch (swizzle) {
case I915_BIT_6_SWIZZLE_NONE:
-   bit6 = BIT(addr, 6);
-   break;
+   return addr;
case I915_BIT_6_SWIZZLE_9:
-   bit6 = BIT(addr, 6) ^ BIT(addr, 9);
-   break;
+   return addr ^ swizzle_bit(9, addr);
case I915_BIT_6_SWIZZLE_9_10:
-   bit6 = BIT(addr, 6) ^ BIT(addr, 9) ^ BIT(addr, 10);
-   break;
+   return addr ^ swizzle_bit(9, addr) ^ swizzle_bit(10, addr);
case I915_BIT_6_SWIZZLE_9_11:
-   bit6 = BIT(addr, 6) ^ BIT(addr, 9) ^ BIT(addr, 11);
-   break;
+   return addr ^ swizzle_bit(9, addr) ^ swizzle_bit(11, addr);
case I915_BIT_6_SWIZZLE_9_10_11:
-   bit6 = BIT(addr, 6) ^ BIT(addr, 9) ^ BIT(addr, 10) ^
-  BIT(addr, 11);
-   break;
+   return (addr ^
+   swizzle_bit(9, addr) ^
+   swizzle_bit(10, addr) ^
+   swizzle_bit(11, addr));
+
case I915_BIT_6_SWIZZLE_UNKNOWN:
case I915_BIT_6_SWIZZLE_9_17:
case I915_BIT_6_SWIZZLE_9_10_17:
@@ -127,12 +126,8 @@ static int swizzle_addr(int addr, int swizzle)
/* If we hit this case, we need to implement support for the
 * appropriate swizzling method. */
igt_require(false);
-   break;
+   return addr;
}
-
-   addr &= ~(1 << 6);
-   addr |= (bit6 << 6);
-   return addr;
 }
 
 static int tile(int x, int y, uint32_t x_tile_size, uint32_t y_tile_size,
-- 
2.15.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH igt 2/2] igt/kms_frontbuffer_tracking: Access via GGTT is not guaranteed to be tracked

2017-12-07 Thread Chris Wilson
As the system may use a partial vma for a GGTT mmap, access via the GGTT
mmap is not guaranteed to be tracked by FBC's fence. The rule expressed has
been that any access to the frontbuffer should be followed by a fb-dirty
ioctl, so always apply and expect the driver to ellide no-ops.

Signed-off-by: Chris Wilson 
---
 tests/kms_frontbuffer_tracking.c | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index a068c8afb..1fcca87c9 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1127,8 +1127,7 @@ static void draw_rect(struct draw_pattern_info *pattern, 
struct fb_region *fb,
 fb->x + rect.x, fb->y + rect.y,
 rect.w, rect.h, rect.color);
 
-   if (method == IGT_DRAW_MMAP_WC)
-   fb_dirty_ioctl(fb, &rect);
+   fb_dirty_ioctl(fb, &rect);
 }
 
 static void draw_rect_igt_fb(struct draw_pattern_info *pattern,
@@ -2132,16 +2131,10 @@ static void multidraw_subtest(const struct test_mode *t)
 
draw_rect(pattern, target, used_method, r);
 
-   if (used_method == IGT_DRAW_MMAP_WC)
+   if (used_method == IGT_DRAW_MMAP_WC ||
+   used_method == IGT_DRAW_MMAP_GTT)
wc_used = true;
 
-   if (used_method == IGT_DRAW_MMAP_GTT &&
-   wc_used) {
-   struct rect rect =
-   pattern->get_rect(target, r);
-   fb_dirty_ioctl(target, &rect);
-   }
-
update_wanted_crc(t,
  &pattern->crcs[t->format][r]);
 
-- 
2.15.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t for CI] tests/kms_vblank: Add test to ensure DRM_CAP_CRTC_IN_VBLANK_EVENT works correctly

2017-12-07 Thread Maarten Lankhorst
This was implemented correctly only on the atomic ioctl before, but
it should really be working on all 3 ioctl's involved, so ensure we
always set crtc_id correctly with a testcase.

The following events are tested:
- Pageflip with event.
- Atomic commit with event.
- wait_vblank ioctl with event.

Signed-off-by: Maarten Lankhorst 
Reviewed-by: Daniel Vetter 
---
 tests/kms_vblank.c | 60 ++
 1 file changed, 56 insertions(+), 4 deletions(-)

diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index b7d570cc96fd..97ccacc4aab9 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -120,7 +120,6 @@ static void run_test(data_t *data, int fd, void 
(*testfunc)(data_t *, int, int))
igt_display_t *display = &data->display;
igt_output_t *output;
enum pipe p;
-   unsigned int valid_tests = 0;
 
for_each_pipe_with_valid_output(display, p, output) {
data->pipe = p;
@@ -161,11 +160,60 @@ static void run_test(data_t *data, int fd, void 
(*testfunc)(data_t *, int, int))
 
/* cleanup what prepare_crtc() has done */
cleanup_crtc(data, fd, output);
-   valid_tests++;
}
+}
+
+static void crtc_id_subtest(data_t *data, int fd)
+{
+   igt_display_t *display = &data->display;
+   igt_output_t *output;
+   enum pipe p;
+
+   for_each_pipe_with_valid_output(display, p, output) {
+   struct drm_event_vblank buf;
+   const uint32_t pipe_id_flag = kmstest_get_vbl_flag(p);
+   unsigned crtc_id, expected_crtc_id;
+   uint64_t val;
+   union drm_wait_vblank vbl;
+
+   crtc_id = display->pipes[p].crtc_id;
+   if (drmGetCap(display->drm_fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, 
&val) == 0)
+   expected_crtc_id = crtc_id;
+   else
+   expected_crtc_id = 0;
+
+   data->pipe = p;
+   prepare_crtc(data, fd, output);
+
+   memset(&vbl, 0, sizeof(vbl));
+   vbl.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT;
+   vbl.request.type |= pipe_id_flag;
+   vbl.request.sequence = 1;
+   igt_assert_eq(wait_vblank(fd, &vbl), 0);
+
+   igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
+   igt_assert_eq(buf.crtc_id, expected_crtc_id);
+
+   do_or_die(drmModePageFlip(fd, crtc_id,
+ data->primary_fb.fb_id,
+ DRM_MODE_PAGE_FLIP_EVENT, NULL));
+
+   igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
+   igt_assert_eq(buf.crtc_id, expected_crtc_id);
+
+   if (display->is_atomic) {
+   igt_plane_t *primary = igt_output_get_plane(output, 0);
+
+   igt_plane_set_fb(primary, &data->primary_fb);
+   igt_display_commit_atomic(display, 
DRM_MODE_PAGE_FLIP_EVENT, NULL);
 
-   igt_require_f(valid_tests,
- "no valid crtc/connector combinations found\n");
+   igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
+   igt_assert_eq(buf.crtc_id, expected_crtc_id);
+   }
+
+   cleanup_crtc(data, fd, output);
+   return;
+   }
 }
 
 static void accuracy(data_t *data, int fd, int nchildren)
@@ -298,8 +346,12 @@ igt_main
fd = drm_open_driver(DRIVER_ANY);
kmstest_set_vt_graphics_mode();
igt_display_init(&data.display, fd);
+   igt_display_require_output(&data.display);
}
 
+   igt_subtest("crtc-id")
+   crtc_id_subtest(&data, fd);
+
for (f = funcs; f->name; f++) {
for (m = modes; m->name; m++) {
if (m->flags & ~f->valid)
-- 
2.15.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH igt] igt/gem_mocs_settings: Force use of master device

2017-12-07 Thread Chris Wilson
To use SECURE batches requires root + master, and we need SECURE batches
to write to the privileged mocs registers, do be sure to use
drm_open_driver_master()

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104157
Signed-off-by: Chris Wilson 
---
 tests/gem_mocs_settings.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/gem_mocs_settings.c b/tests/gem_mocs_settings.c
index cb99010d7..29788b648 100644
--- a/tests/gem_mocs_settings.c
+++ b/tests/gem_mocs_settings.c
@@ -421,7 +421,7 @@ igt_main
int fd = -1;
 
igt_fixture {
-   fd = drm_open_driver(DRIVER_INTEL);
+   fd = drm_open_driver_master(DRIVER_INTEL); /* for SECURE */
igt_require_gem(fd);
gem_require_mocs_registers(fd);
igt_require(get_mocs_settings(fd, &table, false));
-- 
2.15.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] kthread: finer-grained lockdep/cross-release completion

2017-12-07 Thread Daniel Vetter
Since -rc1 we're hitting a bunch of lockdep splats using the new
cross-release stuff around the 2 kthread completions. In all cases
they are because totally independent uses of kthread are mixed up by
lockdep into the same locking class, creating artificial deadlocks.

Fix this by converting kthread code in the same way as e.g.
alloc_workqueue already works: Use macros for the public api so we can
have a callsite specific lockdep key, then pass that through the
entire callchain. Due to the many entry points this is slightly
tedious.

Cc: Tvrtko Ursulin 
Cc: Marta Lofstedt 
Cc: Byungchul Park 
Cc: Ingo Molnar 
Cc: Peter Zijlstra 
Cc: Tejun Heo 
Cc: Kees Cook 
Cc: Thomas Gleixner 
Cc: Shaohua Li 
Cc: Andrew Morton 
Cc: Jens Axboe 
Cc: Daniel Vetter 
Cc: Greg Kroah-Hartman 
Cc: Jonathan Corbet 
Cc: Oleg Nesterov 
References: https://bugs.freedesktop.org/show_bug.cgi?id=103950
Signed-off-by: Daniel Vetter 
---
 include/linux/kthread.h | 48 +-
 kernel/kthread.c| 68 ++---
 2 files changed, 88 insertions(+), 28 deletions(-)

diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index c1961761311d..7a9463f0be5c 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -6,10 +6,12 @@
 #include 
 #include 
 
-__printf(4, 5)
-struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
+__printf(6, 7)
+struct task_struct *_kthread_create_on_node(int (*threadfn)(void *data),
   void *data,
   int node,
+  struct lock_class_key *exited_key,
+  struct lock_class_key *parked_key,
   const char namefmt[], ...);
 
 /**
@@ -25,12 +27,27 @@ struct task_struct *kthread_create_on_node(int 
(*threadfn)(void *data),
  */
 #define kthread_create(threadfn, data, namefmt, arg...) \
kthread_create_on_node(threadfn, data, NUMA_NO_NODE, namefmt, ##arg)
+#define kthread_create_on_node(threadfn, data, node, namefmt, arg...)  \
+({ \
+   static struct lock_class_key __exited_key, __parked_key;\
+   _kthread_create_on_node(threadfn, data, node, &__exited_key,\
+  &__parked_key, namefmt, ##arg);  \
+})
 
 
-struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data),
+struct task_struct *_kthread_create_on_cpu(int (*threadfn)(void *data),
  void *data,
  unsigned int cpu,
+ struct lock_class_key *exited_key,
+ struct lock_class_key *parked_key,
  const char *namefmt);
+#define kthread_create_on_cpu(threadfn, data, cpu, namefmt)\
+({ \
+   static struct lock_class_key __exited_key, __parked_key;\
+   _kthread_create_on_cpu(threadfn, data, cpu, &__exited_key,\
+  &__parked_key, namefmt); \
+})
+
 
 /**
  * kthread_run - create and wake a thread.
@@ -171,13 +188,30 @@ extern void __kthread_init_worker(struct kthread_worker 
*worker,
 
 int kthread_worker_fn(void *worker_ptr);
 
-__printf(2, 3)
+__printf(4, 5)
 struct kthread_worker *
-kthread_create_worker(unsigned int flags, const char namefmt[], ...);
+_kthread_create_worker(unsigned int flags,
+  struct lock_class_key *exited_key,
+  struct lock_class_key *parked_key,
+  const char namefmt[], ...);
+#define kthread_create_worker(flags, namefmt...)   
\
+({ \
+   static struct lock_class_key __exited_key, __parked_key;\
+   _kthread_create_worker(flags, &__exited_key, &__parked_key, \
+  ##namefmt);  \
+})
 
-__printf(3, 4) struct kthread_worker *
-kthread_create_worker_on_cpu(int cpu, unsigned int flags,
+__printf(5, 6) struct kthread_worker *
+_kthread_create_worker_on_cpu(int cpu, unsigned int flags,
+  struct lock_class_key *exited_key,
+  struct lock_class_key *parked_key,
 const char namefmt[], ...);
+#define kthread_create_worker_on_cpu(cpu, flags, namefmt...)   \
+({ \
+   static struct lock_class_key __exited_key, __parked_key;\
+   _kthread_create_worker_on_cpu(cpu, flags, &__exited_key, &__parked_key,\
+  ##namefmt);  \
+})
 
 bool kthread_queue_work(struct kthread_

[Intel-gfx] [PATCH igt] lib: Print other clients when DRM_SET_MASTER fails

2017-12-07 Thread Chris Wilson
It looks like there are some rogue processes running in CI that prevent
DRM_MASTER from being obtained. Dump the list of clients on failure to
make it more obvious what is being left behind.

References: https://bugs.freedesktop.org/show_bug.cgi?id=104157
Signed-off-by: Chris Wilson 
---
 lib/Makefile.sources |  2 ++
 lib/drmtest.c|  4 +--
 lib/igt_device.c | 78 
 lib/igt_device.h | 34 +++
 4 files changed, 116 insertions(+), 2 deletions(-)
 create mode 100644 lib/igt_device.c
 create mode 100644 lib/igt_device.h

diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 6e968d9f7..686c0f145 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -15,6 +15,8 @@ lib_source_list = \
igt.h   \
igt_debugfs.c   \
igt_debugfs.h   \
+   igt_device.c\
+   igt_device.h\
igt_aux.c   \
igt_aux.h   \
igt_edid_template.h \
diff --git a/lib/drmtest.c b/lib/drmtest.c
index ef2f772ea..b2d8150f4 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -51,6 +51,7 @@
 #include "intel_chipset.h"
 #include "intel_io.h"
 #include "igt_debugfs.h"
+#include "igt_device.h"
 #include "igt_gt.h"
 #include "igt_kmod.h"
 #include "version.h"
@@ -423,8 +424,7 @@ int drm_open_driver_master(int chipset)
 {
int fd = drm_open_driver(chipset);
 
-   igt_require_f(drmSetMaster(fd) == 0, "Can't become DRM master, "
- "please check if no other DRM client is running.\n");
+   igt_device_set_master(fd);
 
return fd;
 }
diff --git a/lib/igt_device.c b/lib/igt_device.c
new file mode 100644
index 0..5bf0bdcd3
--- /dev/null
+++ b/lib/igt_device.c
@@ -0,0 +1,78 @@
+/*
+ * Copyright © 2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include "igt.h"
+#include "igt_device.h"
+
+int __igt_device_set_master(int fd)
+{
+   int err;
+
+   err = 0;
+   if (drmIoctl(fd, DRM_IOCTL_SET_MASTER, NULL))
+   err = -errno;
+
+   errno = 0;
+   return err;
+}
+
+/**
+ * igt_device_set_master: Set DRM master
+ * @fd: the device
+ *
+ * Tell the kernel to become DRM master or skip the test.
+ */
+void igt_device_set_master(int fd)
+{
+   if (__igt_device_set_master(fd)) {
+   igt_debugfs_dump(fd, "clients");
+   igt_require_f(__igt_device_set_master(fd) == 0,
+ "Can't become DRM master, "
+ "please check if no other DRM client is 
running.\n");
+   }
+}
+
+int __igt_device_drop_master(int fd)
+{
+   int err;
+
+   err = 0;
+   if (drmIoctl(fd, DRM_IOCTL_DROP_MASTER, NULL))
+   err = -errno;
+
+   errno = 0;
+   return err;
+}
+
+/**
+ * igt_device_drop_master: Drop DRM master
+ * @fd: the device
+ *
+ * Tell the kernel we no longer want to be the DRM master; asserting that
+ * we lose that privilege.
+ */
+void igt_device_drop_master(int fd)
+{
+   igt_assert_eq(__igt_device_drop_master(fd), 0);
+}
diff --git a/lib/igt_device.h b/lib/igt_device.h
new file mode 100644
index 0..2995f969e
--- /dev/null
+++ b/lib/igt_device.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright © 2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * par

Re: [Intel-gfx] [PATCH] drm/i915: Increase max texture to 16k for gen9+

2017-12-07 Thread Alex Tu
Thanks for comment.
I'm not familiar with that, so just followed the patch in mes
https://patchwork.freedesktop.org/patch/124918/a.

How about change subtitle to "drm/i915: Increase max CRTC bounds to 16k for
gen9+"?

On Thu, Dec 7, 2017 at 5:32 PM, Chris Wilson 
wrote:

> Quoting Alex Tu (2017-12-07 09:26:00)
> > Rrefer to another patch [1] on mesa to extend width/height to 16384.
> > For issue :
> >  - https://bugs.freedesktop.org/show_bug.cgi?id=102508
> >  - LP: #1714178 Triple monitor display failed with Dell Dock (HiDPI)
> >
> > [1] https://patchwork.freedesktop.org/patch/124918/
> >
> > Signed-off-by: Alex Tu 
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> > index 47a2f6acee50..556fa57b18b8 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -13905,7 +13905,7 @@ u32 intel_fb_pitch_limit(struct drm_i915_private
> *dev_priv,
> > /* "The stride in bytes must not exceed the of the size
> of 8K
> >  *  pixels and 32K bytes."
> >  */
> > -   return min(8192 * cpp, 32768);
> > +   return min(16384 * cpp, 65536);
> > } else if (gen >= 5 && !HAS_GMCH_DISPLAY(dev_priv)) {
> > return 32*1024;
> > } else if (gen >= 4) {
> > @@ -14604,8 +14604,8 @@ int intel_modeset_init(struct drm_device *dev)
> > dev->mode_config.max_width = 4096;
> > dev->mode_config.max_height = 4096;
> > } else {
> > -   dev->mode_config.max_width = 8192;
> > -   dev->mode_config.max_height = 8192;
> > +   dev->mode_config.max_width = 16384;
> > +   dev->mode_config.max_height = 16384;
>
> These are nothing to do with texture size, but single CRTC bounds.
> -Chris
>
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH igt] igt/perf_pmu: Tweak wait_for_rc6, yet again

2017-12-07 Thread Tvrtko Ursulin


On 06/12/2017 23:12, Chris Wilson wrote:

Still CI remains obstinate that RC6 is not smoothly incrementing during
the sample period. Tweak the wait_for_rc6() to first wait for the
initial Evaluation Interval before polling.

Signed-off-by: Chris Wilson 
Cc: Tvrtko Ursulin 
---
  tests/perf_pmu.c | 15 +++
  tests/pm_rc6_residency.c | 15 +++
  2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index ff6568221..917832d1b 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -1000,13 +1000,20 @@ static bool wait_for_rc6(int fd)
struct timespec tv = {};
uint64_t start, now;
  
-	start = pmu_read_single(fd);

+   /* First wait for roughly an RC6 Evaluation Interval */
+   usleep(160 * 1000);
+
+   /* Then poll for RC6 to start ticking */
+   now = pmu_read_single(fd);
do {
-   usleep(50);
+   start = now;
+   usleep(5000);
now = pmu_read_single(fd);
-   } while (start == now && !igt_seconds_elapsed(&tv));
+   if (now - start > 2e6)
+   return true;


What is the thinking behind the 2ms of RC6 after 5ms of sleep criteria?

Regards,

Tvrtko


+   } while (!igt_seconds_elapsed(&tv));
  
-	return start != now;

+   return false;
  }
  
  static void

diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c
index 16f4b1421..7cc62dac8 100644
--- a/tests/pm_rc6_residency.c
+++ b/tests/pm_rc6_residency.c
@@ -170,13 +170,20 @@ static bool wait_for_rc6(void)
struct timespec tv = {};
unsigned long start, now;
  
-	start = read_rc6_residency("rc6");

+   /* First wait for roughly an RC6 Evaluation Interval */
+usleep(160 * 1000);
+
+/* Then poll for RC6 to start ticking */
+   now = read_rc6_residency("rc6");
do {
-   usleep(50);
+   start = now;
+   usleep(5000);
now = read_rc6_residency("rc6");
-   } while (now == start && !igt_seconds_elapsed(&tv));
+   if (now - start > 2)
+   return true;
+   } while (!igt_seconds_elapsed(&tv));
  
-	return now != start;

+   return false;
  }
  
  igt_main



___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH igt] igt/perf_pmu: Tweak wait_for_rc6, yet again

2017-12-07 Thread Chris Wilson
Quoting Tvrtko Ursulin (2017-12-07 10:25:36)
> 
> On 06/12/2017 23:12, Chris Wilson wrote:
> > Still CI remains obstinate that RC6 is not smoothly incrementing during
> > the sample period. Tweak the wait_for_rc6() to first wait for the
> > initial Evaluation Interval before polling.
> > 
> > Signed-off-by: Chris Wilson 
> > Cc: Tvrtko Ursulin 
> > ---
> >   tests/perf_pmu.c | 15 +++
> >   tests/pm_rc6_residency.c | 15 +++
> >   2 files changed, 22 insertions(+), 8 deletions(-)
> > 
> > diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> > index ff6568221..917832d1b 100644
> > --- a/tests/perf_pmu.c
> > +++ b/tests/perf_pmu.c
> > @@ -1000,13 +1000,20 @@ static bool wait_for_rc6(int fd)
> >   struct timespec tv = {};
> >   uint64_t start, now;
> >   
> > - start = pmu_read_single(fd);
> > + /* First wait for roughly an RC6 Evaluation Interval */
> > + usleep(160 * 1000);
> > +
> > + /* Then poll for RC6 to start ticking */
> > + now = pmu_read_single(fd);
> >   do {
> > - usleep(50);
> > + start = now;
> > + usleep(5000);
> >   now = pmu_read_single(fd);
> > - } while (start == now && !igt_seconds_elapsed(&tv));
> > + if (now - start > 2e6)
> > + return true;
> 
> What is the thinking behind the 2ms of RC6 after 5ms of sleep criteria?

I was being worried about random fluctuations. The sleep before is
probably good enough, basically I'm guessing at what caused it to fail,
with the starting point being that we declared RC6 active before it was.

2ms was trying to guess at what the granularity of the counter was,
which is ~1us, not 1ms. Respin with 2us instead?
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v4 0/9] drm/i915: Implement HDCP

2017-12-07 Thread Jose Abreu
Hi Sean,

On 07-12-2017 00:00, Sean Paul wrote:
> Welcome to version 4 of the patchset. I think we're nearing the finish line
> (hopefully) now. This set addresses the review feedback from v3. I applied 
> some
> R-b's from v3 review, and converted others to Cc since other changes were made
> to the patch, and I didn't want to speak for reviewers.
>
> Thanks for all the review feedback!

Thanks for your patches, nice to see HDCP patches making it into DRM!

I'm not familiar with i915 driver/hw but I do am familiar with
HDCP for HDMI. Here goes a few notes:
- You should make sure that you are streaming valid TMDS data
after reading the BKSV. I think by spec you can read BKSV at any
point but the remaining operations need to be done *after* you
start sending video, otherwise you can end up with wrong Ri's
because Ri rotation is done using TMDS clock...
- Also according to spec you should make sure BSTATUS reports DVI
state in first read (i.e. before start sending video) and that
HDMI_RESERVED field is tied to one.
- I think you should clearly indicate that this is for HDCP 1.4
because HDCP 2.2 is a lot different.

Also, is there any possibility to port any of these functions for
main DRM core? I mean, not the shim ops which seem very specific
for your HW, but at least a .enable, .disable, .link_check
callbacks would be useful to help others to also implement HDCP ...

Best Regards,
Jose Miguel Abreu

>
> Sean
>
> Sean Paul (9):
>   drm: Fix link-status kerneldoc line lengths
>   drm/i915: Add more control to wait_for routines
>   drm: Add Content Protection property
>   drm: Add some HDCP related #defines
>   drm/i915: Add HDCP framework + base implementation
>   drm/i915: Make use of indexed write GMBUS feature
>   drm/i915: Add function to output Aksv over GMBUS
>   drm/i915: Implement HDCP for HDMI
>   drm/i915: Implement HDCP for DisplayPort
>
>  drivers/gpu/drm/drm_atomic.c |   8 +
>  drivers/gpu/drm/drm_connector.c  |  87 -
>  drivers/gpu/drm/drm_sysfs.c  |   1 +
>  drivers/gpu/drm/i915/Makefile|   1 +
>  drivers/gpu/drm/i915/i915_drv.h  |   1 +
>  drivers/gpu/drm/i915/i915_reg.h  |  85 
>  drivers/gpu/drm/i915/intel_atomic.c  |   2 +
>  drivers/gpu/drm/i915/intel_ddi.c |  36 ++
>  drivers/gpu/drm/i915/intel_display.c |   4 +
>  drivers/gpu/drm/i915/intel_dp.c  | 244 +++-
>  drivers/gpu/drm/i915/intel_drv.h | 106 -
>  drivers/gpu/drm/i915/intel_hdcp.c| 735 
> +++
>  drivers/gpu/drm/i915/intel_hdmi.c| 250 
>  drivers/gpu/drm/i915/intel_i2c.c |  81 +++-
>  drivers/gpu/drm/i915/intel_uncore.c  |  23 +-
>  drivers/gpu/drm/i915/intel_uncore.h  |  14 +-
>  include/drm/drm_connector.h  |  16 +
>  include/drm/drm_dp_helper.h  |  17 +
>  include/drm/drm_hdcp.h   |  56 +++
>  include/uapi/drm/drm_mode.h  |   4 +
>  20 files changed, 1728 insertions(+), 43 deletions(-)
>  create mode 100644 drivers/gpu/drm/i915/intel_hdcp.c
>  create mode 100644 include/drm/drm_hdcp.h
>

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: Increase max texture to 16k for gen9+

2017-12-07 Thread Daniel Vetter
On Thu, Dec 07, 2017 at 06:09:17PM +0800, Alex Tu wrote:
> Thanks for comment.
> I'm not familiar with that, so just followed the patch in mes
> https://patchwork.freedesktop.org/patch/124918/a.
> 
> How about change subtitle to "drm/i915: Increase max CRTC bounds to 16k for
> gen9+"?

The render side of the gpu has nothing to do with the display side. Just
because render has higher limits doesn't mean the same limits apply to the
display side. We've had plenty of chips where they don't match.

So trying to justify a CRTC limit change with a mesa change is bogus.
-Daniel
 
> On Thu, Dec 7, 2017 at 5:32 PM, Chris Wilson 
> wrote:
> 
> > Quoting Alex Tu (2017-12-07 09:26:00)
> > > Rrefer to another patch [1] on mesa to extend width/height to 16384.
> > > For issue :
> > >  - https://bugs.freedesktop.org/show_bug.cgi?id=102508
> > >  - LP: #1714178 Triple monitor display failed with Dell Dock (HiDPI)
> > >
> > > [1] https://patchwork.freedesktop.org/patch/124918/
> > >
> > > Signed-off-by: Alex Tu 
> > > ---
> > >  drivers/gpu/drm/i915/intel_display.c | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c
> > b/drivers/gpu/drm/i915/intel_display.c
> > > index 47a2f6acee50..556fa57b18b8 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -13905,7 +13905,7 @@ u32 intel_fb_pitch_limit(struct drm_i915_private
> > *dev_priv,
> > > /* "The stride in bytes must not exceed the of the size
> > of 8K
> > >  *  pixels and 32K bytes."
> > >  */
> > > -   return min(8192 * cpp, 32768);
> > > +   return min(16384 * cpp, 65536);
> > > } else if (gen >= 5 && !HAS_GMCH_DISPLAY(dev_priv)) {
> > > return 32*1024;
> > > } else if (gen >= 4) {
> > > @@ -14604,8 +14604,8 @@ int intel_modeset_init(struct drm_device *dev)
> > > dev->mode_config.max_width = 4096;
> > > dev->mode_config.max_height = 4096;
> > > } else {
> > > -   dev->mode_config.max_width = 8192;
> > > -   dev->mode_config.max_height = 8192;
> > > +   dev->mode_config.max_width = 16384;
> > > +   dev->mode_config.max_height = 16384;
> >
> > These are nothing to do with texture size, but single CRTC bounds.
> > -Chris
> >

> ___
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [RFC i-g-t 3/5] lib/igt_hang_ctx: Use dummyload batch to hang ctx.

2017-12-07 Thread Chris Wilson
Quoting Antonio Argenziano (2017-12-06 23:03:44)
> To hang a context we were effectively reimplementing a spinning batch
> and never stopping it. This patch reuses the recursive batch from
> igt_dummyload to hang a context.
> 
> Cc: Chris Wilson 
> Signed-off-by: Antonio Argenziano 
> ---
>  #define SCRATCH 0
> @@ -168,6 +168,8 @@ static void emit_recursive_batch(igt_spin_t *spin,
> execbuf.flags = engines[i];
> gem_execbuf(fd, &execbuf);
> }
> +
> +   spin->spinning_offset = obj->offset;

s/spinning_offset/gtt_offset;

spin->gtt_offset = obj[BATCH].offset;

which should fix up the CI failures.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PULL] drm-misc-next

2017-12-07 Thread Gustavo Padovan
Hi Dave,

More 4.16 stuff, biggest thing here is the panel orientation work from 
Hans. The rest is just misc core and drivers improvements/doc/bugfixes.

This contain a backmerge of drm-next (at v4.15-rc2) but should be
transparent to you. What you should be aware is the merge conflict that
will happen against drm-intel-next, which is already fixed by drm-tip
and linux-next (See "linux-next: build failure after merge of
the drm-misc tree" from yesterday).

Regards,

Gustavo

drm-misc-next-2017-12-07:
UAPI Changes:

- Add "panel orientation" property to DRM to indicate orientation of the
panel vs the device's casing (Hans de Goede)

Core Changes:

- misc doc and bug fixes

Driver Changes:

- sun4i: Many improvements to the DE driver like multi-plane support and
YUV formats (Jernej Skrabec)
The following changes since commit ca797d29cd63e7b71b4eea29aff3b1cefd1ecb59:

  Merge tag 'drm-intel-next-2017-11-17-1' of 
git://anongit.freedesktop.org/drm/drm-intel into drm-next (2017-12-04 10:56:53 
+1000)

are available in the git repository at:

  git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2017-12-07

for you to fetch changes up to bc29489f712079378081e43d5b1b7470ed70184d:

  drm/sun4i: Fix uninitialized variables in vi layer (2017-12-07 09:51:41 +0100)


UAPI Changes:

- Add "panel orientation" property to DRM to indicate orientation of the
panel vs the device's casing (Hans de Goede)

Core Changes:

- misc doc and bug fixes

Driver Changes:

- sun4i: Many improvements to the DE driver like multi-plane support and
YUV formats (Jernej Skrabec)


Benjamin Gaignard (2):
  gpu: drm: sti: Adopt SPDX identifiers
  gpu: drm: stm: Adopt SPDX identifiers

Chen-Yu Tsai (1):
  drm/sun4i: use sun4i_tcon_of_table to check if a device node is a TCON

David Lechner (4):
  dt-bindings: Add vendor prefix for ilitek
  dt-bindings: Add binding for Ilitek ILI9225 display panels
  drm/tinydrm: export mipi_dbi_buf_copy and mipi_dbi_spi_cmd_max_speed
  drm/tinydrm: add driver for ILI9225 panels

Gustavo A. R. Silva (1):
  drm/fb-helper: Fix potential NULL pointer dereference

Gustavo Padovan (1):
  Merge arlied/drm-next into drm-misc-next

Hans de Goede (8):
  fbcon: Add fbcon_rotate_hint to struct fb_info
  drm: Add panel orientation quirks, v6.
  drm: Add support for a panel-orientation connector property, v6
  drm/fb-helper: Apply panel orientation connector prop to the primary 
plane, v6.
  drm/i915: Add "panel orientation" property to the panel connector, v6.
  efifb: Set info->fbcon_rotate_hint based on 
drm_get_panel_orientation_quirk
  fbcon: Remove dmi quirk table
  drm: Document that drm_panel_orientation_quirks.c is shared with fbdev

Jernej Skrabec (27):
  drm/sun4i: Fix format mask in DE2 driver
  drm/sun4i: Rename DE2 RGB format macros
  drm/sun4i: Remove setting alpha mode in DE2 driver
  drm/sun4i: Fix debug message in DE2
  drm/sun4i: Remove setting default values in DE2 driver
  drm/sun4i: Explain color macro in DE2 driver
  drm/sun4i: Set blending mode for all channels (DE2)
  drm/sun4i: Rename some macros in DE2 driver
  drm/sun4i: Rework enabling plane in DE2 driver
  drm/sun4i: Start using layer id in DE2 driver
  drm/sun4i: Add constraints checking to DE2 driver
  drm/sun4i: Use values calculated by atomic check
  drm/sun4i: Move line width setting in DE2
  drm/sun4i: Move channel size related code in DE2
  drm/sun4i: Move interlace related code in DE2
  drm/sun4i: Add multi plane support to DE2 driver
  drm/sun4i: Add support for all HW supported DE2 RGB formats
  drm/sun4i: Reorganize UI layer code in DE2
  drm/sun4i: Add support for DE2 VI planes
  drm/sun4i: Add scaler configuration to DE2 mixers
  drm/sun4i: Add support for HW scaling to DE2
  drm/sun4i: Add CCSC property to DE2 configuration
  drm/sun4i: Add DE2 CSC library
  drm/sun4i: Add DE2 definitions for YUV formats
  drm/sun4i: Expand DE2 scaler lib with YUV support
  drm/sun4i: Wire in DE2 YUV support
  drm/sun4i: Fix uninitialized variables in vi layer

Lucas Stach (1):
  drm/prime: skip CPU sync in map/unmap dma_buf

Noralf Trønnes (6):
  drm/probe-helper: Fix drm_kms_helper_poll_enable() docs
  drm/modeset-helper: Add simple modeset suspend/resume helpers
  drm/arm/mali: Use drm_mode_config_helper_suspend/resume()
  drm/tinydrm: Use drm_mode_config_helper_suspend/resume()
  drm/docs: Add todo entry for simple modeset suspend/resume
  drm/fsl-dcu: Use drm_mode_config_helper_suspend/resume()

 .../devicetree/bindings/display/ilitek,ili9225.txt |  25 +
 .../devicetree/bindings/vendor-prefixes.txt|   1 +
 Documentation/gpu/drm-kms-helpers.rst  |   3 +
 Documentation/gpu/todo.rst

Re: [Intel-gfx] [PATCH] drm/i915: Increase max texture to 16k for gen9+

2017-12-07 Thread Chris Wilson
Quoting Alex Tu (2017-12-07 09:26:00)
> Rrefer to another patch [1] on mesa to extend width/height to 16384.
> For issue :
>  - https://bugs.freedesktop.org/show_bug.cgi?id=102508
>  - LP: #1714178 Triple monitor display failed with Dell Dock (HiDPI)
> 
> [1] https://patchwork.freedesktop.org/patch/124918/
> 
> Signed-off-by: Alex Tu 

For -intel, I just used RandR to split the fb into per-crtc-pixmaps.
However, Kristian has suggested another approach where we carve
per-crtc-pixmaps/-fb out of the global frontbuffer, which allows us to
completely get around the stride limits of scanout and have no
synchronisation penalty. We still have to create new per-crtc-fb for a
flip, just like with RandR but we can avoid the extra blit.

How one feeds such details through gbm into -modesetting, I have no
idea.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Increase max texture to 16k for gen9+

2017-12-07 Thread Patchwork
== Series Details ==

Series: drm/i915: Increase max texture to 16k for gen9+
URL   : https://patchwork.freedesktop.org/series/35016/
State : success

== Summary ==

Series 35016v1 drm/i915: Increase max texture to 16k for gen9+
https://patchwork.freedesktop.org/api/1.0/series/35016/revisions/1/mbox/

fi-bdw-5557u total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  
time:441s
fi-blb-e6850 total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  
time:383s
fi-bsw-n3050 total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  
time:512s
fi-bwr-2160  total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 
time:281s
fi-bxt-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:508s
fi-bxt-j4205 total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:504s
fi-byt-j1900 total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  
time:490s
fi-byt-n2820 total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:473s
fi-gdg-551   total:288  pass:179  dwarn:1   dfail:0   fail:0   skip:108 
time:268s
fi-glk-1 total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  
time:534s
fi-hsw-4770  total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:383s
fi-hsw-4770r total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  
time:259s
fi-ilk-650   total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  
time:391s
fi-ivb-3520m total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:480s
fi-ivb-3770  total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:445s
fi-kbl-7500u total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  
time:490s
fi-kbl-7560u total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  
time:526s
fi-kbl-7567u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:476s
fi-kbl-r total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:534s
fi-pnv-d510  total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  
time:585s
fi-skl-6260u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:458s
fi-skl-6600u total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:538s
fi-skl-6700hqtotal:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:563s
fi-skl-6700k total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  
time:524s
fi-skl-6770hqtotal:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:496s
fi-skl-gvtdvmtotal:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  
time:444s
fi-snb-2600  total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  
time:414s
Blacklisted hosts:
fi-cfl-s2total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:611s
fi-glk-dsi   total:288  pass:257  dwarn:0   dfail:0   fail:1   skip:30  
time:493s

628d1a2176a1ff6ddc4aa282aeb42c526bc64e8a drm-tip: 2017y-12m-07d-10h-57m-50s UTC 
integration manifest
645b40fc37d4 drm/i915: Increase max texture to 16k for gen9+

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7435/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [GIT PULL] gvt-fixes for 4.15-rc3

2017-12-07 Thread Joonas Lahtinen
Hi,

Pulled these, I will give it a final go with CI and send the pull forward. 
Thanks.

Regards, Joonas

On Wed, 2017-12-06 at 15:51 +0800, Zhenyu Wang wrote:
> Hi,
> 
> Here's gvt-fixes for 4.15-rc3 with several fixes backported.
> 
> thanks
> --
> The following changes since commit b721b65af4eb46df6a1d9e34b14003225e403565:
> 
>   drm/i915/gvt: Correct ADDR_4K/2M/1G_MASK definition (2017-11-28 17:24:30 
> +0800)
> 
> are available in the Git repository at:
> 
>   https://github.com/intel/gvt-linux.git tags/gvt-fixes-2017-12-06
> 
> for you to fetch changes up to 11474e9091cf2002e948647fd9f63a7f027e488a:
> 
>   drm/i915/gvt: set max priority for gvt context (2017-12-06 11:38:21 +0800)
> 
> 
> gvt-fixes-2017-12-06
> 
> - Fix invalid hw reg read value for vGPU (Xiong)
> - Fix qemu warning on PCI ROM bar missing (Changbin)
> - Workaround preemption regression (Zhenyu)
> 
> 
> Changbin Du (1):
>   drm/i915/gvt: Emulate PCI expansion ROM base address register
> 
> Xiong Zhang (1):
>   drm/i915/gvt: Limit read hw reg to active vgpu
> 
> Zhenyu Wang (2):
>   drm/i915/gvt: Don't mark vgpu context as inactive when preempted
>   drm/i915/gvt: set max priority for gvt context
> 
> Zhi Wang (1):
>   drm/i915/gvt: Export intel_gvt_render_mmio_to_ring_id()
> 
>  drivers/gpu/drm/i915/gvt/cfg_space.c | 21 
>  drivers/gpu/drm/i915/gvt/handlers.c  | 47 
> 
>  drivers/gpu/drm/i915/gvt/mmio.h  |  2 ++
>  drivers/gpu/drm/i915/gvt/scheduler.c | 22 -
>  4 files changed, 81 insertions(+), 11 deletions(-)
> 
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] kthread: finer-grained lockdep/cross-release completion

2017-12-07 Thread Peter Zijlstra
On Thu, Dec 07, 2017 at 11:08:49AM +0100, Daniel Vetter wrote:
> Since -rc1 we're hitting a bunch of lockdep splats using the new
> cross-release stuff around the 2 kthread completions. In all cases
> they are because totally independent uses of kthread are mixed up by
> lockdep into the same locking class, creating artificial deadlocks.
> 
> Fix this by converting kthread code in the same way as e.g.
> alloc_workqueue already works: Use macros for the public api so we can
> have a callsite specific lockdep key, then pass that through the
> entire callchain. Due to the many entry points this is slightly
> tedious.

Do you have a splat somewhere? I'm having trouble seeing how all this
comes together. That is, I've no real idea what you're actual problem is
and if this is the right solution.

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 0/9] make stolen resource centric

2017-12-07 Thread Matthew Auld
Continuation of Paulo' stolen series[1], addressing the feedback from Joonas and
Chris.

[1] https://patchwork.freedesktop.org/series/30923/

Joonas Lahtinen (1):
  x86/early-quirks: Extend Intel graphics stolen memory placement to
64bit

Matthew Auld (8):
  x86/early-quirks: replace the magical increment start values
  x86/early-quirks: reverse the if ladders
  drm/i915: nuke the duplicated stolen discovery
  drm/i915: make dsm struct resource centric
  drm/i915: make reserved struct resource centric
  drm/i915: make mappable struct resource centric
  drm/i915: give stolen_usable_size a more suitable home
  drm/i915: prefer resource_size_t for everything stolen

 arch/x86/kernel/early-quirks.c|  92 +
 drivers/char/agp/intel-gtt.c  |  14 +-
 drivers/gpu/drm/i915/gvt/gvt.h|   2 +-
 drivers/gpu/drm/i915/i915_debugfs.c   |   4 +-
 drivers/gpu/drm/i915/i915_drv.c   |   2 +-
 drivers/gpu/drm/i915/i915_drv.h   |  36 +++-
 drivers/gpu/drm/i915/i915_gem.c   |   8 +-
 drivers/gpu/drm/i915/i915_gem_execbuffer.c|   2 +-
 drivers/gpu/drm/i915/i915_gem_gtt.c   |  92 +++--
 drivers/gpu/drm/i915/i915_gem_gtt.h   |  19 +-
 drivers/gpu/drm/i915/i915_gem_stolen.c| 272 --
 drivers/gpu/drm/i915/i915_gpu_error.c |   2 +-
 drivers/gpu/drm/i915/i915_vma.c   |   2 +-
 drivers/gpu/drm/i915/intel_display.c  |   5 +-
 drivers/gpu/drm/i915/intel_fbc.c  |  13 +-
 drivers/gpu/drm/i915/intel_fbdev.c|   3 +-
 drivers/gpu/drm/i915/intel_overlay.c  |   4 +-
 drivers/gpu/drm/i915/intel_pm.c   |  31 +--
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c |   4 +-
 drivers/gpu/drm/i915/selftests/mock_gtt.c |   4 +-
 include/drm/i915_drm.h|   3 +
 include/drm/intel-gtt.h   |   3 +-
 22 files changed, 240 insertions(+), 377 deletions(-)

-- 
2.14.3

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 7/9] drm/i915: make mappable struct resource centric

2017-12-07 Thread Matthew Auld
Now that we are using struct resource to track the stolen region, it is
more convenient if we track the mappable region in a resource as well.

v2: prefer iomap and gmadr naming scheme
prefer DEFINE_RES_MEM

Signed-off-by: Matthew Auld 
Cc: Joonas Lahtinen 
Cc: Chris Wilson 
Cc: Paulo Zanoni 
Reviewed-by: Chris Wilson 
---
 drivers/gpu/drm/i915/gvt/gvt.h|  2 +-
 drivers/gpu/drm/i915/i915_drv.c   |  2 +-
 drivers/gpu/drm/i915/i915_gem.c   |  8 
 drivers/gpu/drm/i915/i915_gem_execbuffer.c|  2 +-
 drivers/gpu/drm/i915/i915_gem_gtt.c   | 29 ++-
 drivers/gpu/drm/i915/i915_gem_gtt.h   |  4 ++--
 drivers/gpu/drm/i915/i915_gpu_error.c |  2 +-
 drivers/gpu/drm/i915/i915_vma.c   |  2 +-
 drivers/gpu/drm/i915/intel_display.c  |  2 +-
 drivers/gpu/drm/i915/intel_overlay.c  |  4 ++--
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c |  4 ++--
 drivers/gpu/drm/i915/selftests/mock_gtt.c |  4 ++--
 12 files changed, 37 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
index 77df9bad5dea..103910a24e4b 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.h
+++ b/drivers/gpu/drm/i915/gvt/gvt.h
@@ -348,7 +348,7 @@ int intel_gvt_load_firmware(struct intel_gvt *gvt);
 
 /* Aperture/GM space definitions for GVT device */
 #define gvt_aperture_sz(gvt) (gvt->dev_priv->ggtt.mappable_end)
-#define gvt_aperture_pa_base(gvt) (gvt->dev_priv->ggtt.mappable_base)
+#define gvt_aperture_pa_base(gvt) (gvt->dev_priv->ggtt.gmadr.start)
 
 #define gvt_ggtt_gm_sz(gvt)  (gvt->dev_priv->ggtt.base.total)
 #define gvt_ggtt_sz(gvt) \
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 5b1fd5f1defb..54a8fca7e7b2 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -726,7 +726,7 @@ static int i915_kick_out_firmware_fb(struct 
drm_i915_private *dev_priv)
if (!ap)
return -ENOMEM;
 
-   ap->ranges[0].base = ggtt->mappable_base;
+   ap->ranges[0].base = ggtt->gmadr.start;
ap->ranges[0].size = ggtt->mappable_end;
 
primary =
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 80b78fb5daac..ff62e2458dfe 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1099,7 +1099,7 @@ i915_gem_gtt_pread(struct drm_i915_gem_object *obj,
page_base += offset & PAGE_MASK;
}
 
-   if (gtt_user_read(&ggtt->mappable, page_base, page_offset,
+   if (gtt_user_read(&ggtt->iomap, page_base, page_offset,
  user_data, page_length)) {
ret = -EFAULT;
break;
@@ -1307,7 +1307,7 @@ i915_gem_gtt_pwrite_fast(struct drm_i915_gem_object *obj,
 * If the object is non-shmem backed, we retry again with the
 * path that handles page fault.
 */
-   if (ggtt_write(&ggtt->mappable, page_base, page_offset,
+   if (ggtt_write(&ggtt->iomap, page_base, page_offset,
   user_data, page_length)) {
ret = -EFAULT;
break;
@@ -1953,9 +1953,9 @@ int i915_gem_fault(struct vm_fault *vmf)
/* Finally, remap it using the new GTT offset */
ret = remap_io_mapping(area,
   area->vm_start + (vma->ggtt_view.partial.offset 
<< PAGE_SHIFT),
-  (ggtt->mappable_base + vma->node.start) >> 
PAGE_SHIFT,
+  (ggtt->gmadr.start + vma->node.start) >> 
PAGE_SHIFT,
   min_t(u64, vma->size, area->vm_end - 
area->vm_start),
-  &ggtt->mappable);
+  &ggtt->iomap);
if (ret)
goto err_fence;
 
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c 
b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 70ccd63cbf8e..4401068ff468 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1012,7 +1012,7 @@ static void *reloc_iomap(struct drm_i915_gem_object *obj,
offset += page << PAGE_SHIFT;
}
 
-   vaddr = (void __force *)io_mapping_map_atomic_wc(&ggtt->mappable,
+   vaddr = (void __force *)io_mapping_map_atomic_wc(&ggtt->iomap,
 offset);
cache->page = page;
cache->vaddr = (unsigned long)vaddr;
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c 
b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 62dd90e00c3a..09c425e35b56 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -2912,7 +2912,7 @@ void i915_ggtt_cleanup_hw(struct drm_i915_private 
*dev_priv)
mutex_unlock(&dev_priv->drm.struct_mutex);
 

[Intel-gfx] [PATCH 9/9] drm/i915: prefer resource_size_t for everything stolen

2017-12-07 Thread Matthew Auld
Keeps things consistent now that we make use of struct resource. This
should keep us covered in case we ever get huge amounts of stolen
memory.

v2: bunch of missing conversions (Chris)

Signed-off-by: Matthew Auld 
Cc: Joonas Lahtinen 
Cc: Chris Wilson 
Cc: Paulo Zanoni 
Reviewed-by: Chris Wilson 
---
 drivers/char/agp/intel-gtt.c   | 12 +-
 drivers/gpu/drm/i915/i915_debugfs.c|  4 ++--
 drivers/gpu/drm/i915/i915_drv.h| 11 +-
 drivers/gpu/drm/i915/i915_gem_gtt.c| 10 -
 drivers/gpu/drm/i915/i915_gem_gtt.h|  2 +-
 drivers/gpu/drm/i915/i915_gem_stolen.c | 40 +-
 drivers/gpu/drm/i915/intel_pm.c| 10 -
 include/drm/intel-gtt.h|  2 +-
 8 files changed, 46 insertions(+), 45 deletions(-)

diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 050708e4562e..b1c0859ed68b 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -80,7 +80,7 @@ static struct _intel_private {
unsigned int needs_dmar : 1;
phys_addr_t gma_bus_addr;
/*  Size of memory reserved for graphics by the BIOS */
-   unsigned int stolen_size;
+   resource_size_t stolen_size;
/* Total number of gtt entries. */
unsigned int gtt_total_entries;
/* Part of the gtt that is mappable by the cpu, for those chips where
@@ -333,13 +333,13 @@ static void i810_write_entry(dma_addr_t addr, unsigned 
int entry,
writel_relaxed(addr | pte_flags, intel_private.gtt + entry);
 }
 
-static unsigned int intel_gtt_stolen_size(void)
+static resource_size_t intel_gtt_stolen_size(void)
 {
u16 gmch_ctrl;
u8 rdct;
int local = 0;
static const int ddt[4] = { 0, 16, 32, 64 };
-   unsigned int stolen_size = 0;
+   resource_size_t stolen_size = 0;
 
if (INTEL_GTT_GEN == 1)
return 0; /* no stolen mem on i81x */
@@ -417,8 +417,8 @@ static unsigned int intel_gtt_stolen_size(void)
}
 
if (stolen_size > 0) {
-   dev_info(&intel_private.bridge_dev->dev, "detected %dK %s 
memory\n",
-  stolen_size / KB(1), local ? "local" : "stolen");
+   dev_info(&intel_private.bridge_dev->dev, "detected %lluK %s 
memory\n",
+  (u64)stolen_size / KB(1), local ? "local" : "stolen");
} else {
dev_info(&intel_private.bridge_dev->dev,
   "no pre-allocated video memory detected\n");
@@ -1423,7 +1423,7 @@ EXPORT_SYMBOL(intel_gmch_probe);
 
 void intel_gtt_get(u64 *gtt_total,
   phys_addr_t *mappable_base,
-  u64 *mappable_end)
+  resource_size_t *mappable_end)
 {
*gtt_total = intel_private.gtt_total_entries << PAGE_SHIFT;
*mappable_base = intel_private.gma_bus_addr;
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index 28294470ae31..fad4116f61c5 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -522,8 +522,8 @@ static int i915_gem_object_info(struct seq_file *m, void 
*data)
seq_printf(m, "%u display objects (globally pinned), %llu bytes\n",
   dpy_count, dpy_size);
 
-   seq_printf(m, "%llu [%llu] gtt total\n",
-  ggtt->base.total, ggtt->mappable_end);
+   seq_printf(m, "%llu [%pa] gtt total\n",
+  ggtt->base.total, &ggtt->mappable_end);
seq_printf(m, "Supported page sizes: %s\n",
   stringify_page_sizes(INTEL_INFO(dev_priv)->page_sizes,
buf, sizeof(buf)));
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 57bda4a370f6..a08875f25673 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2272,7 +2272,7 @@ struct drm_i915_private {
 * avoid the first page! The upper end of stolen memory is reserved for
 * hardware functions and similarly removed from the accessible range.
 */
-   u32 stolen_usable_size; /* Total size minus reserved ranges */
+   resource_size_t stolen_usable_size; /* Total size minus reserved 
ranges */
 
void __iomem *regs;
 
@@ -3929,12 +3929,13 @@ void i915_gem_stolen_remove_node(struct 
drm_i915_private *dev_priv,
 int i915_gem_init_stolen(struct drm_i915_private *dev_priv);
 void i915_gem_cleanup_stolen(struct drm_device *dev);
 struct drm_i915_gem_object *
-i915_gem_object_create_stolen(struct drm_i915_private *dev_priv, u32 size);
+i915_gem_object_create_stolen(struct drm_i915_private *dev_priv,
+ resource_size_t size);
 struct drm_i915_gem_object *
 i915_gem_object_create_stolen_for_preallocated(struct drm_i915_private 
*dev_priv,
-  u32 stolen_offset,
-  u32 gtt_offset,
-  

[Intel-gfx] [PATCH 2/9] x86/early-quirks: replace the magical increment start values

2017-12-07 Thread Matthew Auld
Replace the magical +2, +9 etc. with +MB, which is far easier to read.

Suggested-by: Ville Syrjälä 
Signed-off-by: Matthew Auld 
Cc: Joonas Lahtinen 
Cc: Ville Syrjälä 
Cc: Chris Wilson 
Cc: Paulo Zanoni 
Cc: Thomas Gleixner 
Cc: Ingo Molnar 
Cc: H. Peter Anvin 
Cc: x...@kernel.org
Cc: linux-ker...@vger.kernel.org
Reviewed-by: Ville Syrjälä 
---
 arch/x86/kernel/early-quirks.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index b5855b00a8cc..ef0f4190f290 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -428,9 +428,9 @@ static resource_size_t __init chv_stolen_size(int num, int 
slot, int func)
if (gms < 0x11)
return gms * MB(32);
else if (gms < 0x17)
-   return (gms - 0x11 + 2) * MB(4);
+   return (gms - 0x11) * MB(4) + MB(8);
else
-   return (gms - 0x17 + 9) * MB(4);
+   return (gms - 0x17) * MB(4) + MB(36);
 }
 
 static resource_size_t __init gen9_stolen_size(int num, int slot, int func)
@@ -446,7 +446,7 @@ static resource_size_t __init gen9_stolen_size(int num, int 
slot, int func)
if (gms < 0xf0)
return gms * MB(32);
else
-   return (gms - 0xf0 + 1) * MB(4);
+   return (gms - 0xf0) * MB(4) + MB(4);
 }
 
 struct intel_early_ops {
-- 
2.14.3

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 1/9] x86/early-quirks: Extend Intel graphics stolen memory placement to 64bit

2017-12-07 Thread Matthew Auld
From: Joonas Lahtinen 

To give upcoming SKU BIOSes more flexibility in placing the Intel
graphics stolen memory, make all variables storing the placement or size
compatible with full 64 bit range. Also by exporting the stolen region
as a resource, we can then nuke the duplicated stolen discovery in i915.

v2: export the stolen region as a resource
fix u16 << 16 (Chris)
v3: actually fix u16 << 16

Signed-off-by: Joonas Lahtinen 
Signed-off-by: Matthew Auld 
Cc: Joonas Lahtinen 
Cc: Ville Syrjälä 
Cc: Chris Wilson 
Cc: Paulo Zanoni 
Cc: Thomas Gleixner 
Cc: Ingo Molnar 
Cc: H. Peter Anvin 
Cc: x...@kernel.org
Cc: linux-ker...@vger.kernel.org
Reviewed-by: Chris Wilson 
---
 arch/x86/kernel/early-quirks.c | 86 +++---
 include/drm/i915_drm.h |  3 ++
 2 files changed, 50 insertions(+), 39 deletions(-)

diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 1e82f787c160..b5855b00a8cc 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -243,7 +243,7 @@ static void __init intel_remapping_check(int num, int slot, 
int func)
 #define KB(x)  ((x) * 1024UL)
 #define MB(x)  (KB (KB (x)))
 
-static size_t __init i830_tseg_size(void)
+static resource_size_t __init i830_tseg_size(void)
 {
u8 esmramc = read_pci_config_byte(0, 0, 0, I830_ESMRAMC);
 
@@ -256,7 +256,7 @@ static size_t __init i830_tseg_size(void)
return KB(512);
 }
 
-static size_t __init i845_tseg_size(void)
+static resource_size_t __init i845_tseg_size(void)
 {
u8 esmramc = read_pci_config_byte(0, 0, 0, I845_ESMRAMC);
u8 tseg_size = esmramc & I845_TSEG_SIZE_MASK;
@@ -273,7 +273,7 @@ static size_t __init i845_tseg_size(void)
return 0;
 }
 
-static size_t __init i85x_tseg_size(void)
+static resource_size_t __init i85x_tseg_size(void)
 {
u8 esmramc = read_pci_config_byte(0, 0, 0, I85X_ESMRAMC);
 
@@ -283,12 +283,12 @@ static size_t __init i85x_tseg_size(void)
return MB(1);
 }
 
-static size_t __init i830_mem_size(void)
+static resource_size_t __init i830_mem_size(void)
 {
return read_pci_config_byte(0, 0, 0, I830_DRB3) * MB(32);
 }
 
-static size_t __init i85x_mem_size(void)
+static resource_size_t __init i85x_mem_size(void)
 {
return read_pci_config_byte(0, 0, 1, I85X_DRB3) * MB(32);
 }
@@ -297,36 +297,36 @@ static size_t __init i85x_mem_size(void)
  * On 830/845/85x the stolen memory base isn't available in any
  * register. We need to calculate it as TOM-TSEG_SIZE-stolen_size.
  */
-static phys_addr_t __init i830_stolen_base(int num, int slot, int func,
-  size_t stolen_size)
+static resource_size_t __init i830_stolen_base(int num, int slot, int func,
+  resource_size_t stolen_size)
 {
-   return (phys_addr_t)i830_mem_size() - i830_tseg_size() - stolen_size;
+   return i830_mem_size() - i830_tseg_size() - stolen_size;
 }
 
-static phys_addr_t __init i845_stolen_base(int num, int slot, int func,
-  size_t stolen_size)
+static resource_size_t __init i845_stolen_base(int num, int slot, int func,
+  resource_size_t stolen_size)
 {
-   return (phys_addr_t)i830_mem_size() - i845_tseg_size() - stolen_size;
+   return i830_mem_size() - i845_tseg_size() - stolen_size;
 }
 
-static phys_addr_t __init i85x_stolen_base(int num, int slot, int func,
-  size_t stolen_size)
+static resource_size_t __init i85x_stolen_base(int num, int slot, int func,
+  resource_size_t stolen_size)
 {
-   return (phys_addr_t)i85x_mem_size() - i85x_tseg_size() - stolen_size;
+   return i85x_mem_size() - i85x_tseg_size() - stolen_size;
 }
 
-static phys_addr_t __init i865_stolen_base(int num, int slot, int func,
-  size_t stolen_size)
+static resource_size_t __init i865_stolen_base(int num, int slot, int func,
+  resource_size_t stolen_size)
 {
u16 toud = 0;
 
toud = read_pci_config_16(0, 0, 0, I865_TOUD);
 
-   return (phys_addr_t)(toud << 16) + i845_tseg_size();
+   return toud * KB(64) + i845_tseg_size();
 }
 
-static phys_addr_t __init gen3_stolen_base(int num, int slot, int func,
-  size_t stolen_size)
+static resource_size_t __init gen3_stolen_base(int num, int slot, int func,
+  resource_size_t stolen_size)
 {
u32 bsm;
 
@@ -337,10 +337,10 @@ static phys_addr_t __init gen3_stolen_base(int num, int 
slot, int func,
 */
bsm = read_pci_config(num, slot, func, INTEL_BSM);
 
-   return (phys_addr_t)bsm & INTEL_BSM_MASK;
+   return bsm & INTEL_BSM_MASK;
 }
 
-static size_t __init i830_stolen_size(int num, int slot, in

[Intel-gfx] [PATCH 4/9] drm/i915: nuke the duplicated stolen discovery

2017-12-07 Thread Matthew Auld
We duplicate the stolen discovery code in early-quirks and in i915,
however now that the stolen region is exported as a resource from
early-quirks we can nuke the duplication.

v2: check overflows_type

Signed-off-by: Matthew Auld 
Cc: Joonas Lahtinen 
Cc: Chris Wilson 
Cc: Paulo Zanoni 
Reviewed-by: Chris Wilson 
---
 drivers/gpu/drm/i915/i915_gem_gtt.c|  51 +--
 drivers/gpu/drm/i915/i915_gem_stolen.c | 109 +
 2 files changed, 5 insertions(+), 155 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c 
b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 209bb111f652..036a79fe252d 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -2949,50 +2949,6 @@ static unsigned int chv_get_total_gtt_size(u16 gmch_ctrl)
return 0;
 }
 
-static size_t gen6_get_stolen_size(u16 snb_gmch_ctl)
-{
-   snb_gmch_ctl >>= SNB_GMCH_GMS_SHIFT;
-   snb_gmch_ctl &= SNB_GMCH_GMS_MASK;
-   return (size_t)snb_gmch_ctl << 25; /* 32 MB units */
-}
-
-static size_t gen8_get_stolen_size(u16 bdw_gmch_ctl)
-{
-   bdw_gmch_ctl >>= BDW_GMCH_GMS_SHIFT;
-   bdw_gmch_ctl &= BDW_GMCH_GMS_MASK;
-   return (size_t)bdw_gmch_ctl << 25; /* 32 MB units */
-}
-
-static size_t chv_get_stolen_size(u16 gmch_ctrl)
-{
-   gmch_ctrl >>= SNB_GMCH_GMS_SHIFT;
-   gmch_ctrl &= SNB_GMCH_GMS_MASK;
-
-   /*
-* 0x0  to 0x10: 32MB increments starting at 0MB
-* 0x11 to 0x16: 4MB increments starting at 8MB
-* 0x17 to 0x1d: 4MB increments start at 36MB
-*/
-   if (gmch_ctrl < 0x11)
-   return (size_t)gmch_ctrl << 25;
-   else if (gmch_ctrl < 0x17)
-   return (size_t)(gmch_ctrl - 0x11 + 2) << 22;
-   else
-   return (size_t)(gmch_ctrl - 0x17 + 9) << 22;
-}
-
-static size_t gen9_get_stolen_size(u16 gen9_gmch_ctl)
-{
-   gen9_gmch_ctl >>= BDW_GMCH_GMS_SHIFT;
-   gen9_gmch_ctl &= BDW_GMCH_GMS_MASK;
-
-   if (gen9_gmch_ctl < 0xf0)
-   return (size_t)gen9_gmch_ctl << 25; /* 32 MB units */
-   else
-   /* 4MB increments starting at 0xf0 for 4MB */
-   return (size_t)(gen9_gmch_ctl - 0xf0 + 1) << 22;
-}
-
 static int ggtt_probe_common(struct i915_ggtt *ggtt, u64 size)
 {
struct drm_i915_private *dev_priv = ggtt->base.i915;
@@ -3343,14 +3299,13 @@ static int gen8_gmch_probe(struct i915_ggtt *ggtt)
 
pci_read_config_word(pdev, SNB_GMCH_CTRL, &snb_gmch_ctl);
 
+   ggtt->stolen_size = resource_size(&intel_graphics_stolen_res);
+
if (INTEL_GEN(dev_priv) >= 9) {
-   ggtt->stolen_size = gen9_get_stolen_size(snb_gmch_ctl);
size = gen8_get_total_gtt_size(snb_gmch_ctl);
} else if (IS_CHERRYVIEW(dev_priv)) {
-   ggtt->stolen_size = chv_get_stolen_size(snb_gmch_ctl);
size = chv_get_total_gtt_size(snb_gmch_ctl);
} else {
-   ggtt->stolen_size = gen8_get_stolen_size(snb_gmch_ctl);
size = gen8_get_total_gtt_size(snb_gmch_ctl);
}
 
@@ -3408,7 +3363,7 @@ static int gen6_gmch_probe(struct i915_ggtt *ggtt)
DRM_ERROR("Can't set DMA mask/consistent mask (%d)\n", err);
pci_read_config_word(pdev, SNB_GMCH_CTRL, &snb_gmch_ctl);
 
-   ggtt->stolen_size = gen6_get_stolen_size(snb_gmch_ctl);
+   ggtt->stolen_size = resource_size(&intel_graphics_stolen_res);
 
size = gen6_get_total_gtt_size(snb_gmch_ctl);
ggtt->base.total = (size / sizeof(gen6_pte_t)) << PAGE_SHIFT;
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c 
b/drivers/gpu/drm/i915/i915_gem_stolen.c
index 1877ae9a1d9b..f8ac1438c35d 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -30,9 +30,6 @@
 #include 
 #include "i915_drv.h"
 
-#define KB(x) ((x) * 1024)
-#define MB(x) (KB(x) * 1024)
-
 /*
  * The BIOS typically reserves some of the system's memory for the exclusive
  * use of the integrated graphics. This memory is no longer available for
@@ -81,113 +78,11 @@ void i915_gem_stolen_remove_node(struct drm_i915_private 
*dev_priv,
 
 static dma_addr_t i915_stolen_to_dma(struct drm_i915_private *dev_priv)
 {
-   struct pci_dev *pdev = dev_priv->drm.pdev;
struct i915_ggtt *ggtt = &dev_priv->ggtt;
+   dma_addr_t base = intel_graphics_stolen_res.start;
struct resource *r;
-   dma_addr_t base;
-
-   /* Almost universally we can find the Graphics Base of Stolen Memory
-* at register BSM (0x5c) in the igfx configuration space. On a few
-* (desktop) machines this is also mirrored in the bridge device at
-* different locations, or in the MCHBAR.
-*
-* On 865 we just check the TOUD register.
-*
-* On 830/845/85x the stolen memory base isn't available in any
-* register. We need to calculate it as TOM-TSEG_SIZE-stolen_size.
-*
-*/
-   base = 0;
-   i

[Intel-gfx] [PATCH 5/9] drm/i915: make dsm struct resource centric

2017-12-07 Thread Matthew Auld
Now that we are using struct resource to track the stolen region, it is
more convenient if we track dsm in a resource as well.

v2: check range_overflow when writing to 32b registers (Chris)
pepper in some comments (Chris)
v3: refit i915_stolen_to_dma()
v4: kill ggtt->stolen_size
v5: some more polish

Signed-off-by: Matthew Auld 
Cc: Joonas Lahtinen 
Cc: Chris Wilson 
Cc: Paulo Zanoni 
Reviewed-by: Chris Wilson 
---
 drivers/char/agp/intel-gtt.c   |   2 -
 drivers/gpu/drm/i915/i915_drv.h|  12 +++-
 drivers/gpu/drm/i915/i915_gem_gtt.c|   8 +--
 drivers/gpu/drm/i915/i915_gem_gtt.h|   1 -
 drivers/gpu/drm/i915/i915_gem_stolen.c | 122 +++--
 drivers/gpu/drm/i915/intel_fbc.c   |  13 ++--
 drivers/gpu/drm/i915/intel_pm.c|  15 ++--
 include/drm/intel-gtt.h|   1 -
 8 files changed, 85 insertions(+), 89 deletions(-)

diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 9b6b6023193b..050708e4562e 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -1422,12 +1422,10 @@ int intel_gmch_probe(struct pci_dev *bridge_pdev, 
struct pci_dev *gpu_pdev,
 EXPORT_SYMBOL(intel_gmch_probe);
 
 void intel_gtt_get(u64 *gtt_total,
-  u32 *stolen_size,
   phys_addr_t *mappable_base,
   u64 *mappable_end)
 {
*gtt_total = intel_private.gtt_total_entries << PAGE_SHIFT;
-   *stolen_size = intel_private.stolen_size;
*mappable_base = intel_private.gma_bus_addr;
*mappable_end = intel_private.gtt_mappable_entries << PAGE_SHIFT;
 }
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 02551c781f0a..e88fab552278 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1537,9 +1537,6 @@ struct i915_gem_mm {
 */
struct pagevec wc_stash;
 
-   /** Usable portion of the GTT for GEM */
-   dma_addr_t stolen_base; /* limited to low memory (32-bit) */
-
/**
 * tmpfs instance used for shmem backed objects
 */
@@ -2253,6 +2250,15 @@ struct drm_i915_private {
 
const struct intel_device_info info;
 
+   /**
+* Data Stolen Memory - aka "i915 stolen memory" gives us the start and
+* end of stolen which we can optionally use to create GEM objects
+* backed by stolen memory. Note that ggtt->stolen_usable_size tells us
+* exactly how much of this we are actually allowed to use, given that
+* some portion of it is in fact reserved for use by hardware functions.
+*/
+   struct resource dsm;
+
void __iomem *regs;
 
struct intel_uncore uncore;
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c 
b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 036a79fe252d..62dd90e00c3a 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3299,8 +3299,6 @@ static int gen8_gmch_probe(struct i915_ggtt *ggtt)
 
pci_read_config_word(pdev, SNB_GMCH_CTRL, &snb_gmch_ctl);
 
-   ggtt->stolen_size = resource_size(&intel_graphics_stolen_res);
-
if (INTEL_GEN(dev_priv) >= 9) {
size = gen8_get_total_gtt_size(snb_gmch_ctl);
} else if (IS_CHERRYVIEW(dev_priv)) {
@@ -3363,8 +3361,6 @@ static int gen6_gmch_probe(struct i915_ggtt *ggtt)
DRM_ERROR("Can't set DMA mask/consistent mask (%d)\n", err);
pci_read_config_word(pdev, SNB_GMCH_CTRL, &snb_gmch_ctl);
 
-   ggtt->stolen_size = resource_size(&intel_graphics_stolen_res);
-
size = gen6_get_total_gtt_size(snb_gmch_ctl);
ggtt->base.total = (size / sizeof(gen6_pte_t)) << PAGE_SHIFT;
 
@@ -3410,7 +3406,6 @@ static int i915_gmch_probe(struct i915_ggtt *ggtt)
}
 
intel_gtt_get(&ggtt->base.total,
- &ggtt->stolen_size,
  &ggtt->mappable_base,
  &ggtt->mappable_end);
 
@@ -3482,7 +3477,8 @@ int i915_ggtt_probe_hw(struct drm_i915_private *dev_priv)
DRM_INFO("Memory usable by graphics device = %lluM\n",
 ggtt->base.total >> 20);
DRM_DEBUG_DRIVER("GMADR size = %lldM\n", ggtt->mappable_end >> 20);
-   DRM_DEBUG_DRIVER("GTT stolen size = %uM\n", ggtt->stolen_size >> 20);
+   DRM_DEBUG_DRIVER("GTT stolen size = %lluM\n",
+(u64)resource_size(&intel_graphics_stolen_res) >> 20);
if (intel_vtd_active())
DRM_INFO("VT-d active for gfx access\n");
 
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h 
b/drivers/gpu/drm/i915/i915_gem_gtt.h
index 93211a96fdad..30a2920b1291 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.h
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
@@ -381,7 +381,6 @@ struct i915_ggtt {
 * avoid the first page! The upper end of stolen memory is reserved for
 * hardware functions and similarly removed from the accessible range.
 */
-   u32 stolen_size; 

[Intel-gfx] [PATCH 3/9] x86/early-quirks: reverse the if ladders

2017-12-07 Thread Matthew Auld
Makes things a little easier to follow.

Suggested-by: Ville Syrjälä 
Signed-off-by: Matthew Auld 
Cc: Joonas Lahtinen 
Cc: Ville Syrjälä 
Cc: Chris Wilson 
Cc: Paulo Zanoni 
Cc: Thomas Gleixner 
Cc: Ingo Molnar 
Cc: H. Peter Anvin 
Cc: x...@kernel.org
Cc: linux-ker...@vger.kernel.org
Reviewed-by: Ville Syrjälä 
---
 arch/x86/kernel/early-quirks.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index ef0f4190f290..f5083d82b67b 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -425,12 +425,12 @@ static resource_size_t __init chv_stolen_size(int num, 
int slot, int func)
 * 0x11 to 0x16: 4MB increments starting at 8MB
 * 0x17 to 0x1d: 4MB increments start at 36MB
 */
-   if (gms < 0x11)
-   return gms * MB(32);
-   else if (gms < 0x17)
+   if (gms >= 0x17)
+   return (gms - 0x17) * MB(4) + MB(36);
+   else if (gms >= 0x11)
return (gms - 0x11) * MB(4) + MB(8);
else
-   return (gms - 0x17) * MB(4) + MB(36);
+   return gms * MB(32);
 }
 
 static resource_size_t __init gen9_stolen_size(int num, int slot, int func)
@@ -443,10 +443,10 @@ static resource_size_t __init gen9_stolen_size(int num, 
int slot, int func)
 
/* 0x0  to 0xef: 32MB increments starting at 0MB */
/* 0xf0 to 0xfe: 4MB increments starting at 4MB */
-   if (gms < 0xf0)
-   return gms * MB(32);
-   else
+   if (gms >= 0xf0)
return (gms - 0xf0) * MB(4) + MB(4);
+   else
+   return gms * MB(32);
 }
 
 struct intel_early_ops {
-- 
2.14.3

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 6/9] drm/i915: make reserved struct resource centric

2017-12-07 Thread Matthew Auld
Now that we are using struct resource to track the stolen region, it is
more convenient if we track the reserved portion of that region in a
resource as well.

v2: s/<= end + 1/< end/ (Chris)
v3: prefer DEFINE_RES_MEM

Signed-off-by: Matthew Auld 
Cc: Joonas Lahtinen 
Cc: Chris Wilson 
Cc: Paulo Zanoni 
Reviewed-by: Chris Wilson 
---
 drivers/gpu/drm/i915/i915_drv.h|  4 
 drivers/gpu/drm/i915/i915_gem_gtt.h|  2 --
 drivers/gpu/drm/i915/i915_gem_stolen.c | 14 ++
 drivers/gpu/drm/i915/intel_pm.c|  6 ++
 4 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index e88fab552278..40171a7da9d9 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2258,6 +2258,10 @@ struct drm_i915_private {
 * some portion of it is in fact reserved for use by hardware functions.
 */
struct resource dsm;
+   /**
+* Reseved portion of Data Stolen Memory
+*/
+   struct resource dsm_reserved;
 
void __iomem *regs;
 
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h 
b/drivers/gpu/drm/i915/i915_gem_gtt.h
index 30a2920b1291..db20c72ecfc8 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.h
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
@@ -382,8 +382,6 @@ struct i915_ggtt {
 * hardware functions and similarly removed from the accessible range.
 */
u32 stolen_usable_size; /* Total size minus reserved ranges */
-   u32 stolen_reserved_base;
-   u32 stolen_reserved_size;
 
/** "Graphics Stolen Memory" holds the global PTEs */
void __iomem *gsm;
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c 
b/drivers/gpu/drm/i915/i915_gem_stolen.c
index f4824218e40d..1c0d76f73363 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -389,17 +389,15 @@ int i915_gem_init_stolen(struct drm_i915_private 
*dev_priv)
reserved_base = stolen_top;
}
 
-   if (reserved_base < dev_priv->dsm.start ||
-   reserved_base + reserved_size > stolen_top) {
-   dma_addr_t reserved_top = reserved_base + reserved_size;
-   DRM_ERROR("Stolen reserved area [%pad - %pad] outside stolen 
memory %pR\n",
- &reserved_base, &reserved_top, &dev_priv->dsm);
+   dev_priv->dsm_reserved =
+   (struct resource) DEFINE_RES_MEM(reserved_base, reserved_size);
+
+   if (!resource_contains(&dev_priv->dsm, &dev_priv->dsm_reserved)) {
+   DRM_ERROR("Stolen reserved area %pR outside stolen memory 
%pR\n",
+ &dev_priv->dsm_reserved, &dev_priv->dsm);
return 0;
}
 
-   ggtt->stolen_reserved_base = reserved_base;
-   ggtt->stolen_reserved_size = reserved_size;
-
/* It is possible for the reserved area to end before the end of stolen
 * memory, so just consider the start. */
reserved_total = stolen_top - reserved_base;
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 79b3fd617de0..57dcf8e1ff30 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -6416,7 +6416,6 @@ static void valleyview_disable_rps(struct 
drm_i915_private *dev_priv)
 
 static bool bxt_check_bios_rc6_setup(struct drm_i915_private *dev_priv)
 {
-   struct i915_ggtt *ggtt = &dev_priv->ggtt;
bool enable_rc6 = true;
unsigned long rc6_ctx_base;
u32 rc_ctl;
@@ -6441,9 +6440,8 @@ static bool bxt_check_bios_rc6_setup(struct 
drm_i915_private *dev_priv)
 * for this check.
 */
rc6_ctx_base = I915_READ(RC6_CTX_BASE) & RC6_CTX_BASE_MASK;
-   if (!((rc6_ctx_base >= ggtt->stolen_reserved_base) &&
- (rc6_ctx_base + PAGE_SIZE <= ggtt->stolen_reserved_base +
-   ggtt->stolen_reserved_size))) {
+   if (!((rc6_ctx_base >= dev_priv->dsm_reserved.start) &&
+ (rc6_ctx_base + PAGE_SIZE < dev_priv->dsm_reserved.end))) {
DRM_DEBUG_DRIVER("RC6 Base address not as expected.\n");
enable_rc6 = false;
}
-- 
2.14.3

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 8/9] drm/i915: give stolen_usable_size a more suitable home

2017-12-07 Thread Matthew Auld
Kick it out of i915_ggtt and keep it grouped with dsm and dsm_reserved,
where it makes the most sense.

Signed-off-by: Matthew Auld 
Cc: Joonas Lahtinen 
Cc: Chris Wilson 
Cc: Paulo Zanoni 
Reviewed-by: Chris Wilson 
---
 drivers/gpu/drm/i915/i915_drv.h| 13 -
 drivers/gpu/drm/i915/i915_gem_gtt.h| 10 --
 drivers/gpu/drm/i915/i915_gem_stolen.c |  5 ++---
 drivers/gpu/drm/i915/intel_display.c   |  3 +--
 drivers/gpu/drm/i915/intel_fbdev.c |  3 +--
 5 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 40171a7da9d9..57bda4a370f6 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2253,7 +2253,7 @@ struct drm_i915_private {
/**
 * Data Stolen Memory - aka "i915 stolen memory" gives us the start and
 * end of stolen which we can optionally use to create GEM objects
-* backed by stolen memory. Note that ggtt->stolen_usable_size tells us
+* backed by stolen memory. Note that stolen_usable_size tells us
 * exactly how much of this we are actually allowed to use, given that
 * some portion of it is in fact reserved for use by hardware functions.
 */
@@ -2263,6 +2263,17 @@ struct drm_i915_private {
 */
struct resource dsm_reserved;
 
+   /*
+* Stolen memory is segmented in hardware with different portions
+* offlimits to certain functions.
+*
+* The drm_mm is initialised to the total accessible range, as found
+* from the PCI config. On Broadwell+, this is further restricted to
+* avoid the first page! The upper end of stolen memory is reserved for
+* hardware functions and similarly removed from the accessible range.
+*/
+   u32 stolen_usable_size; /* Total size minus reserved ranges */
+
void __iomem *regs;
 
struct intel_uncore uncore;
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h 
b/drivers/gpu/drm/i915/i915_gem_gtt.h
index 4a17ce36281a..e5aa07ceb627 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.h
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
@@ -373,16 +373,6 @@ struct i915_ggtt {
struct resource gmadr;  /* GMADR resource */
u64 mappable_end;   /* End offset that we can CPU map */
 
-   /* Stolen memory is segmented in hardware with different portions
-* offlimits to certain functions.
-*
-* The drm_mm is initialised to the total accessible range, as found
-* from the PCI config. On Broadwell+, this is further restricted to
-* avoid the first page! The upper end of stolen memory is reserved for
-* hardware functions and similarly removed from the accessible range.
-*/
-   u32 stolen_usable_size; /* Total size minus reserved ranges */
-
/** "Graphics Stolen Memory" holds the global PTEs */
void __iomem *gsm;
void (*invalidate)(struct drm_i915_private *dev_priv);
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c 
b/drivers/gpu/drm/i915/i915_gem_stolen.c
index 1c0d76f73363..346a1cc7d794 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -320,7 +320,6 @@ static void bdw_get_stolen_reserved(struct drm_i915_private 
*dev_priv,
 
 int i915_gem_init_stolen(struct drm_i915_private *dev_priv)
 {
-   struct i915_ggtt *ggtt = &dev_priv->ggtt;
dma_addr_t reserved_base, stolen_top;
u32 reserved_total, reserved_size;
u32 stolen_usable_start;
@@ -411,12 +410,12 @@ int i915_gem_init_stolen(struct drm_i915_private 
*dev_priv)
if (INTEL_GEN(dev_priv) >= 8)
stolen_usable_start = 4096;
 
-   ggtt->stolen_usable_size =
+   dev_priv->stolen_usable_size =
resource_size(&dev_priv->dsm) - reserved_total - 
stolen_usable_start;
 
/* Basic memrange allocator for stolen space. */
drm_mm_init(&dev_priv->mm.stolen, stolen_usable_start,
-   ggtt->stolen_usable_size);
+   dev_priv->stolen_usable_size);
 
return 0;
 }
diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index 0098738d3740..f1e0e838b2a7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2639,7 +2639,6 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
 {
struct drm_device *dev = crtc->base.dev;
struct drm_i915_private *dev_priv = to_i915(dev);
-   struct i915_ggtt *ggtt = &dev_priv->ggtt;
struct drm_i915_gem_object *obj = NULL;
struct drm_mode_fb_cmd2 mode_cmd = { 0 };
struct drm_framebuffer *fb = &plane_config->fb->base;
@@ -2655,7 +2654,7 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
/* If the FB is too big, just don't use it since fbdev is not very
 * important and we should probably use that space wi

[Intel-gfx] [PATCH i-g-t] tools: Cannonlake port clock programming

2017-12-07 Thread Mika Kahola
Cannonlake port clock programming tests and verifies DPLL legal dividers
P, Q, and K. This tests adds two reference clocks 19.2MHz and 24MHz to
test algorithm's capability to find P, Q, and K dividers as well as DCO
frequency for different symbol clock rates.

The test compares two algorithms, the reference with double precision and
i915 implementation with fixed point precision. In case of a difference in
computation the difference on dividers is printed out to the screen.

Signed-off-by: Mika Kahola 
---
 tools/Makefile.sources|   1 +
 tools/cnl_compute_wrpll.c | 526 ++
 2 files changed, 527 insertions(+)
 create mode 100644 tools/cnl_compute_wrpll.c

diff --git a/tools/Makefile.sources b/tools/Makefile.sources
index c49ab8f..abd23a0 100644
--- a/tools/Makefile.sources
+++ b/tools/Makefile.sources
@@ -2,6 +2,7 @@ noinst_PROGRAMS =   \
hsw_compute_wrpll   \
skl_compute_wrpll   \
skl_ddb_allocation  \
+   cnl_compute_wrpll   \
$(NULL)
 
 tools_prog_lists = \
diff --git a/tools/cnl_compute_wrpll.c b/tools/cnl_compute_wrpll.c
new file mode 100644
index 000..c7b7bd7
--- /dev/null
+++ b/tools/cnl_compute_wrpll.c
@@ -0,0 +1,526 @@
+/*
+ * Copyright © 2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define U32_MAX ((uint32_t)~0ULL)
+#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
+
+static inline uint64_t div_u64(uint64_t dividend, uint32_t divisor)
+{
+   return dividend / divisor;
+}
+
+struct skl_wrpll_params {
+   uint32_t dco_fraction;
+   uint32_t dco_integer;
+   uint32_t qdiv_ratio;
+   uint32_t qdiv_mode;
+   uint32_t kdiv;
+   uint32_t pdiv;
+
+   /* for this test code only */
+   unsigned int ref_clock;
+} __attribute__((packed));
+
+static void dump_params(const char *name, struct skl_wrpll_params *params)
+{
+   printf("%s:\n", name);
+   printf("Pdiv: %d\n", params->pdiv);
+   printf("Qdiv: %d\n", params->qdiv_ratio);
+   printf("Kdiv: %d\n", params->kdiv);
+   printf("qdiv mode: %d\n", params->qdiv_mode);
+   printf("dco integer: %d\n", params->dco_integer);
+   printf("dco fraction: %d\n", params->dco_fraction);
+}
+
+static void compare_params(unsigned int clock,
+  const char *name1, struct skl_wrpll_params *p1,
+  const char *name2, struct skl_wrpll_params *p2)
+{
+   if (memcmp(p1, p2, sizeof(struct skl_wrpll_params)) == 0)
+   return;
+
+   printf("===\n");
+   printf("Difference with clock: %10.6f MHz\n", clock/100.0);
+   printf("Reference clock:   %10.6f MHz\n\n", p1->ref_clock/1000.0);
+   dump_params(name1, p1);
+   printf("\n");
+   dump_params(name2, p2);
+   printf("===\n");
+}
+
+static void cnl_wrpll_params_populate(struct skl_wrpll_params *params,
+ uint32_t dco_freq, uint32_t ref_freq,
+ uint32_t pdiv, uint32_t qdiv,
+ uint32_t kdiv)
+{
+   uint32_t dco;
+
+   params->qdiv_ratio = qdiv;
+   params->qdiv_mode = (qdiv == 1) ? 0 : 1;
+   params->pdiv = pdiv;
+   params->kdiv = kdiv;
+
+   if (kdiv != 2 && qdiv != 1)
+   printf("kdiv != 2 and qdiv != 1\n");
+
+   dco = div_u64((uint64_t)dco_freq << 15, ref_freq);
+
+   params->dco_integer = dco >> 15;
+   params->dco_fraction = dco & 0x7fff;
+}
+
+static void cnl_wrpll_get_multipliers(int bestdiv,
+ int *pdiv,
+ int *qdiv,
+ i

Re: [Intel-gfx] [PATCH igt] igt/perf_pmu: Tweak wait_for_rc6, yet again

2017-12-07 Thread Tvrtko Ursulin


On 07/12/2017 10:35, Chris Wilson wrote:

Quoting Tvrtko Ursulin (2017-12-07 10:25:36)


On 06/12/2017 23:12, Chris Wilson wrote:

Still CI remains obstinate that RC6 is not smoothly incrementing during
the sample period. Tweak the wait_for_rc6() to first wait for the
initial Evaluation Interval before polling.

Signed-off-by: Chris Wilson 
Cc: Tvrtko Ursulin 
---
   tests/perf_pmu.c | 15 +++
   tests/pm_rc6_residency.c | 15 +++
   2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index ff6568221..917832d1b 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -1000,13 +1000,20 @@ static bool wait_for_rc6(int fd)
   struct timespec tv = {};
   uint64_t start, now;
   
- start = pmu_read_single(fd);

+ /* First wait for roughly an RC6 Evaluation Interval */
+ usleep(160 * 1000);
+
+ /* Then poll for RC6 to start ticking */
+ now = pmu_read_single(fd);
   do {
- usleep(50);
+ start = now;
+ usleep(5000);
   now = pmu_read_single(fd);
- } while (start == now && !igt_seconds_elapsed(&tv));
+ if (now - start > 2e6)
+ return true;


What is the thinking behind the 2ms of RC6 after 5ms of sleep criteria?


I was being worried about random fluctuations. The sleep before is
probably good enough, basically I'm guessing at what caused it to fail,
with the starting point being that we declared RC6 active before it was.

2ms was trying to guess at what the granularity of the counter was,
which is ~1us, not 1ms. Respin with 2us instead?


Hard for me to say since after the last patch I expected that once the 
counter is running that it is running. Now I don't know anything any 
longer. :/


No harm in trying since the current version is unreliable..

Reviewed-by: Tvrtko Ursulin 

Regards,

Tvrtko
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.BAT: failure for kthread: finer-grained lockdep/cross-release completion

2017-12-07 Thread Patchwork
== Series Details ==

Series: kthread: finer-grained lockdep/cross-release completion
URL   : https://patchwork.freedesktop.org/series/35022/
State : failure

== Summary ==

Applying: kthread: finer-grained lockdep/cross-release completion
error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M   include/linux/kthread.h
M   kernel/kthread.c
Falling back to patching base and 3-way merge...
Auto-merging kernel/kthread.c
CONFLICT (content): Merge conflict in kernel/kthread.c
Patch failed at 0001 kthread: finer-grained lockdep/cross-release completion
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for make stolen resource centric (rev6)

2017-12-07 Thread Patchwork
== Series Details ==

Series: make stolen resource centric (rev6)
URL   : https://patchwork.freedesktop.org/series/34256/
State : success

== Summary ==

Series 34256v6 make stolen resource centric
https://patchwork.freedesktop.org/api/1.0/series/34256/revisions/6/mbox/

Test debugfs_test:
Subgroup read_all_entries:
dmesg-warn -> DMESG-FAIL (fi-elk-e7500) fdo#103989
Test gem_exec_reloc:
Subgroup basic-cpu-active:
fail   -> PASS   (fi-gdg-551) fdo#102582 +1
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
pass   -> FAIL   (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS   (fi-snb-2520m) fdo#103713
Subgroup suspend-read-crc-pipe-c:
incomplete -> PASS   (fi-bdw-5557u)

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  
time:439s
fi-blb-e6850 total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  
time:384s
fi-bsw-n3050 total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  
time:521s
fi-bwr-2160  total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 
time:280s
fi-bxt-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:504s
fi-bxt-j4205 total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:503s
fi-byt-j1900 total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  
time:486s
fi-byt-n2820 total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:474s
fi-elk-e7500 total:224  pass:163  dwarn:14  dfail:1   fail:0   skip:45 
fi-gdg-551   total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 
time:271s
fi-glk-1 total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  
time:538s
fi-hsw-4770  total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:373s
fi-hsw-4770r total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  
time:267s
fi-ilk-650   total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  
time:392s
fi-ivb-3520m total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:476s
fi-ivb-3770  total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:444s
fi-kbl-7500u total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  
time:486s
fi-kbl-7560u total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  
time:527s
fi-kbl-7567u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:477s
fi-kbl-r total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:532s
fi-pnv-d510  total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  
time:590s
fi-skl-6260u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:452s
fi-skl-6600u total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:545s
fi-skl-6700hqtotal:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:569s
fi-skl-6700k total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  
time:522s
fi-skl-6770hqtotal:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:503s
fi-skl-gvtdvmtotal:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  
time:448s
fi-snb-2520m total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:548s
fi-snb-2600  total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  
time:410s
Blacklisted hosts:
fi-cfl-s2total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:605s
fi-cnl-y total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:627s
fi-glk-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:492s

0ccdc69d613e76310fa66006dc6ba8d3e6b5bb92 drm-tip: 2017y-12m-07d-12h-03m-32s UTC 
integration manifest
99134efef16e drm/i915: prefer resource_size_t for everything stolen
4bcdc20e8d5a drm/i915: give stolen_usable_size a more suitable home
45b330db0f5d drm/i915: make mappable struct resource centric
3702a11e6a90 drm/i915: make reserved struct resource centric
17e2ffbd7fcc drm/i915: make dsm struct resource centric
9ed223783b52 drm/i915: nuke the duplicated stolen discovery
cb2311032d6d x86/early-quirks: reverse the if ladders
8bbc63c057b8 x86/early-quirks: replace the magical increment start values
6a993b617bcd x86/early-quirks: Extend Intel graphics stolen memory placement to 
64bit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7437/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PULL] drm-intel-fixes

2017-12-07 Thread Joonas Lahtinen
Hi Dave,

As previously, the CI is still not very happy for the drm-intel-fixes branch
as we're lacking the temporary lockdep fixes which drm-tip is seeing applied.
Daniel has been pinging to get them going, so let's hope next pull will then
be on a solid CI base.

This round it's a bunch of display fixes (machine hanging or image corrupting)
of which the CNL eDP + HDMI hard hang fix being most notable one, then killing
off i915 lockdep warning and fixing GVT guest pre-emption and killing runtime
warnings.

Regards, Joonas

The following changes since commit ae64f9bd1d3621b5e60d7363bc20afb46aede215:

  Linux 4.15-rc2 (2017-12-03 11:01:47 -0500)

are available in the Git repository at:

  git://anongit.freedesktop.org/drm/drm-intel tags/drm-intel-fixes-2017-12-07

for you to fetch changes up to d85936ab62f902ab84be7a021aa013d4b5dfe292:

  Merge tag 'gvt-fixes-2017-12-06' of https://github.com/intel/gvt-linux into 
drm-intel-fixes (2017-12-07 13:35:33 +0200)


- Fix for fd.o bug #103997 CNL eDP + HDMI causing a machine hard hang (James)
- Fix to allow suspending with a wedged GPU to hopefully unwedge it (Chris)
- Fix for Gen2 vblank timestap/frame counter jumps (Ville)
- Revert of a W/A for enabling FBC on CNL/GLK for certain images
  and sizes (Rodrigo)
- Lockdep fix for i915 userptr code (Chris)

gvt-fixes-2017-12-06

- Fix invalid hw reg read value for vGPU (Xiong)
- Fix qemu warning on PCI ROM bar missing (Changbin)
- Workaround preemption regression (Zhenyu)


Changbin Du (1):
  drm/i915/gvt: Emulate PCI expansion ROM base address register

Chris Wilson (2):
  drm/i915: Skip switch-to-kernel-context on suspend when wedged
  drm/i915: Call i915_gem_init_userptr() before taking struct_mutex

James Ausmus (1):
  drm/i915/cnl: Mask previous DDI - PLL mapping

Joonas Lahtinen (1):
  Merge tag 'gvt-fixes-2017-12-06' of https://github.com/intel/gvt-linux 
into drm-intel-fixes

Radhakrishna Sripada (1):
  Revert "drm/i915: Display WA #1133 WaFbcSkipSegments:cnl, glk"

Ville Syrjälä (1):
  drm/i915: Fix vblank timestamp/frame counter jumps on gen2

Xiong Zhang (1):
  drm/i915/gvt: Limit read hw reg to active vgpu

Zhenyu Wang (2):
  drm/i915/gvt: Don't mark vgpu context as inactive when preempted
  drm/i915/gvt: set max priority for gvt context

Zhi Wang (1):
  drm/i915/gvt: Export intel_gvt_render_mmio_to_ring_id()

 drivers/gpu/drm/i915/gvt/cfg_space.c | 21 +++
 drivers/gpu/drm/i915/gvt/handlers.c  | 47 ++---
 drivers/gpu/drm/i915/gvt/mmio.h  |  2 ++
 drivers/gpu/drm/i915/gvt/scheduler.c | 22 +++-
 drivers/gpu/drm/i915/i915_gem.c  | 31 +++---
 drivers/gpu/drm/i915/i915_reg.h  |  3 ---
 drivers/gpu/drm/i915/intel_ddi.c |  1 +
 drivers/gpu/drm/i915/intel_display.c | 51 +---
 drivers/gpu/drm/i915/intel_pm.c  | 13 -
 9 files changed, 133 insertions(+), 58 deletions(-)
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: Increase max texture to 16k for gen9+

2017-12-07 Thread Joonas Lahtinen
+ Ville as Jani is OoO

On Thu, 2017-12-07 at 17:26 +0800, Alex Tu wrote:
> Rrefer to another patch [1] on mesa to extend width/height to 16384.
> For issue :
>  - https://bugs.freedesktop.org/show_bug.cgi?id=102508
>  - LP: #1714178 Triple monitor display failed with Dell Dock (HiDPI)
> 
> [1] https://patchwork.freedesktop.org/patch/124918/
> 
> Signed-off-by: Alex Tu 
> ---
>  drivers/gpu/drm/i915/intel_display.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c 
> b/drivers/gpu/drm/i915/intel_display.c
> index 47a2f6acee50..556fa57b18b8 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13905,7 +13905,7 @@ u32 intel_fb_pitch_limit(struct drm_i915_private 
> *dev_priv,
>   /* "The stride in bytes must not exceed the of the size of 8K
>*  pixels and 32K bytes."
>*/
> - return min(8192 * cpp, 32768);
> + return min(16384 * cpp, 65536);
>   } else if (gen >= 5 && !HAS_GMCH_DISPLAY(dev_priv)) {
>   return 32*1024;
>   } else if (gen >= 4) {
> @@ -14604,8 +14604,8 @@ int intel_modeset_init(struct drm_device *dev)
>   dev->mode_config.max_width = 4096;
>   dev->mode_config.max_height = 4096;
>   } else {
> - dev->mode_config.max_width = 8192;
> - dev->mode_config.max_height = 8192;
> + dev->mode_config.max_width = 16384;
> + dev->mode_config.max_height = 16384;
>   }
>  
>   if (IS_I845G(dev_priv) || IS_I865G(dev_priv)) {
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/2] drm/i915: Remove vma from object on destroy, not close

2017-12-07 Thread Joonas Lahtinen
On Wed, 2017-12-06 at 12:49 +, Chris Wilson wrote:
> Originally we translated from the object to the vma by walking
> obj->vma_list to find the matching vm (for user lookups). Now we process
> user lookups using the rbtree, and we only use obj->vma_list itself for
> maintaining state (e.g. ensuring that all vma are flushed or rebound).
> As such maintenance needs to go on beyond the user's awareness of the
> vma, defer removal of the vma from the obj->vma_list from i915_vma_close()
> to i915_vma_destroy()
> 
> Signed-off-by: Chris Wilson 
> Cc: Joonas Lahtinen 
> Cc: Tvrtko Ursulin 

Reviewed-by: Joonas Lahtinen 

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] lib/draw: Use more typical form for computing swizzle addresses

2017-12-07 Thread Patchwork
== Series Details ==

Series: series starting with [1/2] lib/draw: Use more typical form for 
computing swizzle addresses
URL   : https://patchwork.freedesktop.org/series/35017/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
261ab6bc964081ae62a6084c335033d8a48953fd lib/igt_gt: Add sentinel to 
intel_execution_engines2

with latest DRM-Tip kernel build CI_DRM_3473
0ccdc69d613e drm-tip: 2017y-12m-07d-12h-03m-32s UTC integration manifest

No testlist changes.

Test debugfs_test:
Subgroup read_all_entries:
dmesg-warn -> PASS   (fi-elk-e7500) fdo#103989 +1
Test gem_exec_reloc:
Subgroup basic-cpu-active:
fail   -> PASS   (fi-gdg-551) fdo#102582 +1
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
pass   -> FAIL   (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS   (fi-snb-2520m) fdo#103713
Subgroup suspend-read-crc-pipe-c:
incomplete -> PASS   (fi-bdw-5557u) fdo#104162

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#104162 https://bugs.freedesktop.org/show_bug.cgi?id=104162

fi-bdw-5557u total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  
time:440s
fi-blb-e6850 total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  
time:382s
fi-bsw-n3050 total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  
time:524s
fi-bwr-2160  total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 
time:282s
fi-bxt-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:507s
fi-bxt-j4205 total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:507s
fi-byt-j1900 total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  
time:493s
fi-byt-n2820 total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:483s
fi-elk-e7500 total:224  pass:163  dwarn:15  dfail:0   fail:0   skip:45 
fi-gdg-551   total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 
time:273s
fi-glk-1 total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  
time:542s
fi-hsw-4770  total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:360s
fi-hsw-4770r total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  
time:259s
fi-ilk-650   total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  
time:404s
fi-ivb-3520m total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:485s
fi-ivb-3770  total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:447s
fi-kbl-7500u total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  
time:491s
fi-kbl-7560u total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  
time:527s
fi-kbl-7567u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:477s
fi-kbl-r total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:541s
fi-skl-6260u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:451s
fi-skl-6600u total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:542s
fi-skl-6700hqtotal:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:572s
fi-skl-6700k total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  
time:521s
fi-skl-6770hqtotal:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:509s
fi-skl-gvtdvmtotal:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  
time:447s
fi-snb-2520m total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:551s
fi-snb-2600  total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  
time:424s
Blacklisted hosts:
fi-cfl-s2total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:617s
fi-cnl-y total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:649s
fi-glk-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:492s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_609/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t 6/6] meson: Install .testlist files

2017-12-07 Thread Petri Latvala
Signed-off-by: Petri Latvala 
Cc: Daniel Vetter 
---
 tests/intel-ci/meson.build | 7 +++
 tests/meson.build  | 2 ++
 2 files changed, 9 insertions(+)
 create mode 100644 tests/intel-ci/meson.build

diff --git a/tests/intel-ci/meson.build b/tests/intel-ci/meson.build
new file mode 100644
index ..baad3c7b
--- /dev/null
+++ b/tests/intel-ci/meson.build
@@ -0,0 +1,7 @@
+
+testlist_files = [
+  'fast-feedback.testlist',
+  'meta.testlist',
+]
+
+install_data(sources : testlist_files, install_dir : pkgdatadir)
diff --git a/tests/meson.build b/tests/meson.build
index 1d1cbe3a..4c4bee1d 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -319,3 +319,5 @@ image_files = [
   'pass.png',
 ]
 install_data(sources : image_files, install_dir : pkgdatadir)
+
+subdir('intel-ci')
-- 
2.14.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t 3/3] tests/kms_cursor_legacy: Rework the 2x-*-vs-cursor-* tests.

2017-12-07 Thread Maarten Lankhorst
Using the fancy new DRM_CAP_CRTC_IN_VBLANK_EVENT cap I can finally
make this test the work I originally intended to.

For the !modeset case that means performing a pageflip on both crtc's,
then requeueing as soon as the event is delivered and then check the
vblank counter against the original value, it should be advanced by 1.

The modeset case is slightly more complicated, ideally it's handled
the same, but if we can't perform a modeset and pageflip at the same
time, fall back to queueing both in a single commit, in which case
we can say nothing about the vblank counter.

There is a small race between flip_done and hw_done, so make
flip_nonblocking retry for a second when encountering -EBUSY.

Signed-off-by: Maarten Lankhorst 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101634
---
 tests/kms_cursor_legacy.c | 228 +++---
 1 file changed, 156 insertions(+), 72 deletions(-)

diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index 94d91e9c921a..5011e78e5c2f 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -243,19 +243,27 @@ static enum pipe find_connected_pipe(igt_display_t 
*display, bool second)
return pipe;
 }
 
-static void flip_nonblocking(igt_display_t *display, enum pipe pipe_id, bool 
atomic, struct igt_fb *fb)
+static void flip_nonblocking(igt_display_t *display, enum pipe pipe_id, bool 
atomic, struct igt_fb *fb, void *data)
 {
igt_pipe_t *pipe = &display->pipes[pipe_id];
igt_plane_t *primary = igt_pipe_get_plane_type(pipe, 
DRM_PLANE_TYPE_PRIMARY);
+   int ret;
 
+   igt_set_timeout(1, "Scheduling page flip\n");
if (!atomic) {
/* Schedule a nonblocking flip for the next vblank */
-   do_or_die(drmModePageFlip(display->drm_fd, pipe->crtc_id, 
fb->fb_id,
-   DRM_MODE_PAGE_FLIP_EVENT, fb));
+   do {
+   ret = drmModePageFlip(display->drm_fd, pipe->crtc_id, 
fb->fb_id,
+ DRM_MODE_PAGE_FLIP_EVENT, data);
+   } while (ret == -EBUSY);
} else {
igt_plane_set_fb(primary, fb);
-   igt_display_commit_atomic(display, DRM_MODE_ATOMIC_NONBLOCK | 
DRM_MODE_PAGE_FLIP_EVENT, fb);
+   do {
+   ret = igt_display_try_commit_atomic(display, 
DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_PAGE_FLIP_EVENT, data);
+   } while (ret == -EBUSY);
}
+   igt_assert(!ret);
+   igt_reset_timeout();
 }
 
 enum flip_test {
@@ -424,7 +432,7 @@ static void flip(igt_display_t *display,
 
switch (mode) {
default:
-   flip_nonblocking(display, flip_pipe, mode >= 
flip_test_atomic, &fb_info);
+   flip_nonblocking(display, flip_pipe, mode >= 
flip_test_atomic, &fb_info, NULL);
break;
case flip_test_atomic_transitions:
case flip_test_atomic_transitions_varying_size:
@@ -533,7 +541,7 @@ static void basic_flip_cursor(igt_display_t *display,
case FLIP_BEFORE_CURSOR:
switch (mode) {
default:
-   flip_nonblocking(display, pipe, mode >= 
flip_test_atomic, &fb_info);
+   flip_nonblocking(display, pipe, mode >= 
flip_test_atomic, &fb_info, NULL);
break;
case flip_test_atomic_transitions:
case flip_test_atomic_transitions_varying_size:
@@ -555,7 +563,7 @@ static void basic_flip_cursor(igt_display_t *display,
 
switch (mode) {
default:
-   flip_nonblocking(display, pipe, mode >= 
flip_test_atomic, &fb_info);
+   flip_nonblocking(display, pipe, mode >= 
flip_test_atomic, &fb_info, NULL);
break;
case flip_test_atomic_transitions:
case flip_test_atomic_transitions_varying_size:
@@ -712,7 +720,7 @@ static void flip_vs_cursor(igt_display_t *display, enum 
flip_test mode, int nloo
vblank_start = get_vblank(display->drm_fd, pipe, 
DRM_VBLANK_NEXTONMISS);
switch (mode) {
default:
-   flip_nonblocking(display, pipe, mode >= 
flip_test_atomic, &fb_info);
+   flip_nonblocking(display, pipe, mode >= 
flip_test_atomic, &fb_info, NULL);
break;
case flip_test_atomic_transitions:
case flip_test_atomic_transitions_varying_size:
@@ -843,13 +851,26 @@ static void nonblocking_modeset_vs_cursor(igt_display_t 
*display, int loops)
 
 static void two_screens_flip_vs_cursor(igt_display_t *display, int nloops, 
b

[Intel-gfx] [PATCH i-g-t] tests/kms_color: Rename pipe tests to standard notation

2017-12-07 Thread Maarten Lankhorst
Signed-off-by: Maarten Lankhorst 
---
 tests/kms_color.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index dcda12de3a39..3b0a88802c93 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -855,7 +855,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
data->color_depth = 8;
delta = 1.0 / (1 << data->color_depth);
 
-   igt_subtest_f("ctm-red-to-blue-pipe%d", p) {
+   igt_subtest_f("pipe-%s-ctm-red-to-blue", kmstest_pipe_name(p)) {
color_t blue_green_blue[] = {
{ 0.0, 0.0, 1.0 },
{ 0.0, 1.0, 0.0 },
@@ -868,7 +868,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 blue_green_blue, ctm));
}
 
-   igt_subtest_f("ctm-green-to-red-pipe%d", p) {
+   igt_subtest_f("pipe-%s-ctm-green-to-red", kmstest_pipe_name(p)) {
color_t red_red_blue[] = {
{ 1.0, 0.0, 0.0 },
{ 1.0, 0.0, 0.0 },
@@ -881,7 +881,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 red_red_blue, ctm));
}
 
-   igt_subtest_f("ctm-blue-to-red-pipe%d", p) {
+   igt_subtest_f("pipe-%s-ctm-blue-to-red", kmstest_pipe_name(p)) {
color_t red_green_red[] = {
{ 1.0, 0.0, 0.0 },
{ 0.0, 1.0, 0.0 },
@@ -898,7 +898,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 * the it depends on the hardware we're dealing with, we can
 * either get clamped or rounded values and we also need to
 * account for odd number of items in the LUTs. */
-   igt_subtest_f("ctm-0-25-pipe%d", p) {
+   igt_subtest_f("pipe-%s-ctm-0-25", kmstest_pipe_name(p)) {
color_t expected_colors[] = {
{ 0.0, }, { 0.0, }, { 0.0, }
};
@@ -919,7 +919,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
igt_assert(success);
}
 
-   igt_subtest_f("ctm-0-5-pipe%d", p) {
+   igt_subtest_f("pipe-%s-ctm-0-5", kmstest_pipe_name(p)) {
color_t expected_colors[] = {
{ 0.0, }, { 0.0, }, { 0.0, }
};
@@ -940,7 +940,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
igt_assert(success);
}
 
-   igt_subtest_f("ctm-0-75-pipe%d", p) {
+   igt_subtest_f("pipe-%s-ctm-0-75", kmstest_pipe_name(p)) {
color_t expected_colors[] = {
{ 0.0, }, { 0.0, }, { 0.0, }
};
@@ -961,7 +961,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
igt_assert(success);
}
 
-   igt_subtest_f("ctm-max-pipe%d", p) {
+   igt_subtest_f("pipe-%s-ctm-max", kmstest_pipe_name(p)) {
color_t full_rgb[] = {
{ 1.0, 0.0, 0.0 },
{ 0.0, 1.0, 0.0 },
@@ -979,7 +979,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 full_rgb, ctm));
}
 
-   igt_subtest_f("ctm-negative-pipe%d", p) {
+   igt_subtest_f("pipe-%s-ctm-negative", kmstest_pipe_name(p)) {
color_t all_black[] = {
{ 0.0, 0.0, 0.0 },
{ 0.0, 0.0, 0.0 },
@@ -993,20 +993,20 @@ run_tests_for_pipe(data_t *data, enum pipe p)
}
 
 #if 0
-   igt_subtest_f("ctm-limited-range-pipe%d", p)
+   igt_subtest_f("pipe-%s-ctm-limited-range", kmstest_pipe_name(p))
test_pipe_limited_range_ctm(data, primary);
 #endif
 
-   igt_subtest_f("degamma-pipe%d", p)
+   igt_subtest_f("pipe-%s-degamma", kmstest_pipe_name(p))
test_pipe_degamma(data, primary);
 
-   igt_subtest_f("gamma-pipe%d", p)
+   igt_subtest_f("pipe-%s-gamma", kmstest_pipe_name(p))
test_pipe_gamma(data, primary);
 
-   igt_subtest_f("legacy-gamma-pipe%d", p)
+   igt_subtest_f("pipe-%s-legacy-gamma", kmstest_pipe_name(p))
test_pipe_legacy_gamma(data, primary);
 
-   igt_subtest_f("legacy-gamma-reset-pipe%d", p)
+   igt_subtest_f("pipe-%s-legacy-gamma-reset", kmstest_pipe_name(p))
test_pipe_legacy_gamma_reset(data, primary);
 
igt_fixture {
-- 
2.15.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t 3/6] meson: Install benchmarks to $libexec/intel-gpu-tools/benchmarks

2017-12-07 Thread Petri Latvala
Signed-off-by: Petri Latvala 
Cc: Daniel Vetter 
---
 benchmarks/meson.build | 4 
 1 file changed, 4 insertions(+)

diff --git a/benchmarks/meson.build b/benchmarks/meson.build
index 4afd204f..26d65c4b 100644
--- a/benchmarks/meson.build
+++ b/benchmarks/meson.build
@@ -31,8 +31,12 @@ foreach prog : benchmark_progs
# FIXME meson doesn't like binaries with the same name
# meanwhile just suffix with _bench
executable(prog + '_bench', prog + '.c',
+  install : true,
+  install_dir : join_paths(get_option('libexecdir'), 
'intel-gpu-tools', 'benchmarks'),
   dependencies : test_deps)
 endforeach
 
 executable('gem_wsim_bench', 'gem_wsim.c',
+  install : true,
+  install_dir : join_paths(get_option('libexecdir'), 
'intel-gpu-tools', 'benchmarks'),
   dependencies : test_deps + [ lib_igt_perf ])
-- 
2.14.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t 1/3] lib/igt_kms: Drop all stale events on first commit.

2017-12-07 Thread Maarten Lankhorst
I've been trying to make kms_cursor_legacy work when subtests fail.
Other subtests will start failing too because of expired events or
stale pipe crc. The latter can be resolved in the test, but the former
could affect other tests

Signed-off-by: Maarten Lankhorst 
---
 lib/igt_kms.c | 39 ++-
 lib/igt_kms.h |  1 +
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 223dbe4ca565..9e14f071ea57 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2943,7 +2943,10 @@ display_commit_changed(igt_display_t *display, enum 
igt_commit_style s)
output->changed &= 1 << IGT_CONNECTOR_CRTC_ID;
}
 
-   display->first_commit = false;
+   if (display->first_commit) {
+   igt_display_drop_events(display);
+   display->first_commit = false;
+   }
 }
 
 /*
@@ -3024,6 +3027,10 @@ int igt_display_try_commit_atomic(igt_display_t 
*display, uint32_t flags, void *
if (ret || (flags & DRM_MODE_ATOMIC_TEST_ONLY))
return ret;
 
+   if (display->first_commit)
+   igt_fail_on_f(flags & (DRM_MODE_PAGE_FLIP_EVENT | 
DRM_MODE_ATOMIC_NONBLOCK),
+ "First commit has to drop all stale events\n");
+
display_commit_changed(display, COMMIT_ATOMIC);
 
igt_debug_wait_for_keypress("modeset");
@@ -3121,6 +3128,36 @@ int igt_display_commit(igt_display_t *display)
return igt_display_commit2(display, COMMIT_LEGACY);
 }
 
+/**
+ * igt_display_drop_events:
+ * @display: DRM device handle
+ *
+ * Nonblockingly reads all current events and drops them, for highest
+ * reliablility, call igt_display_commit2() first to flush all outstanding
+ * events.
+ *
+ * This will be called on the first commit after igt_display_reset() too,
+ * to make sure any stale events are flushed.
+ */
+void igt_display_drop_events(igt_display_t *display)
+{
+   /* Clear all events from drm fd. */
+   struct pollfd pfd = {
+   .fd = display->drm_fd,
+   .events = POLLIN
+   };
+
+   while (poll(&pfd, 1, 0) > 0) {
+   struct drm_event ev;
+   char buf[128];
+
+   read(display->drm_fd, &ev, sizeof(ev));
+   igt_info("Dropping event type %u length %u\n", ev.type, 
ev.length);
+   igt_assert(ev.length <= sizeof(buf));
+   read(display->drm_fd, buf, ev.length);
+   }
+}
+
 const char *igt_output_name(igt_output_t *output)
 {
return output->name;
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 2a480bf39956..342881a69177 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -360,6 +360,7 @@ int  igt_display_commit(igt_display_t *display);
 int  igt_display_try_commit_atomic(igt_display_t *display, uint32_t flags, 
void *user_data);
 void igt_display_commit_atomic(igt_display_t *display, uint32_t flags, void 
*user_data);
 int  igt_display_try_commit2(igt_display_t *display, enum igt_commit_style s);
+void igt_display_drop_events(igt_display_t *display);
 int  igt_display_get_n_pipes(igt_display_t *display);
 void igt_display_require_output(igt_display_t *display);
 void igt_display_require_output_on_pipe(igt_display_t *display, enum pipe 
pipe);
-- 
2.15.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t 2/3] tests/kms_cursor_legacy: Perform lazy cleanup between tests

2017-12-07 Thread Maarten Lankhorst
Instead of assuming each subtest cleans up after itself, assume it
fails and doesn't. Now that igt_kms can clean up stale events, we
can just force each subtest to only clean up its framebuffers,
which isn't harmful if it failed.

Signed-off-by: Maarten Lankhorst 
---
 tests/kms_cursor_legacy.c | 88 +++
 1 file changed, 12 insertions(+), 76 deletions(-)

diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index 5720dbef90d3..94d91e9c921a 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -45,6 +45,8 @@
 
 IGT_TEST_DESCRIPTION("Stress legacy cursor ioctl");
 
+igt_pipe_crc_t *pipe_crc;
+
 static void stress(igt_display_t *display,
   enum pipe pipe, int num_children, unsigned mode,
   int timeout)
@@ -203,22 +205,6 @@ static void populate_cursor_args(igt_display_t *display, 
enum pipe pipe,
arg[1] = *arg;
 }
 
-static void do_cleanup_display(igt_display_t *display)
-{
-   enum pipe pipe;
-   igt_output_t *output;
-   igt_plane_t *plane;
-
-   for_each_pipe(display, pipe)
-   for_each_plane_on_pipe(display, pipe, plane)
-   igt_plane_set_fb(plane, NULL);
-
-   for_each_connected_output(display, output)
-   igt_output_set_pipe(output, PIPE_NONE);
-
-   igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : 
COMMIT_LEGACY);
-}
-
 static enum pipe find_connected_pipe(igt_display_t *display, bool second)
 {
enum pipe pipe, first = PIPE_NONE;
@@ -226,6 +212,14 @@ static enum pipe find_connected_pipe(igt_display_t 
*display, bool second)
igt_output_t *first_output = NULL;
bool found = false;
 
+   if (!second) {
+   igt_pipe_crc_free(pipe_crc);
+   pipe_crc = NULL;
+
+   /* Clear display, events will be eaten by commit.. */
+   igt_display_reset(display);
+   }
+
for_each_pipe_with_valid_output(display, pipe, output) {
if (first == pipe || output == first_output)
continue;
@@ -451,8 +445,6 @@ static void flip(igt_display_t *display,
 
munmap(results, 4096);
 
-   do_cleanup_display(display);
-
igt_remove_fb(display->drm_fd, &fb_info);
if (flip_pipe != cursor_pipe)
igt_remove_fb(display->drm_fd, &fb_info2);
@@ -608,7 +600,6 @@ static void basic_flip_cursor(igt_display_t *display,
if (miss1 || miss2)
igt_info("Failed to evade %i vblanks and missed %i page 
flips\n", miss1, miss2);
 
-   do_cleanup_display(display);
igt_remove_fb(display->drm_fd, &fb_info);
igt_remove_fb(display->drm_fd, &cursor_fb);
 
@@ -758,7 +749,6 @@ static void flip_vs_cursor(igt_display_t *display, enum 
flip_test mode, int nloo
sched_setaffinity(0, sizeof(oldmask), &oldmask);
}
 
-   do_cleanup_display(display);
igt_remove_fb(display->drm_fd, &fb_info);
igt_remove_fb(display->drm_fd, &cursor_fb);
 
@@ -768,34 +758,12 @@ static void flip_vs_cursor(igt_display_t *display, enum 
flip_test mode, int nloo
igt_remove_fb(display->drm_fd, &cursor_fb2);
 }
 
-static bool skip_on_unsupported_nonblocking_modeset(igt_display_t *display)
-{
-   enum pipe pipe;
-   int ret;
-
-   igt_display_commit_atomic(display, DRM_MODE_ATOMIC_TEST_ONLY | 
DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
-
-   ret = igt_display_try_commit_atomic(display, 
DRM_MODE_ATOMIC_ALLOW_MODESET | DRM_MODE_ATOMIC_NONBLOCK, NULL);
-
-   if (ret == -EINVAL)
-   return true;
-
-   igt_assert_eq(ret, 0);
-
-   /* Force the next state to update all crtc's, to synchronize with the 
nonblocking modeset. */
-   for_each_pipe(display, pipe)
-   igt_pipe_refresh(display, pipe, false);
-
-   return false;
-}
-
 static void nonblocking_modeset_vs_cursor(igt_display_t *display, int loops)
 {
struct igt_fb fb_info, cursor_fb;
igt_output_t *output;
enum pipe pipe = find_connected_pipe(display, false);
struct drm_mode_cursor arg[2];
-   bool skip_test;
igt_plane_t *cursor = NULL, *plane;
 
igt_require(display->is_atomic);
@@ -815,13 +783,9 @@ static void nonblocking_modeset_vs_cursor(igt_display_t 
*display, int loops)
 
igt_skip_on(!cursor);
 
-   if ((skip_test = skip_on_unsupported_nonblocking_modeset(display)))
-   goto cleanup;
-
/*
-* Start disabled, because skip_on_unsupported_nonblocking_modeset
-* will have enabled this pipe. No way around it, since the first
-* atomic commit may be unreliable with amount of events sent.
+* Start disabled. No way around it, since the first atomic
+* commit may be unreliable with amount of events sent.
 */
igt_output_set_pipe(output, PIPE_NONE);
igt_display_commit2(display, COMMIT_ATOMIC);
@@ -

[Intel-gfx] [PATCH i-g-t 1/6] meson: Don't install headers

2017-12-07 Thread Petri Latvala
Until we can at least check for a matching ABI, the only supported way
of building is having the headers from the source checkout.

Signed-off-by: Petri Latvala 
Cc: Daniel Vetter 
---
 lib/meson.build | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/meson.build b/lib/meson.build
index d06d85b4..a4973180 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -143,8 +143,6 @@ if chamelium.found()
lib_sources += 'igt_chamelium.c'
 endif
 
-install_headers(lib_headers)
-
 pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 
'intel-gpu-tools')
 srcdir = join_paths(meson.source_root(), 'tests')
 
-- 
2.14.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t 5/6] meson: Also install gem_stress.

2017-12-07 Thread Petri Latvala
Signed-off-by: Petri Latvala 
Cc: Daniel Vetter 
---
 tests/meson.build | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/meson.build b/tests/meson.build
index 45517a59..1d1cbe3a 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -293,7 +293,10 @@ foreach prog : test_progs
args : prog)
 endforeach
 
-executable('gem_stress', 'gem_stress.c', dependencies : igt_deps)
+executable('gem_stress', 'gem_stress.c',
+  install : true,
+  install_dir : libexecdir,
+  dependencies : igt_deps)
 
 # IMPORTANT: These tests here are all disabled because the result in sometime
 # unrecoverable gpu hangs. Don't put real testcases here.
-- 
2.14.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t 4/6] meson: Install test-list.txt to libexecdir

2017-12-07 Thread Petri Latvala
Piglit needs test-list.txt to be in the same directory as the test
binaries.

Signed-off-by: Petri Latvala 
Cc: Daniel Vetter 
---
 tests/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/meson.build b/tests/meson.build
index 191ac4ce..45517a59 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -285,7 +285,7 @@ test_list = custom_target('testlist',
  output : 'test-list.txt',
  command : [ gen_testlist, '@OUTPUT@', test_progs ],
  install : true,
- install_dir : pkgdatadir)
+ install_dir : libexecdir)
 
 test_script = find_program('igt_command_line.sh')
 foreach prog : test_progs
-- 
2.14.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t 2/6] meson: Don't install selfcheck binaries

2017-12-07 Thread Petri Latvala
Signed-off-by: Petri Latvala 
Cc: Daniel Vetter 
---
 lib/tests/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/tests/meson.build b/lib/tests/meson.build
index 29bdb2c4..55ab2b3d 100644
--- a/lib/tests/meson.build
+++ b/lib/tests/meson.build
@@ -22,13 +22,13 @@ lib_fail_tests = [
 ]
 
 foreach lib_test : lib_tests
-   exec = executable(lib_test, lib_test + '.c', install : true,
+   exec = executable(lib_test, lib_test + '.c', install : false,
dependencies : igt_deps)
test('lib: ' + lib_test, exec)
 endforeach
 
 foreach lib_test : lib_fail_tests
-   exec = executable(lib_test, lib_test + '.c', install : true,
+   exec = executable(lib_test, lib_test + '.c', install : false,
dependencies : igt_deps)
test('lib: ' + lib_test, exec, should_fail : true)
 endforeach
-- 
2.14.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: Call intel_opregion_notify_encoder in intel_sanitize_encoder

2017-12-07 Thread Ville Syrjälä
On Wed, Dec 06, 2017 at 09:52:51AM +0100, Maarten Lankhorst wrote:
> Op 01-12-17 om 14:32 schreef Ville Syrjälä:
> > On Thu, Nov 30, 2017 at 04:18:53PM +0100, Maarten Lankhorst wrote:
> >> Normally this is called on a modeset, but the call is missing when
> >> we inherit the mode from the BIOS, so make sure it's called somewhere
> >> in hardware readout.
> >>
> >> Signed-off-by: Maarten Lankhorst 
> >> ---
> >>  drivers/gpu/drm/i915/intel_display.c | 2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/i915/intel_display.c 
> >> b/drivers/gpu/drm/i915/intel_display.c
> >> index cd60b4d5cd9d..26edae07e006 100644
> >> --- a/drivers/gpu/drm/i915/intel_display.c
> >> +++ b/drivers/gpu/drm/i915/intel_display.c
> >> @@ -14843,6 +14843,8 @@ static void intel_sanitize_encoder(struct 
> >> intel_encoder *encoder)
> >>  
> >>connector->base.dpms = DRM_MODE_DPMS_OFF;
> >>connector->base.encoder = NULL;
> >> +  } else if (connector) {
> >> +  intel_opregion_notify_encoder(encoder, true);
> >
> > We should probably also do intel_opregion_notify_encoder(encoder, false)
> > when intel_sanitize_encoder() disables the encoder.
> Would it be terrible to always call intel_opregion_notify_encoder, with true 
> or false depending on need?

Sounds like a reasonable approach to me. But it's hard to say what the
correct thing is since this is all some form of BIOS magic.

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 2/2] drm/i915: Track GGTT writes on the vma

2017-12-07 Thread Chris Wilson
Quoting Joonas Lahtinen (2017-12-07 13:42:40)
> On Wed, 2017-12-06 at 12:49 +, Chris Wilson wrote:
> > As writes through the GTT and GGTT PTE updates do not share the same
> > path, they are not strictly ordered and so we must explicitly flush the
> > indirect writes prior to modifying the PTE. We do track outstanding GGTT
> > writes on the object itself, but since the object may have multiple GGTT
> > vma, that is overly coarse as we can track and flush individual vma as
> > required.
> > 
> > Whilst here, update the GGTT flushing behaviour for Cannonlake.
> > 
> > v2: Hard-code ring offset to allow use during unload (after RCS may have
> > been freed, or never existed!)
> > 
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=104002
> > Signed-off-by: Chris Wilson 
> > Cc: Joonas Lahtinen 
> 
> One comment below, not strictly related to this patch.
> 
> Reviewed-by: Joonas Lahtinen 
> 
> Regards, Joonas
> 
> > +static void
> > +flush_write_domain(struct drm_i915_gem_object *obj, unsigned int 
> > flush_domains)
> > +{
> > + struct drm_i915_private *dev_priv = to_i915(obj->base.dev);
> > + struct i915_vma *vma;
> > +
> > + if (!(obj->base.write_domain & flush_domains))
> > + return;
> > +
> >   switch (obj->base.write_domain) {
> >   case I915_GEM_DOMAIN_GTT:
> > - if (!HAS_LLC(dev_priv)) {
> > - intel_runtime_pm_get(dev_priv);
> > - spin_lock_irq(&dev_priv->uncore.lock);
> > - 
> > POSTING_READ_FW(RING_HEAD(dev_priv->engine[RCS]->mmio_base));
> > - spin_unlock_irq(&dev_priv->uncore.lock);
> > - intel_runtime_pm_put(dev_priv);
> > - }
> > + i915_gem_flush_ggtt_writes(dev_priv);
> >  
> >   intel_fb_obj_flush(obj,
> >  fb_write_origin(obj, I915_GEM_DOMAIN_GTT));
> > +
> > + list_for_each_entry(vma, &obj->vma_list, obj_link) {
> > + if (!i915_vma_is_ggtt(vma))
> 
> This pattern could use for_each_ggtt_vma() macro or such.

Ok.

Thanks for the review, my Braswell thanks you, but it should be
reproducible on Broxton+ as well (and presumably Cannonlake+ if QA
reports are to believed). Fortunately, it's such a rare event, requiring
some writes into memory to overtake overs that I doubt anyone but igt
stress tests would notice.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 2/2] drm/i915: Track GGTT writes on the vma

2017-12-07 Thread Joonas Lahtinen
On Wed, 2017-12-06 at 12:49 +, Chris Wilson wrote:
> As writes through the GTT and GGTT PTE updates do not share the same
> path, they are not strictly ordered and so we must explicitly flush the
> indirect writes prior to modifying the PTE. We do track outstanding GGTT
> writes on the object itself, but since the object may have multiple GGTT
> vma, that is overly coarse as we can track and flush individual vma as
> required.
> 
> Whilst here, update the GGTT flushing behaviour for Cannonlake.
> 
> v2: Hard-code ring offset to allow use during unload (after RCS may have
> been freed, or never existed!)
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=104002
> Signed-off-by: Chris Wilson 
> Cc: Joonas Lahtinen 

One comment below, not strictly related to this patch.

Reviewed-by: Joonas Lahtinen 

Regards, Joonas

> +static void
> +flush_write_domain(struct drm_i915_gem_object *obj, unsigned int 
> flush_domains)
> +{
> + struct drm_i915_private *dev_priv = to_i915(obj->base.dev);
> + struct i915_vma *vma;
> +
> + if (!(obj->base.write_domain & flush_domains))
> + return;
> +
>   switch (obj->base.write_domain) {
>   case I915_GEM_DOMAIN_GTT:
> - if (!HAS_LLC(dev_priv)) {
> - intel_runtime_pm_get(dev_priv);
> - spin_lock_irq(&dev_priv->uncore.lock);
> - 
> POSTING_READ_FW(RING_HEAD(dev_priv->engine[RCS]->mmio_base));
> - spin_unlock_irq(&dev_priv->uncore.lock);
> - intel_runtime_pm_put(dev_priv);
> - }
> + i915_gem_flush_ggtt_writes(dev_priv);
>  
>   intel_fb_obj_flush(obj,
>  fb_write_origin(obj, I915_GEM_DOMAIN_GTT));
> +
> + list_for_each_entry(vma, &obj->vma_list, obj_link) {
> + if (!i915_vma_is_ggtt(vma))

This pattern could use for_each_ggtt_vma() macro or such.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 05/10] drm/i915: make dsm struct resource centric

2017-12-07 Thread Ville Syrjälä
On Wed, Dec 06, 2017 at 06:30:33PM +, Chris Wilson wrote:
> Quoting Matthew Auld (2017-12-06 18:17:25)
> > Now that we are using struct resource to track the stolen region, it is
> > more convenient if we track dsm in a resource as well.
> > 
> > v2: check range_overflow when writing to 32b registers (Chris)
> > pepper in some comments (Chris)
> > v3: refit i915_stolen_to_dma()
> > v4: kill ggtt->stolen_size
> > 
> > Signed-off-by: Matthew Auld 
> > Cc: Joonas Lahtinen 
> > Cc: Chris Wilson 
> > Cc: Paulo Zanoni 
> > ---
> > -static dma_addr_t i915_stolen_to_dma(struct drm_i915_private *dev_priv)
> > +static int i915_adjust_stolen(struct drm_i915_private *dev_priv,
> > + struct resource *dsm)
> >  {
> > struct i915_ggtt *ggtt = &dev_priv->ggtt;
> > -   dma_addr_t base = intel_graphics_stolen_res.start;
> > struct resource *r;
> >  
> > -   GEM_BUG_ON(overflows_type(intel_graphics_stolen_res.start, base));
> > +   if (dsm->start == 0 || add_overflows(dsm->start, 
> > resource_size(dsm)))
> 
> Now s/add_overflows/dsm->end <= dsm->start/
> 
> > +   return -EINVAL;
> >  
> > -   if (base == 0 || add_overflows(base, ggtt->stolen_size))
> > -   return 0;
> > -
> > -   /* make sure we don't clobber the GTT if it's within stolen memory 
> > */
> > +   /* Make sure we don't clobber the GTT if it's within stolen memory 
> > */
> > if (INTEL_GEN(dev_priv) <= 4 &&
> > !IS_G33(dev_priv) && !IS_PINEVIEW(dev_priv) && 
> > !IS_G4X(dev_priv)) {
> > -   struct {
> > -   dma_addr_t start, end;
> > -   } stolen[2] = {
> > -   { .start = base, .end = base + ggtt->stolen_size, },
> > -   { .start = base, .end = base + ggtt->stolen_size, },
> > +   struct resource stolen[2] = {
> > +   DEFINE_RES_MEM(dsm->start, resource_size(dsm)),
> > +   DEFINE_RES_MEM(dsm->start, resource_size(dsm)),
> 
> struct resource stolen[2] = { *dsm, *dsm } ?

BTW I don't think I've ever seen a case where the GTT wasn't at the end
of stolen. So we could simplify this code by making that assumption.

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for tests/kms_vblank: Add test to ensure DRM_CAP_CRTC_IN_VBLANK_EVENT works correctly (rev2)

2017-12-07 Thread Patchwork
== Series Details ==

Series: tests/kms_vblank: Add test to ensure DRM_CAP_CRTC_IN_VBLANK_EVENT works 
correctly (rev2)
URL   : https://patchwork.freedesktop.org/series/34299/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
2fc64acf8a4465d5eab3d6cfec9b3c1b5df30d73 igt/perf_pmu: Tweak wait_for_rc6, yet 
again

with latest DRM-Tip kernel build CI_DRM_3473
0ccdc69d613e drm-tip: 2017y-12m-07d-12h-03m-32s UTC integration manifest

Testlist changes:
+igt@kms_vblank@crtc-id

Test debugfs_test:
Subgroup read_all_entries:
dmesg-warn -> DMESG-FAIL (fi-elk-e7500) fdo#103989
Test gem_exec_reloc:
Subgroup basic-cpu-active:
fail   -> PASS   (fi-gdg-551) fdo#102582 +1
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
pass   -> FAIL   (fi-gdg-551) fdo#102575
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-legacy:
pass   -> FAIL   (fi-gdg-551) fdo#102618
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS   (fi-snb-2520m) fdo#103713
Subgroup suspend-read-crc-pipe-c:
incomplete -> PASS   (fi-bdw-5557u) fdo#104162

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#102618 https://bugs.freedesktop.org/show_bug.cgi?id=102618
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#104162 https://bugs.freedesktop.org/show_bug.cgi?id=104162

fi-bdw-5557u total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  
time:441s
fi-blb-e6850 total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  
time:387s
fi-bsw-n3050 total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  
time:524s
fi-bwr-2160  total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 
time:283s
fi-bxt-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:508s
fi-bxt-j4205 total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:512s
fi-byt-j1900 total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  
time:491s
fi-byt-n2820 total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:477s
fi-elk-e7500 total:224  pass:163  dwarn:14  dfail:1   fail:0   skip:45 
fi-gdg-551   total:288  pass:177  dwarn:1   dfail:0   fail:2   skip:108 
time:278s
fi-glk-1 total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  
time:544s
fi-hsw-4770  total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:381s
fi-hsw-4770r total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  
time:261s
fi-ilk-650   total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  
time:394s
fi-ivb-3520m total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:475s
fi-ivb-3770  total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:448s
fi-kbl-7500u total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  
time:496s
fi-kbl-7560u total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  
time:532s
fi-kbl-7567u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:474s
fi-kbl-r total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:536s
fi-pnv-d510  total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  
time:592s
fi-skl-6260u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:450s
fi-skl-6600u total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:539s
fi-skl-6700hqtotal:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:567s
fi-skl-6700k total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  
time:526s
fi-skl-6770hqtotal:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:498s
fi-skl-gvtdvmtotal:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  
time:446s
fi-snb-2520m total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:552s
fi-snb-2600  total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  
time:423s
Blacklisted hosts:
fi-cfl-s2total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:611s
fi-glk-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:491s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_610/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm/i915: add FTRACE dependency for DRM_I915_TRACE_GEM

2017-12-07 Thread Arnd Bergmann
The new trace option gratuitously added a 'select TRACING' statement,
which now causes build failures in other code that assumed tracepoints
were only available with FTRACE:

ERROR: "__tracepoint_ucsi_command" [drivers/usb/typec/ucsi/typec_ucsi.ko] 
undefined!
ERROR: "__tracepoint_ucsi_register_port" [drivers/usb/typec/ucsi/typec_ucsi.ko] 
undefined!
ERROR: "__tracepoint_ucsi_notify" [drivers/usb/typec/ucsi/typec_ucsi.ko] 
undefined!
ERROR: "__tracepoint_ucsi_reset_ppm" [drivers/usb/typec/ucsi/typec_ucsi.ko] 
undefined!
ERROR: "__tracepoint_ucsi_run_command" [drivers/usb/typec/ucsi/typec_ucsi.ko] 
undefined!
drivers/usb/dwc3/gadget.o: In function `__dwc3_prepare_one_trb':
gadget.c:(.text+0x1c5): undefined reference to `__tracepoint_dwc3_prepare_trb'
drivers/usb/dwc3/gadget.o: In function `__dwc3_cleanup_done_trbs':
gadget.c:(.text+0x3f0): undefined reference to `__tracepoint_dwc3_complete_trb'
drivers/usb/dwc3/gadget.o: In function `dwc3_gadget_ep_free_request':
gadget.c:(.text+0x666): undefined reference to `__tracepoint_dwc3_free_request'

This adds an explicit FTRACE dependency here, to ensure this is already
the case. This matches what the other drivers have that select TRACING.

Generally speaking, there is a bigger problem with CONFIG_DRM_I915_DEBUG
though, it selects several other partially related symbols (DEBUGFS,
I2C_CHARDEV, PREEMPT_COUNT, X86_MSR, etc that are each user-visible and
that other symbols in turn depend on. This can easily lead to circular
dependencies and should be avoided. I tried turning those all into
'depends on', which is normally a good strategy, but that seems to
completely defeat the intention of CONFIG_DRM_I915_DEBUG. It might
be better to just remove this completely, possibly replace it with a
Kconfig fragment.

Fixes: bccd3b831185 ("drm/i915: Use trace_printk to provide a death rattle for 
GEM")
Signed-off-by: Arnd Bergmann 
---
 drivers/gpu/drm/i915/Kconfig.debug | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/Kconfig.debug 
b/drivers/gpu/drm/i915/Kconfig.debug
index fa36491495b1..1a1b9732f657 100644
--- a/drivers/gpu/drm/i915/Kconfig.debug
+++ b/drivers/gpu/drm/i915/Kconfig.debug
@@ -18,6 +18,7 @@ config DRM_I915_WERROR
 config DRM_I915_DEBUG
 bool "Enable additional driver debugging"
 depends on DRM_I915
+   depends on FTRACE # for DRM_I915_TRACE_GEM
 select DEBUG_FS
 select PREEMPT_COUNT
 select I2C_CHARDEV
@@ -53,6 +54,7 @@ config DRM_I915_DEBUG_GEM
 
 config DRM_I915_TRACE_GEM
bool "Insert extra ftrace output from the GEM internals"
+   depends on FTRACE
select TRACING
default n
help
-- 
2.9.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v3 04/11] drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()

2017-12-07 Thread Noralf Trønnes


Den 07.12.2017 01.50, skrev Inki Dae:


2017년 12월 06일 03:24에 Noralf Trønnes 이(가) 쓴 글:

This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.

Cc: Inki Dae 
Cc: Joonyoung Shim 
Cc: Seung-Woo Kim 
Cc: Kyungmin Park 
Signed-off-by: Noralf Trønnes 
Acked-by: Daniel Vetter 

Seems you missed my ACK,
http://www.spinics.net/lists/intel-gfx/msg146188.html


Thanks for reminding me.

Noralf.


Thanks,
Inki Dae


---
  drivers/gpu/drm/exynos/exynos_drm_drv.c   |  8 ++--
  drivers/gpu/drm/exynos/exynos_drm_fb.c|  2 +-
  drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 18 --
  drivers/gpu/drm/exynos/exynos_drm_fbdev.h |  2 --
  4 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 82b72425a42f..2f2bd6e37e62 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -16,6 +16,7 @@
  #include 
  #include 
  #include 
+#include 
  
  #include 
  
@@ -89,11 +90,6 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)

file->driver_priv = NULL;
  }
  
-static void exynos_drm_lastclose(struct drm_device *dev)

-{
-   exynos_drm_fbdev_restore_mode(dev);
-}
-
  static const struct vm_operations_struct exynos_drm_gem_vm_ops = {
.fault = exynos_drm_gem_fault,
.open = drm_gem_vm_open,
@@ -140,7 +136,7 @@ static struct drm_driver exynos_drm_driver = {
.driver_features= DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME
  | DRIVER_ATOMIC | DRIVER_RENDER,
.open   = exynos_drm_open,
-   .lastclose  = exynos_drm_lastclose,
+   .lastclose  = drm_fb_helper_lastclose,
.postclose  = exynos_drm_postclose,
.gem_free_object_unlocked = exynos_drm_gem_free_object,
.gem_vm_ops = &exynos_drm_gem_vm_ops,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c 
b/drivers/gpu/drm/exynos/exynos_drm_fb.c
index 8208df56a88f..0faaf829f5bf 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
@@ -205,7 +205,7 @@ static struct drm_mode_config_helper_funcs 
exynos_drm_mode_config_helpers = {
  
  static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = {

.fb_create = exynos_user_fb_create,
-   .output_poll_changed = exynos_drm_output_poll_changed,
+   .output_poll_changed = drm_fb_helper_output_poll_changed,
.atomic_check = exynos_atomic_check,
.atomic_commit = drm_atomic_helper_commit,
  };
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c 
b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index dfb66ecf417b..132dd52d0ac7 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -270,24 +270,6 @@ void exynos_drm_fbdev_fini(struct drm_device *dev)
private->fb_helper = NULL;
  }
  
-void exynos_drm_fbdev_restore_mode(struct drm_device *dev)

-{
-   struct exynos_drm_private *private = dev->dev_private;
-
-   if (!private || !private->fb_helper)
-   return;
-
-   drm_fb_helper_restore_fbdev_mode_unlocked(private->fb_helper);
-}
-
-void exynos_drm_output_poll_changed(struct drm_device *dev)
-{
-   struct exynos_drm_private *private = dev->dev_private;
-   struct drm_fb_helper *fb_helper = private->fb_helper;
-
-   drm_fb_helper_hotplug_event(fb_helper);
-}
-
  void exynos_drm_fbdev_suspend(struct drm_device *dev)
  {
struct exynos_drm_private *private = dev->dev_private;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h 
b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
index 645d1bb7f665..b33847223a85 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
@@ -19,8 +19,6 @@
  
  int exynos_drm_fbdev_init(struct drm_device *dev);

  void exynos_drm_fbdev_fini(struct drm_device *dev);
-void exynos_drm_fbdev_restore_mode(struct drm_device *dev);
-void exynos_drm_output_poll_changed(struct drm_device *dev);
  void exynos_drm_fbdev_suspend(struct drm_device *drm);
  void exynos_drm_fbdev_resume(struct drm_device *drm);
  



___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] intel/atomic: Stop updating legacy fb parameters

2017-12-07 Thread Daniel Vetter
Even fbc isn't using this stuff anymore, so time to remove it.

Cleaning up one small piece of the atomic conversion cruft at the time
...

Quick explanation on why the plane->fb assignment is ok to delete: The
core code takes care of the refcounting and legacy ->fb pointer
updating, but drivers are allowed to update it ahead of time. Most
legacy modeset drivers did that as part of their set_config callback
(since that's how the legacy/crtc helpers worked). In i915 we only
need that to make the fbc code happy.

v2: don't nuke the assignement of intel_crtc->config, I accidentally
set CI ablaze :-) Spotted by Maarten. And better explain why nuking
the ->fb assignement shouldn't set off alarm bells.

Cc: Paulo Zanoni 
Cc: Ville Syrjälä 
Cc: Maarten Lankhorst 
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/intel_display.c | 31 +++
 1 file changed, 3 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index 1f7e312d0d0d..4614c7f1eec5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10967,31 +10967,6 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
return ret;
 }
 
-static void
-intel_modeset_update_crtc_state(struct drm_atomic_state *state)
-{
-   struct drm_crtc *crtc;
-   struct drm_crtc_state *new_crtc_state;
-   int i;
-
-   /* Double check state. */
-   for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
-   to_intel_crtc(crtc)->config = 
to_intel_crtc_state(new_crtc_state);
-
-   /*
-* Update legacy state to satisfy fbc code. This can
-* be removed when fbc uses the atomic state.
-*/
-   if (drm_atomic_get_existing_plane_state(state, crtc->primary)) {
-   struct drm_plane_state *plane_state = 
crtc->primary->state;
-
-   crtc->primary->fb = plane_state->fb;
-   crtc->x = plane_state->src_x >> 16;
-   crtc->y = plane_state->src_y >> 16;
-   }
-   }
-}
-
 static bool intel_fuzzy_clock_check(int clock1, int clock2)
 {
int diff;
@@ -12364,9 +12339,9 @@ static void intel_atomic_commit_tail(struct 
drm_atomic_state *state)
}
}
 
-   /* Only after disabling all output pipelines that will be changed can we
-* update the the output configuration. */
-   intel_modeset_update_crtc_state(state);
+   /* FIXME: Eventually get rid of our intel_crtc->config pointer */
+   for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
+   to_intel_crtc(crtc)->config = 
to_intel_crtc_state(new_crtc_state);
 
if (intel_state->modeset) {
drm_atomic_helper_update_legacy_modeset_state(state->dev, 
state);
-- 
2.15.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm: More debug info for fb leaks in mode_config_cleanup

2017-12-07 Thread Daniel Vetter
We're spotting this very rarely in CI, but have no idea. Let's add
more debug info about what's going on here.

References: https://bugs.freedesktop.org/show_bug.cgi?id=102707
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/drm_mode_config.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_mode_config.c 
b/drivers/gpu/drm/drm_mode_config.c
index cc78b3d9e5e4..6ffe952142e6 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -469,6 +469,9 @@ void drm_mode_config_cleanup(struct drm_device *dev)
 */
WARN_ON(!list_empty(&dev->mode_config.fb_list));
list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
+   struct drm_printer p = drm_debug_printer("[leaked fb]");
+   drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
+   drm_framebuffer_print_info(&p, 1, fb);
drm_framebuffer_free(&fb->base.refcount);
}
 
-- 
2.15.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [RFC PATCH 1/6] drm: Add Content Protection property

2017-12-07 Thread Alan Cox
> If you want to actually lock down a machine to implement content
> protection, then you need secure boot without unlockable boot-loader and a
> pile more bits in userspace. 

So let me take my Intel hat off for a moment.

The upstream policy has always been that we don't merge things which
don't have an open usable user space. Is the HDCP encryption feature
useful on its own ? What do users get from it ?

If this is just an enabler for a lump of binary stuff in ChromeOS then I
don't think it belongs, if it is useful standalone then it seems it does
belong ?

Alan
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [RFC PATCH 1/6] drm: Add Content Protection property

2017-12-07 Thread Alan Cox
> How about for sensitive video streams in government offices where you
> want to avoid a spy potentially tapping the cable to see the video
> stream?

Last time I checked HDCP did not meet government security requirements -
which is hardly surprising since you can buy $10 boxes from China to
de-hdcp video streams 8)

Alan

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] kthread: finer-grained lockdep/cross-release completion

2017-12-07 Thread Daniel Vetter
On Thu, Dec 07, 2017 at 01:22:56PM +0100, Peter Zijlstra wrote:
> On Thu, Dec 07, 2017 at 11:08:49AM +0100, Daniel Vetter wrote:
> > Since -rc1 we're hitting a bunch of lockdep splats using the new
> > cross-release stuff around the 2 kthread completions. In all cases
> > they are because totally independent uses of kthread are mixed up by
> > lockdep into the same locking class, creating artificial deadlocks.
> > 
> > Fix this by converting kthread code in the same way as e.g.
> > alloc_workqueue already works: Use macros for the public api so we can
> > have a callsite specific lockdep key, then pass that through the
> > entire callchain. Due to the many entry points this is slightly
> > tedious.
> 
> Do you have a splat somewhere? I'm having trouble seeing how all this
> comes together. That is, I've no real idea what you're actual problem is
> and if this is the right solution.

The bugzilla link is full of them. One below as example - it ties entirely
unrelated locking chains from i915 memory management together with other
stuff, with the only common bit that the kthread completions are somewhere
in there. But neither can i915 code ever get at the cpu kthread nor the
other way round, so it's flat out impossible to ever hit a deadlock this
way. Same reasons why not all workqueues share their lockdep map either.
-Daniel

[   85.062523] Setting dangerous option reset - tainting kernel
[   85.068934] i915 :00:02.0: Resetting chip after gpu hang

[   85.069408] ==
[   85.069410] WARNING: possible circular locking dependency detected
[   85.069413] 4.15.0-rc1-CI-CI_DRM_3397+ #1 Tainted: G U  
[   85.069415] --
[   85.069417] gem_exec_captur/2810 is trying to acquire lock:
[   85.069419]  ((completion)&self->parked){+.+.}, at: [] 
kthread_park+0x3d/0x50
[   85.069426] 
   but task is already holding lock:
[   85.069428]  (&dev->struct_mutex){+.+.}, at: [] 
i915_reset_device+0x1bd/0x230 [i915]
[   85.069448] 
   which lock already depends on the new lock.

[   85.069451] 
   the existing dependency chain (in reverse order) is:
[   85.069454] 
   -> #3 (&dev->struct_mutex){+.+.}:
[   85.069460]__mutex_lock+0x81/0x9b0
[   85.069481]i915_mutex_lock_interruptible+0x47/0x130 [i915]
[   85.069502]i915_gem_fault+0x201/0x760 [i915]
[   85.069507]__do_fault+0x15/0x70
[   85.069509]__handle_mm_fault+0x7bf/0xda0
[   85.069512]handle_mm_fault+0x14f/0x2f0
[   85.069515]__do_page_fault+0x2d1/0x560
[   85.069518]page_fault+0x22/0x30
[   85.069520] 
   -> #2 (&mm->mmap_sem){}:
[   85.069525]__might_fault+0x63/0x90
[   85.069529]_copy_to_user+0x1e/0x70
[   85.069532]perf_read+0x21d/0x290
[   85.069534]__vfs_read+0x1e/0x120
[   85.069536]vfs_read+0xa1/0x150
[   85.069539]SyS_read+0x40/0xa0
[   85.069541]entry_SYSCALL_64_fastpath+0x1c/0x89
[   85.069543] 
   -> #1 (&cpuctx_mutex){+.+.}:
[   85.069547]perf_event_ctx_lock_nested+0xbc/0x1d0
[   85.069549] 
   -> #0 ((completion)&self->parked){+.+.}:
[   85.069555]lock_acquire+0xaf/0x200
[   85.069558]wait_for_common+0x54/0x210
[   85.069560]kthread_park+0x3d/0x50
[   85.069579]i915_gem_reset_prepare_engine+0x1d/0x90 [i915]
[   85.069600]i915_gem_reset_prepare+0x2c/0x60 [i915]
[   85.069617]i915_reset+0x66/0x230 [i915]
[   85.069635]i915_reset_device+0x1cb/0x230 [i915]
[   85.069651]i915_handle_error+0x2d3/0x430 [i915]
[   85.069670]i915_wedged_set+0x79/0xc0 [i915]
[   85.069673]simple_attr_write+0xab/0xc0
[   85.069677]full_proxy_write+0x4b/0x70
[   85.069679]__vfs_write+0x1e/0x130
[   85.069682]vfs_write+0xc0/0x1b0
[   85.069684]SyS_write+0x40/0xa0
[   85.069686]entry_SYSCALL_64_fastpath+0x1c/0x89
[   85.069688] 
   other info that might help us debug this:

[   85.069692] Chain exists of:
 (completion)&self->parked --> &mm->mmap_sem --> 
&dev->struct_mutex

[   85.069698]  Possible unsafe locking scenario:

[   85.069701]CPU0CPU1
[   85.069703]
[   85.069705]   lock(&dev->struct_mutex);
[   85.069707]lock(&mm->mmap_sem);
[   85.069710]lock(&dev->struct_mutex);
[   85.069713]   lock((completion)&self->parked);
[   85.069715] 
*** DEADLOCK ***

[   85.069718] 3 locks held by gem_exec_captur/2810:
[   85.069722]  #0:  (sb_writers#10){.+.+}, at: [] 
vfs_write+0x15e/0x1b0
[   85.069727]  #1:  (&attr->mutex){+.+.}, at: [] 
simple_attr_write+0x36/0xc0
[   85.069732]  #2:  (&dev->struct_mutex){+.+.}, at: [] 
i915_reset_device+0x1bd/0x230 [i915]
[   85.069751] 
  

Re: [Intel-gfx] [PATCH] Revert "drm/i915: Display WA #1133 WaFbcSkipSegments:cnl, glk"

2017-12-07 Thread Joonas Lahtinen
Hi,

Thanks, this was included in the pull.

One comment below, not strictly related to this patch.

On Wed, 2017-12-06 at 14:25 -0800, Rodrigo Vivi wrote:
> From: Radhakrishna Sripada 
> 
> This reverts commit 8f067837c4b713ce2e69be95af7b2a5eb3bd7de8.
> 
> HSD says "WA withdrawn. It was causing corruption with some images.
> WA is not strictly necessary since this bug just causes loss of FBC
> compression with some sizes and images, but doesn't break anything."
> 
> Fixes: 8f067837c4b7 ("drm/i915: Display WA #1133 WaFbcSkipSegments:cnl, glk")
> Cc: Rodrigo Vivi 
> Signed-off-by: Radhakrishna Sripada 
> Signed-off-by: Rodrigo Vivi 
> Link: 
> https://patchwork.freedesktop.org/patch/msgid/20171117010825.23118-1-radhakrishna.srip...@intel.com
> (cherry picked from commit 0cfecb7c4b9b45ed1776162e132b43f92564f3f4)



> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -124,7 +124,6 @@ static void bxt_init_clock_gating(struct drm_i915_private 
> *dev_priv)
>  
>  static void glk_init_clock_gating(struct drm_i915_private *dev_priv)
>  {
> - u32 val;

This resulted being a pain because it got reused by another upstream
patch, so while this revert removed the variable, the newly added non-
conflicting code still depended on it.

More specific variable names like "dpfc" and allowing compiler to
decide when to optimize and recycle variables would have helped :)

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] intel/atomic: Stop updating legacy fb parameters

2017-12-07 Thread Maarten Lankhorst
Op 07-12-17 om 15:32 schreef Daniel Vetter:
> Even fbc isn't using this stuff anymore, so time to remove it.
>
> Cleaning up one small piece of the atomic conversion cruft at the time
> ...
>
> Quick explanation on why the plane->fb assignment is ok to delete: The
> core code takes care of the refcounting and legacy ->fb pointer
> updating, but drivers are allowed to update it ahead of time. Most
> legacy modeset drivers did that as part of their set_config callback
> (since that's how the legacy/crtc helpers worked). In i915 we only
> need that to make the fbc code happy.
>
> v2: don't nuke the assignement of intel_crtc->config, I accidentally
> set CI ablaze :-) Spotted by Maarten. And better explain why nuking
> the ->fb assignement shouldn't set off alarm bells.
>
> Cc: Paulo Zanoni 
> Cc: Ville Syrjälä 
> Cc: Maarten Lankhorst 

Reviewed-by: Maarten Lankhorst 

> Signed-off-by: Daniel Vetter 
> ---
>  drivers/gpu/drm/i915/intel_display.c | 31 +++
>  1 file changed, 3 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c 
> b/drivers/gpu/drm/i915/intel_display.c
> index 1f7e312d0d0d..4614c7f1eec5 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -10967,31 +10967,6 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
>   return ret;
>  }
>  
> -static void
> -intel_modeset_update_crtc_state(struct drm_atomic_state *state)
> -{
> - struct drm_crtc *crtc;
> - struct drm_crtc_state *new_crtc_state;
> - int i;
> -
> - /* Double check state. */
> - for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
> - to_intel_crtc(crtc)->config = 
> to_intel_crtc_state(new_crtc_state);
> -
> - /*
> -  * Update legacy state to satisfy fbc code. This can
> -  * be removed when fbc uses the atomic state.
> -  */
> - if (drm_atomic_get_existing_plane_state(state, crtc->primary)) {
> - struct drm_plane_state *plane_state = 
> crtc->primary->state;
> -
> - crtc->primary->fb = plane_state->fb;
> - crtc->x = plane_state->src_x >> 16;
> - crtc->y = plane_state->src_y >> 16;
> - }
> - }
> -}
> -
>  static bool intel_fuzzy_clock_check(int clock1, int clock2)
>  {
>   int diff;
> @@ -12364,9 +12339,9 @@ static void intel_atomic_commit_tail(struct 
> drm_atomic_state *state)
>   }
>   }
>  
> - /* Only after disabling all output pipelines that will be changed can we
> -  * update the the output configuration. */
> - intel_modeset_update_crtc_state(state);
> + /* FIXME: Eventually get rid of our intel_crtc->config pointer */
> + for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
> + to_intel_crtc(crtc)->config = 
> to_intel_crtc_state(new_crtc_state);
>  
>   if (intel_state->modeset) {
>   drm_atomic_helper_update_legacy_modeset_state(state->dev, 
> state);


___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: add FTRACE dependency for DRM_I915_TRACE_GEM

2017-12-07 Thread Patchwork
== Series Details ==

Series: drm/i915: add FTRACE dependency for DRM_I915_TRACE_GEM
URL   : https://patchwork.freedesktop.org/series/35035/
State : success

== Summary ==

Series 35035v1 drm/i915: add FTRACE dependency for DRM_I915_TRACE_GEM
https://patchwork.freedesktop.org/api/1.0/series/35035/revisions/1/mbox/

Test kms_pipe_crc_basic:
Subgroup nonblocking-crc-pipe-b-frame-sequence:
fail   -> PASS   (fi-skl-6700k) fdo#103191
Subgroup suspend-read-crc-pipe-b:
pass   -> INCOMPLETE (fi-snb-2520m) fdo#103713

fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  
time:460s
fi-blb-e6850 total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  
time:408s
fi-bsw-n3050 total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  
time:574s
fi-bwr-2160  total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 
time:314s
fi-bxt-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:542s
fi-bxt-j4205 total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:545s
fi-byt-j1900 total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  
time:543s
fi-byt-n2820 total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:522s
fi-elk-e7500 total:224  pass:163  dwarn:15  dfail:0   fail:0   skip:45 
fi-gdg-551   total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 
time:312s
fi-glk-1 total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  
time:570s
fi-hsw-4770  total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:389s
fi-hsw-4770r total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  
time:278s
fi-ilk-650   total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  
time:416s
fi-ivb-3520m total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:493s
fi-ivb-3770  total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:469s
fi-kbl-7500u total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  
time:510s
fi-kbl-7560u total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  
time:543s
fi-kbl-7567u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:499s
fi-kbl-r total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:554s
fi-pnv-d510  total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  
time:682s
fi-skl-6260u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:472s
fi-skl-6600u total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:561s
fi-skl-6700hqtotal:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:588s
fi-skl-6700k total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  
time:534s
fi-skl-6770hqtotal:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:511s
fi-skl-gvtdvmtotal:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  
time:469s
fi-snb-2520m total:245  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600  total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  
time:430s
Blacklisted hosts:
fi-cfl-s2total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:618s
fi-cnl-y total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:665s
fi-glk-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:530s

f5c2d7259c8cc8da14044a64a132aa79846a7915 drm-tip: 2017y-12m-07d-14h-03m-29s UTC 
integration manifest
b34608ddefef drm/i915: add FTRACE dependency for DRM_I915_TRACE_GEM

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7438/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t 1/3] lib/igt_kms: Drop all stale events on first commit.

2017-12-07 Thread Chris Wilson
Quoting Maarten Lankhorst (2017-12-07 13:40:25)
> I've been trying to make kms_cursor_legacy work when subtests fail.
> Other subtests will start failing too because of expired events or
> stale pipe crc. The latter can be resolved in the test, but the former
> could affect other tests
> 
> Signed-off-by: Maarten Lankhorst 
> ---
>  lib/igt_kms.c | 39 ++-
>  lib/igt_kms.h |  1 +
>  2 files changed, 39 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 223dbe4ca565..9e14f071ea57 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -2943,7 +2943,10 @@ display_commit_changed(igt_display_t *display, enum 
> igt_commit_style s)
> output->changed &= 1 << IGT_CONNECTOR_CRTC_ID;
> }
>  
> -   display->first_commit = false;
> +   if (display->first_commit) {
> +   igt_display_drop_events(display);
> +   display->first_commit = false;
> +   }

So I spent quite a bit of time debating whether there is merit in "do
something; set-first-mode" that this would then clobber. After some
thought, no that doesn't seem like a wise test construction. I would
however suggest that we igt_debug() if we drop any events here.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PULL] drm-misc-fixes

2017-12-07 Thread Daniel Vetter
Hi Dave,

drm-misc-fixes-2017-12-07:

regression fix for vc4 + rpm stable fix for analogix bridge

Of course I do a pull, 2 more patches show up. Flushed them out since
you'll be out next week.

Cheers, Daniel

The following changes since commit a703c55004e1c5076d57e43771b3e7796ea0:

  drm: safely free connectors from connector_iter (2017-12-06 10:22:55 +0100)

are available in the Git repository at:

  git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-fixes-2017-12-07

for you to fetch changes up to 510353a63796d467b41237ab4f136136f68c297d:

  drm/bridge: analogix dp: Fix runtime PM state in get_modes() callback 
(2017-12-07 20:12:39 +0530)


regression fix for vc4 + rpm stable fix for analogix bridge


Boris Brezillon (1):
  drm/vc4: Fix false positive WARN() backtrace on refcount_inc() usage

Marek Szyprowski (1):
  drm/bridge: analogix dp: Fix runtime PM state in get_modes() callback

 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 ++
 drivers/gpu/drm/vc4/vc4_bo.c   | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] Dual monitor stuttering bug

2017-12-07 Thread Renato Ferreira
Hello,

I have an issue though i'm not really sure where it belongs to, i915,
mesa, drm or xorg, so i'm really sorry if it doesn't belong here.

The issue is as follows:

I em experiencing a very noticeable stuttering (mainly on scroll) in any
app *only* when an external monitor is enabled, and the stutter happens
*only* on the external monitor (normally, see below), connected through
HDMI.

This happens with mirrored or extended xrandr displays.

Is almost as if the external monitor is running on a lower FPS then the
laptop monitor, which is smooth.

If i turn OFF eDP1 display then HDMI display becomes buttery smooth (i
have a very keen eye for FPS, tearing and refresh from playing FPS
games).

Both monitors support and are set to 60hz.

I mainly use awesomewm, compton and and xf86-video-intel ddx (with
TearFree disabled), but i tested the issue in MANY other scenarios, as
described below.

My setup is as follows:
Haswell i7-4700MQ
Clevo W230ST laptop, with nvidia optimus.
Nvidia card is switched off with bbswitch.

Arch Linux
Kernel 4.14.3-1-ARCH #1 SMP PREEMPT
x86_64
Xorg 1.19.5
Mesa 17.2.6



What i've tried without any success:
- Disabling compton
- Using other window manager (openbox)
- Enabling TearFree
- Using xf86 modesetting driver
- i915 kernel flags: enable_psr 1/0, enable_fbc 1/0, edp_swing 2,
enable_dc 1/0, lvds_use_ssc 0, lvds_channel_mode 2


Then i tried using nvidia card (with xrandr --setprovideroutputsource
modesetting NVIDIA-0), which i use for playing, and then the situation
REVERSED (!!!): HDMI is buttery smooth but eDP1 is stuttering, if i
disable either display the problem goes away.


Please help, and thank you very much in advance,
Renato




i915 params:
alpha_support   = "Y"
disable_display = "N"
disable_power_well  = "1"
edp_vswing  = "0"
enable_cmd_parser   = "Y"
enable_dc   = "-1"
enable_dp_mst   = "Y"
enable_dpcd_backlight= "N"
enable_execlists= "0"
enable_fbc  = "1"
enable_guc_loading  = "0"
enable_guc_submission= "0"
enable_gvt  = "N"
enable_hangcheck= "Y"
enable_ips  = "1"
enable_ppgtt= "1"
enable_psr  = "1"
enable_rc6  = "1"
error_capture   = "Y"
fastboot= "N"
force_reset_modeset_test= "N"
guc_firmware_path   = "(null)"
guc_log_level   = "-1"
huc_firmware_path   = "(null)"
inject_load_failure = "0"
invert_brightness   = "0"
load_detect_test= "N"
lvds_channel_mode   = "0"
lvds_use_ssc= "-1"
mmio_debug  = "0"
modeset = "-1"
nuclear_pageflip= "N"
panel_ignore_lid= "1"
prefault_disable= "N"
reset   = "2"
semaphores  = "1"
use_mmio_flip   = "0"
vbt_firmware= "(null)"
vbt_sdvo_panel_type = "-1"
verbose_state_checks= "Y"


Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
eDP1 connected 1920x1080+0+0 (0x48) normal (normal left inverted right x axis y 
axis) 280mm x 160mm
Identifier: 0x43
Timestamp:  277291
Subpixel:   unknown
Gamma:  1.0:1.0:1.0
Brightness: 1.0
Clones:
CRTC:   0
CRTCs:  0 1 2
Transform:  1.00 0.00 0.00
0.00 1.00 0.00
0.00 0.00 1.00
   filter:
EDID:
00000dae4313
34150104a51c10780293ada9534c9625
114f530001010101010101010101
010101010101363680a0703820402e1e
24001aa51018242480a070382040
2e1e24001aa5101800fe0043
4d4e0a20202020202020202000fe
004e314853452d4541310a2000cd
BACKLIGHT: 2441
range: (0, 2441)
Backlight: 2441
range: (0, 2441)
scaling mode: Full aspect
supported: Full, Center, Full aspect
Broadcast RGB: Automatic
supported: Automatic, Full, Limited 16:235
audio: auto
supported: force-dvi, off, auto, on
link-status: Good
supported: Good, Bad
  1920x1080 (0x48) 138.780MHz -HSync -VSync *current +preferred
h: width  1920 start 1966 end 1996 total 2080 skew0 clock  66.72KHz
v: height 1080 start 1082 end 1086 total 1112   clock  60.00Hz
  1920x1080 (0x164) 92.520MHz -HSync -VSync
h: width  1920 start 1966 end 1996 total 2080 skew0 clock  44.48KHz
v: height 1080 start 1082 end 1086 total 1112   clock  40.00Hz
  1400x1050 (0x165) 122.000MHz +HSync +VSync
h: width  1400 start 1488 end 1640 total 1880 skew0 clock  64.89KHz
v: height 1050 start 1052 end 1064 total 1082   clock  59.98Hz
  1600x900 (0x166) 118.997MHz -HSync +VSync
h: width  1600 start 1696 end 1864 total 2128 skew0 clock  55.92KHz
v: height  900 start  901 end  904 total  932   clock  60.00Hz
  1280x1024 (0x1

Re: [Intel-gfx] [PATCH] drm/i915: Increase max texture to 16k for gen9+

2017-12-07 Thread Ville Syrjälä
On Thu, Dec 07, 2017 at 05:26:00PM +0800, Alex Tu wrote:
> Rrefer to another patch [1] on mesa to extend width/height to 16384.
> For issue :
>  - https://bugs.freedesktop.org/show_bug.cgi?id=102508
>  - LP: #1714178 Triple monitor display failed with Dell Dock (HiDPI)
> 
> [1] https://patchwork.freedesktop.org/patch/124918/
> 
> Signed-off-by: Alex Tu 
> ---
>  drivers/gpu/drm/i915/intel_display.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c 
> b/drivers/gpu/drm/i915/intel_display.c
> index 47a2f6acee50..556fa57b18b8 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13905,7 +13905,7 @@ u32 intel_fb_pitch_limit(struct drm_i915_private 
> *dev_priv,
>   /* "The stride in bytes must not exceed the of the size of 8K
>*  pixels and 32K bytes."

The spec queote clearly says the patch is wrong. Either that or the spec
quote is outdated.

>*/
> - return min(8192 * cpp, 32768);
> + return min(16384 * cpp, 65536);
>   } else if (gen >= 5 && !HAS_GMCH_DISPLAY(dev_priv)) {
>   return 32*1024;
>   } else if (gen >= 4) {
> @@ -14604,8 +14604,8 @@ int intel_modeset_init(struct drm_device *dev)
>   dev->mode_config.max_width = 4096;
>   dev->mode_config.max_height = 4096;
>   } else {
> - dev->mode_config.max_width = 8192;
> - dev->mode_config.max_height = 8192;
> + dev->mode_config.max_width = 16384;
> + dev->mode_config.max_height = 16384;

Even if this would be correct (which it's not for most platforms at
least, not quite sure about the very latest hardware), anyone doing
this should at least do a cursory check of the relevant math in the
driver to make seure we don't end up with integer overflows.

>   }
>  
>   if (IS_I845G(dev_priv) || IS_I865G(dev_priv)) {
> -- 
> 2.11.0
> 
> ___
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t 1/3] lib/igt_kms: Drop all stale events on first commit.

2017-12-07 Thread Maarten Lankhorst
Op 07-12-17 om 16:03 schreef Chris Wilson:
> Quoting Maarten Lankhorst (2017-12-07 13:40:25)
>> I've been trying to make kms_cursor_legacy work when subtests fail.
>> Other subtests will start failing too because of expired events or
>> stale pipe crc. The latter can be resolved in the test, but the former
>> could affect other tests
>>
>> Signed-off-by: Maarten Lankhorst 
>> ---
>>  lib/igt_kms.c | 39 ++-
>>  lib/igt_kms.h |  1 +
>>  2 files changed, 39 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
>> index 223dbe4ca565..9e14f071ea57 100644
>> --- a/lib/igt_kms.c
>> +++ b/lib/igt_kms.c
>> @@ -2943,7 +2943,10 @@ display_commit_changed(igt_display_t *display, enum 
>> igt_commit_style s)
>> output->changed &= 1 << IGT_CONNECTOR_CRTC_ID;
>> }
>>  
>> -   display->first_commit = false;
>> +   if (display->first_commit) {
>> +   igt_display_drop_events(display);
>> +   display->first_commit = false;
>> +   }
> So I spent quite a bit of time debating whether there is merit in "do
> something; set-first-mode" that this would then clobber. After some
> thought, no that doesn't seem like a wise test construction. I would
> however suggest that we igt_debug() if we drop any events here.
> -Chris

Exactly. I'm using igt_info since it's supposed to be uncommon, is it ok if I 
upgrade it to a igt_warn() since nothing in CI will trigger it?

~Maarten

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for intel/atomic: Stop updating legacy fb parameters (rev2)

2017-12-07 Thread Patchwork
== Series Details ==

Series: intel/atomic: Stop updating legacy fb parameters (rev2)
URL   : https://patchwork.freedesktop.org/series/34924/
State : success

== Summary ==

Series 34924v2 intel/atomic: Stop updating legacy fb parameters
https://patchwork.freedesktop.org/api/1.0/series/34924/revisions/2/mbox/

Test debugfs_test:
Subgroup read_all_entries:
dmesg-warn -> DMESG-FAIL (fi-elk-e7500) fdo#103989
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
fail   -> PASS   (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
pass   -> INCOMPLETE (fi-hsw-4770) fdo#103375

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375

fi-bdw-5557u total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  
time:444s
fi-blb-e6850 total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  
time:385s
fi-bsw-n3050 total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  
time:524s
fi-bwr-2160  total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 
time:281s
fi-bxt-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:504s
fi-bxt-j4205 total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:512s
fi-byt-j1900 total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  
time:489s
fi-byt-n2820 total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:475s
fi-elk-e7500 total:224  pass:163  dwarn:14  dfail:1   fail:0   skip:45 
fi-gdg-551   total:288  pass:179  dwarn:1   dfail:0   fail:0   skip:108 
time:268s
fi-glk-1 total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  
time:543s
fi-hsw-4770  total:246  pass:222  dwarn:0   dfail:0   fail:0   skip:23 
fi-hsw-4770r total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  
time:257s
fi-ilk-650   total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  
time:391s
fi-ivb-3520m total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:489s
fi-ivb-3770  total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:450s
fi-kbl-7500u total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  
time:489s
fi-kbl-7560u total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  
time:525s
fi-kbl-7567u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:476s
fi-kbl-r total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:530s
fi-pnv-d510  total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  
time:591s
fi-skl-6260u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:454s
fi-skl-6600u total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:543s
fi-skl-6700hqtotal:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:562s
fi-skl-6700k total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  
time:519s
fi-skl-6770hqtotal:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:495s
fi-skl-gvtdvmtotal:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  
time:453s
fi-snb-2600  total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  
time:418s
Blacklisted hosts:
fi-cfl-s2total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:608s
fi-cnl-y total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:624s
fi-glk-dsi   total:288  pass:257  dwarn:0   dfail:0   fail:1   skip:30  
time:501s
fi-snb-2520m failed to collect. IGT log at Patchwork_7439/fi-snb-2520m/igt.log

bdf9b36fd601c2aa06fb191b31d0bac1197db8d0 drm-tip: 2017y-12m-07d-14h-56m-01s UTC 
integration manifest
0a74c361c039 intel/atomic: Stop updating legacy fb parameters

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7439/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [RFC] drm/i915: Support creating a proxy object that links to other object's pages

2017-12-07 Thread Chris Wilson
Sometimes it is useful to work with arbitrarily large surfaces, that
exceed the limits of various bits of HW. For instance, you may be
creating a mega-texture, a single very large texture with essentially
infinite dimensions, but need to normal textures out of it for sampling
by hardware. As the texture is too big for the HW, one cannot simply use
the GPU to copy chunks out of the huge texture into a smaller version,
instead much find some other indexing trick. The proxy object presents
one such trick. It allows us to create an object with pages of an other,
in an arbitrary order, thus we are able to create a window into the
larger object that can fit within the restrictions of HW, all without
copying any data and just manipulating the GPU page tables.

A similar situation often arises with framebuffers. It is convenient to
address the entire frontbuffer as a single continuous surface; but that
may be much too large for the scanout to handle (e.g. 3x4K monitors, let
alone adding in virtual or prime outputs). Instead of breaking up the
contiguous frontbuffer (ala per-crtc-pixmaps), we can carve smaller
per-crtc-framebuffers out of the larger using a proxy surface and
redirecting the page tables to refer back to the larger surface.

To support such page table manipulations, we introduce a scratch proxy
object. It can be created with arbitrary size (give or take the usual
u64/size_t restrictions), and by default every page index links to the
same scratch page (i.e. you can create a 128PiB object backed by only
4KiB). Through the use of DRM_I915_GEM_SET_PAGES ioctl, different
indices within the proxy object can be redirected to different locations
within a target object. The ioctl takes a 2D strided array as it
description which should facilitate constructing the most common layouts.

Opens:
- userptr needs to revoke proxy attachments
- userspace demonstrator
- explicit selftests to cover the different cases of link_node(), atm we
  rely on the random walk of the smoketest to find all the corner cases

Suggested-by: Kristian Høgsberg 
Signed-off-by: Chris Wilson 
Cc: Kristian Høgsberg 
Cc: Matthew Auld 
Cc: Joonas Lahtinen 
---
 drivers/gpu/drm/i915/Makefile  |   1 +
 drivers/gpu/drm/i915/i915_drv.c|   2 +
 drivers/gpu/drm/i915/i915_drv.h|   2 +
 drivers/gpu/drm/i915/i915_gem.c|  98 +++-
 drivers/gpu/drm/i915/i915_gem_object.h |  16 +-
 drivers/gpu/drm/i915/i915_gem_scratch.c| 373 ++
 drivers/gpu/drm/i915/selftests/huge_gem_object.c   |   6 +-
 drivers/gpu/drm/i915/selftests/huge_gem_object.h   |   2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_object.c   |   2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_scratch.c  | 533 +
 .../gpu/drm/i915/selftests/i915_live_selftests.h   |   1 +
 .../gpu/drm/i915/selftests/i915_mock_selftests.h   |   1 +
 include/uapi/drm/i915_drm.h|  44 +-
 13 files changed, 1065 insertions(+), 16 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/i915_gem_scratch.c
 create mode 100644 drivers/gpu/drm/i915/selftests/i915_gem_scratch.c

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index bdf8724ac0e1..baa7794952c1 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -69,6 +69,7 @@ i915-y += i915_cmd_parser.o \
  i915_gem_object.o \
  i915_gem_render_state.o \
  i915_gem_request.o \
+ i915_gem_scratch.o \
  i915_gem_shrinker.o \
  i915_gem_stolen.o \
  i915_gem_tiling.o \
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index cbe7f2d969cc..abd8d9fd9aca 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -378,6 +378,7 @@ static int i915_getparam(struct drm_device *dev, void *data,
}
break;
 
+   case I915_PARAM_CREATE_VERSION:
case I915_PARAM_MMAP_VERSION:
/* Remember to bump this if the version changes! */
case I915_PARAM_HAS_GEM:
@@ -2814,6 +2815,7 @@ static const struct drm_ioctl_desc i915_ioctls[] = {
DRM_IOCTL_DEF_DRV(I915_PERF_OPEN, i915_perf_open_ioctl, 
DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(I915_PERF_ADD_CONFIG, i915_perf_add_config_ioctl, 
DRM_UNLOCKED|DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(I915_PERF_REMOVE_CONFIG, 
i915_perf_remove_config_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
+   DRM_IOCTL_DEF_DRV(I915_GEM_SET_PAGES, i915_gem_set_pages_ioctl, 
DRM_RENDER_ALLOW),
 };
 
 static struct drm_driver driver = {
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index c4f88a9a4a53..e06d276c82d7 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -3489,6 +3489,8 @@ int i915_gem_throttle_ioctl(struct drm_device *dev, void 
*data,
struct drm_file *file_priv);
 int i915_gem_madvis

Re: [Intel-gfx] [PATCH i-g-t 1/3] lib/igt_kms: Drop all stale events on first commit.

2017-12-07 Thread Chris Wilson
Quoting Maarten Lankhorst (2017-12-07 15:42:54)
> Op 07-12-17 om 16:03 schreef Chris Wilson:
> > Quoting Maarten Lankhorst (2017-12-07 13:40:25)
> >> I've been trying to make kms_cursor_legacy work when subtests fail.
> >> Other subtests will start failing too because of expired events or
> >> stale pipe crc. The latter can be resolved in the test, but the former
> >> could affect other tests
> >>
> >> Signed-off-by: Maarten Lankhorst 
> >> ---
> >>  lib/igt_kms.c | 39 ++-
> >>  lib/igt_kms.h |  1 +
> >>  2 files changed, 39 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> >> index 223dbe4ca565..9e14f071ea57 100644
> >> --- a/lib/igt_kms.c
> >> +++ b/lib/igt_kms.c
> >> @@ -2943,7 +2943,10 @@ display_commit_changed(igt_display_t *display, enum 
> >> igt_commit_style s)
> >> output->changed &= 1 << IGT_CONNECTOR_CRTC_ID;
> >> }
> >>  
> >> -   display->first_commit = false;
> >> +   if (display->first_commit) {
> >> +   igt_display_drop_events(display);
> >> +   display->first_commit = false;
> >> +   }
> > So I spent quite a bit of time debating whether there is merit in "do
> > something; set-first-mode" that this would then clobber. After some
> > thought, no that doesn't seem like a wise test construction. I would
> > however suggest that we igt_debug() if we drop any events here.
> > -Chris
> 
> Exactly. I'm using igt_info since it's supposed to be uncommon, is it ok if I 
> upgrade it to a igt_warn() since nothing in CI will trigger it?

Oh, I wouldn't have put it inside drop_events itself, since that is just
doing its job -- whether or not it is relevant depends on the caller. So
I would suggest reducing it to igt_debug, or just reporting the number
dropped and making the judgement in the caller.

No, I don't this should be an igt_warn, as then CI blames the following
test for environmental errors left over from previous runs.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm: More debug info for fb leaks in mode_config_cleanup

2017-12-07 Thread Noralf Trønnes


Den 07.12.2017 15.49, skrev Daniel Vetter:

We're spotting this very rarely in CI, but have no idea. Let's add
more debug info about what's going on here.

References: https://bugs.freedesktop.org/show_bug.cgi?id=102707
Signed-off-by: Daniel Vetter 
---


Acked-by: Noralf Trønnes 


  drivers/gpu/drm/drm_mode_config.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_mode_config.c 
b/drivers/gpu/drm/drm_mode_config.c
index cc78b3d9e5e4..6ffe952142e6 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -469,6 +469,9 @@ void drm_mode_config_cleanup(struct drm_device *dev)
 */
WARN_ON(!list_empty(&dev->mode_config.fb_list));
list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
+   struct drm_printer p = drm_debug_printer("[leaked fb]");
+   drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
+   drm_framebuffer_print_info(&p, 1, fb);
drm_framebuffer_free(&fb->base.refcount);
}
  


___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t 1/3] lib/igt_kms: Drop all stale events on first commit.

2017-12-07 Thread Maarten Lankhorst
Op 07-12-17 om 16:50 schreef Chris Wilson:
> Quoting Maarten Lankhorst (2017-12-07 15:42:54)
>> Op 07-12-17 om 16:03 schreef Chris Wilson:
>>> Quoting Maarten Lankhorst (2017-12-07 13:40:25)
 I've been trying to make kms_cursor_legacy work when subtests fail.
 Other subtests will start failing too because of expired events or
 stale pipe crc. The latter can be resolved in the test, but the former
 could affect other tests

 Signed-off-by: Maarten Lankhorst 
 ---
  lib/igt_kms.c | 39 ++-
  lib/igt_kms.h |  1 +
  2 files changed, 39 insertions(+), 1 deletion(-)

 diff --git a/lib/igt_kms.c b/lib/igt_kms.c
 index 223dbe4ca565..9e14f071ea57 100644
 --- a/lib/igt_kms.c
 +++ b/lib/igt_kms.c
 @@ -2943,7 +2943,10 @@ display_commit_changed(igt_display_t *display, enum 
 igt_commit_style s)
 output->changed &= 1 << IGT_CONNECTOR_CRTC_ID;
 }
  
 -   display->first_commit = false;
 +   if (display->first_commit) {
 +   igt_display_drop_events(display);
 +   display->first_commit = false;
 +   }
>>> So I spent quite a bit of time debating whether there is merit in "do
>>> something; set-first-mode" that this would then clobber. After some
>>> thought, no that doesn't seem like a wise test construction. I would
>>> however suggest that we igt_debug() if we drop any events here.
>>> -Chris
>> Exactly. I'm using igt_info since it's supposed to be uncommon, is it ok if 
>> I upgrade it to a igt_warn() since nothing in CI will trigger it?
> Oh, I wouldn't have put it inside drop_events itself, since that is just
> doing its job -- whether or not it is relevant depends on the caller. So
> I would suggest reducing it to igt_debug, or just reporting the number
> dropped and making the judgement in the caller.
>
> No, I don't this should be an igt_warn, as then CI blames the following
> test for environmental errors left over from previous runs.
> -Chris

It's not even possible, CI runs each test separately. When you open a
new copy of the drm fd you don't get events for the previous fd.

Only when subtests fail you should get a dropped event, because of this
it will never happen in CI and it's safe to change to a warn.

~Maarten

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for drm: More debug info for fb leaks in mode_config_cleanup

2017-12-07 Thread Patchwork
== Series Details ==

Series: drm: More debug info for fb leaks in mode_config_cleanup
URL   : https://patchwork.freedesktop.org/series/35038/
State : success

== Summary ==

Series 35038v1 drm: More debug info for fb leaks in mode_config_cleanup
https://patchwork.freedesktop.org/api/1.0/series/35038/revisions/1/mbox/

Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS   (fi-snb-2520m) fdo#103713

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  
time:438s
fi-blb-e6850 total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  
time:385s
fi-bsw-n3050 total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  
time:532s
fi-bwr-2160  total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 
time:283s
fi-bxt-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:493s
fi-bxt-j4205 total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:509s
fi-byt-j1900 total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  
time:495s
fi-byt-n2820 total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:470s
fi-elk-e7500 total:224  pass:163  dwarn:15  dfail:0   fail:0   skip:45 
fi-gdg-551   total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 
time:269s
fi-glk-1 total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  
time:537s
fi-hsw-4770  total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:360s
fi-hsw-4770r total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  
time:260s
fi-ilk-650   total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  
time:392s
fi-ivb-3520m total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:484s
fi-ivb-3770  total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:443s
fi-kbl-7500u total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  
time:490s
fi-kbl-7560u total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  
time:526s
fi-kbl-7567u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:474s
fi-kbl-r total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:532s
fi-pnv-d510  total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  
time:593s
fi-skl-6260u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:457s
fi-skl-6600u total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:544s
fi-skl-6700hqtotal:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:564s
fi-skl-6700k total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  
time:516s
fi-skl-6770hqtotal:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:496s
fi-skl-gvtdvmtotal:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  
time:451s
fi-snb-2520m total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:550s
fi-snb-2600  total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  
time:415s
Blacklisted hosts:
fi-cfl-s2total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:622s
fi-cnl-y total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:651s
fi-glk-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:492s

bdf9b36fd601c2aa06fb191b31d0bac1197db8d0 drm-tip: 2017y-12m-07d-14h-56m-01s UTC 
integration manifest
19c16ca706d0 drm: More debug info for fb leaks in mode_config_cleanup

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7440/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t 1/3] lib/igt_kms: Drop all stale events on first commit.

2017-12-07 Thread Chris Wilson
Quoting Maarten Lankhorst (2017-12-07 15:57:09)
> Op 07-12-17 om 16:50 schreef Chris Wilson:
> > Quoting Maarten Lankhorst (2017-12-07 15:42:54)
> >> Op 07-12-17 om 16:03 schreef Chris Wilson:
> >>> Quoting Maarten Lankhorst (2017-12-07 13:40:25)
>  I've been trying to make kms_cursor_legacy work when subtests fail.
>  Other subtests will start failing too because of expired events or
>  stale pipe crc. The latter can be resolved in the test, but the former
>  could affect other tests
> 
>  Signed-off-by: Maarten Lankhorst 
>  ---
>   lib/igt_kms.c | 39 ++-
>   lib/igt_kms.h |  1 +
>   2 files changed, 39 insertions(+), 1 deletion(-)
> 
>  diff --git a/lib/igt_kms.c b/lib/igt_kms.c
>  index 223dbe4ca565..9e14f071ea57 100644
>  --- a/lib/igt_kms.c
>  +++ b/lib/igt_kms.c
>  @@ -2943,7 +2943,10 @@ display_commit_changed(igt_display_t *display, 
>  enum igt_commit_style s)
>  output->changed &= 1 << IGT_CONNECTOR_CRTC_ID;
>  }
>   
>  -   display->first_commit = false;
>  +   if (display->first_commit) {
>  +   igt_display_drop_events(display);
>  +   display->first_commit = false;
>  +   }
> >>> So I spent quite a bit of time debating whether there is merit in "do
> >>> something; set-first-mode" that this would then clobber. After some
> >>> thought, no that doesn't seem like a wise test construction. I would
> >>> however suggest that we igt_debug() if we drop any events here.
> >>> -Chris
> >> Exactly. I'm using igt_info since it's supposed to be uncommon, is it ok 
> >> if I upgrade it to a igt_warn() since nothing in CI will trigger it?
> > Oh, I wouldn't have put it inside drop_events itself, since that is just
> > doing its job -- whether or not it is relevant depends on the caller. So
> > I would suggest reducing it to igt_debug, or just reporting the number
> > dropped and making the judgement in the caller.
> >
> > No, I don't this should be an igt_warn, as then CI blames the following
> > test for environmental errors left over from previous runs.
> > -Chris
> 
> It's not even possible, CI runs each test separately. When you open a
> new copy of the drm fd you don't get events for the previous fd.
> 
> Only when subtests fail you should get a dropped event, because of this
> it will never happen in CI and it's safe to change to a warn.

But others just run all the test as a whole, so the next subtest will
generate warns because of earlier subtests. There's also the concept of
a fork-server so that even different igt may end up in the same process,
continuing on from the same fd. (Depending on how fast we want to strive
for; certainly for fuzzing we want to retain as much state as safely can
be.)
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915: Increase max texture to 16k for gen9+

2017-12-07 Thread Patchwork
== Series Details ==

Series: drm/i915: Increase max texture to 16k for gen9+
URL   : https://patchwork.freedesktop.org/series/35016/
State : success

== Summary ==

Test kms_frontbuffer_tracking:
Subgroup fbc-1p-offscren-pri-shrfb-draw-render:
fail   -> PASS   (shard-snb) fdo#101623 +1
Test drv_module_reload:
Subgroup basic-reload-inject:
pass   -> DMESG-WARN (shard-snb) fdo#102707
Test gem_tiled_swapping:
Subgroup non-threaded:
incomplete -> PASS   (shard-snb) fdo#104009

fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#104009 https://bugs.freedesktop.org/show_bug.cgi?id=104009

shard-hswtotal:2679 pass:1535 dwarn:2   dfail:0   fail:10  skip:1132 
time:9486s
shard-snbtotal:2679 pass:1308 dwarn:2   dfail:0   fail:11  skip:1358 
time:8122s

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7435/shards.html
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm/i915: Refactor common list iteration over GGTT vma

2017-12-07 Thread Chris Wilson
In quite a few places, we have a list iteration over the vma on an
object that only want to inspect GGTT vma. By construction, these are
placed at the start of the list, so we have copied that knowledge into
many callsites. Pull that knowledge back to i915_vma.h and provide a
for_each_ggtt_vma() to tidy up the code.

Suggested-by: Joonas Lahtinen 
Signed-off-by: Chris Wilson 
Cc: Joonas Lahtinen 
---
 drivers/gpu/drm/i915/i915_debugfs.c|  4 ++--
 drivers/gpu/drm/i915/i915_gem.c| 18 --
 drivers/gpu/drm/i915/i915_gem_gtt.c|  5 +
 drivers/gpu/drm/i915/i915_gem_tiling.c | 10 ++
 drivers/gpu/drm/i915/i915_vma.h| 14 +-
 5 files changed, 22 insertions(+), 29 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index 28294470ae31..7b41a1799a03 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -111,8 +111,8 @@ static u64 i915_gem_obj_total_ggtt_size(struct 
drm_i915_gem_object *obj)
u64 size = 0;
struct i915_vma *vma;
 
-   list_for_each_entry(vma, &obj->vma_list, obj_link) {
-   if (i915_vma_is_ggtt(vma) && drm_mm_node_allocated(&vma->node))
+   for_each_ggtt_vma(vma, obj) {
+   if (drm_mm_node_allocated(&vma->node))
size += vma->node.size;
}
 
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 67dc11effc8e..c7b5db78fbb4 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -714,10 +714,7 @@ flush_write_domain(struct drm_i915_gem_object *obj, 
unsigned int flush_domains)
intel_fb_obj_flush(obj,
   fb_write_origin(obj, I915_GEM_DOMAIN_GTT));
 
-   list_for_each_entry(vma, &obj->vma_list, obj_link) {
-   if (!i915_vma_is_ggtt(vma))
-   break;
-
+   for_each_ggtt_vma(vma, obj) {
if (vma->iomap)
continue;
 
@@ -1569,10 +1566,7 @@ static void i915_gem_object_bump_inactive_ggtt(struct 
drm_i915_gem_object *obj)
 
GEM_BUG_ON(!i915_gem_object_has_pinned_pages(obj));
 
-   list_for_each_entry(vma, &obj->vma_list, obj_link) {
-   if (!i915_vma_is_ggtt(vma))
-   break;
-
+   for_each_ggtt_vma(vma, obj) {
if (i915_vma_is_active(vma))
continue;
 
@@ -2051,12 +2045,8 @@ static void __i915_gem_object_release_mmap(struct 
drm_i915_gem_object *obj)
drm_vma_node_unmap(&obj->base.vma_node,
   obj->base.dev->anon_inode->i_mapping);
 
-   list_for_each_entry(vma, &obj->vma_list, obj_link) {
-   if (!i915_vma_is_ggtt(vma))
-   break;
-
+   for_each_ggtt_vma(vma, obj)
i915_vma_unset_userfault(vma);
-   }
 }
 
 /**
@@ -3822,7 +3812,7 @@ int i915_gem_object_set_cache_level(struct 
drm_i915_gem_object *obj,
 * dropped the fence as all snoopable access is
 * supposed to be linear.
 */
-   list_for_each_entry(vma, &obj->vma_list, obj_link) {
+   for_each_ggtt_vma(vma, obj) {
ret = i915_vma_put_fence(vma);
if (ret)
return ret;
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c 
b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 1faea9a17b5a..d701b79b6319 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3623,10 +3623,7 @@ void i915_gem_restore_gtt_mappings(struct 
drm_i915_private *dev_priv)
bool ggtt_bound = false;
struct i915_vma *vma;
 
-   list_for_each_entry(vma, &obj->vma_list, obj_link) {
-   if (vma->vm != &ggtt->base)
-   continue;
-
+   for_each_ggtt_vma(vma, obj) {
if (!i915_vma_unbind(vma))
continue;
 
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c 
b/drivers/gpu/drm/i915/i915_gem_tiling.c
index b85d7ebd9bee..d9dc9df523b5 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -205,10 +205,7 @@ i915_gem_object_fence_prepare(struct drm_i915_gem_object 
*obj,
if (tiling_mode == I915_TILING_NONE)
return 0;
 
-   list_for_each_entry(vma, &obj->vma_list, obj_link) {
-   if (!i915_vma_is_ggtt(vma))
-   break;
-
+   for_each_ggtt_vma(vma, obj) {
if (i915_vma_fence_prepare(vma, tiling_mode, stride))
continue;
 
@@ -285,10 +282,7 @@ i915_gem_object_set_tiling(struct drm_i915_gem_object *obj,
}
mutex_unlock(&obj->mm.lock);
 

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Support creating a proxy object that links to other object's pages

2017-12-07 Thread Patchwork
== Series Details ==

Series: drm/i915: Support creating a proxy object that links to other object's 
pages
URL   : https://patchwork.freedesktop.org/series/35042/
State : success

== Summary ==

Series 35042v1 drm/i915: Support creating a proxy object that links to other 
object's pages
https://patchwork.freedesktop.org/api/1.0/series/35042/revisions/1/mbox/

Warning: Kernel 32bit buildtest failed
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7441/build_32bit.log

Test debugfs_test:
Subgroup read_all_entries:
dmesg-warn -> DMESG-FAIL (fi-elk-e7500) fdo#103989

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989

fi-bdw-5557u total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  
time:437s
fi-blb-e6850 total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  
time:384s
fi-bsw-n3050 total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  
time:522s
fi-bwr-2160  total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 
time:281s
fi-bxt-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:509s
fi-bxt-j4205 total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:507s
fi-byt-j1900 total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  
time:487s
fi-byt-n2820 total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:477s
fi-elk-e7500 total:224  pass:163  dwarn:14  dfail:1   fail:0   skip:45 
fi-gdg-551   total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 
time:270s
fi-glk-1 total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  
time:537s
fi-hsw-4770  total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:374s
fi-hsw-4770r total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  
time:259s
fi-ilk-650   total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  
time:397s
fi-ivb-3520m total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:483s
fi-ivb-3770  total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:447s
fi-kbl-7500u total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  
time:493s
fi-kbl-7560u total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  
time:523s
fi-kbl-7567u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:476s
fi-kbl-r total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:529s
fi-pnv-d510  total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  
time:592s
fi-skl-6260u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:449s
fi-skl-6600u total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:544s
fi-skl-6700hqtotal:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:563s
fi-skl-6700k total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  
time:520s
fi-skl-6770hqtotal:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:496s
fi-skl-gvtdvmtotal:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  
time:447s
fi-snb-2520m total:245  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600  total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  
time:413s
Blacklisted hosts:
fi-cfl-s2total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:595s
fi-cnl-y total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:632s
fi-glk-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:491s

bdf9b36fd601c2aa06fb191b31d0bac1197db8d0 drm-tip: 2017y-12m-07d-14h-56m-01s UTC 
integration manifest
79b1cbb529ba drm/i915: Support creating a proxy object that links to other 
object's pages

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7441/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t 3/6] meson: Install benchmarks to $libexec/intel-gpu-tools/benchmarks

2017-12-07 Thread Ville Syrjälä
On Thu, Dec 07, 2017 at 03:40:28PM +0200, Petri Latvala wrote:
> Signed-off-by: Petri Latvala 
> Cc: Daniel Vetter 
> ---
>  benchmarks/meson.build | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/benchmarks/meson.build b/benchmarks/meson.build
> index 4afd204f..26d65c4b 100644
> --- a/benchmarks/meson.build
> +++ b/benchmarks/meson.build
> @@ -31,8 +31,12 @@ foreach prog : benchmark_progs
>   # FIXME meson doesn't like binaries with the same name
>   # meanwhile just suffix with _bench
>   executable(prog + '_bench', prog + '.c',
> +install : true,
> +install_dir : join_paths(get_option('libexecdir'), 
> 'intel-gpu-tools', 'benchmarks'),

Could maybe define this benchmarksdir or something?

Either way
Reviewed-by: Ville Syrjälä 

>  dependencies : test_deps)
>  endforeach
>  
>  executable('gem_wsim_bench', 'gem_wsim.c',
> +install : true,
> +install_dir : join_paths(get_option('libexecdir'), 
> 'intel-gpu-tools', 'benchmarks'),
>  dependencies : test_deps + [ lib_igt_perf ])
> -- 
> 2.14.1
> 
> ___
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t 2/6] meson: Don't install selfcheck binaries

2017-12-07 Thread Ville Syrjälä
On Thu, Dec 07, 2017 at 03:40:27PM +0200, Petri Latvala wrote:
> Signed-off-by: Petri Latvala 
> Cc: Daniel Vetter 

Reviewed-by: Ville Syrjälä 

> ---
>  lib/tests/meson.build | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/tests/meson.build b/lib/tests/meson.build
> index 29bdb2c4..55ab2b3d 100644
> --- a/lib/tests/meson.build
> +++ b/lib/tests/meson.build
> @@ -22,13 +22,13 @@ lib_fail_tests = [
>  ]
>  
>  foreach lib_test : lib_tests
> - exec = executable(lib_test, lib_test + '.c', install : true,
> + exec = executable(lib_test, lib_test + '.c', install : false,
>   dependencies : igt_deps)
>   test('lib: ' + lib_test, exec)
>  endforeach
>  
>  foreach lib_test : lib_fail_tests
> - exec = executable(lib_test, lib_test + '.c', install : true,
> + exec = executable(lib_test, lib_test + '.c', install : false,
>   dependencies : igt_deps)
>   test('lib: ' + lib_test, exec, should_fail : true)
>  endforeach
> -- 
> 2.14.1
> 
> ___
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t 5/6] meson: Also install gem_stress.

2017-12-07 Thread Ville Syrjälä
On Thu, Dec 07, 2017 at 03:40:30PM +0200, Petri Latvala wrote:
> Signed-off-by: Petri Latvala 
> Cc: Daniel Vetter 

Reviewed-by: Ville Syrjälä 

> ---
>  tests/meson.build | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/meson.build b/tests/meson.build
> index 45517a59..1d1cbe3a 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -293,7 +293,10 @@ foreach prog : test_progs
>   args : prog)
>  endforeach
>  
> -executable('gem_stress', 'gem_stress.c', dependencies : igt_deps)
> +executable('gem_stress', 'gem_stress.c',
> +install : true,
> +install_dir : libexecdir,
> +dependencies : igt_deps)
>  
>  # IMPORTANT: These tests here are all disabled because the result in sometime
>  # unrecoverable gpu hangs. Don't put real testcases here.
> -- 
> 2.14.1
> 
> ___
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t 6/6] meson: Install .testlist files

2017-12-07 Thread Ville Syrjälä
On Thu, Dec 07, 2017 at 03:40:31PM +0200, Petri Latvala wrote:
> Signed-off-by: Petri Latvala 
> Cc: Daniel Vetter 
> ---
>  tests/intel-ci/meson.build | 7 +++
>  tests/meson.build  | 2 ++
>  2 files changed, 9 insertions(+)
>  create mode 100644 tests/intel-ci/meson.build
> 
> diff --git a/tests/intel-ci/meson.build b/tests/intel-ci/meson.build
> new file mode 100644
> index ..baad3c7b
> --- /dev/null
> +++ b/tests/intel-ci/meson.build
> @@ -0,0 +1,7 @@
> +
> +testlist_files = [
> +  'fast-feedback.testlist',
> +  'meta.testlist',
> +]

autotools seems to install the README as well?

> +
> +install_data(sources : testlist_files, install_dir : pkgdatadir)
> diff --git a/tests/meson.build b/tests/meson.build
> index 1d1cbe3a..4c4bee1d 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -319,3 +319,5 @@ image_files = [
>'pass.png',
>  ]
>  install_data(sources : image_files, install_dir : pkgdatadir)
> +
> +subdir('intel-ci')
> -- 
> 2.14.1
> 
> ___
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t 4/6] meson: Install test-list.txt to libexecdir

2017-12-07 Thread Ville Syrjälä
On Thu, Dec 07, 2017 at 03:40:29PM +0200, Petri Latvala wrote:
> Piglit needs test-list.txt to be in the same directory as the test
> binaries.

Referencing the corresponding autotools commit would have made this
easier to review...

Reviewed-by: Ville Syrjälä 

> 
> Signed-off-by: Petri Latvala 
> Cc: Daniel Vetter 
> ---
>  tests/meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/meson.build b/tests/meson.build
> index 191ac4ce..45517a59 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -285,7 +285,7 @@ test_list = custom_target('testlist',
> output : 'test-list.txt',
> command : [ gen_testlist, '@OUTPUT@', test_progs ],
> install : true,
> -   install_dir : pkgdatadir)
> +   install_dir : libexecdir)
>  
>  test_script = find_program('igt_command_line.sh')
>  foreach prog : test_progs
> -- 
> 2.14.1
> 
> ___
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: Refactor common list iteration over GGTT vma

2017-12-07 Thread Ville Syrjälä
On Thu, Dec 07, 2017 at 04:27:17PM +, Chris Wilson wrote:
> In quite a few places, we have a list iteration over the vma on an
> object that only want to inspect GGTT vma. By construction, these are
> placed at the start of the list, so we have copied that knowledge into
> many callsites. Pull that knowledge back to i915_vma.h and provide a
> for_each_ggtt_vma() to tidy up the code.
> 
> Suggested-by: Joonas Lahtinen 
> Signed-off-by: Chris Wilson 
> Cc: Joonas Lahtinen 
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c|  4 ++--
>  drivers/gpu/drm/i915/i915_gem.c| 18 --
>  drivers/gpu/drm/i915/i915_gem_gtt.c|  5 +
>  drivers/gpu/drm/i915/i915_gem_tiling.c | 10 ++
>  drivers/gpu/drm/i915/i915_vma.h| 14 +-
>  5 files changed, 22 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
> b/drivers/gpu/drm/i915/i915_debugfs.c
> index 28294470ae31..7b41a1799a03 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -111,8 +111,8 @@ static u64 i915_gem_obj_total_ggtt_size(struct 
> drm_i915_gem_object *obj)
>   u64 size = 0;
>   struct i915_vma *vma;
>  
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> - if (i915_vma_is_ggtt(vma) && drm_mm_node_allocated(&vma->node))
> + for_each_ggtt_vma(vma, obj) {
> + if (drm_mm_node_allocated(&vma->node))
>   size += vma->node.size;
>   }
>  
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 67dc11effc8e..c7b5db78fbb4 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -714,10 +714,7 @@ flush_write_domain(struct drm_i915_gem_object *obj, 
> unsigned int flush_domains)
>   intel_fb_obj_flush(obj,
>  fb_write_origin(obj, I915_GEM_DOMAIN_GTT));
>  
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> - if (!i915_vma_is_ggtt(vma))
> - break;
> -
> + for_each_ggtt_vma(vma, obj) {
>   if (vma->iomap)
>   continue;
>  
> @@ -1569,10 +1566,7 @@ static void i915_gem_object_bump_inactive_ggtt(struct 
> drm_i915_gem_object *obj)
>  
>   GEM_BUG_ON(!i915_gem_object_has_pinned_pages(obj));
>  
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> - if (!i915_vma_is_ggtt(vma))
> - break;
> -
> + for_each_ggtt_vma(vma, obj) {
>   if (i915_vma_is_active(vma))
>   continue;
>  
> @@ -2051,12 +2045,8 @@ static void __i915_gem_object_release_mmap(struct 
> drm_i915_gem_object *obj)
>   drm_vma_node_unmap(&obj->base.vma_node,
>  obj->base.dev->anon_inode->i_mapping);
>  
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> - if (!i915_vma_is_ggtt(vma))
> - break;
> -
> + for_each_ggtt_vma(vma, obj)
>   i915_vma_unset_userfault(vma);
> - }
>  }
>  
>  /**
> @@ -3822,7 +3812,7 @@ int i915_gem_object_set_cache_level(struct 
> drm_i915_gem_object *obj,
>* dropped the fence as all snoopable access is
>* supposed to be linear.
>*/
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> + for_each_ggtt_vma(vma, obj) {
>   ret = i915_vma_put_fence(vma);
>   if (ret)
>   return ret;
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c 
> b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 1faea9a17b5a..d701b79b6319 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -3623,10 +3623,7 @@ void i915_gem_restore_gtt_mappings(struct 
> drm_i915_private *dev_priv)
>   bool ggtt_bound = false;
>   struct i915_vma *vma;
>  
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> - if (vma->vm != &ggtt->base)
> - continue;
> -
> + for_each_ggtt_vma(vma, obj) {
>   if (!i915_vma_unbind(vma))
>   continue;
>  
> diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c 
> b/drivers/gpu/drm/i915/i915_gem_tiling.c
> index b85d7ebd9bee..d9dc9df523b5 100644
> --- a/drivers/gpu/drm/i915/i915_gem_tiling.c
> +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
> @@ -205,10 +205,7 @@ i915_gem_object_fence_prepare(struct drm_i915_gem_object 
> *obj,
>   if (tiling_mode == I915_TILING_NONE)
>   return 0;
>  
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> - if (!i915_vma_is_ggtt(vma))
> - break;
> -
> + for_each_ggtt_vma(vma, obj) {
>   if (i915_vma_fence_

Re: [Intel-gfx] [PATCH] drm/i915: Refactor common list iteration over GGTT vma

2017-12-07 Thread Chris Wilson
Quoting Ville Syrjälä (2017-12-07 16:40:49)
> On Thu, Dec 07, 2017 at 04:27:17PM +, Chris Wilson wrote:
> > +#define for_each_ggtt_vma(V, OBJ) \
> > + list_for_each_entry(V, &(OBJ)->vma_list, obj_link)  \
> > + if (!i915_vma_is_ggtt(vma)) break; else
> 
> for_each_if() ?

for_each_if() doesn't perform a break.

for_each_until() ? I think that may be a bit too magical.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Refactor common list iteration over GGTT vma

2017-12-07 Thread Patchwork
== Series Details ==

Series: drm/i915: Refactor common list iteration over GGTT vma
URL   : https://patchwork.freedesktop.org/series/35048/
State : success

== Summary ==

Series 35048v1 drm/i915: Refactor common list iteration over GGTT vma
https://patchwork.freedesktop.org/api/1.0/series/35048/revisions/1/mbox/

Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
fail   -> PASS   (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS   (fi-snb-2520m) fdo#103713

fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  
time:446s
fi-blb-e6850 total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  
time:380s
fi-bsw-n3050 total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  
time:521s
fi-bwr-2160  total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 
time:281s
fi-bxt-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:500s
fi-byt-j1900 total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  
time:486s
fi-byt-n2820 total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:472s
fi-elk-e7500 total:224  pass:163  dwarn:15  dfail:0   fail:0   skip:45 
fi-gdg-551   total:288  pass:179  dwarn:1   dfail:0   fail:0   skip:108 
time:270s
fi-glk-1 total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  
time:537s
fi-hsw-4770  total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:357s
fi-hsw-4770r total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  
time:258s
fi-ilk-650   total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  
time:395s
fi-ivb-3520m total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:479s
fi-ivb-3770  total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:444s
fi-kbl-7500u total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  
time:498s
fi-kbl-7560u total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  
time:525s
fi-kbl-7567u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:484s
fi-kbl-r total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:535s
fi-pnv-d510  total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  
time:585s
fi-skl-6260u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:455s
fi-skl-6600u total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:538s
fi-skl-6700hqtotal:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:563s
fi-skl-6700k total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  
time:516s
fi-skl-6770hqtotal:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:497s
fi-skl-gvtdvmtotal:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  
time:445s
fi-snb-2520m total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:550s
fi-snb-2600  total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  
time:409s
Blacklisted hosts:
fi-cfl-s2total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:616s
fi-cnl-y total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:629s
fi-glk-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:488s
fi-bxt-j4205 failed to collect. IGT log at Patchwork_7442/fi-bxt-j4205/igt.log

bdf9b36fd601c2aa06fb191b31d0bac1197db8d0 drm-tip: 2017y-12m-07d-14h-56m-01s UTC 
integration manifest
9d686b86a209 drm/i915: Refactor common list iteration over GGTT vma

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7442/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t 3/6] meson: Install benchmarks to $libexec/intel-gpu-tools/benchmarks

2017-12-07 Thread Chris Wilson
Quoting Petri Latvala (2017-12-07 13:40:28)
> Signed-off-by: Petri Latvala 
> Cc: Daniel Vetter 
> ---
>  benchmarks/meson.build | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/benchmarks/meson.build b/benchmarks/meson.build
> index 4afd204f..26d65c4b 100644
> --- a/benchmarks/meson.build
> +++ b/benchmarks/meson.build
> @@ -31,8 +31,12 @@ foreach prog : benchmark_progs
> # FIXME meson doesn't like binaries with the same name
> # meanwhile just suffix with _bench
> executable(prog + '_bench', prog + '.c',
> +  install : true,
> +  install_dir : join_paths(get_option('libexecdir'), 
> 'intel-gpu-tools', 'benchmarks'),

Isn't the package name now "igt-gpu-tools" ?
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t v2] lib/igt_sysfs: Let igt_sysfs_read|write return -errno

2017-12-07 Thread Chris Wilson
Quoting Michal Wajdeczko (2017-12-07 16:52:46)
> In some cases debugfs or sysfs may return errors that we
> want to check. Return -errno from helper functions to make
> asserts easier.
> 
> v2: don't forget about EOF ret=0 (Chris)
> small re-write (Michal)
> 
> Signed-off-by: Michal Wajdeczko 
> Cc: Chris Wilson 
> Cc: Joonas Lahtinen 
Reviewed-by: Chris Wilson 

Just tests/drv_hangman.c needs to fixed to use
igt_require(sysfs >= 0);
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t v2] lib/igt_sysfs: Let igt_sysfs_read|write return -errno

2017-12-07 Thread Michal Wajdeczko
In some cases debugfs or sysfs may return errors that we
want to check. Return -errno from helper functions to make
asserts easier.

v2: don't forget about EOF ret=0 (Chris)
small re-write (Michal)

Signed-off-by: Michal Wajdeczko 
Cc: Chris Wilson 
Cc: Joonas Lahtinen 
---
 lib/igt_sysfs.c | 44 +---
 1 file changed, 21 insertions(+), 23 deletions(-)

diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index e7c67da..842a136 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -54,36 +54,34 @@
 
 static int readN(int fd, char *buf, int len)
 {
-   int total = 0;
+   int ret, total = 0;
do {
-   int ret = read(fd, buf + total, len - total);
-   if (ret < 0 && (errno == EINTR || errno == EAGAIN))
+   ret = read(fd, buf + total, len - total);
+   if (ret < 0)
+   ret = -errno;
+   if (ret == -EINTR || ret == -EAGAIN)
continue;
-
if (ret <= 0)
-   return total ?: ret;
-
+   break;
total += ret;
-   if (total == len)
-   return total;
-   } while (1);
+   } while (total != len);
+   return total ?: ret;
 }
 
 static int writeN(int fd, const char *buf, int len)
 {
-   int total = 0;
+   int ret, total = 0;
do {
-   int ret = write(fd, buf + total, len - total);
-   if (ret < 0 && (errno == EINTR || errno == EAGAIN))
+   ret = write(fd, buf + total, len - total);
+   if (ret < 0)
+   ret = -errno;
+   if (ret == -EINTR || ret == -EAGAIN)
continue;
-
if (ret <= 0)
-   return total ?: ret;
-
+   break;
total += ret;
-   if (total == len)
-   return total;
-   } while (1);
+   } while (total != len);
+   return total ?: ret;
 }
 
 /**
@@ -238,7 +236,7 @@ int igt_sysfs_open_parameters(int device)
  * This writes @len bytes from @data to the sysfs file.
  *
  * Returns:
- * The number of bytes written, or -1 on error.
+ * The number of bytes written, or -errno on error.
  */
 int igt_sysfs_write(int dir, const char *attr, const void *data, int len)
 {
@@ -246,7 +244,7 @@ int igt_sysfs_write(int dir, const char *attr, const void 
*data, int len)
 
fd = openat(dir, attr, O_WRONLY);
if (fd < 0)
-   return false;
+   return -errno;
 
len = writeN(fd, data, len);
close(fd);
@@ -264,7 +262,7 @@ int igt_sysfs_write(int dir, const char *attr, const void 
*data, int len)
  * This reads @len bytes from the sysfs file to @data
  *
  * Returns:
- * The length read, -1 on failure.
+ * The length read, -errno on failure.
  */
 int igt_sysfs_read(int dir, const char *attr, void *data, int len)
 {
@@ -272,7 +270,7 @@ int igt_sysfs_read(int dir, const char *attr, void *data, 
int len)
 
fd = openat(dir, attr, O_RDONLY);
if (fd < 0)
-   return false;
+   return -errno;
 
len = readN(fd, data, len);
close(fd);
@@ -338,7 +336,7 @@ char *igt_sysfs_get(int dir, const char *attr)
rem = len - offset - 1;
}
 
-   if (ret != -1)
+   if (ret > 0)
offset += ret;
buf[offset] = '\0';
while (offset > 0 && buf[offset-1] == '\n')
-- 
2.7.4

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: Refactor common list iteration over GGTT vma

2017-12-07 Thread Ville Syrjälä
On Thu, Dec 07, 2017 at 04:46:37PM +, Chris Wilson wrote:
> Quoting Ville Syrjälä (2017-12-07 16:40:49)
> > On Thu, Dec 07, 2017 at 04:27:17PM +, Chris Wilson wrote:
> > > +#define for_each_ggtt_vma(V, OBJ) \
> > > + list_for_each_entry(V, &(OBJ)->vma_list, obj_link)  \
> > > + if (!i915_vma_is_ggtt(vma)) break; else
> > 
> > for_each_if() ?
> 
> for_each_if() doesn't perform a break.

Ah. I probably should have read the comment :)

> 
> for_each_until() ? I think that may be a bit too magical.

Maybe. I guess open coding it here is fine until the pattern
starts to repeat all over the place.

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for igt/gem_mocs_settings: Force use of master device

2017-12-07 Thread Patchwork
== Series Details ==

Series: igt/gem_mocs_settings: Force use of master device
URL   : https://patchwork.freedesktop.org/series/35019/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
2fc64acf8a4465d5eab3d6cfec9b3c1b5df30d73 igt/perf_pmu: Tweak wait_for_rc6, yet 
again

with latest DRM-Tip kernel build CI_DRM_3475
bdf9b36fd601 drm-tip: 2017y-12m-07d-14h-56m-01s UTC integration manifest

No testlist changes.

Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS   (fi-snb-2520m) fdo#103713

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  
time:444s
fi-blb-e6850 total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  
time:388s
fi-bsw-n3050 total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  
time:528s
fi-bwr-2160  total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 
time:283s
fi-bxt-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:503s
fi-bxt-j4205 total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:509s
fi-byt-j1900 total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  
time:491s
fi-byt-n2820 total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:473s
fi-elk-e7500 total:224  pass:163  dwarn:15  dfail:0   fail:0   skip:45 
fi-gdg-551   total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 
time:272s
fi-glk-1 total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  
time:546s
fi-hsw-4770  total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:367s
fi-hsw-4770r total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  
time:271s
fi-ilk-650   total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  
time:393s
fi-ivb-3520m total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:489s
fi-ivb-3770  total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:451s
fi-kbl-7500u total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  
time:485s
fi-kbl-7560u total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  
time:529s
fi-kbl-7567u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:477s
fi-kbl-r total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:536s
fi-pnv-d510  total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  
time:591s
fi-skl-6260u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:453s
fi-skl-6600u total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:545s
fi-skl-6700hqtotal:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:580s
fi-skl-6700k total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  
time:526s
fi-skl-6770hqtotal:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:507s
fi-skl-gvtdvmtotal:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  
time:447s
fi-snb-2520m total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:552s
fi-snb-2600  total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  
time:424s
Blacklisted hosts:
fi-cfl-s2total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:620s
fi-cnl-y total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:639s
fi-glk-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:489s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_611/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for lib: Print other clients when DRM_SET_MASTER fails

2017-12-07 Thread Patchwork
== Series Details ==

Series: lib: Print other clients when DRM_SET_MASTER fails
URL   : https://patchwork.freedesktop.org/series/35023/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
2fc64acf8a4465d5eab3d6cfec9b3c1b5df30d73 igt/perf_pmu: Tweak wait_for_rc6, yet 
again

with latest DRM-Tip kernel build CI_DRM_3475
bdf9b36fd601 drm-tip: 2017y-12m-07d-14h-56m-01s UTC integration manifest

No testlist changes.

fi-bdw-5557u total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  
time:445s
fi-blb-e6850 total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  
time:393s
fi-bsw-n3050 total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  
time:526s
fi-bwr-2160  total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 
time:281s
fi-bxt-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:510s
fi-bxt-j4205 total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:512s
fi-byt-j1900 total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  
time:495s
fi-byt-n2820 total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:478s
fi-elk-e7500 total:224  pass:163  dwarn:15  dfail:0   fail:0   skip:45 
fi-gdg-551   total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 
time:271s
fi-glk-1 total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  
time:539s
fi-hsw-4770  total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:358s
fi-hsw-4770r total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  
time:260s
fi-ilk-650   total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  
time:392s
fi-ivb-3520m total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:477s
fi-ivb-3770  total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:451s
fi-kbl-7500u total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  
time:499s
fi-kbl-7560u total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  
time:533s
fi-kbl-7567u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:478s
fi-kbl-r total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:534s
fi-skl-6260u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:457s
fi-skl-6600u total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:542s
fi-skl-6700hqtotal:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:573s
fi-skl-6700k total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  
time:525s
fi-skl-6770hqtotal:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:505s
fi-skl-gvtdvmtotal:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  
time:448s
fi-snb-2520m total:245  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600  total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  
time:416s
Blacklisted hosts:
fi-cfl-s2total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:608s
fi-cnl-y total:287  pass:261  dwarn:0   dfail:0   fail:0   skip:25 
fi-glk-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:497s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_612/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for tools: Cannonlake port clock programming

2017-12-07 Thread Patchwork
== Series Details ==

Series: tools: Cannonlake port clock programming
URL   : https://patchwork.freedesktop.org/series/35028/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
2fc64acf8a4465d5eab3d6cfec9b3c1b5df30d73 igt/perf_pmu: Tweak wait_for_rc6, yet 
again

with latest DRM-Tip kernel build CI_DRM_3475
bdf9b36fd601 drm-tip: 2017y-12m-07d-14h-56m-01s UTC integration manifest

No testlist changes.

Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS   (fi-snb-2520m) fdo#103713

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  
time:440s
fi-blb-e6850 total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  
time:383s
fi-bsw-n3050 total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  
time:520s
fi-bwr-2160  total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 
time:281s
fi-bxt-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:508s
fi-bxt-j4205 total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:507s
fi-byt-j1900 total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  
time:492s
fi-elk-e7500 total:224  pass:163  dwarn:15  dfail:0   fail:0   skip:45 
fi-gdg-551   total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 
time:268s
fi-glk-1 total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  
time:537s
fi-hsw-4770  total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:385s
fi-hsw-4770r total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  
time:260s
fi-ilk-650   total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  
time:393s
fi-ivb-3520m total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:481s
fi-ivb-3770  total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  
time:449s
fi-kbl-7500u total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  
time:483s
fi-kbl-7560u total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  
time:530s
fi-kbl-7567u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:476s
fi-kbl-r total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:537s
fi-pnv-d510  total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  
time:591s
fi-skl-6260u total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:448s
fi-skl-6600u total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  
time:545s
fi-skl-6700hqtotal:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:570s
fi-skl-6700k total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  
time:523s
fi-skl-6770hqtotal:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  
time:507s
fi-skl-gvtdvmtotal:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  
time:451s
fi-snb-2520m total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  
time:556s
fi-snb-2600  total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  
time:419s
Blacklisted hosts:
fi-cfl-s2total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  
time:616s
fi-glk-dsi   total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  
time:492s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_613/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm: More debug info for fb leaks in mode_config_cleanup

2017-12-07 Thread Daniel Vetter
On Thu, Dec 07, 2017 at 04:52:04PM +0100, Noralf Trønnes wrote:
> 
> Den 07.12.2017 15.49, skrev Daniel Vetter:
> > We're spotting this very rarely in CI, but have no idea. Let's add
> > more debug info about what's going on here.
> > 
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=102707
> > Signed-off-by: Daniel Vetter 
> > ---
> 
> Acked-by: Noralf Trønnes 

Applied, thanks for taking a look!
-Daniel

> 
> >   drivers/gpu/drm/drm_mode_config.c | 3 +++
> >   1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_mode_config.c 
> > b/drivers/gpu/drm/drm_mode_config.c
> > index cc78b3d9e5e4..6ffe952142e6 100644
> > --- a/drivers/gpu/drm/drm_mode_config.c
> > +++ b/drivers/gpu/drm/drm_mode_config.c
> > @@ -469,6 +469,9 @@ void drm_mode_config_cleanup(struct drm_device *dev)
> >  */
> > WARN_ON(!list_empty(&dev->mode_config.fb_list));
> > list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
> > +   struct drm_printer p = drm_debug_printer("[leaked fb]");
> > +   drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
> > +   drm_framebuffer_print_info(&p, 1, fb);
> > drm_framebuffer_free(&fb->base.refcount);
> > }
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: Refactor common list iteration over GGTT vma

2017-12-07 Thread Daniel Vetter
On Thu, Dec 07, 2017 at 04:27:17PM +, Chris Wilson wrote:
> In quite a few places, we have a list iteration over the vma on an
> object that only want to inspect GGTT vma. By construction, these are
> placed at the start of the list, so we have copied that knowledge into
> many callsites. Pull that knowledge back to i915_vma.h and provide a
> for_each_ggtt_vma() to tidy up the code.
> 
> Suggested-by: Joonas Lahtinen 
> Signed-off-by: Chris Wilson 
> Cc: Joonas Lahtinen 
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c|  4 ++--
>  drivers/gpu/drm/i915/i915_gem.c| 18 --
>  drivers/gpu/drm/i915/i915_gem_gtt.c|  5 +
>  drivers/gpu/drm/i915/i915_gem_tiling.c | 10 ++
>  drivers/gpu/drm/i915/i915_vma.h| 14 +-
>  5 files changed, 22 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
> b/drivers/gpu/drm/i915/i915_debugfs.c
> index 28294470ae31..7b41a1799a03 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -111,8 +111,8 @@ static u64 i915_gem_obj_total_ggtt_size(struct 
> drm_i915_gem_object *obj)
>   u64 size = 0;
>   struct i915_vma *vma;
>  
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> - if (i915_vma_is_ggtt(vma) && drm_mm_node_allocated(&vma->node))
> + for_each_ggtt_vma(vma, obj) {
> + if (drm_mm_node_allocated(&vma->node))
>   size += vma->node.size;
>   }
>  
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 67dc11effc8e..c7b5db78fbb4 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -714,10 +714,7 @@ flush_write_domain(struct drm_i915_gem_object *obj, 
> unsigned int flush_domains)
>   intel_fb_obj_flush(obj,
>  fb_write_origin(obj, I915_GEM_DOMAIN_GTT));
>  
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> - if (!i915_vma_is_ggtt(vma))
> - break;
> -
> + for_each_ggtt_vma(vma, obj) {
>   if (vma->iomap)
>   continue;
>  
> @@ -1569,10 +1566,7 @@ static void i915_gem_object_bump_inactive_ggtt(struct 
> drm_i915_gem_object *obj)
>  
>   GEM_BUG_ON(!i915_gem_object_has_pinned_pages(obj));
>  
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> - if (!i915_vma_is_ggtt(vma))
> - break;
> -
> + for_each_ggtt_vma(vma, obj) {
>   if (i915_vma_is_active(vma))
>   continue;
>  
> @@ -2051,12 +2045,8 @@ static void __i915_gem_object_release_mmap(struct 
> drm_i915_gem_object *obj)
>   drm_vma_node_unmap(&obj->base.vma_node,
>  obj->base.dev->anon_inode->i_mapping);
>  
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> - if (!i915_vma_is_ggtt(vma))
> - break;
> -
> + for_each_ggtt_vma(vma, obj)
>   i915_vma_unset_userfault(vma);
> - }
>  }
>  
>  /**
> @@ -3822,7 +3812,7 @@ int i915_gem_object_set_cache_level(struct 
> drm_i915_gem_object *obj,
>* dropped the fence as all snoopable access is
>* supposed to be linear.
>*/
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> + for_each_ggtt_vma(vma, obj) {
>   ret = i915_vma_put_fence(vma);
>   if (ret)
>   return ret;
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c 
> b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 1faea9a17b5a..d701b79b6319 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -3623,10 +3623,7 @@ void i915_gem_restore_gtt_mappings(struct 
> drm_i915_private *dev_priv)
>   bool ggtt_bound = false;
>   struct i915_vma *vma;
>  
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> - if (vma->vm != &ggtt->base)
> - continue;
> -
> + for_each_ggtt_vma(vma, obj) {
>   if (!i915_vma_unbind(vma))
>   continue;
>  
> diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c 
> b/drivers/gpu/drm/i915/i915_gem_tiling.c
> index b85d7ebd9bee..d9dc9df523b5 100644
> --- a/drivers/gpu/drm/i915/i915_gem_tiling.c
> +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
> @@ -205,10 +205,7 @@ i915_gem_object_fence_prepare(struct drm_i915_gem_object 
> *obj,
>   if (tiling_mode == I915_TILING_NONE)
>   return 0;
>  
> - list_for_each_entry(vma, &obj->vma_list, obj_link) {
> - if (!i915_vma_is_ggtt(vma))
> - break;
> -
> + for_each_ggtt_vma(vma, obj) {
>   if (i915_vma_fence_

Re: [Intel-gfx] [PATCH i-g-t 1/6] meson: Don't install headers

2017-12-07 Thread Daniel Vetter
On Thu, Dec 07, 2017 at 03:40:26PM +0200, Petri Latvala wrote:
> Until we can at least check for a matching ABI, the only supported way
> of building is having the headers from the source checkout.
> 
> Signed-off-by: Petri Latvala 
> Cc: Daniel Vetter 

Yeah we don't want the headers.

Reviewed-by: Daniel Vetter 


> ---
>  lib/meson.build | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/lib/meson.build b/lib/meson.build
> index d06d85b4..a4973180 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -143,8 +143,6 @@ if chamelium.found()
>   lib_sources += 'igt_chamelium.c'
>  endif
>  
> -install_headers(lib_headers)
> -
>  pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 
> 'intel-gpu-tools')
>  srcdir = join_paths(meson.source_root(), 'tests')
>  
> -- 
> 2.14.1
> 
> ___
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH i-g-t 3/6] meson: Install benchmarks to $libexec/intel-gpu-tools/benchmarks

2017-12-07 Thread Daniel Vetter
On Thu, Dec 07, 2017 at 06:32:58PM +0200, Ville Syrjälä wrote:
> On Thu, Dec 07, 2017 at 03:40:28PM +0200, Petri Latvala wrote:
> > Signed-off-by: Petri Latvala 
> > Cc: Daniel Vetter 
> > ---
> >  benchmarks/meson.build | 4 
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/benchmarks/meson.build b/benchmarks/meson.build
> > index 4afd204f..26d65c4b 100644
> > --- a/benchmarks/meson.build
> > +++ b/benchmarks/meson.build
> > @@ -31,8 +31,12 @@ foreach prog : benchmark_progs
> > # FIXME meson doesn't like binaries with the same name
> > # meanwhile just suffix with _bench
> > executable(prog + '_bench', prog + '.c',
> > +  install : true,
> > +  install_dir : join_paths(get_option('libexecdir'), 
> > 'intel-gpu-tools', 'benchmarks'),
> 
> Could maybe define this benchmarksdir or something?

Yeah, I think extracting all the install dirs, and defining them all in
the top-level meson.build file would be good. Maybe as a follow-up.

And +1 on igt-gpu-tools, but that's perhaps also a different thing to
tackle, there's more places. Perhaps for igt 2.0 :-)
-Daniel

> 
> Either way
> Reviewed-by: Ville Syrjälä 
> 
> >dependencies : test_deps)
> >  endforeach
> >  
> >  executable('gem_wsim_bench', 'gem_wsim.c',
> > +  install : true,
> > +  install_dir : join_paths(get_option('libexecdir'), 
> > 'intel-gpu-tools', 'benchmarks'),
> >dependencies : test_deps + [ lib_igt_perf ])
> > -- 
> > 2.14.1
> > 
> > ___
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Ville Syrjälä
> Intel OTC

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH igt] lib: Print other clients when DRM_SET_MASTER fails

2017-12-07 Thread Daniel Vetter
On Thu, Dec 07, 2017 at 10:09:33AM +, Chris Wilson wrote:
> It looks like there are some rogue processes running in CI that prevent
> DRM_MASTER from being obtained. Dump the list of clients on failure to
> make it more obvious what is being left behind.
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=104157
> Signed-off-by: Chris Wilson 

Pls also update docs/reference/intel-gpu-tools/intel-gpu-tools.xml to
include the new file (builds better with meson ime, automake needs a
complete new autogen.sh run to pick that up). I think that also needs the
overview stanza for gtkdoc to pick it up.

Maybe longer-term we want to shuffle all the core open stuff in here, but
that can be done later on. With gtkdoc basics appeased:

Reviewed-by: Daniel Vetter 

> ---
>  lib/Makefile.sources |  2 ++
>  lib/drmtest.c|  4 +--
>  lib/igt_device.c | 78 
> 
>  lib/igt_device.h | 34 +++
>  4 files changed, 116 insertions(+), 2 deletions(-)
>  create mode 100644 lib/igt_device.c
>  create mode 100644 lib/igt_device.h
> 
> diff --git a/lib/Makefile.sources b/lib/Makefile.sources
> index 6e968d9f7..686c0f145 100644
> --- a/lib/Makefile.sources
> +++ b/lib/Makefile.sources
> @@ -15,6 +15,8 @@ lib_source_list =   \
>   igt.h   \
>   igt_debugfs.c   \
>   igt_debugfs.h   \
> + igt_device.c\
> + igt_device.h\
>   igt_aux.c   \
>   igt_aux.h   \
>   igt_edid_template.h \
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index ef2f772ea..b2d8150f4 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -51,6 +51,7 @@
>  #include "intel_chipset.h"
>  #include "intel_io.h"
>  #include "igt_debugfs.h"
> +#include "igt_device.h"
>  #include "igt_gt.h"
>  #include "igt_kmod.h"
>  #include "version.h"
> @@ -423,8 +424,7 @@ int drm_open_driver_master(int chipset)
>  {
>   int fd = drm_open_driver(chipset);
>  
> - igt_require_f(drmSetMaster(fd) == 0, "Can't become DRM master, "
> -   "please check if no other DRM client is running.\n");
> + igt_device_set_master(fd);
>  
>   return fd;
>  }
> diff --git a/lib/igt_device.c b/lib/igt_device.c
> new file mode 100644
> index 0..5bf0bdcd3
> --- /dev/null
> +++ b/lib/igt_device.c
> @@ -0,0 +1,78 @@
> +/*
> + * Copyright © 2017 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
> DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#include "igt.h"
> +#include "igt_device.h"
> +
> +int __igt_device_set_master(int fd)
> +{
> + int err;
> +
> + err = 0;
> + if (drmIoctl(fd, DRM_IOCTL_SET_MASTER, NULL))
> + err = -errno;
> +
> + errno = 0;
> + return err;
> +}
> +
> +/**
> + * igt_device_set_master: Set DRM master
> + * @fd: the device
> + *
> + * Tell the kernel to become DRM master or skip the test.
> + */
> +void igt_device_set_master(int fd)
> +{
> + if (__igt_device_set_master(fd)) {
> + igt_debugfs_dump(fd, "clients");
> + igt_require_f(__igt_device_set_master(fd) == 0,
> +   "Can't become DRM master, "
> +   "please check if no other DRM client is 
> running.\n");
> + }
> +}
> +
> +int __igt_device_drop_master(int fd)
> +{
> + int err;
> +
> + err = 0;
> + if (drmIoctl(fd, DRM_IOCTL_DROP_MASTER, NULL))
> + err = -errno;
> +
> + errno = 0;
> + return err;
> +}
> +
> +/**
> + * igt_device_drop_master: Drop DRM master
> + * @fd: the device
> + *
> + * Tell the kernel we no longer want to be the DRM master; asserting that
> + * we lose that privilege.
> + */
> +void igt_device_drop_master(int fd)
> +{
> + igt_assert_eq(__igt_device_drop_master(fd), 0);
> +}
> diff --git a/lib/igt_device.h b/lib/igt_device.h
> ne

  1   2   >