drm_hwcomposer: Raise clang-tidy level of some files to NORMAL
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
This commit is contained in:
parent
57b9ba3a7d
commit
f815d38c2a
6 changed files with 20 additions and 21 deletions
|
|
@ -15,7 +15,6 @@ SKIP_FILES := \
|
|||
bufferinfo/BufferInfoMapperMetadata.cpp
|
||||
|
||||
TIDY_FILES_OVERRIDE := \
|
||||
backend/BackendManager.h:COARSE \
|
||||
bufferinfo/legacy/BufferInfoImagination.cpp:COARSE \
|
||||
bufferinfo/legacy/BufferInfoLibdrm.cpp:COARSE \
|
||||
bufferinfo/legacy/BufferInfoMaliHisi.cpp:COARSE \
|
||||
|
|
@ -25,7 +24,6 @@ TIDY_FILES_OVERRIDE := \
|
|||
compositor/DrmDisplayComposition.cpp:COARSE \
|
||||
compositor/DrmDisplayComposition.h:COARSE \
|
||||
compositor/DrmDisplayCompositor.cpp:COARSE \
|
||||
compositor/DrmDisplayCompositor.h:COARSE \
|
||||
drm/DrmFbImporter.h:FINE \
|
||||
drm/DrmMode.h:COARSE \
|
||||
drm/DrmDevice.h:COARSE \
|
||||
|
|
@ -36,7 +34,6 @@ TIDY_FILES_OVERRIDE := \
|
|||
drm/DrmEncoder.h:COARSE \
|
||||
drm/DrmConnector.cpp:COARSE \
|
||||
drm/DrmDevice.cpp:COARSE \
|
||||
drm/DrmPlane.cpp:COARSE \
|
||||
drm/DrmProperty.cpp:COARSE \
|
||||
drm/UEventListener.cpp:COARSE \
|
||||
drm/VSyncWorker.cpp:COARSE \
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ BackendManager &BackendManager::GetInstance() {
|
|||
}
|
||||
|
||||
int BackendManager::RegisterBackend(const std::string &name,
|
||||
backend_constructor_t backend_constructor) {
|
||||
BackendConstructorT backend_constructor) {
|
||||
available_backends_[name] = std::move(backend_constructor);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "Backend.h"
|
||||
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
|
||||
#define REGISTER_BACKEND(name_str_, backend_) \
|
||||
static int \
|
||||
backend = BackendManager::GetInstance() \
|
||||
|
|
@ -36,10 +37,10 @@ namespace android {
|
|||
|
||||
class BackendManager {
|
||||
public:
|
||||
using backend_constructor_t = std::function<std::unique_ptr<Backend>()>;
|
||||
using BackendConstructorT = std::function<std::unique_ptr<Backend>()>;
|
||||
static BackendManager &GetInstance();
|
||||
int RegisterBackend(const std::string &name,
|
||||
backend_constructor_t backend_constructor);
|
||||
BackendConstructorT backend_constructor);
|
||||
int SetBackendForDisplay(DrmHwcTwo::HwcDisplay *display);
|
||||
std::unique_ptr<Backend> GetBackendByName(std::string &name);
|
||||
HWC2::Error ValidateDisplay(DrmHwcTwo::HwcDisplay *display,
|
||||
|
|
@ -50,7 +51,7 @@ class BackendManager {
|
|||
|
||||
static const std::vector<std::string> kClientDevices;
|
||||
|
||||
std::map<std::string, backend_constructor_t> available_backends_;
|
||||
std::map<std::string, BackendConstructorT> available_backends_;
|
||||
};
|
||||
} // namespace android
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ DrmDisplayCompositor::CreateInitializedComposition() const {
|
|||
auto DrmDisplayCompositor::CommitFrame(AtomicCommitArgs &args) -> int {
|
||||
ATRACE_CALL();
|
||||
|
||||
if (args.active && *args.active == active_frame_state.crtc_active_state) {
|
||||
if (args.active && *args.active == active_frame_state_.crtc_active_state) {
|
||||
/* Don't set the same state twice */
|
||||
args.active.reset();
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ auto DrmDisplayCompositor::CommitFrame(AtomicCommitArgs &args) -> int {
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!active_frame_state.crtc_active_state) {
|
||||
if (!active_frame_state_.crtc_active_state) {
|
||||
/* Force activate display */
|
||||
args.active = true;
|
||||
}
|
||||
|
|
@ -204,7 +204,7 @@ auto DrmDisplayCompositor::CommitFrame(AtomicCommitArgs &args) -> int {
|
|||
connector->set_active_mode(*args.display_mode);
|
||||
}
|
||||
|
||||
active_frame_state = std::move(new_frame_state);
|
||||
active_frame_state_ = std::move(new_frame_state);
|
||||
|
||||
if (crtc->out_fence_ptr_property()) {
|
||||
args.out_fence = UniqueFd((int)out_fence);
|
||||
|
|
|
|||
|
|
@ -78,13 +78,13 @@ class DrmDisplayCompositor {
|
|||
|
||||
/* To avoid setting the inactive state twice, which will fail the commit */
|
||||
bool crtc_active_state{};
|
||||
} active_frame_state;
|
||||
} active_frame_state_;
|
||||
|
||||
auto NewFrameState() -> KmsState {
|
||||
return (KmsState){
|
||||
.used_planes = active_frame_state.used_planes,
|
||||
.used_framebuffers = active_frame_state.used_framebuffers,
|
||||
.crtc_active_state = active_frame_state.crtc_active_state,
|
||||
.used_planes = active_frame_state_.used_planes,
|
||||
.used_framebuffers = active_frame_state_.used_framebuffers,
|
||||
.crtc_active_state = active_frame_state_.crtc_active_state,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ DrmPlane::DrmPlane(DrmDevice *drm, drmModePlanePtr p)
|
|||
: drm_(drm),
|
||||
id_(p->plane_id),
|
||||
possible_crtc_mask_(p->possible_crtcs),
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
|
||||
formats_(p->formats, p->formats + p->count_formats) {
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +47,7 @@ int DrmPlane::Init() {
|
|||
int ret = 0;
|
||||
uint64_t type = 0;
|
||||
std::tie(ret, type) = p.value();
|
||||
if (ret) {
|
||||
if (ret != 0) {
|
||||
ALOGE("Failed to get plane type property value");
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -150,7 +151,7 @@ bool DrmPlane::IsValidForLayer(DrmHwcLayer *layer) {
|
|||
}
|
||||
}
|
||||
|
||||
if (alpha_property_.id() == 0 && layer->alpha != 0xffff) {
|
||||
if (alpha_property_.id() == 0 && layer->alpha != UINT16_MAX) {
|
||||
ALOGV("Alpha is not supported on plane %d", id_);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -190,15 +191,15 @@ bool DrmPlane::HasNonRgbFormat() const {
|
|||
|
||||
static uint64_t ToDrmRotation(DrmHwcTransform transform) {
|
||||
uint64_t rotation = 0;
|
||||
if (transform & DrmHwcTransform::kFlipH)
|
||||
if ((transform & DrmHwcTransform::kFlipH) != 0)
|
||||
rotation |= DRM_MODE_REFLECT_X;
|
||||
if (transform & DrmHwcTransform::kFlipV)
|
||||
if ((transform & DrmHwcTransform::kFlipV) != 0)
|
||||
rotation |= DRM_MODE_REFLECT_Y;
|
||||
if (transform & DrmHwcTransform::kRotate90)
|
||||
if ((transform & DrmHwcTransform::kRotate90) != 0)
|
||||
rotation |= DRM_MODE_ROTATE_90;
|
||||
else if (transform & DrmHwcTransform::kRotate180)
|
||||
else if ((transform & DrmHwcTransform::kRotate180) != 0)
|
||||
rotation |= DRM_MODE_ROTATE_180;
|
||||
else if (transform & DrmHwcTransform::kRotate270)
|
||||
else if ((transform & DrmHwcTransform::kRotate270) != 0)
|
||||
rotation |= DRM_MODE_ROTATE_270;
|
||||
else
|
||||
rotation |= DRM_MODE_ROTATE_0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue