Primary responsibilities of this class are:
1. Send composition/mode/active state over DRM atomic commit IOCTL
to the kernel
2. Track commit state and keep planes owned by the Pipeline while they
are either displayed or staged for displaying.
3. Keep framebuffers alive while they are in use or staged.
Not much related to composition itself, therefore rename it to
DrmAtomicStateManager and move it to drm folder.
Bump clang-tidy level of DrmAtomicStateManager.c to normal by fixing
minor clang-tidy findings.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
We are not testing it for more than year, therefore it's better
to use generic logic for 'rcar-du' instead.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Create systematic way of binding DRM objects (Crtc,Encoder,Planes...)
to the pipeline using RAII. Use it to create the pipeline.
+ Allow pipeline creation to fail.
Closes: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/14
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
... to reduce complexity of DrmHwcTwo.* files.
Bump-up tidy level of new files to NORMAL (fix function naming,
add NOLINT, etc.)
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
... to reduce complexity of DrmHwcTwo class.
Create "hwc2_device" directory that will be later used to fit
all frontend-related code.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
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>
1. DRM event listener doesn't work in this conditions, uevent blocks
the thread and non-blocking select() doesn't make any sense.
Remove DRM event handling for now.
2. UEvent listeren is common for all DrmDevices, therefore put it into
ResourceManager class.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
DRM framebuffer objects must be kept registered in DRM/KMS
while used for scanning-out (After atomic commit applied
for processing by display controller and until next atomic
commit is applied for processing).
Existing logic for tracking current state is overcomplicated and
needs to be redesigned. Also further developing of drm_hwc will
require migration to asynchronous atomic commit, so additional
asynchronous FB cleanup logic must be created.
Buffer caching logic will also benefit from this.
With the RAII all further changes will be less painful and more robust.
By this commit I also renamed DrmGenericImporter to DrmFbImporter:
'Fb' word is present in most of existing composers (android and linux)
so it will be easier to compare different implementations.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
pixel_stride is used only to validate buffer when importing using
GraphicBufferMapper::importBuffer() method.
The problem is we can't always get this value from buffer_handle_t.
Libdrm and MapperMetadata getters can only calculate this value based
on byte stride and buffer format. But this calculation isn't always
possible, which causes importBuffer() to fail.
Instead we can use GrallocMapper::importBuffer() method,
which doesn't require to validate the buffer.
This commit is not compatible with Android-P.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Motivation:
Platform term meaning used in drm_hwcomposer does not correspond to the
content of the platform directory. Platform directory consists of:
1. Buffer information getters for different gralloc (currently called platform).
2. Composition planner logic (which has flaws and should be reworked into
layer->plane mapping during validation stage logic).
3. DrmGenericImpoter with reference counting logic.
Android-11 IMapper@4 metadata API offers a generic way to access buffer
information which makes other gralloc buffer information getters obsolete.
Legacy getters should be maintained for some time until all known users
will migrate to Mapper@4 API.
Implementation:
1. Split 'PlatformImporter' logic to 'Importer' only and 'Buffer Getter' logic.
a. Remove buffer_handle_t parameter from ImportBuffer(). Instead user should
get BufferInfo using ConvertBoInfo to struct hwc_drm_bo_t, then use it for
ImportBuffer().
b. Move DrmGenericImporter.{cpp/h} into the drm directory.
2. Isolate planner code in single file and move it to compositor directory as
compositor/Planner.{cpp/h}
3. Rename platform definition
a. Rename platform directory to bufferinfo.
b. Rename/move bufferinfo/platorm*.{cpp,h} getters to
bufferinfo/legacy/BufferInfo*.{cpp,h}. Align class names/includes.
4. Split legacy/metadata getters logic.
a. Apply existing bufferinfogetter base class only for legacy getters.
b. Combine legacy/generic gettera under new base class.
c. Create a placeholder for generic(metadata) getter.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
This platform handler is dedicated for the i500 MediaTek SoC [1].
i500 has a Mali-G72 MP3 GPU.
OpenGL/Mali integration is based on ARM Gralloc module, version
BX304L01B-SW-99005-r20p0-01rel0, without additional patches.
This platformmediatek is based on platformmeson, without the additional
usage flag in the private_handle_t.
AFBC support has also been removed as it's unsupported.
External Android.bp file should be created in order to build this
module:
```
cc_library_shared {
name: "hwcomposer.drm_mediatek",
defaults: ["hwcomposer.drm_defaults"],
srcs: [":drm_hwcomposer_platformmediatek"],
whole_static_libs: ["drm_hwcomposer"],
}
```
[1] https://www.mediatek.com/products/AIoT/i500
Change-Id: I3ea7a980d76ba5c5ff583b5d4f21e1989875bafb
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
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
... to improve navigation between source/header file.
Unnecessary dependencies also removed.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I2c3bf993b8c5f356490433fd94e90011487a1276
ABGR8888 pixel format and layer scaling are unsupported for rcar-du
platform.
Handle and filter out the layers by overriding the IsClientLayer method
for additional checks. That will force layers that require scaling or have
the unsupported pixel format to be merged by GPU, and allow other layers
to be merged by DRM.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
This display backend may be chosen by setting the hwc.backend_override
system property to the "client" value.
Suggested-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com>
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
Different DRM/KMS backends have a variable set of limitations, which is
not always exposed via DRM ioctls.
This implementation of backend-dependent validation provides a register
of platform-specific inherited backend class to the map by BackendManager
class. ValidateDisplay function is moved to generic backend
implementantion and separated into 2 additional methods.
The map key is a string that contains the corresponding DRM driver name.
During DrmHwcTwo class initialization the vendor.hwc.backend_override
system property and driver name will be checked and a backend will be set
for the appropriate display. If the map does not have any backend for the
named driver, the generic backend will be used.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
PLATFORM_SDK_VERSION is needed for already present
code (GetDisplayIdentificationData/GetDisplayCapabilities),
which implements some of the android.hardware.graphics.composer@2.3 API.
Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I1a5019e9d8ae327db41f55cee0ba3636f913928f
External Android.bp file should be created in order to build this module:
```
cc_library_shared {
name: "hwcomposer.drm_imagination",
defaults: ["hwcomposer.drm_defaults"],
srcs: [":drm_hwcomposer_platformimagination"],
whole_static_libs: ["drm_hwcomposer"],
shared_libs: ["libion"],
include_dirs: [
"path/to/imgtec/include/files",
],
}
```
libion is needed to make ion.h header visible `linux/ion.h`.
Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
This specific platform handler is dedicated for the Amlogic SoC,
and more precisely for the Amlogic G12A family.
OpenGL/Mali allocation is done via a slightly modified ARM Gralloc
module, thus needing a custom platform handler to handle the custom
private_handle_t structure.
This platformmeson is based on platformhisi without the AFBC YUV
management (not handled by the Amlogic SoCs).
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Change-Id: I1a1d20b0a84b0e17aa3417c8e9633712f258523d
Prevent external/drm_hwcomposer from referencing device/linaro/hikey,
which may not exist in all trees, by compiling most of drm_hwcomposer
as a static library and then compiling just the source files that
are affected by device-specific #defines and #includes in
device/linary/hikey/gralloc*.
Fixes: 129543119
Test: m hwcomposer.drm_hikey hwcomposer.drm_hikey960 MODULES-IN-external-drm_hwcomposer
Change-Id: I800b147a40c4e368ce1a74273728f5941f6b63c4
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
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>