[Nouveau] [Bug 99400] [nouveau] garbled rendering with glamor on G71

2017-02-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99400

--- Comment #22 from Ilia Mirkin  ---
(In reply to Olivier Fourdan from comment #21)
> Same links, updated files:
> 
> https://people.freedesktop.org/~ofourdan/bug99400/Xwayland.log
> https://people.freedesktop.org/~ofourdan/bug99400/Xwayland.trace
> 
> > For example frame 8932 (toward the end) is interesting imho, [...]
> 
> Let's forget about this, now that the new trace can replay on both intel and
> nouveau.
> 
> The problem I see is rather that I see no problem in apitrace, the frames
> look fine, AFAICT.

Hmmm... this is very unfortunate. And furthermore unfortunate is that this
trace makes use of NPOT textures, which my NV34 doesn't support (at least not
without some pretty nasty workarounds).

If replaying the trace yields the desired results, then this is all for naught.
You can try running

  apitrace dump-images --calls='*/draw' Xwayland.trace

and see if any of the screenshots generated show the artifacts. If not, then
this is a much more insidious problem.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [v3 PATCH 3/3] drm/amd/display: Switch to using atomic_helper for flip.

2017-02-01 Thread Andrzej Hajda
Hi Andrey,


On 29.01.2017 03:26, Andrey Grodzovsky wrote:
> Swicth to use atomic helper.
> Start using actual user's given target_vblank value for flip 
> instead of current value.
>
> v3:
> Update for movig pflip flags to crtc_state
>
> Change-Id: I25dae6d8c29de5d022a42aa99a18a32674b56cda
>
Gerrit  relic :)

Regards
Andrzej
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [PATCH v4 1/3] drm/atomic: Save flip flags in drm_crtct_state

2017-02-01 Thread Ville Syrjälä
On Wed, Feb 01, 2017 at 12:03:34PM -0500, Andrey Grodzovsky wrote:
> Allows using atomic flip helpers for drivers
> using ASYNC flip.
> Remove ASYNC_FLIP restriction in helpers and
> caches the page flip flags in drm_crtc_state
> to be used in the low level drivers.
> 
> v2:
> Resending the patch since the original was broken.
> 
> v3:
> Save flag in crtc_state instead of plane_state
> 
> v4:
> Reset the flag before using again.
> 
> Change-Id: I0219c3ec3ecceb82143ee176d30cb50d9aa76bf0
> Signed-off-by: Andrey Grodzovsky 
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 20 ++--
>  include/drm/drm_crtc.h  |  9 -
>  include/drm/drm_plane.h |  1 +
>  3 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
> b/drivers/gpu/drm/drm_atomic_helper.c
> index a4e5477..f84b5aa 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2737,7 +2737,8 @@ static int page_flip_common(
>   struct drm_atomic_state *state,
>   struct drm_crtc *crtc,
>   struct drm_framebuffer *fb,
> - struct drm_pending_vblank_event *event)
> + struct drm_pending_vblank_event *event,
> + uint32_t flags)
>  {
>   struct drm_plane *plane = crtc->primary;
>   struct drm_plane_state *plane_state;
> @@ -2749,12 +2750,12 @@ static int page_flip_common(
>   return PTR_ERR(crtc_state);
>  
>   crtc_state->event = event;
> + crtc_state->pflip_flags = flags;

Still wondering why we can't afford to spell out "page_flip" completely?

>  
>   plane_state = drm_atomic_get_plane_state(state, plane);
>   if (IS_ERR(plane_state))
>   return PTR_ERR(plane_state);
>  
> -
>   ret = drm_atomic_set_crtc_for_plane(plane_state, crtc);
>   if (ret != 0)
>   return ret;

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


[Nouveau] [PATCH v4 1/3] drm/atomic: Save flip flags in drm_crtct_state

2017-02-01 Thread Andrey Grodzovsky
Allows using atomic flip helpers for drivers
using ASYNC flip.
Remove ASYNC_FLIP restriction in helpers and
caches the page flip flags in drm_crtc_state
to be used in the low level drivers.

v2:
Resending the patch since the original was broken.

v3:
Save flag in crtc_state instead of plane_state

v4:
Reset the flag before using again.

Change-Id: I0219c3ec3ecceb82143ee176d30cb50d9aa76bf0
Signed-off-by: Andrey Grodzovsky 
---
 drivers/gpu/drm/drm_atomic_helper.c | 20 ++--
 include/drm/drm_crtc.h  |  9 -
 include/drm/drm_plane.h |  1 +
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
b/drivers/gpu/drm/drm_atomic_helper.c
index a4e5477..f84b5aa 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2737,7 +2737,8 @@ static int page_flip_common(
struct drm_atomic_state *state,
struct drm_crtc *crtc,
struct drm_framebuffer *fb,
-   struct drm_pending_vblank_event *event)
+   struct drm_pending_vblank_event *event,
+   uint32_t flags)
 {
struct drm_plane *plane = crtc->primary;
struct drm_plane_state *plane_state;
@@ -2749,12 +2750,12 @@ static int page_flip_common(
return PTR_ERR(crtc_state);
 
crtc_state->event = event;
+   crtc_state->pflip_flags = flags;
 
plane_state = drm_atomic_get_plane_state(state, plane);
if (IS_ERR(plane_state))
return PTR_ERR(plane_state);
 
-
ret = drm_atomic_set_crtc_for_plane(plane_state, crtc);
if (ret != 0)
return ret;
@@ -2781,10 +2782,6 @@ static int page_flip_common(
  * Provides a default &drm_crtc_funcs.page_flip implementation
  * using the atomic driver interface.
  *
- * Note that for now so called async page flips (i.e. updates which are not
- * synchronized to vblank) are not supported, since the atomic interfaces have
- * no provisions for this yet.
- *
  * Returns:
  * Returns 0 on success, negative errno numbers on failure.
  *
@@ -2800,9 +2797,6 @@ int drm_atomic_helper_page_flip(struct drm_crtc *crtc,
struct drm_atomic_state *state;
int ret = 0;
 
-   if (flags & DRM_MODE_PAGE_FLIP_ASYNC)
-   return -EINVAL;
-
state = drm_atomic_state_alloc(plane->dev);
if (!state)
return -ENOMEM;
@@ -2810,7 +2804,7 @@ int drm_atomic_helper_page_flip(struct drm_crtc *crtc,
state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc);
 
 retry:
-   ret = page_flip_common(state, crtc, fb, event);
+   ret = page_flip_common(state, crtc, fb, event, flags);
if (ret != 0)
goto fail;
 
@@ -2865,9 +2859,6 @@ int drm_atomic_helper_page_flip_target(
struct drm_crtc_state *crtc_state;
int ret = 0;
 
-   if (flags & DRM_MODE_PAGE_FLIP_ASYNC)
-   return -EINVAL;
-
state = drm_atomic_state_alloc(plane->dev);
if (!state)
return -ENOMEM;
@@ -2875,7 +2866,7 @@ int drm_atomic_helper_page_flip_target(
state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc);
 
 retry:
-   ret = page_flip_common(state, crtc, fb, event);
+   ret = page_flip_common(state, crtc, fb, event, flags);
if (ret != 0)
goto fail;
 
@@ -3072,6 +3063,7 @@ void __drm_atomic_helper_crtc_duplicate_state(struct 
drm_crtc *crtc,
state->color_mgmt_changed = false;
state->zpos_changed = false;
state->event = NULL;
+   state->pflip_flags = 0;
 }
 EXPORT_SYMBOL(__drm_atomic_helper_crtc_duplicate_state);
 
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 5c77c3f..b74dbe1 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -162,10 +162,17 @@ struct drm_crtc_state {
 * Target vertical blank period when a page flip
 * should take effect.
 */
-
u32 target_vblank;
 
/**
+* @pflip_flags:
+*
+* DRM_MODE_PAGE_FLIP_* flags, as passed to the page flip ioctl.
+* Zero in any other case.
+*/
+   u32 pflip_flags;
+
+   /**
 * @event:
 *
 * Optional pointer to a DRM event to signal upon completion of the
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
index db3bbde..57414ae 100644
--- a/include/drm/drm_plane.h
+++ b/include/drm/drm_plane.h
@@ -122,6 +122,7 @@ struct drm_plane_state {
 */
bool visible;
 
+
struct drm_atomic_state *state;
 };
 
-- 
1.9.1

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [PATCH v4 2/3] drm/nouveau/kms/nv50: Switch to using atomic helper for flip.

2017-02-01 Thread Andrey Grodzovsky
v2:
Update code after flip_flags moved from plane_state
to crtc_state

Change-Id: I5a3189c03e389af2ff6c13d870a7d28282b7b0ee
Signed-off-by: Andrey Grodzovsky 
---
 drivers/gpu/drm/nouveau/nv50_display.c | 84 --
 1 file changed, 10 insertions(+), 74 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nv50_display.c 
b/drivers/gpu/drm/nouveau/nv50_display.c
index 2c2c645..0d194ae 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -831,7 +831,8 @@ struct nv50_wndw_func {
 static int
 nv50_wndw_atomic_check_acquire(struct nv50_wndw *wndw,
   struct nv50_wndw_atom *asyw,
-  struct nv50_head_atom *asyh)
+  struct nv50_head_atom *asyh,
+  u32 pflip_flags)
 {
struct nouveau_framebuffer *fb = nouveau_framebuffer(asyw->state.fb);
struct nouveau_drm *drm = nouveau_drm(wndw->plane.dev);
@@ -846,6 +847,9 @@ struct nv50_wndw_func {
asyw->image.w = fb->base.width;
asyw->image.h = fb->base.height;
asyw->image.kind = (fb->nvbo->tile_flags & 0xff00) >> 8;
+
+   asyw->interval = pflip_flags & DRM_MODE_PAGE_FLIP_ASYNC ? 0 : 1;
+
if (asyw->image.kind) {
asyw->image.layout = 0;
if (drm->device.info.chipset >= 0xc0)
@@ -883,6 +887,7 @@ struct nv50_wndw_func {
struct nv50_head_atom *harm = NULL, *asyh = NULL;
bool varm = false, asyv = false, asym = false;
int ret;
+   u32 pflip_flags = 0;
 
NV_ATOMIC(drm, "%s atomic_check\n", plane->name);
if (asyw->state.crtc) {
@@ -891,6 +896,7 @@ struct nv50_wndw_func {
return PTR_ERR(asyh);
asym = drm_atomic_crtc_needs_modeset(&asyh->state);
asyv = asyh->state.active;
+   pflip_flags = asyh->state.pflip_flags;
}
 
if (armw->state.crtc) {
@@ -907,7 +913,8 @@ struct nv50_wndw_func {
asyw->set.point = true;
 
if (!varm || asym || armw->state.fb != asyw->state.fb) {
-   ret = nv50_wndw_atomic_check_acquire(wndw, asyw, asyh);
+   ret = nv50_wndw_atomic_check_acquire(
+   wndw, asyw, asyh, pflip_flags);
if (ret)
return ret;
}
@@ -2221,77 +2228,6 @@ struct nv50_base {
.atomic_check = nv50_head_atomic_check,
 };
 
-/* This is identical to the version in the atomic helpers, except that
- * it supports non-vblanked ("async") page flips.
- */
-static int
-nv50_head_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
-   struct drm_pending_vblank_event *event, u32 flags)
-{
-   struct drm_plane *plane = crtc->primary;
-   struct drm_atomic_state *state;
-   struct drm_plane_state *plane_state;
-   struct drm_crtc_state *crtc_state;
-   int ret = 0;
-
-   state = drm_atomic_state_alloc(plane->dev);
-   if (!state)
-   return -ENOMEM;
-
-   state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc);
-retry:
-   crtc_state = drm_atomic_get_crtc_state(state, crtc);
-   if (IS_ERR(crtc_state)) {
-   ret = PTR_ERR(crtc_state);
-   goto fail;
-   }
-   crtc_state->event = event;
-
-   plane_state = drm_atomic_get_plane_state(state, plane);
-   if (IS_ERR(plane_state)) {
-   ret = PTR_ERR(plane_state);
-   goto fail;
-   }
-
-   ret = drm_atomic_set_crtc_for_plane(plane_state, crtc);
-   if (ret != 0)
-   goto fail;
-   drm_atomic_set_fb_for_plane(plane_state, fb);
-
-   /* Make sure we don't accidentally do a full modeset. */
-   state->allow_modeset = false;
-   if (!crtc_state->active) {
-   DRM_DEBUG_ATOMIC("[CRTC:%d] disabled, rejecting legacy flip\n",
-crtc->base.id);
-   ret = -EINVAL;
-   goto fail;
-   }
-
-   if (flags & DRM_MODE_PAGE_FLIP_ASYNC)
-   nv50_wndw_atom(plane_state)->interval = 0;
-
-   ret = drm_atomic_nonblocking_commit(state);
-fail:
-   if (ret == -EDEADLK)
-   goto backoff;
-
-   drm_atomic_state_put(state);
-   return ret;
-
-backoff:
-   drm_atomic_state_clear(state);
-   drm_atomic_legacy_backoff(state);
-
-   /*
-* Someone might have exchanged the framebuffer while we dropped locks
-* in the backoff code. We need to fix up the fb refcount tracking the
-* core does for us.
-*/
-   plane->old_fb = plane->fb;
-
-   goto retry;
-}
-
 static int
 nv50_head_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
uint32_t size)
@@ -2386,7 +2322,7 @@ struct nv50_base {
.gamma_set = nv50_head_gamma_set,
.destroy = nv50_he

[Nouveau] [PATCH v4 3/3] drm/amd/display: Switch to using atomic_helper for flip.

2017-02-01 Thread Andrey Grodzovsky
v2:
Modify for movig pflip flags to crtc_state

v4:
Fix identation.

Change-Id: I25dae6d8c29de5d022a42aa99a18a32674b56cda
Signed-off-by: Andrey Grodzovsky 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h   |   1 -
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c| 113 +
 2 files changed, 24 insertions(+), 90 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
index 4c0a86e..3ff3c14 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
@@ -443,7 +443,6 @@ struct amdgpu_crtc {
enum amdgpu_interrupt_state vsync_timer_enabled;
 
int otg_inst;
-   uint32_t flip_flags;
/* After Set Mode target will be non-NULL */
struct dc_target *target;
 };
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
index a443b70..78f65ba 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
@@ -1060,83 +1060,6 @@ static int dm_crtc_funcs_atomic_set_property(
return 0;
 }
 
-
-static int amdgpu_atomic_helper_page_flip(struct drm_crtc *crtc,
-   struct drm_framebuffer *fb,
-   struct drm_pending_vblank_event *event,
-   uint32_t flags)
-{
-   struct drm_plane *plane = crtc->primary;
-   struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
-   struct drm_atomic_state *state;
-   struct drm_plane_state *plane_state;
-   struct drm_crtc_state *crtc_state;
-   int ret = 0;
-
-   state = drm_atomic_state_alloc(plane->dev);
-   if (!state)
-   return -ENOMEM;
-
-   ret = drm_crtc_vblank_get(crtc);
-   if (ret)
-   return ret;
-
-   state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc);
-retry:
-   crtc_state = drm_atomic_get_crtc_state(state, crtc);
-   if (IS_ERR(crtc_state)) {
-   ret = PTR_ERR(crtc_state);
-   goto fail;
-   }
-   crtc_state->event = event;
-
-   plane_state = drm_atomic_get_plane_state(state, plane);
-   if (IS_ERR(plane_state)) {
-   ret = PTR_ERR(plane_state);
-   goto fail;
-   }
-
-   ret = drm_atomic_set_crtc_for_plane(plane_state, crtc);
-   if (ret != 0)
-   goto fail;
-   drm_atomic_set_fb_for_plane(plane_state, fb);
-
-   /* Make sure we don't accidentally do a full modeset. */
-   state->allow_modeset = false;
-   if (!crtc_state->active) {
-   DRM_DEBUG_ATOMIC("[CRTC:%d] disabled, rejecting legacy flip\n",
-crtc->base.id);
-   ret = -EINVAL;
-   goto fail;
-   }
-   acrtc->flip_flags = flags;
-
-   ret = drm_atomic_nonblocking_commit(state);
-
-fail:
-   if (ret == -EDEADLK)
-   goto backoff;
-
-   if (ret)
-   drm_crtc_vblank_put(crtc);
-
-   drm_atomic_state_put(state);
-
-   return ret;
-backoff:
-   drm_atomic_state_clear(state);
-   drm_atomic_legacy_backoff(state);
-
-   /*
-* Someone might have exchanged the framebuffer while we dropped locks
-* in the backoff code. We need to fix up the fb refcount tracking the
-* core does for us.
-*/
-   plane->old_fb = plane->fb;
-
-   goto retry;
-}
-
 /* Implemented only the options currently availible for the driver */
 static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = {
.reset = drm_atomic_helper_crtc_reset,
@@ -1145,7 +1068,7 @@ static int amdgpu_atomic_helper_page_flip(struct drm_crtc 
*crtc,
.destroy = amdgpu_dm_crtc_destroy,
.gamma_set = amdgpu_dm_atomic_crtc_gamma_set,
.set_config = drm_atomic_helper_set_config,
-   .page_flip = amdgpu_atomic_helper_page_flip,
+   .page_flip_target = drm_atomic_helper_page_flip_target,
.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
.atomic_set_property = dm_crtc_funcs_atomic_set_property
@@ -1626,7 +1549,8 @@ static void clear_unrelated_fields(struct drm_plane_state 
*state)
 static bool page_flip_needed(
const struct drm_plane_state *new_state,
const struct drm_plane_state *old_state,
-   bool commit_surface_required)
+   bool commit_surface_required,
+   uint32_t pflip_flags)
 {
struct drm_plane_state old_state_tmp;
struct drm_plane_state new_state_tmp;
@@ -1679,7 +1603,7 @@ static bool page_flip_needed(
sizeof(old_state_tmp)) == 0 ? true:false;
if (new_state->crtc && page_flip_required == false) {
acrtc_new = to_amdgpu_crtc(new_state->crtc);
-   if (acrtc_new->flip_flags & DRM_MODE_PAGE_FLIP_ASYNC)
+  

[Nouveau] [PATCH v4 0/3] Allow ASYNC flip with atomic helpers.

2017-02-01 Thread Andrey Grodzovsky
This series is a folow-up on
https://patchwork.kernel.org/patch/9501787/

The first patch makes changes to atomic helpers to allow for drives with ASYNC 
flip support to use them.
Patch 2 is to use this in AMDGPU/DC.
Patch 3 is possible cleanup in nouveau/kms who seems to have to duplicate the 
helper as we did to support ASYNC flips. 

v2: 
Resend drm/atomic: Save flip flags in drm_plane_state since the original patch 
was incomplete.
Squash 2 AMD changes into one to not break compilation.

v3:
Following Daniel's comments, save flip flags in crtc_state instead of 
plane_state.

v4:
Lauren's comment, reset flp flags before using again.
Harry's comment, fix identation in amd/display.

Andrey Grodzovsky (3):
  drm/atomic: Save flip flags in drm_crtct_state
  drm/nouveau/kms/nv50: Switch to using atomic helper for flip.
  drm/amd/display: Switch to using atomic_helper for flip.

 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h   |   1 -
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c| 113 +
 drivers/gpu/drm/drm_atomic_helper.c|  20 ++--
 drivers/gpu/drm/nouveau/nv50_display.c |  84 ++-
 include/drm/drm_crtc.h |   9 +-
 include/drm/drm_plane.h|   1 +
 6 files changed, 49 insertions(+), 179 deletions(-)

-- 
1.9.1

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] HP Zbook17 Dock and UEFI conflict with GK107GLM aka Quadro K1100M

2017-02-01 Thread Phil Turmel
Hi All,

I've been running Gentoo on a ZBook with great success for a couple years,
but I've been stymied in my attempts to implement SecureBoot by an
apparent problem with efifb to nouveaufb handoff, but only when external
monitors are attached.  The handoff works without issue when the BIOS is
in Mixed EFI mode, with and without external monitors, and
works in Native EFI mode without external monitors.

Diffing dmesg from working (mixed) to nonworking (native), I find
numerous lines like the following immediately after handoff:

+nouveau :01:00.0: disp: Base 2:
+nouveau :01:00.0: disp: ^I0080:   
+nouveau :01:00.0: disp: ^I0084:  -> 0010
+nouveau :01:00.0: disp: ^I0088:  -> 0200
+nouveau :01:00.0: disp: ^I008c:   
+nouveau :01:00.0: disp: ^I0090:  -> 0001
+nouveau :01:00.0: disp: ^I0094:  -> f000
+nouveau :01:00.0: disp: ^I00a0:   

None of these show up in any of the working configurations. In non-working
mode, all three displays (laptop + 2 external) are black and I've found no
intervention that will revive them.

One other notable difference that shows up is the BIOS initial video mode
is different in native EFI mode:

@@ -374,11 +379,11 @@
 pciehp: PCI Express Hot Plug Controller Driver version: 0.4
 nvidiafb: Device ID: 10de0ff6 
 efifb: probing for efifb
-efifb: framebuffer at 0x8100, using 3072k, total 3072k
-efifb: mode is 1024x768x32, linelength=4096, pages=1
+efifb: framebuffer at 0x7000, using 8100k, total 8100k
+efifb: mode is 1920x1080x32, linelength=7680, pages=1
 efifb: scrolling: redraw
 efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
-Console: switching to colour frame buffer device 128x48
+Console: switching to colour frame buffer device 240x67
 fb0: EFI VGA frame buffer device
 ACPI: AC Adapter [AC] (on-line)
 input: Sleep Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input0

No functional difference was observed after upgrading the BIOS to v1.36,
which was released in November 2016.

One more data point:  There's no problem if the monitors are unplugged from
the dock and the laptop rebooted.  The monitors may be added any time after
boot without any problem.  There is also no problem if the laptop is
put to sleep with no external monitors and then resumed in the dock with
them.

Boot messages for the different cases were collected and the following script
used to prune them for nice diffs:

#! /bin/bash
for x in *.log; do
 egrep -v '((usb|hub) 
[0-9]+-[0-9]+|raid[0-9]+|Thermal|Battery|Bluetooth|ata[0-9]+|scsi 
[0-9]+|dracut:|udevd|snd_hda|br[0-9]+|random|sd [0-9]+:)' $x \
 |cut -c16- > ${x%%.log}.boot
done

diff -U3 bios34-uefi-mixed-20170131-1038.boot 
uefi-mixed-docked-20170131-1211.boot >bios34-36-mixed.diff
diff -U3 bios34-uefi-native-20170131-1034.boot 
uefi-native-docked-20170131-1209.boot >bios34-36-native.diff
diff -U3 bios34-uefi-mixed-20170131-1038.boot 
bios34-uefi-native-20170131-1034.boot >bios34-mixed-native.diff
diff -U3 uefi-mixed-undocked-20170131-1226.boot 
uefi-mixed-docked-20170131-1211.boot >bios36-mixed-undocked-docked.diff
diff -U3 uefi-native-undocked-20170131-1223.boot 
uefi-native-docked-20170131-1209.boot >bios36-native-undocked-docked.diff 
diff -U3 uefi-mixed-undocked-20170131-1226.boot 
uefi-native-undocked-20170131-1223.boot >bios36-undocked-mixed-native.diff
diff -U3 uefi-mixed-docked-20170131-1211.boot 
uefi-native-docked-20170131-1209.boot >bios36-docked-mixed-native.diff 
#

This script, the raw and filtered logs, the diffs, and kernel config and
machine data have all been posted on my personal server:

http://www.turmel.org/lists/nouveau/

The docked diff from mixed to native that shows the problem is attached.

The kernel is self-compiled and assembled with its initramfs into
a direct-bootable EFI file, following the general instructions on
Greg Kroah-Hartman's blog:

http://kroah.com/log/blog/2013/09/02/booting-a-self-signed-linux-kernel/

My intent is to complete those instructions with my own signed kernel after
I can reliably use SecureBoot in my office.

I will also be attempting newer kernels, but I haven't noticed anything recent
that would impact this.  Of course, if I knew how the driver worked, I wouldn't
be asking for help. (-:

Any suggestions for config or debugging options that might help here?  Or
debugging information you might like that would help?

Phil Turmel
--- uefi-mixed-docked-20170131-1211.boot	2017-01-31 13:36:40.260102387 -0500
+++ uefi-native-docked-20170131-1209.boot	2017-01-31 13:36:40.290102387 -0500
@@ -9,8 +9,8 @@
 e820: BIOS-provided physical RAM map:
 BIOS-e820: [mem 0x-0x00057fff] usable
 BIOS-e820: [mem 0x00058000-0x00058fff] reserved
-BIOS-e820: [mem 0x00059000-0x00097fff] usable
-BIOS-e820: [mem 0x00098000-0x0009] reserved
+BIOS-e820: [mem 0x00059000-0x0009cfff]

Re: [Nouveau] [v3 PATCH 3/3] drm/amd/display: Switch to using atomic_helper for flip.

2017-02-01 Thread Laurent Pinchart
Hi Harry,

On Monday 30 Jan 2017 10:38:47 Harry Wentland wrote:
> On 2017-01-28 09:26 PM, Andrey Grodzovsky wrote:
> > Swicth to use atomic helper.
> > Start using actual user's given target_vblank value for flip
> > instead of current value.
> > 
> > v3:
> > Update for movig pflip flags to crtc_state
> > 
> > Change-Id: I25dae6d8c29de5d022a42aa99a18a32674b56cda
> > Signed-off-by: Andrey Grodzovsky 
> > ---
> > 
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h   |   1 -
> >  .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c| 109  +++
> >  2 files changed, 19 insertions(+), 91 deletions(-)

[snip]
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
> > b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c index
> > a443b70..148780d 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c

[snip]

> > @@ -2696,7 +2620,9 @@ int amdgpu_dm_atomic_commit(
> > 
> >  * 1. This commit is not a page flip.
> >  * 2. This commit is a page flip, and targets are created.
> >  */
> > 
> > -   if (!page_flip_needed(plane_state, old_plane_state, true) ||
> > +   if (!page_flip_needed(
> > +   plane_state, old_plane_state, true, crtc-
>state->pflip_flags)
> > +   ||
> > 
> > action == DM_COMMIT_ACTION_DPMS_ON ||
> > action == DM_COMMIT_ACTION_SET) {
> 
> Might be good to clean up indentation to conform a bit more to kernel
> style. Something like the following, I think (I hope Thunderbird doesn't
> mangle it):
> 
>   if (!page_flip_needed(plane_state,
> old_plane_state,
> true,
> crtc->state->pflip_flags) ||
>   action == DM_COMMIT_ACTION_DPMS_ON ||
>   action == DM_COMMIT_ACTION_SET) {

In which case you should go for (tabs replaced by spaces to avoid e-mail 
mangling)

if (!page_flip_needed(plane_state, old_plane_state, true,
  crtc->state->pflip_flags) ||
action == DM_COMMIT_ACTION_DPMS_ON || 
action == DM_COMMIT_ACTION_SET) {

[snip]

-- 
Regards,

Laurent Pinchart

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [v3 PATCH 1/3] drm/atomic: Save flip flags in drm_crtct_state

2017-02-01 Thread Laurent Pinchart
Hi Andrey,

(by the way there's a typo in the subject)

On Monday 30 Jan 2017 19:42:23 Grodzovsky, Andrey wrote:
> On Monday, January 30, 2017 6:05 AM Laurent Pinchart wrote:
> > On Saturday 28 Jan 2017 21:26:49 Andrey Grodzovsky wrote:
> >> Allows using atomic flip helpers for drivers using ASYNC flip.
> >> Remove ASYNC_FLIP restriction in helpers and caches the page flip
> >> flags in drm_crtc_state to be used in the low level drivers.
> >> 
> >> v2:
> >> Resending the patch since the original was broken.
> >> 
> >> v3:
> >> Save flag in crtc_state instead of plane_state
> >> 
> >> Signed-off-by: Andrey Grodzovsky 
> >> ---
> >> 
> >>  drivers/gpu/drm/drm_atomic_helper.c | 19 +--
> >>  include/drm/drm_crtc.h  |  8 +++-
> >>  include/drm/drm_plane.h |  1 +
> >>  3 files changed, 13 insertions(+), 15 deletions(-)
> >> 
> >> diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> >> b/drivers/gpu/drm/drm_atomic_helper.c index a4e5477..28065ee 100644
> >> --- a/drivers/gpu/drm/drm_atomic_helper.c
> >> +++ b/drivers/gpu/drm/drm_atomic_helper.c

[snip]

> >> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index
> >> 5c77c3f..76457a4 100644
> >> --- a/include/drm/drm_crtc.h
> >> +++ b/include/drm/drm_crtc.h
> >> @@ -162,10 +162,16 @@ struct drm_crtc_state {
> >> * Target vertical blank period when a page flip
> >> * should take effect.
> >> */
> >>u32 target_vblank;
> >>
> >>/**
> >> +   * @pflip_flags:
> >> +   *
> >> +   * Flip related config options
> > 
> > This isn't detailed enough. I propose something along the lines of
> > 
> > "DRM_MODE_PAGE_FLIP_* page flip flags, as passed to the page flip ioctl.
> > Always zero for atomic commits that don't originate from a page flip
> > ioctl."
> > 
> > You will then also need to reset the field to 0 at an appropriate point,
> > as it's more an atomic commit transaction information than a state. Apart
> > from that this patch looks good to me.
> 
> Thanks for your comments, i am not sure I understand why the reset is
> needed, for any future commit on same crtc the new state will have the
> field empty

It won't, __drm_atomic_helper_crtc_duplicate_state() memcpy's the state, so 
the page flip flags will be copied to the new state until another legacy page 
flip overwrites them.

> and if it's a flip IOCTL the field will be filled as needed in
> page_flip_common, otherwise it will stay empty. If the last commit on that
> crtc was a flip then why not keep this field with the bits that the user
> mode set ?

The page flip flags are not state information. They describe an operation, not 
a state. They're needed when performing the operation, but if we don't reset 
them when it completes (at the latest when duplicating the state for the next 
atomic commit, but possibly earlier) there's a risk that a driver will 
mistakenly perform an async page flip during a later operation.

> >> +   */
> >> +  u32 pflip_flags;

[snip]

-- 
Regards,

Laurent Pinchart

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau