New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 673026 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Dec 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Laptop screen is dark after going back to extended mode

Project Member Reported by gurcheta...@chromium.org, Dec 9 2016

Issue description

Reproduced this on ChromeOS-test-R57-9059.0.0-cyan:

(1) Boot up system
(2) Attach evdi device with external screen to the host; make sure external display is working
(3)Change layout from Extended -> Dock mode by closing the lid
(4)Change layout from Dock -> Extended by opening the ld
(5) Observe that the host screen is all black 

These errors show in /var/log/ui/ui.LATEST:

[1406:1705:1209/143850.969328:ERROR:cast_crl.cc(354)] No supported version of revocation data.
[1406:1705:1209/143851.079910:ERROR:cast_crl.cc(354)] No supported version of revocation data.
[1715:1752:1209/143924.235612:ERROR:hardware_display_plane_manager_legacy.cc(67)] Cannot page flip: crtc=27 framebuffer=55: Invalid argument
[1715:1715:1209/143924.244759:ERROR:gles2_cmd_decoder.cc(15171)] Context lost because SwapBuffers failed.
[1715:1715:1209/143924.245002:ERROR:gles2_cmd_decoder.cc(4153)]   GLES2DecoderImpl: Trying to make lost context current.
[1715:1715:1209/143924.245712:ERROR:gles2_cmd_decoder.cc(4153)]   GLES2DecoderImpl: Trying to make lost context current.
[1715:1715:1209/143924.245944:ERROR:gles2_cmd_decoder.cc(4153)]   GLES2DecoderImpl: Trying to make lost context current.

This has been reproduced on Intel devices (glimmer, cyan, chell), but not minnie.



 
ui.LATEST
453 KB Download
The page flip ioctl is failing at this lace in intel_display.c:

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index bea742d..feff0cc 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11320,9 +11320,13 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
         * TILEOFF/LINOFF registers can't be changed via MI display flips.
         * Note that pitch changes could also affect these register.
         */
+       printk("intel_display.c test: fb->width is %d, fb->height is %d, crtc->primary->fb->width is %d, crtc->primary->fb->height is %d\n", fb->width, fb->height, crtc->primary->fb->width, crtc->primary->fb->height);
+       printk("intel_display.c test: fb->offsets[0] is %d, fb->pitches[0] is %d, crtc->primary->fb->offsets[0] is %d, crtc->primary->fb->pitches[0] is %d\n", fb->offsets[0], fb->pitches[0], crtc->primary->fb->offsets[0], crtc->primary->fb->pitches[0]);
        if (INTEL_INFO(dev)->gen > 3 &&
            (fb->offsets[0] != crtc->primary->fb->offsets[0] ||
             fb->pitches[0] != crtc->primary->fb->pitches[0])) {
+               printk("intel_display.c fail: fb->width is %d, fb->height is %d\n", fb->width, fb->height);
+               printk("intel_display.c fail: fb->offsets[0] is %d, fb->pitches[0] is %d, crtc->primary->fb->offsets[0] is %d, crtc->primary->fb->pitches[0] is %d\n", fb->offsets[0], fb->pitches[0], crtc->primary->fb->offsets[0], crtc->primary->fb->pitches[0]);
                atomic_inc(&intel_crtc->error_count);
                return -EINVAL;

The stride of the primary framebuffer changes from 5632 to 5504 after the suspend/resume.
Cc: dcasta...@chromium.org
Due to this CL:

https://codereview.chromium.org/2533163002/patch/40001/50003 

The gbm buffers are getting created with different flags (GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR) when in multi-monitor mode versus normal mode (GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING). It was previously just GBM_BO_USE_SCANOUT, which results in the same stride as GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING for the intel backend.

Changing GbmBufferGenerator::Create back to GBM_BO_USE_SCANOUT fixes this, though this might not be the correct solution.
Cc: hoegsberg@chromium.org
Owner: ----
Status: Available (was: Assigned)
Let's use this bug to track progress on the delayed modeset idea.  One of the Chrome folks should probably work on this.  
I think the issue here is that we used to allocate a tiled buffer and now we allocate a linear buffer. That typically results in a different stride, but even with the same stride, we can't pageflip between buffers with different tiling.

Daniele: I think we need either to go with the delayed modeset idea or use GL for doing the copy in FillModesetbuffer.
Project Member

Comment 6 by bugdroid1@chromium.org, Dec 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a17cccbc2dbf0bf2a0df1d98ebbc773491e3e4b4

commit a17cccbc2dbf0bf2a0df1d98ebbc773491e3e4b4
Author: dcastagna <dcastagna@chromium.org>
Date: Tue Dec 13 16:56:44 2016

ozone: Remove USE_LINEAR when allocating modeset buffers.

crrev.com/2533163002 changed the way we allocate modeset buffers.
Unfortunately the new use flags introduced a regression that makes it
not possible to pageflip from a modeset buffer to a buffer queue buffer.
This CL restores the old modeset buffer use flags in order to fix the
regression, while we work on a long term solution.

BUG= 673026 
TEST=manually tried the step described in the bug and verified it now works.

Review-Url: https://codereview.chromium.org/2568243004
Cr-Commit-Position: refs/heads/master@{#438193}

[modify] https://crrev.com/a17cccbc2dbf0bf2a0df1d98ebbc773491e3e4b4/ui/ozone/platform/drm/gpu/drm_thread.cc

Status: Fixed (was: Available)
Okay let's not use this to track the delayed modeset idea (since we're probably going to use GL anyways if doesn't regress boot performance).
Project Member

Comment 8 by bugdroid1@chromium.org, Jan 13 2017

Labels: merge-merged-2924
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7601afb62d79327acdc66f77114bb68023ba9c26

commit 7601afb62d79327acdc66f77114bb68023ba9c26
Author: Daniele Castagna <dcastagna@chromium.org>
Date: Fri Jan 13 00:15:12 2017

ozone: Remove USE_LINEAR when allocating modeset buffers.

crrev.com/2533163002 changed the way we allocate modeset buffers.
Unfortunately the new use flags introduced a regression that makes it
not possible to pageflip from a modeset buffer to a buffer queue buffer.
This CL restores the old modeset buffer use flags in order to fix the
regression, while we work on a long term solution.

BUG= 673026 , 680510 
TEST=manually tried the step described in the bug and verified it now works.

Review-Url: https://codereview.chromium.org/2568243004
Cr-Commit-Position: refs/heads/master@{#438193}
(cherry picked from commit a17cccbc2dbf0bf2a0df1d98ebbc773491e3e4b4)

Review-Url: https://codereview.chromium.org/2625323003 .
Cr-Commit-Position: refs/branch-heads/2924@{#750}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/7601afb62d79327acdc66f77114bb68023ba9c26/ui/ozone/platform/drm/gpu/drm_thread.cc

Sign in to add a comment