This reverts commit b7a9a2b7d5.
Reason for revert: Crash resolved by Ieb07b5bbc206f07f69e4afba921149f49d6fe8c4
Bug: 349870098
Change-Id: I49848f6e7311c1f44e6c988cb42107ed79da3a6b
Mark the availability of minigbm's newer gbm_bo_get_map_info() API.
Virglrenderer (and others) can test for its existence at build-time and
conditionally use it.
BUG=b:338254311
TEST=emerge minigbm
TEST=virglrenderer can conditionally build with gbm_bo_get_map_info()
Change-Id: I2685813fa99b73316477bef7edfd96e5dd9699a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5636516
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Dawn Han <dawnhan@google.com>
Commit-Queue: Ryan Neph <ryanneph@google.com>
Rationale: this will help get Rust gbm bindings into Android
(go/drm-gbm-rust-crates-for-android) without needing minigbm-specific
patches to upstream Rust code.
Upstream Mesa gbm defines those functions as variants with an extra
"flags" argument[2][3] (these don't exist in the mesa version checked
into Chromium though). The definitions added in this CL provide variants
that fail for any non-zero flags.
[1] https://crates.io/crates/gbm
[2] b7d6d90dab/src/gbm/main/gbm.h (L303)
[3] b7d6d90dab/src/gbm/main/gbm.h (L443)
Bug: 328363177
Test: cros build-packages --board=amd64-generic minigbm drm-tests
Change-Id: I9284d597e2d4de5ff9b677db0a0ffe6d274e4f57
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5352371
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Marcin Radomski <dextero@google.com>
Tested-by: Marcin Radomski <dextero@google.com>
Rationale: this will help get Rust gbm bindings into Android
(go/drm-gbm-rust-crates-for-android) without needing minigbm-specific
patches to upstream Rust code.
Mesa gbm defines the plane argument for some functions as int rather
than size_t. While this doesn't bother C/C++ compilers too much,
attempting to use bindgen-generated Rust bindings to minigbm with gbm
Rust crate[1] fails.
[1] https://crates.io/crates/gbm
Bug: 328363177
Test: cros build-packages --board=amd64-generic minigbm drm-tests
Change-Id: I5938633e0936bf1b9aafb856bfb966ceb1fb1a2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5352370
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Marcin Radomski <dextero@google.com>
Tested-by: Marcin Radomski <dextero@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Crosvm currently makes the simplistic assumption that if driver==i915
then cached mappings to guest should be used for minigbm allocated
buffers. But this may not always be the correct choice. And other
drivers can do cached mappings to, in certain cases. But on ARM devices
in particular, we should be consistent in cachability when it comes to
CPU mappings. So add a new minigbm API which crosvm can use to
determine how to map to guest.
BUG=b:239718180, b:306548532
TEST=no artifact in Camera FOV Calibration of CtsVerifier on rex
Change-Id: I5c9b6346270f6a2eb83e6637a911f2153f6120ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3777567
Tested-by: Chia-I Wu <olv@google.com>
Auto-Submit: Rob Clark <robdclark@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Chia-I Wu <olv@google.com>
This is required for modern Android atop a gralloc with the cross_domain
backend or other native backend.
BUG=b:238609372
TEST=build and AHB cts
Change-Id: Id963eeec62c4400cc009384e127c93588c99346e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3777566
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
This CL adds GBM_FORMAT_P010 which somehow wasn't there (Chrome used
DRM_FORMAT_P010) and adds SCANOUT support for it: P010 can be
scanned out in JSL and TGL (Gen 11 and Gen12 GPUs).
crrev/c/2808787 adds P010 support to drm-tests plane_test.
[1] https://source.chromium.org/search?q=I915_SCANOUT_Y_TILED
BUG=b:183760490
TEST=on volteer:
/usr/bin/plane_test -f P010
/usr/bin/plane_test --format NV12 --size 600x400 -p --format P010 --size 200x200 -d 200,200
work as expected.
Change-Id: I535b05102ab8d2c3bd7cd0d63029bfca5fe3d79f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2808788
Tested-by: Miguel Casas <mcasas@chromium.org>
Auto-Submit: Miguel Casas <mcasas@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Add a flag to indicate that a buffer will be used for front-buffer (low-
latency) rendering. We need to avoid using framebuffer compression in
this case, as the compression data and pixel data can be transiently out
of sync, resulting in corrupted display.
BUG=b:168868719
TEST=None
Change-Id: I08e6444aba99a5f694d010372277de775bc56fd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2450927
Tested-by: Rob Clark <robdclark@chromium.org>
Auto-Submit: Rob Clark <robdclark@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Rob Clark <robdclark@chromium.org>
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>
This reverts commit 08d8dbf094.
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 f0e607c7d4.
>
> 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>
This reverts commit f0e607c7d4.
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>
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>
We have been running an effort to align minigbm apis with
the upstream libgbm.
The clients of minigbm are fixed, and the deprecated methods can be
removed now.
Change-Id: I09043ef5728af36298e3331c6694fde656b0d7e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1505613
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Plan is convert all users to gbm_bo_map2, and then make gbm_bo_map
follow the upstream convention.
BUG=b:145747350
TEST=emerge-nami minigbm
Change-Id: I7c7d54d519277e21ebfa99c57d9a738e9d257a57
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1965671
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
First step to removing technical debt: sync header.
This patch series is not bisectable.
The header was copied from commit 1abca2b3c84a42ab64c466bc209db42c41bba5e3.
BUG=b:145747113
TEST=emerge-nami minigbm
Cq-Depend: chromium:1963000
Change-Id: Ic19a471887f57a46de75e71c3db4791d4ae9795d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1963000
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Chrome needs to allocate a linear buffer that a hardware video encoder can read
and cpu can read and write. There is no use flag in gbm that specifies the
former. This CL introduces a new use flag for that.
BUG=b:138703716
TEST=None
Change-Id: Ied0321914a366294a47e4fc5c2a8f08ee0351bd8
Reviewed-on: https://chromium-review.googlesource.com/1728729
Tested-by: Hirokazu Honda <hiroh@chromium.org>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
It seems like the problem was that the
GBM_BO_IMPORT_FD_PLANAR was redifened to 0x5505
from 0x5504. And GBM_BO_IMPORT_FD_MODIFIER
was added as 0x5504, which lead to crashes.
In order to minimize risks, do it other way round -
leave GBM_BO_IMPORT_FD_PLANAR as 0x5504 and
add GBM_BO_IMPORT_FD_MODIFIER as 0x5505.
Once all the call sites are changed to use
GBM_BO_IMPORT_FD_MODIFIER, remove GBM_BO_IMPORT_FD_PLANAR
and make GBM_BO_IMPORT_FD_MODIFIER to be 0x5505.
Original change's description:
> minigbm: define GBM_BO_IMPORT_FD_MODIFIER
>
> This CL aligns the minigbm more with the upstream GBM
> by defining GBM_BO_IMPORT_FD_MODIFIER and using
> gbm_import_fd_modifier_data instead.
>
> That is, the main difference between the old
> gbm_import_fd_planar_data one and the new one is
> the format_modifiers variable. In the upstream
> GBM, it's a single variable. In the minigbm, it is
> an array.
>
> As we know there are no cases when modifiers would
> be different for each plane. Thus, it's safe to eliminate
> that and adapt more to the upstream.
>
> Change-Id: Iaae062ef1fe9fc9ab0ead09c5f4bfa91d2db67c3
> Reviewed-on: https://chromium-review.googlesource.com/1360771
> Commit-Ready: Maksim Sisov <msisov@igalia.com>
> Tested-by: Maksim Sisov <msisov@igalia.com>
> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Change-Id: I1617de54914734c903cb05e1694cc782a7bb171a
Reviewed-on: https://chromium-review.googlesource.com/1454658
Commit-Ready: Maksim Sisov <msisov@igalia.com>
Tested-by: Maksim Sisov <msisov@igalia.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This reverts commit bc667c3ef6.
Reason for revert: This change might cause crbug.com/913329.
Original change's description:
> minigbm: define GBM_BO_IMPORT_FD_MODIFIER
>
> This CL aligns the minigbm more with the upstream GBM
> by defining GBM_BO_IMPORT_FD_MODIFIER and using
> gbm_import_fd_modifier_data instead.
>
> That is, the main difference between the old
> gbm_import_fd_planar_data one and the new one is
> the format_modifiers variable. In the upstream
> GBM, it's a single variable. In the minigbm, it is
> an array.
>
> As we know there are no cases when modifiers would
> be different for each plane. Thus, it's safe to eliminate
> that and adapt more to the upstream.
>
> Change-Id: Iaae062ef1fe9fc9ab0ead09c5f4bfa91d2db67c3
> Reviewed-on: https://chromium-review.googlesource.com/1360771
> Commit-Ready: Maksim Sisov <msisov@igalia.com>
> Tested-by: Maksim Sisov <msisov@igalia.com>
> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Change-Id: I7dec62abd4243554847930cce33f0d5db069c3f4
Reviewed-on: https://chromium-review.googlesource.com/1369469
Commit-Ready: Naoki Fukino <fukino@chromium.org>
Tested-by: Naoki Fukino <fukino@chromium.org>
Reviewed-by: Naoki Fukino <fukino@chromium.org>
This CL aligns the minigbm more with the upstream GBM
by defining GBM_BO_IMPORT_FD_MODIFIER and using
gbm_import_fd_modifier_data instead.
That is, the main difference between the old
gbm_import_fd_planar_data one and the new one is
the format_modifiers variable. In the upstream
GBM, it's a single variable. In the minigbm, it is
an array.
As we know there are no cases when modifiers would
be different for each plane. Thus, it's safe to eliminate
that and adapt more to the upstream.
Change-Id: Iaae062ef1fe9fc9ab0ead09c5f4bfa91d2db67c3
Reviewed-on: https://chromium-review.googlesource.com/1360771
Commit-Ready: Maksim Sisov <msisov@igalia.com>
Tested-by: Maksim Sisov <msisov@igalia.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This patch does not bring any functionality changes, but just
adds a MINIGBM define in order to be able to distiguish if
Chromium, for example, uses a system libgbm (needed by Ozone/Wayland
builds for Linux due to some diffirences, which we cannot fix yet)
or minigbm.
Change-Id: I82366ce9a1c302124b75a6c21028a67127497065
Reviewed-on: https://chromium-review.googlesource.com/1281887
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Maksim Sisov <msisov@igalia.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This patch simply changes some methods' names in order to
align them with the upstream ones. It's needed because Chromium/Wayland
implementation is going to have a gbm implementation used by a GPU
split effort.
In order to avoid to have a per compile gn flags, we would like
to standartize the gbm APIs and be able to use the same binary without
recompilations.
In follow-up CLs, I will fix callers and finally remove the old APIs
namings in favor of new ones.
Change-Id: I850824e7194077c47baa761cddb2947959dff9c3
Reviewed-on: https://chromium-review.googlesource.com/1162170
Commit-Ready: Michael Spang <spang@chromium.org>
Tested-by: Michael Spang <spang@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
This is a reland of 1bd7b04a3a
We've landed CL:1070995 which fixes the missing modifier that
caused tiling corruption on pre-KBL Intel devices and CL:1072638
which makes the failing vda unittests use SCANOUT_VDA_WRITE as
they were supposed to.
Original change's description:
> i915: Add GBM_BO_USE_HW_VIDEO_DECODER use flag
>
> This flag is used to indicate that the platform video decoder will be
> writing into this buffer and that it should be allocated
> accordingly. On Intel, this means that we have to allocate y-tiled
> NV12 for libva to be able to decode to the buffer.
>
> We force gralloc NV12 allocations to be linear for now, since ARC++
> doesn't properly pass modifiers to ChromeOS.
>
> BUG=822346
> TEST=test_that graphics_Gbm
>
> Change-Id: I840c30d22355d26816df718b49717407e2e4620f
> Reviewed-on: https://chromium-review.googlesource.com/996648
> Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
> Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Bug: 822346
Change-Id: Icf0921dc91ac422da26371bffea34b26550b8234
Reviewed-on: https://chromium-review.googlesource.com/1073877
Commit-Ready: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
This reverts commit 1bd7b04a3a.
Reason for revert: Breaks video decoding on most intel platforms, e.g., caroline and samus
Original change's description:
> i915: Add GBM_BO_USE_HW_VIDEO_DECODER use flag
>
> This flag is used to indicate that the platform video decoder will be
> writing into this buffer and that it should be allocated
> accordingly. On Intel, this means that we have to allocate y-tiled
> NV12 for libva to be able to decode to the buffer.
>
> We force gralloc NV12 allocations to be linear for now, since ARC++
> doesn't properly pass modifiers to ChromeOS.
>
> BUG=822346
> TEST=test_that graphics_Gbm
>
> Change-Id: I840c30d22355d26816df718b49717407e2e4620f
> Reviewed-on: https://chromium-review.googlesource.com/996648
> Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
> Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Bug: 822346, 845076
Change-Id: I7681ddb66e4789951e840821993fc5562a55d1af
Reviewed-on: https://chromium-review.googlesource.com/1066032
Tested-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Kuo Jen Wei <inker@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
This flag is used to indicate that the platform video decoder will be
writing into this buffer and that it should be allocated
accordingly. On Intel, this means that we have to allocate y-tiled
NV12 for libva to be able to decode to the buffer.
We force gralloc NV12 allocations to be linear for now, since ARC++
doesn't properly pass modifiers to ChromeOS.
BUG=822346
TEST=test_that graphics_Gbm
Change-Id: I840c30d22355d26816df718b49717407e2e4620f
Reviewed-on: https://chromium-review.googlesource.com/996648
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Need for these flags has arisen because buffer's allocated
BO_USE_SCANOUT flag is not mmapable in amd, whereas going further
for ensuring atomictity related operations are functional, one
needs buffer to be mmap'd.
These flags shall be used to strike balance in enabling
AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED on amd and mmap X-tiled buffers
on Intel platforms.
BUG=b:65297611, chromium:777706
TEST=On Kahlee,
UI comes up.
GLMark2 & GLbench autotests show no performance regression
atomictest -t multiplanes passes
WebGL Aquarium
Change-Id: I582452d331f4a05106939447784a76eba06d13c2
Reviewed-on: https://chromium-review.googlesource.com/758618
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Allow allocations with BO_USE_PROTECTED.
Moreover, disallow mapping of such BOs, as for GBM/Gralloc API callers
it should not be mappable and considered as metadata alone, without
usable content.
BUG=b:64323695
TEST=emerge-eve arc-cros-gralloc
Change-Id: I1dd1846a2042f97eee2fcc7581a91a60854e62cc
Reviewed-on: https://chromium-review.googlesource.com/607808
Commit-Ready: Pawel Osciak <posciak@chromium.org>
Tested-by: Pawel Osciak <posciak@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Add a new GBM usage flag for buffers used a output for camera subsystem.
It corresponds to Android GRALLOC_USAGE_HW_CAMERA_{READ,WRITE} flags and
translates to the same BO_USE_HW_CAMERA_{READ,WRITE} flags of drv.
BUG=b:62358788
TEST=compile
Change-Id: Ib7063437e39d1e08f643763c6ce383ce8657f5ce
Reviewed-on: https://chromium-review.googlesource.com/560935
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Ricky Liang <jcliang@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Chromium passes in no flags to gbm_bo_create() to indicate the buffer will be
used as a texture. This convention has caused confusion in the past.
CL:448251 introduced BO_USE_TEXTURE, so it makes sense to match the more
explicit internal semantics.
TEST=run mapped_texture_test -f NV12 of drm-tests package on amd64-generic
BUG=chromium:683347
Change-Id: I40782763d125e640b4bb6a157035b17ebc32cc8c
Reviewed-on: https://chromium-review.googlesource.com/546884
Commit-Ready: Dongseong Hwang <dongseong.hwang@intel.com>
Tested-by: Dongseong Hwang <dongseong.hwang@intel.com>
Reviewed-by: Dongseong Hwang <dongseong.hwang@intel.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This adds support for allocating AFBC (ARM FrameBuffer Compression)
buffers with minigbm for Rockchip SoCs. AFBC buffers are allocated
through the new gbm_bo_create_with_modifiers() entry point. Callers are
responsible for determining which modifiers are valid for the intended
use case and pass in that list. gbm will then pick the optimal modifier
and allocate a buffer with that layout. The chosen modifier can be
queries through gbm_bo_get_format_modifier().
Callers of the new entry point are expected to forward the modifier when
using the buffer with other APIs (EGL, KMS etc). The old gbm_bo_create()
entry point continues to work as before and won't allocate AFBC buffers.
BUG=chrome-os-partner:56407
TEST=drm-tests null_platform_test with AFBC support
Change-Id: I1aa345b0d79c4545b7bfc17e9699ef6ad57c68e2
Reviewed-on: https://chromium-review.googlesource.com/386318
Commit-Ready: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This is helpful for importing multiplanar formats (see b/31999328)
and importing AFBC format modifiers.
BUG=chrome-os-partner:56407
TEST=drm-tests null_platform_test with AFBC support
test_that -b cyan $IP1 graphics_Gbm to check for regressions
Change-Id: If7ed9b54e18069ca69b2dbda2b01d59ce58ebeef
Reviewed-on: https://chromium-review.googlesource.com/401439
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniele Castagna <dcastagna@chromium.org>
This reverts commit bb19d6abec.
This was chumped w/out explanation, and the bots have all been
dead since due to graphics_Gbm check failures. Reverting in
the hope it'll fix things. It can reland via the CQ.
BUG=chromium:654245
Change-Id: I0d88f7731e9e90fffee1485056d787430eb0b850
Reviewed-on: https://chromium-review.googlesource.com/395727
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
BUG=chrome-os-partner:56407
TEST=drm-tests null_platform_test with AFBC support
Change-Id: If7ed9b54e18069ca69b2dbda2b01d59ce58ede0b
Reviewed-on: https://chromium-review.googlesource.com/387145
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Trybot-Ready: Kristian H. Kristensen <hoegsberg@chromium.org>
We want to add gbm_bo_map/gbm_bo_unmap entry points so certain tests
and Chrome can use driver specific map logic. This is based on the
upstream entry points in Mesa, with the addition of a plane parameter.
Currently, we just map the entire buffer and don't attempt to do partial
mappings or use the map flags. We should do this in the future...
BUG=chromium:653284
TEST=minigbm builds
Change-Id: I0423c10c55bab8fac6d6d7c6a699ab71b43aa61b
Reviewed-on: https://chromium-review.googlesource.com/393927
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
To pass the surface format parameters to EGL, we add format modifiers
which are used for dmabuf import. The vendor ID definitions are copied
from drm_fourcc.h.
BUG=chromium:478339
TEST=none
Change-Id: Ida3e6787b29af73ff534c054006f93c3bad4c5b9
Signed-off-by: Vince Hsu <vince.h@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/346365
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
The presence of this enum makes mistakes handling gbm formats very easy
to make. With this patch, no new code can use this enum. Any old code
that tries will see errors.
BUG=None
TEST=drm-tests
CQ-DEPEND=CL:343592
Change-Id: If3b19975a137928965f14bad26d1e895dd839810
Reviewed-on: https://chromium-review.googlesource.com/343528
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Haixia Shi <hshi@chromium.org>
There are no users of this flag, and the only thing it is defined to
affect is gbm_bo_write, which has no implementation. I suspect this is a
leftover from the original gbm that is no longer needed.
This also removes the declaration of gbm_bo_write to keep others from
thinking minigbm actually implements it.
BUG=None
TEST=minigbm still builds
Change-Id: I0b72efa14208b32e924292cef957273359c7d40b
Reviewed-on: https://chromium-review.googlesource.com/331289
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Some drivers will enable tiling with the other GBM_BO_USE_* flags as an
optimization, but this interferes with reading/writing to mmapped
buffers and other devices that might expect linear buffers.
This CL adds an explicit request to minigbm to only allocate linear
buffer objects. This request is only honored for buffers that meet all
the following requirements:
- YUV formats or ARGB/XRGB 32-bit formats.
- Not combined with GBM_BO_USE_RENDERING
A backend might still reject an allocation even if it meets those
requirements.
This CL also raises the limit on the number of driver formats to 16.
TEST=on samus, run vgem_fb_test with GBM_BO_USE_LINEAR flag in
gbm_bo_create
BUG=None
Change-Id: I8ca31c4c1753af816b13bd75e4feb5b76d153e2a
Reviewed-on: https://chromium-review.googlesource.com/329248
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Enable NV12 format on Exynos.
BUG=chromium:368775
TEST=HW video overlay works on snow and peach_pi
Change-Id: Ia149618fa086b9ba3ef998149c3557052833e33b
Signed-off-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/318550
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
If GBM_BO_USE_RENDERING flag is passed, allocate tiled buffers. Add logic
to the Tegra backend to compute tiled buffer dimensions and tiling
parameters (kind and block height).
The tiling parameters must somehow be passed to EGL at EGLImage creation.
The long term plan is to introduce an extensible structure that can contain
arbitrary vendor specific metadata. For now, we abuse the PITCH attribute
to pass tiling parameters.
Add a new GBM utility function gbm_bo_get_stride_or_tiling, which returns
either the tiling parameters or byte pitch, depending whether the buffer
is tiled or not.
The Nvidia term for our tiled layout is "blocklinear".
BUG=None
TEST=null_platform_test on Tegra
Change-Id: I4e0226efa401b08f7e4a009a7f74b3453c622a10
Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/236663
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Minigbm is a gbm implementation for a few DRM targets. Currently the
targets are:
- cirrus
- exynos
- gma500
- i915
- rockchip
- tegra
- udl
Right some targets are controlled with GBM_{TARGET} flags. I would
like to get to a place where we can just build all the targets in a
single library, but we need the drm headers for all targets for that
to happen so this needs more thinking.
BUG=chromium:394868,chromium:402597,chromium:413947,chromium:412508
TEST=unit tests, which I will need to import later
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Change-Id: I36ae07f2a59827a807e19e1432891ca196b28803
Reviewed-on: https://chromium-review.googlesource.com/218030