Commit graph

23 commits

Author SHA1 Message Date
dawnhan
56f157bb8a minigbm: add unit test for minigbm public apis
This is the first change to add unit tests for the public APIs in
minigbm.
Only tests 3 APIs here for now, and just added some very simple input
for each api testing.

The ultimate goal would be cover more APIs and the input combinations.

BUG=b:304380938
TEST=cros_workon_make --board=guybrush minigbm --test
TEST=cros_run_unit_tests --board guybrush --packages "minigbm"
TEST=CQ

Change-Id: Id15806b7bc6cd9c4764bf08becec6546d72bb117
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4923791
Commit-Queue: Dawn Han <dawnhan@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Dawn Han <dawnhan@google.com>
2024-01-30 20:59:57 +00:00
Chung-Sheng Wu
9af6092317 minigbm: Install minigbm_helpers.h
Install the header for others to use it.

BUG=b:175246639, b:240390351
TEST=emerge-zork minigbm

Change-Id: Ib6cc8055aaace23132634c2478ae8c586340e806
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3780065
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Chung-Sheng Wu <chungsheng@google.com>
Auto-Submit: Chung-Sheng Wu <chungsheng@google.com>
Tested-by: Chung-Sheng Wu <chungsheng@google.com>
2022-08-03 09:12:36 +00:00
Yiwei Zhang
dc74898d1c minigbm: cleanup exynos backend leftovers
BUG=b:199524294
TEST=CQ

Change-Id: I9a82304247bd506b24e08219fc359874f39fd221
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3214692
Reviewed-by: Chia-I Wu <olv@google.com>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
2021-10-12 02:45:09 +00:00
Dennis Kempin
94a69bd0bf Add static library to Makefile
These are used when building minigbm for crosvm for unit and integration
tests. See: https://crrev.com/c/3141771

BUG=b:196059146
TEST=make CC_STATIC_LIBRARY(libminigbm.pie.a)

Change-Id: I819fcd2f3ec4969139825ffdc323e54e8b2eeab9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3141018
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-09-07 19:22:40 +00:00
Rob Clark
e48e4d7e58 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>
2020-08-10 15:50:39 +00:00
Satyajit
cdcebd879c minigbm: using dri extensions
addrlib dependency removed. dri extensions are called instead.
dri.c/dri.h implements the generic dri extensions call.
amdgpu.c implements amdgpu specific.

BUG=b:72972511
TEST=Chrome booted to UI and passed graphics_Gbm autotest

Change-Id: Ia0edec7752a258fe2f70bc4838dac6398d46def2
Signed-off-by: Satyajit <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/863723
Commit-Ready: Satyajit Sahu <satyajit.sahu@amd.com>
Tested-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2018-04-16 09:20:20 -07:00
Jeremy Grosser
7cfcc285d9 minigbm: Enable vc4 driver
BUG=None
TEST=graphics_Gbm on target board

Change-Id: Id92466354e644f9237f8c19aebd0534c1b23bbc0
Reviewed-on: https://chromium-review.googlesource.com/989301
Commit-Ready: Jeremy Grosser <jeremy@synack.me>
Tested-by: Jeremy Grosser <jeremy@synack.me>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2018-04-02 20:12:49 -07:00
Sergey Volk
6eca36809e Rename amlogic backend in minigbm into meson
The name of Amlogic DRM driver in kernel is "meson", so rename it in
minigbm to match that.

BUG=internal b/74248568
TEST=run ozone_demo on device

Change-Id: If2ef376715231f0b3c9fe320177d0e82d94214f0
Reviewed-on: https://chromium-review.googlesource.com/951912
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Alex Sakhartchouk <alexst@chromium.org>
Tested-by: Sergey Volk <servolk@chromium.org>
2018-03-08 22:08:35 +00:00
Gurchetan Singh
08052344f5 minigbm: add amlogic backend
Add dumb amlogic backend based on udl.

BUG=none
TEST=emerge-falco minigbm

Change-Id: I435d0924d8206b4058b76bf403175f9b2cbb1291
Reviewed-on: https://chromium-review.googlesource.com/861865
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Sergey Volk <servolk@chromium.org>
2018-01-12 14:31:15 -08:00
giri
3f25951570 Added radeon backend for minigbm
This is useful for amd/radeon cards
based on gpu architecture preceding GCN 1.2

BUG=none
TEST=none

Change-Id: I54f1c84157ce691da1b595cb859dfca357d0b171
Reviewed-on: https://chromium-review.googlesource.com/593634
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Giri Kumar <giri@flintos.io>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2017-08-04 02:35:55 -07:00
Gurchetan Singh
cc015e8b84 Revert "minigbm: i915: libdrm-ize backend"
As per offline discussion, libdrm_intel doesn't maintain cache coherency
correctly for a number of edge cases.

The plan is to:

1) Revert the libdrm CL.
2) Use simpler mmap/unmap logic to deal CTS failures.
3) Use explicit flush to deal with coherency.

CQ-DEPEND=CL:454105

This reverts commit 82a8eedaa5.
Conflicts: i915.c

Change-Id: I6c0bf746b71ea08f5cf4f1aa80d17d28b26ec4c6
Reviewed-on: https://chromium-review.googlesource.com/454104
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
2017-05-01 12:20:01 -07:00
Gurchetan Singh
82a8eedaa5 minigbm: i915: libdrm-ize backend
With cros_gralloc enabled, the following three CTS tests fail with an i915
backend:

EncodeVirtualDisplayWithCompositionTest#testRendering800x480Locally
EncodeVirtualDisplayWithCompositionTest#testRenderingMaxResolutionRemotely
EncodeVirtualDisplayWithCompositionTest#testVirtualDisplayRecycles

The reason for the failures is the bo_map() function calls
DRM_IOCTL_I915_GEM_MMAP_GTT with untiled buffers, leading to
Surface::dequeueBuffer not completing in time.

In addition, we never set the domain when we map, which can lead to
cache coherency issues.

libdrm already has functions for regular and GTT mapppings, so let's just
add it here rather than duplicating the logic.

TEST=Chrome boots and container boots
     gbmtest, tiled_bo_test, all CTS tests specified in go/arc++gfx pass
BUG=chromium:616275
CQ-DEPEND=CL:424674

Change-Id: I68943367205abd3b470adb0597109fe30aa3e381
Reviewed-on: https://chromium-review.googlesource.com/424832
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2017-01-13 01:19:09 -08:00
Stéphane Marchesin
3aa3dc8bf3 minigbm: Move c99 flag from CPPFLAGS to CFLAGS
It has nothing to do with the preprocessor.

BUG=none
TEST=builds

Change-Id: Ib5c851b0127d36bf52cce1e5c81cfed0eb3b541d
Reviewed-on: https://chromium-review.googlesource.com/415112
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2016-12-13 17:51:10 -08:00
Ricky Liang
fe46031f72 minigbm: Compile with large file support
On device with 32-bit userspace on 64-bit kernel we need to make
sure mmap64 is used to import buffer, or the call may fail because
of invalid offset.

BUG=None
TEST=Use libgbm to import drm_gralloc buffer on Elm.

Change-Id: I1b70d105e6f135d8fa534fb99cad266eed910ea9
Reviewed-on: https://chromium-review.googlesource.com/405147
Commit-Ready: Ricky Liang <jcliang@chromium.org>
Tested-by: Ricky Liang <jcliang@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2016-11-09 09:41:31 -08:00
Akshu Agrawal
0337d9b380 minigbm: Add AMDGPU minigbm driver
Add a minigbm driver to support the AMDGPU drm.

BUG=chrome-os-partner:56076
TEST=emerge-jadeite minigbm and test UI

Change-Id: I395bba57998d95074bd13a379d62d6bec888154b
Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/368101
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2016-10-01 00:04:27 -07:00
Gurchetan Singh
46faf6bf43 minigbm: Refactored minigbm on top a private API
We would like to reuse the same set of drivers for ChromeOS (with
a minigbm frontend) and Android (with a gralloc frontend).  Since
we don't want to pollute the gbm API with gralloc formats and usages,
we can refactor minigbm on top a private API that will be a superset
of gbm and gralloc.  This change redirects gbm calls to the
private API.

TEST=Ran graphics_Gbm on minnie and cyan, and checked if Chrome boots.
BUG=chromium:616275

CQ-DEPEND=CL:367791

Change-Id: I50d10f9d6c7ea936b0d76c5299a58d948939fdf9
Reviewed-on: https://chromium-review.googlesource.com/367780
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2016-08-12 22:44:40 -07:00
Michael Spang
de93efd0ef minigbm: Set library soname to libgbm.so.1 during link
The soname needs to match mesa exactly. The actual library is installed
as libminigbm.so.1.0.0 - this filename does not matter, and it is
probably better to be specific.

BUG=chromium:446653
TEST=chrome built against mesa boots with minigbm &
 chrome built against minigbm boots with minigbm

Change-Id: Id031cc1eb63ab27df57ef9e0313994723e24987c
Reviewed-on: https://chromium-review.googlesource.com/244782
Reviewed-by: Haixia Shi <hshi@chromium.org>
Tested-by: Michael Spang <spang@chromium.org>
Commit-Queue: Michael Spang <spang@chromium.org>
2015-01-30 23:04:33 +00:00
Dominik Behr
59c7fe7c33 rename pc file from libgbm.pc to gbm.pc to match mesa
BUG=none
TEST=emerge-$BOARD minigbm

Change-Id: I640b12bd31b7f93287600a636324adc8f4432dca
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/229186
2014-11-12 03:54:03 +00:00
Dominik Behr
91b25f83c7 fix the test for environment variables
BUG=none
TEST=emerge-$BOARD minigbm
CQ-DEPEND=CL:220465

Change-Id: I1f594e5504e85e4f60d2143d21425899e2bd00e6
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220480
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2014-09-30 08:32:23 +00:00
Stéphane Marchesin
eeac2ff6d3 Include libdrm_* headers propertly
We don't want to use the misc. platform-specific libdrms, but we
still need the headers for the ioctl definitions and such. So let's
react to the GBM_* flags and use pkg-config to find the path to those
headers.

BUG=chromium:412508
TEST=emerge-daisy_freon minigbm

Change-Id: Ie8e1812fc0cebbc025d9c57a9032541c6a7e6da0
Reviewed-on: https://chromium-review.googlesource.com/219010
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2014-09-19 02:31:53 +00:00
Stéphane Marchesin
8c7039c8a9 Support pkg-config
Let's add pkg-config and install headers since this is needed for
ozone to build with a gbm platform.

BUG=chromium:394868,chromium:402597,chromium:413947,chromium:412508
TEST=emerge minigbm, then try pkg-config-board --libs --cflags. Rejoice that it works!

Change-Id: I94a26b1986db76e2d0dad638feda80ec10f48a9f
Reviewed-on: https://chromium-review.googlesource.com/218979
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2014-09-19 02:31:44 +00:00
Stéphane Marchesin
85afac436d Use libdir from the ebuild
Instead of overriding with our own, let's use the libdir passed down
from the ebuild.

BUG=none
TEST=emerge minigbm

Change-Id: Ic38fd538add6d4c85e502b9dc0feeabaa8378e2e
Reviewed-on: https://chromium-review.googlesource.com/218978
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2014-09-19 02:31:33 +00:00
Stéphane Marchesin
25a2606a25 Import minigbm
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
2014-09-13 01:34:56 +00:00