Re: [Intel-gfx] [PATCH 18/37] drm/exynos: Drop drm_vblank_cleanup

2017-05-29 Thread Inki Dae
Hi Daniel,

2017년 05월 24일 23:51에 Daniel Vetter 이(가) 쓴 글:
> Only in the load failure path, where the hardware is quiet anyway.
> 
> Cc: Inki Dae 
> Cc: Joonyoung Shim 
> Cc: Seung-Woo Kim 
> Cc: Kyungmin Park 
> Signed-off-by: Daniel Vetter 
> ---
>  drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
> b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index 50294a7bd29d..1c814b9342af 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -376,7 +376,7 @@ static int exynos_drm_bind(struct device *dev)
>   /* Probe non kms sub drivers and virtual display driver. */
>   ret = exynos_drm_device_subdrv_probe(drm);
>   if (ret)
> - goto err_cleanup_vblank;
> + goto err_unbind_all;

With this change shouldn't you post the patch to remove drm_vblank_init and 
setup vblank stuff in drm_crtc_init together?
I couldn't find the relevant patch on your patch series[1].

As of now, I think resource leak would happen with this patch only.

Thanks,
Inki Dae

[1] http://www.spinics.net/lists/dri-devel/msg142387.html

>  
>   drm_mode_config_reset(drm);
>  
> @@ -407,8 +407,6 @@ static int exynos_drm_bind(struct device *dev)
>   exynos_drm_fbdev_fini(drm);
>   drm_kms_helper_poll_fini(drm);
>   exynos_drm_device_subdrv_remove(drm);
> -err_cleanup_vblank:
> - drm_vblank_cleanup(drm);
>  err_unbind_all:
>   component_unbind_all(drm->dev, drm);
>  err_mode_config_cleanup:
> 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


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

2017-05-29 Thread Daniel Vetter
Hi Dave,

Entire pile of tags since the previous pull got hold up:

drm-intel-next-2017-05-29:
More stuff for 4.13:

- skl+ wm fixes from Mahesh Kumar
- some refactor and tests for i915_sw_fence (Chris)
- tune execlist/scheduler code (Chris)
- g4x,g33 gpu reset improvements (Chris, Mika)
- guc code cleanup (Michal Wajdeczko, Michał Winiarski)
- dp aux backlight improvements (Puthikorn Voravootivat)
- buffer based guc/host communication (Michal Wajdeczko)
drm-intel-next-2017-05-15:
Another pile of stuff for 4.12:

- OA improvements and fixes from Robert Bragg
- fixes for the dp aux backlight driver (Puthikorn Voravootivat)
- no RCU during shrinking (unfortunately), from Joonas
- small atomic leftovers (better unpin, statified hw verifier), from
  Maarten
- g4x wm fixes (Ville)
- piles of cursor fixes/improvements (Ville)
- g4x overlay plane support (Ville)
- prep for new guc logging/notification (Michal Wajdeczko)
- pile of static checker appeasement from Imre
- implement dma_buf->kmap, good for testing (Chris)
- fine-tune ring handling (Chris)
drm-intel-next-2017-05-02:
Somehow not much these 2 weeks ...

- (hopefully) stability fixes for byt/bsw gt wake (Chris)
- tighten up requests (especially restarts) checks and debug tracking
  (Chris)
- unify context handling more for gen5+ (Chris+Joonas)
- oddball bugfixes as usual
drm-intel-next-2017-04-18:
First slice of 4.13 features:

new uabi:
- extend error state dumping to include non-batch buffers requested by
  userspace (Chris), so that mesa gets more useful error state dumps
- reapply the link status patch, for handlig dp link failures
  (Manasi). This needs updated -modesetting to work correctly.
- Add new _WC cache domain, our assumption that wc can be subsumed by
  the existing cache domains didn't pan out (Chris)

feature work:
- first pile of conversion to atomic properties for connectors
  (Maarten)
- refactor dp link rate handling code and related areas (Jani)
- split engine info into class and runtime stuff (Oscar Mateo)
- more robust wait_for_register code (Chris, Michal Wajdeczko)
- fix rcu issues in the shrinker and simplify locking (Joonas)
- guc/huc for glk (Anusha)
- enable atomic modesetting for vlv/chv (Ville), plus final fixes for
  that

Note that this has a nasty-looking conflict with drm-misc, but just take
the code from this pull and s/DRM_ROTATE/DRM_MODE_ROTATE/ to make it
compile and you should be good.

Also, can you pls roll forward to -rc3? We need a pm patch in there for
drm-intel.

Cheers, Daniel


The following changes since commit 8b03d1ed2c43a2ba5ef3381322ee4515b97381bf:

  Merge branch 'linux-4.12' of git://github.com/skeggsb/linux into drm-next 
(2017-05-02 04:46:01 +1000)

are available in the git repository at:

  git://anongit.freedesktop.org/git/drm-intel tags/drm-intel-next-2017-05-29

for you to fetch changes up to cd9f4688a3297c0df0eecc2adaae5812d3e5b997:

  drm/i915: Update DRIVER_DATE to 20170529 (2017-05-29 09:00:58 +0200)


More stuff for 4.13:

- skl+ wm fixes from Mahesh Kumar
- some refactor and tests for i915_sw_fence (Chris)
- tune execlist/scheduler code (Chris)
- g4x,g33 gpu reset improvements (Chris, Mika)
- guc code cleanup (Michal Wajdeczko, Michał Winiarski)
- dp aux backlight improvements (Puthikorn Voravootivat)
- buffer based guc/host communication (Michal Wajdeczko)


Ander Conselvan de Oliveira (2):
  drm/i915/glk: Don't allow 12 bpc when htotal is too big
  drm/i915/glk: Fix DSI "*ERROR* ULPS is still active" messages

Andrea Arcangeli (1):
  i915: initialize the free_list of the fencing atomic_helper

Anusha Srivatsa (3):
  drm/i915/GuC/GLK: Load GuC on GLK
  drm/i915/GLK/HuC: Load HuC on GLK
  drm/i915/huc: Update GLK HuC version

Arkadiusz Hiler (1):
  drm/i915/gen9: Reintroduce WaEnableYV12BugFixInHalfSliceChicken7

Chris Wilson (72):
  drm/i915: intel_ring.engine is unused
  drm/i915: Onion unwind for intel_init_ring_common()
  drm/i915: Park the signaler before sleeping
  drm/i915: Apply a cond_resched() to the saturated signaler
  drm/i915: Use the right mapping_gfp_mask for final shmem allocation
  drm/i915: Assert the engine is idle before overwiting the HWS
  drm/i915: Advance ring->head fully when idle
  drm/i915: The shrinker already acquires struct_mutex, so call it unlocked
  drm/i915: Drain any freed objects prior to hibernation
  drm/i915: Break up long runs of freeing objects
  drm/i915: Insert cond_resched() into i915_gem_free_objects
  drm/i915: Use drm_i915_private directly from debugfs
  drm/i915: Stop second guessing the caller for 
intel_uncore_wait_for_register()
  drm/i915: Stop sleeping from inside gen6_bsd_submit_request()
  drm/i915: Acquire uncore.lock over intel_uncore_wait_for_register()
  drm/i915: Use __intel_uncore_wait

Re: [Intel-gfx] [PATCH] drm/i915/gvt: remove redundant -Wall

2017-05-29 Thread Nick Desaulniers
ping for review
___
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: Fix locking in drm_atomic_helper_resume

2017-05-29 Thread Patchwork
== Series Details ==

Series: drm: Fix locking in drm_atomic_helper_resume
URL   : https://patchwork.freedesktop.org/series/25018/
State : success

== Summary ==

Series 25018v1 drm: Fix locking in drm_atomic_helper_resume
https://patchwork.freedesktop.org/api/1.0/series/25018/revisions/1/mbox/

Test gem_exec_flush:
Subgroup basic-batch-kernel-default-uc:
fail   -> PASS   (fi-snb-2600) fdo#17
Test kms_busy:
Subgroup basic-flip-default-a:
dmesg-warn -> PASS   (fi-skl-6700hq) fdo#101144 +3
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-atomic:
fail   -> PASS   (fi-skl-6700hq) fdo#101154 +7

fdo#17 https://bugs.freedesktop.org/show_bug.cgi?id=17
fdo#101144 https://bugs.freedesktop.org/show_bug.cgi?id=101144
fdo#101154 https://bugs.freedesktop.org/show_bug.cgi?id=101154

fi-bdw-5557u total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  
time:448s
fi-bdw-gvtdvmtotal:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  
time:430s
fi-bsw-n3050 total:278  pass:242  dwarn:0   dfail:0   fail:0   skip:36  
time:566s
fi-bxt-j4205 total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  
time:510s
fi-byt-j1900 total:278  pass:254  dwarn:0   dfail:0   fail:0   skip:24  
time:485s
fi-byt-n2820 total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  
time:483s
fi-hsw-4770  total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  
time:430s
fi-hsw-4770r total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  
time:416s
fi-ilk-650   total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  
time:421s
fi-ivb-3520m total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  
time:486s
fi-ivb-3770  total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  
time:474s
fi-kbl-7500u total:278  pass:255  dwarn:5   dfail:0   fail:0   skip:18  
time:463s
fi-kbl-7560u total:278  pass:263  dwarn:5   dfail:0   fail:0   skip:10  
time:565s
fi-skl-6260u total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  
time:455s
fi-skl-6700hqtotal:278  pass:239  dwarn:0   dfail:1   fail:17  skip:21  
time:430s
fi-skl-6700k total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  
time:469s
fi-skl-6770hqtotal:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  
time:494s
fi-skl-gvtdvmtotal:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  
time:438s
fi-snb-2520m total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  
time:741s
fi-snb-2600  total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:29  
time:402s

afd6d4ac7d9c06649fe00300dd608bccc189ca22 drm-tip: 2017y-05m-29d-19h-12m-29s UTC 
integration manifest
a72293f drm: Fix locking in drm_atomic_helper_resume

== Logs ==

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


Re: [Intel-gfx] [PATCH 07/37] drm: Extract drm_vblank.[hc]

2017-05-29 Thread Stefan Agner
On 2017-05-24 07:51, Daniel Vetter wrote:
> drm_irq.c contains both the irq helper library (optional) and the
> vblank support (optional, but part of the modeset uapi, and doesn't
> require the use of the irq helpers at all.
> 
> Split this up for more clarity of the scope of the individual bits.
> 
> Signed-off-by: Daniel Vetter 
> ---
>  Documentation/gpu/drm-kms.rst |4 +-
>  drivers/gpu/drm/drm_irq.c | 1623 +---
>  drivers/gpu/drm/drm_vblank.c  | 1645 
> +
>  include/drm/drmP.h|5 +-
>  include/drm/drm_file.h|1 +
>  include/drm/drm_irq.h |  158 +---
>  include/drm/drm_prime.h   |2 +
>  include/drm/drm_vblank.h  |  181 +
>  8 files changed, 1857 insertions(+), 1762 deletions(-)
>  create mode 100644 drivers/gpu/drm/drm_vblank.c
>  create mode 100644 include/drm/drm_vblank.h
> 
> diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst
> index bfecd21a8cdf..2d77c9580164 100644
> --- a/Documentation/gpu/drm-kms.rst
> +++ b/Documentation/gpu/drm-kms.rst
> @@ -612,8 +612,8 @@ operation handler.
>  Vertical Blanking and Interrupt Handling Functions Reference
>  
>  
> -.. kernel-doc:: include/drm/drm_irq.h
> +.. kernel-doc:: include/drm/drm_vblank.h
> :internal:
>  
> -.. kernel-doc:: drivers/gpu/drm/drm_irq.c
> +.. kernel-doc:: drivers/gpu/drm/drm_vblank.c

Is that removing drm_irq from kernel-docs? Why? At least the C files
seems to contain valid kernel docs...

> :export:
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index c7debaad67f8..28d736c3fcb4 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c

  

>  /**
>   * drm_irq_install - install IRQ handler
> @@ -571,7 +176,7 @@ int drm_irq_uninstall(struct drm_device *dev)
>  
>   WARN_ON(drm_core_check_feature(dev, DRIVER_MODESET));
>  
> - vblank_disable_and_save(dev, i);
> + drm_vblank_disable_and_save(dev, i);

This leads to:

drivers/gpu/drm/drm_irq.c: In function 'drm_irq_uninstall':   
drivers/gpu/drm/drm_irq.c:179:4: error: implicit declaration of function
'drm_vblank_disable_and_save' [-Werror=implicit-function-declaration]   
 
drm_vblank_disable_and_save(dev, i);  
^

Since you moved the function to drm_vblank.c, I guess you have to add a
deceleration in drm_vblank.h?

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


[Intel-gfx] [PATCH] drm: Fix locking in drm_atomic_helper_resume

2017-05-29 Thread Daniel Vetter
In the conversion to drop drm_modeset_lock_all and the magic implicit
context I failed to realize that _resume starts out with a pile of
state copies, but not with the locks. And hence drm_atomic_commit
won't grab these for us.

Cc: Jyri Sarha 
Fixes: a5b8444e289c ("drm/atomic-helper: remove modeset_lock_all from 
helper_resume")
Cc: Maarten Lankhorst 
Cc: Daniel Vetter 
Cc: Jani Nikula 
Cc: Sean Paul 
Signed-off-by: Daniel Vetter 
---
Needs to be applied to drm-misc-fixes for 4.12.
-Daniel
---
 drivers/gpu/drm/drm_atomic_helper.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
b/drivers/gpu/drm/drm_atomic_helper.c
index af07368846e0..a61291c29567 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2669,7 +2669,12 @@ int drm_atomic_helper_resume(struct drm_device *dev,
 
drm_modeset_acquire_init(, 0);
while (1) {
+   err = drm_modeset_lock_all_ctx(dev, );
+   if (err)
+   goto out;
+
err = drm_atomic_helper_commit_duplicated_state(state, );
+out:
if (err != -EDEADLK)
break;
 
-- 
2.11.0

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


Re: [Intel-gfx] [RFC PATCH 7/7] drm/i915: add DisplayPort CEC-Tunneling-over-AUX support

2017-05-29 Thread Daniel Vetter
On Fri, May 26, 2017 at 12:20:48PM +0200, Hans Verkuil wrote:
> On 05/26/2017 09:15 AM, Daniel Vetter wrote:
> > On Thu, May 25, 2017 at 05:06:26PM +0200, Hans Verkuil wrote:
> >> From: Hans Verkuil 
> >>
> >> Implement support for this DisplayPort feature.
> >>
> >> The cec device is created whenever it detects an adapter that
> >> has this feature. It is only removed when a new adapter is connected
> >> that does not support this. If a new adapter is connected that has
> >> different properties than the previous one, then the old cec device is
> >> unregistered and a new one is registered to replace the old one.
> >>
> >> Signed-off-by: Hans Verkuil 
> > 
> > Some small comments below.
> > 
> >> ---
> >>  drivers/gpu/drm/i915/Kconfig| 11 ++
> >>  drivers/gpu/drm/i915/intel_dp.c | 46 
> >> +
> >>  2 files changed, 53 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> >> index a5cd5dacf055..f317b13a1409 100644
> >> --- a/drivers/gpu/drm/i915/Kconfig
> >> +++ b/drivers/gpu/drm/i915/Kconfig
> >> @@ -124,6 +124,17 @@ config DRM_I915_GVT_KVMGT
> >>  Choose this option if you want to enable KVMGT support for
> >>  Intel GVT-g.
> >>  
> >> +config DRM_I915_DP_CEC
> >> +  tristate "Enable DisplayPort CEC-Tunneling-over-AUX HDMI support"
> >> +  depends on DRM_I915 && CEC_CORE
> >> +  select DRM_DP_CEC
> >> +  help
> >> +Choose this option if you want to enable HDMI CEC support for
> >> +DisplayPort/USB-C to HDMI adapters.
> >> +
> >> +Note: not all adapters support this feature, and even for those
> >> +that do support this often do not hook up the CEC pin.
> > 
> > Why Kconfig? There's not anything else optional in i915.ko (except debug
> > stuff ofc), since generally just not worth the pain. Also doesn't seem to
> > be wired up at all :-)
> 
> It selects DRM_DP_CEC, but you're right, it can be dropped.
> 
> > 
> >> +
> >>  menu "drm/i915 Debugging"
> >>  depends on DRM_I915
> >>  depends on EXPERT
> >> diff --git a/drivers/gpu/drm/i915/intel_dp.c 
> >> b/drivers/gpu/drm/i915/intel_dp.c
> >> index ee77b519835c..38e17ee2548d 100644
> >> --- a/drivers/gpu/drm/i915/intel_dp.c
> >> +++ b/drivers/gpu/drm/i915/intel_dp.c
> >> @@ -32,6 +32,7 @@
> >>  #include 
> >>  #include 
> >>  #include 
> >> +#include 
> >>  #include 
> >>  #include 
> >>  #include 
> >> @@ -1405,6 +1406,7 @@ static void intel_aux_reg_init(struct intel_dp 
> >> *intel_dp)
> >>  static void
> >>  intel_dp_aux_fini(struct intel_dp *intel_dp)
> >>  {
> >> +  cec_unregister_adapter(intel_dp->aux.cec_adap);
> >>kfree(intel_dp->aux.name);
> >>  }
> >>  
> >> @@ -4179,6 +4181,33 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
> >>return -EINVAL;
> >>  }
> >>  
> >> +static bool
> >> +intel_dp_check_cec_status(struct intel_dp *intel_dp)
> >> +{
> >> +  bool handled = false;
> >> +
> >> +  for (;;) {
> >> +  u8 cec_irq;
> >> +  int ret;
> >> +
> >> +  ret = drm_dp_dpcd_readb(_dp->aux,
> >> +  DP_DEVICE_SERVICE_IRQ_VECTOR_ESI1,
> >> +  _irq);
> >> +  if (ret < 0 || !(cec_irq & DP_CEC_IRQ))
> >> +  return handled;
> >> +
> >> +  cec_irq &= ~DP_CEC_IRQ;
> >> +  drm_dp_cec_irq(_dp->aux);
> >> +  handled = true;
> >> +
> >> +  ret = drm_dp_dpcd_writeb(_dp->aux,
> >> +   DP_DEVICE_SERVICE_IRQ_VECTOR_ESI1,
> >> +   cec_irq);
> >> +  if (ret < 0)
> >> +  return handled;
> >> +  }
> >> +}
> > 
> > Shouldn't the above be a helper in the cec library? Doesn't look i915
> > specific to me at least ...
> 
> Good point, this can be moved to drm_dp_cec_irq().
> 
> > 
> >> +
> >>  static void
> >>  intel_dp_retrain_link(struct intel_dp *intel_dp)
> >>  {
> >> @@ -4553,6 +4582,7 @@ intel_dp_set_edid(struct intel_dp *intel_dp)
> >>intel_dp->has_audio = intel_dp->force_audio == HDMI_AUDIO_ON;
> >>else
> >>intel_dp->has_audio = drm_detect_monitor_audio(edid);
> >> +  cec_s_phys_addr_from_edid(intel_dp->aux.cec_adap, edid);
> >>  }
> >>  
> >>  static void
> >> @@ -4562,6 +4592,7 @@ intel_dp_unset_edid(struct intel_dp *intel_dp)
> >>  
> >>kfree(intel_connector->detect_edid);
> >>intel_connector->detect_edid = NULL;
> >> +  cec_phys_addr_invalidate(intel_dp->aux.cec_adap);
> >>  
> >>intel_dp->has_audio = false;
> >>  }
> >> @@ -4582,13 +4613,17 @@ intel_dp_long_pulse(struct intel_connector 
> >> *intel_connector)
> >>intel_display_power_get(to_i915(dev), intel_dp->aux_power_domain);
> >>  
> >>/* Can't disconnect eDP, but you can close the lid... */
> >> -  if (is_edp(intel_dp))
> >> +  if (is_edp(intel_dp)) {
> >>status = edp_detect(intel_dp);
> >> -  else if 

Re: [Intel-gfx] [PATCH 08/37] drm/doc: Polish irq helper documentation

2017-05-29 Thread Daniel Vetter
On Thu, May 25, 2017 at 12:46:29AM -0700, Stefan Agner wrote:
> On 2017-05-24 07:51, Daniel Vetter wrote:
> > Pull a (much shorter) overview into drm_irq.c, and instead put the
> > callback documentation into in-line comments in drm_drv.h.
> 
> Looks good and just found all I needed to know to fix IRQ registration
> in fsl dcu.
> 
> Reviewed-by: Stefan Agner 

Can you pls ack/review the previous patch 7 too? I can't apply this one
here with the other one ...

Thanks, Daniel

> 
> > 
> > Signed-off-by: Daniel Vetter 
> > ---
> >  Documentation/gpu/drm-internals.rst | 62 
> > +
> >  drivers/gpu/drm/drm_irq.c   | 30 +++---
> >  drivers/gpu/drm/drm_vblank.c|  3 ++
> >  include/drm/drmP.h  |  9 --
> >  include/drm/drm_drv.h   | 33 ++--
> >  5 files changed, 74 insertions(+), 63 deletions(-)
> > 
> > diff --git a/Documentation/gpu/drm-internals.rst
> > b/Documentation/gpu/drm-internals.rst
> > index d218dd29221a..82b406d3d377 100644
> > --- a/Documentation/gpu/drm-internals.rst
> > +++ b/Documentation/gpu/drm-internals.rst
> > @@ -149,60 +149,14 @@ Device Instance and Driver Handling
> >  Driver Load
> >  ---
> >  
> > -IRQ Registration
> > -
> > -
> > -The DRM core tries to facilitate IRQ handler registration and
> > -unregistration by providing :c:func:`drm_irq_install()` and
> > -:c:func:`drm_irq_uninstall()` functions. Those functions only
> > -support a single interrupt per device, devices that use more than one
> > -IRQs need to be handled manually.
> > -
> > -Managed IRQ Registration
> > -
> > -
> > -:c:func:`drm_irq_install()` starts by calling the irq_preinstall
> > -driver operation. The operation is optional and must make sure that the
> > -interrupt will not get fired by clearing all pending interrupt flags or
> > -disabling the interrupt.
> > -
> > -The passed-in IRQ will then be requested by a call to
> > -:c:func:`request_irq()`. If the DRIVER_IRQ_SHARED driver feature
> > -flag is set, a shared (IRQF_SHARED) IRQ handler will be requested.
> > -
> > -The IRQ handler function must be provided as the mandatory irq_handler
> > -driver operation. It will get passed directly to
> > -:c:func:`request_irq()` and thus has the same prototype as all IRQ
> > -handlers. It will get called with a pointer to the DRM device as the
> > -second argument.
> > -
> > -Finally the function calls the optional irq_postinstall driver
> > -operation. The operation usually enables interrupts (excluding the
> > -vblank interrupt, which is enabled separately), but drivers may choose
> > -to enable/disable interrupts at a different time.
> > -
> > -:c:func:`drm_irq_uninstall()` is similarly used to uninstall an
> > -IRQ handler. It starts by waking up all processes waiting on a vblank
> > -interrupt to make sure they don't hang, and then calls the optional
> > -irq_uninstall driver operation. The operation must disable all hardware
> > -interrupts. Finally the function frees the IRQ by calling
> > -:c:func:`free_irq()`.
> > -
> > -Manual IRQ Registration
> > -'''
> > -
> > -Drivers that require multiple interrupt handlers can't use the managed
> > -IRQ registration functions. In that case IRQs must be registered and
> > -unregistered manually (usually with the :c:func:`request_irq()` and
> > -:c:func:`free_irq()` functions, or their :c:func:`devm_request_irq()` and
> > -:c:func:`devm_free_irq()` equivalents).
> > -
> > -When manually registering IRQs, drivers must not set the
> > -DRIVER_HAVE_IRQ driver feature flag, and must not provide the
> > -irq_handler driver operation. They must set the :c:type:`struct
> > -drm_device ` irq_enabled field to 1 upon
> > -registration of the IRQs, and clear it to 0 after unregistering the
> > -IRQs.
> > +IRQ Helper Library
> > +~~
> > +
> > +.. kernel-doc:: drivers/gpu/drm/drm_irq.c
> > +   :doc: irq helpers
> > +
> > +.. kernel-doc:: drivers/gpu/drm/drm_irq.c
> > +   :export:
> >  
> >  Memory Manager Initialization
> >  ~
> > diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> > index 28d736c3fcb4..3b04c25100ae 100644
> > --- a/drivers/gpu/drm/drm_irq.c
> > +++ b/drivers/gpu/drm/drm_irq.c
> > @@ -62,19 +62,39 @@
> >  #include "drm_internal.h"
> >  
> >  /**
> > + * DOC: irq helpers
> > + *
> > + * The DRM core provides very simple support helpers to enable IRQ
> > handling on a
> > + * device through the drm_irq_install() and drm_irq_uninstall() functions. 
> > This
> > + * only supports devices with a single interrupt on the main device stored 
> > in
> > + * _device.dev and set as the device paramter in drm_dev_alloc().
> > + *
> > + * These IRQ helpers are strictly optional. Drivers which roll their own 
> > only
> > + * need to set _device.irq_enabled to signal the DRM core that vblank
> > + * interrupts 

Re: [Intel-gfx] [RFC PATCH v3 5/5] ACPI: button: Always notify kernel space using _LID returning value

2017-05-29 Thread Benjamin Tissoires
Hi Lv,

On May 27 2017 or thereabouts, Lv Zheng wrote:
> Both nouveau and i915, the only 2 kernel space lid notification listeners,
> invoke acpi_lid_open() API to obtain _LID returning value instead of using
> the notified value.
> 
> So this patch moves this logic from listeners to lid driver, always notify
> kernel space listeners using _LID returning value.
> 
> This is a no-op cleanup, but facilitates administrators to configure to
> notify kernel drivers with faked lid init states via command line
> "button.lid_notify_init_state=Y".
> 
> Cc: 
> Cc: 
> Cc: Benjamin Tissoires 
> Cc: Peter Hutterer 
> Signed-off-by: Lv Zheng 
> ---
>  drivers/acpi/button.c | 16 ++--
>  drivers/gpu/drm/i915/intel_lvds.c |  2 +-
>  2 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
> index 4abf8ae..e047d34 100644
> --- a/drivers/acpi/button.c
> +++ b/drivers/acpi/button.c
> @@ -119,6 +119,9 @@ static u8 lid_init_state = ACPI_BUTTON_LID_INIT_OPEN;
>  static unsigned long lid_report_interval __read_mostly = 500;
>  module_param(lid_report_interval, ulong, 0644);
>  MODULE_PARM_DESC(lid_report_interval, "Interval (ms) between lid key 
> events");
> +static bool lid_notify_init_state __read_mostly = false;
> +module_param(lid_notify_init_state, bool, 0644);
> +MODULE_PARM_DESC(lid_notify_init_state, "Notify init lid state to kernel 
> drivers after boot/resume");
>  
>  /* --
>FS Interface (/proc)
> @@ -224,6 +227,15 @@ static void acpi_lid_notify_state(struct acpi_device 
> *device,
>   if (state)
>   pm_wakeup_event(>dev, 0);
>  
> + if (!lid_notify_init_state) {
> + /*
> +  * There are cases "state" is not a _LID return value, so
> +  * correct it before notification.
> +  */
> + if (!bios_notify &&
> + lid_init_state != ACPI_BUTTON_LID_INIT_METHOD)
> + state = acpi_lid_evaluate_state(device);
> + }
>   acpi_lid_notifier_call(device, state);
>  }
>  
> @@ -572,10 +584,10 @@ static int param_set_lid_init_state(const char *val, 
> struct kernel_param *kp)
>  
>   if (!strncmp(val, "open", sizeof("open") - 1)) {
>   lid_init_state = ACPI_BUTTON_LID_INIT_OPEN;
> - pr_info("Notify initial lid state as open\n");
> + pr_info("Notify initial lid state to users space as open and 
> kernel drivers with _LID return value\n");
>   } else if (!strncmp(val, "method", sizeof("method") - 1)) {
>   lid_init_state = ACPI_BUTTON_LID_INIT_METHOD;
> - pr_info("Notify initial lid state with _LID return value\n");
> + pr_info("Notify initial lid state to user/kernel space with 
> _LID return value\n");
>   } else if (!strncmp(val, "ignore", sizeof("ignore") - 1)) {
>   lid_init_state = ACPI_BUTTON_LID_INIT_IGNORE;
>   pr_info("Do not notify initial lid state\n");
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c 
> b/drivers/gpu/drm/i915/intel_lvds.c
> index 9ca4dc4..8ca9080 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -548,7 +548,7 @@ static int intel_lid_notify(struct notifier_block *nb, 
> unsigned long val,
>   /* Don't force modeset on machines where it causes a GPU lockup */
>   if (dmi_check_system(intel_no_modeset_on_lid))
>   goto exit;
> - if (!acpi_lid_open()) {
> + if (!val) {
>   /* do modeset on next lid open event */
>   dev_priv->modeset_restore = MODESET_ON_LID_OPEN;
>   goto exit;

This last hunk should really be in its own patch because the intel GPU
folks would need to apply the rest of the series for their CI suite, and
also because there is no reason for this change to be alongside any
other acpi/button.c change.

Cheers,
Benjamin

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


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

2017-05-29 Thread Jani Nikula

Hi Dave, fixes all around, including GVT. I guess Joonas' RCU sync fix
is the most important one.

I've got the DP quirk stuff I asked about sitting on a branch, feeding
to drm-tip too, hoping to get a bit more testing on it. I'll send a
separate pull request for it later this week.

BR,
Jani.


The following changes since commit 2f720aac936dc7a301b757d3b197d86c333d59b8:

  drm/i915: don't do allocate_va_range again on PIN_UPDATE (2017-05-15 14:44:33 
+0300)

are available in the git repository at:

  git://anongit.freedesktop.org/git/drm-intel tags/drm-intel-fixes-2017-05-29

for you to fetch changes up to 9bd9590997b92fbd79fd028f704f6c584b4439d7:

  drm/i915: Stop pretending to mask/unmask LPE audio interrupts (2017-05-26 
11:51:18 +0300)


drm/i915 fixes for v4.12-rc4


Changbin Du (1):
  drm/i915/gvt: clean up unsubmited workloads before destroying kmem cache

Chris Wilson (1):
  drm/i915/selftests: Silence compiler warning in igt_ctx_exec

Chuanxiao Dong (2):
  drm/i915: set initialised only when init_context callback is NULL
  drm/i915/gvt: Disable compression workaround for Gen9

Daniel Vetter (1):
  Revert "drm/i915: Restore lost "Initialized i915" welcome message"

Hans de Goede (1):
  drm/i915: Fix new -Wint-in-bool-context gcc compiler warning

Jani Nikula (1):
  Merge tag 'gvt-fixes-2017-05-25' of https://github.com/01org/gvt-linux 
into drm-intel-fixes

Joonas Lahtinen (1):
  drm/i915: Do not sync RCU during shrinking

Matthew Auld (1):
  drm/i915: use vma->size for appgtt allocate_va_range

Ville Syrjälä (1):
  drm/i915: Stop pretending to mask/unmask LPE audio interrupts

 drivers/gpu/drm/i915/gvt/execlist.c   | 30 ---
 drivers/gpu/drm/i915/gvt/handlers.c   | 30 +--
 drivers/gpu/drm/i915/i915_drv.c   |  4 ---
 drivers/gpu/drm/i915/i915_gem_gtt.c   |  2 +-
 drivers/gpu/drm/i915/i915_gem_shrinker.c  |  5 
 drivers/gpu/drm/i915/i915_irq.c   | 15 --
 drivers/gpu/drm/i915/i915_reg.h   |  2 +-
 drivers/gpu/drm/i915/intel_lpe_audio.c| 36 ---
 drivers/gpu/drm/i915/intel_lrc.c  |  2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_context.c |  8 +++--
 10 files changed, 55 insertions(+), 79 deletions(-)

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


[Intel-gfx] Updated drm-intel-testing

2017-05-29 Thread Daniel Vetter
Hi all,

More stuff for 4.13:

- skl+ wm fixes from Mahesh Kumar
- some refactor and tests for i915_sw_fence (Chris)
- tune execlist/scheduler code (Chris)
- g4x,g33 gpu reset improvements (Chris, Mika)
- guc code cleanup (Michal Wajdeczko, Michał Winiarski)
- dp aux backlight improvements (Puthikorn Voravootivat)
- buffer based guc/host communication (Michal Wajdeczko)

Happy testing!

Cheers, 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] [i-g-t PATCH v2 4/4] Convert ddx_intel_after_fbdev to C.

2017-05-29 Thread Chris Wilson
On Mon, May 29, 2017 at 03:08:10PM +0300, Abdiel Janulgue wrote:
> v2: Use igt_exec_cmd macro.

What benefit does this give us? You are not writing it in C using the
system libraries, you are just badly rewriting the shell script as
snippets pass to shell from C.
-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


Re: [Intel-gfx] [i-g-t PATCH v2 1/4] lib/igt_core: Add igt_exec helpers

2017-05-29 Thread Chris Wilson
On Mon, May 29, 2017 at 03:08:07PM +0300, Abdiel Janulgue wrote:
> Support executing external processes with the goal of capturing its
> standard streams to the igt logging infrastructure in addition to its
> exit status.

This is not an exec wrapper. This is a system() replacement. That it
invokes shell to evaluate the cmd should be front and centre.
-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


Re: [Intel-gfx] [i-g-t PATCH v2 3/4] Convert shell script tests to C version

2017-05-29 Thread Chris Wilson
On Mon, May 29, 2017 at 03:08:09PM +0300, Abdiel Janulgue wrote:
> diff --git a/tests/debugfs.c b/tests/debugfs.c
> new file mode 100644
> index 000..fb33f9f
> --- /dev/null
> +++ b/tests/debugfs.c
> @@ -0,0 +1,97 @@
> +/*
> + * 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.
> + */
> +#ifdef HAVE_CONFIG_H
> +#include "config.h"
> +#endif
> +#include "igt.h"
> +#include "igt_sysfs.h"
> +#include 
> +#include 
> +#include 
> +
> +igt_main
> +{
> + int fd = -1, debugfs;
> + igt_skip_on_simulation();
> +
> + igt_fixture {
> + fd = drm_open_driver_master(DRIVER_INTEL);
> + igt_require_gem(fd);
> + debugfs = igt_debugfs_dir(fd);
> + }
> +
> + igt_subtest_group {

What's the group for? It's very lonely.

> + igt_subtest("emon_crash") {
> + int i;
> + /*
> +  * This check if we can crash the kernel with
> +  * segmentation-fault by reading
> +  * /sys/kernel/debug/dri/0/i915_emon_status too quickly
> +  */
> + for (i = 0; i < 1; i++) {
> + char *buf = igt_sysfs_get(debugfs,
> +   "i915_emon_status");
> + free(buf);
> + }

This is covered by the later test to read it once. And if frequent
rereads is a trigger, apply it to all.

> +
> + /* If we got here, we haven't crashed */
> + igt_success();
> + }
> +
> + igt_subtest("wedged") {
> + char *error;
> + int dev;
> +
> + /* wedge the hw to check the error_state reading */
> + igt_sysfs_write(debugfs, "i915_error_state", "", 1);
> +
> + dev = igt_debugfs_open(fd, "i915_wedged", O_WRONLY);
> + igt_ignore_warn(write(dev, "1\n", 2));
> + close(dev);
> + /*
> +  * Reading i915_error_state file explodes on a
> +  * broken kernel
> +  */
> + error = igt_sysfs_get(debugfs, "i915_error_state");
> + igt_assert(error);
> + free(error);
> + /* If we got here, we haven't crashed */
> + igt_success();

This is drv_hangman/basic.

> + }
> +
> + igt_subtest("drv_reader") {
> + struct dirent *dirent;
> + DIR *dir;
> +
> + igt_assert((dir = fdopendir(debugfs)) != NULL);
> + while ((dirent = readdir(dir))) {
> + char *buf = igt_sysfs_get(debugfs, 
> dirent->d_name);
> + free(buf);
> + }
> + }

Needs to descend through the debugfs directory.
-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] [i-g-t PATCH v2 1/4] lib/igt_core: Add igt_exec helpers

2017-05-29 Thread Abdiel Janulgue
Support executing external processes with the goal of capturing its
standard streams to the igt logging infrastructure in addition to its
exit status.

v2: Fix leaks on fd teardown. Make sure redirected process printout when
> 64kb still works, like full dmesg. (Petri)

Cc: Petri Latvala 
Signed-off-by: Abdiel Janulgue 
---
 lib/igt_core.c | 154 +
 lib/igt_core.h |  10 
 2 files changed, 164 insertions(+)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 9c3b37f..c2c8872 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -2099,3 +2099,157 @@ FILE *__igt_fopen_data(const char* igt_srcdir, const 
char* igt_datadir,
 
return fp;
 }
+
+struct output_pipe {
+   int output_fd;
+   int save_fd;
+   int read_fd;
+   int write_fd;
+   bool redirected;
+   enum igt_log_level log_level;
+};
+
+static bool redirect_output(struct output_pipe *p, int output_fd,
+   enum igt_log_level level)
+{
+   int fds[2];
+
+   if (pipe(fds) == -1)
+   goto err;
+
+   /* save output */
+   if ((p->save_fd = dup(output_fd)) == -1)
+   goto err;
+
+   /* Redirect output to our buffer */
+   if (dup2(fds[1], output_fd) == -1)
+   goto err;
+
+   p->output_fd = output_fd;
+   p->read_fd = fds[0];
+   p->write_fd = fds[1];
+   p->redirected = true;
+   p->log_level = level;
+
+   return true;
+err:
+   close(fds[0]);
+   close(fds[1]);
+   close(p->save_fd);
+
+   return false;
+}
+
+static void unredirect_output(struct output_pipe *p)
+{
+   if (!p->redirected)
+   return;
+
+   /* read_fd is closed separately. We still need to read its
+* buffered contents after un-redirecting the stream.
+*/
+   close(p->write_fd);
+   dup2(p->save_fd, p->output_fd);
+   close(p->save_fd);
+   p->redirected = false;
+}
+
+/**
+ * igt_exec:
+ *
+ * Executes the shell command specified in @command and capture its stdout and
+ * stderr to igt_log or igt_warn respectively.
+ *
+ * Returns: The exit status of the executed process. -1 for failure.
+ */
+int igt_exec(const char *command)
+{
+#define OUT 0
+#define ERR 1
+   struct output_pipe op[2];
+   int i, status;
+   struct igt_helper_process process = {};
+   char buf[PIPE_BUF];
+
+   if (!redirect_output([OUT], STDOUT_FILENO, IGT_LOG_INFO))
+   goto err;
+   if (!redirect_output([ERR], STDERR_FILENO, IGT_LOG_WARN))
+   goto err;
+
+   igt_fork_helper() {
+   igt_assert(execl("/bin/sh", "sh", "-c", command,
+(char *) NULL) != -1);
+   }
+
+   for (i = 0; i < ARRAY_SIZE(op); i++) {
+   struct output_pipe *current = [i];
+
+   /* Unredirect so igt_log() works */
+   unredirect_output(current);
+   memset(buf, 0, sizeof(buf));
+   while (read(current->read_fd, buf, sizeof(buf)) > 0) {
+   igt_log(IGT_LOG_DOMAIN, current->log_level,
+   "[cmd] %s", buf);
+   memset(buf, 0, sizeof(buf));
+   }
+   close(current->read_fd);
+   }
+   status = igt_wait_helper();
+
+   return WEXITSTATUS(status);
+err:
+   /* Failed to redirect one or both streams. Roll back changes. */
+   for (i = 0; i < ARRAY_SIZE(op); i++) {
+   if (!op[i].redirected)
+   continue;
+   close(op[i].read_fd);
+   unredirect_output([i]);
+   }
+
+   return -1;
+}
+
+/**
+ * igt_exec_quiet:
+ * Similar to igt_exec(), except redirect output to /dev/null
+ *
+ * Returns: The exit status of the executed process. -1 for failure.
+ */
+int igt_exec_quiet(const char *command)
+{
+   int stderr_fd_copy, stdout_fd_copy, status, nullfd;
+
+   /* redirect */
+   if ((nullfd = open("/dev/null", O_WRONLY)) == -1)
+   goto err;
+   if ((stdout_fd_copy = dup(STDOUT_FILENO)) == -1)
+   goto err;
+   if ((stderr_fd_copy = dup(STDERR_FILENO)) == -1)
+   goto err;
+
+   if (dup2(nullfd, STDOUT_FILENO) == -1)
+   goto err;
+   if (dup2(nullfd, STDERR_FILENO) == -1)
+   goto err;
+
+   if ((status = system(command)) == -1)
+   goto err;
+
+   /* restore */
+   if (dup2(stdout_fd_copy, STDOUT_FILENO) == -1)
+   goto err;
+   if (dup2(stderr_fd_copy, STDERR_FILENO) == -1)
+   goto err;
+
+   close(stdout_fd_copy);
+   close(stderr_fd_copy);
+   close(nullfd);
+
+   return WEXITSTATUS(status);
+err:
+   close(stderr_fd_copy);
+   close(stdout_fd_copy);
+   close(nullfd);
+
+   return -1;
+}
diff --git a/lib/igt_core.h b/lib/igt_core.h

[Intel-gfx] [i-g-t PATCH v2 4/4] Convert ddx_intel_after_fbdev to C.

2017-05-29 Thread Abdiel Janulgue
v2: Use igt_exec_cmd macro.

Signed-off-by: Abdiel Janulgue 
---
 tests/Makefile.sources|   1 +
 tests/ddx_intel_after_fbdev   |  73 ---
 tests/ddx_intel_after_fbdev.c | 113 ++
 3 files changed, 114 insertions(+), 73 deletions(-)
 delete mode 100755 tests/ddx_intel_after_fbdev
 create mode 100644 tests/ddx_intel_after_fbdev.c

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index c4a78a9..8068257 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -245,6 +245,7 @@ TESTS_progs = \
perf \
debugfs \
tools \
+   ddx_intel_after_fbdev \
$(NULL)
 
 # IMPORTANT: The ZZ_ tests need to be run last!
diff --git a/tests/ddx_intel_after_fbdev b/tests/ddx_intel_after_fbdev
deleted file mode 100755
index f068209..000
--- a/tests/ddx_intel_after_fbdev
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-#
-# Testcase: Load Intel DDX after fbdev was loaded
-#
-
-whoami | grep -q root || {
-   echo "ERROR: not running as root"
-   exit 1
-}
-
-# no other X session should be running
-find /tmp/ -name .X*lock 2>/dev/null | grep -q X && {
-   echo "ERROR: X session already running"
-   exit 1
-}
-
-TMPDIR=$(mktemp -d /tmp/igt.) || {
-   echo "ERROR: Failed to create temp dir"
-   exit 1
-}
-
-cat > $TMPDIR/xorg.conf.fbdev << EOF
-Section "Device"
-   Driver  "fbdev"
-   Identifier  "Device[fbdev]"
-EndSection
-EOF
-
-cat > $TMPDIR/xorg.conf.intel << EOF
-Section "Device"
-   Driver  "intel"
-   Identifier  "Device[intel]"
-EndSection
-EOF
-
-# log before fbdev
-dmesg -c > $TMPDIR/dmesg.1.before.fbdev
-cp /var/log/Xorg.0.log $TMPDIR/Xorg.0.log.1.before.fbdev
-
-# run fbdev
-xinit -- /usr/bin/X -config $TMPDIR/xorg.conf.fbdev & 
-sleep 5
-if [ -f `which intel_reg` ]; then
-`which intel_reg` dump > $TMPDIR/intel_reg_dump.1.fbdev
-fi
-killall X
-
-# log after fbdev & before intel
-dmesg -c > $TMPDIR/dmesg.2.after.fbdev.before.intel
-cp /var/log/Xorg.0.log $TMPDIR/Xorg.0.log.2.after.fbdev.before.intel
-
-sleep 5
-
-# run intel
-xinit -- /usr/bin/X -config $TMPDIR/xorg.conf.intel & 
-sleep 5 
-if [ -f `which intel_reg` ]; then
-`which intel_reg` dump > $TMPDIR/intel_reg_dump.2.intel
-fi
-killall X
-
-# log after intel
-dmesg -c > $TMPDIR/dmesg.3.after.intel
-cp /var/log/Xorg.0.log $TMPDIR/Xorg.0.log.3.after.intel
-
-cp $0 $TMPDIR/
-
-tar czf $TMPDIR.tar.gz $TMPDIR/*
-if [ -f $TMPDIR.tar.gz ]; then
-   echo $TMPDIR.tar.gz contains this script, all configs and logs 
generated on this tests
-fi
-
-exit 0
diff --git a/tests/ddx_intel_after_fbdev.c b/tests/ddx_intel_after_fbdev.c
new file mode 100644
index 000..b22f8d8
--- /dev/null
+++ b/tests/ddx_intel_after_fbdev.c
@@ -0,0 +1,113 @@
+/*
+ * 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.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "igt.h"
+#include 
+#include 
+
+int main(int argc, char **argv)
+{
+   int status;
+   FILE *file;
+   char *path;
+   const char xorg_fbdev[] =
+   "Section  \"Device\"\n"
+   "  Driver\"fbdev\"\n"
+   "  Identifier\"Device[fbdev]\"\n"
+   "EndSection\n";
+   const char xorg_intel[] =
+   "Section   \"Device\"\n"
+   "  Driver\"intel\"\n"
+   "  Identifier\"Device[intel]\"\n"
+   "EndSection\n";
+   char *tmpdir = strdup("/tmp/igt.XX");
+
+   igt_skip_on_simulation();
+
+   igt_assert_f(getuid() == 0, "ERROR: not running as root\n");
+
+   igt_assert_f(igt_exec_quiet("find /tmp/ -name .X*lock | grep -q X")
+!= IGT_EXIT_SUCCESS,
+"ERROR: X session already running\n");
+
+ 

[Intel-gfx] [i-g-t PATCH v2 3/4] Convert shell script tests to C version

2017-05-29 Thread Abdiel Janulgue
v2: Use internal igt_debugfs functions instead of cat and document
debugfs tests.
Convert sysfs_l3_parity properly.
Rename redundant names in tests.

Converted:
 - check_drm_clients (ensures no other clients are running.
   functionality provided by drm_open_driver_master).
 - debugfs_emon_crash
 - debugfs_wedged
 - drv_debugfs_reader
 - sysfs_l3_parity
 - test_rte_check  (same as check_drm_clients)
 - tools_test
 - ZZ_check_dmesg

Cc: Petri Latvala 
Signed-off-by: Abdiel Janulgue 
---
 tests/Makefile.sources   |   9 +---
 tests/ZZ_check_dmesg |  11 -
 tests/check_drm_clients  |   6 ---
 tests/debugfs.c  |  97 
 tests/debugfs_emon_crash |  16 --
 tests/debugfs_wedged |  10 
 tests/drv_debugfs_reader |   9 
 tests/sysfs_l3_parity|  22 -
 tests/test_rte_check |   6 ---
 tests/tools.c| 125 +++
 tests/tools_test |  16 --
 11 files changed, 224 insertions(+), 103 deletions(-)
 delete mode 100755 tests/ZZ_check_dmesg
 delete mode 100755 tests/check_drm_clients
 create mode 100644 tests/debugfs.c
 delete mode 100755 tests/debugfs_emon_crash
 delete mode 100755 tests/debugfs_wedged
 delete mode 100755 tests/drv_debugfs_reader
 delete mode 100755 tests/sysfs_l3_parity
 delete mode 100755 tests/test_rte_check
 create mode 100644 tests/tools.c
 delete mode 100755 tests/tools_test

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 9553e4d..c4a78a9 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -243,6 +243,8 @@ TESTS_progs = \
drv_module_reload \
kms_sysfs_edid_timing \
perf \
+   debugfs \
+   tools \
$(NULL)
 
 # IMPORTANT: The ZZ_ tests need to be run last!
@@ -251,11 +253,6 @@ TESTS_scripts_M = \
$(NULL)
 
 TESTS_scripts = \
-   debugfs_emon_crash \
-   drv_debugfs_reader \
-   sysfs_l3_parity \
-   test_rte_check \
-   tools_test \
$(NULL)
 
 # This target contains testcases which support automagic subtest enumeration
@@ -317,9 +314,7 @@ HANG = \
$(NULL)
 
 scripts = \
-   check_drm_clients \
ddx_intel_after_fbdev \
-   debugfs_wedged \
drm_lib.sh \
drm_getopt.sh \
$(NULL)
diff --git a/tests/ZZ_check_dmesg b/tests/ZZ_check_dmesg
deleted file mode 100755
index e28ba35..000
--- a/tests/ZZ_check_dmesg
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-if dmesg | grep '\*ERROR\*'  > /dev/null ; then
-   echo "DRM_ERROR dirt in dmesg"
-   exit 1
-fi
-
-if dmesg | grep -- '--\[ cut here \]' > /dev/null  ; then
-   echo "found a backtrace in dmesg"
-   exit 1
-fi
diff --git a/tests/check_drm_clients b/tests/check_drm_clients
deleted file mode 100755
index 2a891b8..000
--- a/tests/check_drm_clients
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
-. $SOURCE_DIR/drm_lib.sh
-
-exit $IGT_EXIT_SUCCESS
diff --git a/tests/debugfs.c b/tests/debugfs.c
new file mode 100644
index 000..fb33f9f
--- /dev/null
+++ b/tests/debugfs.c
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "igt.h"
+#include "igt_sysfs.h"
+#include 
+#include 
+#include 
+
+igt_main
+{
+   int fd = -1, debugfs;
+   igt_skip_on_simulation();
+
+   igt_fixture {
+   fd = drm_open_driver_master(DRIVER_INTEL);
+   igt_require_gem(fd);
+   debugfs = igt_debugfs_dir(fd);
+   }
+
+   igt_subtest_group {
+   igt_subtest("emon_crash") {
+   int i;
+   /*
+* This check if we can crash the kernel with
+   

[Intel-gfx] [i-g-t PATCH v2 2/4] igt/igt_core: Provide an option to check for the log buffer contents

2017-05-29 Thread Abdiel Janulgue
Signed-off-by: Abdiel Janulgue 
---
 lib/igt_core.c | 24 
 lib/igt_core.h |  3 +++
 2 files changed, 27 insertions(+)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index c2c8872..81d2039 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -329,6 +329,30 @@ static void _igt_log_buffer_dump(void)
pthread_mutex_unlock(_buffer_mutex);
 }
 
+/**
+ * igt_log_buffer_inspect:
+ *
+ * Provides a way to replay the internal igt log buffer for inspection.
+ * @check: A user-specified handler that gets invoked for each line of
+   the log buffer. The handler should return true to stop
+   inspecting the rest of the buffer.
+ * @data: passed as a user argument to the inspection function.
+ */
+void igt_log_buffer_inspect(igt_buffer_log_handler_t check, void *data)
+{
+   uint8_t i;
+   pthread_mutex_lock(_buffer_mutex);
+
+   i = log_buffer.start;
+   do {
+   if (check(log_buffer.entries[i], data))
+   break;
+   i++;
+   } while (i != log_buffer.start && i != log_buffer.end);
+
+   pthread_mutex_unlock(_buffer_mutex);
+}
+
 __attribute__((format(printf, 1, 2)))
 static void kmsg(const char *format, ...)
 #define KERN_EMER  "<0>"
diff --git a/lib/igt_core.h b/lib/igt_core.h
index c41aa1a..93f61d8 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -818,6 +818,9 @@ void igt_vlog(const char *domain, enum igt_log_level level, 
const char *format,
  */
 #define igt_critical(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_CRITICAL, f)
 
+typedef bool (*igt_buffer_log_handler_t)(const char *line, void *data);
+void igt_log_buffer_inspect(igt_buffer_log_handler_t check, void *data);
+
 extern enum igt_log_level igt_log_level;
 
 /**
-- 
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: Wait for struct_mutex inside shrinker

2017-05-29 Thread Joonas Lahtinen
On ke, 2017-05-24 at 11:11 +0100, Chris Wilson wrote:
> Having resolved whether or not we would deadlock upon a call to
> mutex_lock(>struct_mutex), we can then wait for the contended
> struct_mutex if we are not the owner. This should significantly improve
> the chance of running the shrinker for other processes whilst the GPU is
> busy.
> 
> Signed-off-by: Chris Wilson 
> Cc: Joonas Lahtinen 

Reviewed-by: Joonas Lahtinen 

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


Re: [Intel-gfx] [PATCH 23/37] drm/imx: Drop drm_vblank_cleanup

2017-05-29 Thread Philipp Zabel
Hi Daniel,

On Wed, 2017-05-24 at 16:51 +0200, Daniel Vetter wrote:
> It's only done in the driver load error path, where vblanks don't need
> to be quiescent anyway. And that's all drm_vblank_cleanup does, since
> the core will release the vblank allocations on its own already. So
> drop it.

Thank you for cleaning this up and improving the docs.
From the function name and kerneldoc comment, it was really not clear
that this function is already called in the drm_device release path.

I think the comment is slightly misleading though, as drm_vblank_cleanup
does call kfree(dev->vblank).

> Cc: Philipp Zabel 
> Signed-off-by: Daniel Vetter 
>
> ---
>  drivers/gpu/drm/imx/imx-drm-core.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
> b/drivers/gpu/drm/imx/imx-drm-core.c
> index 50add2f9e250..95e2181963d9 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -278,7 +278,7 @@ static int imx_drm_bind(struct device *dev)
>   /* Now try and bind all our sub-components */
>   ret = component_bind_all(dev, drm);
>   if (ret)
> - goto err_vblank;
> + goto err_kms;
>  
>   drm_mode_config_reset(drm);
>  
> @@ -316,8 +316,6 @@ static int imx_drm_bind(struct device *dev)
>  err_unbind:
>  #endif
>   component_unbind_all(drm->dev, drm);
> -err_vblank:
> - drm_vblank_cleanup(drm);
>  err_kms:
>   drm_mode_config_cleanup(drm);
>  err_unref:

As I understand, the drm_dev_unref(drm) that follows this causes
drm_dev_release -> drm_dev_fini -> drm_vblank_cleanup to be called, so

Acked-by: Philipp Zabel 

regards
Philipp

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


Re: [Intel-gfx] [PATCH 3/4] drm/dp: start a DPCD based DP sink/branch device quirk database

2017-05-29 Thread Jani Nikula
On Thu, 18 May 2017, "Pandiyan, Dhinakaran"  
wrote:
> On Thu, 2017-05-18 at 14:10 +0300, Jani Nikula wrote:
>> Face the fact, there are Display Port sink and branch devices out there
>> in the wild that don't follow the Display Port specifications, or they
>> have bugs, or just otherwise require special treatment. Start a common
>> quirk database the drivers can query based on the DP device
>> identification. At least for now, we leave the workarounds for the
>> drivers to implement as they see fit.
>> 
>> For starters, add a branch device that can't handle full 24-bit main
>> link Mdiv and Ndiv main link attributes properly. Naturally, the
>> workaround of reducing main link attributes for all devices ended up in
>> regressions for other devices. So here we are.
>> 
>> v2: Rebase on DRM DP desc read helpers
>> 
>> v3: Fix the OUI memcmp blunder (Clint)
>> 
>> Cc: Ville Syrjälä 
>> Cc: Dhinakaran Pandiyan 
>> Cc: Clint Taylor 
>> Cc: Adam Jackson 
>> Cc: Harry Wentland 
>> Signed-off-by: Jani Nikula 
>> ---
>>  drivers/gpu/drm/drm_dp_helper.c | 52 
>> +++--
>>  include/drm/drm_dp_helper.h | 32 +
>>  2 files changed, 82 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/drm_dp_helper.c 
>> b/drivers/gpu/drm/drm_dp_helper.c
>> index 52e0ca9a5bb1..213fb837e1c4 100644
>> --- a/drivers/gpu/drm/drm_dp_helper.c
>
> 
>> + * enum drm_dp_quirk - Display Port sink/branch device specific quirks
>> + *
>> + * Display Port sink and branch devices in the wild have a variety of bugs, 
>> try
>> + * to collect them here. The quirks are shared, but it's up to the drivers 
>> to
>> + * implement workarounds for them.
>> + */
>> +enum drm_dp_quirk {
>> +/**
>> + * @DP_DPCD_QUIRK_LIMITED_M_N:
>> + *
>> + * The device requires main link attributes Mdiv and Ndiv to be limited
>
> s/Mdiv/Mvid
> s/Ndiv/Nvid

Thanks, I took the liberty of fixing this while applying.

BR,
Jani.

>
>> + * to 16 bits.
>> + */
>> +DP_DPCD_QUIRK_LIMITED_M_N,
>> +};

-- 
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] [PATCH 3/4] drm/dp: start a DPCD based DP sink/branch device quirk database

2017-05-29 Thread Jani Nikula
On Thu, 18 May 2017, Clint Taylor  wrote:
> On 05/18/2017 04:10 AM, Jani Nikula wrote:
>> Face the fact, there are Display Port sink and branch devices out there
>> in the wild that don't follow the Display Port specifications, or they
>> have bugs, or just otherwise require special treatment. Start a common
>> quirk database the drivers can query based on the DP device
>> identification. At least for now, we leave the workarounds for the
>> drivers to implement as they see fit.
>>
>> For starters, add a branch device that can't handle full 24-bit main
>> link Mdiv and Ndiv main link attributes properly. Naturally, the
>> workaround of reducing main link attributes for all devices ended up in
>> regressions for other devices. So here we are.
>>
>> v2: Rebase on DRM DP desc read helpers
>>
>> v3: Fix the OUI memcmp blunder (Clint)
>
> Tested-by: Clinton Taylor 
> Reviewed-by: Clinton Taylor 

I pushed the series to drm-intel topic/dp-quirks branch based on
v4.12-rc3, with the goal of merging this to v4.12. Thanks for the review
and testing so far; would you mind giving that branch a go too, to
ensure I didn't screw anything up while applying?

BR,
Jani.


>
>>
>> Cc: Ville Syrjälä 
>> Cc: Dhinakaran Pandiyan 
>> Cc: Clint Taylor 
>> Cc: Adam Jackson 
>> Cc: Harry Wentland 
>> Signed-off-by: Jani Nikula 
>> ---
>>   drivers/gpu/drm/drm_dp_helper.c | 52 
>> +++--
>>   include/drm/drm_dp_helper.h | 32 +
>>   2 files changed, 82 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_dp_helper.c 
>> b/drivers/gpu/drm/drm_dp_helper.c
>> index 52e0ca9a5bb1..213fb837e1c4 100644
>> --- a/drivers/gpu/drm/drm_dp_helper.c
>> +++ b/drivers/gpu/drm/drm_dp_helper.c
>> @@ -1209,6 +1209,51 @@ int drm_dp_stop_crc(struct drm_dp_aux *aux)
>>   }
>>   EXPORT_SYMBOL(drm_dp_stop_crc);
>>   
>> +struct dpcd_quirk {
>> +u8 oui[3];
>> +bool is_branch;
>> +u32 quirks;
>> +};
>> +
>> +#define OUI(first, second, third) { (first), (second), (third) }
>> +
>> +static const struct dpcd_quirk dpcd_quirk_list[] = {
>> +/* Analogix 7737 needs reduced M and N at HBR2 link rates */
>> +{ OUI(0x00, 0x22, 0xb9), true, BIT(DP_DPCD_QUIRK_LIMITED_M_N) },
>> +};
>> +
>> +#undef OUI
>> +
>> +/*
>> + * Get a bit mask of DPCD quirks for the sink/branch device identified by
>> + * ident. The quirk data is shared but it's up to the drivers to act on the
>> + * data.
>> + *
>> + * For now, only the OUI (first three bytes) is used, but this may be 
>> extended
>> + * to device identification string and hardware/firmware revisions later.
>> + */
>> +static u32
>> +drm_dp_get_quirks(const struct drm_dp_dpcd_ident *ident, bool is_branch)
>> +{
>> +const struct dpcd_quirk *quirk;
>> +u32 quirks = 0;
>> +int i;
>> +
>> +for (i = 0; i < ARRAY_SIZE(dpcd_quirk_list); i++) {
>> +quirk = _quirk_list[i];
>> +
>> +if (quirk->is_branch != is_branch)
>> +continue;
>> +
>> +if (memcmp(quirk->oui, ident->oui, sizeof(ident->oui)) != 0)
>> +continue;
>> +
>> +quirks |= quirk->quirks;
>> +}
>> +
>> +return quirks;
>> +}
>> +
>>   /**
>>* drm_dp_read_desc - read sink/branch descriptor from DPCD
>>* @aux: DisplayPort AUX channel
>> @@ -1231,14 +1276,17 @@ int drm_dp_read_desc(struct drm_dp_aux *aux, struct 
>> drm_dp_desc *desc,
>>  if (ret < 0)
>>  return ret;
>>   
>> +desc->quirks = drm_dp_get_quirks(ident, is_branch);
>> +
>>  dev_id_len = strnlen(ident->device_id, sizeof(ident->device_id));
>>   
>> -DRM_DEBUG_KMS("DP %s: OUI %*phD dev-ID %*pE HW-rev %d.%d SW-rev 
>> %d.%d\n",
>> +DRM_DEBUG_KMS("DP %s: OUI %*phD dev-ID %*pE HW-rev %d.%d SW-rev %d.%d 
>> quirks 0x%04x\n",
>>is_branch ? "branch" : "sink",
>>(int)sizeof(ident->oui), ident->oui,
>>dev_id_len, ident->device_id,
>>ident->hw_rev >> 4, ident->hw_rev & 0xf,
>> -  ident->sw_major_rev, ident->sw_minor_rev);
>> +  ident->sw_major_rev, ident->sw_minor_rev,
>> +  desc->quirks);
>>   
>>  return 0;
>>   }
>> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
>> index aee5b96b51d7..717cb8496725 100644
>> --- a/include/drm/drm_dp_helper.h
>> +++ b/include/drm/drm_dp_helper.h
>> @@ -1090,12 +1090,44 @@ struct drm_dp_dpcd_ident {
>>   /**
>>* struct drm_dp_desc - DP branch/sink device descriptor
>>* @ident: DP device identification from DPCD 0x400 (sink) or 0x500 
>> (branch).
>> + * @quirks: Quirks; use drm_dp_has_quirk() to query for the quirks.
>>*/
>>   struct drm_dp_desc {
>>

Re: [Intel-gfx] ✗ Fi.CI.BAT: warning for i2c: refactor core and break out blocks

2017-05-29 Thread Jani Nikula
On Sat, 27 May 2017, Wolfram Sang  wrote:
> As far as I can read the above page, all non-green blocks are caused by
> non-I2C issues. So, I'd assume my patch set doesn't break things. Good!

Thanks for submitting the series for testing. This is just a basic test
set, but gives confidence there's nothing terribly wrong here. :)

BR,
Jani.

-- 
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] [PATCH 31/37] drm/stm: Drop drm_vblank_cleanup

2017-05-29 Thread Philippe CORNU


On 05/24/2017 04:52 PM, Daniel Vetter wrote:
> Again seems just cargo-culted.
> 
> Cc: Yannick Fertre 
> Cc: Philippe Cornu 
> Signed-off-by: Daniel Vetter 
> ---
>   drivers/gpu/drm/stm/ltdc.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index 700cc0800e51..1b9483d4f2a4 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -1144,8 +1144,6 @@ void ltdc_unload(struct drm_device *ddev)
>   
>   DRM_DEBUG_DRIVER("\n");
>   
> - drm_vblank_cleanup(ddev);
> -
>   if (ldev->panel)
>   drm_panel_detach(ldev->panel);
>   
> 

Acked-by: Philippe Cornu 

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


Re: [Intel-gfx] [PATCH] Defined NM doesn't work on KBL and uses automatic N/M.

2017-05-29 Thread Jani Nikula

On Fri, 26 May 2017, "Wang, Quanxian"  wrote:
> "The patch is probably fine. But I can't invent an explanation if I
> don't know what the problem is."
>
> @Jani @libin, is it possible for you to help contact Intel graphics
> hardware design engineer to get the reason why M/N doesn't work as you
> implemented in kernel code in Kabylake platform? I don't find good
> reason in bspec. Thanks.

How did you come up with the patch then? What made you try this?

BR,
Jani.


>
> -Original Message-
> From: Jani Nikula [mailto:jani.nik...@linux.intel.com] 
> Sent: Friday, May 26, 2017 7:01 PM
> To: Wang, Quanxian ; intel-gfx@lists.freedesktop.org
> Cc: Yang, Libin 
> Subject: RE: [PATCH] Defined NM doesn't work on KBL and uses automatic N/M.
>
> On Fri, 26 May 2017, "Wang, Quanxian"  wrote:
>> [Wang, Quanxian] in Ubuntu 17.04, we do audio testing on KBL/SKL/APL 
>> and more, the audio doesn't work on KBL specially, and other platform 
>> works fine. Even if with latest upstream kernel, but it works on 4.8 
>> kernel. Therefore It is a regression issue. After investigation, we 
>> found it is caused by commit 
>> "6014ac122ed081feca99217bc57b2e15c7fc1a51] drm/i915/audio: set proper 
>> N/M in modeset". Therefore I provided this patch.
>
> If it's a regression, we need to backport the fix to stable kernels, and the 
> patch needs annotation:
>
> Fixes: 6014ac122ed0 ("drm/i915/audio: set proper N/M in modeset")
> Cc:  # v4.10+
>
>> After getting suggestion from you and Libin, we do more testing on 4K 
>> monitor for audio delay issue. Also talked with Libin why not use 
>> transcoder disable/enable process described in bspec, it will affect 
>> performance.
>>
>> This is the whole story. You can check LCK number 3791 in Intel JIRA 
>> about that.
>
> Actually, I can't. And the commit message needs to have the explanation. I 
> still do not know what the bug is specifically, or why Kabylake, and only 
> Kabylake, needs this.
>
>> [Wang, Quanxian] Basically if upstream could provide a reasonable 
>> patch, it will appreciate since you are expert in this area.
>> Thanks for your understanding.
>
> The patch is probably fine. But I can't invent an explanation if I don't know 
> what the problem is.
>
>
> BR,
> Jani.
>
> --
> Jani Nikula, Intel Open Source Technology Center

-- 
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] [PATCH 2/3] drm/i915/glk: WA#0893: Also apply memory bw wa to Geminilake.

2017-05-29 Thread Ander Conselvan De Oliveira
On Fri, 2017-05-26 at 16:23 -0700, Rodrigo Vivi wrote:
> According to spec this WA is needed for every gen9.

Actually GLK has a gen10 display, so the gen9 workarounds don't apply.

Ander

> 
> Cc:Arthur Runyan 
> Cc: Ander Conselvan de Oliveira 
> Signed-off-by: Rodrigo Vivi 
> ---
>  drivers/gpu/drm/i915/i915_drv.h | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 5abeb3f..7a5f2e4 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2904,9 +2904,8 @@ static inline struct scatterlist *__sg_next(struct 
> scatterlist *sg)
>  #define NEEDS_WaRsDisableCoarsePowerGating(dev_priv) \
>   (IS_SKL_GT3(dev_priv) || IS_SKL_GT4(dev_priv))
>  
> -/* WA#0893 */
> -#define NEEDS_WaIncreaseMemoryBW(dev_priv)   (IS_GEN9_BC(dev_priv) || \
> -  IS_BROXTON(dev_priv))
> +/* WA#0893: GEN9:ALL */
> +#define NEEDS_WaIncreaseMemoryBW(dev_priv)   (IS_GEN9(dev_priv))
>  
>  /*
>   * dp aux and gmbus irq on gen4 seems to be able to generate legacy 
> interrupts
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 55/67] drm/i915/gen10: implement gen 10 watermarks calculations

2017-05-29 Thread Ander Conselvan De Oliveira
On Thu, 2017-04-06 at 12:15 -0700, Rodrigo Vivi wrote:
> From: Paulo Zanoni 
> 
> They're slightly different than the gen 9 calculations.

I missed this at first, but GLK should follow the gen10 watermark programming as
it has a gen10 display.

> 
> TODO: before upstraming this, check if the spec is still the same.
> 
> Signed-off-by: Paulo Zanoni 
> Signed-off-by: Rodrigo Vivi 
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 27 ---
>  1 file changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 0194d55..b07369a 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3692,8 +3692,9 @@ void skl_ddb_get_hw_state(struct drm_i915_private 
> *dev_priv,
>   * should allow pixel_rate up to ~2 GHz which seems sufficient since max
>   * 2xcdclk is 1350 MHz and the pixel rate should never exceed that.
>  */
> -static uint_fixed_16_16_t skl_wm_method1(uint32_t pixel_rate, uint8_t cpp,
> -  uint32_t latency)
> +static uint_fixed_16_16_t
> +skl_wm_method1(const struct drm_i915_private *dev_priv, uint32_t pixel_rate,
> +uint8_t cpp, uint32_t latency)
>  {
>   uint32_t wm_intermediate_val;
>   uint_fixed_16_16_t ret;
> @@ -3703,6 +3704,10 @@ static uint_fixed_16_16_t skl_wm_method1(uint32_t 
> pixel_rate, uint8_t cpp,
>  
>   wm_intermediate_val = latency * pixel_rate * cpp;
>   ret = fixed_16_16_div_round_up_u64(wm_intermediate_val, 1000 * 512);
> +
> + if (INTEL_GEN(dev_priv) >= 10)

|| IS_GLK

> + ret.val += 1 << 16;
> +
>   return ret;
>  }
>  
> @@ -3836,11 +3841,15 @@ static int skl_compute_plane_wm(const struct 
> drm_i915_private *dev_priv,
>  
>   plane_bytes_per_line = width * cpp;
>   if (y_tiled) {
> - interm_pbpl = DIV_ROUND_UP(plane_bytes_per_line *
> -y_min_scanlines, 512);
> + interm_pbpl = plane_bytes_per_line * y_min_scanlines;
> +
> + if (INTEL_GEN(dev_priv) >= 10)
> + interm_pbpl++;
> +
> + interm_pbpl = DIV_ROUND_UP(interm_pbpl, 512);

If I'm reading the spec right, the +1 should be done after the division by 512.

>   plane_blocks_per_line =
> fixed_16_16_div_round_up(interm_pbpl, y_min_scanlines);
> - } else if (x_tiled) {
> + } else if (x_tiled && INTEL_GEN(dev_priv) == 9) {

&& !IS_GLK

>   interm_pbpl = DIV_ROUND_UP(plane_bytes_per_line, 512);
>   plane_blocks_per_line = u32_to_fixed_16_16(interm_pbpl);
>   } else {
> @@ -3848,7 +3857,7 @@ static int skl_compute_plane_wm(const struct 
> drm_i915_private *dev_priv,
>   plane_blocks_per_line = u32_to_fixed_16_16(interm_pbpl);
>   }
>  
> - method1 = skl_wm_method1(plane_pixel_rate, cpp, latency);
> + method1 = skl_wm_method1(dev_priv, plane_pixel_rate, cpp, latency);
>   method2 = skl_wm_method2(plane_pixel_rate,
>cstate->base.adjusted_mode.crtc_htotal,
>latency,
> @@ -3865,7 +3874,11 @@ static int skl_compute_plane_wm(const struct 
> drm_i915_private *dev_priv,
>   selected_result = method2;
>   else if ((ddb_allocation /
>   fixed_16_16_to_u32_round_up(plane_blocks_per_line)) >= 
> 1)
> - selected_result = min_fixed_16_16(method1, method2);
> + if (INTEL_GEN(dev_priv) == 9)

&& !IS_GLK
> + selected_result = min_fixed_16_16(method1,
> +   method2);
> + else
> + selected_result = method2;
>   else
>   selected_result = method1;
>   }
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915/psr: disable psr2 for resolution greater than 32X20

2017-05-29 Thread Jani Nikula
On Fri, 26 May 2017, Rodrigo Vivi  wrote:
> I believe we need to cc:stable on this right?!
>
> Jani, is this ok to go ahead and merge after stable is cc'ed?

Please add this, and it'll all happen automagically.

Fixes: acf45d11050a ("drm/i915/psr: disable psr2 for resolution greater than 
32X20")
Cc: Rodrigo Vivi 
Cc: Jim Bride 
Cc: Vathsala Nagaraju 
Cc: Daniel Vetter 
Cc: Jani Nikula 
Cc: intel-gfx@lists.freedesktop.org
Cc:  # v4.11+

BR,
Jani.


>
> On Thu, May 25, 2017 at 9:43 AM, vathsala nagaraju
>  wrote:
>> psr1 is also disabled for panel resolution  greater than 32X20.
>> Added psr2 check to disable only for psr2 panels having resolution
>> greater than 32X20.
>>
>> issue was introduced by
>> commit-id : "acf45d11050abd751dcec986ab121cb2367dcbba"
>> commit message: "PSR2 is restricted to work with panel resolutions
>> upto 3200x2000, move the check to intel_psr_match_conditions and fully
>> block psr."
>>
>> v2: (Rodrigo)
>>Add previous commit details which introduced the issue
>>
>> Cc: Rodrigo Vivi 
>> Cc: Jim Bride 
>> Cc: Yaroslav Shabalin 
>> Reported-by: Yaroslav Shabalin 
>> Reviewed-by: Rodrigo Vivi 
>> Signed-off-by: vathsala nagaraju 
>> ---
>>  drivers/gpu/drm/i915/intel_psr.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_psr.c 
>> b/drivers/gpu/drm/i915/intel_psr.c
>> index c3780d0..559f1ab 100644
>> --- a/drivers/gpu/drm/i915/intel_psr.c
>> +++ b/drivers/gpu/drm/i915/intel_psr.c
>> @@ -435,8 +435,9 @@ static bool intel_psr_match_conditions(struct intel_dp 
>> *intel_dp)
>> }
>>
>> /* PSR2 is restricted to work with panel resolutions upto 3200x2000 
>> */
>> -   if (intel_crtc->config->pipe_src_w > 3200 ||
>> -   intel_crtc->config->pipe_src_h > 2000) {
>> +   if (dev_priv->psr.psr2_support &&
>> +   (intel_crtc->config->pipe_src_w > 3200 ||
>> +intel_crtc->config->pipe_src_h > 2000)) {
>> dev_priv->psr.psr2_support = false;
>> return false;
>> }
>> --
>> 1.9.1
>>
>> ___
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
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] [PATCH 32/37] drm/sun4i: Drop drm_vblank_cleanup

2017-05-29 Thread Maxime Ripard
On Wed, May 24, 2017 at 04:52:07PM +0200, Daniel Vetter wrote:
> Again seems just cargo-culted ... It's not ordered against any
> irq/vblank/modeset shutdown.
> 
> Cc: Maxime Ripard  
> Signed-off-by: Daniel Vetter 

Acked-by: Maxime Ripard 

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [Intel-gfx] [PATCH v6 4/6] vfio: Define vfio based vgpu's dma-buf operations

2017-05-29 Thread Gerd Hoffmann
> +struct vfio_vgpu_dmabuf_info {
> + __u32 argsz;
> + __u32 flags;
> + struct vfio_vgpu_plane_info plane_info;
> + __s32 fd;
> + __u32 pad;
> +};

Hmm, now you have argsz and flags twice in vfio_vgpu_dmabuf_info ...

I think we should have something like this:

struct vfio_vgpu_plane_info {
    __u64 start;
    __u64 drm_format_mod;
    __u32 drm_format;
    __u32 width;
    __u32 height;
    __u32 stride;
    __u32 size;
    __u32 x_pos;
    __u32 y_pos;
__u32 padding;
};

struct vfio_vgpu_query_plane {
__u32 argsz;
__u32 flags;
struct vfio_vgpu_plane_info plane_info;
__u32 plane_id;
__u32 padding;
};

struct vfio_vgpu_create_dmabuf {
__u32 argsz;
__u32 flags;
struct vfio_vgpu_plane_info plane_info;
__u32 plane_id;
__s32 fd;
};
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


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

2017-05-29 Thread Daniel Vetter
On Fri, May 26, 2017 at 04:58:37PM -0400, Sean Paul wrote:
> Hi Dave,
> Here's another misc-next pull for you. We have some nice improvements in core
> adding mode_valid hooks and de-duping the allocation code. Daniel continues to
> improve documentation (\o/), and a bunch of little stuff was fixed up.

Just a small note: This pull only contains the patch to add the hooks.
Wiring it up and converting drivers is still on the list, but I'll
probably apply it all this week.
-Daniel

> 
> Also noteworthy is that I backmerged -next so Daniel could pick up Michal's
> kvmalloc set.
> 
> 
> drm-misc-next-2017-05-26:
> UAPI Changes:
> - Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ defines to the UAPI (Robert)
> 
> Cross-subsystem Changes:
> - Standardize sync_file.txt documentation format (Mauro)
> 
> Core Changes:
> - Turf drm_[cm]alloc functions for kvmalloc alternatives (Michal)
> - Add optional mode_valid() hook to crtc/encoder/bridge (Jose)
> - Improve documentation around mode validation/alteration (Daniel)
> - Reduce sync_file construction time by deferring name creation (Chris)
> 
> Driver Changes:
> - pl111: Wire up the clock divider and add debugfs (Eric)
> - various: Fix include notation and remove -Iinclude/drm (Masahiro)
> - stm: Add Benjamin Gaignard and Vincent Abriou as STM maintainers (Vincent)
> - various: Miscellaneous trivial fixes to pl111/stm/vgem/vc4
> 
> Cc: Michal Hocko 
> Cc: Eric Anholt 
> Cc: Masahiro Yamada 
> Cc: Robert Foss 
> Cc: Vincent Abriou 
> Cc: Jose Abreu 
> Cc: Daniel Vetter 
> Cc: Chris Wilson 
> Cc: Mauro Carvalho Chehab 
> 
> Happy weekend, Sean
> 
> 
> The following changes since commit e98c58e55f68f8785aebfab1f8c9a03d8de0afe1:
> 
>   Merge tag 'drm-misc-next-2017-05-16' of 
> git://anongit.freedesktop.org/git/drm-misc into drm-next (2017-05-18 12:57:06 
> +1000)
> 
> are available in the git repository at:
> 
>   git://anongit.freedesktop.org/git/drm-misc tags/drm-misc-next-2017-05-26
> 
> for you to fetch changes up to 71ebc9a3795818eab52e81bbcbdfae130ee35d9e:
> 
>   dma-buf/sync-file: Defer creation of sync_file->name (2017-05-24 13:08:29 
> -0300)
> 
> 
> UAPI Changes:
> - Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ defines to the UAPI (Robert)
> 
> Cross-subsystem Changes:
> - Standardize sync_file.txt documentation format (Mauro)
> 
> Core Changes:
> - Turf drm_[cm]alloc functions for kvmalloc alternatives (Michal)
> - Add optional mode_valid() hook to crtc/encoder/bridge (Jose)
> - Improve documentation around mode validation/alteration (Daniel)
> - Reduce sync_file construction time by deferring name creation (Chris)
> 
> Driver Changes:
> - pl111: Wire up the clock divider and add debugfs (Eric)
> - various: Fix include notation and remove -Iinclude/drm (Masahiro)
> - stm: Add Benjamin Gaignard and Vincent Abriou as STM maintainers (Vincent)
> - various: Miscellaneous trivial fixes to pl111/stm/vgem/vc4
> 
> Cc: Michal Hocko 
> Cc: Eric Anholt 
> Cc: Masahiro Yamada 
> Cc: Robert Foss 
> Cc: Vincent Abriou 
> Cc: Jose Abreu 
> Cc: Daniel Vetter 
> Cc: Chris Wilson 
> Cc: Mauro Carvalho Chehab 
> 
> 
> Arnd Bergmann (2):
>   gpu: host1x: select IOMMU_IOVA
>   gpu: drm: gma500: remove two more dead variable
> 
> Chris Wilson (1):
>   dma-buf/sync-file: Defer creation of sync_file->name
> 
> Colin Ian King (4):
>   drm/vc4: fix spelling mistake: "dimesions" -> "dimensions"
>   drm/sti:fix spelling mistake: "compoment" -> "component"
>   drm/pl111: make structure pl111_display_funcs static
>   drm/pl111: make structure mode_config_funcs static
> 
> Daniel Vetter (2):
>   drm/doc: Document adjusted/request modes a bit better
>   drm/doc: Clarify mode_fixup vs. atomic_check a bit more
> 
> Eric Anholt (4):
>   drm/vc4: Enable selection in Kconfig on any 32-bit BCM platform.
>   drm/vc4: Adjust modes in DSI to work around the integer PLL divider.
>   drm/pl111: Register the clock divider and use it.
>   drm/pl111: Add a debugfs node to dump our registers.
> 
> Gabriel Krisman Bertazi (1):
>   drm: trivial documentation fix to drm_for_each_connector_iter
> 
> Jose Abreu (1):
>   drm: Add crtc/encoder/bridge->mode_valid() callbacks
> 
> Masahiro Yamada (31):
>   drm: make drm_panel.h self-contained
>   drm/ttm: fix include notation and remove -Iinclude/drm flag
>   drm/amd: fix include notation and remove -Iinclude/drm flag
>   drm/ast: fix include 

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

2017-05-29 Thread Daniel Vetter
On Sun, May 28, 2017 at 12:08:13PM +0200, Lukas Wunner wrote:
> On Fri, May 26, 2017 at 08:36:45AM +0200, Daniel Vetter wrote:
> > On Thu, May 25, 2017 at 7:44 PM, Sean Paul  wrote:
> > > The pull is noisy because it includes -rc2.
> > 
> > dim has you covered for this, in case you've rolled forward but Dave
> > hasn't yet, you can regenerate against linus upstream branch for a
> > cleaner pull (but still warn Dave ofc):
> > 
> > $ dim pull-request drm-misc-next origin/master
> 
> Is it worth documenting this?  If so, below is a suggestion.
> Feel free to rephrase as you see fit.

Great idea, thanks for the patch. Applied
-Daniel

> 
> Thanks,
> 
> Lukas
> 
> -- >8 --
> Subject: [PATCH] drm-misc: Document recommended base for -fixes pulls
> 
> Summarize the following discussion on dri-devel:
> 
>"dim has you covered for this, in case you've rolled forward but Dave
> hasn't yet, you can regenerate against linus upstream branch for a
> cleaner pull (but still warn Dave ofc):
> $ dim pull-request drm-misc-next origin/master" (Daniel)
> 
>"FWIW this is what I've always done with drm-intel-fixes." (Jani)
> 
>"As long as I'm warned in the pull request I often fast forward to
> the base if my tree is clean, just to avoid the pull request having
> noise in it." (Dave)
> 
> Cc: Daniel Vetter 
> Cc: Jani Nikula 
> Cc: Sean Paul 
> Cc: Dave Airlie 
> Signed-off-by: Lukas Wunner 
> ---
>  drm-misc.rst | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drm-misc.rst b/drm-misc.rst
> index d56c3c7..c66ac67 100644
> --- a/drm-misc.rst
> +++ b/drm-misc.rst
> @@ -178,6 +178,14 @@ Maintainers mostly provide services to keep drm-misc 
> running smoothly:
>keep it current. We try to avoid backmerges for bugfix branches, and 
> rebasing
>isn't an option with multiple committers.
>  
> +* Pull requests become noisy if `-fixes` has been fast-forwarded to Linus'
> +  latest -rc tag but drm-upstream hasn't done the same yet: The shortlog
> +  will contain not just the queued fixes but also anything else that has
> +  landed in Linus' tree in the meantime. The best practice is then to base
> +  the pull request on Linus' master branch (rather than drm-upstream) by
> +  setting the `upstream` argument for ``dim pull-request`` accordingly.
> +  Upstream should be warned that they haven't fast-forwarded yet.
> +
>  * During the merge-windo blackout, i.e. from -rc6 on until the merge window
>closes with the release of -rc1, try to track `drm-next` with the
>`-next-fixes` branch. Do not advance past -rc1, otherwise the automagic in
> -- 
> 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 02/37] drm: Remove drm_device->virtdev

2017-05-29 Thread Gerd Hoffmann
On Wed, 2017-05-24 at 16:51 +0200, Daniel Vetter wrote:
> This is a leftover from the drm_bus days, where we've had a
> bus-specific device type for every bus type in drm_device. Except for
> pci (which we can't remove because dri1 drivers) this is all gone.
> And
> the virt driver also doesn't really need it, dev_to_virtio works
> perfectly fine.

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


Re: [Intel-gfx] [PATCH 1/3] drm/i915: Wa#0893 is defined per platform.

2017-05-29 Thread Mahesh Kumar

Hi,

There are already patches floated to get the total_display_bandwidth 
in-order to implement correct memory bandwidth related WA for GEN9. This 
is the series floated earlier for this:


https://patchwork.freedesktop.org/series/18842/

above series is hitting the performance issue, because we were including 
all CRTC in each flip even if crtc is not part of flip & we don't have 
i915 level global ww_mutex lock.


There was another RFC doc to list down different approaches to implement 
bandwidth related WA, which will be implemented eventually.

http://www.spinics.net/lists/intel-gfx/msg124872.html

unconditional implementation of these WA's restricts us from using more 
planes per CRTC due to limited availability of DDB.


Do we still need this patch? because once above patches comes in, this 
patch will require modification.


-Mahesh


On Saturday 27 May 2017 04:53 AM, Rodrigo Vivi wrote:

No detection will ever be needed. So let's simplify
and clean it up.

Cc: Mahesh Kumar 
Cc: Paulo Zanoni 
Signed-off-by: Rodrigo Vivi 
---
  drivers/gpu/drm/i915/i915_drv.h |  4 
  drivers/gpu/drm/i915/intel_pm.c | 21 ++---
  2 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index d2a5749..5abeb3f 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2904,6 +2904,10 @@ static inline struct scatterlist *__sg_next(struct 
scatterlist *sg)
  #define NEEDS_WaRsDisableCoarsePowerGating(dev_priv) \
(IS_SKL_GT3(dev_priv) || IS_SKL_GT4(dev_priv))
  
+/* WA#0893 */

+#define NEEDS_WaIncreaseMemoryBW(dev_priv) (IS_GEN9_BC(dev_priv) || \
+IS_BROXTON(dev_priv))
+
  /*
   * dp aux and gmbus irq on gen4 seems to be able to generate legacy interrupts
   * even when in MSI mode. This results in spurious interrupt warnings if the
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 32b3b3e..919235c 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3532,21 +3532,6 @@ bool ilk_disable_lp_wm(struct drm_device *dev)
  
  #define SKL_SAGV_BLOCK_TIME	30 /* µs */
  
-/*

- * FIXME: We still don't have the proper code detect if we need to apply the 
WA,
- * so assume we'll always need it in order to avoid underruns.
- */
-static bool skl_needs_memory_bw_wa(struct intel_atomic_state *state)
-{
-   struct drm_i915_private *dev_priv = to_i915(state->base.dev);
-
-   /* WA#0893: GEN9:ALL */
-   if (IS_GEN9(dev_priv))
-   return true;
-
-   return false;
-}
-
  static bool
  intel_has_sagv(struct drm_i915_private *dev_priv)
  {
@@ -3694,7 +3679,7 @@ bool intel_can_enable_sagv(struct drm_atomic_state *state)
  
  		latency = dev_priv->wm.skl_latency[level];
  
-		if (skl_needs_memory_bw_wa(intel_state) &&

+   if (NEEDS_WaIncreaseMemoryBW(dev_priv) &&
plane->base.state->fb->modifier ==
I915_FORMAT_MOD_X_TILED)
latency += 15;
@@ -4265,9 +4250,7 @@ static int skl_compute_plane_wm(const struct 
drm_i915_private *dev_priv,
uint32_t plane_pixel_rate;
uint_fixed_16_16_t y_tile_minimum;
uint32_t y_min_scanlines;
-   struct intel_atomic_state *state =
-   to_intel_atomic_state(cstate->base.state);
-   bool apply_memory_bw_wa = skl_needs_memory_bw_wa(state);
+   bool apply_memory_bw_wa = NEEDS_WaIncreaseMemoryBW(dev_priv);
bool y_tiled, x_tiled;
  
  	if (latency == 0 ||


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