Re: [Intel-gfx] [PATCH 1/2] drm/dp: Bit definition for D3 power state that keeps AUX fully powered

2017-08-10 Thread Jani Nikula
On Fri, 11 Aug 2017, Dhinakaran Pandiyan  wrote:
> DPCD 600h - SET_POWER & SET_DP_PWR_VOLTAGE defines power state
>
> 101 = Set Main-Link for local Sink device and all downstream Sink
> devices to D3 (power-down mode), keep AUX block fully powered, ready to
> reply within a Response Timeout period of 300us.
>
> This state is useful in a MST dock + MST monitor configuration that
> doesn't wake up from D3 state.
>
> Signed-off-by: Dhinakaran Pandiyan 
> ---
>  include/drm/drm_dp_helper.h | 9 +
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index b17476a..d77e0f5 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -614,10 +614,11 @@
>  #define DP_BRANCH_HW_REV0x509
>  #define DP_BRANCH_SW_REV0x50A
>  
> -#define DP_SET_POWER0x600
> -# define DP_SET_POWER_D00x1
> -# define DP_SET_POWER_D30x2
> -# define DP_SET_POWER_MASK  0x3
> +#define DP_SET_POWER 0x600
> +# define DP_SET_POWER_D0 0x1
> +# define DP_SET_POWER_D3 0x2
> +# define DP_SET_POWER_MASK   0x3

Please keep the above intact. It appears space is the indent character
of choice in this file.

BR,
Jani.

> +# define DP_SET_POWER_D3_AUX_ON  0x5
>  
>  #define DP_EDP_DPCD_REV  0x700/* eDP 1.2 */
>  # define DP_EDP_11   0x00

-- 
Jani Nikula, Intel Open Source Technology Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [maintainer-tools PATCH v2 4/4] doc: build documentation using Sphinx

2017-08-10 Thread Jani Nikula
On Thu, 10 Aug 2017, Rodrigo Vivi  wrote:
> On Thu, Aug 10, 2017 at 12:39:49PM +0300, Jani Nikula wrote:
>> Based on Sphinx-quickstart, with existing and generated Makefiles merged
>> together.
>> 
>> This makes the rst2html and Sphinx builds work side by side. Plain
>> 'make' continues to use rst2html, and 'make html' and friends use
>> Sphinx. The intention is to keep both for a transition period so that we
>> can have documentation autobuilders updated.
>> 
>> Once we're fully converted to Sphinx, we can share the common parts of
>> drm-intel and drm-misc documentation better, and have more coherent
>> documentation overall. We can also start looking into using the graphviz
>> (Sphinx builtin) and WaveDrom (3rd party) extensions. For now, we use
>> the same old clunky methods for including them.
>> 
>> v2: require Sphinx 1.3, use sphinx_rtd_theme
>
> Thanks! :)
>
> Acked-by: Rodrigo Vivi 

Thanks Rodrigo and Sean for the acks/reviews, pushed.

BR,
Jani.

>
>> 
>> Signed-off-by: Jani Nikula 
>> ---
>>  .gitignore |   1 +
>>  Makefile   |  61 +++-
>>  conf.py| 236 
>> +
>>  index.rst  |  17 +
>>  4 files changed, 313 insertions(+), 2 deletions(-)
>>  create mode 100644 conf.py
>>  create mode 100644 index.rst
>> 
>> diff --git a/.gitignore b/.gitignore
>> index 35ed071ca482..a176bd76eef5 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -1,3 +1,4 @@
>> +_build
>>  drm-intel-flow.svg
>>  drm-misc-commit-flow.svg
>>  *.html
>> diff --git a/Makefile b/Makefile
>> index 7059eec42720..40b7ee6e2b32 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -4,6 +4,20 @@
>>  # the wavedrom json, copy-pasting to and from 
>> http://wavedrom.com/editor.html is
>>  # handy as it shows the result live.
>>  
>> +# You can set these variables from the command line.
>> +SPHINXOPTS=
>> +SPHINXBUILD   = sphinx-build
>> +PAPER =
>> +BUILDDIR  = _build
>> +
>> +# Internal variables.
>> +PAPEROPT_a4 = -D latex_paper_size=a4
>> +PAPEROPT_letter = -D latex_paper_size=letter
>> +ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) 
>> $(SPHINXOPTS) .
>> +# the i18n builder cannot share the environment and doctrees with the others
>> +I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
>> +
>> +.PHONY: all
>>  all: drm-intel.html dim.html drm-misc.html
>>  
>>  %.svg: %.dot
>> @@ -41,7 +55,50 @@ mancheck:
>>  
>>  check: shellcheck mancheck all
>>  
>> +.PHONY: clean
>>  clean:
>> -rm -f drm-intel.html drm-intel-flow.svg drm-misc-commit-flow.svg 
>> dim.html drm-misc.html
>> +rm -rf drm-intel.html drm-intel-flow.svg drm-misc-commit-flow.svg 
>> dim.html drm-misc.html $(BUILDDIR)
>> +
>> +.PHONY: help
>> +help:
>> +@echo "Please use \`make ' where  is one of"
>> +@echo "  html   to make standalone HTML files"
>> +@echo "  dirhtmlto make HTML files named index.html in directories"
>> +@echo "  singlehtml to make a single large HTML file"
>> +@echo "  linkcheck  to check all external links for integrity"
>> +@echo "  doctestto run all doctests embedded in the documentation 
>> (if enabled)"
>> +
>> +# FIXME: This works for the first build, but not for updates. Look into 
>> using
>> +# Sphinx extensions for both the graphviz and wavedrom parts.
>> +html dirhtml singlehtml linkcheck doctest: drm-intel-flow.svg 
>> drm-misc-commit-flow.svg
>> +
>> +.PHONY: html
>> +html:
>> +$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
>> +@echo
>> +@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
>> +
>> +.PHONY: dirhtml
>> +dirhtml:
>> +$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
>> +@echo
>> +@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
>> +
>> +.PHONY: singlehtml
>> +singlehtml:
>> +$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
>> +@echo
>> +@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
>> +
>> +.PHONY: linkcheck
>> +linkcheck:
>> +$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
>> +@echo
>> +@echo "Link check complete; look for any errors in the above output " \
>> +  "or in $(BUILDDIR)/linkcheck/output.txt."
>>  
>> -.PHONY: all clean
>> +.PHONY: doctest
>> +doctest:
>> +$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
>> +@echo "Testing of doctests in the sources finished, look at the " \
>> +  "results in $(BUILDDIR)/doctest/output.txt."
>> diff --git a/conf.py b/conf.py
>> new file mode 100644
>> index ..385c2aa8ff66
>> --- /dev/null
>> +++ b/conf.py
>> @@ -0,0 +1,236 @@
>> +# -*- coding: utf-8 -*-
>> +#
>> +# DRM Maintainer Tools documentation build configuration file, created by
>> +# sphinx-quickstart on Wed Aug  9 17:57:16 2017.
>> +#
>> +# This file is execfile()d with the current directory 

[Intel-gfx] [PATCH 2/2] drm/i915/dp: Leave the AUX block powered on for MST

2017-08-10 Thread Dhinakaran Pandiyan
Dell monitor with a built-in MST branch does not light up on boot when
connected to a Thinkpad dock. The monitor also does not wake up after
Suspend-to-Idle or dpms off in this configuration. Keeping the AUX
powered up in the D3 power state solved this problem.

This partially fixes
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90963

Cc: Ethan Hsieh 
Cc: Lyude 
Signed-off-by: Dhinakaran Pandiyan 
---
 drivers/gpu/drm/i915/intel_dp.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 76c8a0b..5595367 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2485,7 +2485,11 @@ void intel_dp_sink_dpms(struct intel_dp *intel_dp, int 
mode)
return;
 
if (mode != DRM_MODE_DPMS_ON) {
-   ret = drm_dp_dpcd_writeb(_dp->aux, DP_SET_POWER,
+   if (intel_dp->is_mst)
+   ret = drm_dp_dpcd_writeb(_dp->aux, DP_SET_POWER,
+DP_SET_POWER_D3_AUX_ON);
+   else
+   ret = drm_dp_dpcd_writeb(_dp->aux, DP_SET_POWER,
 DP_SET_POWER_D3);
} else {
struct intel_lspcon *lspcon = dp_to_lspcon(intel_dp);
-- 
2.7.4

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


[Intel-gfx] [PATCH 1/2] drm/dp: Bit definition for D3 power state that keeps AUX fully powered

2017-08-10 Thread Dhinakaran Pandiyan
DPCD 600h - SET_POWER & SET_DP_PWR_VOLTAGE defines power state

101 = Set Main-Link for local Sink device and all downstream Sink
devices to D3 (power-down mode), keep AUX block fully powered, ready to
reply within a Response Timeout period of 300us.

This state is useful in a MST dock + MST monitor configuration that
doesn't wake up from D3 state.

Signed-off-by: Dhinakaran Pandiyan 
---
 include/drm/drm_dp_helper.h | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index b17476a..d77e0f5 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -614,10 +614,11 @@
 #define DP_BRANCH_HW_REV0x509
 #define DP_BRANCH_SW_REV0x50A
 
-#define DP_SET_POWER0x600
-# define DP_SET_POWER_D00x1
-# define DP_SET_POWER_D30x2
-# define DP_SET_POWER_MASK  0x3
+#define DP_SET_POWER   0x600
+# define DP_SET_POWER_D0   0x1
+# define DP_SET_POWER_D3   0x2
+# define DP_SET_POWER_MASK 0x3
+# define DP_SET_POWER_D3_AUX_ON0x5
 
 #define DP_EDP_DPCD_REV0x700/* eDP 1.2 */
 # define DP_EDP_11 0x00
-- 
2.7.4

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


Re: [Intel-gfx] [PATCH] drm/i915/cnl: Add allowed DP rates for Cannonlake.

2017-08-10 Thread Manasi Navare
Verified this as per the Bspec and it looks good.

Manasi

On Thu, Aug 10, 2017 at 03:40:08PM -0700, Rodrigo Vivi wrote:
> "Frequencies over 5.4 GHz only supported on certain
> DDI ports and SKUs, and requires Vccio >= 0.95V."
> 
> More specifically, for current CNL SKUs available
> (CNL-U and CNL-Y) we have:
> 
> DDI A - 5.4G eDP
> DDI B - 8.1G DP
> DDI C - 8.1G DP
> DDI D - 5.4G DP
> 
> v2: Rebase on top of source_rates changes.
> v3: Address the max 5.4 x 8.1 per DDI and also consider vccio.
> 
> Cc: Mika Kahola 
> Signed-off-by: Rodrigo Vivi 
 Reviewed-by: Manasi Navare 
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 12 
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 76c8a0bd17f9..ead37c449019 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -97,6 +97,9 @@ static const int bxt_rates[] = { 162000, 216000, 243000, 
> 27,
> 324000, 432000, 54 };
>  static const int skl_rates[] = { 162000, 216000, 27,
> 324000, 432000, 54 };
> +static const int cnl_rates[] = { 162000, 216000, 27,
> +  324000, 432000, 54,
> +  648000, 81 };
>  static const int default_rates[] = { 162000, 27, 54 };
>  
>  /**
> @@ -229,8 +232,10 @@ intel_dp_set_source_rates(struct intel_dp *intel_dp)
>  {
>   struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
>   struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
> + enum port port = dig_port->port;
>   const int *source_rates;
>   int size;
> + u32 voltage;
>  
>   /* This should only be done once */
>   WARN_ON(intel_dp->source_rates || intel_dp->num_source_rates);
> @@ -238,6 +243,13 @@ intel_dp_set_source_rates(struct intel_dp *intel_dp)
>   if (IS_GEN9_LP(dev_priv)) {
>   source_rates = bxt_rates;
>   size = ARRAY_SIZE(bxt_rates);
> + } else if (IS_CANNONLAKE(dev_priv)) {
> + source_rates = cnl_rates;
> + size = ARRAY_SIZE(cnl_rates);
> + voltage = I915_READ(CNL_PORT_COMP_DW3) & VOLTAGE_INFO_MASK;
> + if (port == PORT_A || port == PORT_D ||
> + voltage == VOLTAGE_INFO_0_85V)
> + size -= 2;
>   } else if (IS_GEN9_BC(dev_priv)) {
>   source_rates = skl_rates;
>   size = ARRAY_SIZE(skl_rates);
> -- 
> 2.13.2
> 
> ___
> 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


Re: [Intel-gfx] [PATCH libdrm] drm: Remove create_handle() drm_framebuffer "virtual".

2017-08-10 Thread Emil Velikov
On 10 August 2017 at 20:29, Joe Kniss  wrote:
> On Wed, Aug 9, 2017 at 4:13 PM, Joe Kniss  wrote:
>> On Wed, Aug 9, 2017 at 12:14 PM, Noralf Trønnes  wrote:
>>>
>>> Den 09.08.2017 01.42, skrev Joe Kniss:

 Because all drivers currently use gem objects for framebuffer planes,
 the virtual create_handle() is not required.  This change adds a
 struct drm_gem_object *gems[4] field to drm_framebuffer and removes
 create_handle() function pointer from drm_framebuffer_funcs.  The
 corresponding *_create_handle() function is removed from each driver.

 In many cases this change eliminates a struct *_framebuffer object,
 as the only need for the derived struct is the addition of the gem
 object pointer.

 TESTED: compiled: allyesconfig ARCH=x86,arm platforms:i915, rockchip

 Signed-off-by: Joe Kniss 
 ---
>>>
>>>
>>> Hi Joe,
>>>
>>> I'm also looking into adding gem objs to drm_framebuffer in this patch:
>>> [PATCH v2 01/22] drm: Add GEM backed framebuffer library
>>> https://lists.freedesktop.org/archives/dri-devel/2017-August/149782.html
>>>
>>
>> Great.  There's only minimal overlap here.  I'll rebase this change on yours
>> once it's in.
>>
>>> [...]
>>>
 diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c
 b/drivers/gpu/drm/drm_fb_cma_helper.c
 index ade319d10e70..f5f011b910b1 100644
 --- a/drivers/gpu/drm/drm_fb_cma_helper.c
 +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
 @@ -31,14 +31,9 @@
 #define DEFAULT_FBDEFIO_DELAY_MS 50
   -struct drm_fb_cma {
 -   struct drm_framebuffer  fb;
 -   struct drm_gem_cma_object   *obj[4];
 -};
 -
   struct drm_fbdev_cma {
 struct drm_fb_helperfb_helper;
 -   struct drm_fb_cma   *fb;
 +   struct drm_framebuffer  *fb;
>>>
>>>
>>> This fb pointer isn't necessary, since fb_helper already has one.
>>>
>
> So, looking deeper into this, it seems that the struct
> drm_framebuffer_funcs *fb_funcs is also redundant here?  In which case
> this whole struct can go...
>
I think you're spot on.

Perhaps the goal was to allow drivers to use separate funcs for fb vs fbdev?
Not sure how well that will fair, yet again, all current users use the
same funcs for both.

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


[Intel-gfx] [PATCH i-g-t 3/4] lib/igt_vgem: Add a syncobj attach helper

2017-08-10 Thread Jason Ekstrand
Signed-off-by: Jason Ekstrand 
---
 lib/igt_vgem.c | 25 -
 lib/igt_vgem.h |  1 +
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/lib/igt_vgem.c b/lib/igt_vgem.c
index 21cccb3..069c6dd 100644
--- a/lib/igt_vgem.c
+++ b/lib/igt_vgem.c
@@ -101,8 +101,9 @@ void *vgem_mmap(int fd, struct vgem_bo *bo, unsigned prot)
 struct local_vgem_fence_attach {
uint32_t handle;
uint32_t flags;
+#define LOCAL_VGEM_FENCE_SYNCOBJ   0x2
uint32_t out_fence;
-   uint32_t pad;
+   uint32_t syncobj;
 };
 
 struct local_vgem_fence_signal {
@@ -167,6 +168,28 @@ uint32_t vgem_fence_attach(int fd, struct vgem_bo *bo, 
unsigned flags)
return arg.out_fence;
 }
 
+uint32_t vgem_fence_attach_syncobj(int fd, uint32_t syncobj)
+{
+   struct local_vgem_fence_attach arg;
+   struct vgem_bo bo;
+
+   /* Create a dummy BO so the import works */
+   bo.width = 1;
+   bo.height = 1;
+   bo.bpp = 4;
+   vgem_create(fd, );
+
+   memset(, 0, sizeof(arg));
+   arg.handle = bo.handle;
+   arg.syncobj = syncobj;
+   arg.flags = LOCAL_VGEM_FENCE_SYNCOBJ;
+   igt_assert_eq(__vgem_fence_attach(fd, ), 0);
+
+   gem_close(fd, bo.handle);
+
+   return arg.out_fence;
+}
+
 static int ioctl_vgem_fence_signal(int fd, struct local_vgem_fence_signal *arg)
 {
int err = 0;
diff --git a/lib/igt_vgem.h b/lib/igt_vgem.h
index 002ad7f..555674b 100644
--- a/lib/igt_vgem.h
+++ b/lib/igt_vgem.h
@@ -44,6 +44,7 @@ bool vgem_fence_has_flag(int fd, unsigned flags);
 uint32_t vgem_fence_attach(int fd, struct vgem_bo *bo, unsigned flags);
 #define VGEM_FENCE_WRITE 0x1
 #define WIP_VGEM_FENCE_NOTIMEOUT 0x2
+uint32_t vgem_fence_attach_syncobj(int fd, uint32_t syncobj);
 int __vgem_fence_signal(int fd, uint32_t fence);
 void vgem_fence_signal(int fd, uint32_t fence);
 
-- 
2.5.0.400.gff86faf

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


[Intel-gfx] [PATCH i-g-t 4/4] tests/syncobj: Add some wait and reset tests (v5)

2017-08-10 Thread Jason Ekstrand
This adds both trivial error-checking tests as well as more complex
tests which actually test whether or not waits do what they're supposed
to do.  They only currently work on i915 but it should be simple to hook
them up for other drivers by simply implementing the little function
pointer hook provided at the top for triggering a syncobj.

v2:
 - Actually add the reset tests.
v3:
 - Only do one execbuf for trigger
 - Use do_ioctl and do_ioctl_err
 - Better check for syncobj support
 - Add local_/LOCAL_ defines of things
 - Use a timer instead of a pthread
v4:
 - Use ioctl wrappers
 - Use VGEM instead of i915
 - Combine a bunch of the simple tests into one function
v5:
 - Combinatorially generate basic tests
 - Use sw_sync instead of using vgem directly
 - Add even more tests

Signed-off-by: Jason Ekstrand 
---
 tests/Makefile.sources |   1 +
 tests/syncobj_wait.c   | 746 +
 2 files changed, 747 insertions(+)
 create mode 100644 tests/syncobj_wait.c

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index bb013c7..430b637 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -230,6 +230,7 @@ TESTS_progs = \
prime_vgem \
sw_sync \
syncobj_basic \
+   syncobj_wait \
template \
tools_test \
vgem_basic \
diff --git a/tests/syncobj_wait.c b/tests/syncobj_wait.c
new file mode 100644
index 000..a7a8953
--- /dev/null
+++ b/tests/syncobj_wait.c
@@ -0,0 +1,746 @@
+/*
+ * Copyright © 2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "igt.h"
+#include "sw_sync.h"
+#include "igt_syncobj.h"
+#include 
+#include 
+#include 
+#include "drm.h"
+
+IGT_TEST_DESCRIPTION("Tests for the drm sync object wait API");
+
+/* One tenth of a second */
+#define SHORT_TIME_NSEC 1ull
+
+#define NSECS_PER_SEC 10ull
+
+static uint64_t
+gettime_ns(void)
+{
+   struct timespec current;
+   clock_gettime(CLOCK_MONOTONIC, );
+   return (uint64_t)current.tv_sec * NSECS_PER_SEC + current.tv_nsec;
+}
+
+static void
+sleep_nsec(uint64_t time_nsec)
+{
+   struct timespec t;
+   t.tv_sec = time_nsec / NSECS_PER_SEC;
+   t.tv_nsec = time_nsec % NSECS_PER_SEC;
+   igt_assert_eq(nanosleep(, NULL), 0);
+}
+
+static uint64_t
+short_timeout(void)
+{
+   return gettime_ns() + SHORT_TIME_NSEC;
+}
+
+static int
+syncobj_attach_sw_sync(int fd, uint32_t handle)
+{
+   struct drm_syncobj_handle;
+   int timeline, fence;
+
+   timeline = sw_sync_timeline_create();
+   fence = sw_sync_timeline_create_fence(timeline, 1);
+   syncobj_import_sync_file(fd, handle, fence);
+   close(fence);
+
+   return timeline;
+}
+
+static void
+syncobj_trigger(int fd, uint32_t handle)
+{
+   int timeline = syncobj_attach_sw_sync(fd, handle);
+   sw_sync_timeline_inc(timeline, 1);
+   close(timeline);
+}
+
+static timer_t
+set_timer(void (*cb)(union sigval), void *ptr, int i, uint64_t nsec)
+{
+timer_t timer;
+struct sigevent sev;
+struct itimerspec its;
+
+memset(, 0, sizeof(sev));
+sev.sigev_notify = SIGEV_THREAD;
+   if (ptr)
+   sev.sigev_value.sival_ptr = ptr;
+   else
+   sev.sigev_value.sival_int = i;
+sev.sigev_notify_function = cb;
+igt_assert(timer_create(CLOCK_MONOTONIC, , ) == 0);
+
+memset(, 0, sizeof(its));
+its.it_value.tv_sec = nsec / NSEC_PER_SEC;
+its.it_value.tv_nsec = nsec % NSEC_PER_SEC;
+igt_assert(timer_settime(timer, 0, , NULL) == 0);
+
+   return timer;
+}
+
+struct fd_handle_pair {
+   int fd;
+   uint32_t handle;
+};
+
+static void
+timeline_inc_func(union sigval sigval)
+{
+   sw_sync_timeline_inc(sigval.sival_int, 1);
+}
+
+static void
+syncobj_trigger_free_pair_func(union sigval sigval)

[Intel-gfx] [PATCH i-g-t 2/4] tests/syncobj: Convert the basic test over to the helpers

2017-08-10 Thread Jason Ekstrand
Signed-off-by: Jason Ekstrand 
---
 tests/syncobj_basic.c | 77 +--
 1 file changed, 19 insertions(+), 58 deletions(-)

diff --git a/tests/syncobj_basic.c b/tests/syncobj_basic.c
index a7a6742..b08dd2d 100644
--- a/tests/syncobj_basic.c
+++ b/tests/syncobj_basic.c
@@ -22,6 +22,7 @@
  */
 
 #include "igt.h"
+#include "igt_syncobj.h"
 #include 
 #include 
 #include "drm.h"
@@ -48,14 +49,11 @@ static void
 test_bad_handle_to_fd(int fd)
 {
struct drm_syncobj_handle handle;
-   int ret;
 
handle.handle = 0xdeadbeef;
handle.flags = 0;
 
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD, );
-
-   igt_assert(ret == -1 && errno == EINVAL);
+   igt_assert_eq(__syncobj_handle_to_fd(fd, ), -EINVAL);
 }
 
 /* fd to handle a bad fd */
@@ -63,14 +61,11 @@ static void
 test_bad_fd_to_handle(int fd)
 {
struct drm_syncobj_handle handle;
-   int ret;
 
handle.fd = -1;
handle.flags = 0;
 
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE, );
-
-   igt_assert(ret == -1 && errno == EINVAL);
+   igt_assert_eq(__syncobj_fd_to_handle(fd, ), -EINVAL);
 }
 
 /* fd to handle an fd but not a sync file one */
@@ -78,58 +73,47 @@ static void
 test_illegal_fd_to_handle(int fd)
 {
struct drm_syncobj_handle handle;
-   int ret;
 
handle.fd = fd;
handle.flags = 0;
 
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE, );
-
-   igt_assert(ret == -1 && errno == EINVAL);
+   igt_assert_eq(__syncobj_fd_to_handle(fd, ), -EINVAL);
 }
 
 static void
 test_bad_flags_fd_to_handle(int fd)
 {
struct drm_syncobj_handle handle = { 0 };
-   int ret;
 
handle.flags = 0xdeadbeef;
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE, );
-   igt_assert(ret == -1 && errno == EINVAL);
+   igt_assert_eq(__syncobj_fd_to_handle(fd, ), -EINVAL);
 }
 
 static void
 test_bad_flags_handle_to_fd(int fd)
 {
struct drm_syncobj_handle handle = { 0 };
-   int ret;
 
handle.flags = 0xdeadbeef;
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD, );
-   igt_assert(ret == -1 && errno == EINVAL);
+   igt_assert_eq(__syncobj_handle_to_fd(fd, ), -EINVAL);
 }
 
 static void
 test_bad_pad_handle_to_fd(int fd)
 {
struct drm_syncobj_handle handle = { 0 };
-   int ret;
 
handle.pad = 0xdeadbeef;
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD, );
-   igt_assert(ret == -1 && errno == EINVAL);
+   igt_assert_eq(__syncobj_handle_to_fd(fd, ), -EINVAL);
 }
 
 static void
 test_bad_pad_fd_to_handle(int fd)
 {
struct drm_syncobj_handle handle = { 0 };
-   int ret;
 
handle.pad = 0xdeadbeef;
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE, );
-   igt_assert(ret == -1 && errno == EINVAL);
+   igt_assert_eq(__syncobj_fd_to_handle(fd, ), -EINVAL);
 }
 
 
@@ -138,24 +122,17 @@ test_bad_pad_fd_to_handle(int fd)
 static void
 test_bad_destroy_pad(int fd)
 {
-   struct drm_syncobj_create create = { 0 };
struct drm_syncobj_destroy destroy;
int ret;
 
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_CREATE, );
-
-   destroy.handle = create.handle;
+   destroy.handle = syncobj_create(fd);
destroy.pad = 0xdeadbeef;
 
ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_DESTROY, );
 
igt_assert(ret == -1 && errno == EINVAL);
 
-   destroy.handle = create.handle;
-   destroy.pad = 0;
-
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_DESTROY, );
-   igt_assert(ret == 0);
+   syncobj_destroy(fd, destroy.handle);
 }
 
 static void
@@ -176,34 +153,18 @@ test_bad_create_flags(int fd)
 static void
 test_valid_cycle(int fd)
 {
-   int ret;
-   struct drm_syncobj_create create = { 0 };
-   struct drm_syncobj_handle handle = { 0 };
-   struct drm_syncobj_destroy destroy = { 0 };
-   uint32_t first_handle;
-
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_CREATE, );
-   igt_assert(ret == 0);
+   uint32_t first_handle, second_handle;
+   int syncobj_fd;
 
-   first_handle = create.handle;
+   first_handle = syncobj_create(fd);
+   syncobj_fd = syncobj_handle_to_fd(fd, first_handle, 0);
+   second_handle = syncobj_fd_to_handle(fd, syncobj_fd, 0);
+   close(syncobj_fd);
 
-   handle.handle = create.handle;
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD, );
-   igt_assert(ret == 0);
-   handle.handle = 0;
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE, );
-   close(handle.fd);
-   igt_assert(ret == 0);
+   igt_assert(first_handle != second_handle);
 
-   igt_assert(handle.handle != first_handle);
-
-   destroy.handle = handle.handle;
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_DESTROY, );
-   igt_assert(ret == 0);
-
-   destroy.handle = first_handle;
-   ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_DESTROY, );
-   igt_assert(ret == 0);
+   syncobj_destroy(fd, 

[Intel-gfx] [PATCH i-g-t 1/4] lib: Add some syncobj helpers

2017-08-10 Thread Jason Ekstrand
Signed-off-by: Jason Ekstrand 
---
 lib/Makefile.sources |   2 +
 lib/igt_syncobj.c| 186 +++
 lib/igt_syncobj.h|  66 ++
 3 files changed, 254 insertions(+)
 create mode 100644 lib/igt_syncobj.c
 create mode 100644 lib/igt_syncobj.h

diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 53fdb54..692fe30 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -83,6 +83,8 @@ lib_source_list = \
uwildmat/uwildmat.c \
igt_kmod.c  \
igt_kmod.h  \
+   igt_syncobj.c   \
+   igt_syncobj.h   \
$(NULL)
 
 .PHONY: version.h.tmp
diff --git a/lib/igt_syncobj.c b/lib/igt_syncobj.c
new file mode 100644
index 000..fe0d26c
--- /dev/null
+++ b/lib/igt_syncobj.c
@@ -0,0 +1,186 @@
+/*
+ * Copyright © 2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include 
+#include 
+
+#include "igt.h"
+#include "igt_syncobj.h"
+
+static int
+__syncobj_create(int fd, uint32_t *handle)
+{
+   struct drm_syncobj_create create = { 0 };
+   int err = 0;
+
+   if (drmIoctl(fd, DRM_IOCTL_SYNCOBJ_CREATE, ))
+   err = -errno;
+   *handle = create.handle;
+   return err;
+}
+
+uint32_t
+syncobj_create(int fd)
+{
+   uint32_t handle;
+   igt_assert_eq(__syncobj_create(fd, ), 0);
+   igt_assert(handle);
+   return handle;
+}
+
+static int
+__syncobj_destroy(int fd, uint32_t handle)
+{
+   struct drm_syncobj_destroy destroy = { 0 };
+   int err = 0;
+
+   destroy.handle = handle;
+   if (drmIoctl(fd, DRM_IOCTL_SYNCOBJ_DESTROY, ))
+   err = -errno;
+   return err;
+}
+
+void
+syncobj_destroy(int fd, uint32_t handle)
+{
+   igt_assert_eq(__syncobj_destroy(fd, handle), 0);
+}
+
+int
+__syncobj_handle_to_fd(int fd, struct drm_syncobj_handle *args)
+{
+   int err = 0;
+   if (drmIoctl(fd, DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD, args))
+   err = -errno;
+   return err;
+}
+
+int
+syncobj_handle_to_fd(int fd, uint32_t handle, uint32_t flags)
+{
+   struct drm_syncobj_handle args = { 0 };
+   args.handle = handle;
+   args.flags = flags;
+   igt_assert_eq(__syncobj_handle_to_fd(fd, ), 0);
+   igt_assert(args.fd >= 0);
+   return args.fd;
+}
+
+int
+__syncobj_fd_to_handle(int fd, struct drm_syncobj_handle *args)
+{
+   int err = 0;
+   if (drmIoctl(fd, DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE, args))
+   err = -errno;
+   return err;
+}
+
+uint32_t
+syncobj_fd_to_handle(int fd, int syncobj_fd, uint32_t flags)
+{
+   struct drm_syncobj_handle args = { 0 };
+   args.fd = syncobj_fd;
+   args.flags = flags;
+   igt_assert_eq(__syncobj_fd_to_handle(fd, ), 0);
+   igt_assert(args.handle > 0);
+   return args.handle;
+}
+
+void
+syncobj_import_sync_file(int fd, uint32_t handle, int sync_file)
+{
+   struct drm_syncobj_handle args = { 0 };
+   args.handle = handle;
+   args.fd = sync_file;
+   args.flags = DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE;
+   igt_assert_eq(__syncobj_fd_to_handle(fd, ), 0);
+}
+
+int
+__syncobj_wait(int fd, struct local_syncobj_wait *args)
+{
+   int err = 0;
+   if (drmIoctl(fd, LOCAL_IOCTL_SYNCOBJ_WAIT, args))
+   err = -errno;
+   return err;
+}
+
+int
+syncobj_wait_err(int fd, uint32_t *handles, uint32_t count,
+uint64_t abs_timeout_nsec, uint32_t flags)
+{
+   struct local_syncobj_wait wait;
+
+   wait.handles = to_user_pointer(handles);
+   wait.timeout_nsec = abs_timeout_nsec;
+   wait.count_handles = count;
+   wait.flags = flags;
+   wait.first_signaled = 0;
+   wait.pad = 0;
+
+   return __syncobj_wait(fd, );
+}
+
+bool
+syncobj_wait(int fd, uint32_t *handles, uint32_t count,
+

Re: [Intel-gfx] [PATCH] drm/i915: Introduce intel_hdp_pin.

2017-08-10 Thread Pandiyan, Dhinakaran
On Thu, 2017-08-10 at 14:23 -0700, Rodrigo Vivi wrote:
> On Wed, Aug 9, 2017 at 9:44 PM, Pandiyan, Dhinakaran
>  wrote:
> > On Wed, 2017-08-02 at 12:26 -0700, Rodrigo Vivi wrote:
> >> The idea is to have an unique place to decide the pin-port
> >> per platform.
> >>
> >> So let's create this function now without any functional
> >> change.
> >
> > This seems to change the behavior when port A is not eDP.
> >
> >> Just adding together code from hdmi and dp together.
> >>
> >> v2: Add missing pin for port A.
> >>
> >> Cc: Ville Syrjälä 
> >> Signed-off-by: Rodrigo Vivi 
> >> ---
> >>  drivers/gpu/drm/i915/i915_drv.h  |  1 +
> >>  drivers/gpu/drm/i915/intel_dp.c  |  8 ++--
> >>  drivers/gpu/drm/i915/intel_hdmi.c| 19 +--
> >>  drivers/gpu/drm/i915/intel_hotplug.c | 26 ++
> >>  4 files changed, 30 insertions(+), 24 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/i915_drv.h 
> >> b/drivers/gpu/drm/i915/i915_drv.h
> >> index 5c2c7a677e96..c038717ad739 100644
> >> --- a/drivers/gpu/drm/i915/i915_drv.h
> >> +++ b/drivers/gpu/drm/i915/i915_drv.h
> >> @@ -3148,6 +3148,7 @@ void intel_hpd_init(struct drm_i915_private 
> >> *dev_priv);
> >>  void intel_hpd_init_work(struct drm_i915_private *dev_priv);
> >>  void intel_hpd_cancel_work(struct drm_i915_private *dev_priv);
> >>  enum port intel_hpd_port(enum hpd_pin pin);
> >> +enum hpd_pin intel_hpd_pin(enum port port);
> >>  bool intel_hpd_disable(struct drm_i915_private *dev_priv, enum hpd_pin 
> >> pin);
> >>  void intel_hpd_enable(struct drm_i915_private *dev_priv, enum hpd_pin 
> >> pin);
> >>
> >> diff --git a/drivers/gpu/drm/i915/intel_dp.c 
> >> b/drivers/gpu/drm/i915/intel_dp.c
> >> index d4e6128f3b3a..126783752c6d 100644
> >> --- a/drivers/gpu/drm/i915/intel_dp.c
> >> +++ b/drivers/gpu/drm/i915/intel_dp.c
> >> @@ -5906,26 +5906,22 @@ intel_dp_init_connector_port_info(struct 
> >> intel_digital_port *intel_dig_port)
> >>   struct intel_encoder *encoder = _dig_port->base;
> >>   struct intel_dp *intel_dp = _dig_port->dp;
> >>
> >> + encoder->hpd_pin = intel_hpd_pin(intel_dig_port->port);
> >> +
> >>   switch (intel_dig_port->port) {
> >>   case PORT_A:
> >> - encoder->hpd_pin = HPD_PORT_A;
> >>   intel_dp->aux_power_domain = POWER_DOMAIN_AUX_A;
> >>   break;
> >>   case PORT_B:
> >> - encoder->hpd_pin = HPD_PORT_B;
> >>   intel_dp->aux_power_domain = POWER_DOMAIN_AUX_B;
> >>   break;
> >>   case PORT_C:
> >> - encoder->hpd_pin = HPD_PORT_C;
> >>   intel_dp->aux_power_domain = POWER_DOMAIN_AUX_C;
> >>   break;
> >>   case PORT_D:
> >> - encoder->hpd_pin = HPD_PORT_D;
> >>   intel_dp->aux_power_domain = POWER_DOMAIN_AUX_D;
> >>   break;
> >>   case PORT_E:
> >> - encoder->hpd_pin = HPD_PORT_E;
> >> -
> >>   /* FIXME: Check VBT for actual wiring of PORT E */
> >>   intel_dp->aux_power_domain = POWER_DOMAIN_AUX_D;
> >>   break;
> >> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c 
> >> b/drivers/gpu/drm/i915/intel_hdmi.c
> >> index 5609976539bf..dcd14c71a989 100644
> >> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> >> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> >> @@ -1921,24 +1921,7 @@ void intel_hdmi_init_connector(struct 
> >> intel_digital_port *intel_dig_port,
> >>   connector->ycbcr_420_allowed = true;
> >>
> >>   intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
> >> -
> >> - switch (port) {
> >> - case PORT_B:
> >> - intel_encoder->hpd_pin = HPD_PORT_B;
> >> - break;
> >> - case PORT_C:
> >> - intel_encoder->hpd_pin = HPD_PORT_C;
> >> - break;
> >> - case PORT_D:
> >> - intel_encoder->hpd_pin = HPD_PORT_D;
> >> - break;
> >> - case PORT_E:
> >> - intel_encoder->hpd_pin = HPD_PORT_E;
> >> - break;
> >> - default:
> >> - MISSING_CASE(port);
> >> - return;
> >> - }
> >> + intel_encoder->hpd_pin = intel_hpd_pin(port);
> >
> > Instead of returning early for port A, this will go ahead and attach the
> > HDMI encoder to the connector.
> 
> hmm! indeed!
> this also explains how I end up forgetting the PORT_A on v1...
> 
> > However, I don't know likely  we'll have
> > a vbt that says port A supports both DP and HDMI but not eDP.
> 
> If we have a VBT stating that or it is a current bug we have or if
> we have a VBT that lies to that point we have probably bigger issues,
> but I understand that so far this option is working stable out there and
> we don't want to take the risk, so what about a"
> 
> + if(WARN_ON(port == PORT_A)) return;
> + intel_encoder->hpd_pin = intel_hpd_pin(port);
> 

Looks good to me with this change

Re: [Intel-gfx] [PATCH i-g-t 5/5] igt_command_line.sh: Test subtest documentation flag handling

2017-08-10 Thread Belgaumkar, Vinay



On 8/10/2017 3:26 AM, Petri Latvala wrote:

Signed-off-by: Petri Latvala 
---
  tests/igt_command_line.sh | 12 +++-
  1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
index 7f80fc8..b3a794c 100755
--- a/tests/igt_command_line.sh
+++ b/tests/igt_command_line.sh
@@ -102,7 +102,17 @@ for test in $TESTLIST; do
fi
fi
  
+	# check --document-all-subtests handling

+   echo "  Checking subtest documentation..."
+   DOCS=`./$test --document-all-subtests`
+   RET=$?
+
+   if [ $RET -ne 0 -a $RET -ne 79 ]; then
+   fail $test
+   fi
+
# check invalid subtest handling
echo "  Checking invalid subtest handling..."
-   ./$test --run-subtest invalid-subtest > /dev/null 2>&1 && fail $test
+   ./$test --run-subtest invalid-subtest > /dev/null 2>&1 && fail "$test 
--run-subtest invalid"
+   ./$test --document-subtest invalid-subtest > /dev/null 2>&1 && fail "$test 
--document-subtest invalid"
  done


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


Re: [Intel-gfx] [PATCH i-g-t 4/5] testdisplay: Handle subtest documentation flags

2017-08-10 Thread Belgaumkar, Vinay



On 8/10/2017 3:26 AM, Petri Latvala wrote:

testdisplay has no subtests so hook them to existing subtest handling.

Signed-off-by: Petri Latvala 
---
  tests/testdisplay.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index f2a41fa..85b118f 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -623,6 +623,8 @@ int main(int argc, char **argv)
struct option long_opts[] = {
{"list-subtests", 0, 0, SUBTEST_OPTS},
{"run-subtest", 1, 0, SUBTEST_OPTS},
+   {"document-all-subtests", 0, 0, SUBTEST_OPTS},
+   {"document-subtest", 1, 0, SUBTEST_OPTS},
{"help-description", 0, 0, HELP_DESCRIPTION},
{"help", 0, 0, 'h'},
{"yb", 0, 0, Yb_OPT},


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


[Intel-gfx] [PATCH] drm/i915/cnl: Dump the right pll registers when dumping pipe config.

2017-08-10 Thread Rodrigo Vivi
Different from SKL we don't need ctrl1 and cfgcr2, but
we need to dump cfgcr0 and cfgcr1 instead.

v2: rebase and commit message

Cc: Clint Taylor 
Cc: Mika Kahola 
Signed-off-by: Rodrigo Vivi 
Reviewed-by: Mika Kahola 
---
 drivers/gpu/drm/i915/intel_dpll_mgr.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c 
b/drivers/gpu/drm/i915/intel_dpll_mgr.c
index 2f7b0e64f628..a2a3d93d67bd 100644
--- a/drivers/gpu/drm/i915/intel_dpll_mgr.c
+++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c
@@ -2379,6 +2379,15 @@ cnl_get_dpll(struct intel_crtc *crtc, struct 
intel_crtc_state *crtc_state,
return pll;
 }
 
+static void cnl_dump_hw_state(struct drm_i915_private *dev_priv,
+ struct intel_dpll_hw_state *hw_state)
+{
+   DRM_DEBUG_KMS("dpll_hw_state: "
+ "cfgcr0: 0x%x, cfgcr1: 0x%x\n",
+ hw_state->cfgcr0,
+ hw_state->cfgcr1);
+}
+
 static const struct intel_shared_dpll_funcs cnl_ddi_pll_funcs = {
.enable = cnl_ddi_pll_enable,
.disable = cnl_ddi_pll_disable,
@@ -2395,7 +2404,7 @@ static const struct dpll_info cnl_plls[] = {
 static const struct intel_dpll_mgr cnl_pll_mgr = {
.dpll_info = cnl_plls,
.get_dpll = cnl_get_dpll,
-   .dump_hw_state = skl_dump_hw_state,
+   .dump_hw_state = cnl_dump_hw_state,
 };
 
 /**
-- 
2.13.2

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


[Intel-gfx] [PATCH] drm/i915/cnl: Add allowed DP rates for Cannonlake.

2017-08-10 Thread Rodrigo Vivi
"Frequencies over 5.4 GHz only supported on certain
DDI ports and SKUs, and requires Vccio >= 0.95V."

More specifically, for current CNL SKUs available
(CNL-U and CNL-Y) we have:

DDI A - 5.4G eDP
DDI B - 8.1G DP
DDI C - 8.1G DP
DDI D - 5.4G DP

v2: Rebase on top of source_rates changes.
v3: Address the max 5.4 x 8.1 per DDI and also consider vccio.

Cc: Mika Kahola 
Signed-off-by: Rodrigo Vivi 
---
 drivers/gpu/drm/i915/intel_dp.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 76c8a0bd17f9..ead37c449019 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -97,6 +97,9 @@ static const int bxt_rates[] = { 162000, 216000, 243000, 
27,
  324000, 432000, 54 };
 static const int skl_rates[] = { 162000, 216000, 27,
  324000, 432000, 54 };
+static const int cnl_rates[] = { 162000, 216000, 27,
+324000, 432000, 54,
+648000, 81 };
 static const int default_rates[] = { 162000, 27, 54 };
 
 /**
@@ -229,8 +232,10 @@ intel_dp_set_source_rates(struct intel_dp *intel_dp)
 {
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
+   enum port port = dig_port->port;
const int *source_rates;
int size;
+   u32 voltage;
 
/* This should only be done once */
WARN_ON(intel_dp->source_rates || intel_dp->num_source_rates);
@@ -238,6 +243,13 @@ intel_dp_set_source_rates(struct intel_dp *intel_dp)
if (IS_GEN9_LP(dev_priv)) {
source_rates = bxt_rates;
size = ARRAY_SIZE(bxt_rates);
+   } else if (IS_CANNONLAKE(dev_priv)) {
+   source_rates = cnl_rates;
+   size = ARRAY_SIZE(cnl_rates);
+   voltage = I915_READ(CNL_PORT_COMP_DW3) & VOLTAGE_INFO_MASK;
+   if (port == PORT_A || port == PORT_D ||
+   voltage == VOLTAGE_INFO_0_85V)
+   size -= 2;
} else if (IS_GEN9_BC(dev_priv)) {
source_rates = skl_rates;
size = ARRAY_SIZE(skl_rates);
-- 
2.13.2

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


Re: [Intel-gfx] [PATCH i-g-t 1/5] Add support for subtest-specific documentation

2017-08-10 Thread Belgaumkar, Vinay



On 8/10/2017 3:26 AM, Petri Latvala wrote:

The current documentation for tests is limited to a single string per
test binary. This patch adds support for documenting individual
subtests.

The syntax for subtest documentation is:

igt_document_subtest("Frob knobs to see if one of the "
 "crossbeams will go out of skew on the "
 "treadle.\n");
igt_subtest("knob-frobbing-askew")
  test_frob();

or with a format string:

   for_example_loop(e) {
 igt_document_subtest_f("Frob %s to see if one of the "
"crossbeams will go out of skew on the "
"treadle.\n", e->readable_name);
 igt_subtest_f("%s-frob-askew", e->name)
   test_frob(e);
   }

The documentation cannot be extracted from just comments, because
associating them with the correct subtest name will then require doing
pattern matching in the documentation generator, for subtests where
the name is generated at runtime using igt_subtest_f.

v2: Rebase, change function name in commit message to match code

v3: Fix current documentation string tracking, add missing va_end (Vinay)

v4: Fix brainfart in __igt_run_subtest

Signed-off-by: Petri Latvala 
Acked-by: Leo Li 
Acked-by: Arkadiusz Hiler 
---
  lib/igt_aux.c  |   8 ++--
  lib/igt_core.c | 149 +
  lib/igt_core.h |   6 ++-
  3 files changed, 128 insertions(+), 35 deletions(-)

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index f428f15..d56f41f 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -311,7 +311,7 @@ static void sig_handler(int i)
   */
  void igt_fork_signal_helper(void)
  {
-   if (igt_only_list_subtests())
+   if (igt_only_collect_data())
return;
  
  	/* We pick SIGCONT as it is a "safe" signal - if we send SIGCONT to

@@ -344,7 +344,7 @@ void igt_fork_signal_helper(void)
   */
  void igt_stop_signal_helper(void)
  {
-   if (igt_only_list_subtests())
+   if (igt_only_collect_data())
return;
  
  	igt_stop_helper(_helper);

@@ -375,7 +375,7 @@ static void __attribute__((noreturn)) 
shrink_helper_process(int fd, pid_t pid)
   */
  void igt_fork_shrink_helper(int drm_fd)
  {
-   assert(!igt_only_list_subtests());
+   assert(!igt_only_collect_data());
igt_require(igt_drop_caches_has(drm_fd, DROP_SHRINK_ALL));
igt_fork_helper(_helper)
shrink_helper_process(drm_fd, getppid());
@@ -473,7 +473,7 @@ void igt_stop_hang_detector(void)
  #else
  void igt_fork_hang_detector(int fd)
  {
-   if (igt_only_list_subtests())
+   if (igt_only_collect_data())
return;
  }
  
diff --git a/lib/igt_core.c b/lib/igt_core.c

index c0488e9..f126ef8 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -99,7 +99,7 @@
   *
   * To allow this i-g-t provides #igt_fixture code blocks for setup code 
outside
   * of subtests and automatically skips the subtest code blocks themselves. For
- * special cases igt_only_list_subtests() is also provided. For setup code only
+ * special cases igt_only_collect_data() is also provided. For setup code only
   * shared by a group of subtest encapsulate the #igt_fixture block and all the
   * subtestest in a #igt_subtest_group block.
   *
@@ -253,9 +253,9 @@ static unsigned int exit_handler_count;
  const char *igt_interactive_debug;
  
  /* subtests helpers */

-static bool list_subtests = false;
-static char *run_single_subtest = NULL;
-static bool run_single_subtest_found = false;
+static char *single_subtest = NULL;
+static bool single_subtest_found = false;
+static char *current_subtest_documentation = NULL;
  static const char *in_subtest = NULL;
  static struct timespec subtest_time;
  static clockid_t igt_clock = (clockid_t)-1;
@@ -265,6 +265,13 @@ static bool in_atexit_handler = false;
  static enum {
CONT = 0, SKIP, FAIL
  } skip_subtests_henceforth = CONT;
+static enum {
+   EXECUTE_ALL,
+   EXECUTE_SINGLE,
+   LIST_SUBTESTS,
+   DOCUMENT,
+   DOCUMENT_SINGLE
+} runmode = EXECUTE_ALL;
  
  bool __igt_plain_output = false;
  
@@ -277,6 +284,8 @@ bool test_child;

  enum {
   OPT_LIST_SUBTESTS,
   OPT_RUN_SUBTEST,
+ OPT_DOC_SUBTESTS,
+ OPT_DOC_SINGLE_SUBTEST,
   OPT_DESCRIPTION,
   OPT_DEBUG,
   OPT_INTERACTIVE_DEBUG,
@@ -469,7 +478,7 @@ bool __igt_fixture(void)
  {
assert(!in_fixture);
  
-	if (igt_only_list_subtests())

+   if (igt_only_collect_data())
return false;
  
  	if (skip_subtests_henceforth)

@@ -563,7 +572,7 @@ static void low_mem_killer_disable(bool disable)
  bool igt_exit_called;
  static void common_exit_handler(int sig)
  {
-   if (!igt_only_list_subtests()) {
+   if (!igt_only_collect_data()) {
low_mem_killer_disable(false);
kick_fbcon(true);
}
@@ -583,7 +592,7 @@ static void print_version(void)
  {
  

Re: [Intel-gfx] [PATCH] drm/i915: Introduce intel_hdp_pin.

2017-08-10 Thread Rodrigo Vivi
On Wed, Aug 9, 2017 at 9:44 PM, Pandiyan, Dhinakaran
 wrote:
> On Wed, 2017-08-02 at 12:26 -0700, Rodrigo Vivi wrote:
>> The idea is to have an unique place to decide the pin-port
>> per platform.
>>
>> So let's create this function now without any functional
>> change.
>
> This seems to change the behavior when port A is not eDP.
>
>> Just adding together code from hdmi and dp together.
>>
>> v2: Add missing pin for port A.
>>
>> Cc: Ville Syrjälä 
>> Signed-off-by: Rodrigo Vivi 
>> ---
>>  drivers/gpu/drm/i915/i915_drv.h  |  1 +
>>  drivers/gpu/drm/i915/intel_dp.c  |  8 ++--
>>  drivers/gpu/drm/i915/intel_hdmi.c| 19 +--
>>  drivers/gpu/drm/i915/intel_hotplug.c | 26 ++
>>  4 files changed, 30 insertions(+), 24 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_drv.h 
>> b/drivers/gpu/drm/i915/i915_drv.h
>> index 5c2c7a677e96..c038717ad739 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.h
>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>> @@ -3148,6 +3148,7 @@ void intel_hpd_init(struct drm_i915_private *dev_priv);
>>  void intel_hpd_init_work(struct drm_i915_private *dev_priv);
>>  void intel_hpd_cancel_work(struct drm_i915_private *dev_priv);
>>  enum port intel_hpd_port(enum hpd_pin pin);
>> +enum hpd_pin intel_hpd_pin(enum port port);
>>  bool intel_hpd_disable(struct drm_i915_private *dev_priv, enum hpd_pin pin);
>>  void intel_hpd_enable(struct drm_i915_private *dev_priv, enum hpd_pin pin);
>>
>> diff --git a/drivers/gpu/drm/i915/intel_dp.c 
>> b/drivers/gpu/drm/i915/intel_dp.c
>> index d4e6128f3b3a..126783752c6d 100644
>> --- a/drivers/gpu/drm/i915/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/intel_dp.c
>> @@ -5906,26 +5906,22 @@ intel_dp_init_connector_port_info(struct 
>> intel_digital_port *intel_dig_port)
>>   struct intel_encoder *encoder = _dig_port->base;
>>   struct intel_dp *intel_dp = _dig_port->dp;
>>
>> + encoder->hpd_pin = intel_hpd_pin(intel_dig_port->port);
>> +
>>   switch (intel_dig_port->port) {
>>   case PORT_A:
>> - encoder->hpd_pin = HPD_PORT_A;
>>   intel_dp->aux_power_domain = POWER_DOMAIN_AUX_A;
>>   break;
>>   case PORT_B:
>> - encoder->hpd_pin = HPD_PORT_B;
>>   intel_dp->aux_power_domain = POWER_DOMAIN_AUX_B;
>>   break;
>>   case PORT_C:
>> - encoder->hpd_pin = HPD_PORT_C;
>>   intel_dp->aux_power_domain = POWER_DOMAIN_AUX_C;
>>   break;
>>   case PORT_D:
>> - encoder->hpd_pin = HPD_PORT_D;
>>   intel_dp->aux_power_domain = POWER_DOMAIN_AUX_D;
>>   break;
>>   case PORT_E:
>> - encoder->hpd_pin = HPD_PORT_E;
>> -
>>   /* FIXME: Check VBT for actual wiring of PORT E */
>>   intel_dp->aux_power_domain = POWER_DOMAIN_AUX_D;
>>   break;
>> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c 
>> b/drivers/gpu/drm/i915/intel_hdmi.c
>> index 5609976539bf..dcd14c71a989 100644
>> --- a/drivers/gpu/drm/i915/intel_hdmi.c
>> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
>> @@ -1921,24 +1921,7 @@ void intel_hdmi_init_connector(struct 
>> intel_digital_port *intel_dig_port,
>>   connector->ycbcr_420_allowed = true;
>>
>>   intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
>> -
>> - switch (port) {
>> - case PORT_B:
>> - intel_encoder->hpd_pin = HPD_PORT_B;
>> - break;
>> - case PORT_C:
>> - intel_encoder->hpd_pin = HPD_PORT_C;
>> - break;
>> - case PORT_D:
>> - intel_encoder->hpd_pin = HPD_PORT_D;
>> - break;
>> - case PORT_E:
>> - intel_encoder->hpd_pin = HPD_PORT_E;
>> - break;
>> - default:
>> - MISSING_CASE(port);
>> - return;
>> - }
>> + intel_encoder->hpd_pin = intel_hpd_pin(port);
>
> Instead of returning early for port A, this will go ahead and attach the
> HDMI encoder to the connector.

hmm! indeed!
this also explains how I end up forgetting the PORT_A on v1...

> However, I don't know likely  we'll have
> a vbt that says port A supports both DP and HDMI but not eDP.

If we have a VBT stating that or it is a current bug we have or if
we have a VBT that lies to that point we have probably bigger issues,
but I understand that so far this option is working stable out there and
we don't want to take the risk, so what about a"

+ if(WARN_ON(port == PORT_A)) return;
+ intel_encoder->hpd_pin = intel_hpd_pin(port);

?
or just change the commit message explaining this case?

>
>>
>>   if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
>>   intel_hdmi->write_infoframe = vlv_write_infoframe;
>> diff --git a/drivers/gpu/drm/i915/intel_hotplug.c 
>> b/drivers/gpu/drm/i915/intel_hotplug.c
>> index 5982c47586e7..7b1cf30a3e9b 100644
>> --- 

Re: [Intel-gfx] [PATCH v3 15/16] drm/i915/guc: Trace messages from CT while in debug

2017-08-10 Thread Daniele Ceraolo Spurio


On 08/08/17 05:30, Michal Wajdeczko wrote:

During debug we may want to investigate all communication
from the Guc. Add proper tracing macros in debug config.

v2: convert remaining DRM_DEBUG into new CT_DEBUG (Michal)
v3: use dedicated Kconfig (Daniele)

Signed-off-by: Michal Wajdeczko 
Cc: Daniele Ceraolo Spurio 
Cc: Chris Wilson 


Acked-by: Daniele Ceraolo Spurio 

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


Re: [Intel-gfx] [PATCH] drm/i915/cnl: Add slice and subslice information to debugfs.

2017-08-10 Thread Rodrigo Vivi
On Thu, Aug 10, 2017 at 4:36 AM, Joonas Lahtinen
 wrote:
> On ke, 2017-08-09 at 13:07 -0700, Rodrigo Vivi wrote:
>> A missing part to EU slice power gating is the
>> debugfs interface. This patch actually should have been
>> squashed to the initial EU slice power gating one.
>>
>> v2: Initial patch was merged without this part.
>>
>> Fixes: c7ae7e9ab207 ("drm/i915/cnl: Configure EU slice power gating.")
>> Cc: Joonas Lahtinen 
>> Signed-off-by: Rodrigo Vivi 
>
> Reviewed-by: Joonas Lahtinen 

thanks
merged to dinq

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



-- 
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: Avoid null dereference if mst_port is unset.

2017-08-10 Thread Rodrigo Vivi
On Thu, Aug 10, 2017 at 9:23 AM, Chris Wilson  wrote:
> Quoting Rodrigo Vivi (2017-08-10 15:50:43)
>> I'm not sure if this is really the case and I don't believe
>> this is the real fix for the bug mentioned here, but since
>> I don't see a reliable path when mst_port is set and when
>> mode_valid is requested I believe it is worth to have this
>> protection here.
>
> The guard looks correct. We defend ourselves against the async
> disconnect elsewhere through the post-detect callbacks, i.e. we cannot
> rely on intel_connector->mst_port remaining valid for a whole detect()
> cycle.
>
> Reviewed-by: Chris Wilson 

thanks, merged to dinq.

the discussion around the actual bug should move back to 102022


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



-- 
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
___
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/perf: Drop redundant check for perf.initialised on reset

2017-08-10 Thread Chris Wilson
Quoting Matthew Auld (2017-08-10 20:02:22)
> On 10 August 2017 at 18:57, Chris Wilson  wrote:
> > As we cannot have an exclusive stream set if the perf has not been
> > initialized, we only need to check for that exclusive stream.
> >
> > Signed-off-by: Chris Wilson 
> > Cc: Lionel Landwerlin 
> > Cc: Matthew Auld 
> Reviewed-by: Matthew Auld 

Hmm, pw why have you foresaken me?  Oh well, trybot was happy
https://patchwork.freedesktop.org/series/28639/

Pushed so that CI is functional again, hopefully that wasn't a mistake.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [maintainer-tools PATCH v2 4/4] doc: build documentation using Sphinx

2017-08-10 Thread Rodrigo Vivi
On Thu, Aug 10, 2017 at 12:39:49PM +0300, Jani Nikula wrote:
> Based on Sphinx-quickstart, with existing and generated Makefiles merged
> together.
> 
> This makes the rst2html and Sphinx builds work side by side. Plain
> 'make' continues to use rst2html, and 'make html' and friends use
> Sphinx. The intention is to keep both for a transition period so that we
> can have documentation autobuilders updated.
> 
> Once we're fully converted to Sphinx, we can share the common parts of
> drm-intel and drm-misc documentation better, and have more coherent
> documentation overall. We can also start looking into using the graphviz
> (Sphinx builtin) and WaveDrom (3rd party) extensions. For now, we use
> the same old clunky methods for including them.
> 
> v2: require Sphinx 1.3, use sphinx_rtd_theme

Thanks! :)

Acked-by: Rodrigo Vivi 

> 
> Signed-off-by: Jani Nikula 
> ---
>  .gitignore |   1 +
>  Makefile   |  61 +++-
>  conf.py| 236 
> +
>  index.rst  |  17 +
>  4 files changed, 313 insertions(+), 2 deletions(-)
>  create mode 100644 conf.py
>  create mode 100644 index.rst
> 
> diff --git a/.gitignore b/.gitignore
> index 35ed071ca482..a176bd76eef5 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,3 +1,4 @@
> +_build
>  drm-intel-flow.svg
>  drm-misc-commit-flow.svg
>  *.html
> diff --git a/Makefile b/Makefile
> index 7059eec42720..40b7ee6e2b32 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -4,6 +4,20 @@
>  # the wavedrom json, copy-pasting to and from 
> http://wavedrom.com/editor.html is
>  # handy as it shows the result live.
>  
> +# You can set these variables from the command line.
> +SPHINXOPTS=
> +SPHINXBUILD   = sphinx-build
> +PAPER =
> +BUILDDIR  = _build
> +
> +# Internal variables.
> +PAPEROPT_a4 = -D latex_paper_size=a4
> +PAPEROPT_letter = -D latex_paper_size=letter
> +ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) 
> .
> +# the i18n builder cannot share the environment and doctrees with the others
> +I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
> +
> +.PHONY: all
>  all: drm-intel.html dim.html drm-misc.html
>  
>  %.svg: %.dot
> @@ -41,7 +55,50 @@ mancheck:
>  
>  check: shellcheck mancheck all
>  
> +.PHONY: clean
>  clean:
> - rm -f drm-intel.html drm-intel-flow.svg drm-misc-commit-flow.svg 
> dim.html drm-misc.html
> + rm -rf drm-intel.html drm-intel-flow.svg drm-misc-commit-flow.svg 
> dim.html drm-misc.html $(BUILDDIR)
> +
> +.PHONY: help
> +help:
> + @echo "Please use \`make ' where  is one of"
> + @echo "  html   to make standalone HTML files"
> + @echo "  dirhtmlto make HTML files named index.html in directories"
> + @echo "  singlehtml to make a single large HTML file"
> + @echo "  linkcheck  to check all external links for integrity"
> + @echo "  doctestto run all doctests embedded in the documentation 
> (if enabled)"
> +
> +# FIXME: This works for the first build, but not for updates. Look into using
> +# Sphinx extensions for both the graphviz and wavedrom parts.
> +html dirhtml singlehtml linkcheck doctest: drm-intel-flow.svg 
> drm-misc-commit-flow.svg
> +
> +.PHONY: html
> +html:
> + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
> + @echo
> + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
> +
> +.PHONY: dirhtml
> +dirhtml:
> + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
> + @echo
> + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
> +
> +.PHONY: singlehtml
> +singlehtml:
> + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
> + @echo
> + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
> +
> +.PHONY: linkcheck
> +linkcheck:
> + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
> + @echo
> + @echo "Link check complete; look for any errors in the above output " \
> +   "or in $(BUILDDIR)/linkcheck/output.txt."
>  
> -.PHONY: all clean
> +.PHONY: doctest
> +doctest:
> + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
> + @echo "Testing of doctests in the sources finished, look at the " \
> +   "results in $(BUILDDIR)/doctest/output.txt."
> diff --git a/conf.py b/conf.py
> new file mode 100644
> index ..385c2aa8ff66
> --- /dev/null
> +++ b/conf.py
> @@ -0,0 +1,236 @@
> +# -*- coding: utf-8 -*-
> +#
> +# DRM Maintainer Tools documentation build configuration file, created by
> +# sphinx-quickstart on Wed Aug  9 17:57:16 2017.
> +#
> +# This file is execfile()d with the current directory set to its
> +# containing dir.
> +#
> +# Note that not all possible configuration values are present in this
> +# autogenerated file.
> +#
> +# All configuration values have a default; values that are commented out
> +# serve to show the default.
> +
> 

Re: [Intel-gfx] [maintainer-tools PATCH v2 1/4] doc: load WaveDrom scripts directly from CDN instead of bundling

2017-08-10 Thread Rodrigo Vivi
On Thu, Aug 10, 2017 at 12:39:46PM +0300, Jani Nikula wrote:
> Way back when the WaveDrom stuff was added, the scripts could only be
> accessed over http. This caused issues with sites served over https and
> modern browsers rightly complaining about mixed content. This was worked
> around by downloading the WaveDrom scripts over http at build time, and
> bundling them inline into the http.
> 
> Now that WaveDrom is available over https, simplify the hackery, and let
> the user's browser load the scripts directly at page load time.
> 
> Signed-off-by: Jani Nikula 
> ---
>  drm-intel-timeline.rst | 20 +++-
>  drm-misc-timeline.rst  | 21 +++--
>  2 files changed, 6 insertions(+), 35 deletions(-)
> 
> diff --git a/drm-intel-timeline.rst b/drm-intel-timeline.rst
> index 3ab39afd5788..fe69fd374cf6 100644
> --- a/drm-intel-timeline.rst
> +++ b/drm-intel-timeline.rst
> @@ -1,22 +1,8 @@
>  .. raw:: html
>  
> - 
> - /* Embedded WaveDrom skin from http://wavedrom.com/skins/default.js */
> -
> -.. raw:: html
> - :url: http://wavedrom.com/skins/default.js
> -
> -.. raw:: html
> -
> - 
> - 
> - /* Embedded WaveDrom engine from http://wavedrom.com/WaveDrom.js */
> -
> -.. raw:: html
> - :url: http://wavedrom.com/WaveDrom.js
> -
> -.. raw:: html
> -
> +