1
0
Fork 0

drm_hwcomposer: Use pragma once instead of include guards

Some of existing include guards were copy-pasted without modification,
therefore have incorrect name. Switch to 'pragma once' in order to fix
it and avoid such copy-paste issues in the future.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
This commit is contained in:
Roman Stratiienko 2022-12-10 20:27:58 +02:00
parent 80566fe554
commit bde95666cf
33 changed files with 65 additions and 130 deletions

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_BACKEND_H
#define ANDROID_BACKEND_H
#pragma once
#include "hwc2_device/DrmHwcTwo.h"
@ -41,5 +40,3 @@ class Backend {
int client_start, size_t client_size);
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_BACKEND_CLIENT_H
#define ANDROID_BACKEND_CLIENT_H
#pragma once
#include "Backend.h"
@ -27,5 +26,3 @@ class BackendClient : public Backend {
uint32_t *num_requests) override;
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_BACKEND_MANAGER_H
#define ANDROID_BACKEND_MANAGER_H
#pragma once
#include <functional>
#include <map>
@ -54,5 +53,3 @@ class BackendManager {
std::map<std::string, BackendConstructorT> available_backends_;
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_BUFFERINFOGETTER_H_
#define ANDROID_BUFFERINFOGETTER_H_
#pragma once
#include <drm/drm_fourcc.h>
#include <hardware/gralloc.h>
@ -89,4 +88,3 @@ class LegacyBufferInfoGetter : public BufferInfoGetter {
#endif
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef PLATFORMIMAGINATION_H
#define PLATFORMIMAGINATION_H
#pragma once
#include "bufferinfo/BufferInfoGetter.h"
@ -32,5 +31,3 @@ class BufferInfoMapperMetadata : public BufferInfoGetter {
static BufferInfoGetter *CreateInstance();
};
} // namespace android
#endif // PLATFORMIMAGINATION_H

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef BUFFERINFOIMAGINATION_H
#define BUFFERINFOIMAGINATION_H
#pragma once
#include <hardware/gralloc.h>
@ -30,5 +29,3 @@ class BufferInfoImagination : public LegacyBufferInfoGetter {
auto GetBoInfo(buffer_handle_t handle) -> std::optional<BufferInfo> override;
};
} // namespace android
#endif // PLATFORMIMAGINATION_H

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef BUFFERINFOLIBDRM_H_
#define BUFFERINFOLIBDRM_H_
#pragma once
#include <hardware/gralloc.h>
@ -35,5 +34,3 @@ class BufferInfoLibdrm : public LegacyBufferInfoGetter {
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef BUFFERINFOMALIHISI_H_
#define BUFFERINFOMALIHISI_H_
#pragma once
#include <hardware/gralloc.h>
@ -33,5 +32,3 @@ class BufferInfoMaliHisi : public LegacyBufferInfoGetter {
uint64_t ConvertGrallocFormatToDrmModifiers(uint64_t flags, bool is_rgb);
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef BUFFERINFOMALIMTK_H_
#define BUFFERINFOMALIMTK_H_
#pragma once
#include <hardware/gralloc.h>
@ -30,5 +29,3 @@ class BufferInfoMaliMediatek : public LegacyBufferInfoGetter {
auto GetBoInfo(buffer_handle_t handle) -> std::optional<BufferInfo> override;
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef BUFFERINFOMALIHISI_H_
#define BUFFERINFOMALIHISI_H_
#pragma once
#include <hardware/gralloc.h>
@ -32,5 +31,3 @@ class BufferInfoMaliMeson : public LegacyBufferInfoGetter {
uint64_t ConvertGrallocFormatToDrmModifiers(uint64_t flags);
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef BUFFERINFOMINIGBM_H_
#define BUFFERINFOMINIGBM_H_
#pragma once
#include <hardware/gralloc.h>
@ -31,5 +30,3 @@ class BufferInfoMinigbm : public LegacyBufferInfoGetter {
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_DRM_KMS_PLAN_H_
#define ANDROID_DRM_KMS_PLAN_H_
#pragma once
#include <memory>
#include <vector>
@ -41,4 +40,3 @@ struct DrmKmsPlan {
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_DRM_CONNECTOR_H_
#define ANDROID_DRM_CONNECTOR_H_
#pragma once
#include <xf86drmMode.h>
@ -135,5 +134,3 @@ class DrmConnector : public PipelineBindable<DrmConnector> {
DrmProperty writeback_out_fence_;
};
} // namespace android
#endif // ANDROID_DRM_PLANE_H_

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_DRM_CRTC_H_
#define ANDROID_DRM_CRTC_H_
#pragma once
#include <xf86drmMode.h>
@ -72,5 +71,3 @@ class DrmCrtc : public PipelineBindable<DrmCrtc> {
DrmProperty out_fence_ptr_property_;
};
} // namespace android
#endif // ANDROID_DRM_CRTC_H_

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_DRM_H_
#define ANDROID_DRM_H_
#pragma once
#include <cstdint>
#include <map>
@ -24,7 +23,6 @@
#include "DrmConnector.h"
#include "DrmCrtc.h"
#include "DrmEncoder.h"
#include "DrmFbImporter.h"
#include "utils/UniqueFd.h"
namespace android {
@ -121,5 +119,3 @@ class DrmDevice {
ResourceManager *const res_man_;
};
} // namespace android
#endif // ANDROID_DRM_H_

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_DRMDISPLAYPIPELINE_H_
#define ANDROID_DRMDISPLAYPIPELINE_H_
#pragma once
#include <memory>
#include <vector>
@ -86,5 +85,3 @@ struct DrmDisplayPipeline {
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_DRM_ENCODER_H_
#define ANDROID_DRM_ENCODER_H_
#pragma once
#include <xf86drmMode.h>
@ -65,5 +64,3 @@ class DrmEncoder : public PipelineBindable<DrmEncoder> {
const uint32_t index_in_res_array_;
};
} // namespace android
#endif // ANDROID_DRM_ENCODER_H_

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef DRM_DRMFBIMPORTER_H_
#define DRM_DRMFBIMPORTER_H_
#pragma once
#include <drm/drm_fourcc.h>
#include <hardware/gralloc.h>
@ -87,5 +86,3 @@ class DrmFbImporter {
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_DRM_MODE_H_
#define ANDROID_DRM_MODE_H_
#pragma once
#include <xf86drmMode.h>
@ -80,5 +79,3 @@ class DrmMode {
std::string name_;
};
} // namespace android
#endif // ANDROID_DRM_MODE_H_

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_DRM_PLANE_H_
#define ANDROID_DRM_PLANE_H_
#pragma once
#include <xf86drmMode.h>
@ -100,5 +99,3 @@ class DrmPlane : public PipelineBindable<DrmPlane> {
std::map<LayerTransform, uint64_t> transform_enum_map_;
};
} // namespace android
#endif // ANDROID_DRM_PLANE_H_

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_DRM_PROPERTY_H_
#define ANDROID_DRM_PROPERTY_H_
#pragma once
#include <xf86drmMode.h>
@ -104,5 +103,3 @@ auto DrmProperty::AddEnumToMap(const std::string &name, E key,
}
} // namespace android
#endif // ANDROID_DRM_PROPERTY_H_

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef DRM_UNIQUE_H_
#define DRM_UNIQUE_H_
#pragma once
#include <xf86drmMode.h>
@ -83,5 +82,3 @@ auto inline MakeDrmModeResUnique(int fd) {
return DrmModeResUnique(drmModeGetResources(fd),
[](drmModeRes *it) { drmModeFreeResources(it); });
}
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef RESOURCEMANAGER_H
#define RESOURCEMANAGER_H
#pragma once
#include <cstring>
@ -79,5 +78,3 @@ class ResourceManager {
bool initialized_{};
};
} // namespace android
#endif // RESOURCEMANAGER_H

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_UEVENT_LISTENER_H_
#define ANDROID_UEVENT_LISTENER_H_
#pragma once
#include <functional>
@ -44,5 +43,3 @@ class UEventListener : public Worker {
std::function<void()> hotplug_handler_;
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_EVENT_WORKER_H_
#define ANDROID_EVENT_WORKER_H_
#pragma once
#include <hardware/hardware.h>
#include <hardware/hwcomposer.h>
@ -55,5 +54,3 @@ class VSyncWorker : public Worker {
int64_t last_timestamp_ = -1;
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_DRM_HWC_TWO_H_
#define ANDROID_DRM_HWC_TWO_H_
#pragma once
#include <hardware/hwcomposer2.h>
@ -86,5 +85,3 @@ class DrmHwcTwo : public PipelineToFrontendBindingInterface {
uint32_t last_display_handle_ = kPrimaryDisplay;
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_HWC2_DEVICE_HWC_DISPLAY_H
#define ANDROID_HWC2_DEVICE_HWC_DISPLAY_H
#pragma once
#include <hardware/hwcomposer2.h>
@ -239,5 +238,3 @@ class HwcDisplay {
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_HWC2_DEVICE_HWC_DISPLAY_CONFIGS_H
#define ANDROID_HWC2_DEVICE_HWC_DISPLAY_CONFIGS_H
#pragma once
#include <hardware/hwcomposer2.h>
@ -55,5 +54,3 @@ struct HwcDisplayConfigs {
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_HWC2_DEVICE_HWC_LAYER_H
#define ANDROID_HWC2_DEVICE_HWC_LAYER_H
#pragma once
#include <hardware/hwcomposer2.h>
@ -140,5 +139,3 @@ class HwcLayer {
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef UNIQUEFD_H_
#define UNIQUEFD_H_
#pragma once
#include <fcntl.h>
#include <unistd.h>
@ -114,5 +113,3 @@ class UniqueFd {
};
} // namespace android
#endif

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_WORKER_H_
#define ANDROID_WORKER_H_
#pragma once
#include <condition_variable>
#include <cstdint>
@ -78,4 +77,3 @@ class Worker {
bool initialized_;
};
} // namespace android
#endif

View file

@ -1,5 +1,20 @@
#ifndef UTILS_LOG_H_
#define UTILS_LOG_H_
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#ifdef ANDROID
@ -22,5 +37,3 @@
#define ALOGV(args...) printf("VERBOSE: " args)
#endif
#endif

View file

@ -1,5 +1,20 @@
#ifndef UTILS_PROPERTIES_H_
#define UTILS_PROPERTIES_H_
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#ifdef ANDROID
@ -25,5 +40,3 @@ auto inline property_get(const char *name, char *value,
}
#endif
#endif