1
0
Fork 0
Commit graph

23 commits

Author SHA1 Message Date
Andrew Wolfers
9255d0d10b drm_hwcomposer: Migrate to android::drm_hwcomposer namespace
Change-Id: I2859aa8f55532d88231389724956fc77b0625339
2025-09-08 18:53:00 +00:00
Roman Stratiienko
5742bcb285 drm_hwcomposer: Enable performance-avoid-endl clang-tidy check
And fix every related warning.

Change-Id: I6afacef19ac04269245ef687762698be057d420b
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2025-01-24 23:44:00 +02:00
Vilas Bhat
407362538c drm_hwcomposer: Remove hardcoded PAGE_SIZE usage in gralloc_helper
Use getpagesize() to make drm_hwcomposer work with multiple page sizes.
This benefits Android as AOSP no longer relies on bionic's PAGE_SIZE
macro.

Change-Id: I9af7436ac9ca6c052f67cdd296a960b51b8ba67a
Signed-off-by: Vilas Bhat <vilasbhat@google.com>
2024-03-27 14:00:10 -07:00
Roman Stratiienko
bdc4382f8b drm_hwcomposer: Fix missing dependency in hwc-drm-uevent-print
Error:
ld.lld: error: undefined symbol: android::MakeUniqueFd(int)

Fixes: 76892784ac ("drm_hwcomposer: Introduce SharedFd, use standard c++ RAII for UniqueFd")
Closes: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/77
Change-Id: I6d37ff15b002cc49159a239393e18a8ca5b3cb27
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2023-06-27 21:29:44 +03:00
Roman Stratiienko
14bc764de0 drm_hwcomposer: Remove utils/worker from the project
utils/worker is no longer used and can be removed.

Change-Id: I5fc9bd2b3b8b0375622ee2446044d3b893756b30
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2022-12-28 19:18:34 +02:00
Roman Stratiienko
4dfa62d825 drm_hwcomposer: Use header library instead of hardcoded path
This allows to put drm_hwcomposer in any directory.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2022-11-16 16:51:06 +02:00
Roman Stratiienko
a7913de518 drm_hwcomposer: CI: Bump-up clang toolchain to v15
Address new clang-tidy findings, in most cases 'misc-const-correctness'
check was addressed by adding 'const' modifier, or in some cases changed
to 'auto' (where it's better for formatting).

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2022-10-20 14:14:33 +03:00
Roman Stratiienko
4b2cc484f9 drm_hwcomposer: Reorganize struct DrmHwcLayer
1. Move BlendMode, ColorSpace, SampleRange fields to the struct BufferInfo,
   allowing extraction of the data from native_handle using Metadata@4 API.
   Use it when data from HWC2 API can't be used (Currently it's a BlendMode
   case for CLIENT layer)

2. Rename DrmHwcLayer to LayerData and move it to compositor/ directory.
   (I was confused in the past because of similarity of names DrmHwcLayer
    vs HwcLayer, so this step should meke it easier for newcomers to
    understand the code)

3. Allow clonning of the LayerData to propagate it through the composition
   pipeline. Thus LayerData can be used by both HwcLayer to track state
   and by the compositor.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-05-17 11:20:44 +03:00
Roman Stratiienko
bd9731713b drm_hwcomposer: Add test utility to listen for uevents
Dumping uevents is useful for debugging purposes.

1. Extract logic related to uevent socket into utils/UEvent.h class.
2. Use it by both UEventListener.cpp and tests/uevent_print.cpp.

Bump clang-tidy level of UEventListener.cpp to normal.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-02-18 17:16:00 +02:00
Roman Stratiienko
5621f5fd4c drm_hwcomposer: Use gralloc0::perform API by minigbm bufferinfo getter
Using of internals of cros_gralloc_handle isn't recommended, since
it can be changed at any time. Meanwhile minigbm provides another
API to access buffer information based on gralloc0 perform() call.

ChromiumOS are using this API by mesa3d and other related projects.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-12-06 13:22:34 +02:00
Roman Stratiienko
0ee8f58b93 drm_hwcomposer: Don't use Mapper@4 metadata API for legacy getters
As it turned out Mapper@4 metadata API calls are slow.
Allow using legacy getters again.

Closes: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/56

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-11-10 19:30:54 +02:00
Roman Stratiienko
d21071f7d5 drm_hwcomposer: CI: Increase coverage
Add the following files to the build:
backend/BackendClient.cpp
backend/Backend.cpp
backend/BackendManager.cpp
backend/BackendRCarDu.cpp
bufferinfo/legacy/BufferInfoImagination.cpp
bufferinfo/legacy/BufferInfoLibdrm.cpp
bufferinfo/legacy/BufferInfoMaliHisi.cpp
bufferinfo/legacy/BufferInfoMaliMediatek.cpp
bufferinfo/legacy/BufferInfoMaliMeson.cpp
bufferinfo/legacy/BufferInfoMinigbm.cpp
compositor/DrmDisplayComposition.cpp
compositor/DrmDisplayCompositor.cpp
compositor/Planner.cpp
drm/DrmGenericImporter.cpp
DrmHwcTwo.cpp
drm/ResourceManager.cpp
drm/VSyncWorker.cpp
tests/worker_test.cpp
utils/autolock.cpp

Files 'bufferinfo/BufferInfoMapperMetadata.cpp' and 'utils/hwcutils.cpp' require
a lot of additional headers, therefore move them out of the scope of this commit.

'utils/gralloc.h' isn't planned to use in pure-linux builds, therefore remove
it from 'utils' and put it into '.ci/android_headers/hardware/'

Fix minor tidy fails.

Fix linux build fails (missing includes) due to differences between libc and
bionic.

Comment-out some sections in 'tests/test_include' which aren't used by drm_hwc
but causing build failures for CI due to missing dependencies.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Matvii Zorin <matvii.zorin@globallogic.com>
2021-04-06 12:12:17 +03:00
Roman Stratiienko
d665998333 drm_hwcomposer: CI: Use bpfmt to check Android.bp files style
Fix available errors by executing:
$ find -name "*.bp" -exec bpfmt -d -s -w {} \;

Suggested-by: Marijn Suijten <marijn.suijten@somainline.org>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2021-03-03 12:14:14 +02:00
Roman Stratiienko
e398334e97 drm_hwcomposer: Create make target to test filegroups
Android.bp contains filegroups that are not built by default
(e.g. using $ mmma external/drm_hwcomposer)

Fix it.

To ensure build will work on wide range of Android versions,
pull depended headers from AOSP-11 tree:
1. Mali: "device/linaro/hikey/gralloc960"
2. Imagination: "hardware/ti/am57x/libhwcomposer"
and put it into ./tests/test_include directory.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2021-03-01 13:47:46 +02:00
Roman Stratiienko
13cc3666c6 drm_hwcomposer: use CamelCase in source/header files related to class
Main goal is to increase readability of file names.
AOSP uses camelcase for files in many projects.
Lets do the same for drm_hwcomposer.

Keep platform/ directory as is, since class names is different from file names.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I7e992357851c2a86711f4da1241c4d507359e56b
2020-09-08 22:34:52 +03:00
Roman Stratiienko
aa3cd54562 drm_hwcomposer: move header files into source directory
... to improve navigation between source/header file.
Unnecessary dependencies also removed.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I2c3bf993b8c5f356490433fd94e90011487a1276
2020-09-08 22:34:52 +03:00
Sean Paul
27cd480501 drm_hwcomposer: Organize files into subdirs
This is way overdue

Signed-off-by: Sean Paul <seanpaul@chromium.org>

Change-Id: I1bcbd8fdb0bb03feafd76bc41f6f11c03cdf9c25
2019-06-11 09:38:11 -04:00
Colin Cross
cdf4b49d3f drm_hwcomposer: Convert external/drm_hwcomposer to Android.bp
See build/soong/README.md for more information.

This replaces the product and BoardConfig.mk variable conditionals
with different versions of the HAL for each product, which will
also allow checkbuild to verify that they build even on products
that don't use them.

Fixes: 122332597
Test: mma
Change-Id: I8d2c8ac1bb58dcbc81ae75c2bb2c97d4485909b4
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2019-04-10 09:36:23 -07:00
Rob Herring
cff7b1e829 drm_hwcomposer: remove separate_rects
As part of removing GL compositing, separate_rects.cpp is no long
needed. Use hwc_rect_t and hwc_frect_t in places instead of our own
class.

Signed-off-by: Rob Herring <robh@kernel.org>
2018-05-30 13:31:41 -04:00
Alistair Strachan
104748d677 drm_hwcomposer: Mark tests as vendor, fix build
After commit 94bb596, the tests for drm_hwcomposer no longer build,
because the build system detects that they are linking other vendor
modules (but installing themselves elsewhere).

This change also adds the libhardware include path explicitly, as the
implicit include of hardware/libhardware/include is going away.

Cc: John Stultz <john.stultz@linaro.org>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Sean Paul <seanpaul@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Acked-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Alistair Strachan <astrachan@google.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
2018-05-03 09:43:33 -04:00
Rhys Kidd
f667f805e3
drm_hwcomposer: Enable and refactor Separate Rects test
Plumb through the existing test based on known sample data for the
Separate Rect algorithm via Android's NATIVE_TEST harness.

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
2018-02-28 12:09:11 +01:00
Rhys Kidd
c7a6d27627
drm_hwcomposer: Fix comment on worker_test
Reflect the boolean logic of the accompanying code, which is run after
Worker.InitWorker() has completed in test setup.

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
2018-02-28 11:58:17 +01:00
Adrian Salido
fa37f67815 drm_hwcomposer: refactor Worker
Make use of standard library mutex and conditions which simplifies use
of condition variables and benefits from things like scoped locking.

Also add tests to make sure it runs as expected.

Change-Id: Iaf92e17e1f6757dce490eddee61f84cb1f953b0c
2017-04-25 14:41:03 -04:00