aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-01-20drm_hwcomposer: Remove DrmDisplayCompositor:CreateInitializedCompositionRoman Stratiienko
Remove unused functionality. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-20drm_hwcomposer: Add headless mode supportRoman Stratiienko
Headless mode required to keep SurfaceFlinger alive when all displays are disconnected, Without headless mode Android will continuously crash. Only single internal (primary) display is required to be in HEADLESS mode to prevent the crash. See [1]. [1]: https://source.android.com/devices/graphics/hotplug#handling-common-scenarios Closes: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/57 Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-20drm_hwcomposer: Configuring Composer HAL to use sequential IDsRoman Stratiienko
Implement Google guidelines from [1] 1. The supported display config IDs are: id=1, 1080x1920 60hz id=2, 1080x1920 50hz 2. When a change of display configs is processed, the next set of config IDs are assigned starting from the next unused integer, shown as follows: id=3, 2160x3840 60hz id=4, 2160x3840 50hz id=5, 1080x1920 60hz id=6, 1080x1920 50hz + Don't update modes in GetDisplayConfigs() . Modes is now updated at init or after every hotplug event. [1]: https://source.android.com/devices/graphics/hotplug#configuring-composer-hal-sequential-ids Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-20drm_hwcomposer: Introduce main lockRoman Stratiienko
Further development will require more asynchronous processing. Introduce project-wide single mutex for these purposes. Use it instead for callback handling instead of callback_lock. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-20drm_hwcomposer: Restore HWC2 API logging functionalityRoman Stratiienko
Process and log __PRETTY_FUNCTION__ compiler string. Prints HWC2 API logs as follows: hwc2-device: Display #0 Layer: #0 hook: android::HwcLayer::SetLayerBuffer hwc2-device: Display #0 hook: android::HwcDisplay::ValidateDisplay hwc2-device: Display #0 hook: android::HwcDisplay::GetChangedCompositionTypes hwc2-device: Display #0 hook: android::HwcDisplay::GetChangedCompositionTypes hwc2-device: Display #0 hook: android::HwcDisplay::GetDisplayRequests hwc2-device: Display #0 hook: android::HwcDisplay::GetDisplayRequests hwc2-device: Display #0 hook: android::HwcDisplay::AcceptDisplayChanges hwc2-device: Display #0 hook: android::HwcDisplay::PresentDisplay hwc2-device: Display #0 hook: android::HwcDisplay::GetReleaseFences hwc2-device: Display #0 hook: android::HwcDisplay::GetReleaseFences Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-20drm_hwcomposer: CI: Upgrade to clang-13 && clang-tidy-13Roman Stratiienko
+ address new clang-tidy findings. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-20drm_hwcomposer: Add delay between hotplug uevent and modes getRoman Stratiienko
We need some delay to ensure DrmConnector::UpdateModes() will query correct modes list, otherwise at least RPI4 board may report 0 modes. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-18drm_hwcomposer: Fix missing connector state assignmentRoman Stratiienko
It was accidentally removed by my previous commit. Restore it. Fixes: a148f21336ad ("drm_hwcomposer: Rework display modes handling") Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-14drm_hwcomposer: Add script for quick build and deploy drm_hwcomposerRoman Stratiienko
It should help us with manual testing. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-13drm_hwcomposer: Merge remote-tracking branch 'aosp/upstream-main' into HEADJohn Stultz
This pulls in upstream-main branch for drm_hwcomposer. Particularly important in this update are fixes that resolve regressions seen on HiKey and HiKey960 that I merged before the holiday break, causing some minor havoc. Tons of credit to Roman Stratiienko for quickly resolving the issues I missed. Also credit to Yongqin Liu for catching and reporting these issues. * aosp/upstream-main: drm_hwcomposer: Use DPMS property to configure display pipeline drm_hwcomposer: Move HwcDisplayConfigs out of HwcDisplay class drm_hwcomposer: Move DrmHwcTwo.{cpp|h} to hwc2_device/ directory drm_hwcomposer: Move HwcDisplay out of DrmHwcTwo class drm_hwcomposer: Move HwcLayer out of DrmHwcTwo class drm_hwcomposer: Move hw_module related code out of DrmHwcTwo.* files drm_hwcomposer: CI: Remove -readability-use-anyofallof from COARSE list drm_hwcomposer: CI: Remove duplicate tidy checks drm_hwcomposer: CI: Move tidy FINE checklist to Makefile drm_hwcomposer: Raise clang-tidy level of some files to NORMAL drm_hwcomposer: Fix float to 16.16 fixed point conversion drm_hwcomposer: CI: Find all source files instead of hardcoding them. drm_hwcomposer: Make Planner class fully static drm_hwcomposer: CI: Set clang-tidy level to NORMAL for some files drm_hwcomposer: CI: Raise clang-tidy level from NONE to COARSE for *.h drm_hwcomposer: CI: Process every file with clang-tidy. drm_hwcomposer: CI: Fix Makefile dependencies drm_hwcomposer: Update readability-identifier-naming rules drm_hwcomposer: Free resources in HookDevClose() drm_hwcomposer: Send crtc.active and crtc.mode together with the frame drm_hwcomposer: Remove supported()/unsupported() functions drm_hwcomposer: Modify source_layers_ to be integer instead of array drm_hwcomposer: Cleanup Planner class drm_hwcomposer: Handle unused planes by DrmDisplayCompositor drm_hwcomposer: Rework KMS state tracking drm_hwcomposer: CI: Replace shell scripts with Makefile drm_hwcomposer: CI: Tune clang-tidy coarse checks drm_hwcomposer: Tidy-up the CI scripts drm_hwcomposer: support more connector types Validated on db845c, hikey960 and hikey Signed-off-by: John Stultz <john.stultz@linaro.org> Change-Id: If4a17a763c758c8b05e6057cb0a81146603ab31a
2022-01-13drm_hwcomposer: Use DPMS property to configure display pipelineRoman Stratiienko
Some of KMS drivers like kirin are sensitive to display pipeline configuration, modern kernel will configure the pipeline correctly when user sets DPMS property. To be more precise current compositor logic will not attach primary plane to the CRTC, while kirin relies on it internally. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: Move HwcDisplayConfigs out of HwcDisplay classRoman Stratiienko
To reduce complexity of HwcDisplay class. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: Move DrmHwcTwo.{cpp|h} to hwc2_device/ directoryRoman Stratiienko
To keep all frontend-related files in a single directory. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: Move HwcDisplay out of DrmHwcTwo classRoman Stratiienko
Reduces code complexity. Closes: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/35 Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: Move HwcLayer out of DrmHwcTwo classRoman Stratiienko
... 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>
2022-01-12drm_hwcomposer: Move hw_module related code out of DrmHwcTwo.* filesRoman Stratiienko
... 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>
2022-01-12drm_hwcomposer: CI: Remove -readability-use-anyofallof from COARSE listRoman Stratiienko
We have single fail case of -readability-use-anyofallof. Use NOLINTNEXTLINE comment instead. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: CI: Remove duplicate tidy checksRoman Stratiienko
This improves visibility and helps to distinguish which particular checks are disabled at every level. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: CI: Move tidy FINE checklist to MakefileRoman Stratiienko
To make checklists definitions aligned and allow inheritance. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: Raise clang-tidy level of some files to NORMALRoman Stratiienko
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: Fix float to 16.16 fixed point conversionRoman Stratiienko
Previously, the fractional part was truncated. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: CI: Find all source files instead of hardcoding them.Roman Stratiienko
Goals: 1. Follow clang-tidy rules to maintain project clean. 2. Do not allow new code to break goal #1. Requirements for CI: 1. In case new file appears in the project, it should be picked-up by CI automatically and CI should assign NORMAL clang-tidy check level. 2. CI makefile should have SKIP list to define files for which build by CI is impossible for some reason. 3. CI makefile should have ability to override clang-tidy check level for every file. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: Make Planner class fully staticRoman Stratiienko
clang-tidy suggested to make all methods of Planner static, since they don't use any instance members. This makes creation of Planner instances unnecessary, therefore remove all such cases. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: CI: Set clang-tidy level to NORMAL for some filesRoman Stratiienko
Some of files require small adjustments to move into NORMAL checks list. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: CI: Raise clang-tidy level from NONE to COARSE for *.hRoman Stratiienko
To improve CI coverage. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: CI: Process every file with clang-tidy.Roman Stratiienko
Currently part of header files isn't processed by CI. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: CI: Fix Makefile dependenciesRoman Stratiienko
Previous dependencies relations was triggering FULL 'clang-tidy' re-validation, even in case single source file has changed. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: Update readability-identifier-naming rulesRoman Stratiienko
Sync local rules with github gist [1] revision 7. [1]: https://gist.github.com/airglow923/1fa3bda42f2b193920d7f46ee8345e04 Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: Free resources in HookDevClose()Roman Stratiienko
Composer service won't free memory for us, see [1]. [1]: https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/graphics/composer/2.1/utils/passthrough/include/composer-passthrough/2.1/HwcHal.h;l=83;drc=7ae8af54b32a7eb827dbf9f2aedb647c9525a3d9 Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12drm_hwcomposer: Send crtc.active and crtc.mode together with the frameRoman Stratiienko
On HiKey/HiKey960 boards, enabling the crtc before the first composition is set can cause trouble, as part of the display engine is configured in the atomic plane update method. So when commit 36a7f28516a4 ("drm_hwcomposer: Rework display Mode Setting and DPMS handling"), which reworked the dpms and modeset logic to commit the modeset immediately, landed it caused bootup regressions on those boards. Talking with others it seems other drivers likely may have issues trying to enable the crtc without a plane. Thus this patch changes the logic to queue modesets so they are submitted with the initial composition. Similarly it removes the crtc activation, as the initial composition will implicitly activate the crtc. Fixes: 36a7f28516a4 ("drm_hwcomposer: Rework display Mode Setting and DPMS handling") Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com> [jstultz: Added commit message, reworked a comment] Signed-off-by: John Stultz <john.stultz@linaro.org> Change-Id: Ie4d1f967da052b0b3ef73257c2ca76b30504a6c2
2021-12-29drm_hwcomposer: Remove supported()/unsupported() functionsRoman Stratiienko
Functions was used mostly for logging HWC2 API calls. API calls logging will be re-introduced inside the hook templates in further patches, which will improve logs quality and reduce LOC number. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-12-29drm_hwcomposer: Modify source_layers_ to be integer instead of arrayRoman Stratiienko
It isn't used as an array. Simplify the logic. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com> Tested-by: Martin Juecker <martin.juecker@gmail.com> Reviewed-by: Matvii Zorin <matvii.zorin@globallogic.com>
2021-12-29drm_hwcomposer: Cleanup Planner classRoman Stratiienko
Remove unused code. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com> Tested-by: Martin Juecker <martin.juecker@gmail.com> Reviewed-by: Matvii Zorin <matvii.zorin@globallogic.com>
2021-12-29drm_hwcomposer: Handle unused planes by DrmDisplayCompositorRoman Stratiienko
Rationale: 1. Cleanup/Simplify DrmDisplayComposition class 2. Prepare for shared planes support Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com> Tested-by: Martin Juecker <martin.juecker@gmail.com> Reviewed-by: Matvii Zorin <matvii.zorin@globallogic.com>
2021-12-29drm_hwcomposer: Rework KMS state trackingRoman Stratiienko
1. Store only FrameBuffer shared handle to keep buffer alive while it is a part of active composition. 2. Store used planes to allow clearing of the composition. Before this both of mentioned above was a part of DrmDisplayComposition. Any external modification DrmDisplayComposition caused framebuffer object to be destroyed, which forced screen to go blank. We want to modify DrmDisplayComposition, to allow re-using previous composition data. This change will also help us tracking STAGED frame state and migrate to non-blocking atomic commit. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com> Tested-by: Martin Juecker <martin.juecker@gmail.com> Reviewed-by: Matvii Zorin <matvii.zorin@globallogic.com>
2021-12-22drm_hwcomposer: CI: Replace shell scripts with MakefileRoman Stratiienko
This won't make much benefits for CI, but for local native builds will significantly speed-up build cycle by allowing parallel build and by using dependency tracking logic. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-12-22drm_hwcomposer: CI: Tune clang-tidy coarse checksRoman Stratiienko
1. Switch to "enable all then disable unwanted" strategy 2. Enable checks that causes small number of failes, marking corresponding lines as NOLINT, so we won't introduce new such cases unintentionally. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-12-22drm_hwcomposer: Tidy-up the CI scriptsRoman Stratiienko
1. Use -Wextra instead of multiple -Wxxx arguments. It will turn on remaining checks (such as -Wunused-parameter, which is currently disabled in CI) 2. Bump-up ANDROID_API definitions to 31 3. Fix clang-format-diff-X version to match the one specified in the README.md Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-12-20drm_hwcomposer: support more connector typesYongqin Liu
according to the drm_connector_enum_list defined in the kernel file drivers/gpu/drm/drm_connector.c Otherwise for the new connector type, the connector name will be "None" to be printed in the logcat, like this: 12-13 05:38:06.263 383 383 I hwc-backend: Backend 'generic' for 'None' and driver 'omapdrm' was successfully set with this change, it will be fixed with the connector type like this: 12-13 06:01:57.672 342 342 I hwc-backend: Backend 'generic' for 'DPI-1' and driver 'omapdrm' was successfully set Also updated the internal() and external() functions to make the newly added SPI and USB are valid types Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2021-12-14drm_hwcomposer: Merge remote-tracking branch 'aosp/upstream-main' into HEAD ↵John Stultz
am: 774e5e3432 am: 24ccb88ece am: 42f5da5192 am: 51fd1b6fde Original change: https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/1921343 Change-Id: I1e0f8ce3f2c32662bf03e30249915210075fd1aa
2021-12-14drm_hwcomposer: Merge remote-tracking branch 'aosp/upstream-main' into HEAD ↵John Stultz
am: 774e5e3432 am: 24ccb88ece am: 42f5da5192 Original change: https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/1921343 Change-Id: Iae3684f162cd9e86a0feca58480a2dbcf3f450fe
2021-12-14drm_hwcomposer: Merge remote-tracking branch 'aosp/upstream-main' into HEAD ↵John Stultz
am: 774e5e3432 am: 24ccb88ece Original change: https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/1921343 Change-Id: Ie06bd7b625f697ffea49621c3c41109b04cf36ad
2021-12-14drm_hwcomposer: Merge remote-tracking branch 'aosp/upstream-main' into HEAD ↵John Stultz
am: 774e5e3432 Original change: https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/1921343 Change-Id: I8167d2b1b7c43605a7fd313faa140fdb45a4e451
2021-12-14drm_hwcomposer: Merge remote-tracking branch 'aosp/upstream-main' into HEADJohn Stultz
Includes a number of updates that address CTS failures as well as fixes incorrect alpha issues on hardware planes. By Roman Stratiienko * aosp/upstream-main: drm_hwcomposer: Assume premultiplied alpha for CLIENT layer drm_hwcomposer: Fix all cases which triggers an error on -Wsign-compare drm_hwcomposer: Use gralloc0::perform API by minigbm bufferinfo getter drm_hwcomposer: Validate gralloc0 name for minigbm and libdrm getters drm_hwcomposer: Rework display modes handling drm_hwcomposer: Don't use Mapper@4 metadata API for legacy getters drm_hwcomposer: Make uevent listener standalone drm_hwcomposer: Route release fence directly drm_hwcomposer: Make single atomic function for all atomic commit ops. drm_hwcomposer: Move CreateModeBlob to DrmMode class drm_hwcomposer: Remove DrmDisplayCompositor::GetActiveModeResolution() drm_hwcomposer: Rework display Mode Setting and DPMS handling Many thanks to Roman for all the great work here! Signed-off-by: John Stultz <john.stultz@linaro.org> Change-Id: I0aacd8e3ea7b493133f8e99340e12c43bdf505ae
2021-12-13drm_hwcomposer: Assume premultiplied alpha for CLIENT layerRoman Stratiienko
On db845c, we have seen an odd behavior with modal dialogs in AOSP, where the background which is normally darkened, was rendering as black, though it would occasionally flicker to the right thing. This cropped up after alpha support on planes landed in 5.15, so we assumed it was an edge case issue with the dpu1 driver. But while working on a separate issue seen on x86 hardware: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/46 Roman noticed drm_hwcomposer always sets the blending type to NONE for the client layer. Which had gone un-noticed becase he didn't have any devices that exposed the NONE type. Thus Roman implemented this patch, which sets up the client blend type to PREMULTIPLIED. While it did not resolve the x86 issue above, it does resolve the incorrect rendering seen on db845c with alpha support enabled. Tested-by: Martin Juecker martin.juecker@gmail.com #Exynos 4412 Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Change-Id: I95601c680ca1af0dc9d3b3f102f79f77af081b75
2021-12-07drm_hwcomposer: Fix all cases which triggers an error on -Wsign-compareRoman Stratiienko
Android-9 has -Wsign-compare enabled by default and it causes build issues. Enable -Wsign-compare option in CI, so we won't introduce such issues anymore. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-12-06drm_hwcomposer: Use gralloc0::perform API by minigbm bufferinfo getterRoman Stratiienko
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-06drm_hwcomposer: Validate gralloc0 name for minigbm and libdrm gettersRoman Stratiienko
Using of incorrect gralloc0 results in a runtime issues, with logs like "Cannot convert hal format to drm format <VALUE>" or other. Validate gralloc name and exit gracefully in case it doesnt't match the one we are expecting. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-12-02drm_hwcomposer: Rework display modes handlingRoman Stratiienko
Android likes to adapt display output frequency to match window context frequency. Unfortunately platform code has some limitations, therefore hwcomposer HAL should be careful with reporting supported display modes. Known platform limitations: 1: Framework doesn't distinguish between interlaced/progressive modes. 2. Framework will not switch display frequency in case margin in FPS rate is very small (<1FPS or so). Not a big issue, but that is causing some CTS tests to fail. In addition to that VRR technology (or seamless mode switching) require hwcomposer to group modes which tells the framework that seamless mode configuration change is supported within a group of display modes. By this commit do the following: 1. Group modes by the resolution: E.g. Group 1: 1024x768i@60 1024x768i@90 1024x768@50 1024x768@50.1 Group 2: 1920x1080@60 1920x1080@24.3 1920x1080i@60 1920x1080i@120 2. Disable modes in a way that each group keeps only interlaced or proressive modes enabled. In case KMS reported preferred mode is interlaced - prefer interlaced for the whole group, otherwise prefer progressive. 3. Disable mode in case different mode in the same group has similar frequency with delta less than 1FPS. 4. Report only modes which remain enabled to the framework. Test: atest CtsGraphicsTestCases Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-11-17[automerger skipped] Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918 am: ↵Xin Li
ac850066c3 -s ours am: 163d99edee -s ours am: 8fada8aa90 -s ours am skip reason: Merged-In I302491d47346aa48eebcac6498991fda95f62b58 with SHA-1 a976c15a02 is already in history Original change: https://googleplex-android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/16277420 Change-Id: Ib8f8630cd1c551ecb5bc4b98286733f3ad077d59