New issue
Advanced search Search tips

Issue 872901 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 10
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

HW overlays in portrait mode are upside down

Project Member Reported by dcasta...@chromium.org, Aug 9

Issue description

To reproduce: crosvideo.appspot.com, play a video, maximize to fullscreen, put eve or soraka in tablet/portrait mode.

Can this be in any way related to the work we've been doing for flipping upside down webgl/canvas?
 
I don't think it's related to webgl/canvas y-flip.  This isn't a flip, it's a rotate.  The text is still readable, you don't need a mirror.  If it was y-flip I would expect that a mirror would be needed to read the text in the video.

The overlay is in a nv12 plane, which I don't think is touched by opengl.
WebGL is not getting sent to a plane when rotation occurs.  (https://webglsamples.org/aquarium/aquarium.html) goes to compositing on soraka when rotated (whenever the screen is detached it goes to compositing)

https://nacl-latency.firebaseapp.com/ is on a plane, but only rotated 90 degrees.
Labels: ReleaseBlock-Beta
Components: Internals>GPU>Video
Labels: -OS-Linux OS-Chrome
dcastagna@chromium.org: who is doing Q/A on ChromeOS side? It seems we might be able to bisect and pin-point when this regress, so maybe assign a Q/A folk to own this bug?
back at M68 it is still upside down with underlays (single-on-top isn't kicking in for the rotated image)

It may go back before that.  It shows for both underlay and single-on-top.

Here is a thought.  In the kernel, for the primary plane, there is a swap of DRM_ROTATE_90 for PLANE_CTL_ROTATE_270 and DRM_ROTATE_270 for PLANE_CTL_ROTATE_90.  This occurs in skl_plane_ctl_rotation[1].

This is only done for the primary plane.  The sprite planes (which the underlay/overlay (NV12) video is), do not go through this path.

I can go into OverlayTransformToDrmRotationPropertyValue[2] and make this switch happen.  OVERLAY_TRANSFORM_ROTATE_90 maps to DRM_ROTATE_270 and OVERLAY_TRANSFORM_ROTATE_270 maps to DRM_ROTATE_90.  And then the video rotates correctly.

[1]: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/factory-soraka-10323.39.B-chromeos-4.4/drivers/gpu/drm/i915/intel_display.c#3505

[2]: https://cs.chromium.org/chromium/src/ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.cc?q=OverlayTransformToDrmRotationPropertyValue&g=0&l=24
Cc: rjkroege@chromium.org dcasta...@chromium.org
Owner: frkoenig@chromium.org
Status: Assigned (was: Untriaged)
Any progress on this?
drm rotation is ccw, this seems to be backwards from chrome rotation.  I think the solution is to change the mapping of DRM_ROTATE to OVERLAY_TRANSFORM_ROTATE in hardware_display_plane_atomic.cc

but I haven't confirmed what the direction of OVERLAY_TRANSFORM_ROTATE is at the moment

The solution for now is to reject rotated NV12 planes.  Only tiled NV12 planes can be rotated by DRM.  Software video decoders currently use non-tiled NV12 planes.

There isn't a good mechanism to get back the necessary information from atomic test.
Project Member

Comment 11 by bugdroid1@chromium.org, Sep 5

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

commit a90551a9a54efe3afdecb37b450a0cd56dad6ac1
Author: Fritz Koenig <frkoenig@chromium.org>
Date: Wed Sep 05 17:11:57 2018

ozone/drm: Turn off unsupported overlay rotations

DRM does not support overlay rotation well.
NV12 planes are supported, but they need to be
tiled.  That information is not available currently.

BUG= 872901 
TEST=browser

Change-Id: Ide9c837dca62a6db9d13e6fedaaf5b256e4bcb79
Reviewed-on: https://chromium-review.googlesource.com/1196019
Commit-Queue: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: Daniel Nicoara <dnicoara@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588903}
[modify] https://crrev.com/a90551a9a54efe3afdecb37b450a0cd56dad6ac1/ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.cc

Confirmed working in R71-11043.0.0 on soraka
Labels: Merge-Request-70
Labels: -Merge-Request-70 Merge-Approved-70
Project Member

Comment 15 by bugdroid1@chromium.org, Sep 7

Labels: -merge-approved-70 merge-merged-3538
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/80ab9a03ccc6ecb0d28636b3dafc1296518ffac6

commit 80ab9a03ccc6ecb0d28636b3dafc1296518ffac6
Author: Fritz Koenig <frkoenig@chromium.org>
Date: Fri Sep 07 22:45:16 2018

ozone/drm: Turn off unsupported overlay rotations

DRM does not support overlay rotation well.
NV12 planes are supported, but they need to be
tiled.  That information is not available currently.

BUG= 872901 
TEST=browser

(cherry picked from commit a90551a9a54efe3afdecb37b450a0cd56dad6ac1)

Change-Id: Ide9c837dca62a6db9d13e6fedaaf5b256e4bcb79
Reviewed-on: https://chromium-review.googlesource.com/1196019
Commit-Queue: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: Daniel Nicoara <dnicoara@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#588903}
Reviewed-on: https://chromium-review.googlesource.com/1214403
Cr-Commit-Position: refs/branch-heads/3538@{#174}
Cr-Branched-From: 79f7c91a2b2a2932cd447fa6f865cb6662fa8fa6-refs/heads/master@{#587811}
[modify] https://crrev.com/80ab9a03ccc6ecb0d28636b3dafc1296518ffac6/ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.cc

Status: Fixed (was: Assigned)

Sign in to add a comment