Commit graph

9 commits

Author SHA1 Message Date
Dawn Han
a845b4c157 minigbm: clean up legacy gbm_get_default_device_fd usage
`gbm_get_default_device_fd` is no longer used externally. It became a
helper function for `minigbm_create_default_device`. So we are no longer
need to expose it as PUBLIC.

BUG=b:267219693
TEST=manual check that the function works

Change-Id: I7109f27e843ee6a86e998c1dc9c2f2a5ff807997
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4308055
Commit-Queue: Dawn Han <dawnhan@google.com>
Tested-by: Dawn Han <dawnhan@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
2023-03-09 05:06:53 +00:00
Yi Xie
fa8ea877d3 minigbm: Drop DRM master if taken by accident on primary node
On display-only DRM devices (e.g. vkms) we have to use primary node for
GBM, which is used by cros-camera. However, if cros-camera is started
before Chrome, it automatically takes over DRM master via minigbm,
blocking Chrome from starting.

Since we don't actually need any DRM master ioctls in minigbm (it works
on render nodes anyway), we'd like to drop it whenever it's taken by
accident.

BUG=b:239110721
TEST=On VM with vkms: stop ui -> restart cros-camera -> start ui

Change-Id: I66d60210e221dad9450ecd1eea939bd1d7813bbd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4290730
Commit-Queue: Yi Xie <yixie@chromium.org>
Tested-by: Yi Xie <yixie@chromium.org>
Reviewed-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Chia-I Wu <olv@google.com>
2023-02-28 07:24:00 +00:00
Yiwei Zhang
b377924a7b minigbm: format fix and add missing header
BUG=n/a
TEST=build

Change-Id: Id2dac9a25190ba8ee05f42ef3a4ff8a1e3965844
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4269511
Reviewed-by: Satoshi Niwa <niwa@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
2023-02-20 22:49:46 +00:00
Chia-I Wu
52fca9c2cd minigbm: add minigbm_create_default_device helper
Variants of minigbm_create_default_device are open-coded in multiple
places.  This should be used wherever minigbm can be assumed.

BUG=none
TEST=manual check that the function works

Change-Id: I3ad9897355ab72080fdca329674df09087b9adfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4163418
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Chia-I Wu <olv@google.com>
Commit-Queue: Chia-I Wu <olv@google.com>
2023-02-06 22:54:56 +00:00
Yiwei Zhang
9e89e0fc3d minigbm_helper: close the opened dir
BUG=b:205774533
TEST=no leak

Change-Id: I169dbf05f40f90266620a4b5cf0a8b7bb3c79d9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3282826
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olv@google.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
2021-11-16 00:18:15 +00:00
Nathan Hebert
5141a19052 minigbm: Remove Tegra support.
Background:
Tegra K1 (nyan) boards are not longer supported by ChromeOS. The last
compatible device stopped receiving updates after 2020-08-01.

ChromeOS code developed for this board can be removed.

Changes:
* Remove Tegra minigbm handler and plumbing.

Bug: b/180870522
Change-Id: I288b292fa8c85c17e9df1e65b0bf3295b56cb8a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2782243
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Fritz Koenig <frkoenig@chromium.org>
2021-03-25 17:17:21 +00:00
Gurchetan Singh
cadc54fe5d minigbm: consistent style
- Sometimes were return -1 and sometimes -errno.  Prefer -errno
  wherever possible.
- No braces for single line if/else statements.  This does not
  apply gralloc3/gralloc4, since that directory follows AOSP
  style.

BUG=b:178495907
TEST=Cuttlefish CFI

Change-Id: I4c35768e015109730772a972b4b18e8d2c3cbb9b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2665001
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
2021-02-03 04:22:38 +00:00
Dennis Kempin
bfd38d3e80 Fix amdgpu_drm/radeon_drm.h include paths
The paths work in the cros build environment, but not when building
on debian (which keeps them in libdrm/*).
The Makefile already takes care of adding the appropriate include
path, so we can just refer to the files directly.

Note: We do compile minigbm on debian for our Kokoro builder that
tests crosvm changes before the CQ.

BUG=None
TEST=CQ Dry Run

Change-Id: I766d14377941b2602df3c117055e17144af51b25
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2643162
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-01-22 19:58:23 +00:00
Dominik Behr
8ff2bf873f minigbm: add helper function for detecting DRI devices
and discovering "default" device.

These are utility functions to help virglrenderer and possibly other clients
enumerate and discover DRI devices. They can be improved separately from
virglrenderer.

BUG=b:175246639
TEST=build and run together with virglrenderer change

Change-Id: I86c3e68cdab5a824184e744c4c90fb7daa316377
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2583188
Tested-by: Dominik Behr <dbehr@chromium.org>
Auto-Submit: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Dominik Behr <dbehr@chromium.org>
2021-01-16 08:01:01 +00:00