aboutsummaryrefslogtreecommitdiff
path: root/drm/DrmPlane.cpp
AgeCommit message (Collapse)Author
2022-01-31drm_hwcomposer: Tidy-up DrmDevice classRoman Stratiienko
1. Move drm/DrmConnector.h to Normal clang-tidy checks list by fixing clang-tidy findings. 2. Remove DrmDevice self-reference. 3. Replace shared_ptr reference to DrmDevice in DrmFbImporter with a pointer, making ResourceManager only owner of DrmDevice and its chilren. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-31drm_hwcomposer: Tidy-up DrmCrtc classRoman Stratiienko
Implement DrmCrtc instantiation through CreateInstance() static method, which helps to reduce complexity of DrmDevice::Init() function. Move CRTC-to-Display binding information to the DrmDevice class. Move drm/DrmCrtc.h to Normal clang-tidy checks list by fixing clang-tidy findings. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-31drm_hwcomposer: Tidy-up DrmPlane classRoman Stratiienko
This allow to throw away few lines from DrmDevice::Init() making it less complicated. 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: 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>
2021-10-23drm_hwcomposer: Move GetPlaneProperty into DrmPlane classRoman Stratiienko
In addition move logging to GetPlaneProperty(), which allow to reduce number of LoC by ~50 LoC and increase readability. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-10-23drm_hwcomposer: Allow pre-multi layer to always pass DrmPlane validationRoman Stratiienko
This logic was removed accidentaly during cleanup. Restore it. Enables hardware-accelerated composition on raspberry-pi 4. Fixes: 5063d53ddf7d ("drm_hwcomposer: Improve handling of blending mode") Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-09-29drm_hwcomposer: Move rotation enum querying into DrmPlane initializationRoman Stratiienko
Benefits: 1. Improve readability. 2. Less logic in runtime slightly reduces overhead on CPU. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-09-29drm_hwcomposer: Cleanup DrmPlane::Init()Roman Stratiienko
Adding enum value into map looks ugly. Create a wrapper in order to fix it. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-09-29drm_hwcomposer: DrmPlane: More atomic commit cleanupRoman Stratiienko
A few rearrangements to reduce LoC and increase readability. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-09-29drm_hwcomposer: Improve handling of blending modeRoman Stratiienko
1. Convert to DrmHwcBlending inside HWC hook. 2. Use map for enum_values for cleaner atomic commit preparation. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-09-29drm_hwcomposer: Query color_encoding and color_range enums during initRoman Stratiienko
Should slightly reduce CPU load at runtime + improve atomic commit readability. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-09-29drm_hwcomposer: Create intermediate enum for colorspace and samplerangeRoman Stratiienko
Part of "frontend" isolation activities. Also allows to additionally simplify atomic commit. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-09-29drm_hwcomposer: Move plane-related atomic commit logic to DrmPlane classRoman Stratiienko
Remove unnecessary property getter/setters from DrmPlane class. As result: Removed ~50 unnecessary LoC. Improved readability. Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-05-19drm_hwcomposer: cleanup hwcutilsRoman Stratiienko
Remove DrmHwcBuffer class. Wrap remaining logic into DrmHwcLayer class. Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2021-05-09drm_hwcomposer: remove unused variable blendBenjamin Li
The first tuple element returned by GetEnumValueWithName is just the index of that enum, which is not useful. Signed-off-by: Benjamin Li <benl@squareup.com>
2021-05-09drm_hwcomposer: reject rotations reported as unsupported by hardwareBenjamin Li
Currently we only check for the presence of any rotation support -- but hardware may choose to, say, only support 180 degree rotation. Respect the specific rotation capabilities reported through DRM properties. Signed-off-by: Benjamin Li <benl@squareup.com>
2021-04-06drm_hwcomposer: Move ValidatePlane method into DrmPlaneMatvii Zorin
It is more common to validate the layer for the proper object. Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
2021-03-03drm_hwcomposer: CI: Add more source files to the buildRoman Stratiienko
Build bufferinfo/BufferInfoGetter.cpp and drm/DrmPlane.cpp Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2021-03-03drm_hwcomposer: clang-tidy: enable cppcoreguidelines-* checksRoman Stratiienko
Our code isn't ready for the following checks therefore keep disabled -cppcoreguidelines-pro-bounds-array-to-pointer-decay -cppcoreguidelines-pro-bounds-constant-array-index -cppcoreguidelines-pro-bounds-pointer-arithmetic -cppcoreguidelines-pro-type-cstyle-cast -cppcoreguidelines-pro-type-vararg -cppcoreguidelines-avoid-magic-numbers -cppcoreguidelines-macro-usage -cppcoreguidelines-avoid-c-arrays + fixed existing tidy warnings for these checks. Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2021-03-03drm_hwcomposer: enable code analysis using clang-tidyRoman Stratiienko
Drm hwcomposer project has some code-style inconsistencies. This is the initial step to unify code-style of the code. Clang-tidy is a great tool which can not only suggest correct styling, but also allow predicting the errors in the code and suggest correct coding approaches to avoid potential weaknesses. CI was tuned to check clang-tidy recommendation for some part of the code which is ready ATM (can be built outside AOSP tree). For this part a limited set of clang-tidy checks has applied (coarse check). Header files aren't checked at all. Starting from now new code files must be included into the list that is checked by almost all clang-tidy checks (fine checklist). New header files should be also included into this list. See '.gitlab-ci-clang-tidy-fine.sh'. Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2021-03-03drm_hwcomposer: CI: Initial build and clang-tidy checksRoman Stratiienko
Build android-agnostic code in linux environment. Enable static code analysis using clang-tidy. Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2021-01-30drm_hwcomposer: Add support for color encoding and range propertiesMatvii Zorin
Starting from the linux-v4.17, the DRM module has support for different non-RGB color encodings that are controlled through plane-specific COLOR_ENCODING and COLOR_RANGE properties. This patch creates a matching between the HWC layer dataspace which is supported by DRM driver and DRM plane properties. Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
2020-09-25drm_hwcomposer: Add supported formats list to DrmPlaneRoman Kovalivskyi
There are some use-cases for checking formats supported by given plane. drmModePlane already contains reqired data, so it simply could be saved into DrmPlane, no need to query any additional stuff. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
2020-09-08drm_hwcomposer: use CamelCase in source/header files related to classRoman Stratiienko
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