OSDN Git Service

android-x86/external-minigbm.git
3 years agominigbm/msm: Double pitch alignment for YUV
Rob Clark [Tue, 1 Dec 2020 20:13:13 +0000 (12:13 -0800)]
minigbm/msm: Double pitch alignment for YUV

Something somewhere is assuming the UV pitch can be half of the Y pitch,
leading to failures with CtsMediaTestCases#android.media.cts.DecodeAccuracyTest

To componsate, double the pitch alignment requirement for YUV formats.

BUG=b:159504968, b:165333514
TEST=run CtsMediaTestCases#android.media.cts.DecodeAccuracyTest

Change-Id: I0118d813576654c72ed55500d741cf07a1977b20
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2568395
Commit-Queue: Rob Clark <robdclark@chromium.org>
Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Rob Clark <robdclark@chromium.org>
Auto-Submit: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
3 years agominigbm: add option to force 256 byte alignment of linear buffers
Dominik Behr [Fri, 6 Nov 2020 02:58:06 +0000 (18:58 -0800)]
minigbm: add option to force 256 byte alignment of linear buffers

BUG=b:172617736
TEST=run glxgears crostini on mushu

Change-Id: I0a5934e3676a70dd0bdb5f53701114fb0c19f016
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2522635
Reviewed-by: David Riley <davidriley@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Auto-Submit: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Dominik Behr <dbehr@chromium.org>

3 years agominigbm: i915: use protected content feature
Gurchetan Singh [Wed, 7 Oct 2020 22:46:23 +0000 (15:46 -0700)]
minigbm: i915: use protected content feature

This enables protected content playback on gen 12 and greater
i915.

BUG=b:153111783,b:155511259
TEST=Protected playback works w/ associated Chrome OS changes

Change-Id: I829dddf506b3b765e5d2f25f2b77af9ecc4f7309
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2459532
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agominigbm: i915: use experimental uapi
Gurchetan Singh [Wed, 7 Oct 2020 21:42:49 +0000 (14:42 -0700)]
minigbm: i915: use experimental uapi

New proposed i915 features for testing purposes.

BUG=b:153111783,b:155511259
TEST=Protected playback works w/ associated Chrome OS changes

Change-Id: I67bb178794d827c85667bff2fb4500c69fe0a4e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2459531
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agominigbm: i915: use local i915 drm header
Gurchetan Singh [Wed, 7 Oct 2020 21:31:20 +0000 (14:31 -0700)]
minigbm: i915: use local i915 drm header

Taken from libdrm.  Mainly so we can have local header for
development purposes.

BUG=b:153111783,b:155511259
TEST=Protected playback works w/ associated Chrome OS changes

Change-Id: I947ab11d5fbc0c2b62dbaf8806e7897d2df79621
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2459530
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agohelpers: Use backend num_planes_from_modifier only when modifier set
Drew Davenport [Tue, 10 Nov 2020 01:37:55 +0000 (18:37 -0700)]
helpers: Use backend num_planes_from_modifier only when modifier set

If modifiers are not set, or if only linear modifier is set, just return
the number of planes based on the format. If there are other modifiers
set, then query the backend.

BUG=b:172830088
TEST=Start camera on zork after mesa uprev

Change-Id: I130e9ef3730b35f6e8777ce9c1919de2eb466733
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2528204
Reviewed-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Drew Davenport <ddavenport@chromium.org>
Commit-Queue: Drew Davenport <ddavenport@chromium.org>

3 years agocros_gralloc: handle memfd_create availability
Jason Macnak [Thu, 5 Nov 2020 21:32:49 +0000 (13:32 -0800)]
cros_gralloc: handle memfd_create availability

BUG=b:172031518
TEST=vts -m VtsHalGraphicsMapperV4_0TargetTest

Change-Id: I9a7a0237620ab2468c014e0778976b379b757acf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2521454
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
Auto-Submit: Jason Macnak <natsu@google.com>

3 years agominigbm i915: Enable Y tiling for buffer width greater than 4096
Abhishek Kumar [Mon, 12 Oct 2020 10:54:03 +0000 (16:24 +0530)]
minigbm i915: Enable Y tiling for buffer width greater than 4096

Vappi hardware decoder requires NV12 buffer to be Y-tiled only ,so
enable Y tiling for buffer width > 4096.Intel GEN9/10 Gpu does not
support Y tiled buffers scanout and overlay plane will not be used.

BUG=b:168706685,b:171518235
TEST= play 5k video on hatch

Change-Id: Icb3ad0ebe58b733f22614d95f2ba3976e7d6e33d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2465962
Tested-by: Andres Calderon Jaramillo <andrescj@google.com>
Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Robert Tarasov <tutankhamen@chromium.org>
3 years agominigbm/mediatek: Allocate NV12 video buffers for MT8192
Fritz Koenig [Sun, 8 Nov 2020 01:37:38 +0000 (17:37 -0800)]
minigbm/mediatek: Allocate NV12 video buffers for MT8192

MT8192 v4l2 decodes into nv12

BUG=b:167469726
TEST=video_decode_accelerator_tests get the buffers needed

Change-Id: I03fd52c26a3f09d5e4e75e92fd3eb4e55dc2d987
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2524254
Tested-by: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agominigbm/msm: Disable UBWC for video gtest
Fritz Koenig [Fri, 6 Nov 2020 17:39:34 +0000 (09:39 -0800)]
minigbm/msm: Disable UBWC for video gtest

video_decode_accelerator_tests need non UBWC
frames in order to check for exactness.  This
is expected to be a short term fix until a
proper verification method is devised.

BUG=b:171260705
TEST=YouTube has UBWC, video_decode_accelerator_tests does not

Change-Id: Ia3ab02493f8b740ba9589b4fc21d3fa6b23ea7cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2523246
Reviewed-by: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Fritz Koenig <frkoenig@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agovirtgpu: set blob_id when creating blob resources
David Stevens [Wed, 28 Oct 2020 07:06:38 +0000 (16:06 +0900)]
virtgpu: set blob_id when creating blob resources

Setting the blob_id is necessary to prevent a race where the cmds for
two concurrent CREATE_BLOB ioctls get swapped.

BUG=b:170375809
TEST=android.media.cts.EncoderTest

Change-Id: I74d4ebe9a819f0564e10736ba5f35c5f8fc8aa1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2503995
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
3 years agominigbm: virtgpu: Fix mapping of DRM_FORMAT_ABGR16161616F
Lepton Wu [Fri, 30 Oct 2020 23:29:26 +0000 (16:29 -0700)]
minigbm: virtgpu: Fix mapping of DRM_FORMAT_ABGR16161616F

This fixes SingleLayer_ColorTest_CpuWriteColorGpuRead_R16G16B16A16_FLOAT
in AHardwareBufferNativeTests with help of this upstream CL:
https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/434

BUG=b:158618381
TEST=manual - the failed test passed

Change-Id: Ib57bd316c17baa7129a6f4067487b88fe0f6e527
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2511795
Tested-by: Lepton Wu <lepton@chromium.org>
Auto-Submit: Lepton Wu <lepton@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Lepton Wu <lepton@chromium.org>

3 years agominigbm: add back in udl/evdi
Gurchetan Singh [Wed, 28 Oct 2020 22:00:10 +0000 (15:00 -0700)]
minigbm: add back in udl/evdi

These drivers are still in use for MIMO displays.

BUG=b:171725208
TEST=enterprise_RemoraRequisitionDisplayUsage

Change-Id: Idecc686e7977a1739943ccb01df849552e40f979
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2505738
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
3 years agocros_gralloc: Fix PlaneLayout width/height metadata
Jason Macnak [Tue, 27 Oct 2020 18:58:35 +0000 (11:58 -0700)]
cros_gralloc: Fix PlaneLayout width/height metadata

... by using the horizontal/vertical subsampling of
each plane.

BUG=b:171019648
TEST=vts -m VtsHalGraphicsMapperV4_0TargetTest

Change-Id: I3eccfa1c0ac30394314c83b54ca50d690c679724
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2503481
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Auto-Submit: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>

3 years agogralloctest: update test for ARCVM
David Stevens [Tue, 27 Oct 2020 04:40:17 +0000 (13:40 +0900)]
gralloctest: update test for ARCVM

On ARCVM, the stride obtained from GRALLOC_DRM_GET_STRIDE is the host
stride, and may be larger than the guest stride.

This change also moves the line which prints the next test to execute to
before the test actually runs, so it appears before test failures.

BUG=b:155238003
TEST=tast run DUT arc.Gralloc*

Change-Id: I4594f352fba585fa4bdbaff609f198888b99c8f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2500971
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
3 years agominigbm: vc4: add YUV support
Gurchetan Singh [Mon, 23 Mar 2020 16:46:09 +0000 (09:46 -0700)]
minigbm: vc4: add YUV support

Ozone should work with VC4's MMAL in V4L2.

Change-Id: Ife783f7005628c49756f251692b0cc42e8b47d8c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2115562
Reviewed-by: Ewan Roycroft <ewan.roycroft@bbc.co.uk>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Ewan Roycroft <ewan.roycroft@bbc.co.uk>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agoi915: Enable Y-tiling for huge buffer object for GEN11 GPU
Abhishek Kumar [Fri, 9 Oct 2020 10:38:01 +0000 (16:08 +0530)]
i915: Enable Y-tiling for huge buffer object for GEN11 GPU

Intel GEN11+ Gpu can scan out Y-tiled buffers with maximum width
5320, so enable Y-tiled buffer for GEN11.

BUG=b:168573604 b:168706685
TEST=play 5k video on JSL device

Change-Id: Idb99c9512591e786f796fb32c0e60f549cec03da
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2462328
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
Tested-by: Girish DS <girish.ds@intel.corp-partner.google.com>
Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org>

3 years agominigbm: komeda: Refactor the 'dumb' drivers and add Komeda support
Anders Dellien [Wed, 10 Jun 2020 09:30:44 +0000 (10:30 +0100)]
minigbm: komeda: Refactor the 'dumb' drivers and add Komeda support

Several drivers are very similar in that they only use the 'dumb'
operations. This patch puts all such drivers into a single file and
also adds a driver to support the Arm Komeda/D71 display processor.

TEST=Boot Android and verify that we reach the home screen

Change-Id: If39605deaef446adf8d6693d760a16c2c3f84649
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2429952
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agominigbm: cros_gralloc: map protected flag to linear
Gurchetan Singh [Fri, 16 Oct 2020 17:28:04 +0000 (10:28 -0700)]
minigbm: cros_gralloc: map protected flag to linear

This should be fine since the dummy fd was never used
with the encoder / decoders, so it doesn't need to be
tiled.

BUG=b/171018855
TEST=GtsExoPlayerTestCases / GtsMediaTestCases

Change-Id: I1309a641e19a9196e0aed05f4820e0d2672fafa0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2481223
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agoamdgpu: Align stride to 512 for multiplane formats
Drew Davenport [Fri, 16 Oct 2020 04:18:00 +0000 (22:18 -0600)]
amdgpu: Align stride to 512 for multiplane formats

Quick fix to ensure subsample stride is aligned to 256 for multiplane formats.

BUG=b:171013552
TEST=CtsMediaTestCases passes on zork

Change-Id: I0f47ae3585e5875f3e35cbb667cb7a0ab6421898
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2477987
Reviewed-by: Bas Nieuwenhuizen <basni@chromium.org>
Commit-Queue: Drew Davenport <ddavenport@chromium.org>
Tested-by: Drew Davenport <ddavenport@chromium.org>
3 years agominigbm: stop faking the protected buffers
Gurchetan Singh [Tue, 13 Oct 2020 00:31:10 +0000 (17:31 -0700)]
minigbm: stop faking the protected buffers

With real HW protection on the horizon, let's repurpose the
protection flag to mean that.

Currently, our protected buffer scheme on the Android side
allocates a dummy fd, which is sent to Chrome.  Chrome
associates that dummy fd with an unmappable shared memory
buffer.  In the entire process, minigbm doesn't really do
anything.

We prevent buffers allocated with the protected
flag from being mapped, but since it's a dummy fd it's not
really useful.

Chrome doesn't use the protected flag yet, but hopefully will
so in the future, but with real HW protection.

BUG=
TEST=

Change-Id: I57be26926539471f062ffeff33b523a3899c35f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2466958
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agoi915: Add gen12 ids for TGL
Sushma Venkatesh Reddy [Thu, 8 Oct 2020 17:18:01 +0000 (10:18 -0700)]
i915: Add gen12 ids for TGL

During 5K/8K HW accelerated video playback, corruptions are observed on
gen12 TGL devices as (i915->gen <= 11) condition is returning true, and
I915_TILING_NONE tile is being set to bo. Adding gen12 ids ensures
buffer allocations happen as per the device's capabilities and here, it
resolves the video corruption issues.

BUG=b:168706685
TEST=Play 5K/8K VP9 codec video

Signed-off-by: Sushma Venkatesh Reddy <sushma.venkatesh.reddy@intel.com>
Change-Id: I24cd0b667f2bf74f73d2377a32f92a148d21c793
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2462345
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Kevin L Derossett <kevin.l.derossett@intel.com>
3 years agovirtgpu: enable blobs for decoder output buffers
David Stevens [Fri, 25 Sep 2020 09:52:26 +0000 (18:52 +0900)]
virtgpu: enable blobs for decoder output buffers

Enabling this requires two changes. First, the check that prevents
BO_USE_RENDERING/BO_USE_TEXTURE buffers from being blobs is removed,
since decoder output buffers are generally used as textures. Second,
NV12 format with no SW usage is added to the list of configurations that
use blobs.

This change also removes the assumption that blobs are mappable, instead
keying off of the software usage flags.

BUG=b:169212117
TEST=Play YouTube on ARCVM

Change-Id: I3fbe744a1ad406fc27f9912296ae4f9b1b55f903
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2430540
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
3 years agominigbm: reduce use of memset
Gurchetan Singh [Wed, 7 Oct 2020 22:28:11 +0000 (15:28 -0700)]
minigbm: reduce use of memset

Also run presubmit.sh.

BUG=none
TEST=compile

Change-Id: I6f5d2afca41c4228a4f8eb40f3670b39bce7b641
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2459529
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agominigbm/msm: Enable UBWC for NV12 buffers
Fritz Koenig [Fri, 7 Aug 2020 21:56:18 +0000 (14:56 -0700)]
minigbm/msm: Enable UBWC for NV12 buffers

BUG=b:149525848
TEST=video_decode_accelerator_tests use UBWC

Change-Id: I66f44f31f69b2a1d32c66a802c21e0a76d95ec89
Cq-Depend: chromium:2460816, chromium:2455450
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2343729
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>

3 years agominigbm: cros_gralloc: simplify getting the drm format string
Gurchetan Singh [Tue, 6 Oct 2020 00:17:13 +0000 (17:17 -0700)]
minigbm: cros_gralloc: simplify getting the drm format string

Can we do this.

BUG=none
TEST=compile

Change-Id: If9488038f1eb77b92e37d6daa99c8bea495315c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2451522
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agominigbm: remove vgem from minigbm (take 2)
Gurchetan Singh [Thu, 19 Dec 2019 18:01:13 +0000 (10:01 -0800)]
minigbm: remove vgem from minigbm (take 2)

In theory, vgem is only used on Android, and nothing
should fail. In theory.  Otherwise, we can just revert
again.

BUG=b:141278896
TEST=compile

Change-Id: I998cb83d5342e454b876f4b74274df96b4951882
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2412903
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agovirtgpu: improve blob support on ARCVM
David Stevens [Thu, 10 Sep 2020 01:50:26 +0000 (10:50 +0900)]
virtgpu: improve blob support on ARCVM

This change expands the types of buffers which use blob allocation, to
cover decoder/encoder bitstream buffers. It also adds tiling to the
exported buffer metadata, so that flush/invalidate are properly skipped
on imported blob buffers.

BUG=None
TEST=tast run ARCVM-DUT arc.VideoDecodeAccel.*

Change-Id: I460f4448db9e1bd2f7458f3180c4e92ff3b3d74f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2400839
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>

3 years agominigbm: Adds Gralloc 4 support
Jason Macnak [Thu, 10 Sep 2020 17:57:46 +0000 (10:57 -0700)]
minigbm: Adds Gralloc 4 support

Implements the Allocator 4.0 and Mapper 4.0 interfaces.

Some notable features of the 4.0 interface:
- buffer metadata getter/setters
- buffer flushing
- buffer debugging (buffer listing and buffer id)

BUG=b:161909468
TEST=build and launch Cuttlefish with Gralloc4

Change-Id: I63bdc76604207e1fcfe0135c9b64fa62bfba5b27
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2404601
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>

3 years agominigbm: Remove Android.bp files
Jason Macnak [Thu, 10 Sep 2020 17:51:47 +0000 (10:51 -0700)]
minigbm: Remove Android.bp files

These files quickly become out of sync with Android specific
build changes so just drop them from upstream Chromium repo.

BUG=b:161909468
TEST=build Cuttlefish

Change-Id: Icf4e3eb708e13ba6c807fcc7d0abe06572d341c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2404600
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>

3 years agominigbm/msm: Correct NV12 UBWC buffer allocation
Fritz Koenig [Wed, 9 Sep 2020 22:22:46 +0000 (15:22 -0700)]
minigbm/msm: Correct NV12 UBWC buffer allocation

V4L2 is the consumer of these buffers and sets up
the allocation in get_framesize_raw_nv12_ubwc().
There was a mismatch where V4L2 was aligning the
uv buffer differently than minigbm.

BUG=b:166157708
TEST=video_decode_accelerator_tests with 856x480 video

Change-Id: Idb9fb689a56639dbc73753d453e7e6e5daeb6700
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2402146
Tested-by: Fritz Koenig <frkoenig@chromium.org>
Commit-Queue: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
3 years agominigbm: remove gbm_bo_map(..) discrepancy
Gurchetan Singh [Tue, 24 Mar 2020 18:05:03 +0000 (11:05 -0700)]
minigbm: remove gbm_bo_map(..) discrepancy

We can now use the upstream gbm_bo_map(..) prototype.

BUG=b:145747350
TEST=compile

Change-Id: Ic3e25ebad903da29be4eb085e5a46bf8109de63f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2118475
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
Reviewed-by: Lepton Wu <lepton@chromium.org>
3 years agomsm: Clear all sw use flags for UBWC combinations
Kristian H. Kristensen [Tue, 8 Sep 2020 03:28:23 +0000 (03:28 +0000)]
msm: Clear all sw use flags for UBWC combinations

Whether rarely or often, we can't support any kind of sw access if the
buffer is UBWC compressed.  We could potentially add support for
blitting in and out of the buffer, but for now just allocate linear.

BUG=b:167934919
TEST=Buffers allocated with any SW access use flag don't get UBWC

Change-Id: Ic9c1d86a124e24b7bc4aa259c62d8c4882c487b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2397084
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>

3 years agominigbm: add O_CLOEXEC for the opened fd
Boleyn Su [Fri, 21 Aug 2020 03:31:49 +0000 (12:31 +0900)]
minigbm: add O_CLOEXEC for the opened fd

BUG=b:162475183
TEST=None

Change-Id: Ic7debb48874ad90509954f7138e33a9d88da4898
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2368693
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Lepton Wu <lepton@chromium.org>
Tested-by: Boleyn Su <boleynsu@chromium.org>
Auto-Submit: Boleyn Su <boleynsu@chromium.org>
Commit-Queue: Boleyn Su <boleynsu@chromium.org>

3 years agominigbm: virtgpu: add resource create blob function
Gurchetan Singh [Sat, 14 Sep 2019 00:49:20 +0000 (17:49 -0700)]
minigbm: virtgpu: add resource create blob function

Some SW intensive apps could benefit from this.

This should decrease power consumption when playing a Youtube
1080p60fps video by 10%.

BUG=chromium:924405
TEST=mmap_test

Change-Id: I80bb08a95b7387eb8af58e1f0d30beb695fc3e74
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1804914
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Lingfeng Yang <lfy@google.com>
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agominigbm: virtgpu: add virgl_protocol.h, add external directory
Gurchetan Singh [Fri, 3 Apr 2020 22:15:30 +0000 (15:15 -0700)]
minigbm: virtgpu: add virgl_protocol.h, add external directory

This adds Mesa protocol headers for BLOB resources.  Also some
code movement.  See:

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4821

for another example.

BUG=chromium:924405
TEST=compile

Change-Id: I330851e6a58d4e12be8e0e882a230a1cca83e7a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1804828
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agoRevert "msm: Disable UBWC briefly while we land the ARC++ modifier support"
Kristian H. Kristensen [Wed, 26 Aug 2020 00:26:24 +0000 (00:26 +0000)]
Revert "msm: Disable UBWC briefly while we land the ARC++ modifier support"

This reverts commit 8e2ae67794c69a25308ffdb6f33ef771c75a97dd.  With the
uprev from CL:2375596, we have support for modifiers all the way from
ARC++, through EGL and exo to KMS and can re-enable UBWC.

BUG=b:145579089, b:79682290, b:163562363
TEST=Once UBWC is enabled again in minigbm, ARC++ buffers should be UBWC
  compressed.

Cq-Depend: chromium:2375596
Change-Id: Iec9bb6f2057eb897fe119750f6a961bbefb871af
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2375673
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Commit-Queue: Rob Clark <robdclark@chromium.org>

3 years agominigbm: run presubmit.sh
Gurchetan Singh [Thu, 20 Aug 2020 21:25:43 +0000 (14:25 -0700)]
minigbm: run presubmit.sh

It's good to do this every once and a while.

Change-Id: Ief71a50e07a51e2ac1b66daf1ed0c8b9129d9c1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2368212
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agocros_gralloc: Add new perform op for getting buffer info
Kristian H. Kristensen [Wed, 12 Aug 2020 22:16:33 +0000 (15:16 -0700)]
cros_gralloc: Add new perform op for getting buffer info

This perform op gives us all the underlying info about the BO, which
lets us import multiplane BOs (such as Intel compressed BOs). This
eliminates a lot of guessing and fudging in EGL and wayland_service
when trying to determine this info from the Android handle.

This generalizes the GET_MODIFIER op, which nothing was using yet.

BUG=b:145579089, b:79682290. b:163562363
TEST=arc++ apps using non-linear format layouts

Change-Id: I821e14477d35794b7247fab59649f564e8ff6985
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2353750
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>

3 years agomsm: Disable UBWC briefly while we land the ARC++ modifier support
Kristian H. Kristensen [Wed, 12 Aug 2020 22:12:44 +0000 (15:12 -0700)]
msm: Disable UBWC briefly while we land the ARC++ modifier support

BUG=b:145579089, b:79682290. b:163562363
TEST=Verify that UBWC is off (eg /sys/kernel/debug/dri/1/state)

Change-Id: Icc62960ea12c30bfa709e358ec1cfb097333e6fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2353749
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>

3 years agominigbm: Use NV12 for video decoder on MT8183 only
Wei Lee [Wed, 5 Aug 2020 09:24:45 +0000 (17:24 +0800)]
minigbm: Use NV12 for video decoder on MT8183 only

To unblock the HALv3 camera migration for MT8173 platform, we changed to
use NV12 for camera read/write, video hw encoder/decoder for
DRM_FORMAT_FLEX_YCbCr_420_888 format on MT8173 in crrev.com/c/2317328.

However, it broke V4L2 VDA since it does not support NV12, as per
b:162698479.

Since camera will not use video decoder actually, change MT8173
back to use YVU420 for video decoder.

BUG=b:162698479
TEST=tast run [DUT] arc.VideoDecodeAccel.h264

Change-Id: Iee83ab0184541b24ecc9e4fb07138c09228e5440
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2336352
Tested-by: Wei Lee <wtlee@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Wei Lee <wtlee@chromium.org>
Auto-Submit: Wei Lee <wtlee@chromium.org>

3 years agominigbm/msm: Add workaround for waffle
Rob Clark [Fri, 7 Aug 2020 15:08:30 +0000 (08:08 -0700)]
minigbm/msm: Add workaround for waffle

Waffle does not support modifiers, detect it and fall back to linear
buffers.  Fixes glmark2-waffle, glbench/windowmanagertest, etc.

BUG=b:158238296, b:153675943
TEST=run glmark2-waffle and verify it displays correct
TEST=run graphics.Sanity and verify that it passes
TEST=start ui and verify that it still picks UBWC modifier

Change-Id: I591136c8d07bd32beb6f4efa63971821193ce39e
Exempt-From-Owner-Approval: already CR+2 from owner
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2343173
Tested-by: Rob Clark <robdclark@chromium.org>
Commit-Queue: Rob Clark <robdclark@chromium.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Auto-Submit: Rob Clark <robdclark@chromium.org>

3 years agoi915: Enable Render Buffer Compression for Gen-11
Binu R S [Mon, 20 Jul 2020 05:06:53 +0000 (10:36 +0530)]
i915: Enable Render Buffer Compression for Gen-11

Enable Render Buffer Compression only for Gen 11

BUG=b:161520827
TEST=Boot target board to UI

Signed-off-by: Binu R S <binu.r.s@intel.com>
Change-Id: I40739732e915a516837a2c7530b4a81679597efe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2306853
Reviewed-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Justin TerAvest <teravest@chromium.org>
Tested-by: Mohanram Meenakshisundaram <mohanram.meenakshisundaram@intel.com>
Commit-Queue: Justin TerAvest <teravest@chromium.org>

3 years agominigbm: Enable NV12 for camera usage on MT8173
Wei Lee [Tue, 21 Jul 2020 03:27:14 +0000 (11:27 +0800)]
minigbm: Enable NV12 for camera usage on MT8173

BUG=b:141517606
TEST=tast run [DUT] camera.CCAUI* camera.HAL3*
TEST=Run CtsCameraTestCases

Change-Id: I908f4a9896e716f460325abb741ace4ee8547ad7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2317328
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Wei Lee <wtlee@chromium.org>
Tested-by: Wei Lee <wtlee@chromium.org>
3 years agocros_gralloc: Add perform action for getting the modifier
Kristian H. Kristensen [Thu, 23 Jul 2020 23:04:47 +0000 (16:04 -0700)]
cros_gralloc: Add perform action for getting the modifier

BUG=b:145579089, b:79682290
TEST=arc++ apps using non-linear format layouts

Change-Id: I9d71852b52b984d89428a07fad5c82d61150e8a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2316523
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>

3 years agominigbm: vc4: Fix error log for DRM_IOCTL_VC4_CREATE_BO
Ewan Roycroft [Thu, 23 Jul 2020 15:08:14 +0000 (16:08 +0100)]
minigbm: vc4: Fix error log for DRM_IOCTL_VC4_CREATE_BO

An ioctl call is made to DRM_IOCTL_VC4_CREATE_BO. On error, it
incorrectly reports that DRM_IOCTL_VC4_GEM_CREATE has failed. This fixes
the log message.

Change-Id: I1b817dba1feae370f5fecfd756595c436cc6d6c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2316159
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Ewan Roycroft <ewan.roycroft@bbc.co.uk>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agominigbm/msm: Don't use uninitialized metadata to setup DRM_FORMAT_R8
Douglas Anderson [Tue, 21 Jul 2020 15:06:46 +0000 (08:06 -0700)]
minigbm/msm: Don't use uninitialized metadata to setup DRM_FORMAT_R8

CL:2245540 seems to have accidentally modified msm.c to use an
uninitialized metadata when setting up DRM_FORMAT_R8.  Let's go back
to using LINEAR_METADATA.

BUG=b:161426616
TEST=Camera no longer crashes

Change-Id: Ia587821216c82d4488b096686904f82147224aa5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2310289
Tested-by: Douglas Anderson <dianders@chromium.org>
Auto-Submit: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Douglas Anderson <dianders@chromium.org>

3 years agodri: Complete the 10-bits formats.
Bas Nieuwenhuizen [Tue, 14 Jul 2020 12:15:38 +0000 (14:15 +0200)]
dri: Complete the 10-bits formats.

They were added to the AMDGPU driver but only half of the formats
were in the mapping table.

Fixes: b16076b "amdgpu: Add 10-bit color formats."

BUG=b:161136516
TEST=run graphics_Gbm on Grunt

Change-Id: I445da2df7b049e3c18456b978a79b28d5b7d008a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2297423
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Drew Davenport <ddavenport@chromium.org>
3 years agomeson: Add support for YUV formats
Daniel Nicoara [Thu, 9 Jul 2020 23:15:42 +0000 (19:15 -0400)]
meson: Add support for YUV formats

Add support to allocate a number of YUV formats. Particularly around
NV12 which can be used in the camera and encoder. This will allow
allocating/sharing buffers across multiple devices via dmabuf.

BUG=b/159467426
TEST=Allocate NV12 buffer and composite it on the GPU.

Change-Id: I9b5dc54dae7f578f7e099a64bd67589658693534
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2291194
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>
Tested-by: Daniel Nicoara <dnicoara@chromium.org>
3 years agoamdgpu: Add 10-bit color formats.
Bas Nieuwenhuizen [Mon, 29 Jun 2020 10:41:18 +0000 (12:41 +0200)]
amdgpu: Add 10-bit color formats.

Should be fine for rendering and texturing.

AMDGPU only exposes this on the primary plane though, not on the
overlay or cursor. I strongly suspect the HW could also do this
on the overlay but I lack a proper testcase for now.

BUG=b:159011420
TEST=Run tast.video.Play.vp9_2_sw on Zork

Change-Id: Ie3a5356576a960985aac0ba16665425f45bd1541
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2272566
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>

3 years agocros_gralloc: fix log statement format specifier
Jason Macnak [Wed, 8 Jul 2020 21:51:13 +0000 (14:51 -0700)]
cros_gralloc: fix log statement format specifier

BUG=b:157902551
TEST=build 64-bit Cuttlefish

Change-Id: Ica6942dca23d562f4527233dd614b8f1ab10b00c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2288583
Tested-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Jason Macnak <natsu@google.com>

3 years agocros_gralloc: set install path in Android.bp
Jason Macnak [Wed, 8 Jul 2020 18:46:13 +0000 (11:46 -0700)]
cros_gralloc: set install path in Android.bp

BUG=b:157902551
TEST=run Cuttlefish w/ Minigbm Gralloc0

Change-Id: I284e911371d0672b1c6663ad601455dd326b8632
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2288141
Tested-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Jason Macnak <natsu@google.com>

3 years agocros_gralloc: Adds gralloc 3.0 support
Jason Macnak [Fri, 24 Jan 2020 23:05:57 +0000 (15:05 -0800)]
cros_gralloc: Adds gralloc 3.0 support

Implements the allocator 3.0 and mapper 3.0 interfaces
which:

 - Implements HIDL interface directly (older versions
   are wrapped in a passthrough HIDL interface)

 - Adds isSupported() to allow checking for format and
   usage combination support before allocating.

Adds emulated multi-planar buffer support to virtio
backend for non gbm enabled hosts.

Updates cros_gralloc_handle to use uint64_t instead of
two uint32_t for some members.

Updates cros_gralloc_handle to have a single format
modifier.

Replaces Android makefiles with Android bp files.

BUG=b:146515640
TEST=run Cuttlefish w/ gralloc3 and run CTS tests

Change-Id: I43ed9788a2413201bddce17ffb69b76006ef39fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2273554
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>

3 years agominigbm:amdgpu: align height to 16 bit for video buffers
Ikshwaku Chauhan [Mon, 29 Jun 2020 11:14:57 +0000 (16:44 +0530)]
minigbm:amdgpu: align height to 16 bit for video buffers

Currently, allocator used by chrome aligns the height of Encoder/Decoder
buffer while allocator used by android(gralloc/minigbm) doesn't provide
any aligment.Aligned the height for video buffers in minigbm.

BUG=b:153130069
TEST=cheets_CTS_P.x86.CtsVideoTestCases

Signed-off-by: Ikshwaku Chauhan <ikshwaku.chauhan@amd.corp-partner.google.com>
Change-Id: I62a883ca55c07674fab7981af0974277fbd2c5b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2273037
Reviewed-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Drew Davenport <ddavenport@chromium.org>
Tested-by: Drew Davenport <ddavenport@chromium.org>
Commit-Queue: Drew Davenport <ddavenport@chromium.org>

3 years agoRevert "Revert "amdgpu: Set USWC for SCANOUT images.""
Bas Nieuwenhuizen [Thu, 4 Jun 2020 21:11:27 +0000 (23:11 +0200)]
Revert "Revert "amdgpu: Set USWC for SCANOUT images.""

This reverts commit 91d36976aa84abde87f0f56d235d57042ca3ea81.i

The previous changes should fix the mapping performance with USWC
memory.

original change:
    amdgpu: Set USWC for SCANOUT images.

    This is necessary for scanout from GTT. Without it, the kernel will
    migrate it to the carveout. For large resolutions this would not be
    feasible due to small carveout sizes and hence it is important that
    we alloc scanout from GTT.

    The original patch was on top of
    4eebcea "amdgpu: make AMDGPU_GEM_CREATE_CPU_GTT_USWC flag default"
    which set USWC unconditionally, but has since been reverted. The
    main failure reason is being addressed in mesa-amd. This patch also
    still disables USWC if we can and the image will be read often on
    the CPU, to avoid staging textures during memory mapping.

TEST=Run android.hardware.camera2.cts.RecordingTest#testVideoPreviewSurfaceSharing on Grunt.
BUG=b:152378755

Change-Id: Ice0041de6676c057a2659986b962c2d54833e928
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2246025
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>

3 years agoamdgpu: Add SDMA copy support.
Bas Nieuwenhuizen [Sat, 20 Jun 2020 01:50:34 +0000 (03:50 +0200)]
amdgpu: Add SDMA copy support.

For SCANOUT images we need to use USWC memory. However USWC
memory is very slow to read from (~25 MiB/second).

At the same time for video decoding there are some images
that are allocated with SCANOUT but at the same time frequently
accessed from the CPU. Just mapping these is going to result
in non-satisfactory performance, so this patch adds a DMA step
to copy it to memory that is faster to acces from the CPU.

Benchmarked on Grunt with
android.hardware.camera2.cts.RecordingTest#testVideoPreviewSurfaceSharing

The time that an image (~500 KiB) is kept mapped for processing,
including the time for mapping and unmapping:

plain GTT (cachaeable):  1.5-2 ms
USWC:                    45-50 ms
USWC w/ memcpy:          20-30 ms
USWC w/ SDMA copy:       3.5-5.5 ms

We can clearly see that the Android video processing code only gets
a throughput of ~10 MiB/s with USWC memory. memcpy is slightly more
efficient by getting 20-30 MiB/s, but neither of these are suitable
for 30+ fps video.

Furthermore, with SDMA copy, the timing is roughly as follows:

map:
  - Allocate plain GTT BO:        ~400-800 us
  - map src & dst BO into GPU VM: ~25 us
  - submit SDMA copy:             ~80 us
  - wait till SDMA copy finishes: ~400 us
  - unmap src & dst BO from GPU:  ~15 us
  - map dst BO into CPU:          ~30 us

unmap:
  - unmapping dst BO from CPU:    ~30 us
  - Copy not benchmarked (avoided for RO map)
  - delete BO:                    ~100 us

ideas for further improvement:
  - BO cache
  - rely on implicit sync and don't wait for the copy during
    unmapping.

Alternatives that have been rejected:
  - Use radeonsi + DRI interface: each plane gets mapped into
    its own BO, which is an issue for gralloc.
  - more persistently mapping each BO into GPU VM: this needs
    proper address space management which adds complexity.
    librm_amdgpu can do it for us but brings its own can of worms
    with dedup of the drm fd. (which makes e.g. implicit sync not
    work with any radeonsi instances in the same process)
  - Use SDMA instead of DRI/Radeonsi for more images. This is an
    issue because SDMA for images is a whole mess with lots of
    corner cases and lots of changes per generation. Furthermore,
    it wouldn't work for DCC compressed images.

TEST=Run android.hardware.camera2.cts.RecordingTest#testVideoPreviewSurfaceSharing on Grunt.
BUG=b:152378755

Change-Id: I8f5e00ff4b6d9e31f78fd4de7eb62d0d3aa66438
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2256228
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>

3 years agoModify NV12 allowed buffer usages for camera capture use case
Hirokazu Honda [Tue, 23 Jun 2020 08:52:20 +0000 (17:52 +0900)]
Modify NV12 allowed buffer usages for camera capture use case

We use SCANOUT_VEA_READ_CAMERA_AND_CPU_READ_WRITE for camera
capture use scenario in Chrome. Therefore, NV12 format must be
allowed for all those usage masks. This CL modifies the usages on
all platforms.

BUG=chromium:982201
TEST=video.EncodeAccel.vp8_720p_i420 on eve

Change-Id: I7880e64049f3bbf9dd1c177619e41362baf641f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2240995
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Hirokazu Honda <hiroh@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>

3 years agominigbm: virtio-gpu: Remove offset log message
Matthias Springer [Mon, 22 Jun 2020 01:05:22 +0000 (10:05 +0900)]
minigbm: virtio-gpu: Remove offset log message

When running the Zoom Android client, "Non-zero transfer offset" was
printed in the logs. We now know for sure that we encounter this case in
the wild, thus removing the log message.

BUG=none
TEST=build minigbm manually

Change-Id: I1a536df50996e5218548fb097543566affa9af3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2255931
Tested-by: Matthias Springer <springerm@chromium.org>
Auto-Submit: Matthias Springer <springerm@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Matthias Springer <springerm@chromium.org>

3 years agoRemove HW_VIDEO_ENCODER usage of YVU420
Hirokazu Honda [Tue, 16 Jun 2020 06:28:56 +0000 (15:28 +0900)]
Remove HW_VIDEO_ENCODER usage of YVU420

minigbm has allowed HW_VIDEO_ENCODER usage to YVU420 so that
chrome can allocate YVU420 with HW_VIDEO_ENCODER. But this
format is no longer allocated by chrome with the usage. Let's
delete the code.

BUG=chromium:982201
TEST=None

Change-Id: Ia6bbc24e7782e3e73c2eb00c00127af212ddf486
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2245967
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Tested-by: Hirokazu Honda <hiroh@chromium.org>
Auto-Submit: Hirokazu Honda <hiroh@chromium.org>

3 years agominigbm: add encoder/decoder blob combination
David Stevens [Mon, 15 Jun 2020 04:48:48 +0000 (13:48 +0900)]
minigbm: add encoder/decoder blob combination

ARCVM sets encoder/decoder usage on the blob output/input buffers, so
that virtio_gpu knows to perform transfers from/to the host where
appropriate. Recently, virtio_gpu started passing all bind flags to the
host, instead of reducing them in the guest. These factors combined
means that the host backends now need to support encoder/decoder usage
with R8 format.

Test: manually verify ARCVM YouTube
Bug: b:158957350
Change-Id: I58bf657496647f8002c693d17a1186f4cf527b01
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2245540
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>

3 years agominigbm: virtio_gpu: add BO_USE_HW_VIDEO_ENCODER usage to R8 format.
David Staessens [Thu, 28 May 2020 06:47:15 +0000 (15:47 +0900)]
minigbm: virtio_gpu: add BO_USE_HW_VIDEO_ENCODER usage to R8 format.

This combination will be used by ARCVM for video encoder bitstream
blobs. Minigbm uses the usage flags to determine whether it needs to
transfer data to/from the host, and whether that transfer needs to be
synchronous. BO_USE_HW_VIDEO_ENCODER needs to be set on the encoder's
output buffers so that minigbm knows that the host modifies the buffer,
so that minigbm transfers the data to the guest.

BUG=b:143570994
TEST=emerge-$BOARD minigbm arc-cros-gralloc

Change-Id: I05eb35d7b68092138c337c0e7fc43f60dd1bc32d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2217833
Tested-by: David Staessens <dstaessens@chromium.org>
Commit-Queue: David Staessens <dstaessens@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
3 years agominigbm: virtio_gpu: use expanded bind flags
David Stevens [Fri, 15 May 2020 05:15:35 +0000 (14:15 +0900)]
minigbm: virtio_gpu: use expanded bind flags

Pass more bind flags from minigbm to virglrenderer. This is necessary to
handle cases where special alignment/padding is required for certain
use cases. For example, jpeg camera recording on mediatek requires extra
padding. Minigbm adds this due to BO_USE_HW_VIDEO_ENCODER, so that flag
must be properly passed from virtio_gpu to host minigbm.

BUG: b:151197279
TEST: verify that ArcCameraFpsTest recording works on kukui

Change-Id: Ie2871b37ca468930abe41738ed0ee4fad0f4cf1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2203164
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
3 years agominigbm/msm: Add DRM_FORMAT_FLEX_IMPLEMENTATION_DEFINED for msm
Douglas Anderson [Tue, 19 May 2020 17:12:14 +0000 (10:12 -0700)]
minigbm/msm: Add DRM_FORMAT_FLEX_IMPLEMENTATION_DEFINED for msm

It seems to be tradition to copy a bit of code into the
resolve_format() function for everyone.  The msm driver isn't one to
break from tradition, so we'll adopt this code fragment too.

BUG=b:154782445
TEST=Hangout

Change-Id: I9e8eaf0c5a8485afea82437fd7249e24e5509b5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2209178
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
3 years agominigbm: virtio_gpu: fill transfer offset
Gurchetan Singh [Tue, 5 May 2020 16:18:22 +0000 (09:18 -0700)]
minigbm: virtio_gpu: fill transfer offset

virglrenderer expects info->offset to be non-zero when a subregion
of the buffer is transferred.  Interestingly enough, minigbm doesn't
seem to hit that case in my (limited) testing.  Fill the transfer
offset and add logging statements.  Maybe we could fail on that case
if we don't encounter it in the wild.

BUG=none
TEST=manual testing with betty

Change-Id: I2f3afaff373777fb8808a0bea169be491d864d1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2182791
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Chia-I Wu <olv@google.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

3 years agoi915: Avoid using y-tiling on huge buffer objects
Sean Paul [Tue, 19 May 2020 14:17:07 +0000 (10:17 -0400)]
i915: Avoid using y-tiling on huge buffer objects

<= GEN11 i915 devices can't scan out Y-tiled buffers greater than 4096
in width. This patch downgrades these huge buffers to X-tiled which can
be scanned out.

BUG=b:151166605
BUG=chromium:988091
TEST=Tested with hatch on Samsung CRG9 5k display

Change-Id: I9f83ab1f9d1f2a254ca0ae7028c138f87be378eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2207670
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Robert Tarasov <tutankhamen@chromium.org>
Tested-by: Sean Paul <seanpaul@chromium.org>
Auto-Submit: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Sean Paul <seanpaul@chromium.org>

3 years agominigbm: Fix cast to avoid null pointer arithmetic
Jason Macnak [Thu, 14 May 2020 17:57:17 +0000 (10:57 -0700)]
minigbm: Fix cast to avoid null pointer arithmetic

'external/minigbm/cros_gralloc/gralloc0/gralloc0.cc:417:50:
error: arithmetic on a null pointer treated as a cast from
integer to pointer is a GNU extension'

BUG=b:146515640
TEST=m gralloc.minigbm

Change-Id: I2e86b676224657bdb656a45db4cfa49e84b61c2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2202518
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Auto-Submit: Jason Macnak <natsu@google.com>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>

3 years agominigbm: virtio_gpu: add BO_USE_HW_VIDEO_DECODER usage to R8 format.
Chih-Yu Huang [Thu, 7 May 2020 02:54:24 +0000 (11:54 +0900)]
minigbm: virtio_gpu: add BO_USE_HW_VIDEO_DECODER usage to R8 format.

This combination will be used by ARCVM for video decoder bitstream
blobs.

BUG=b:156442659
TEST=run e2e test with C2VDAComponent

Change-Id: Iad978f659c0a8edf3279b303794c2b840446be31
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2189994
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Auto-Submit: Chih-Yu Huang <akahuang@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
3 years agoFix YV12 dumb buffer plane sizes
Jason Macnak [Tue, 28 Apr 2020 18:21:16 +0000 (11:21 -0700)]
Fix YV12 dumb buffer plane sizes

Allocating a 1280x720 YUV420 (YV12) buffer results in
calling the create dumb ioctl with 1280x1080 and results
in a file with size 1384448
(1280 * 1080 = 1382400, ALIGN(1382400, 4096) = 1384448).

The existing code calls drv_bo_from_format with the
aligned height of 768 which results in oversized planes
totaling a size of 1474560 bytes. This ultimately leads
to segfaults when running past the end of the mapped
file.

Because the dumb buffer iotcl height is computed using
the buffer's unaligned height (bo->meta.height), the
call to drv_bo_from_format should use the unaligned
height as well.

BUG=b:146515640
TEST=cts android.media.cts.EncodeDecodeTest

Change-Id: I40893cf92caa9d35a89d21a3512604f361822222
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2171157
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>

4 years agoRevert "amdgpu: Set USWC for SCANOUT images."
Bas Nieuwenhuizen [Mon, 27 Apr 2020 19:59:29 +0000 (19:59 +0000)]
Revert "amdgpu: Set USWC for SCANOUT images."

This reverts commit d2c28439190dbf1ab678a4dae5aa23dada7808bd.

Reason for revert: b/55018529: broke android.hardware.camera2.cts.RecordingTest#testVideoPreviewSurfaceSharing and fixing it is non-trivial

Original change's description:
> amdgpu: Set USWC for SCANOUT images.
>
> This is necessary for scanout from GTT. Without it, the kernel will
> migrate it to the carveout. For large resolutions this would not be
> feasible due to small carveout sizes and hence it is important that
> we alloc scanout from GTT.
>
> The original patch was on top of
4eebcea "amdgpu: make AMDGPU_GEM_CREATE_CPU_GTT_USWC flag default"
> which set USWC unconditionally, but has since been reverted. The
> main failure reason is being addressed in mesa-amd. This patch also
> still disables USWC if we can and the image will be read often on
> the CPU, to avoid staging textures during memory mapping.
>
> BUG=b:153247881
> TEST=Run CtsCameraTestCases on Grunt.
>      4k YouTube video p/b
>
> Change-Id: If6393e60cea5d2a98a052d7c46604e0012de0618
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2134451
> Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
> Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>

Bug: b:153247881
Change-Id: I395798c637ab10a2cf2a2a65a3a418a18feb2310
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2167399
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>

4 years agominigbm: synaptics: add texture source format support
Min Zhao [Tue, 14 Apr 2020 22:51:04 +0000 (15:51 -0700)]
minigbm: synaptics: add texture source format support

BUG=b:152384632
TEST=Test by making DUO video call

Change-Id: I2c7920652ab48699a66aedc11f56f44aea9d1c4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2162517
Tested-by: Daniel Nicoara <dnicoara@chromium.org>
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>
Reviewed-by: Daniel Nicoara <dnicoara@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agoamdgpu: Set USWC for SCANOUT images.
Bas Nieuwenhuizen [Mon, 6 Apr 2020 16:50:24 +0000 (18:50 +0200)]
amdgpu: Set USWC for SCANOUT images.

This is necessary for scanout from GTT. Without it, the kernel will
migrate it to the carveout. For large resolutions this would not be
feasible due to small carveout sizes and hence it is important that
we alloc scanout from GTT.

The original patch was on top of
4eebcea "amdgpu: make AMDGPU_GEM_CREATE_CPU_GTT_USWC flag default"
which set USWC unconditionally, but has since been reverted. The
main failure reason is being addressed in mesa-amd. This patch also
still disables USWC if we can and the image will be read often on
the CPU, to avoid staging textures during memory mapping.

BUG=b:153247881
TEST=Run CtsCameraTestCases on Grunt.
     4k YouTube video p/b

Change-Id: If6393e60cea5d2a98a052d7c46604e0012de0618
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2134451
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>

4 years agoSort OWNERS and add ihf.
Ilja H. Friedel [Fri, 17 Apr 2020 22:50:41 +0000 (15:50 -0700)]
Sort OWNERS and add ihf.

BUG=None.
TEST=None.

Change-Id: Id3efc609c23f71b1170ff6c50ef018693425f044
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2154052
Tested-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Ilja H. Friedel <ihf@chromium.org>

4 years agoRemove i915_FORMAT_MOD_Y_TILED_CCS from modifier_order
Mark Yacoub [Fri, 17 Apr 2020 20:27:48 +0000 (16:27 -0400)]
Remove i915_FORMAT_MOD_Y_TILED_CCS from modifier_order

Revert adding i915_FORMAT_MOD_Y_TILED_CCS to the modifiers options.
Reason for revert: Devices with internal 4K displays aren't able to drive external 4K monitors as well.

(This is a partial revert of crrev.com/c/2044490)

BUG=chromium:979736,b:153731006

Change-Id: I40a0c686ee348f94e25b399b9ab91d4d6d377bc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2154983
Tested-by: Ilja H. Friedel <ihf@chromium.org>
Tested-by: Mark Yacoub <markyacoub@google.com>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Mark Yacoub <markyacoub@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Auto-Submit: Mark Yacoub <markyacoub@google.com>
Commit-Queue: Ilja H. Friedel <ihf@chromium.org>
Commit-Queue: Matthew Blecker <matthewb@chromium.org>

4 years agoRevert "amdgpu: make AMDGPU_GEM_CREATE_CPU_GTT_USWC flag default"
Jao-ke Chin-Lee [Fri, 10 Apr 2020 00:12:12 +0000 (00:12 +0000)]
Revert "amdgpu: make AMDGPU_GEM_CREATE_CPU_GTT_USWC flag default"

This reverts commit 4eebcea0cc53e385f715730e883963e86761a2f9.

Reason for revert: Broke tast.video.DecodeAccel.*.h264_resolution_switch on grunt

Original change's description:
> amdgpu: make AMDGPU_GEM_CREATE_CPU_GTT_USWC flag default
>
> amdgpu kernel driver requires USWC flag for allowing bo
> allocation in GTT domain, hence enable it by default.
>
> BUG=b:152378755
> TEST=On Dali play 4k YouTube video
>
> Signed-off-by: Shirish S <shirish.s@amd.com>
> Change-Id: Ic509701f683d184d3fb85b7616dc9a7ed467cfe3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2128147
> Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
> Reviewed-by: Bas Nieuwenhuizen <basni@chromium.org>
> Reviewed-by: Drew Davenport <ddavenport@chromium.org>

Bug: b:152378755
Change-Id: If382833a741faa5462df841cc801e60fd9fca77a
Exempt-From-Owner-Approval: revert.
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2145078
Tested-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Jao-ke Chin-Lee <jchinlee@google.com>
4 years agoamdgpu: make AMDGPU_GEM_CREATE_CPU_GTT_USWC flag default
Shirish S [Tue, 31 Mar 2020 10:35:33 +0000 (16:05 +0530)]
amdgpu: make AMDGPU_GEM_CREATE_CPU_GTT_USWC flag default

amdgpu kernel driver requires USWC flag for allowing bo
allocation in GTT domain, hence enable it by default.

BUG=b:152378755
TEST=On Dali play 4k YouTube video

Signed-off-by: Shirish S <shirish.s@amd.com>
Change-Id: Ic509701f683d184d3fb85b7616dc9a7ed467cfe3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2128147
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Drew Davenport <ddavenport@chromium.org>
4 years agominigbm: virtgpu: refactor virtgpu features
Gurchetan Singh [Fri, 13 Sep 2019 00:26:45 +0000 (17:26 -0700)]
minigbm: virtgpu: refactor virtgpu features

This way, we can call the GET_PARAM ioctl in a loop.

BUG=chromium:924405
TEST=compile

Change-Id: I74359b758a864d72bdec04b7741bbe9e2b466f1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2133073
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Lepton Wu <lepton@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Lepton Wu <lepton@chromium.org>

4 years agominigbm: add resource_info callback for virtio-gpu
Gurchetan Singh [Fri, 28 Jun 2019 03:05:54 +0000 (20:05 -0700)]
minigbm: add resource_info callback for virtio-gpu

In ARC++, the wayland sevice and the video stack rely on
GRALLOC_DRM_GET_STRIDE and (*lock_ycbcr) with zero flags to return
the metadata associated with the buffer.

In the past, we've simply returned the metadata that was calculated
during allocation.

Since the current virtio-gpu API relies on shadow buffers, there's
actually two different sets of metadata:

1) The metadata of the shadow buffer --> useful for mapping
2) The metadata of the host resource --> useful for passing to Chrome

For the wayland_service and video stack, we want to return (2).
For the Android framework, we want to return (1).

BUG=b:132939420
TEST=compile

Change-Id: I1134d651396ba68e064eaf2e3cad3cb3225d7c5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1681383
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agodrm/virtgpu: add header
Gurchetan Singh [Thu, 6 Feb 2020 02:18:52 +0000 (18:18 -0800)]
drm/virtgpu: add header

It's useless to try to keep up with a evolving UAPI, so just add it
here temporarily.

Change-Id: I18671f64cdf28af829fef1124f9f93cb4ffddcb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2003266
Reviewed-by: David Stevens <stevensd@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

4 years agominigbm: mediatek: fix SCANOUT flag
Gurchetan Singh [Tue, 24 Mar 2020 20:53:51 +0000 (13:53 -0700)]
minigbm: mediatek: fix SCANOUT flag

All renderer target works are eligible for scanout, after looking
at mtk_plane_init.

BUG=b:151064316
TEST=Mirror mode works again on Kukui

Change-Id: Ife8948c167c1d75622404af573f8cc92b3516416
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2118463
Reviewed-by: David Stevens <stevensd@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

4 years agominigbm: add synaptics gbm driver
Leona Chou [Thu, 19 Mar 2020 07:06:12 +0000 (15:06 +0800)]
minigbm: add synaptics gbm driver

Change the ozone platform from cast to drm
add synaptics gbm driver for buffer management.

BUG=b:152384632
TEST=use chromecast ui to verify drm
TEST=use ozone_demo app to verify drm

Change-Id: I9dff03e6b522ee84e34cbbcb28a40ca7857c4168
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2108458
Reviewed-by: Daniel Nicoara <dnicoara@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Daniel Nicoara <dnicoara@chromium.org>
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>

4 years agoAdd more scanout formats to meson driver
Daniel Nicoara [Tue, 24 Mar 2020 23:24:43 +0000 (19:24 -0400)]
Add more scanout formats to meson driver

BUG=None
TEST=Allocated AB24 buffers with scanout bit to validate it works.

Change-Id: I415026034e2dd1598d519f00ef4e075731d28074
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2118939
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Daniel Nicoara <dnicoara@chromium.org>
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>

4 years agominigbm: run presubmit.sh, modify OWNERs
Gurchetan Singh [Tue, 24 Mar 2020 20:48:54 +0000 (13:48 -0700)]
minigbm: run presubmit.sh, modify OWNERs

BUG=none
TEST=none

Change-Id: I07ae6fa603117f16dee39b1b7e9ca3162daa0c97
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2118462
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: virtio: check caps version before disabling formats
Jason Macnak [Fri, 13 Mar 2020 16:55:13 +0000 (09:55 -0700)]
minigbm: virtio: check caps version before disabling formats

Gfxstream backend does not yet populate supported formats cap
info.

Bug: b/146066070
Test: launch_cvd --gpu_mode=gfxstream
Change-Id: I28964c7701c5fd4cbe4ebc77f9fc553c64aeb924
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2103048
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>

4 years agomediatek: get prime fd with drv_bo_get_plane_fd
David Stevens [Fri, 13 Mar 2020 06:24:37 +0000 (15:24 +0900)]
mediatek: get prime fd with drv_bo_get_plane_fd

Instead of calling drmPrimeHandleToFD directly, call drv_bo_get_plane_fd
so that the FD is exported with DRM_RDWR if possible.

When a handle is exported, the drm framework caches the underlying
dma_buf struct, even if all fd references are closed. This means that
the flags from the first export operation end up being the primary flags
for all subsequent export attempts. This change ensures that the O_RDWR
flag is set on the first call, to prevent permission checks in
PlatformSharedMemoryRegion from failing.

BUG=b:151394062
TEST=youtube on arcvm on kukui

Change-Id: I9de7bb67b45b3669704f3487889b10ed62493418
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2101054
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>

4 years agominigbm: dri: Set the plane sizes on bo creation.
Bas Nieuwenhuizen [Fri, 13 Mar 2020 10:21:34 +0000 (11:21 +0100)]
minigbm: dri: Set the plane sizes on bo creation.

I cut a corner here on a previous patch and apparently it is used.

Since DRI does not give us useful horizontal & vertical strides
(especially considering things like auxiliary surfaces), do this
calculation based on offsets & buffer strides.

BUG=1061315
TEST=test_that graphics_Gbm on Zork.

Change-Id: Idbca7ce42f4f8a692129a2f8ab5d9c3ccd796496
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2100795
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Ilja H. Friedel <ihf@chromium.org>

4 years agoarc-cros-gralloc: amdgpu: Use DRI_PATH to load radeonsi
Satyajit Sahu [Wed, 4 Mar 2020 10:23:30 +0000 (15:53 +0530)]
arc-cros-gralloc: amdgpu: Use DRI_PATH to load radeonsi

Use DRI_PATH cpp flag exported by ebuild to load the radeonsi
library. This ensures 64/32 bit libraries are loaded as per arch.

BUG=b:148405947, b:148045046, b:139690910, b:150425665, b:150422260,
b:150742051, b:150742059
TEST=Launch play store, no black screen observed

Cq-Depend: chromium:2098992
Change-Id: I12649457c82808aafb468d3d3123ff3eb028e7b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2087294
Reviewed-by: Drew Davenport <ddavenport@chromium.org>
Tested-by: Drew Davenport <ddavenport@chromium.org>
Commit-Queue: Drew Davenport <ddavenport@chromium.org>

4 years agominigbm: dri,amdgpu: Modifier support.
ChromeOS Developer [Mon, 2 Mar 2020 12:08:53 +0000 (13:08 +0100)]
minigbm: dri,amdgpu: Modifier support.

This adds modifier support to minigbm in the amdgpu driver.

This includes

(a) creation of images with modifiers
(b) imports
  - Had to distinguish between legacy and non-legacy.
(c) Support for planes > format planes

BUG=b:149819940
TEST=Login on a Zork device + play a YT video.

Change-Id: If58ada081aa254932e299536c48c18937266c2e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2093212
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>

4 years agominigbm: dri: Support 2+ planes query for modifiers.
ChromeOS Developer [Mon, 2 Mar 2020 15:32:09 +0000 (16:32 +0100)]
minigbm: dri: Support 2+ planes query for modifiers.

If the driver does not implement the new function, or
if modifier is INVALID this should return exactly the
same as before.

For LINEAR, DRI should return exactly the same as
minigbm for all the YUV formats.

BUG=b:149819940
TEST=Use with followup patch and login on a Zork device + play a YT
video.

Change-Id: I6ea3b5827876844e510794b85212be51e5dfd68f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2093211
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>

4 years agoReland "minigbm: introduce test allocation"
David Stevens [Mon, 9 Mar 2020 12:23:42 +0000 (12:23 +0000)]
Reland "minigbm: introduce test allocation"

This reverts commit 08d8dbf094fdc5aa9b92c7257e292edcf28602b2.

The original change returned early from drv_bo_create_with_modifiers,
which broke reference counting. This must have hit some race condition
in the tests, as they no longer flake after fixing reference counting.

Original change's description:
> Revert "minigbm: introduce test allocation"
>
> This reverts commit f0e607c7d436134b53fd45a4ead36d714451be8a.
>
> Reason for revert: caused flaky regressions across the board.
>
> BUG=b:150997559
> Exempt-From-Owner-Approval: revert.
>
> Original change's description:
> > minigbm: introduce test allocation
> >
> > This change introduces a GBM_TEST_ALLOC flag to minigbm, which allows
> > for the creation of fake buffers that can be used to determine buffer
> > metadata without actually allocating a full buffer. The new flag is
> > supported by the i915 backends. This flag also alleviates the need to
> > cache buffers when virtio_gpu queries metadata properties.
> >
> > BUG=b:145994510
> > TEST=play youtube with arcvm demo image plus this and virgl change
> >
> > Change-Id: I9c6819aa3b5b674e4bb33b0656f2a9f155b0884e
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1980688
> > Tested-by: David Stevens <stevensd@chromium.org>
> > Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
> > Commit-Queue: David Stevens <stevensd@chromium.org>
>
> Bug: b:145994510
> Change-Id: I50079b7f0aabf38e1f373cac0f28c0e057eed760
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2093923
> Commit-Queue: Ilja H. Friedel <ihf@chromium.org>
> Tested-by: Ilja H. Friedel <ihf@chromium.org>
> Reviewed-by: Ilja H. Friedel <ihf@chromium.org>

Bug: b:150997559, b:145994510
Change-Id: If0f02a4701bb6960b6413d6b0c00b481146914d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2094068
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
4 years agoRevert "minigbm: introduce test allocation"
Ilja H. Friedel [Sun, 8 Mar 2020 04:48:13 +0000 (04:48 +0000)]
Revert "minigbm: introduce test allocation"

This reverts commit f0e607c7d436134b53fd45a4ead36d714451be8a.

Reason for revert: caused flaky regressions across the board.

BUG=b:150997559
Exempt-From-Owner-Approval: revert.

Original change's description:
> minigbm: introduce test allocation
>
> This change introduces a GBM_TEST_ALLOC flag to minigbm, which allows
> for the creation of fake buffers that can be used to determine buffer
> metadata without actually allocating a full buffer. The new flag is
> supported by the i915 backends. This flag also alleviates the need to
> cache buffers when virtio_gpu queries metadata properties.
>
> BUG=b:145994510
> TEST=play youtube with arcvm demo image plus this and virgl change
>
> Change-Id: I9c6819aa3b5b674e4bb33b0656f2a9f155b0884e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1980688
> Tested-by: David Stevens <stevensd@chromium.org>
> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
> Commit-Queue: David Stevens <stevensd@chromium.org>

Bug: b:145994510
Change-Id: I50079b7f0aabf38e1f373cac0f28c0e057eed760
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2093923
Commit-Queue: Ilja H. Friedel <ihf@chromium.org>
Tested-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
4 years agominigbm: vc4: add create_with_modifiers function
Gurchetan Singh [Sat, 22 Feb 2020 01:59:01 +0000 (17:59 -0800)]
minigbm: vc4: add create_with_modifiers function

Change-Id: Iedba297cbcf69e3c87165bd54fce316b75a7a530
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2068463
Reviewed-by: Ewan Roycroft <ewan.roycroft@bbc.co.uk>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
4 years agominigbm: introduce test allocation
David Stevens [Wed, 25 Dec 2019 07:43:36 +0000 (16:43 +0900)]
minigbm: introduce test allocation

This change introduces a GBM_TEST_ALLOC flag to minigbm, which allows
for the creation of fake buffers that can be used to determine buffer
metadata without actually allocating a full buffer. The new flag is
supported by the i915 backends. This flag also alleviates the need to
cache buffers when virtio_gpu queries metadata properties.

BUG=b:145994510
TEST=play youtube with arcvm demo image plus this and virgl change

Change-Id: I9c6819aa3b5b674e4bb33b0656f2a9f155b0884e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1980688
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>

4 years agominigbm/msm: Update msm for removal of kms_query
Jeffrey Kardatzke [Mon, 2 Mar 2020 20:25:55 +0000 (12:25 -0800)]
minigbm/msm: Update msm for removal of kms_query

Recently kms_query was removed which then caused the NV12 texture format
here to use UBWC, which is incorrect currently. This updates the msm
code similar to other changes.

I'm somewhat guessing at this, so please review this thoroughly.

BUG=b:149190288
TEST=VDA tests pass on trogdor again

Change-Id: Ie3370623d324f8378d03bcc3562cd17561f5ba01
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2083720
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>

4 years agominigbm: virtio: Advertise BO_USE_SCANOUT correctly.
Lepton Wu [Wed, 26 Feb 2020 23:13:34 +0000 (15:13 -0800)]
minigbm: virtio: Advertise BO_USE_SCANOUT correctly.

If host doesn't support BO_USE_SCANOUT for some format, we shouldn't
advertise it. Otherwise the bo will fail to allocate at host side
with minigbm.

BUG=b:145603024
TEST=tast run 127.0.0.1:9222 arc.Boot.vm

Change-Id: I9e2c8141462b630bf18cc8859df607dca7b335c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2076580
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Lepton Wu <lepton@chromium.org>
Commit-Queue: Lepton Wu <lepton@chromium.org>
Auto-Submit: Lepton Wu <lepton@chromium.org>

4 years agominigbm: virtio-gpu: wait for transfers when necessary
David Stevens [Wed, 26 Feb 2020 08:14:43 +0000 (17:14 +0900)]
minigbm: virtio-gpu: wait for transfers when necessary

There are two situations where guest access and host access to buffers
need to be synchronized to ensure consistency:

  - If the guest CPU can write to the mapping and something in the host
    besides the GPU might access the buffer, flush must be synchronous
    to ensure the host sees any guest changes. Waiting is not necessary
    if only the GPU can access the buffer because any subsequent
    commands will be properly ordered.
  - If the guest CPU can access the mapping and something in the host
    can write to the buffer, then invalidate must be synchronous to
    ensure the guest sees any host changes.

To perform this synchronization, have the virtio_gpu backend wait for
the transfer to/from the host to complete before returning from
flush/invalidate. In the future, support for fence-based synchronization
should also be added.

BUG=b:120456557 b:136733358
TEST=arc-codec-test, ArcVideoPlayer

Change-Id: If4ad293886a67d93d85b0d4a682b31c66597d4ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1687736
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
4 years agominigbm/msm: Add NV12 format for Android flex allocation
Jeffrey Kardatzke [Tue, 25 Feb 2020 18:33:37 +0000 (10:33 -0800)]
minigbm/msm: Add NV12 format for Android flex allocation

BUG=b:149344523
TEST=HW decoder playback on ARC works w/ test codec manifest

Change-Id: Ic4c8ed8466a783dd9779b529e96be85298fc680e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2072600
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>

4 years agoReland "minigbm: i915: remove KMS query"
Ilja H. Friedel [Wed, 26 Feb 2020 02:50:51 +0000 (02:50 +0000)]
Reland "minigbm: i915: remove KMS query"

This reverts commit b0787a9fdb40b580c473d79d0e55070a1fd4844a.

Reason for revert: I want to avoid a potentially broken build due to the revert. My local build is taking too long.

BUG=b:149959202
Exempt-From-Owner-Approval: reland change.

Original change's description:
> Revert "minigbm: i915: remove KMS query"
>
> This reverts commit 0254a661f1511cea63d1b993d3d2b1457e371e36.
>
> Reason for revert: speculative revert to address octopus breakages
>
> BUG=b:149959202
> Exempt-From-Owner-Approval: revert change.
>
>
> Original change's description:
> > minigbm: i915: remove KMS query
> >
> > This simplifies the code.  We just have to make sure:
> >
> > - the scanout flag goes to X-tiled.
> >
> > BUG=b:145747132
> > TEST=compile and run on Nami
> >
> > Cq-Depend: chromium:1998011
> > Change-Id: Ic2a1c367017c28abc3a9307bea53c577bc33e31e
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1976275
> > Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
> > Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
> > Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
> > Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
>
> Bug: b:145747132
> Change-Id: If6aa7e3623461b8f837dec581934ed86d4c4a573
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2073173
> Tested-by: Ilja H. Friedel <ihf@chromium.org>
> Reviewed-by: Jao-ke Chin-Lee <jchinlee@google.com>
> Commit-Queue: Jao-ke Chin-Lee <jchinlee@google.com>

Bug: b:149959202, b:145747132
Change-Id: I529f24309ee33bc6b500c65fd83a7f282dafef05
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2073478
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Jao-ke Chin-Lee <jchinlee@google.com>
Commit-Queue: Ilja H. Friedel <ihf@chromium.org>
Tested-by: Ilja H. Friedel <ihf@chromium.org>
4 years agoRevert "minigbm: i915: remove KMS query"
Jao-ke Chin-Lee [Wed, 26 Feb 2020 02:14:19 +0000 (02:14 +0000)]
Revert "minigbm: i915: remove KMS query"

This reverts commit 0254a661f1511cea63d1b993d3d2b1457e371e36.

Reason for revert: speculative revert to address octopus breakages

BUG=b:149959202
Exempt-From-Owner-Approval: revert change.

Original change's description:
> minigbm: i915: remove KMS query
>
> This simplifies the code.  We just have to make sure:
>
> - the scanout flag goes to X-tiled.
>
> BUG=b:145747132
> TEST=compile and run on Nami
>
> Cq-Depend: chromium:1998011
> Change-Id: Ic2a1c367017c28abc3a9307bea53c577bc33e31e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1976275
> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
> Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
> Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>

Bug: b:145747132
Change-Id: If6aa7e3623461b8f837dec581934ed86d4c4a573
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2073173
Tested-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Jao-ke Chin-Lee <jchinlee@google.com>
Commit-Queue: Jao-ke Chin-Lee <jchinlee@google.com>

4 years agomsm: Don't height align R8, height 1 buffers used for camera output
Jeffrey Kardatzke [Fri, 21 Feb 2020 23:35:01 +0000 (15:35 -0800)]
msm: Don't height align R8, height 1 buffers used for camera output

We height align to multiples of 64 and the camera will create a height
one buffer of length 13MB for JPEG output with R8 format. If we see R8
format with height 1, then don't do the height alignment.

BUG=b:148152367
TEST=Camera app works on trogdor

Change-Id: I6e4260f37cc45fe3b7e9bd132844cbde4a58fc26
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2066796
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Auto-Submit: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>

4 years agomsm: add camera use flags for NV12 and R8
Ricky Liang [Thu, 13 Feb 2020 02:42:46 +0000 (10:42 +0800)]
msm: add camera use flags for NV12 and R8

NV12 is used by the camera stack for YUV buffers. R8 is used by the
camera stack as a blob format for JPEG images.

BUG=b:148152367
TEST=Manually with built-in camera app on Cheza

Change-Id: I484f1a5ede2dfece549706310d832086af087544
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2053665
Tested-by: Ricky Liang <jcliang@chromium.org>
Commit-Queue: Ricky Liang <jcliang@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>