[Intel-gfx] [PATCH 01/10] drm : adds Y-coordinate and Colorimetry Format

2016-12-30 Thread vathsala nagaraju
PSR2 vsc revision number hb2( as per table 6-11)is updated to
4 or 5 based on Y cordinate and Colorimetry Format as below
04h = 3D stereo + PSR/PSR2 + Y-coordinate.
05h = -3D stereo- + PSR/PSR2 + Y-coordinate + Pixel Encoding/Colorimetry
Format indication. A DP Source device is allowed to indicate the pixel
encoding/colorimetry format to the DP Sink device with VSC SDP only when
the DP Sink device supports it (
i.e.,VSC_SDP_EXTENSION_FOR_COLORIMETRY_SUPPORTED bit in the
DPRX_FEATURE_ENUMERATION_LIST register (DPCD Address 02210h, bit 3;
is set to 1).

v2: (Jani)
- Change DP_PSR_Y_COORDINATE to DP_PSR2_SU_Y_COORDINATE_REQUIRED.
- Add DP_PSR2_SU_GRANULARITY_REQUIRED.
- Change DPRX_FEATURE_ENUMERATION_LIST to DP_DPRX.
- Add GTC_CAP and AV_SYNC_CAP, other bits in DPRX_FEATURE_ENUMERATION_LIST.

v3: (Jani)
- Add support for bits 7:4 and 1 as per DP v1.4 for
  DPRX_FEATURE_ENUMERATION_LIST.

Cc: Rodrigo Vivi 
Cc: Jim Bride 
Signed-off-by: Vathsala Nagaraju 
Signed-off-by: Patil Deepti 
---
 include/drm/drm_dp_helper.h | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 55bbeb0..0468135 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -194,7 +194,8 @@
 # define DP_PSR_SETUP_TIME_0(6 << 1)
 # define DP_PSR_SETUP_TIME_MASK (7 << 1)
 # define DP_PSR_SETUP_TIME_SHIFT1
-
+# define DP_PSR2_SU_Y_COORDINATE_REQUIRED   (1 << 4)  /* eDP 1.4a */
+# define DP_PSR2_SU_GRANULARITY_REQUIRED(1 << 5)  /* eDP 1.4b */
 /*
  * 0x80-0x8f describe downstream port capabilities, but there are two layouts
  * based on whether DP_DETAILED_CAP_INFO_AVAILABLE was set.  If it was not,
@@ -568,6 +569,16 @@
 #define DP_RECEIVER_ALPM_STATUS0x200b  /* eDP 1.4 */
 # define DP_ALPM_LOCK_TIMEOUT_ERROR(1 << 0)
 
+#define DP_DPRX_FEATURE_ENUMERATION_LIST0x2210  /* DP 1.3 */
+# define DP_GTC_CAP(1 << 0)  /* DP 1.3 */
+# define DP_SST_SPLIT_SDP_CAP  (1 << 1)  /* DP 1.4 */
+# define DP_AV_SYNC_CAP(1 << 2)  /* DP 
1.3 */
+# define DP_VSC_SDP_EXT_FOR_COLORIMETRY_SUPPORTED  (1 << 3)  /* DP 1.3 */
+# define DP_VSC_EXT_VESA_SDP_SUPPORTED (1 << 4)  /* DP 1.4 */
+# define DP_VSC_EXT_VESA_SDP_CHAINING_SUPPORTED(1 << 5)  /* DP 
1.4 */
+# define DP_VSC_EXT_CEA_SDP_SUPPORTED  (1 << 6)  /* DP 1.4 */
+# define DP_VSC_EXT_CEA_SDP_CHAINING_SUPPORTED (1 << 7)  /* DP 1.4 */
+
 /* DP 1.2 Sideband message defines */
 /* peer device type - DP 1.2a Table 2-92 */
 #define DP_PEER_DEVICE_NONE0x0
-- 
1.9.1

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


Re: [Intel-gfx] [PATCH] drm/i915: Move assert of page pin vs bind count into i915_vma_unbind

2016-12-30 Thread Daniel Vetter
On Fri, Dec 30, 2016 at 05:33:14PM +, Chris Wilson wrote:
> The read of the page pin count and the bind count are unordered,
> presenting races in the assert and it firing off incorrectly. Prevent
> this by restricting the assert to the vma bind/unbind routines where we
> have local cpu ordering between the two.
> 
> Signed-off-by: Chris Wilson 
> Cc: Daniel Vetter 

Fun.

Reviewed-by: Daniel Vetter 
> ---
>  drivers/gpu/drm/i915/i915_drv.h | 1 -
>  drivers/gpu/drm/i915/i915_vma.c | 1 +
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 00ecbb4da25e..1aa33444115a 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -3291,7 +3291,6 @@ __i915_gem_object_unpin_pages(struct 
> drm_i915_gem_object *obj)
>   GEM_BUG_ON(!obj->mm.pages);
>  
>   atomic_dec(>mm.pages_pin_count);
> - GEM_BUG_ON(atomic_read(>mm.pages_pin_count) < obj->bind_count);
>  }
>  
>  static inline void
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 414f0f7f5059..d48c68214611 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -640,6 +640,7 @@ int i915_vma_unbind(struct i915_vma *vma)
>* reaped by the shrinker.
>*/
>   i915_gem_object_unpin_pages(obj);
> + GEM_BUG_ON(atomic_read(>mm.pages_pin_count) < obj->bind_count);
>  
>  destroy:
>   if (unlikely(i915_vma_is_closed(vma)))
> -- 
> 2.11.0
> 

-- 
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] Add the new case for create GVT-g Linux guest based on KVMGT

2016-12-30 Thread Daniel Vetter
On Sat, Dec 31, 2016 at 01:24:53AM +0800, Terrence Xu wrote:
> GVT-g (Intel® Graphics Virtualization Technology) is a full GPU
> virtualization solution with mediated pass-through support.
> 
> This case is for create basic Linux guest based on KVMGT with VFIO
> framework, it including create vgpu, create guest, check IP address,
> destroy guest, remove vgpu,check dmesg log, etc functions.
> 
> Signed-off-by: Terrence Xu 
> Signed-off-by: Benyu Xu 
> ---
>  tests/Makefile.sources |   1 +
>  tests/gvtg_guest.c | 323 
> +
>  2 files changed, 324 insertions(+)
>  create mode 100644 tests/gvtg_guest.c
> 
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index 04dd2d5..09b936e 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -219,6 +219,7 @@ TESTS_progs = \
>   prime_udl \
>   drv_module_reload \
>   kms_sysfs_edid_timing \
> +gvtg_guest \
>   $(NULL)
>  
>  # IMPORTANT: The ZZ_ tests need to be run last!
> diff --git a/tests/gvtg_guest.c b/tests/gvtg_guest.c
> new file mode 100644
> index 000..b9e6304
> --- /dev/null
> +++ b/tests/gvtg_guest.c
> @@ -0,0 +1,323 @@
> +/*
> + * Copyright 2016 Intel Corporation
> + *   Terrence Xu 
> + *
> + * 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 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.
> + */
> +
> +/*
> + * This program is intended for testing of validate GVT-g virtual machine
> + * creation of allow for testing of KVMGT / XenGT.
> + *
> + * TODO:
> + * Enable more GVT-g related test cases.
> + */
> +#ifdef HAVE_CONFIG_H
> +#include "config.h"
> +#endif
> +
> +#include "igt.h"
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define RANDOM(x) (rand() % x)
> +
> +static unsigned char mac_addr[17] = {'0', '0', ':', '0', '0', ':',
> +'0', '0', ':', '0', '0', ':', '0', '0', ':', '0', '0'};
> +static char uuid[40];
> +static char guest_ip[32];
> +
> +static char qemu_path[PATH_MAX] = {0};
> +static char hda_path[PATH_MAX] = {0};
> +static char bios_path[PATH_MAX] = {0};
> +
> +static int super_system(const char *cmd, char *retmsg, int msg_len)
> +{
> +FILE *fp;
> +int res = -1;
> +if (cmd == NULL || retmsg == NULL || msg_len < 0) {
> +igt_info("Error: %s system paramer invalid!\n", __func__);
> +return 1;
> +}
> +fp = popen(cmd, "r");
> +if (fp == NULL) {
> +perror("popen");
> +igt_info("Error: %s popen error: %s\n", __func__, strerror(errno));
> +return 2;
> +} else {
> +memset(retmsg, 0, msg_len);
> +while (fgets(retmsg, msg_len, fp)) {
> +;
> +};
> +res = pclose(fp);
> +if (res == -1) {
> +igt_info("Error:%s close popen file pointer fp error!\n", 
> __func__);
> +return 3;
> +}
> +retmsg[strlen(retmsg) - 1] = '\0';
> +return 0;
> +}
> +}
> +
> +static void create_guest(void)
> +{
> +char create_qcow_cmd[PATH_MAX] = {0};
> +char create_vgpu_cmd[PATH_MAX] = {0};
> +char create_instance_cmd[PATH_MAX] = {0};
> +
> +sprintf(create_qcow_cmd, "qemu-img create -b %s -f qcow2 %s.qcow2",
> +hda_path, hda_path);
> +sprintf(create_vgpu_cmd, "echo \"%s\" > 
> /sys/bus/pci/devices/:00:02.0/"
> +   "mdev_supported_types/i915-GVTg_V4_1/create", uuid);
> +sprintf(create_instance_cmd, "%s -m 2048 -smp 2 -M pc -name gvtg_guest"
> +   " -hda %s.qcow2 -bios %s -enable-kvm --net nic,macaddr=%s -net"
> +   " tap,script=/etc/qemu-ifup -vga none -device isa-vga -k en-us"
> +   " -serial stdio -vnc :1 -machine 

Re: [Intel-gfx] [PATCH] drm/i915: Remove ring_mask from skl/kbl_gt3_info

2016-12-30 Thread Daniel Vetter
On Fri, Dec 30, 2016 at 04:25:31PM +, Chris Wilson wrote:
> In subject: +Remove duplicate ring_mask. Less freaking out ensues. However,
> note that the gt3+ have BSD2 which is not inherited from BDW_FEATURES.

Wow, I was blind somehow, now idea how I came up with this. At least CI
caught it nicely, too ;-)
-Daniel
-- 
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 3/3] drm/i915: Drop kerneldoc markup from non-kerneldoc enum drrs_refresh_rate_type

2016-12-30 Thread Daniel Vetter
On Fri, Dec 30, 2016 at 09:27:21AM +, Chris Wilson wrote:
> DRRS is not yet kerneldoc despite the allusion prior to enum
> drrs_refresh_rate_type. Drop the '**' to avoid the warnings from
> make htmldocs.
> 
> Signed-off-by: Chris Wilson 

On patch 1&3 here: Reviewed-by: Daniel Vetter 

> ---
>  drivers/gpu/drm/i915/i915_drv.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index c8617360c912..03e94f33108b 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1347,7 +1347,7 @@ struct intel_fbc {
>   const char *no_fbc_reason;
>  };
>  
> -/**
> +/*
>   * HIGH_RR is the highest eDP panel refresh rate read from EDID
>   * LOW_RR is the lowest eDP panel refresh rate found from EDID
>   * parsing for same resolution.
> -- 
> 2.11.0
> 
> ___
> 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 2/3] drm/i915: Complete kerneldoc for struct i915_gem_context

2016-12-30 Thread Daniel Vetter
On Fri, Dec 30, 2016 at 09:27:20AM +, Chris Wilson wrote:
> The existing kerneldoc was outdated, so time for a refresh.
> 
> Signed-off-by: Chris Wilson 

A few bikesheds below, feel free to pick what you like and ignore the
others. Otherwise:

Reviewed-by: Daniel Vetter 

> ---
>  drivers/gpu/drm/i915/i915_drv.h| 214 
> -
>  drivers/gpu/drm/i915/i915_gem.c|  26 ++--
>  drivers/gpu/drm/i915/i915_gem_context.c|  33 ++---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c |   2 +-
>  drivers/gpu/drm/i915/i915_gpu_error.c  |   2 +-
>  drivers/gpu/drm/i915/intel_lrc.c   |   2 +-
>  6 files changed, 211 insertions(+), 68 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 00ecbb4da25e..c8617360c912 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1051,44 +1051,118 @@ enum i915_cache_level {
>  #define DEFAULT_CONTEXT_HANDLE 0
>  
>  /**
> - * struct i915_gem_context - as the name implies, represents a context.
> - * @ref: reference count.
> - * @user_handle: userspace tracking identity for this context.
> - * @remap_slice: l3 row remapping information.
> - * @flags: context specific flags:
> - * CONTEXT_NO_ZEROMAP: do not allow mapping things to page 0.
> - * @file_priv: filp associated with this context (NULL for global default
> - *  context).
> - * @hang_stats: information about the role of this context in possible GPU
> - *   hangs.
> - * @ppgtt: virtual memory space used by this context.
> - * @legacy_hw_ctx: render context backing object and whether it is correctly
> - *initialized (legacy ring submission mechanism only).
> - * @link: link in the global list of contexts.
> + * struct i915_gem_context - client state
>   *
> - * Contexts are memory images used by the hardware to store copies of their
> - * internal state.
> + * The struct i915_gem_context represents the combined view of the driver and
> + * logical hardware state for a particular client.
>   */
>  struct i915_gem_context {
> - struct kref ref;
> + /**
> +  * @i915: i915 device backpointer
> +  */
>   struct drm_i915_private *i915;

Hot of the press, but 4.10 has a new one-line inline format:

/** i915: i915 device backpointer */

Only works if it's really just one line, but perfect for small stuff in
big structs.

Feel free to bikeshed while applying, or not.

> +
> + /**
> +  * @file_priv: owning file descriptor
> +  */
>   struct drm_i915_file_private *file_priv;
> +
> + /**
> +  * @ppgtt: unique address space (GTT)
> +  *
> +  * In full-ppgtt mode, each context has its own address space ensuring
> +  * complete seperation of one client from all others.
> +  */
>   struct i915_hw_ppgtt *ppgtt;
> +
> + /**
> +  * @pid: process id of creator
> +  *
> +  * Note that who created the context may not be the principle user,
> +  * as the context may be shared across a local socket. However,
> +  * that should only affect the default context, all contexts created
> +  * explicitly by the client are expected to be isolated.
> +  */
>   struct pid *pid;
> +
> + /**
> +  * @name: arbitrary name
> +  *
> +  * A name is constructed for the context from the creator's process
> +  * name, pid and user handle in order to uniquely identify the
> +  * context in messages.

... debug messages.

> +  */
>   const char *name;
>  
> + /**
> +  * @link: place with _i915_private.context_list
> +  */
> + struct list_head link;
> +
> + /**
> +  * @ref: reference count
> +  *
> +  * A reference to a context is held by both the client who created it
> +  * and on each request submitted to the hardware using the request
> +  * (to ensure the hardware has access to the state until it has
> +  * finished all pending writes).
> +  */

For refcounts I like to point at the functions meant to manipulate it,
here i915_gem_context_get() and i915_gem_context_put(). Seems good
practice in general to mentions the funcs used to manipulate a bit of
data.

> + struct kref ref;
> +
> + /**
> +  * @flags: small set of booleans
> +  */
>   unsigned long flags;
>  #define CONTEXT_NO_ZEROMAP   BIT(0)
> -#define CONTEXT_NO_ERROR_CAPTURE BIT(1)
> +#define CONTEXT_NO_ERROR_CAPTURE 1
> +#define CONTEXT_CLOSED   2
> +#define CONTEXT_BANNABLE 3
> +#define CONTEXT_BANNED   4
> +#define CONTEXT_FORCE_SINGLE_SUBMISSION  5
>  
> - /* Unique identifier for this context, used by the hw for tracking */
> + /**
> +  * @hw_id: - unique identifier for the context
> +  *
> +  * The hardware needs to uniquely identify the context for a few
> +  * 

Re: [Intel-gfx] [PATCH 01/10] drm : adds Y-coordinate and Colorimetry Format

2016-12-30 Thread Daniel Vetter
On Fri, Dec 30, 2016 at 10:55:15AM +0530, vathsala nagaraju wrote:
> PSR2 vsc revision number hb2( as per table 6-11)is updated to
> 4 or 5 based on Y cordinate and Colorimetry Format as below
> 04h = 3D stereo + PSR/PSR2 + Y-coordinate.
> 05h = -3D stereo- + PSR/PSR2 + Y-coordinate + Pixel Encoding/Colorimetry
> Format indication. A DP Source device is allowed to indicate the pixel
> encoding/colorimetry format to the DP Sink device with VSC SDP only when
> the DP Sink device supports it (
> i.e.,VSC_SDP_EXTENSION_FOR_COLORIMETRY_SUPPORTED bit in the
> DPRX_FEATURE_ENUMERATION_LIST register (DPCD Address 02210h, bit 3;
> is set to 1).
> 
> v2: (Jani)
> - Change DP_PSR_Y_COORDINATE to DP_PSR2_SU_Y_COORDINATE_REQUIRED.
> - Add DP_PSR2_SU_GRANULARITY_REQUIRED.
> - Change DPRX_FEATURE_ENUMERATION_LIST to DP_DPRX.
> - Add GTC_CAP and AV_SYNC_CAP, other bits in DPRX_FEATURE_ENUMERATION_LIST.
> 
> v3: (Jani)
> - Add support for bits 7:4 and 1 as per DP v1.4 for
>   DPRX_FEATURE_ENUMERATION_LIST.
> 
> Cc: Rodrigo Vivi 
> Cc: Jim Bride 
> Signed-off-by: Vathsala Nagaraju 
> Signed-off-by: Patil Deepti 

drm core patches always need to be submitted to dri-devel. In general just
submit a patch series to both mailing lists if that's the case, so that
dri-devel has the full context.
-Daniel

> ---
>  include/drm/drm_dp_helper.h | 13 -
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 55bbeb0..0468135 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -194,7 +194,8 @@
>  # define DP_PSR_SETUP_TIME_0(6 << 1)
>  # define DP_PSR_SETUP_TIME_MASK (7 << 1)
>  # define DP_PSR_SETUP_TIME_SHIFT1
> -
> +# define DP_PSR2_SU_Y_COORDINATE_REQUIRED   (1 << 4)  /* eDP 1.4a */
> +# define DP_PSR2_SU_GRANULARITY_REQUIRED(1 << 5)  /* eDP 1.4b */
>  /*
>   * 0x80-0x8f describe downstream port capabilities, but there are two layouts
>   * based on whether DP_DETAILED_CAP_INFO_AVAILABLE was set.  If it was not,
> @@ -568,6 +569,16 @@
>  #define DP_RECEIVER_ALPM_STATUS  0x200b  /* eDP 1.4 */
>  # define DP_ALPM_LOCK_TIMEOUT_ERROR  (1 << 0)
>  
> +#define DP_DPRX_FEATURE_ENUMERATION_LIST0x2210  /* DP 1.3 */
> +# define DP_GTC_CAP  (1 << 0)  /* DP 1.3 */
> +# define DP_SST_SPLIT_SDP_CAP(1 << 1)  /* DP 
> 1.4 */
> +# define DP_AV_SYNC_CAP  (1 << 2)  /* DP 
> 1.3 */
> +# define DP_VSC_SDP_EXT_FOR_COLORIMETRY_SUPPORTED(1 << 3)  /* DP 1.3 */
> +# define DP_VSC_EXT_VESA_SDP_SUPPORTED   (1 << 4)  /* DP 
> 1.4 */
> +# define DP_VSC_EXT_VESA_SDP_CHAINING_SUPPORTED  (1 << 5)  /* DP 
> 1.4 */
> +# define DP_VSC_EXT_CEA_SDP_SUPPORTED(1 << 6)  /* DP 
> 1.4 */
> +# define DP_VSC_EXT_CEA_SDP_CHAINING_SUPPORTED   (1 << 7)  /* DP 
> 1.4 */
> +
>  /* DP 1.2 Sideband message defines */
>  /* peer device type - DP 1.2a Table 2-92 */
>  #define DP_PEER_DEVICE_NONE  0x0
> -- 
> 1.9.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 7/7] drm/i915: Move intel_atomic_get_shared_dpll_state() to intel_dpll_mgr.c

2016-12-30 Thread Daniel Vetter
On Thu, Dec 29, 2016 at 05:22:13PM +0200, Ander Conselvan de Oliveira wrote:
> The function intel_atomic_get_shared_dpll_state() is only called from
> intel_dpll_mgr.c and it concerns the same data structures as the other
> functions in that file, so move it there and make it static.
> 
> Signed-off-by: Ander Conselvan de Oliveira 
> 
> Suggested-by: Daniel Vetter 

Always love some doc work, thanks for respinning this series.

Reviewed-by: Daniel Vetter 

> ---
>  drivers/gpu/drm/i915/intel_atomic.c   | 31 ---
>  drivers/gpu/drm/i915/intel_dpll_mgr.c | 31 +++
>  drivers/gpu/drm/i915/intel_drv.h  |  2 --
>  3 files changed, 31 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c 
> b/drivers/gpu/drm/i915/intel_atomic.c
> index fa6dc43..aa9160e 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -265,37 +265,6 @@ int intel_atomic_setup_scalers(struct drm_device *dev,
>   return 0;
>  }
>  
> -static void
> -intel_atomic_duplicate_dpll_state(struct drm_i915_private *dev_priv,
> -   struct intel_shared_dpll_state *shared_dpll)
> -{
> - enum intel_dpll_id i;
> -
> - /* Copy shared dpll state */
> - for (i = 0; i < dev_priv->num_shared_dpll; i++) {
> - struct intel_shared_dpll *pll = _priv->shared_dplls[i];
> -
> - shared_dpll[i] = pll->state;
> - }
> -}
> -
> -struct intel_shared_dpll_state *
> -intel_atomic_get_shared_dpll_state(struct drm_atomic_state *s)
> -{
> - struct intel_atomic_state *state = to_intel_atomic_state(s);
> -
> - WARN_ON(!drm_modeset_is_locked(>dev->mode_config.connection_mutex));
> -
> - if (!state->dpll_set) {
> - state->dpll_set = true;
> -
> - intel_atomic_duplicate_dpll_state(to_i915(s->dev),
> -   state->shared_dpll);
> - }
> -
> - return state->shared_dpll;
> -}
> -
>  struct drm_atomic_state *
>  intel_atomic_state_alloc(struct drm_device *dev)
>  {
> diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c 
> b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> index 57d4271..c92a255 100644
> --- a/drivers/gpu/drm/i915/intel_dpll_mgr.c
> +++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> @@ -80,6 +80,37 @@ skl_find_link_pll(struct drm_i915_private *dev_priv, int 
> clock)
>   return pll;
>  }
>  
> +static void
> +intel_atomic_duplicate_dpll_state(struct drm_i915_private *dev_priv,
> +   struct intel_shared_dpll_state *shared_dpll)
> +{
> + enum intel_dpll_id i;
> +
> + /* Copy shared dpll state */
> + for (i = 0; i < dev_priv->num_shared_dpll; i++) {
> + struct intel_shared_dpll *pll = _priv->shared_dplls[i];
> +
> + shared_dpll[i] = pll->state;
> + }
> +}
> +
> +static struct intel_shared_dpll_state *
> +intel_atomic_get_shared_dpll_state(struct drm_atomic_state *s)
> +{
> + struct intel_atomic_state *state = to_intel_atomic_state(s);
> +
> + WARN_ON(!drm_modeset_is_locked(>dev->mode_config.connection_mutex));
> +
> + if (!state->dpll_set) {
> + state->dpll_set = true;
> +
> + intel_atomic_duplicate_dpll_state(to_i915(s->dev),
> +   state->shared_dpll);
> + }
> +
> + return state->shared_dpll;
> +}
> +
>  /**
>   * intel_get_shared_dpll_by_id - get a DPLL given its id
>   * @dev_priv: i915 device instance
> diff --git a/drivers/gpu/drm/i915/intel_drv.h 
> b/drivers/gpu/drm/i915/intel_drv.h
> index 5ee1719..6b02dac 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1815,8 +1815,6 @@ void intel_crtc_destroy_state(struct drm_crtc *crtc,
>  struct drm_crtc_state *state);
>  struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev);
>  void intel_atomic_state_clear(struct drm_atomic_state *);
> -struct intel_shared_dpll_state *
> -intel_atomic_get_shared_dpll_state(struct drm_atomic_state *s);
>  
>  static inline struct intel_crtc_state *
>  intel_atomic_get_crtc_state(struct drm_atomic_state *state,
> -- 
> 2.5.5
> 

-- 
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 0/6] Introduce DP MST Topology state

2016-12-30 Thread Daniel Vetter
On Fri, Dec 30, 2016 at 8:09 AM, Dhinakaran Pandiyan
 wrote:
> Link bandwidth is shared between multiple display streams in DP MST
> configurations. The DP MST topology manager structure maintains the shared
> link bandwidth for a primary link directly connected to the GPU. For atomic
> modesetting drivers, checking if there is sufficient link bandwidth for a
> mode needs to be done during the atomic_check phase to avoid failed
> modesets.
>
> Using the new helpers is optional and the changes should not affect
> drivers that don't support atomic modesetting.
>
> Patches 1-3/6 include cleanups and refactoring.
> Patch 4/6 adds the MST topology state, 5/6 adds helpers to alter the state
> and 6/6 contains i915 changes to use the helpers .
>
> Dhinakaran Pandiyan (6):
>   drm/dp: Store drm_device in MST topology manager
>   drm/dp: Kill unused MST vcpi slot availability tracking
>   drm/dp: Split drm_dp_mst_allocate_vcpi
>   drm/dp: Introduce DP MST topology manager state to track DP link bw
>   drm/dp: Add DP MST helpers to atomically find and release vcpi slots
>   drm/i915/dp: Track available DP MST vcpi time slots

drm core changes always need to be submitted to dri-devel too, but
please keep intel-gfx for the entire set so that CI can test it. I.e.
you need to resubmit ...
-Daniel

>  drivers/gpu/drm/drm_atomic.c   | 66 +
>  drivers/gpu/drm/drm_atomic_helper.c| 10 
>  drivers/gpu/drm/drm_dp_mst_topology.c  | 89 
> ++
>  drivers/gpu/drm/i915/intel_display.c   | 39 ++-
>  drivers/gpu/drm/i915/intel_dp_mst.c| 42 ++--
>  drivers/gpu/drm/i915/intel_drv.h   |  3 ++
>  drivers/gpu/drm/nouveau/nv50_display.c |  5 +-
>  drivers/gpu/drm/radeon/radeon_dp_mst.c |  5 +-
>  include/drm/drm_atomic.h   | 11 +
>  include/drm/drm_dp_mst_helper.h| 35 -
>  10 files changed, 263 insertions(+), 42 deletions(-)
>
> --
> 2.7.4
>



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Move assert of page pin vs bind count into i915_vma_unbind

2016-12-30 Thread Patchwork
== Series Details ==

Series: drm/i915: Move assert of page pin vs bind count into i915_vma_unbind
URL   : https://patchwork.freedesktop.org/series/17324/
State : success

== Summary ==

Series 17324v1 drm/i915: Move assert of page pin vs bind count into 
i915_vma_unbind
https://patchwork.freedesktop.org/api/1.0/series/17324/revisions/1/mbox/


fi-bdw-5557u total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050 total:246  pass:207  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205 total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700 total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900 total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820 total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770  total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770  total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hqtotal:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k total:246  pass:222  dwarn:3   dfail:0   fail:0   skip:21 
fi-skl-6770hqtotal:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600  total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 

e4c1cef7d100f25abfb41035e691b60c555a0ae4 drm-tip: 2016y-12m-30d-17h-03m-36s UTC 
integration manifest
1e615ff7 drm/i915: Move assert of page pin vs bind count into i915_vma_unbind

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3414/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [Linux v4.10.0-rc1+] Still call-traces after suspend-resume (pm? i915? cpu/hotplug?)

2016-12-30 Thread Sedat Dilek
On Fri, Dec 30, 2016 at 3:02 PM, Rafael J. Wysocki  wrote:
> On Fri, Dec 30, 2016 at 12:40 PM, Sedat Dilek  wrote:
>> Hi,
>>
>> I have already reported this issue in [1].
>> One of the issue was solved.
>> Unfortunately, it looks like there is still a different problem here
>> (Ubuntu/precise AMD64).
>>
>> I tried v4.10-rc1 and latest Linus tree up to...
>>
>> commit 98473f9f3f9bd404873cd1178c8be7d6d619f0d1
>> "mm/filemap: fix parameters to test_bit()"
>>
>> Here we go...
>>
>> [   29.636047] BUG: sleeping function called from invalid context at
>> drivers/base/power/runtime.c:1032
>> [   29.636055] in_atomic(): 1, irqs_disabled(): 0, pid: 1500, name: Xorg
>> [   29.636058] 1 lock held by Xorg/1500:
>> [   29.636060]  #0:  (>struct_mutex){+.+.+.}, at:
>> [] i915_mutex_lock_interruptible+0x43/0x140 [i915]
>> [   29.636107] CPU: 0 PID: 1500 Comm: Xorg Not tainted
>> 4.10.0-rc1-6-iniza-amd64 #1
>> [   29.636109] Hardware name: SAMSUNG ELECTRONICS CO., LTD.
>> 530U3BI/530U4BI/530U4BH/530U3BI/530U4BI/530U4BH, BIOS 13XK 03/28/2013
>> [   29.636111] Call Trace:
>> [   29.636120]  dump_stack+0x85/0xc2
>> [   29.636124]  ___might_sleep+0x196/0x260
>> [   29.636127]  __might_sleep+0x53/0xb0
>> [   29.636131]  __pm_runtime_resume+0x7a/0x90
>> [   29.636159]  intel_runtime_pm_get+0x25/0x90 [i915]
>> [   29.636189]  aliasing_gtt_bind_vma+0xaa/0xf0 [i915]
>> [   29.636220]  i915_vma_bind+0xaf/0x1e0 [i915]
>> [   29.636248]  i915_gem_execbuffer_relocate_entry+0x513/0x6f0 [i915]
>> [   29.636272]  i915_gem_execbuffer_relocate_vma.isra.34+0x188/0x250 [i915]
>> [   29.636275]  ? trace_hardirqs_on+0xd/0x10
>> [   29.636294]  ? i915_gem_execbuffer_reserve_vma.isra.31+0x152/0x1f0 [i915]
>> [   29.636316]  ? i915_gem_execbuffer_reserve.isra.32+0x372/0x3a0 [i915]
>> [   29.636342]  i915_gem_do_execbuffer.isra.38+0xa70/0x1a40 [i915]
>> [   29.636347]  ? __might_fault+0x4e/0xb0
>> [   29.636373]  i915_gem_execbuffer2+0xc5/0x260 [i915]
>> [   29.636376]  ? __might_fault+0x4e/0xb0
>> [   29.636395]  drm_ioctl+0x206/0x450 [drm]
>> [   29.636420]  ? i915_gem_execbuffer+0x340/0x340 [i915]
>> [   29.636425]  ? __fget+0x5/0x200
>> [   29.636429]  do_vfs_ioctl+0x91/0x6f0
>> [   29.636431]  ? __fget+0x111/0x200
>> [   29.636433]  ? __fget+0x5/0x200
>> [   29.636436]  SyS_ioctl+0x79/0x90
>> [   29.636441]  entry_SYSCALL_64_fastpath+0x23/0xc6
>>
>> On suspend/resume I see the same call trace.
>> [2] points to the "BUG" line.
>
> Well, this appears to be an i915 issue, but not a serious one.
>
> Clearly, a function that may sleep (pm_runtime_get_sync() in
> intel_runtime_pm_get()) is called with disabled interrupts.  If I
> understand the code correctly, though, it actually is not going to
> sleep in this particular case, because pm_runtime_get_sync() has
> already been called once for this device in the same code path which
> means that this particular instance will return immediately, so this
> is a false-positive (most likely).
>
> Let me see if I the might_sleep_if() assertion in
> __pm_runtime_resume(() can be moved to a better place.
>

OK.
Please CC me if you have something to test for.
Thanks, Rafael.

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


[Intel-gfx] [PATCH] drm/i915: Move assert of page pin vs bind count into i915_vma_unbind

2016-12-30 Thread Chris Wilson
The read of the page pin count and the bind count are unordered,
presenting races in the assert and it firing off incorrectly. Prevent
this by restricting the assert to the vma bind/unbind routines where we
have local cpu ordering between the two.

Signed-off-by: Chris Wilson 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_drv.h | 1 -
 drivers/gpu/drm/i915/i915_vma.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 00ecbb4da25e..1aa33444115a 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -3291,7 +3291,6 @@ __i915_gem_object_unpin_pages(struct drm_i915_gem_object 
*obj)
GEM_BUG_ON(!obj->mm.pages);
 
atomic_dec(>mm.pages_pin_count);
-   GEM_BUG_ON(atomic_read(>mm.pages_pin_count) < obj->bind_count);
 }
 
 static inline void
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 414f0f7f5059..d48c68214611 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -640,6 +640,7 @@ int i915_vma_unbind(struct i915_vma *vma)
 * reaped by the shrinker.
 */
i915_gem_object_unpin_pages(obj);
+   GEM_BUG_ON(atomic_read(>mm.pages_pin_count) < obj->bind_count);
 
 destroy:
if (unlikely(i915_vma_is_closed(vma)))
-- 
2.11.0

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


[Intel-gfx] [PATCH igt] Add the new case for create GVT-g Linux guest based on KVMGT

2016-12-30 Thread Terrence Xu
GVT-g (Intel® Graphics Virtualization Technology) is a full GPU
virtualization solution with mediated pass-through support.

This case is for create basic Linux guest based on KVMGT with VFIO
framework, it including create vgpu, create guest, check IP address,
destroy guest, remove vgpu,check dmesg log, etc functions.

Signed-off-by: Terrence Xu 
Signed-off-by: Benyu Xu 
---
 tests/Makefile.sources |   1 +
 tests/gvtg_guest.c | 323 +
 2 files changed, 324 insertions(+)
 create mode 100644 tests/gvtg_guest.c

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 04dd2d5..09b936e 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -219,6 +219,7 @@ TESTS_progs = \
prime_udl \
drv_module_reload \
kms_sysfs_edid_timing \
+gvtg_guest \
$(NULL)
 
 # IMPORTANT: The ZZ_ tests need to be run last!
diff --git a/tests/gvtg_guest.c b/tests/gvtg_guest.c
new file mode 100644
index 000..b9e6304
--- /dev/null
+++ b/tests/gvtg_guest.c
@@ -0,0 +1,323 @@
+/*
+ * Copyright 2016 Intel Corporation
+ *   Terrence Xu 
+ *
+ * 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 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.
+ */
+
+/*
+ * This program is intended for testing of validate GVT-g virtual machine
+ * creation of allow for testing of KVMGT / XenGT.
+ *
+ * TODO:
+ * Enable more GVT-g related test cases.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "igt.h"
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define RANDOM(x) (rand() % x)
+
+static unsigned char mac_addr[17] = {'0', '0', ':', '0', '0', ':',
+'0', '0', ':', '0', '0', ':', '0', '0', ':', '0', '0'};
+static char uuid[40];
+static char guest_ip[32];
+
+static char qemu_path[PATH_MAX] = {0};
+static char hda_path[PATH_MAX] = {0};
+static char bios_path[PATH_MAX] = {0};
+
+static int super_system(const char *cmd, char *retmsg, int msg_len)
+{
+FILE *fp;
+int res = -1;
+if (cmd == NULL || retmsg == NULL || msg_len < 0) {
+igt_info("Error: %s system paramer invalid!\n", __func__);
+return 1;
+}
+fp = popen(cmd, "r");
+if (fp == NULL) {
+perror("popen");
+igt_info("Error: %s popen error: %s\n", __func__, strerror(errno));
+return 2;
+} else {
+memset(retmsg, 0, msg_len);
+while (fgets(retmsg, msg_len, fp)) {
+;
+};
+res = pclose(fp);
+if (res == -1) {
+igt_info("Error:%s close popen file pointer fp error!\n", 
__func__);
+return 3;
+}
+retmsg[strlen(retmsg) - 1] = '\0';
+return 0;
+}
+}
+
+static void create_guest(void)
+{
+char create_qcow_cmd[PATH_MAX] = {0};
+char create_vgpu_cmd[PATH_MAX] = {0};
+char create_instance_cmd[PATH_MAX] = {0};
+
+sprintf(create_qcow_cmd, "qemu-img create -b %s -f qcow2 %s.qcow2",
+hda_path, hda_path);
+sprintf(create_vgpu_cmd, "echo \"%s\" > /sys/bus/pci/devices/:00:02.0/"
+   "mdev_supported_types/i915-GVTg_V4_1/create", uuid);
+sprintf(create_instance_cmd, "%s -m 2048 -smp 2 -M pc -name gvtg_guest"
+   " -hda %s.qcow2 -bios %s -enable-kvm --net nic,macaddr=%s -net"
+   " tap,script=/etc/qemu-ifup -vga none -device isa-vga -k en-us"
+   " -serial stdio -vnc :1 -machine kernel_irqchip=on -global"
+   " PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -cpu host"
+   " -usb -usbdevice tablet -device vfio-pci,sysfsdev="
+   "/sys/bus/pci/devices/:00:02.0/%s &",
+   qemu_path, hda_path, bios_path, mac_addr, uuid);
+system(create_qcow_cmd);
+system(create_vgpu_cmd);
+

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Remove ring_mask from skl/kbl_gt3_info

2016-12-30 Thread Patchwork
== Series Details ==

Series: drm/i915: Remove ring_mask from skl/kbl_gt3_info
URL   : https://patchwork.freedesktop.org/series/17320/
State : failure

== Summary ==

Series 17320v1 drm/i915: Remove ring_mask from skl/kbl_gt3_info
https://patchwork.freedesktop.org/api/1.0/series/17320/revisions/1/mbox/

Test gem_exec_basic:
Subgroup basic-bsd1:
pass   -> SKIP   (fi-skl-6770hq)
pass   -> SKIP   (fi-skl-6260u)
Subgroup basic-bsd2:
pass   -> SKIP   (fi-skl-6770hq)
pass   -> SKIP   (fi-skl-6260u)
Subgroup gtt-bsd1:
pass   -> SKIP   (fi-skl-6770hq)
pass   -> SKIP   (fi-skl-6260u)
Subgroup gtt-bsd2:
pass   -> SKIP   (fi-skl-6770hq)
pass   -> SKIP   (fi-skl-6260u)
Subgroup readonly-bsd1:
pass   -> SKIP   (fi-skl-6770hq)
pass   -> SKIP   (fi-skl-6260u)
Subgroup readonly-bsd2:
pass   -> SKIP   (fi-skl-6770hq)
pass   -> SKIP   (fi-skl-6260u)
Test gem_exec_gttfill:
Subgroup basic:
pass   -> DMESG-FAIL (fi-snb-2520m)
Test gem_exec_store:
Subgroup basic-bsd1:
pass   -> SKIP   (fi-skl-6770hq)
pass   -> SKIP   (fi-skl-6260u)
Subgroup basic-bsd2:
pass   -> SKIP   (fi-skl-6770hq)
pass   -> SKIP   (fi-skl-6260u)

fi-bdw-5557u total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050 total:246  pass:207  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205 total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700 total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900 total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820 total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770  total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770  total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6700hqtotal:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k total:246  pass:222  dwarn:3   dfail:0   fail:0   skip:21 
fi-skl-6770hqtotal:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-snb-2520m total:246  pass:214  dwarn:0   dfail:1   fail:0   skip:31 
fi-snb-2600  total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 

685f8f68b848ff40e561ea181ba679c58e080739 drm-tip: 2016y-12m-30d-14h-32m-58s UTC 
integration manifest
ae8584e drm/i915: Remove ring_mask from skl/kbl_gt3_info

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3413/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 14/17] drm/cma-helpers: Use recommened kerneldoc for struct member refs

2016-12-30 Thread Daniel Vetter
On Fri, Dec 30, 2016 at 04:11:44PM +0200, Laurent Pinchart wrote:
> Hi Daniel,
> 
> Thank you for the patch.
> 
> On Thursday 29 Dec 2016 21:48:34 Daniel Vetter wrote:
> > I just learned that _name.member_name works and looks pretty
> > even. It doesn't (yet) link to the member directly though, which would
> > be really good for big structures or vfunc tables (where the
> > per-member kerneldoc tends to be long).
> > 
> > Also some minor drive-by polish where it makes sense, I read a lot
> > of docs ...
> > 
> > Cc: Laurent Pinchart 
> > Cc: Jani Nikula 
> > Cc: Chris Wilson 
> > Signed-off-by: Daniel Vetter 
> > ---
> >  drivers/gpu/drm/drm_fb_cma_helper.c  | 24 
> >  drivers/gpu/drm/drm_gem_cma_helper.c | 16 
> >  2 files changed, 20 insertions(+), 20 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c
> > b/drivers/gpu/drm/drm_fb_cma_helper.c index ec081727cd5a..0a0ac77b464b
> > 100644
> > --- a/drivers/gpu/drm/drm_fb_cma_helper.c
> > +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
> > @@ -48,14 +48,14 @@ struct drm_fbdev_cma {
> >   * Provides helper functions for creating a cma (contiguous memory
> > allocator)
> >   * backed framebuffer.
> >   *
> > - * drm_fb_cma_create() is used in the _mode_config_funcs ->fb_create
> > + * drm_fb_cma_create() is used in the _mode_config_funcs.fb_create
> >   * callback function to create a cma backed framebuffer.
> >   *
> >   * An fbdev framebuffer backed by cma is also available by calling
> >   * drm_fbdev_cma_init(). drm_fbdev_cma_fini() tears it down.
> > - * If the _framebuffer_funcs ->dirty callback is set, fb_deferred_io
> > - * will be set up automatically. dirty() is called by
> > - * drm_fb_helper_deferred_io() in process context (struct delayed_work).
> > + * If the _framebuffer_funcs.dirty callback is set, fb_deferred_io will
> > be
> > + * set up automatically. _framebuffer_funcs.dirty is called by
> > + * drm_fb_helper_deferred_io() in process context ( delayed_work).
> >   *
> >   * Example fbdev deferred io code::
> >   *
> > @@ -155,16 +155,16 @@ static struct drm_fb_cma *drm_fb_cma_alloc(struct
> > drm_device *dev,
> > 
> >  /**
> >   * drm_fb_cma_create_with_funcs() - helper function for the
> > - *  _mode_config_funcs ->fb_create
> > - *  callback function
> > + *  _mode_config_funcs.fb_create
> > + *  callback
> >   * @dev: DRM device
> >   * @file_priv: drm file for the ioctl call
> >   * @mode_cmd: metadata from the userspace fb creation request
> >   * @funcs: vtable to be used for the new framebuffer object
> >   *
> >   * This can be used to set _framebuffer_funcs for drivers that need the
> > - * dirty() callback. Use drm_fb_cma_create() if you don't need to change
> > - * _framebuffer_funcs.
> > + * _framebuffer_funcs.dirty callback. Use drm_fb_cma_create() if you
> > don't
> > + * need to change _framebuffer_funcs.
> >   */
> >  struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device
> > *dev, struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd,
> > @@ -221,14 +221,14 @@ struct drm_framebuffer
> > *drm_fb_cma_create_with_funcs(struct drm_device *dev,
> > EXPORT_SYMBOL_GPL(drm_fb_cma_create_with_funcs);
> > 
> >  /**
> > - * drm_fb_cma_create() - _mode_config_funcs ->fb_create callback
> > function
> > + * drm_fb_cma_create() - _mode_config_funcs.fb_create callback function
> >   * @dev: DRM device
> >   * @file_priv: drm file for the ioctl call
> >   * @mode_cmd: metadata from the userspace fb creation request
> >   *
> >   * If your hardware has special alignment or pitch requirements these 
> > should be
> >   * checked before calling this function. Use drm_fb_cma_create_with_funcs()
> > if
> > - * you need to set _framebuffer_funcs ->dirty.
> > + * you need to set _framebuffer_funcs.dirty.
> >   */
> >  struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
> > struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd)
> > @@ -264,7 +264,7 @@ EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_obj);
> >   * @plane: Which plane
> >   * @state: Plane state attach fence to
> >   *
> > - * This should be put into prepare_fb hook of 
> > drm_plane_helper_funcs .
> > + * This should be set as the  drm_plane_helper_funcs.prepare_fb
> > hook.
> >   *
> >   * This function checks if the plane FB has an dma-buf attached, extracts
> >   * the exclusive fence and attaches it to plane state for the atomic helper
> > @@ -491,7 +491,7 @@ static const struct drm_fb_helper_funcs
> > drm_fb_cma_helper_funcs = { * @preferred_bpp: Preferred bits per pixel for
> > the device
> >   * @num_crtc: Number of CRTCs
> >   * @max_conn_count: Maximum number of connectors
> > - * @funcs: fb helper functions, in particular 

Re: [Intel-gfx] [PATCH] drm/i915: Remove ring_mask from skl/kbl_gt3_info

2016-12-30 Thread Chris Wilson
In subject: +Remove duplicate ring_mask. Less freaking out ensues. However,
note that the gt3+ have BSD2 which is not inherited from BDW_FEATURES.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm/i915: Remove ring_mask from skl/kbl_gt3_info

2016-12-30 Thread Daniel Vetter
It's the same as in BDW_FEATURES, no point being inconsistent about
this.

Cc: Rodrigo Vivi 
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_pci.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 7435a73f6bc6..c52c699ed4d7 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -361,7 +361,6 @@ static const struct intel_device_info 
intel_skylake_gt3_info = {
.has_csr = 1,
.has_guc = 1,
.ddb_size = 896,
-   .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
 };
 
 #define GEN9_LP_FEATURES \
@@ -421,7 +420,6 @@ static const struct intel_device_info 
intel_kabylake_gt3_info = {
.has_csr = 1,
.has_guc = 1,
.ddb_size = 896,
-   .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
 };
 
 /*
-- 
2.7.4

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


[Intel-gfx] [drm-tip:drm-tip 390/412] drivers/gpu/drm/armada/armada_debugfs.c:25:2: error: implicit declaration of function 'drm_mm_dump_table'

2016-12-30 Thread kbuild test robot
tree:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
head:   97565ed7e129cd22bcd804d7b607fc5884072daa
commit: b5c3714fe8789745521d8351d75049b9c6a0d26b [390/412] drm/mm: Convert to 
drm_printer
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout b5c3714fe8789745521d8351d75049b9c6a0d26b
# save the attached .config to linux build tree
make.cross ARCH=arm 

All errors (new ones prefixed by >>):

   drivers/gpu/drm/armada/armada_debugfs.c: In function 
'armada_debugfs_gem_linear_show':
>> drivers/gpu/drm/armada/armada_debugfs.c:25:2: error: implicit declaration of 
>> function 'drm_mm_dump_table' [-Werror=implicit-function-declaration]
 drm_mm_dump_table(, >linear);
 ^
   cc1: some warnings being treated as errors

vim +/drm_mm_dump_table +25 drivers/gpu/drm/armada/armada_debugfs.c

19  struct drm_info_node *node = m->private;
20  struct drm_device *dev = node->minor->dev;
21  struct armada_private *priv = dev->dev_private;
22  struct drm_printer p = drm_seq_file_printer(m);
23  
24  mutex_lock(>linear_lock);
  > 25  drm_mm_dump_table(, >linear);
26  mutex_unlock(>linear_lock);
27  
28  return 0;

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm: Avoid NULL dereference of drm_device.dev

2016-12-30 Thread Daniel Vetter
On Fri, Dec 30, 2016 at 02:16:39PM +, Chris Wilson wrote:
> For a virtual device, drm_device.dev is NULL, so becareful not to
> dereference it unconditionally in core code such as drm_dev_register().
> 
> Fixes: 75f6dfe3e652 ("drm: Deduplicate driver initialization message")
> Signed-off-by: Chris Wilson 
> Cc: Gabriel Krisman Bertazi 
> Cc: Daniel Vetter 

Welp, so much for assuming I don't need to CI simple core patches ... I
guess we should roll out bat CI to dri-devel asap, but for that there's
still way too much noise :(

Thanks for the quick fix, applied.
-Daniel
> ---
>  drivers/gpu/drm/drm_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 24d2949fd80b..6285e42b42da 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -767,7 +767,8 @@ int drm_dev_register(struct drm_device *dev, unsigned 
> long flags)
>  
>   DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
>driver->name, driver->major, driver->minor,
> -  driver->patchlevel, driver->date, dev_name(dev->dev),
> +  driver->patchlevel, driver->date,
> +  dev->dev ? dev_name(dev->dev) : "virtual device",
>dev->primary->index);
>  
>   goto out_unlock;
> -- 
> 2.11.0
> 

-- 
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] [PATCH] drm: Avoid NULL dereference of drm_device.dev

2016-12-30 Thread Chris Wilson
For a virtual device, drm_device.dev is NULL, so becareful not to
dereference it unconditionally in core code such as drm_dev_register().

Fixes: 75f6dfe3e652 ("drm: Deduplicate driver initialization message")
Signed-off-by: Chris Wilson 
Cc: Gabriel Krisman Bertazi 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/drm_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 24d2949fd80b..6285e42b42da 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -767,7 +767,8 @@ int drm_dev_register(struct drm_device *dev, unsigned long 
flags)
 
DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
 driver->name, driver->major, driver->minor,
-driver->patchlevel, driver->date, dev_name(dev->dev),
+driver->patchlevel, driver->date,
+dev->dev ? dev_name(dev->dev) : "virtual device",
 dev->primary->index);
 
goto out_unlock;
-- 
2.11.0

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


Re: [Intel-gfx] [PATCH 14/17] drm/cma-helpers: Use recommened kerneldoc for struct member refs

2016-12-30 Thread Laurent Pinchart
Hi Daniel,

Thank you for the patch.

On Thursday 29 Dec 2016 21:48:34 Daniel Vetter wrote:
> I just learned that _name.member_name works and looks pretty
> even. It doesn't (yet) link to the member directly though, which would
> be really good for big structures or vfunc tables (where the
> per-member kerneldoc tends to be long).
> 
> Also some minor drive-by polish where it makes sense, I read a lot
> of docs ...
> 
> Cc: Laurent Pinchart 
> Cc: Jani Nikula 
> Cc: Chris Wilson 
> Signed-off-by: Daniel Vetter 
> ---
>  drivers/gpu/drm/drm_fb_cma_helper.c  | 24 
>  drivers/gpu/drm/drm_gem_cma_helper.c | 16 
>  2 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c
> b/drivers/gpu/drm/drm_fb_cma_helper.c index ec081727cd5a..0a0ac77b464b
> 100644
> --- a/drivers/gpu/drm/drm_fb_cma_helper.c
> +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
> @@ -48,14 +48,14 @@ struct drm_fbdev_cma {
>   * Provides helper functions for creating a cma (contiguous memory
> allocator)
>   * backed framebuffer.
>   *
> - * drm_fb_cma_create() is used in the _mode_config_funcs ->fb_create
> + * drm_fb_cma_create() is used in the _mode_config_funcs.fb_create
>   * callback function to create a cma backed framebuffer.
>   *
>   * An fbdev framebuffer backed by cma is also available by calling
>   * drm_fbdev_cma_init(). drm_fbdev_cma_fini() tears it down.
> - * If the _framebuffer_funcs ->dirty callback is set, fb_deferred_io
> - * will be set up automatically. dirty() is called by
> - * drm_fb_helper_deferred_io() in process context (struct delayed_work).
> + * If the _framebuffer_funcs.dirty callback is set, fb_deferred_io will
> be
> + * set up automatically. _framebuffer_funcs.dirty is called by
> + * drm_fb_helper_deferred_io() in process context ( delayed_work).
>   *
>   * Example fbdev deferred io code::
>   *
> @@ -155,16 +155,16 @@ static struct drm_fb_cma *drm_fb_cma_alloc(struct
> drm_device *dev,
> 
>  /**
>   * drm_fb_cma_create_with_funcs() - helper function for the
> - *  _mode_config_funcs ->fb_create
> - *  callback function
> + *  _mode_config_funcs.fb_create
> + *  callback
>   * @dev: DRM device
>   * @file_priv: drm file for the ioctl call
>   * @mode_cmd: metadata from the userspace fb creation request
>   * @funcs: vtable to be used for the new framebuffer object
>   *
>   * This can be used to set _framebuffer_funcs for drivers that need the
> - * dirty() callback. Use drm_fb_cma_create() if you don't need to change
> - * _framebuffer_funcs.
> + * _framebuffer_funcs.dirty callback. Use drm_fb_cma_create() if you
> don't
> + * need to change _framebuffer_funcs.
>   */
>  struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device
> *dev, struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd,
> @@ -221,14 +221,14 @@ struct drm_framebuffer
> *drm_fb_cma_create_with_funcs(struct drm_device *dev,
> EXPORT_SYMBOL_GPL(drm_fb_cma_create_with_funcs);
> 
>  /**
> - * drm_fb_cma_create() - _mode_config_funcs ->fb_create callback
> function
> + * drm_fb_cma_create() - _mode_config_funcs.fb_create callback function
>   * @dev: DRM device
>   * @file_priv: drm file for the ioctl call
>   * @mode_cmd: metadata from the userspace fb creation request
>   *
>   * If your hardware has special alignment or pitch requirements these 
> should be
>   * checked before calling this function. Use drm_fb_cma_create_with_funcs()
> if
> - * you need to set _framebuffer_funcs ->dirty.
> + * you need to set _framebuffer_funcs.dirty.
>   */
>  struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
>   struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd)
> @@ -264,7 +264,7 @@ EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_obj);
>   * @plane: Which plane
>   * @state: Plane state attach fence to
>   *
> - * This should be put into prepare_fb hook of 
> drm_plane_helper_funcs .
> + * This should be set as the  drm_plane_helper_funcs.prepare_fb
> hook.
>   *
>   * This function checks if the plane FB has an dma-buf attached, extracts
>   * the exclusive fence and attaches it to plane state for the atomic helper
> @@ -491,7 +491,7 @@ static const struct drm_fb_helper_funcs
> drm_fb_cma_helper_funcs = { * @preferred_bpp: Preferred bits per pixel for
> the device
>   * @num_crtc: Number of CRTCs
>   * @max_conn_count: Maximum number of connectors
> - * @funcs: fb helper functions, in particular fb_probe()
> + * @funcs: fb helper functions, in particular a custom dirty() callback

Doesn't this belong to a different patch ?

>   * Returns a newly allocated drm_fbdev_cma struct or a ERR_PTR.
>   */
> diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c
> 

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Drain freed objects for mmap space exhaustion

2016-12-30 Thread Patchwork
== Series Details ==

Series: drm/i915: Drain freed objects for mmap space exhaustion
URL   : https://patchwork.freedesktop.org/series/17312/
State : success

== Summary ==

Series 17312v1 drm/i915: Drain freed objects for mmap space exhaustion
https://patchwork.freedesktop.org/api/1.0/series/17312/revisions/1/mbox/

Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
fail   -> PASS   (fi-ivb-3520m)
Subgroup suspend-read-crc-pipe-b:
dmesg-fail -> PASS   (fi-ivb-3520m)
Subgroup suspend-read-crc-pipe-c:
dmesg-warn -> PASS   (fi-ivb-3770)
dmesg-fail -> PASS   (fi-ivb-3520m)

fi-bdw-5557u total:227  pass:212  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050 total:227  pass:188  dwarn:0   dfail:0   fail:0   skip:38 
fi-bxt-j4205 total:227  pass:204  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700 total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900 total:227  pass:199  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820 total:227  pass:195  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770  total:227  pass:207  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r total:227  pass:207  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m total:227  pass:206  dwarn:0   dfail:0   fail:0   skip:20 
fi-ivb-3770  total:227  pass:205  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u total:227  pass:205  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u total:227  pass:213  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hqtotal:227  pass:207  dwarn:0   dfail:0   fail:0   skip:19 
fi-skl-6700k total:227  pass:202  dwarn:3   dfail:0   fail:0   skip:21 
fi-skl-6770hqtotal:227  pass:213  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m total:227  pass:195  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600  total:227  pass:194  dwarn:0   dfail:0   fail:0   skip:32 

97565ed7e129cd22bcd804d7b607fc5884072daa drm-tip: 2016y-12m-30d-12h-57m-05s UTC 
integration manifest
c770967 drm/i915: Drain freed objects for mmap space exhaustion

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3411/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [Linux v4.10.0-rc1+] Still call-traces after suspend-resume (pm? i915? cpu/hotplug?)

2016-12-30 Thread Rafael J. Wysocki
On Fri, Dec 30, 2016 at 12:40 PM, Sedat Dilek  wrote:
> Hi,
>
> I have already reported this issue in [1].
> One of the issue was solved.
> Unfortunately, it looks like there is still a different problem here
> (Ubuntu/precise AMD64).
>
> I tried v4.10-rc1 and latest Linus tree up to...
>
> commit 98473f9f3f9bd404873cd1178c8be7d6d619f0d1
> "mm/filemap: fix parameters to test_bit()"
>
> Here we go...
>
> [   29.636047] BUG: sleeping function called from invalid context at
> drivers/base/power/runtime.c:1032
> [   29.636055] in_atomic(): 1, irqs_disabled(): 0, pid: 1500, name: Xorg
> [   29.636058] 1 lock held by Xorg/1500:
> [   29.636060]  #0:  (>struct_mutex){+.+.+.}, at:
> [] i915_mutex_lock_interruptible+0x43/0x140 [i915]
> [   29.636107] CPU: 0 PID: 1500 Comm: Xorg Not tainted
> 4.10.0-rc1-6-iniza-amd64 #1
> [   29.636109] Hardware name: SAMSUNG ELECTRONICS CO., LTD.
> 530U3BI/530U4BI/530U4BH/530U3BI/530U4BI/530U4BH, BIOS 13XK 03/28/2013
> [   29.636111] Call Trace:
> [   29.636120]  dump_stack+0x85/0xc2
> [   29.636124]  ___might_sleep+0x196/0x260
> [   29.636127]  __might_sleep+0x53/0xb0
> [   29.636131]  __pm_runtime_resume+0x7a/0x90
> [   29.636159]  intel_runtime_pm_get+0x25/0x90 [i915]
> [   29.636189]  aliasing_gtt_bind_vma+0xaa/0xf0 [i915]
> [   29.636220]  i915_vma_bind+0xaf/0x1e0 [i915]
> [   29.636248]  i915_gem_execbuffer_relocate_entry+0x513/0x6f0 [i915]
> [   29.636272]  i915_gem_execbuffer_relocate_vma.isra.34+0x188/0x250 [i915]
> [   29.636275]  ? trace_hardirqs_on+0xd/0x10
> [   29.636294]  ? i915_gem_execbuffer_reserve_vma.isra.31+0x152/0x1f0 [i915]
> [   29.636316]  ? i915_gem_execbuffer_reserve.isra.32+0x372/0x3a0 [i915]
> [   29.636342]  i915_gem_do_execbuffer.isra.38+0xa70/0x1a40 [i915]
> [   29.636347]  ? __might_fault+0x4e/0xb0
> [   29.636373]  i915_gem_execbuffer2+0xc5/0x260 [i915]
> [   29.636376]  ? __might_fault+0x4e/0xb0
> [   29.636395]  drm_ioctl+0x206/0x450 [drm]
> [   29.636420]  ? i915_gem_execbuffer+0x340/0x340 [i915]
> [   29.636425]  ? __fget+0x5/0x200
> [   29.636429]  do_vfs_ioctl+0x91/0x6f0
> [   29.636431]  ? __fget+0x111/0x200
> [   29.636433]  ? __fget+0x5/0x200
> [   29.636436]  SyS_ioctl+0x79/0x90
> [   29.636441]  entry_SYSCALL_64_fastpath+0x23/0xc6
>
> On suspend/resume I see the same call trace.
> [2] points to the "BUG" line.

Well, this appears to be an i915 issue, but not a serious one.

Clearly, a function that may sleep (pm_runtime_get_sync() in
intel_runtime_pm_get()) is called with disabled interrupts.  If I
understand the code correctly, though, it actually is not going to
sleep in this particular case, because pm_runtime_get_sync() has
already been called once for this device in the same code path which
means that this particular instance will return immediately, so this
is a false-positive (most likely).

Let me see if I the might_sleep_if() assertion in
__pm_runtime_resume(() can be moved to a better place.

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


Re: [Intel-gfx] [PATCH 11/17] drm/cma-helper: simplify setup for drivers with ->dirty callbacks

2016-12-30 Thread Laurent Pinchart
Hi Daniel,

Thank you for the patch.

On Thursday 29 Dec 2016 21:48:31 Daniel Vetter wrote:
> If we store the fb funcs pointer, we can remove a bit of boilerplate.
> Also remove the _fbdev_ in the example code, since the fb_funcs->dirty
> callback has nothing to do with fbdev. It's a KMS feature, only
> used by the fbdev deferred_io support to implement flushing/upload.
> 
> Cc: Noralf Trønnes 
> Cc: Laurent Pinchart 
> Signed-off-by: Daniel Vetter 

Reviewed-by: Laurent Pinchart 

> ---
>  drivers/gpu/drm/drm_fb_cma_helper.c | 58 +++--
>  include/drm/drm_fb_cma_helper.h |  5 +---
>  2 files changed, 21 insertions(+), 42 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c
> b/drivers/gpu/drm/drm_fb_cma_helper.c index 76cb1aa1b089..ec081727cd5a
> 100644
> --- a/drivers/gpu/drm/drm_fb_cma_helper.c
> +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
> @@ -39,6 +39,7 @@ struct drm_fb_cma {
>  struct drm_fbdev_cma {
>   struct drm_fb_helperfb_helper;
>   struct drm_fb_cma   *fb;
> + const struct drm_framebuffer_funcs *fb_funcs;
>  };
> 
>  /**
> @@ -58,39 +59,29 @@ struct drm_fbdev_cma {
>   *
>   * Example fbdev deferred io code::
>   *
> - * static int driver_fbdev_fb_dirty(struct drm_framebuffer *fb,
> - *  struct drm_file *file_priv,
> - *  unsigned flags, unsigned color,
> - *  struct drm_clip_rect *clips,
> - *  unsigned num_clips)
> + * static int driver_fb_dirty(struct drm_framebuffer *fb,
> + *struct drm_file *file_priv,
> + *unsigned flags, unsigned color,
> + *struct drm_clip_rect *clips,
> + *unsigned num_clips)
>   * {
>   * struct drm_gem_cma_object *cma = drm_fb_cma_get_gem_obj(fb, 0);
>   * ... push changes ...
>   * return 0;
>   * }
>   *
> - * static struct drm_framebuffer_funcs driver_fbdev_fb_funcs = {
> + * static struct drm_framebuffer_funcs driver_fb_funcs = {
>   * .destroy   = drm_fb_cma_destroy,
>   * .create_handle = drm_fb_cma_create_handle,
> - * .dirty = driver_fbdev_fb_dirty,
> + * .dirty = driver_fb_dirty,
>   * };
>   *
> - * static int driver_fbdev_create(struct drm_fb_helper *helper,
> - * struct drm_fb_helper_surface_size *sizes)
> - * {
> - * return drm_fbdev_cma_create_with_funcs(helper, sizes,
> - *_fbdev_fb_funcs);
> - * }
> - *
> - * static const struct drm_fb_helper_funcs driver_fb_helper_funcs = {
> - * .fb_probe = driver_fbdev_create,
> - * };
> + * Initialize::
>   *
> - * Initialize:
>   * fbdev = drm_fbdev_cma_init_with_funcs(dev, 16,
>   *   dev->mode_config.num_crtc,
>   *  
> dev->mode_config.num_connector, - *
>   _fb_helper_funcs); + *  
> _fb_funcs);
>   *
>   */
> 
> @@ -408,13 +399,9 @@ static void drm_fbdev_cma_defio_fini(struct fb_info
> *fbi) kfree(fbi->fbops);
>  }
> 
> -/*
> - * For use in a (struct drm_fb_helper_funcs *)->fb_probe callback function
> that - * needs custom struct drm_framebuffer_funcs, like dirty() for
> deferred_io use. - */
> -int drm_fbdev_cma_create_with_funcs(struct drm_fb_helper *helper,
> - struct drm_fb_helper_surface_size *sizes,
> - const struct drm_framebuffer_funcs *funcs)
> +static int
> +drm_fbdev_cma_create(struct drm_fb_helper *helper,
> + struct drm_fb_helper_surface_size *sizes)
>  {
>   struct drm_fbdev_cma *fbdev_cma = to_fbdev_cma(helper);
>   struct drm_mode_fb_cmd2 mode_cmd = { 0 };
> @@ -450,7 +437,8 @@ int drm_fbdev_cma_create_with_funcs(struct drm_fb_helper
> *helper, goto err_gem_free_object;
>   }
> 
> - fbdev_cma->fb = drm_fb_cma_alloc(dev, _cmd, , 1, funcs);
> + fbdev_cma->fb = drm_fb_cma_alloc(dev, _cmd, , 1,
> +  fbdev_cma->fb_funcs);
>   if (IS_ERR(fbdev_cma->fb)) {
>   dev_err(dev->dev, "Failed to allocate DRM framebuffer.\n");
>   ret = PTR_ERR(fbdev_cma->fb);
> @@ -476,7 +464,7 @@ int drm_fbdev_cma_create_with_funcs(struct drm_fb_helper
> *helper, fbi->screen_size = size;
>   fbi->fix.smem_len = size;
> 
> - if (funcs->dirty) {
> + if (fbdev_cma->fb_funcs->dirty) {
>   ret = drm_fbdev_cma_defio_init(fbi, obj);
>   if (ret)
>   goto err_cma_destroy;
> @@ -492,13 +480,6 @@ int drm_fbdev_cma_create_with_funcs(struct
> drm_fb_helper *helper, 

Re: [Intel-gfx] [PATCH 10/17] drm/atomic-helpers: Remove outdated comment

2016-12-30 Thread Daniel Vetter
On Fri, Dec 30, 2016 at 12:18:33PM +0100, David Herrmann wrote:
> Hi
> 
> On Thu, Dec 29, 2016 at 9:48 PM, Daniel Vetter  wrote:
> > We forgot to clean this up when adding connector refcounting.
> >
> > Signed-off-by: Daniel Vetter 
> > ---
> >  drivers/gpu/drm/drm_atomic_helper.c | 5 -
> >  1 file changed, 5 deletions(-)
> 
> Patch 1-10 all:
> 
> Reviewed-by: David Herrmann 

All applied, thanks a lot for your review.
-Daniel

> 
> Thanks
> David
> 
> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
> > b/drivers/gpu/drm/drm_atomic_helper.c
> > index 8eab8944c736..5e5224460042 100644
> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > @@ -3286,11 +3286,6 @@ EXPORT_SYMBOL(drm_atomic_helper_duplicate_state);
> >  void
> >  __drm_atomic_helper_connector_destroy_state(struct drm_connector_state 
> > *state)
> >  {
> > -   /*
> > -* This is currently a placeholder so that drivers that subclass the
> > -* state will automatically do the right thing if code is ever added
> > -* to this function.
> > -*/
> > if (state->crtc)
> > drm_connector_unreference(state->connector);
> >  }
> > --
> > 2.7.4
> >
> > ___
> > dri-devel mailing list
> > dri-de...@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
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] [PATCH i-g-t v4] tests/kms_plane_lowres: Plane visibility after atomic modesets

2016-12-30 Thread Mika Kahola
Testcase for plane visibility after atomic modesets. The idea of the test
is the following:

 - draw a blue screen with high resolution
 - enable a yellow plane, visible, in lower-left corner
 - set a new lower resolution mode (1024x768) that makes plane invisible
 - check from debugfs 'i915_display_info' that the plane is invisible
 - switch back to higher resolution mode
 - check from debugfs 'i915_display_info' that the plane is visible again
 - repeat number of iterations, default 64

v2: allow test to be run on non-Intel drivers (Daniel)
moved test for plane visibility to as helper function (Daniel)
moved get_vblank() function to be part of helper functions (Daniel)
rename 'tiling' parameter as 'modifier' (Daniel)
select a mode from a list so that the plane should be invisible.
use default 1024x768 mode only as a fallback if decent mode has not
been found (Daniel)
add tiling MODE_NONE (Daniel)

v3: draw as many overlay planes as the platform supports + cursor plane
on top of each other on lower-left corner
skip the test if i915_display_info file is not available
test plane visibility with igt_assert_plane_visibility() function
drop option for multiple test iterations (Daniel Vetter)

v4: switch 'for_each_connected_output()' to
'for_each_valid_output_on_pipe()' (Maarten)

Cc: Daniel Stone 
Cc: Maarten Lankhorst 

Signed-off-by: Mika Kahola 
---
 lib/igt_kms.c| 161 ++
 lib/igt_kms.h|  23 
 tests/Makefile.sources   |   1 +
 tests/kms_plane_lowres.c | 344 +++
 4 files changed, 529 insertions(+)
 create mode 100644 tests/kms_plane_lowres.c

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 5312f8d8..c823a3b 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -324,6 +324,24 @@ const char *kmstest_pipe_name(enum pipe pipe)
 }
 
 /**
+ * kmstest_pipe_to_index:
+ *@pipe: display pipe in string format
+ *
+ * Returns: index to corresponding pipe
+ */
+int kmstest_pipe_to_index(char pipe)
+{
+   if (pipe == 'A')
+   return 0;
+   else if (pipe == 'B')
+   return 1;
+   else if (pipe == 'C')
+   return 2;
+   else
+   return -EINVAL;
+}
+
+/**
  * kmstest_plane_name:
  * @plane: display plane
  *
@@ -1181,6 +1199,149 @@ int kmstest_get_crtc_idx(drmModeRes *res, uint32_t 
crtc_id)
igt_assert(false);
 }
 
+static inline uint32_t pipe_select(int pipe)
+{
+   if (pipe > 1)
+   return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT;
+   else if (pipe > 0)
+   return DRM_VBLANK_SECONDARY;
+   else
+   return 0;
+}
+
+unsigned int kmstest_get_vblank(int fd, int pipe, unsigned int flags)
+{
+   union drm_wait_vblank vbl;
+
+   memset(, 0, sizeof(vbl));
+   vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe) | flags;
+   if (drmIoctl(fd, DRM_IOCTL_WAIT_VBLANK, ))
+   return 0;
+
+   return vbl.reply.sequence;
+}
+
+static void get_plane(char *str, int type, struct kmstest_plane *plane)
+{
+   int ret;
+   char buf[256];
+
+   plane->plane = type;
+   ret = sscanf(str + 12, "%d%*c %*s %[^n]s",
+>id,
+buf);
+   igt_assert_eq(ret, 2);
+
+   ret = sscanf(buf + 9, "%4d%*c%4d%*c", >pos_x, >pos_y);
+   igt_assert_eq(ret, 2);
+
+   ret = sscanf(buf + 30, "%4d%*c%4d%*c", >width, >height);
+   igt_assert_eq(ret, 2);
+}
+
+static int parse_planes(FILE *fid, struct kmstest_plane *plane)
+{
+   char tmp[256];
+   int nplanes;
+   int ovl;
+
+   ovl = 0;
+   nplanes = 0;
+   while (fgets(tmp, 256, fid) != NULL) {
+   igt_assert_neq(nplanes, IGT_MAX_PLANES);
+   if (strstr(tmp, "type=PRI") != NULL) {
+   get_plane(tmp, IGT_PLANE_PRIMARY, [nplanes]);
+   nplanes++;
+   } else if (strstr(tmp, "type=OVL") != NULL) {
+   get_plane(tmp, IGT_PLANE_2 + ovl, [nplanes]);
+   ovl++;
+   nplanes++;
+   } else if (strstr(tmp, "type=CUR") != NULL) {
+   get_plane(tmp, IGT_PLANE_CURSOR, [nplanes]);
+   nplanes++;
+   break;
+   }
+   }
+
+   return nplanes;
+}
+
+static void parse_crtc(char *info, struct kmstest_crtc *crtc)
+{
+   char buf[256];
+   int ret;
+   char pipe;
+
+   ret = sscanf(info + 4, "%d%*c %*s %c%*c %*s %s%*c",
+>id, , buf);
+   igt_assert_eq(ret, 3);
+
+   crtc->pipe = kmstest_pipe_to_index(pipe);
+   igt_assert(crtc->pipe >= 0);
+
+   ret = sscanf(buf + 6, "%d%*c%d%*c",
+>width, >height);
+   igt_assert_eq(ret, 2);
+}
+
+void kmstest_get_crtc(enum pipe pipe, struct 

[Intel-gfx] [PATCH] drm/i915: Drain freed objects for mmap space exhaustion

2016-12-30 Thread Chris Wilson
As we now use a deferred free queue for objects, simply retiring the
active objects is not enough to immediately free them and recover their
mmap space - we must now also drain the freed object list.

Fixes: fbbd37b36fa5 ("drm/i915: Move object release to a freelist + worker"
Signed-off-by: Chris Wilson 
Cc: Joonas Lahtinen 
Cc: 
---
 drivers/gpu/drm/i915/i915_gem.c | 22 ++
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 636e388e19de..a8771d9d4e0e 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2119,20 +2119,18 @@ static int i915_gem_object_create_mmap_offset(struct 
drm_i915_gem_object *obj)
if (!err)
return 0;
 
-   /* We can idle the GPU locklessly to flush stale objects, but in order
-* to claim that space for ourselves, we need to take the big
-* struct_mutex to free the requests+objects and allocate our slot.
-*/
-   err = i915_gem_wait_for_idle(dev_priv, I915_WAIT_INTERRUPTIBLE);
-   if (err)
-   return err;
+   /* Attempt to reap some mmap space from dead objects */
+   do {
+   err = i915_gem_wait_for_idle(dev_priv, I915_WAIT_INTERRUPTIBLE);
+   if (err)
+   break;
 
-   err = i915_mutex_lock_interruptible(_priv->drm);
-   if (!err) {
-   i915_gem_retire_requests(dev_priv);
+   i915_gem_drain_freed_objects(dev_priv);
err = drm_gem_create_mmap_offset(>base);
-   mutex_unlock(_priv->drm.struct_mutex);
-   }
+   if (!err)
+   break;
+
+   } while (flush_delayed_work(_priv->gt.retire_work));
 
return err;
 }
-- 
2.11.0

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


[Intel-gfx] [PATCH i-g-t 2/5] tests/kms_atomic_transition: Add TEST_ONLY flag

2016-12-30 Thread Mika Kahola
Add TEST_ONLY flag to test atomic transition display commits without
actual real-life commit.

Signed-off-by: Mika Kahola 
---
 tests/kms_atomic_transition.c | 227 --
 1 file changed, 152 insertions(+), 75 deletions(-)

diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
index 851ffc9..2505210 100644
--- a/tests/kms_atomic_transition.c
+++ b/tests/kms_atomic_transition.c
@@ -68,7 +68,7 @@ wm_setup_plane(igt_display_t *display, enum pipe pipe,
}
 }
 
-static bool skip_on_unsupported_nonblocking_modeset(igt_display_t *display)
+static bool skip_on_unsupported_nonblocking_modeset(igt_display_t *display, 
bool test_only)
 {
enum pipe pipe;
int ret;
@@ -81,12 +81,14 @@ static bool 
skip_on_unsupported_nonblocking_modeset(igt_display_t *display)
 */
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 (!test_only) {
+   ret = igt_display_try_commit_atomic(display, 
DRM_MODE_ATOMIC_ALLOW_MODESET | DRM_MODE_ATOMIC_NONBLOCK, NULL);
 
-   if (ret == -EINVAL)
-   return true;
+   if (ret == -EINVAL)
+   return true;
 
-   igt_assert_eq(ret, 0);
+   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)
@@ -267,7 +269,7 @@ retry:
  */
 static void
 run_transition_test(igt_display_t *display, enum pipe pipe, igt_output_t 
*output,
-   enum transition_type type, bool nonblocking)
+   enum transition_type type, bool nonblocking, bool test_only)
 {
struct igt_fb fb, argb_fb, sprite_fb;
drmModeModeInfo *mode, override_mode;
@@ -276,6 +278,10 @@ run_transition_test(igt_display_t *display, enum pipe 
pipe, igt_output_t *output
struct plane_parms parms[IGT_MAX_PLANES];
bool skip_test = false;
unsigned flags = DRM_MODE_PAGE_FLIP_EVENT;
+   int ret;
+
+   if (test_only)
+   flags = DRM_MODE_ATOMIC_ALLOW_MODESET | 
DRM_MODE_ATOMIC_TEST_ONLY;
 
if (nonblocking)
flags |= DRM_MODE_ATOMIC_NONBLOCK;
@@ -295,18 +301,26 @@ run_transition_test(igt_display_t *display, enum pipe 
pipe, igt_output_t *output
wm_setup_plane(display, pipe, 0, NULL);
 
if (flags & DRM_MODE_ATOMIC_ALLOW_MODESET) {
-   skip_test = nonblocking && 
skip_on_unsupported_nonblocking_modeset(display);
+   skip_test = nonblocking && 
skip_on_unsupported_nonblocking_modeset(display, test_only);
if (skip_test)
goto cleanup;
 
igt_output_set_pipe(output, PIPE_NONE);
 
-   igt_display_commit2(display, COMMIT_ATOMIC);
+   if (test_only) {
+   ret = igt_display_try_commit_atomic(display, flags, 
NULL);
+   igt_assert_eq(ret, 0);
+   } else
+   igt_display_commit2(display, COMMIT_ATOMIC);
 
igt_output_set_pipe(output, pipe);
}
 
-   igt_display_commit2(display, COMMIT_ATOMIC);
+   if (test_only) {
+   ret = igt_display_try_commit_atomic(display, flags, NULL);
+   igt_assert_eq(ret, 0);
+   } else
+   igt_display_commit2(display, COMMIT_ATOMIC);
 
setup_parms(display, pipe, mode, _fb, _fb, parms);
 
@@ -315,17 +329,22 @@ run_transition_test(igt_display_t *display, enum pipe 
pipe, igt_output_t *output
 
wm_setup_plane(display, pipe, i, parms);
 
-   igt_display_commit_atomic(display, flags, (void *)(unsigned 
long)i);
-   drmHandleEvent(display->drm_fd, _events);
+   ret = igt_display_try_commit_atomic(display, flags, (void 
*)(unsigned long)i);
+   igt_assert_eq(ret, 0);
+
+   if (!test_only)
+   drmHandleEvent(display->drm_fd, _events);
 
if (type == TRANSITION_MODESET_DISABLE) {
igt_output_set_pipe(output, PIPE_NONE);
 
wm_setup_plane(display, pipe, 0, parms);
 
-   igt_display_commit_atomic(display, flags, (void *)0UL);
+   ret = igt_display_try_commit_atomic(display, flags, 
(void *)0UL);
+   igt_assert_eq(ret, 0);
 
-   drmHandleEvent(display->drm_fd, _events);
+   if (!test_only)
+   drmHandleEvent(display->drm_fd, _events);
} else {
uint32_t j;
 
@@ -336,15 +355,21 @@ run_transition_test(igt_display_t *display, enum pipe 
pipe, igt_output_t *output
 

[Intel-gfx] [PATCH i-g-t 3/5] tests/kms_plane_scaling: Add TEST_ONLY flag

2016-12-30 Thread Mika Kahola
Add TEST_ONLY flag to test atomic scaling without
actually committing the changes.

Signed-off-by: Mika Kahola 
---
 tests/kms_plane_scaling.c | 152 --
 1 file changed, 135 insertions(+), 17 deletions(-)

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 368da09..ae3ce40 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -55,9 +55,18 @@ typedef struct {
 
 #define FILE_NAME   "1080p-left.png"
 
+/* Command line parameters. */
+struct {
+   bool test_only;
+} opt = {
+   .test_only = false,
+};
+
 static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
-   igt_plane_t *plane, drmModeModeInfo *mode, enum 
igt_commit_style s)
+igt_plane_t *plane, drmModeModeInfo *mode,
+enum igt_commit_style s, bool test_only)
 {
+   int ret;
igt_display_t *display = >display;
 
igt_output_set_pipe(output, pipe);
@@ -94,7 +103,6 @@ static void prepare_crtc(data_t *data, igt_output_t *output, 
enum pipe pipe,
 
igt_plane_set_fb(plane, >fb1);
if (s == COMMIT_LEGACY) {
-   int ret;
ret = drmModeSetCrtc(data->drm_fd,
plane->pipe->crtc_id,
data->fb_id1,
@@ -103,6 +111,12 @@ static void prepare_crtc(data_t *data, igt_output_t 
*output, enum pipe pipe,
1,
mode);
igt_assert_eq(ret, 0);
+   } else if (test_only) {
+   ret = igt_display_try_commit2(display,
+ DRM_MODE_ATOMIC_TEST_ONLY |
+ DRM_MODE_ATOMIC_ALLOW_MODESET |
+ COMMIT_ATOMIC);
+   igt_assert_eq(ret, 0);
} else {
igt_display_commit2(display, s);
}
@@ -175,13 +189,14 @@ static void iterate_plane_scaling(data_t *d, 
drmModeModeInfo *mode)
}
 }
 
-static void test_plane_scaling(data_t *d)
+static void test_plane_scaling(data_t *d, bool test_only)
 {
igt_display_t *display = >display;
igt_output_t *output;
enum pipe pipe;
int valid_tests = 0;
int primary_plane_scaling = 0; /* For now */
+   int ret;
 
igt_require(d->num_scalers);
 
@@ -208,7 +223,7 @@ static void test_plane_scaling(data_t *d)
 
/* Set up display with plane 1 */
d->plane1 = igt_output_get_plane(output, IGT_PLANE_PRIMARY);
-   prepare_crtc(d, output, pipe, d->plane1, mode, 
COMMIT_UNIVERSAL);
+   prepare_crtc(d, output, pipe, d->plane1, mode, 
COMMIT_UNIVERSAL, test_only);
 
if (primary_plane_scaling) {
/* Primary plane upscaling */
@@ -216,14 +231,30 @@ static void test_plane_scaling(data_t *d)
igt_fb_set_size(>fb1, d->plane1, 500, 500);
igt_plane_set_position(d->plane1, 0, 0);
igt_plane_set_size(d->plane1, mode->hdisplay, 
mode->vdisplay);
-   igt_display_commit2(display, COMMIT_UNIVERSAL);
+
+   if (test_only) {
+   ret = igt_display_try_commit_atomic(>display,
+   
DRM_MODE_ATOMIC_TEST_ONLY | DRM_MODE_ATOMIC_ALLOW_MODESET,
+   NULL);
+   igt_assert_eq(ret, 0);
+   } else {
+   igt_display_commit2(display, COMMIT_UNIVERSAL);
+   }
 
/* Primary plane 1:1 no scaling */
igt_fb_set_position(>fb1, d->plane1, 0, 0);
igt_fb_set_size(>fb1, d->plane1, d->fb1.width, 
d->fb1.height);
igt_plane_set_position(d->plane1, 0, 0);
igt_plane_set_size(d->plane1, mode->hdisplay, 
mode->vdisplay);
-   igt_display_commit2(display, COMMIT_UNIVERSAL);
+
+   if (test_only) {
+   ret = igt_display_try_commit_atomic(>display,
+   
DRM_MODE_ATOMIC_TEST_ONLY | DRM_MODE_ATOMIC_ALLOW_MODESET,
+   NULL);
+   igt_assert_eq(ret, 0);
+   } else {
+   igt_display_commit2(display, COMMIT_UNIVERSAL);
+   }
}
 
/* Set up fb2->plane2 mapping. */
@@ -235,7 +266,15 @@ static void test_plane_scaling(data_t *d)
igt_fb_set_size(>fb2, d->plane2, d->fb2.width-200, 
d->fb2.height-200);
   

[Intel-gfx] [PATCH i-g-t 0/5] Validate TEST_ONLY correctness against full atomic commit

2016-12-30 Thread Mika Kahola
This test case adds TEST_ONLY flag to the following test cases to test
atomic commit correctness.

 - kms_plane_multiple
 - kms_atomic_transitions
 - kms_plane_scaling
 - kms_rotation_crc

The test randomly selects one of the above test cases and tests atomic
commit. If the test fails with TEST_ONLY flag the real deal atomic commit
is executed and the outcome is verified.

For: VIZ-6956

Mika Kahola (5):
  tests/kms_plane_multiple: Add TEST_ONLY flag
  tests/kms_atomic_transition: Add TEST_ONLY flag
  tests/kms_plane_scaling: Add TEST_ONLY flag
  tests/kms_rotation_crc: Add TEST_ONLY flag
  tests/kms_test_only: Validate TEST_ONLY correctness against full
atomic commit

 tests/Makefile.sources|   1 +
 tests/kms_atomic_transition.c | 227 ++---
 tests/kms_plane_multiple.c|  79 +---
 tests/kms_plane_scaling.c | 152 --
 tests/kms_rotation_crc.c  | 282 --
 tests/kms_test_only.c | 455 ++
 6 files changed, 1014 insertions(+), 182 deletions(-)
 create mode 100644 tests/kms_test_only.c

-- 
2.7.4

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


[Intel-gfx] [PATCH i-g-t 4/5] tests/kms_rotation_crc: Add TEST_ONLY flag

2016-12-30 Thread Mika Kahola
Add TEST_ONLY flag to test atomic transition display commits without
actual real-life commit.

Signed-off-by: Mika Kahola 
---
 tests/kms_rotation_crc.c | 282 +--
 1 file changed, 222 insertions(+), 60 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 796b448..434f845 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -84,11 +84,25 @@ paint_squares(data_t *data, drmModeModeInfo *mode, 
igt_rotation_t rotation,
cairo_destroy(cr);
 }
 
-static void commit_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)
+static int display_commit_test_only(igt_display_t *display)
+{
+   int ret;
+
+   ret = igt_display_try_commit_atomic(display,
+   DRM_MODE_ATOMIC_TEST_ONLY |
+   DRM_MODE_ATOMIC_ALLOW_MODESET,
+   NULL);
+
+   return ret;
+}
+
+static void commit_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane,
+   bool test_only)
 {
igt_display_t *display = >display;
enum igt_commit_style commit = COMMIT_LEGACY;
igt_plane_t *primary;
+   int ret;
 
/*
 * With igt_display_commit2 and COMMIT_UNIVERSAL, we call just the
@@ -99,7 +113,13 @@ static void commit_crtc(data_t *data, igt_output_t *output, 
igt_plane_t *plane)
 
primary = igt_output_get_plane(output, IGT_PLANE_PRIMARY);
igt_plane_set_fb(primary, >fb_modeset);
-   igt_display_commit(display);
+
+   if (test_only) {
+   ret = display_commit_test_only(display);
+   igt_assert_eq(ret, 0);
+   } else {
+   igt_display_commit(display);
+   }
 
igt_plane_set_fb(plane, >fb);
 
@@ -111,12 +131,19 @@ static void commit_crtc(data_t *data, igt_output_t 
*output, igt_plane_t *plane)
 
if (data->display.is_atomic)
commit = COMMIT_ATOMIC;
+   else
+   igt_skip_on(test_only);
 
-   igt_display_commit2(display, commit);
+   if (test_only) {
+   ret = display_commit_test_only(display);
+   igt_assert_eq(ret, 0);
+   } else {
+   igt_display_commit2(display, commit);
+   }
 }
 
 static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
-igt_plane_t *plane)
+igt_plane_t *plane, bool test_only)
 {
drmModeModeInfo *mode;
int fb_id, fb_modeset_id;
@@ -181,8 +208,10 @@ static void prepare_crtc(data_t *data, igt_output_t 
*output, enum pipe pipe,
 
/* Step 1: create a reference CRC for a software-rotated fb */
paint_squares(data, mode, data->rotation, >fb, 1.0);
-   commit_crtc(data, output, plane);
-   igt_pipe_crc_collect_crc(data->pipe_crc, >ref_crc);
+   commit_crtc(data, output, plane, test_only);
+
+   if (!test_only)
+   igt_pipe_crc_collect_crc(data->pipe_crc, >ref_crc);
 
/*
 * Step 2: prepare the plane with an non-rotated fb let the hw
@@ -192,10 +221,12 @@ static void prepare_crtc(data_t *data, igt_output_t 
*output, enum pipe pipe,
igt_plane_set_fb(plane, >fb);
 }
 
-static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t 
*plane)
+static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t 
*plane,
+   bool test_only)
 {
igt_display_t *display = >display;
-
+   int ret;
+
igt_pipe_crc_free(data->pipe_crc);
data->pipe_crc = NULL;
 
@@ -215,7 +246,12 @@ static void cleanup_crtc(data_t *data, igt_output_t 
*output, igt_plane_t *plane)
igt_plane_set_fb(plane, NULL);
igt_output_set_pipe(output, PIPE_ANY);
 
-   igt_display_commit(display);
+   if (test_only) {
+   ret = display_commit_test_only(display);
+   igt_assert_eq(ret, 0);
+   } else {
+   igt_display_commit(display);
+   }
 }
 
 static void wait_for_pageflip(int fd)
@@ -235,7 +271,7 @@ static void wait_for_pageflip(int fd)
igt_assert(drmHandleEvent(fd, ) == 0);
 }
 
-static void test_plane_rotation(data_t *data, enum igt_plane plane_type)
+static void test_plane_rotation(data_t *data, enum igt_plane plane_type, bool 
test_only)
 {
igt_display_t *display = >display;
igt_output_t *output;
@@ -254,6 +290,8 @@ static void test_plane_rotation(data_t *data, enum 
igt_plane plane_type)
 
if (data->display.is_atomic)
commit = COMMIT_ATOMIC;
+   else
+   igt_skip_on(test_only);
 
for_each_connected_output(display, output) {
for_each_pipe(display, pipe) {
@@ -264,17 +302,32 @@ static void test_plane_rotation(data_t *data, enum 
igt_plane plane_type)
plane = igt_output_get_plane(output, plane_type);

[Intel-gfx] [PATCH i-g-t 5/5] tests/kms_test_only: Validate TEST_ONLY correctness against full atomic commit

2016-12-30 Thread Mika Kahola
This test case adds TEST_ONLY flag to the following test cases to test
atomic commit correctness.

 - kms_plane_multiple
 - kms_atomic_transitions
 - kms_plane_scaling
 - kms_rotation_crc

The test randomly selects one of the above test cases and tests atomic
commit. If the test fails with TEST_ONLY flag the real deal atomic commit
is executed and the outcome is verified.

The test runs by default for 64 iterations.

Signed-off-by: Mika Kahola 
---
 tests/Makefile.sources |   1 +
 tests/kms_test_only.c  | 455 +
 2 files changed, 456 insertions(+)
 create mode 100644 tests/kms_test_only.c

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 6316ea6..ff599c3 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -112,6 +112,7 @@ TESTS_progs_M = \
kms_plane \
kms_plane_multiple \
kms_plane_lowres \
+   kms_test_only \
kms_properties \
kms_psr_sink_crc \
kms_render \
diff --git a/tests/kms_test_only.c b/tests/kms_test_only.c
new file mode 100644
index 000..1ae835e
--- /dev/null
+++ b/tests/kms_test_only.c
@@ -0,0 +1,455 @@
+/*
+ * Copyright © 2016 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 "drmtest.h"
+#include 
+#include 
+#include 
+#include 
+#include 
+
+IGT_TEST_DESCRIPTION("Test atomic mode setting with a TEST_ONLY flag");
+
+#define LOOP_FOREVER -1
+
+#define FAIL   -1
+#define SKIP0
+#define SUCCESS 1
+
+/* Command line parameters. */
+struct {
+   int iterations;
+} opt = {
+   .iterations = 64,
+};
+
+static
+int parse_output(char *testname)
+{
+   FILE *fid;
+   char output[1024];
+   char result[32];
+
+   fid = popen(testname, "r");
+   igt_assert(fid != NULL);
+
+   while (fgets(output, sizeof(output)-1, fid) != NULL) {
+   if (strstr(output, "Subtest")) {
+   sscanf(output, "%*s %*s %s%*c", result);
+
+   if (strncmp(result, "FAIL", 4) == 0) {
+   pclose(fid);
+   return FAIL;
+   } else if (strncmp(result, "SKIP", 4) == 0) {
+   pclose(fid);
+   return SKIP;
+   } else if (strncmp(result, "SUCCESS", 7) == 0) {
+   pclose(fid);
+   return SUCCESS;
+   }
+   } else if (strstr(output, "Test requirement not met in 
function")) {
+   pclose(fid);
+   return SKIP;
+   }
+   }
+
+   pclose(fid);
+
+   return -EINVAL;
+}
+
+static
+void test_kms_rotation_crc(void)
+{
+   int ret;
+   char testname[256];
+
+   strcpy(testname, "kms_rotation_crc --run-subtest 
primary-rotation-180-test-only");
+   ret = parse_output(testname);
+   if (ret == SKIP)
+   return;
+
+   if (ret == FAIL) {
+   igt_info("%s failed. Trying with real atomic commit\n", 
testname);
+   strcpy(testname, "kms_rotation_crc --run-subtest 
primary-rotation-180");
+   ret = parse_output(testname);
+   igt_assert_eq(ret, FAIL);
+   }
+
+   strcpy(testname, "kms_rotation_crc --run-subtest 
sprite-rotation-180-test-only");
+   ret = parse_output(testname);
+   if (ret == SKIP)
+   return;
+
+   if (ret == FAIL) {
+   igt_info("%s failed. Trying with real atomic commit\n", 
testname);
+   strcpy(testname, "kms_rotation_crc --run-subtest 
sprite-rotation-180");
+   ret = parse_output(testname);
+   igt_assert_eq(ret, FAIL);
+   }
+
+   strcpy(testname, "kms_rotation_crc --run-subtest 

[Intel-gfx] [PATCH i-g-t 1/5] tests/kms_plane_multiple: Add TEST_ONLY flag

2016-12-30 Thread Mika Kahola
Add TEST_ONLY flag to test atomic modesetting commits without
actual real-life commit.

Signed-off-by: Mika Kahola 
---
 tests/kms_plane_multiple.c | 79 --
 1 file changed, 49 insertions(+), 30 deletions(-)

diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index 5e12be4..1a77a38 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -61,10 +61,12 @@ struct {
int iterations;
bool user_seed;
int seed;
+   bool test_only;
 } opt = {
.iterations = 64,
.user_seed = false,
.seed = 1,
+   .test_only = false,
 };
 
 static inline uint32_t pipe_select(int pipe)
@@ -228,7 +230,7 @@ prepare_planes(data_t *data, enum pipe pipe, color_t *color,
 static void
 test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,
   igt_output_t *output, int max_planes,
-  uint64_t tiling)
+  uint64_t tiling, bool test_only)
 {
char buf[256];
struct drm_event *e = (void *)buf;
@@ -240,6 +242,12 @@ test_atomic_plane_position_with_output(data_t *data, enum 
pipe pipe,
int iterations = opt.iterations < 1 ? 1 : opt.iterations;
bool loop_forever;
char info[256];
+   int flags = DRM_MODE_ATOMIC_ALLOW_MODESET;
+
+   if (test_only)
+   flags |= DRM_MODE_ATOMIC_TEST_ONLY;
+   else
+   flags |= DRM_MODE_PAGE_FLIP_EVENT;
 
if (opt.iterations == LOOP_FOREVER) {
loop_forever = true;
@@ -256,8 +264,9 @@ test_atomic_plane_position_with_output(data_t *data, enum 
pipe pipe,
 
test_init(data, pipe);
 
-   test_grab_crc(data, output, pipe, true, , tiling,
- _crc);
+   if (!test_only)
+   test_grab_crc(data, output, pipe, true, , tiling,
+ _crc);
 
i = 0;
while (i < iterations || loop_forever) {
@@ -265,24 +274,27 @@ test_atomic_plane_position_with_output(data_t *data, enum 
pipe pipe,
 
vblank_start = get_vblank(data->display.drm_fd, pipe, 
DRM_VBLANK_NEXTONMISS);
 
-   igt_display_commit_atomic(>display,
- DRM_MODE_PAGE_FLIP_EVENT,
- >display);
+   ret = igt_display_try_commit_atomic(>display,
+   flags,
+   >display);
+   igt_assert(ret != -EINVAL);
 
-   igt_set_timeout(1, "Stuck on page flip");
+   if (!test_only) {
+   igt_set_timeout(1, "Stuck on page flip");
 
-   ret = read(data->display.drm_fd, buf, sizeof(buf));
-   igt_assert(ret >= 0);
+   ret = read(data->display.drm_fd, buf, sizeof(buf));
+   igt_assert(ret >= 0);
 
-   igt_assert_eq(get_vblank(data->display.drm_fd, pipe, 0), 
vblank_start + 1);
-   igt_assert_eq(e->type, DRM_EVENT_FLIP_COMPLETE);
-   igt_reset_timeout();
+   igt_assert_eq(get_vblank(data->display.drm_fd, pipe, 
0), vblank_start + 1);
+   igt_assert_eq(e->type, DRM_EVENT_FLIP_COMPLETE);
+   igt_reset_timeout();
 
-   n = igt_pipe_crc_get_crcs(data->pipe_crc, MAX_CRCS, );
+   n = igt_pipe_crc_get_crcs(data->pipe_crc, MAX_CRCS, 
);
 
-   igt_assert_eq(n, MAX_CRCS);
+   igt_assert_eq(n, MAX_CRCS);
 
-   igt_assert_crc_equal(_crc, crc);
+   igt_assert_crc_equal(_crc, crc);
+   }
 
i++;
}
@@ -345,7 +357,7 @@ test_legacy_plane_position_with_output(data_t *data, enum 
pipe pipe,
 
 static void
 test_plane_position(data_t *data, enum pipe pipe, bool atomic, int max_planes,
-   uint64_t tiling)
+   uint64_t tiling, bool test_only)
 {
igt_output_t *output;
int connected_outs;
@@ -372,7 +384,8 @@ test_plane_position(data_t *data, enum pipe pipe, bool 
atomic, int max_planes,
test_atomic_plane_position_with_output(data, pipe,
   output,
   max_planes,
-  tiling);
+  tiling,
+  test_only);
else
test_legacy_plane_position_with_output(data, pipe,
   output,
@@ -387,54 +400,55 @@ test_plane_position(data_t *data, enum pipe pipe, bool 
atomic, int 

Re: [Intel-gfx] [PATCH 04/17] dma-buf: use preferred struct reference in kernel-doc

2016-12-30 Thread Daniel Vetter
On Fri, Dec 30, 2016 at 12:16:17PM +0100, David Herrmann wrote:
> Hi
> 
> On Thu, Dec 29, 2016 at 9:48 PM, Daniel Vetter  wrote:
> > sed -e 's/\( \* .*\)struct &\([_a-z]*\)/\1\ \2/' -i
> >
> > Originally I wasnt a friend of this style because I thought a
> > line-break between the "" and "foo" part would break it. But a
> > quick test shows that " *  \n * foo\n" works pefectly well with
> > current kernel-doc. So time to mass-apply these changes!
> >
> > Cc: Sumit Semwal 
> > Cc: Jani Nikula 
> > Cc: Chris Wilson 
> > Signed-off-by: Daniel Vetter 
> > ---
> >  drivers/dma-buf/dma-buf.c | 6 +++---
> >  include/linux/dma-buf.h   | 4 ++--
> >  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> Reviewed-by: David Herrmann 

Merged up to this patch, thanks for the review.

Now, lunch!
-Daniel

> 
> Thanks
> David
> 
> > diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> > index 91aff74ed092..ab814aff0a5b 100644
> > --- a/drivers/dma-buf/dma-buf.c
> > +++ b/drivers/dma-buf/dma-buf.c
> > @@ -128,7 +128,7 @@ static loff_t dma_buf_llseek(struct file *file, loff_t 
> > offset, int whence)
> >   * DOC: fence polling
> >   *
> >   * To support cross-device and cross-driver synchronization of buffer 
> > access
> > - * implicit fences (represented internally in the kernel with struct 
> > ) can
> > + * implicit fences (represented internally in the kernel with  
> > fence) can
> >   * be attached to a _buf. The glue for that and a few related things 
> > are
> >   * provided in the _object structure.
> >   *
> > @@ -373,7 +373,7 @@ static inline int is_dma_buf_file(struct file *file)
> >   * Additionally, provide a name string for exporter; useful in debugging.
> >   *
> >   * @exp_info:  [in]holds all the export related information provided
> > - * by the exporter. see struct _buf_export_info
> > + * by the exporter. see  dma_buf_export_info
> >   * for further details.
> >   *
> >   * Returns, on success, a newly created dma_buf object, which wraps the
> > @@ -517,7 +517,7 @@ EXPORT_SYMBOL_GPL(dma_buf_get);
> >   *
> >   * If, as a result of this call, the refcount becomes 0, the 'release' file
> >   * operation related to this fd is called. It calls the release operation 
> > of
> > - * struct _buf_ops in turn, and frees the memory allocated for dmabuf 
> > when
> > + *  dma_buf_ops in turn, and frees the memory allocated for dmabuf 
> > when
> >   * exported.
> >   */
> >  void dma_buf_put(struct dma_buf *dmabuf)
> > diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
> > index 57828154e440..4d61fc55278b 100644
> > --- a/include/linux/dma-buf.h
> > +++ b/include/linux/dma-buf.h
> > @@ -278,7 +278,7 @@ struct dma_buf_ops {
> >   * Shared dma buffers are reference counted using dma_buf_put() and
> >   * get_dma_buf().
> >   *
> > - * Device DMA access is handled by the separate struct _buf_attachment.
> > + * Device DMA access is handled by the separate  dma_buf_attachment.
> >   */
> >  struct dma_buf {
> > size_t size;
> > @@ -355,7 +355,7 @@ struct dma_buf_export_info {
> >   * DEFINE_DMA_BUF_EXPORT_INFO - helper macro for exporters
> >   * @name: export-info name
> >   *
> > - * DEFINE_DMA_BUF_EXPORT_INFO macro defines the struct 
> > _buf_export_info,
> > + * DEFINE_DMA_BUF_EXPORT_INFO macro defines the  
> > dma_buf_export_info,
> >   * zeroes it out and pre-populates exp_name in it.
> >   */
> >  #define DEFINE_DMA_BUF_EXPORT_INFO(name)   \
> > --
> > 2.7.4
> >
> > ___
> > dri-devel mailing list
> > dri-de...@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
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] ✓ Fi.CI.BAT: success for drm/i915: Fix phys pwrite for struct_mutex-less operation

2016-12-30 Thread Patchwork
== Series Details ==

Series: drm/i915: Fix phys pwrite for struct_mutex-less operation
URL   : https://patchwork.freedesktop.org/series/17310/
State : success

== Summary ==

Series 17310v1 drm/i915: Fix phys pwrite for struct_mutex-less operation
https://patchwork.freedesktop.org/api/1.0/series/17310/revisions/1/mbox/


fi-bdw-5557u total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050 total:246  pass:207  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205 total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700 total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900 total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820 total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770  total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770  total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hqtotal:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k total:246  pass:222  dwarn:3   dfail:0   fail:0   skip:21 
fi-skl-6770hqtotal:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600  total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 

6e668687e5d05a21479a16bbe342eb88fc034899 drm-tip: 2016y-12m-30d-10h-22m-50s UTC 
integration manifest
bce38e9 drm/i915: Fix phys pwrite for struct_mutex-less operation

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3410/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [Linux v4.10.0-rc1] call-traces after suspend-resume (pm? i915? cpu/hotplug?)

2016-12-30 Thread Sedat Dilek
On Thu, Dec 29, 2016 at 12:58 PM, Mika Kuoppala
 wrote:
> Sedat Dilek  writes:
>
>> On Wed, Dec 28, 2016 at 11:32 PM, Rafael J. Wysocki  
>> wrote:
>>> On Wed, Dec 28, 2016 at 11:00 AM, Sedat Dilek  wrote:
 On Wed, Dec 28, 2016 at 9:29 AM, Jani Nikula  wrote:
> On Wed, 28 Dec 2016, Sedat Dilek  wrote:
>> On Tue, Dec 27, 2016 at 10:13 PM, Pavel Machek  wrote:
>>> Hi!
>>>
 [ Add some pm | i915 | x86 folks ]

 Hi,

 I have built Linux v4.10-rc1 today on my Ubuntu/precise AMD64 system
 and I see some call-traces.
 It is reproducible on suspend and resume.

 I cannot say which area touches the problem or if these are several
 independent problems.

 For a full dmesg-log see attachments (my linux-config is attached, 
 too).

 Here some hunks...

 [   29.003601] BUG: sleeping function called from invalid context at
 drivers/base/power/runtime.c:1032
 [   29.003608] in_atomic(): 1, irqs_disabled(): 0, pid: 1469, name: 
 Xorg
 [   29.003610] 1 lock held by Xorg/1469:
 [   29.003611]  #0:  (>struct_mutex){+.+.+.}, at:
 [] i915_mutex_lock_interruptible+0x43/0x140 [i915]
 [   29.003653] CPU: 0 PID: 1469 Comm: Xorg Not tainted
 4.10.0-rc1-1-iniza-small #1
 [   29.003655] Hardware name: SAMSUNG ELECTRONICS CO., LTD.
 530U3BI/530U4BI/530U4BH/530U3BI/530U4BI/530U4BH, BIOS 13XK 03/28/2013
 [   29.003656] Call Trace:
>>>
>>> Just a note, at least 2 machines here refuse to resume with
>>> v4.10-rc1. One has intel graphics, one has AMD. It may or may not have
>>> common cause...
>>>
>>
>> [ Correct linux-pm ML and add Mika & Jani ]
>>
>> Thanks for the feedback.
>>
>> There are some cpu/hotplug fixes post-v4.10-rc1.
>> Give that a try.
>>
>> Yesterday, after answers from drm-intel folks I have seen that a
>> cpu/hotplug commit [1] was reverted in
>> drm-intel.git#drm-intel-nightly.
>> I haven't tried that.
>>
>> It's good when Thomas knows of this and gets in contact with drm-intel 
>> folks.
>>
>> Regards,
>> - Sedat -
>>
>> [1] 
>> https://cgit.freedesktop.org/drm-intel/commit/?h=drm-intel-nightly=e558f178f5390185b7324ff4b816b52c6ae3a928
>> [2] https://cgit.freedesktop.org/drm-intel/log/?h=drm-intel-nightly
>>
>> P.S.: Revert "cpu/hotplug: Prevent overwriting of callbacks"
>>
>> This reverts commit dc280d93623927570da279e99393879dbbab39e7
>> Author: Thomas Gleixner 
>> Date: Wed Dec 21 20:19:49 2016 +0100
>> cpu/hotplug: Prevent overwriting of callbacks
>>
>> It started hanging all machines in CI s3 test:
>> https://intel-gfx-ci.01.org/CI/igt@gem_exec_susp...@basic-s3.html
>>
>> Bisected-by: Mika Kuoppala 
>> Signed-off-by: Jani Nikula 
>
> Thomas -
>
> Indeed, basically all of the boxes in the intel-gfx CI hang at the
> suspend/resume test with dc280d936239 ("cpu/hotplug: Prevent overwriting
> of callbacks"), and after the revert in the tree that feeds to the CI,
> we're back on track.
>
> I found [1], was hoping to get feedback from Mika whether that helps
> before reporting. Chris also suggested [2] as a quick fix but I don't
> know if anyone tried that.
>

 Hi Jani,

 I know you were not CCed in the original thread, please see [5].

 The patchset from Thomas you mention [1] does fix one of the problems
 I have seen, please see [6].
 With these post-v4.10-rc1 patches applied a clean revert of Revert
 "cpu/hotplug: Prevent overwriting of callbacks" is not possible.

 Can you give a clear statement if the quick-fix from Chris is in
 combination with the above revert or not?
 Against v4.10-rc1?
 Tested together with the patchset of Thomas?
>>>
>>> Please test the Linus' tree from today, it should work.
>>>
>>
>> Latest Linus tree (v4.10-rc1-17-g2d706e790f05) does not fix it.
>>
>
> Latest Linus tree 2d706e790f0508dff4fb72eca9b4892b79757feb fixes our S3
> problems. It survives gem_exec_suspend --r basic-S3 on kabylake.
>
> It contains the fix to the bisected commit:
>
> commit b9d9d6911bd5c370ad4b3aa57d758c093d17aed5
> Author: Thomas Gleixner 
> Date:   Mon Dec 26 22:58:19 2016 +0100
>
> smp/hotplug: Undo tglxs brainfart
>
>

These are good news!

I still see another issue and this seems independent of Thomas'
"brainfart" patch.

Will post a separate email on the other issue.

- Sedat -
___
Intel-gfx mailing list

Re: [Intel-gfx] [PATCH 10/17] drm/atomic-helpers: Remove outdated comment

2016-12-30 Thread David Herrmann
Hi

On Thu, Dec 29, 2016 at 9:48 PM, Daniel Vetter  wrote:
> We forgot to clean this up when adding connector refcounting.
>
> Signed-off-by: Daniel Vetter 
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 5 -
>  1 file changed, 5 deletions(-)

Patch 1-10 all:

Reviewed-by: David Herrmann 

Thanks
David

> diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
> b/drivers/gpu/drm/drm_atomic_helper.c
> index 8eab8944c736..5e5224460042 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -3286,11 +3286,6 @@ EXPORT_SYMBOL(drm_atomic_helper_duplicate_state);
>  void
>  __drm_atomic_helper_connector_destroy_state(struct drm_connector_state 
> *state)
>  {
> -   /*
> -* This is currently a placeholder so that drivers that subclass the
> -* state will automatically do the right thing if code is ever added
> -* to this function.
> -*/
> if (state->crtc)
> drm_connector_unreference(state->connector);
>  }
> --
> 2.7.4
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm: Reduce verbosity level for drm_core_init() debug message

2016-12-30 Thread Daniel Vetter
On Thu, Dec 29, 2016 at 01:37:29PM +, Chris Wilson wrote:
> Currently at the end of drm_core_init() we print
> 
> [0.735185] [drm] Initialized
> 
> which does not provide any user information and is only a breadcrumb for
> developers, so reduce it from info to debug.
> 
> Signed-off-by: Chris Wilson 

Applied to drm-misc, thanks.
-Daniel

> ---
>  drivers/gpu/drm/drm_drv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 2b75ce65d586..25783b99b651 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -929,7 +929,7 @@ static int __init drm_core_init(void)
>   if (ret < 0)
>   goto error;
>  
> - DRM_INFO("Initialized\n");
> + DRM_DEBUG("Initialized\n");
>   return 0;
>  
>  error:
> -- 
> 2.11.0
> 
> ___
> 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 04/17] dma-buf: use preferred struct reference in kernel-doc

2016-12-30 Thread David Herrmann
Hi

On Thu, Dec 29, 2016 at 9:48 PM, Daniel Vetter  wrote:
> sed -e 's/\( \* .*\)struct &\([_a-z]*\)/\1\ \2/' -i
>
> Originally I wasnt a friend of this style because I thought a
> line-break between the "" and "foo" part would break it. But a
> quick test shows that " *  \n * foo\n" works pefectly well with
> current kernel-doc. So time to mass-apply these changes!
>
> Cc: Sumit Semwal 
> Cc: Jani Nikula 
> Cc: Chris Wilson 
> Signed-off-by: Daniel Vetter 
> ---
>  drivers/dma-buf/dma-buf.c | 6 +++---
>  include/linux/dma-buf.h   | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: David Herrmann 

Thanks
David

> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index 91aff74ed092..ab814aff0a5b 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -128,7 +128,7 @@ static loff_t dma_buf_llseek(struct file *file, loff_t 
> offset, int whence)
>   * DOC: fence polling
>   *
>   * To support cross-device and cross-driver synchronization of buffer access
> - * implicit fences (represented internally in the kernel with struct ) 
> can
> + * implicit fences (represented internally in the kernel with  fence) 
> can
>   * be attached to a _buf. The glue for that and a few related things are
>   * provided in the _object structure.
>   *
> @@ -373,7 +373,7 @@ static inline int is_dma_buf_file(struct file *file)
>   * Additionally, provide a name string for exporter; useful in debugging.
>   *
>   * @exp_info:  [in]holds all the export related information provided
> - * by the exporter. see struct _buf_export_info
> + * by the exporter. see  dma_buf_export_info
>   * for further details.
>   *
>   * Returns, on success, a newly created dma_buf object, which wraps the
> @@ -517,7 +517,7 @@ EXPORT_SYMBOL_GPL(dma_buf_get);
>   *
>   * If, as a result of this call, the refcount becomes 0, the 'release' file
>   * operation related to this fd is called. It calls the release operation of
> - * struct _buf_ops in turn, and frees the memory allocated for dmabuf 
> when
> + *  dma_buf_ops in turn, and frees the memory allocated for dmabuf 
> when
>   * exported.
>   */
>  void dma_buf_put(struct dma_buf *dmabuf)
> diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
> index 57828154e440..4d61fc55278b 100644
> --- a/include/linux/dma-buf.h
> +++ b/include/linux/dma-buf.h
> @@ -278,7 +278,7 @@ struct dma_buf_ops {
>   * Shared dma buffers are reference counted using dma_buf_put() and
>   * get_dma_buf().
>   *
> - * Device DMA access is handled by the separate struct _buf_attachment.
> + * Device DMA access is handled by the separate  dma_buf_attachment.
>   */
>  struct dma_buf {
> size_t size;
> @@ -355,7 +355,7 @@ struct dma_buf_export_info {
>   * DEFINE_DMA_BUF_EXPORT_INFO - helper macro for exporters
>   * @name: export-info name
>   *
> - * DEFINE_DMA_BUF_EXPORT_INFO macro defines the struct _buf_export_info,
> + * DEFINE_DMA_BUF_EXPORT_INFO macro defines the  dma_buf_export_info,
>   * zeroes it out and pre-populates exp_name in it.
>   */
>  #define DEFINE_DMA_BUF_EXPORT_INFO(name)   \
> --
> 2.7.4
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 03/17] drm/mm: Some doc polish

2016-12-30 Thread David Herrmann
Hi

On Thu, Dec 29, 2016 at 9:48 PM, Daniel Vetter  wrote:
> Added some boilerplate for the structs, documented members where they
> are relevant and plenty of markup for hyperlinks all over. And a few
> small wording polish.
>
> Note that the intro needs some more love after the DRM_MM_INSERT_*
> patch from Chris has landed.
>
> v2: Spelling fixes (Chris).
>
> v3: Use  foo instead of  structure (Chris).
>
> Cc: Chris Wilson 
> Cc: Joonas Lahtinen 
> Signed-off-by: Daniel Vetter 
> ---
>  Documentation/gpu/drm-mm.rst |  2 +-
>  drivers/gpu/drm/drm_mm.c | 41 +++--
>  include/drm/drm_mm.h | 84 
> ++--
>  3 files changed, 89 insertions(+), 38 deletions(-)

I liked the "DRM Roaster" more than the "Roster"!

Reviewed-by: David Herrmann 

Thanks
David

> diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst
> index cb5daffcd6be..5355e5ad51a7 100644
> --- a/Documentation/gpu/drm-mm.rst
> +++ b/Documentation/gpu/drm-mm.rst
> @@ -442,7 +442,7 @@ LRU Scan/Eviction Support
>  -
>
>  .. kernel-doc:: drivers/gpu/drm/drm_mm.c
> -   :doc: lru scan roaster
> +   :doc: lru scan roster
>
>  DRM MM Range Allocator Function References
>  --
> diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
> index e54aa3fa538f..229b3f525dee 100644
> --- a/drivers/gpu/drm/drm_mm.c
> +++ b/drivers/gpu/drm/drm_mm.c
> @@ -59,8 +59,8 @@
>   *
>   * The main data struct is _mm, allocations are tracked in _mm_node.
>   * Drivers are free to embed either of them into their own suitable
> - * datastructures. drm_mm itself will not do any allocations of its own, so 
> if
> - * drivers choose not to embed nodes they need to still allocate them
> + * datastructures. drm_mm itself will not do any memory allocations of its 
> own,
> + * so if drivers choose not to embed nodes they need to still allocate them
>   * themselves.
>   *
>   * The range allocator also supports reservation of preallocated blocks. 
> This is
> @@ -78,7 +78,7 @@
>   * steep cliff not a real concern. Removing a node again is O(1).
>   *
>   * drm_mm supports a few features: Alignment and range restrictions can be
> - * supplied. Further more every _mm_node has a color value (which is 
> just an
> + * supplied. Furthermore every _mm_node has a color value (which is just 
> an
>   * opaque unsigned long) which in conjunction with a driver callback can be 
> used
>   * to implement sophisticated placement restrictions. The i915 DRM driver 
> uses
>   * this to implement guard pages between incompatible caching domains in the
> @@ -296,11 +296,11 @@ static void drm_mm_insert_helper(struct drm_mm_node 
> *hole_node,
>   * @mm: drm_mm allocator to insert @node into
>   * @node: drm_mm_node to insert
>   *
> - * This functions inserts an already set-up drm_mm_node into the allocator,
> - * meaning that start, size and color must be set by the caller. This is 
> useful
> - * to initialize the allocator with preallocated objects which must be set-up
> - * before the range allocator can be set-up, e.g. when taking over a firmware
> - * framebuffer.
> + * This functions inserts an already set-up _mm_node into the allocator,
> + * meaning that start, size and color must be set by the caller. All other
> + * fields must be cleared to 0. This is useful to initialize the allocator 
> with
> + * preallocated objects which must be set-up before the range allocator can 
> be
> + * set-up, e.g. when taking over a firmware framebuffer.
>   *
>   * Returns:
>   * 0 on success, -ENOSPC if there's no hole where @node is.
> @@ -375,7 +375,7 @@ EXPORT_SYMBOL(drm_mm_reserve_node);
>   * @sflags: flags to fine-tune the allocation search
>   * @aflags: flags to fine-tune the allocation behavior
>   *
> - * The preallocated node must be cleared to 0.
> + * The preallocated @node must be cleared to 0.
>   *
>   * Returns:
>   * 0 on success, -ENOSPC if there's no suitable hole.
> @@ -537,7 +537,7 @@ void drm_mm_replace_node(struct drm_mm_node *old, struct 
> drm_mm_node *new)
>  EXPORT_SYMBOL(drm_mm_replace_node);
>
>  /**
> - * DOC: lru scan roaster
> + * DOC: lru scan roster
>   *
>   * Very often GPUs need to have continuous allocations for a given object. 
> When
>   * evicting objects to make space for a new one it is therefore not most
> @@ -549,9 +549,11 @@ EXPORT_SYMBOL(drm_mm_replace_node);
>   * The DRM range allocator supports this use-case through the scanning
>   * interfaces. First a scan operation needs to be initialized with
>   * drm_mm_scan_init() or drm_mm_scan_init_with_range(). The driver adds
> - * objects to the roster (probably by walking an LRU list, but this can be
> - * freely implemented) (using drm_mm_scan_add_block()) until a suitable hole
> - * is found or there are no further evictable 

Re: [Intel-gfx] [PATCH 01/17] drm/docs: Small cleanup in drm-uapi.rst

2016-12-30 Thread David Herrmann
Hi

On Thu, Dec 29, 2016 at 9:48 PM, Daniel Vetter  wrote:
> - Remove the outdated hunk about driver documentation which somehow
>   got misplaced here in the split-up.
>
> - Collect all the testing stuff together and give the CRC
>   section a heading for prettier output.
>
> Cc: Tomeu Vizoso 
> Cc: Jani Nikula 
> Signed-off-by: Daniel Vetter 
> ---
>  Documentation/gpu/drm-uapi.rst | 25 +++--
>  1 file changed, 11 insertions(+), 14 deletions(-)

Reviewed-by: David Herrmann 

Thanks
David

> diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst
> index de3ac9f90f8f..fcc228ef5bc4 100644
> --- a/Documentation/gpu/drm-uapi.rst
> +++ b/Documentation/gpu/drm-uapi.rst
> @@ -156,8 +156,12 @@ other hand, a driver requires shared state between 
> clients which is
>  visible to user-space and accessible beyond open-file boundaries, they
>  cannot support render nodes.
>
> +
> +Testing and validation
> +==
> +
>  Validating changes with IGT
> -===
> +---
>
>  There's a collection of tests that aims to cover the whole functionality of
>  DRM drivers and that can be used to check that changes to DRM drivers or the
> @@ -193,6 +197,12 @@ run-tests.sh is a wrapper around piglit that will 
> execute the tests matching
>  the -t options. A report in HTML format will be available in
>  ./results/html/index.html. Results can be compared with piglit.
>
> +Display CRC Support
> +---
> +
> +.. kernel-doc:: drivers/gpu/drm/drm_debugfs_crc.c
> +   :doc: CRC ABI
> +
>  VBlank event handling
>  =
>
> @@ -209,16 +219,3 @@ DRM_IOCTL_MODESET_CTL
>  mode setting, since on many devices the vertical blank counter is
>  reset to 0 at some point during modeset. Modern drivers should not
>  call this any more since with kernel mode setting it is a no-op.
> -
> -This second part of the GPU Driver Developer's Guide documents driver
> -code, implementation details and also all the driver-specific userspace
> -interfaces. Especially since all hardware-acceleration interfaces to
> -userspace are driver specific for efficiency and other reasons these
> -interfaces can be rather substantial. Hence every driver has its own
> -chapter.
> -
> -Testing and validation
> -==
> -
> -.. kernel-doc:: drivers/gpu/drm/drm_debugfs_crc.c
> -   :doc: CRC ABI
> --
> 2.7.4
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm: clean cached display info

2016-12-30 Thread Daniel Vetter
On Thu, Dec 29, 2016 at 05:58:50PM +0530, Shashank Sharma wrote:
> This patch adds a small helper function, which clears the cached
> information about a hot-pluggable display, from connector. On event
> This will run on event of a hot-unplug, keeping the connector's display
> info up-to-date, avoiding any errors due to invalid cached data.
> 
> Forking this patch out from the 3 patch series:
>   https://patchwork.freedesktop.org/patch/128961/
> (still under review) and sending as individual patch.
> 
> Cc: Jose Abreu 
> Cc: Daniel Vetter 
> 
> Suggested-by: Jose Abreu 
> Signed-off-by: Shashank Sharma 
> ---
>  drivers/gpu/drm/drm_probe_helper.c | 22 ++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_probe_helper.c 
> b/drivers/gpu/drm/drm_probe_helper.c
> index 7cff91e..65a6a1f 100644
> --- a/drivers/gpu/drm/drm_probe_helper.c
> +++ b/drivers/gpu/drm/drm_probe_helper.c
> @@ -164,6 +164,18 @@ void drm_kms_helper_poll_enable_locked(struct drm_device 
> *dev)
>  }
>  
>  /**
> + * drm_helper_clear_display_info - clean cached display information for
> + * hot pluggable displays, on event of hot-unplug
> + * @connector: connector under event
> + */
> +void drm_helper_clear_display_info(struct drm_connector *connector)
> +{
> + struct drm_display_info *info = >display_info;
> +
> + memset(info, 0, sizeof(*info));
> +}
> +
> +/**
>   * drm_helper_probe_single_connector_modes - get complete set of display 
> modes
>   * @connector: connector to probe
>   * @maxX: max width for modes
> @@ -288,6 +300,16 @@ int drm_helper_probe_single_connector_modes(struct 
> drm_connector *connector,
>   DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",
>   connector->base.id, connector->name);
>   drm_mode_connector_update_edid_property(connector, NULL);
> +
> + /*
> +  * Connector status change to disconnected, time to clean
> +  * cached display information.
> +  * Any driver which doesn't use this probe_helper function
> +  * should implement update of EDID property and display_info
> +  * on its own.
> +  */
> + drm_helper_clear_display_info(connector);

This isn't really the only place where you can switch to disconnected. I
think something along the lines of some of Jani's recent RFC where we try
to make this functions dtrt thing for a NULL edid would be much more
robust.
-Daniel

> +
>   verbose_prune = false;
>   goto prune;
>   }
> -- 
> 1.9.1
> 

-- 
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 1/2] drm/printer: add debug printer

2016-12-30 Thread Daniel Vetter
On Thu, Dec 29, 2016 at 12:47:52PM +, Chris Wilson wrote:
> On Wed, Dec 28, 2016 at 05:42:09PM +0100, Daniel Vetter wrote:
> > Useful for dumping lots of data into dmesg, e.g. drm_mm.
> > 
> > Cc: Rob Clark 
> > Signed-off-by: Daniel Vetter 
> > ---
> >  drivers/gpu/drm/drm_print.c |  6 ++
> >  include/drm/drm_print.h | 20 ++--
> >  2 files changed, 24 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
> > index ad3caaa1f48b..a8300cd2d3b3 100644
> > --- a/drivers/gpu/drm/drm_print.c
> > +++ b/drivers/gpu/drm/drm_print.c
> > @@ -40,6 +40,12 @@ void __drm_printfn_info(struct drm_printer *p, struct 
> > va_format *vaf)
> >  }
> >  EXPORT_SYMBOL(__drm_printfn_info);
> >  
> > +void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf)
> > +{
> > +   pr_debug("%s %pV", p->prefix, vaf);
> > +}
> > +EXPORT_SYMBOL(__drm_printfn_info);
> 
> Ahem.

Oops, I spotted it, but misplaced the fixup hunk into the 2nd patch. Will
fix.

> > +
> >  /**
> >   * drm_printf - print to a _printer stream
> >   * @p: the _printer
> > diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> > index 1adf84aea622..e9d0ba20089c 100644
> > --- a/include/drm/drm_print.h
> > +++ b/include/drm/drm_print.h
> > @@ -60,19 +60,20 @@
> >  
> >  /**
> >   * struct drm_printer - drm output "stream"
> > - * @printfn: actual output fxn
> > - * @arg: output fxn specific data
> >   *
> >   * Do not use struct members directly.  Use drm_printer_seq_file(),
> >   * drm_printer_info(), etc to initialize.  And drm_printf() for output.
> >   */
> >  struct drm_printer {
> > +   /* private: */
> > void (*printfn)(struct drm_printer *p, struct va_format *vaf);
> > void *arg;
> > +   const char *prefix;
> >  };
> >  
> >  void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf);
> >  void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf);
> > +void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf);
> >  
> >  void drm_printf(struct drm_printer *p, const char *f, ...);
> >  
> > @@ -109,4 +110,19 @@ static inline struct drm_printer 
> > drm_info_printer(struct device *dev)
> > return p;
> >  }
> >  
> > +/**
> > + * drm_debug_printer - construct a _printer that outputs to pr_debug()
> > + * @prefix: debug output prefix
> > + *
> > + * RETURNS:
> > + * The _printer object
> > + */
> > +static inline struct drm_printer drm_debug_printer(const char *prefix)
> > +{
> > +   struct drm_printer p = {
> > +   .printfn = __drm_printfn_debug,
> > +   .prefix = prefix
> > +   };
> > +   return p;
> > +}
> 
> \n
> 
> >  #endif /* DRM_PRINT_H_ */
> 
> I was looking at a single __drm_printfn callback with a
> drm_printer.level, but we lose the dynamic debug goodness.
> 
> With the EXPORT_SYMBOL fixed,
> Reviewed-by: Chris Wilson 

Thanks for the review, both applied to -misc.
-Daniel
-- 
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] [PULL] drm-intel-next

2016-12-30 Thread Daniel Vetter
Hi Dave,

drm-intel-next-2016-12-26:
2nd round of stuff for 4.11:

- DP link rate fixes (DK)
- prep work for atomic wm updates on vlv/chv (Ville)
- platform enumeration cleanup (Jani)
- dsi fixes and cleaups (Hans de Goede)
- gen9 wm fixes (Mahesh Kumar)
- prep work for DP link failure fallback handling (Manasi)
- introduce GEM_WARN_ON (Matthew Auld)
- overlay fixes and cleanups (Ville)
- make is_lp apply to all modern/gen7+ atom-based platforms (Rodrigo)

Tons of small polish, fixes and cleanups all over. This time around
this is about half the patches!
drm-intel-next-2016-12-05:
First round of stuff for 4.10!

- refactor hangcheck/ban/reset stats code in prep for TDR (Mika)
- much more fancy perf monitoring support (Robert Bragg)
- lspcon fixes (Imre)
- rework plane ids to unconfuse the code (Ville)
- fix up cdclck/atomic state handling (Ville)
- debugobjects support for i915 fences (Chris)
- guc code cleanup (Arkadiusz Hiler)
- dp mst enabling, one more attempt (Libin)
- bugfixes for request resubmission after hangs (Chris)
- add basic geminilake support (Ander)
- switch more internal functions from drm_device to dev_priv (Tvrtko)

As mentioned already, will conflict in a few places with -misc, but
nothing too bad. drm-tip has the well-tested merge solutions, for peeking.

Cheers, Daniel


The following changes since commit f03ee46be9401e3434f52bb15e92d1e640f76438:

  Backmerge tag 'v4.9-rc8' into drm-next (2016-12-05 17:11:48 +1000)

are available in the git repository at:

  git://anongit.freedesktop.org/git/drm-intel tags/drm-intel-next-2016-12-26

for you to fetch changes up to f061ff077e657b27d7e24e31b1da484b2376348d:

  drm/i915: Update DRIVER_DATE to 20161226 (2016-12-26 16:48:25 +0100)


2nd round of stuff for 4.11:

- DP link rate fixes (DK)
- prep work for atomic wm updates on vlv/chv (Ville)
- platform enumeration cleanup (Jani)
- dsi fixes and cleaups (Hans de Goede)
- gen9 wm fixes (Mahesh Kumar)
- prep work for DP link failure fallback handling (Manasi)
- introduce GEM_WARN_ON (Matthew Auld)
- overlay fixes and cleanups (Ville)
- make is_lp apply to all modern/gen7+ atom-based platforms (Rodrigo)

Tons of small polish, fixes and cleanups all over. This time around
this is about half the patches!


A.Sunil Kamath (1):
  drm/i915: Use num_scalers instead of SKL_NUM_SCALERS in debugfs

Ander Conselvan de Oliveira (14):
  drm/i915: Pass dev_priv to intel_setup_outputs()
  drm/i915: Don't sanitize has_decoupled_mmio if platform is not broxton
  drm/i915/glk: Introduce Geminilake platform definition
  drm/i915/glk: Add Geminilake PCI IDs
  drm/i915/glk: Add a IS_GEN9_LP() macro
  drm/i915: Fix intel_psr_init() kerneldoc
  drm/i915/glk: Reuse broxton code for geminilake
  drm/i915/glk: Add power wells for Geminilake
  drm/i915/glk: Implement Geminilake DDI init sequence
  drm/i915/glk: Set DCC delay range 2 in PLL enable sequence
  drm/i915/glk: Reuse broxton's cdclk code for GLK
  drm/i915/glk: Allow dotclock up to 2 * cdclk on geminilake
  drm/i915/glk: Implement core display init/uninit sequence for geminilake
  drm/i915/glk: Configure number of sprite planes properly

Arkadiusz Hiler (6):
  drm/i915: Rename intel_guc.h to intel_uc.h
  drm/i915/guc: Drop guc2host/host2guc from names
  drm/i915/guc: Move guc_{send,recv}() to intel_uc.c
  drm/i915/guc: Init send_mutex in intel_uc_init_early()
  drm/i915/guc: Remove spurious include
  drm/i915/guc: Drop comment on fwif autogeneration

Bob Paauwe (1):
  drm/i915/bxt: Correct dual-link MIPI port control.

Chris Wilson (51):
  drm/i915: Use user, not driver, DRM_DEBUG for 2 context ioctls
  drm/i915: Add a warning on shutdown if signal threads still active
  drm/i915: Don't deref context->file_priv ERR_PTR upon reset
  drm/i915: Disable hangcheck when wedged
  drm/i915: Complete requests in nop_submit_request
  drm/i915: Stop the machine as we install the wedged submit_request handler
  drm/i915/debugfs: Drop i915_hws_info
  drm/i915/debugfs: Increment return value of gt.next_seqno
  drm/i915: Use the precomputed value for whether to enable command parsing
  drm/i915/debugfs: Update pageflip information
  drm/i915: Add is-completed assert to request retire entrypoint
  drm/i915: Assert no external observers when unwind a failed request alloc
  drm/i915: Hold a reference on the request for its fence chain
  drm/i915: Integrate i915_sw_fence with debugobjects
  drm/i915: Move priority bumping for flips earlier
  Revert "drm/i915/execlists: Use a local lock for dfs_link access"
  drm/i915: Convert vm->dev backpointer to vm->i915
  drm/i915/perf: Wrap 64bit divides in do_div()
  drm/i915: Fix tracepoint compilation
  drm/i915: Trim i915_guc_info() stack usage
   

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

2016-12-30 Thread Daniel Vetter
Hi Dave,

First -misc pull for 4.11:
- drm_mm rework + lots of selftests (Chris Wilson)
- new connector_list locking+iterators 
- plenty of kerneldoc updates
- format handling rework from Ville
- atomic helper changes from Maarten for better plane corner-case handling
  in drivers, plus the i915 legacy cursor patch that needs this
- bridge cleanup from Laurent
- plus plenty of small stuff all over
- also contains a merge of the 4.10 docs tree so that we could apply the
  dma-buf kerneldoc patches

It's a lot more than usual, but due to the merge window blackout it also
covers about 4 weeks, so all in line again on a per-week basis. The more
annoying part with no pull request for 4 weeks is managing cross-tree
work. The -intel pull request I'll follow up with does conflict quite a
bit with -misc here. Longer-term (if drm-misc keeps growing) a
drm-next-queued to accept pull request for the next merge window during
this time might be useful.

I'd also like to backmerge -rc2+this into drm-intel next week, we have
quite a pile of patches waiting for the stuff in here.
 
Cheers, Daniel


The following changes since commit 2cf026ae85c42f253feb9f420d1b4bc99bd5503d:

  Merge branch 'linux-4.10' of git://github.com/skeggsb/linux into drm-next 
(2016-12-13 14:29:05 +1000)

are available in the git repository at:

  git://anongit.freedesktop.org/git/drm-misc tags/drm-misc-next-2016-12-30

for you to fetch changes up to 9b8b75de4cb379187c481a5332a12429f31c0887:

  drm: Add kerneldoc markup for new @scan parameters in drm_mm (2016-12-28 
14:05:38 +0100)


Bartosz Golaszewski (2):
  drm: bridge: add DT bindings for TI ths8135
  drm: bridge: add support for TI ths8135

Caesar Wang (1):
  drm/bridge: analogix_dp: set the DPCD600 during disabling PSR

Chris Wilson (39):
  dma-buf: Provide wrappers for reservation's lock
  drm: Add drm_mm_for_each_node_safe()
  drm: Constify the drm_mm API
  drm/i915: Simplify i915_gtt_color_adjust()
  drm: Use drm_mm_nodes() as shorthand for the list of nodes under struct 
drm_mm
  drm: Compile time enabling for asserts in drm_mm
  lib: Add a simple prime number generator
  drm: Add a simple generator of random permutations
  drm: Add some kselftests for the DRM range manager (struct drm_mm)
  drm: kselftest for drm_mm_init()
  drm: kselftest for drm_mm_debug()
  drm: kselftest for drm_mm_reserve_node()
  drm: kselftest for drm_mm_insert_node()
  drm: kselftest for drm_mm_replace_node()
  drm: kselftest for drm_mm_insert_node_in_range()
  drm: kselftest for drm_mm and alignment
  drm: kselftest for drm_mm and eviction
  drm: kselftest for drm_mm and range restricted eviction
  drm: kselftest for drm_mm and top-down allocation
  drm: kselftest for drm_mm and color adjustment
  drm: kselftest for drm_mm and color eviction
  drm: kselftest for drm_mm and restricted color eviction
  drm: Promote drm_mm alignment to u64
  drm: Fix kerneldoc for drm_mm_scan_remove_block()
  drm: Detect overflow in drm_mm_reserve_node()
  drm: Simplify drm_mm_clean()
  drm: Add asserts to catch overflow in drm_mm_init() and drm_mm_init_scan()
  drm: Extract struct drm_mm_scan from struct drm_mm
  drm: Rename prev_node to hole in drm_mm_scan_add_block()
  drm: Unconditionally do the range check in drm_mm_scan_add_block()
  drm: Fix application of color vs range restriction when scanning drm_mm
  drm: Compute tight evictions for drm_mm_scan
  drm: Optimise power-of-two alignments in drm_mm_scan_add_block()
  drm: Simplify drm_mm scan-list manipulation
  drm: Apply tight eviction scanning to color_adjust
  drm: Wrap drm_mm_node.hole_follows
  drm: Apply range restriction after color adjustment when allocation
  drm: Use drm_mm_insert_node_in_range_generic() for everyone
  drm: Add kerneldoc markup for new @scan parameters in drm_mm

Dan Carpenter (1):
  drm: mxsfb: drm_dev_alloc() returns error pointers

Daniel Stone (1):
  drm: Use atomic state for FB in legacy ioctls

Daniel Vetter (27):
  drm: Update drm_device docs about embedding.
  drm: Simplify GETRESOURCES ioctl
  drm_fourcc: Document linear modifier
  drm: Protect master->unique with dev->master_mutex
  drm: setclientcap doesn't need the drm BKL
  drm: Enforce BKL-less ioctls for modern drivers
  drm/hisilicon: Don't set drm_device->platformdev
  Merge tag 'docs-4.10' of git://git.lwn.net/linux into drm-misc-next
  dma-buf: Update kerneldoc for sync_file_create
  dma-buf: Reorganize device dma access docs
  dma-buf: Update cpu access documentation
  dma-buf: Final bits of doc polish
  drm/mediatek: don't use drm_put_dev
  drm/etnaviv: Use drm_dev_unref, not drm_put_dev
  Merge tag 'drm-for-v4.10' of git://people.freedesktop.org/~airlied/linux 
into drm-misc-next
 

[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Fix kerneldoc for i915_gem_object_pin_map()

2016-12-30 Thread Patchwork
== Series Details ==

Series: series starting with [1/3] drm/i915: Fix kerneldoc for 
i915_gem_object_pin_map()
URL   : https://patchwork.freedesktop.org/series/17307/
State : success

== Summary ==

Series 17307v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/17307/revisions/1/mbox/


fi-bdw-5557u total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050 total:246  pass:207  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205 total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700 total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900 total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820 total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770  total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770  total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hqtotal:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k total:246  pass:222  dwarn:3   dfail:0   fail:0   skip:21 
fi-skl-6770hqtotal:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600  total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 

a36d44c518880c0703369fe70325a49527ff2d20 drm-tip: 2016y-12m-30d-09h-21m-36s UTC 
integration manifest
6b6bbbc drm/i915: Drop kerneldoc markup from non-kerneldoc enum 
drrs_refresh_rate_type
3debad6 drm/i915: Complete kerneldoc for struct i915_gem_context
46569f9 drm/i915: Fix kerneldoc for i915_gem_object_pin_map()

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3409/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm/i915: Fix phys pwrite for struct_mutex-less operation

2016-12-30 Thread Chris Wilson
Since commit fe115628d567 ("drm/i915: Implement pwrite without
struct-mutex") the lowlevel pwrite calls are now called without the
protection of struct_mutex, but pwrite_phys was still asserting that it
held the struct_mutex and later tried to drop and relock it.

Fixes: fe115628d567 ("drm/i915: Implement pwrite without struct-mutex")
Signed-off-by: Chris Wilson 
Cc: Joonas Lahtinen 
Cc: 
---
 drivers/gpu/drm/i915/i915_gem.c | 34 --
 1 file changed, 4 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 2c3649b29069..636e388e19de 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -597,47 +597,21 @@ i915_gem_phys_pwrite(struct drm_i915_gem_object *obj,
 struct drm_i915_gem_pwrite *args,
 struct drm_file *file)
 {
-   struct drm_device *dev = obj->base.dev;
void *vaddr = obj->phys_handle->vaddr + args->offset;
char __user *user_data = u64_to_user_ptr(args->data_ptr);
-   int ret;
 
/* We manually control the domain here and pretend that it
 * remains coherent i.e. in the GTT domain, like shmem_pwrite.
 */
-   lockdep_assert_held(>base.dev->struct_mutex);
-   ret = i915_gem_object_wait(obj,
-  I915_WAIT_INTERRUPTIBLE |
-  I915_WAIT_LOCKED |
-  I915_WAIT_ALL,
-  MAX_SCHEDULE_TIMEOUT,
-  to_rps_client(file));
-   if (ret)
-   return ret;
-
intel_fb_obj_invalidate(obj, ORIGIN_CPU);
-   if (__copy_from_user_inatomic_nocache(vaddr, user_data, args->size)) {
-   unsigned long unwritten;
-
-   /* The physical object once assigned is fixed for the lifetime
-* of the obj, so we can safely drop the lock and continue
-* to access vaddr.
-*/
-   mutex_unlock(>struct_mutex);
-   unwritten = copy_from_user(vaddr, user_data, args->size);
-   mutex_lock(>struct_mutex);
-   if (unwritten) {
-   ret = -EFAULT;
-   goto out;
-   }
-   }
+   if (copy_from_user(vaddr, user_data, args->size))
+   return -EFAULT;
 
drm_clflush_virt_range(vaddr, args->size);
-   i915_gem_chipset_flush(to_i915(dev));
+   i915_gem_chipset_flush(to_i915(obj->base.dev));
 
-out:
intel_fb_obj_flush(obj, false, ORIGIN_CPU);
-   return ret;
+   return 0;
 }
 
 void *i915_gem_object_alloc(struct drm_i915_private *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 4/6] drm/dp: Introduce DP MST topology manager state to track DP link bw

2016-12-30 Thread kbuild test robot
Hi Dhinakaran,

[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on v4.10-rc1 next-20161224]
[cannot apply to drm/drm-next]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Dhinakaran-Pandiyan/Introduce-DP-MST-Topology-state/20161230-151546
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

   make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make 
rule.
   include/linux/init.h:1: warning: no structured comments found
   include/linux/workqueue.h:392: warning: No description found for parameter 
'...'
   include/linux/workqueue.h:392: warning: Excess function parameter 'args' 
description in 'alloc_workqueue'
   include/linux/workqueue.h:413: warning: No description found for parameter 
'...'
   include/linux/workqueue.h:413: warning: Excess function parameter 'args' 
description in 'alloc_ordered_workqueue'
   include/linux/kthread.h:26: warning: No description found for parameter '...'
   kernel/sys.c:1: warning: no structured comments found
   drivers/dma-buf/seqno-fence.c:1: warning: no structured comments found
   include/sound/core.h:324: warning: No description found for parameter '...'
   include/sound/core.h:335: warning: No description found for parameter '...'
   include/sound/core.h:388: warning: No description found for parameter '...'
   include/drm/drm_drv.h:409: warning: No description found for parameter 'load'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'firstopen'
   include/drm/drm_drv.h:409: warning: No description found for parameter 'open'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'preclose'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'postclose'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'lastclose'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'unload'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'dma_ioctl'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'dma_quiescent'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'context_dtor'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'set_busid'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'irq_handler'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'irq_preinstall'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'irq_postinstall'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'irq_uninstall'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'debugfs_init'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'debugfs_cleanup'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_open_object'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_close_object'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'prime_handle_to_fd'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'prime_fd_to_handle'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_prime_export'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_prime_import'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_prime_pin'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_prime_unpin'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_prime_res_obj'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_prime_get_sg_table'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_prime_import_sg_table'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_prime_vmap'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_prime_vunmap'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_prime_mmap'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'vgaarb_irq'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'gem_vm_ops'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'major'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'minor'
   include/drm/drm_drv.h:409: warning: No description found for parameter 
'patchlevel'
   include/drm/drm_drv.h:409: warning: No description found for parameter 'name'
   include/drm/drm_drv.h:409: warning: No description found for parameter 'desc'
   include/drm/drm_drv.h:409: warning: No description found for parameter

[Intel-gfx] [PATCH 2/3] drm/i915: Complete kerneldoc for struct i915_gem_context

2016-12-30 Thread Chris Wilson
The existing kerneldoc was outdated, so time for a refresh.

Signed-off-by: Chris Wilson 
---
 drivers/gpu/drm/i915/i915_drv.h| 214 -
 drivers/gpu/drm/i915/i915_gem.c|  26 ++--
 drivers/gpu/drm/i915/i915_gem_context.c|  33 ++---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |   2 +-
 drivers/gpu/drm/i915/i915_gpu_error.c  |   2 +-
 drivers/gpu/drm/i915/intel_lrc.c   |   2 +-
 6 files changed, 211 insertions(+), 68 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 00ecbb4da25e..c8617360c912 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1051,44 +1051,118 @@ enum i915_cache_level {
 #define DEFAULT_CONTEXT_HANDLE 0
 
 /**
- * struct i915_gem_context - as the name implies, represents a context.
- * @ref: reference count.
- * @user_handle: userspace tracking identity for this context.
- * @remap_slice: l3 row remapping information.
- * @flags: context specific flags:
- * CONTEXT_NO_ZEROMAP: do not allow mapping things to page 0.
- * @file_priv: filp associated with this context (NULL for global default
- *context).
- * @hang_stats: information about the role of this context in possible GPU
- * hangs.
- * @ppgtt: virtual memory space used by this context.
- * @legacy_hw_ctx: render context backing object and whether it is correctly
- *initialized (legacy ring submission mechanism only).
- * @link: link in the global list of contexts.
+ * struct i915_gem_context - client state
  *
- * Contexts are memory images used by the hardware to store copies of their
- * internal state.
+ * The struct i915_gem_context represents the combined view of the driver and
+ * logical hardware state for a particular client.
  */
 struct i915_gem_context {
-   struct kref ref;
+   /**
+* @i915: i915 device backpointer
+*/
struct drm_i915_private *i915;
+
+   /**
+* @file_priv: owning file descriptor
+*/
struct drm_i915_file_private *file_priv;
+
+   /**
+* @ppgtt: unique address space (GTT)
+*
+* In full-ppgtt mode, each context has its own address space ensuring
+* complete seperation of one client from all others.
+*/
struct i915_hw_ppgtt *ppgtt;
+
+   /**
+* @pid: process id of creator
+*
+* Note that who created the context may not be the principle user,
+* as the context may be shared across a local socket. However,
+* that should only affect the default context, all contexts created
+* explicitly by the client are expected to be isolated.
+*/
struct pid *pid;
+
+   /**
+* @name: arbitrary name
+*
+* A name is constructed for the context from the creator's process
+* name, pid and user handle in order to uniquely identify the
+* context in messages.
+*/
const char *name;
 
+   /**
+* @link: place with _i915_private.context_list
+*/
+   struct list_head link;
+
+   /**
+* @ref: reference count
+*
+* A reference to a context is held by both the client who created it
+* and on each request submitted to the hardware using the request
+* (to ensure the hardware has access to the state until it has
+* finished all pending writes).
+*/
+   struct kref ref;
+
+   /**
+* @flags: small set of booleans
+*/
unsigned long flags;
 #define CONTEXT_NO_ZEROMAP BIT(0)
-#define CONTEXT_NO_ERROR_CAPTURE   BIT(1)
+#define CONTEXT_NO_ERROR_CAPTURE   1
+#define CONTEXT_CLOSED 2
+#define CONTEXT_BANNABLE   3
+#define CONTEXT_BANNED 4
+#define CONTEXT_FORCE_SINGLE_SUBMISSION5
 
-   /* Unique identifier for this context, used by the hw for tracking */
+   /**
+* @hw_id: - unique identifier for the context
+*
+* The hardware needs to uniquely identify the context for a few
+* functions like fault reporting, PASID, scheduling. The
+* _i915_private.context_hw_ida is used to assign a unqiue
+* id for the lifetime of the context.
+*/
unsigned int hw_id;
+
+   /**
+* @user_handle: userspace identifier
+*
+* A unique per-file identifier is generated from
+* _i915_file_private.contexts.
+*/
u32 user_handle;
-   int priority; /* greater priorities are serviced first */
 
+   /**
+* @priority: execution and service priority
+*
+* All clients are equal, but some are more equal than others!
+*
+* Requests from a context with a greater (more positive) value of
+* @priority will be executed before those with a lower @priority
+* value, 

[Intel-gfx] [PATCH 1/3] drm/i915: Fix kerneldoc for i915_gem_object_pin_map()

2016-12-30 Thread Chris Wilson
Parameter - no.
Parameter: yes.

Signed-off-by: Chris Wilson 
---
 drivers/gpu/drm/i915/i915_drv.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 1d8761cd90c7..00ecbb4da25e 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -3316,8 +3316,8 @@ enum i915_map_type {
 
 /**
  * i915_gem_object_pin_map - return a contiguous mapping of the entire object
- * @obj - the object to map into kernel address space
- * @type - the type of mapping, used to select pgprot_t
+ * @obj: the object to map into kernel address space
+ * @type: the type of mapping, used to select pgprot_t
  *
  * Calls i915_gem_object_pin_pages() to prevent reaping of the object's
  * pages and then returns a contiguous mapping of the backing storage into
@@ -3335,7 +3335,7 @@ void *__must_check i915_gem_object_pin_map(struct 
drm_i915_gem_object *obj,
 
 /**
  * i915_gem_object_unpin_map - releases an earlier mapping
- * @obj - the object to unmap
+ * @obj: the object to unmap
  *
  * After pinning the object and mapping its pages, once you are finished
  * with your access, call i915_gem_object_unpin_map() to release the pin
-- 
2.11.0

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


[Intel-gfx] [PATCH 3/3] drm/i915: Drop kerneldoc markup from non-kerneldoc enum drrs_refresh_rate_type

2016-12-30 Thread Chris Wilson
DRRS is not yet kerneldoc despite the allusion prior to enum
drrs_refresh_rate_type. Drop the '**' to avoid the warnings from
make htmldocs.

Signed-off-by: Chris Wilson 
---
 drivers/gpu/drm/i915/i915_drv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index c8617360c912..03e94f33108b 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1347,7 +1347,7 @@ struct intel_fbc {
const char *no_fbc_reason;
 };
 
-/**
+/*
  * HIGH_RR is the highest eDP panel refresh rate read from EDID
  * LOW_RR is the lowest eDP panel refresh rate found from EDID
  * parsing for same resolution.
-- 
2.11.0

___
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/dp: Do not reset detect_done flag in intel_dp_detect (rev2)

2016-12-30 Thread Patchwork
== Series Details ==

Series: drm/i915/dp: Do not reset detect_done flag in intel_dp_detect (rev2)
URL   : https://patchwork.freedesktop.org/series/17110/
State : success

== Summary ==

Series 17110v2 drm/i915/dp: Do not reset detect_done flag in intel_dp_detect
https://patchwork.freedesktop.org/api/1.0/series/17110/revisions/2/mbox/

Test pm_rpm:
Subgroup basic-pci-d3-state:
incomplete -> PASS   (fi-byt-n2820)

fi-bdw-5557u total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050 total:246  pass:207  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205 total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700 total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900 total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820 total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770  total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770  total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hqtotal:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k total:246  pass:222  dwarn:3   dfail:0   fail:0   skip:21 
fi-skl-6770hqtotal:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600  total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 

584adc8f6687d7f6832ce060c3f6022282119f18 drm-tip: 2016y-12m-28d-13h-55m-14s UTC 
integration manifest
17c740f drm/i915/dp: Do not reset detect_done flag in intel_dp_detect

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3408/
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 3/6] drm/dp: Split drm_dp_mst_allocate_vcpi

2016-12-30 Thread kbuild test robot
Hi Dhinakaran,

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v4.10-rc1 next-20161224]
[cannot apply to drm/drm-next]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Dhinakaran-Pandiyan/Introduce-DP-MST-Topology-state/20161230-151546
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: i386-randconfig-r0-201652 (attached as .config)
compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/gpu/drm/nouveau/nv50_display.c: In function 'nv50_msto_enable':
>> drivers/gpu/drm/nouveau/nv50_display.c:2959:10: error: implicit declaration 
>> of function 'drm_dp_mst_find_vcpi_slots' 
>> [-Werror=implicit-function-declaration]
 slots = drm_dp_mst_find_vcpi_slots(>mgr, mstc->pbn);
 ^
   cc1: some warnings being treated as errors

vim +/drm_dp_mst_find_vcpi_slots +2959 drivers/gpu/drm/nouveau/nv50_display.c

  2953  }
  2954  }
  2955  
  2956  if (WARN_ON(!mstc))
  2957  return;
  2958  
> 2959  slots = drm_dp_mst_find_vcpi_slots(>mgr, mstc->pbn);
  2960  r = drm_dp_mst_allocate_vcpi(>mgr, mstc->port, mstc->pbn, 
slots);
  2961  WARN_ON(!r);
  2962  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] ✓ Fi.CI.BAT: success for Shared DPLL kernel doc and improvements (rev2)

2016-12-30 Thread Ander Conselvan De Oliveira
On Thu, 2016-12-29 at 15:53 +, Patchwork wrote:
> == Series Details ==
> 
> Series: Shared DPLL kernel doc and improvements (rev2)
> URL   : https://patchwork.freedesktop.org/series/13277/
> State : success

Patches 1-6 pushed.

Thanks
Ander


> == Summary ==
> 
> Series 13277v2 Shared DPLL kernel doc and improvements
> https://patchwork.freedesktop.org/api/1.0/series/13277/revisions/2/mbox/
> 
> Test pm_rpm:
> Subgroup basic-pci-d3-state:
> incomplete -> PASS   (fi-byt-n2820)
> 
> fi-bdw-5557u total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
> fi-bsw-n3050 total:246  pass:207  dwarn:0   dfail:0   fail:0   skip:39 
> fi-bxt-j4205 total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
> fi-bxt-t5700 total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
> fi-byt-j1900 total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
> fi-byt-n2820 total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
> fi-hsw-4770  total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
> fi-hsw-4770r total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
> fi-ivb-3520m total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
> fi-ivb-3770  total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
> fi-kbl-7500u total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
> fi-skl-6260u total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
> fi-skl-6700hqtotal:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
> fi-skl-6700k total:246  pass:222  dwarn:3   dfail:0   fail:0   skip:21 
> fi-skl-6770hqtotal:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
> fi-snb-2520m total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
> fi-snb-2600  total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 
> 
> 584adc8f6687d7f6832ce060c3f6022282119f18 drm-tip: 2016y-12m-28d-13h-55m-14s
> UTC integration manifest
> c905e30 drm/i915: Move intel_atomic_get_shared_dpll_state() to
> intel_dpll_mgr.c
> 8ee6bea drm/i915: Add dpll entrypoint for dumping hw state
> f3b72bb drm/i915: Update kerneldoc for intel_dpll_mgr.c
> 729333c drm/i915: Rename intel_shared_dpll->mode_set() to prepare()
> f06cf12 drm/i915: Rename intel_shared_dpll_config to intel_shared_dpll_state
> be94191 drm/i915: Rename intel_shared_dpll_commit() to _swap_state()
> dafe87c drm/i915: Introduce intel_release_shared_dpll()
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3403/
> ___
> 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