1
0
Fork 0

Merge remote-tracking branch 'freedesktop/main' into android-16.0

This commit is contained in:
Konsta 2025-11-11 23:05:05 +02:00
commit 69629f8907
72 changed files with 323 additions and 181 deletions

View file

@ -18,7 +18,9 @@
#include "BackendManager.h"
#include "hwc/HwcDisplay.h"
#include "drm/DrmConnector.h"
#include "drm/DrmDevice.h"
#include "drm/DrmDisplayPipeline.h"
#include "utils/log.h"
#include "utils/properties.h"

View file

@ -21,10 +21,11 @@
#include <string>
#include <vector>
#include "compositor/CompositionPlanner.h"
namespace android::drm_hwcomposer {
class DrmConnector;
struct DrmDisplayPipeline;
// BackendManager is a singleton that manages the registration of Backends and
// finding a Backend which can be used to create a DrmDisplayPipeline for a
// DrmConnector.

View file

@ -15,7 +15,7 @@
*/
#include "backend/GenericBackend.h"
#include "compositor/GenericCompositionPlanner.h"
#include "compositor/CompositionPlanner.h"
#include "hwc/HwcDisplay.h"
namespace android::drm_hwcomposer {

View file

@ -14,9 +14,12 @@
* limitations under the License.
*/
#include "backend/GenericBackend.h"
#include "GenericBackend.h"
#include "backend/BackendManager.h"
#include "compositor/CompositionPlanner.h"
#include "compositor/GenericCompositionPlanner.h"
#include "drm/DrmConnector.h"
#include "drm/DrmDisplayPipeline.h"
namespace android::drm_hwcomposer {

View file

@ -21,6 +21,9 @@
namespace android::drm_hwcomposer {
class DrmConnector;
struct DrmDisplayPipeline;
// Implement the Backend interface on top of upstream drm uAPI.
class GenericBackend : public BackendManager::Backend {
public:

View file

@ -17,7 +17,6 @@
#define LOG_TAG "drmhwc"
#include "BufferInfoGetter.h"
#include "BufferInfoMapperMetadata.h"
#include <sys/stat.h>
#include <sys/types.h>
@ -27,8 +26,8 @@
#include <mutex>
#include "bufferinfo/BufferInfoMapperMetadata.h"
#include "utils/log.h"
#include "utils/properties.h"
namespace android::drm_hwcomposer {

View file

@ -21,8 +21,7 @@
#include <optional>
#include "BufferInfo.h"
#include "drm/DrmDevice.h"
#include "utils/log.h"
#ifndef DRM_FORMAT_INVALID
#define DRM_FORMAT_INVALID 0
@ -32,6 +31,8 @@ namespace android::drm_hwcomposer {
using BufferUniqueId = uint64_t;
struct BufferInfo;
class BufferInfoGetter {
public:
virtual ~BufferInfoGetter() = default;

View file

@ -25,6 +25,8 @@
#include <cinttypes>
#include "bufferinfo/BufferInfo.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -20,6 +20,8 @@
namespace android::drm_hwcomposer {
struct BufferInfo;
class BufferInfoMapperMetadata : public BufferInfoGetter {
public:
using BufferInfoGetter::BufferInfoGetter;

View file

@ -22,6 +22,8 @@
#include <cerrno>
#include "bufferinfo/BufferInfo.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "img_gralloc1_public.h"
#include "utils/log.h"

View file

@ -25,8 +25,9 @@
#include <mutex>
#include "bufferinfo/BufferInfo.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "utils/log.h"
#include "utils/properties.h"
namespace android::drm_hwcomposer {

View file

@ -23,8 +23,9 @@
#include <cinttypes>
#include "bufferinfo/BufferInfo.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "gralloc_priv.h"
#include "utils/log.h"
#define MALI_ALIGN(value, base) (((value) + ((base)-1)) & ~((base)-1))

View file

@ -25,8 +25,9 @@
#include <cinttypes>
#include "bufferinfo/BufferInfo.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "gralloc_priv.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -23,8 +23,9 @@
#include <cinttypes>
#include "bufferinfo/BufferInfo.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "gralloc_priv.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -24,6 +24,8 @@
#include <cerrno>
#include <cstring>
#include "bufferinfo/BufferInfo.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -16,6 +16,7 @@
#include "CompositionPlanner.h"
#include "compositor/LayerData.h"
#include "hwc/HwcLayer.h"
namespace android::drm_hwcomposer {

View file

@ -21,13 +21,12 @@
#include <optional>
#include <vector>
#include "compositor/LayerData.h"
namespace android::drm_hwcomposer {
struct LayerToPlaneJoiningPlan;
enum class CompositionType;
class HwcDisplay;
class HwcLayer;
struct LayerToPlaneJoiningPlan;
// CompositionPlanner is responsible for determining the mapping between
// HwcLayer and drm planes. This includes deciding which HwcLayers should be

View file

@ -82,7 +82,7 @@ enum class Colorspace : int32_t {
/**
* Display panel orientation property values.
*/
enum PanelOrientation {
enum class PanelOrientation {
kModePanelOrientationNormal = 0,
kModePanelOrientationBottomUp,
kModePanelOrientationLeftUp,

View file

@ -20,11 +20,12 @@
#include <tuple>
#include <vector>
#include "backend/BackendManager.h"
#include "compositor/FlatteningController.h"
#include "compositor/LayerData.h"
#include "drm/DrmPlane.h"
#include "hwc/HwcDisplay.h"
#include "hwc/HwcLayer.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -16,11 +16,11 @@
#pragma once
#include "CompositionPlanner.h"
#include "compositor/CompositionPlanner.h"
namespace android::drm_hwcomposer {
struct LayerToPlaneJoiningPlan;
enum class CompositionType;
class HwcDisplay;
class HwcLayer;

View file

@ -23,7 +23,6 @@
#include <vector>
#include "bufferinfo/BufferInfo.h"
#include "drm/DrmFbImporter.h"
#include "utils/fd.h"
namespace android::drm_hwcomposer {

View file

@ -18,9 +18,9 @@
#include "LayerToPlaneJoiningPlan.h"
#include "drm/DrmDevice.h"
#include "compositor/LayerData.h"
#include "drm/DrmDisplayPipeline.h"
#include "drm/DrmPlane.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -23,7 +23,10 @@
namespace android::drm_hwcomposer {
class DrmDevice;
class DrmPlane;
struct DrmDisplayPipeline;
template <typename T>
class BindingOwner;
struct LayerToPlaneJoiningPlan {
struct LayerToPlaneJoining {

View file

@ -29,10 +29,16 @@
#include <cassert>
#include "compositor/LayerData.h"
#include "compositor/LayerToPlaneJoiningPlan.h"
#include "drm/DrmConnector.h"
#include "drm/DrmCrtc.h"
#include "drm/DrmDevice.h"
#include "drm/DrmDisplayPipeline.h"
#include "drm/DrmFbImporter.h"
#include "drm/DrmPlane.h"
#include "drm/DrmUnique.h"
#include "utils/fd.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -22,16 +22,30 @@
#include <memory>
#include <optional>
#include <queue>
#include <thread>
#include <android-base/thread_annotations.h>
#include "compositor/DisplayInfo.h"
#include "compositor/LayerData.h"
#include "compositor/LayerToPlaneJoiningPlan.h"
#include "drm/DrmPlane.h"
#include "drm/ResourceManager.h"
#include "drm/VSyncWorker.h"
#include "drm/DrmMode.h"
#include "utils/fd.h"
namespace android::drm_hwcomposer {
template <typename T>
class BindingOwner;
class DrmFbIdHandle;
class DrmPlane;
struct DrmDisplayPipeline;
struct LayerToPlaneJoiningPlan;
enum class Colorspace;
enum class ContentProtection;
enum class ContentType;
enum class HdcpContentType;
struct AtomicCommitArgs {
/* inputs. All fields are optional, but at least one has to be specified */
bool test_only = false;

View file

@ -27,8 +27,13 @@
#include <cstdint>
#include <sstream>
#include "DrmDevice.h"
#include "compositor/DisplayInfo.h"
#include "drm/DrmDevice.h"
#include "drm/DrmEncoder.h"
#include "drm/DrmMode.h"
#include "drm/DrmProperty.h"
#include "drm/DrmUnique.h"
#include "utils/log.h"
#include "utils/properties.h"
#ifndef DRM_MODE_CONNECTOR_SPI
@ -82,6 +87,13 @@ auto DrmConnector::CreateInstance(DrmDevice &dev, uint32_t connector_id,
return c;
}
DrmConnector::~DrmConnector() = default;
DrmConnector::DrmConnector(DrmModeConnectorUnique connector, DrmDevice *drm,
uint32_t index)
: connector_(std::move(connector)), drm_(drm), index_in_res_array_(index) {
}
auto DrmConnector::Init()-> bool {
if (!GetConnectorProperty("DPMS", &dpms_property_) ||
!GetConnectorProperty("CRTC_ID", &crtc_id_property_)) {
@ -196,6 +208,17 @@ auto DrmConnector::GetEdidBlob() -> DrmModePropertyBlobUnique {
return MakeDrmModePropertyBlobUnique(*drm_->GetFd(), *blob_id);
}
bool DrmConnector::SupportsEncoder(DrmEncoder &enc) const {
for (int i = 0; i < connector_->count_encoders; i++) {
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
if (connector_->encoders[i] == enc.GetId()) {
return true;
}
}
return false;
}
bool DrmConnector::IsInternal() const {
auto type = connector_->connector_type;
return type == DRM_MODE_CONNECTOR_Unknown ||

View file

@ -22,15 +22,18 @@
#include <string>
#include <vector>
#include "DrmEncoder.h"
#include "DrmMode.h"
#include "DrmProperty.h"
#include "DrmUnique.h"
#include "compositor/DisplayInfo.h"
#include "drm/DrmDisplayPipeline.h"
#include "drm/DrmProperty.h"
#include "drm/DrmUnique.h"
namespace android::drm_hwcomposer {
class DrmDevice;
class DrmProperty;
class DrmMode;
enum class Colorspace;
enum class PanelOrientation;
class DrmConnector : public PipelineBindable<DrmConnector> {
friend class FakeDrmConnector;
@ -42,7 +45,7 @@ class DrmConnector : public PipelineBindable<DrmConnector> {
DrmConnector(const DrmProperty &) = delete;
DrmConnector &operator=(const DrmProperty &) = delete;
virtual ~DrmConnector() = default;
virtual ~DrmConnector();
int UpdateEdidProperty();
auto GetEdidBlob() -> DrmModePropertyBlobUnique;
@ -63,16 +66,7 @@ class DrmConnector : public PipelineBindable<DrmConnector> {
return connector_->encoder_id;
}
auto SupportsEncoder(DrmEncoder &enc) const {
for (int i = 0; i < connector_->count_encoders; i++) {
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
if (connector_->encoders[i] == enc.GetId()) {
return true;
}
}
return false;
}
bool SupportsEncoder(DrmEncoder &enc) const;
bool IsInternal() const;
bool IsExternal() const;
@ -158,10 +152,8 @@ class DrmConnector : public PipelineBindable<DrmConnector> {
auto GetPanelOrientation() -> std::optional<PanelOrientation>;
private:
DrmConnector(DrmModeConnectorUnique connector, DrmDevice *drm, uint32_t index)
: connector_(std::move(connector)),
drm_(drm),
index_in_res_array_(index) {};
DrmConnector(DrmModeConnectorUnique connector, DrmDevice *drm,
uint32_t index);
DrmModeConnectorUnique connector_;
DrmDevice *const drm_;

View file

@ -18,12 +18,14 @@
#include "DrmCrtc.h"
#include <utils/log.h>
#include <xf86drmMode.h>
#include <cstdint>
#include "DrmDevice.h"
#include "drm/DrmDevice.h"
#include "drm/DrmProperty.h"
#include "drm/DrmUnique.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -20,10 +20,9 @@
#include <cstdint>
#include "DrmDisplayPipeline.h"
#include "DrmMode.h"
#include "DrmProperty.h"
#include "DrmUnique.h"
#include "drm/DrmDisplayPipeline.h"
#include "drm/DrmProperty.h"
#include "drm/DrmUnique.h"
namespace android::drm_hwcomposer {

View file

@ -27,15 +27,22 @@
#include <cstdint>
#include <string>
#include "drm/DrmAtomicStateManager.h"
#include "bufferinfo/BufferInfo.h"
#include "drm/DrmConnector.h"
#include "drm/DrmCrtc.h"
#include "drm/DrmEncoder.h"
#include "drm/DrmFbImporter.h"
#include "drm/DrmPlane.h"
#include "drm/DrmProperty.h"
#include "drm/DrmUnique.h"
#include "drm/ResourceManager.h"
#include "utils/fd.h"
#include "utils/log.h"
#include "utils/properties.h"
namespace android::drm_hwcomposer {
DrmDevice::~DrmDevice() = default;
auto DrmDevice::CreateInstance(std::string const &path,
ResourceManager *res_man, uint32_t index)
-> std::unique_ptr<DrmDevice> {
@ -194,6 +201,26 @@ auto DrmDevice::RegisterUserPropertyBlob(void *data, size_t length) const
});
}
DrmCrtc *DrmDevice::FindCrtcById(uint32_t id) const {
for (const auto &crtc : crtcs_) {
if (crtc->GetId() == id) {
return crtc.get();
}
};
return nullptr;
}
DrmEncoder *DrmDevice::FindEncoderById(uint32_t id) const {
for (const auto &enc : encoders_) {
if (enc->GetId() == id) {
return enc.get();
}
};
return nullptr;
}
int DrmDevice::GetProperty(uint32_t obj_id, uint32_t obj_type,
const char *prop_name, DrmProperty *property) const {
drmModeObjectPropertiesPtr props = nullptr;

View file

@ -21,23 +21,25 @@
#include <optional>
#include <tuple>
#include "DrmConnector.h"
#include "DrmCrtc.h"
#include "DrmEncoder.h"
#include "bufferinfo/BufferInfo.h"
#include "drm/DrmUnique.h"
#include "utils/fd.h"
namespace android::drm_hwcomposer {
struct BufferInfo;
class DrmConnector;
class DrmCrtc;
class DrmEncoder;
class DrmFbImporter;
class DrmPlane;
class DrmProperty;
class ResourceManager;
class DrmDevice {
friend class FakeDrmDevice;
public:
~DrmDevice() = default;
~DrmDevice();
static auto CreateInstance(std::string const &path, ResourceManager *res_man,
uint32_t index) -> std::unique_ptr<DrmDevice>;
@ -88,25 +90,9 @@ class DrmDevice {
return *drm_fb_importer_;
}
auto FindCrtcById(uint32_t id) const -> DrmCrtc * {
for (const auto &crtc : crtcs_) {
if (crtc->GetId() == id) {
return crtc.get();
}
};
DrmCrtc *FindCrtcById(uint32_t id) const;
return nullptr;
}
auto FindEncoderById(uint32_t id) const -> DrmEncoder * {
for (const auto &enc : encoders_) {
if (enc->GetId() == id) {
return enc.get();
}
};
return nullptr;
}
DrmEncoder *FindEncoderById(uint32_t id) const;
int GetProperty(uint32_t obj_id, uint32_t obj_type, const char *prop_name,
DrmProperty *property) const;

View file

@ -18,13 +18,13 @@
#include "DrmDisplayPipeline.h"
#include "DrmAtomicStateManager.h"
#include "DrmConnector.h"
#include "DrmCrtc.h"
#include "DrmDevice.h"
#include "DrmEncoder.h"
#include "DrmPlane.h"
#include "compositor/CompositionPlanner.h"
#include "drm/DrmAtomicStateManager.h"
#include "drm/DrmConnector.h"
#include "drm/DrmCrtc.h"
#include "drm/DrmDevice.h"
#include "drm/DrmEncoder.h"
#include "drm/DrmPlane.h"
#include "utils/log.h"
#include "utils/properties.h"

View file

@ -22,12 +22,12 @@
namespace android::drm_hwcomposer {
class CompositionPlanner;
class DrmConnector;
class DrmDevice;
class DrmPlane;
class DrmCrtc;
class DrmEncoder;
class DrmAtomicStateManager;
class DrmConnector;
class DrmCrtc;
class DrmDevice;
class DrmEncoder;
class DrmPlane;
struct DrmDisplayPipeline;

View file

@ -20,12 +20,12 @@
#include <gtest/gtest.h>
#include <xf86drmMode.h>
#include "DrmConnector.h"
#include "DrmCrtc.h"
#include "DrmDevice.h"
#include "DrmDisplayPipeline.h"
#include "DrmEncoder.h"
#include "DrmPlane.h"
#include "drm/DrmConnector.h"
#include "drm/DrmCrtc.h"
#include "drm/DrmDevice.h"
#include "drm/DrmDisplayPipeline.h"
#include "drm/DrmEncoder.h"
#include "drm/DrmPlane.h"
namespace android::drm_hwcomposer {

View file

@ -22,7 +22,9 @@
#include <cstdint>
#include "DrmDevice.h"
#include "drm/DrmCrtc.h"
#include "drm/DrmDevice.h"
#include "drm/DrmUnique.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {
@ -38,4 +40,12 @@ auto DrmEncoder::CreateInstance(DrmDevice &dev, uint32_t encoder_id,
return std::unique_ptr<DrmEncoder>(new DrmEncoder(std::move(e), index));
}
bool DrmEncoder::CanClone(DrmEncoder &encoder) {
return (enc_->possible_clones & (1 << encoder.GetIndexInResArray())) != 0;
}
bool DrmEncoder::SupportsCrtc(DrmCrtc &crtc) {
return (enc_->possible_crtcs & (1 << crtc.GetIndexInResArray())) != 0;
}
} // namespace android::drm_hwcomposer

View file

@ -22,11 +22,14 @@
#include <set>
#include <vector>
#include "DrmCrtc.h"
#include "DrmDisplayPipeline.h"
#include "drm/DrmDisplayPipeline.h"
#include "drm/DrmUnique.h"
namespace android::drm_hwcomposer {
class DrmCrtc;
class DrmDevice;
class DrmEncoder : public PipelineBindable<DrmEncoder> {
friend class FakeDrmEncoder;
@ -47,13 +50,9 @@ class DrmEncoder : public PipelineBindable<DrmEncoder> {
return index_in_res_array_;
}
auto CanClone(DrmEncoder &encoder) {
return (enc_->possible_clones & (1 << encoder.GetIndexInResArray())) != 0;
}
bool CanClone(DrmEncoder &encoder);
auto SupportsCrtc(DrmCrtc &crtc) {
return (enc_->possible_crtcs & (1 << crtc.GetIndexInResArray())) != 0;
}
bool SupportsCrtc(DrmCrtc &crtc);
virtual uint32_t GetCurrentCrtcId() const {
return enc_->crtc_id;

View file

@ -29,8 +29,9 @@
#include <cinttypes>
#include <system_error>
#include "bufferinfo/BufferInfo.h"
#include "drm/DrmDevice.h"
#include "utils/log.h"
#include "utils/properties.h"
namespace android::drm_hwcomposer {
@ -125,6 +126,9 @@ DrmFbIdHandle::~DrmFbIdHandle() {
}
}
DrmFbIdHandle::DrmFbIdHandle(DrmDevice &drm) : drm_fd_(drm.GetFd()) {
}
auto DrmFbImporter::GetOrCreateFbId(BufferInfo *bo)
-> std::shared_ptr<DrmFbIdHandle> {
/* TODO: Clean up DrmDevices and DrmFbImporter inter-dependency.

View file

@ -23,7 +23,6 @@
#include <map>
#include "bufferinfo/BufferInfo.h"
#include "drm/DrmDevice.h"
#include "utils/fd.h"
#ifndef DRM_FORMAT_INVALID
@ -34,6 +33,8 @@ using GemHandle = uint32_t;
namespace android::drm_hwcomposer {
class DrmDevice;
class DrmFbIdHandle {
public:
static auto CreateInstance(BufferInfo *bo, GemHandle first_gem_handle,
@ -50,7 +51,7 @@ class DrmFbIdHandle {
}
private:
explicit DrmFbIdHandle(DrmDevice &drm) : drm_fd_(drm.GetFd()) {};
explicit DrmFbIdHandle(DrmDevice &drm);
SharedFd drm_fd_;

View file

@ -24,6 +24,9 @@
#include <sstream>
#include <utility>
#include "drm/DrmConnector.h"
#include "drm/DrmDisplayPipeline.h"
#include "hwc/HwcDisplay.h"
#include "stats/CompositionStats.h"
#include "utils/log.h"
#include "utils/properties.h"

View file

@ -16,13 +16,14 @@
#pragma once
#include "drm/DrmDisplayPipeline.h"
#include "drm/ResourceManager.h"
#include "hwc/HwcDisplay.h"
#include "stats/CompositionStats.h"
namespace android::drm_hwcomposer {
struct DrmDisplayPipeline;
class DrmHwc : public PipelineToFrontendBindingInterface,
public CompositionStatsProvider {
public:

View file

@ -18,7 +18,8 @@
#include <cstring>
#include "DrmDevice.h"
#include "drm/DrmDevice.h"
#include "drm/DrmUnique.h"
namespace android::drm_hwcomposer {

View file

@ -22,7 +22,7 @@
#include <cstdio>
#include <string>
#include "DrmUnique.h"
#include "drm/DrmUnique.h"
namespace android::drm_hwcomposer {

View file

@ -23,9 +23,11 @@
#include <cinttypes>
#include <cstdint>
#include "DrmDevice.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "compositor/LayerData.h"
#include "drm/DrmCrtc.h"
#include "drm/DrmDevice.h"
#include "drm/DrmFbImporter.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -21,15 +21,22 @@
#include <cstdint>
#include <vector>
#include "DrmCrtc.h"
#include "DrmProperty.h"
#include "compositor/LayerData.h"
#include "drm/DrmDisplayPipeline.h"
#include "drm/DrmProperty.h"
#include "drm/DrmUnique.h"
namespace android::drm_hwcomposer {
class DrmCrtc;
class DrmDevice;
struct DstRectInfo;
struct LayerData;
enum class BufferBlendMode;
enum class BufferColorSpace;
enum class BufferSampleRange;
// NOLINTNEXTLINE(readability-identifier-naming)
struct drm_plane_size_hint_local {
__u16 width;

View file

@ -26,7 +26,7 @@
#include <cstdint>
#include <string>
#include "DrmDevice.h"
#include "utils/fd.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -26,10 +26,10 @@
#include "backend/BackendManager.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "drm/DrmAtomicStateManager.h"
#include "drm/DrmConnector.h"
#include "drm/DrmDevice.h"
#include "drm/DrmDisplayPipeline.h"
#include "drm/DrmPlane.h"
#include "drm/UEventListener.h"
#include "utils/log.h"
#include "utils/properties.h"

View file

@ -17,18 +17,18 @@
#pragma once
#include <cstring>
#include <map>
#include <mutex>
#include <set>
#include "DrmDevice.h"
#include "DrmDisplayPipeline.h"
#include "DrmFbImporter.h"
#include "DrmProperty.h"
#include "UEventListener.h"
#include "utils/properties.h"
namespace android::drm_hwcomposer {
enum class CtmHandling;
class DrmConnector;
class DrmDevice;
struct DrmDisplayPipeline;
class UEventListener;
class PipelineToFrontendBindingInterface {
public:
virtual ~PipelineToFrontendBindingInterface() = default;

View file

@ -20,6 +20,7 @@
#include <thread>
#include "utils/UEvent.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -20,10 +20,10 @@
#include <mutex>
#include <thread>
#include "utils/UEvent.h"
namespace android::drm_hwcomposer {
class UEvent;
class UEventListener {
public:
~UEventListener();

View file

@ -27,7 +27,11 @@
#include <cstring>
#include <ctime>
#include "drm/DrmCrtc.h"
#include "drm/DrmDevice.h"
#include "drm/DrmDisplayPipeline.h"
#include "drm/ResourceManager.h"
#include "utils/fd.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -24,10 +24,12 @@
#include <android-base/thread_annotations.h>
#include "DrmDevice.h"
#include "utils/fd.h"
namespace android::drm_hwcomposer {
struct DrmDisplayPipeline;
class VSyncWorker {
public:
using VsyncTimestampCallback = std::function<void(int64_t /*timestamp*/,

View file

@ -30,10 +30,18 @@
#include "compositor/CompositionPlanner.h"
#include "compositor/DisplayInfo.h"
#include "compositor/FlatteningController.h"
#include "compositor/LayerToPlaneJoiningPlan.h"
#include "drm/DrmAtomicStateManager.h"
#include "drm/DrmConnector.h"
#include "drm/DrmCrtc.h"
#include "drm/DrmDevice.h"
#include "drm/DrmDisplayPipeline.h"
#include "drm/DrmHwc.h"
#include "drm/VSyncWorker.h"
#include "hwc/HwcLayer.h"
#include "stats/CompositionStats.h"
#include "utils/EdidWrapper.h"
#include "utils/log.h"
#include "utils/properties.h"
using ColorGamut = ::android::ColorSpace;

View file

@ -18,15 +18,11 @@
#include <optional>
#include "HwcDisplayConfigs.h"
#include "HwcLayer.h"
#include "compositor/CompositionPlanner.h"
#include "compositor/DisplayInfo.h"
#include "compositor/LayerData.h"
#include "drm/DrmAtomicStateManager.h"
#include "drm/VSyncWorker.h"
#include "stats/CompositionStats.h"
#include "utils/EdidWrapper.h"
#include "hwc/HwcDisplayConfigs.h"
#include "hwc/HwcLayer.h"
namespace aidl::android::hardware::graphics::common {
enum class Hdr;
@ -38,13 +34,20 @@ using aidl::android::hardware::graphics::common::Hdr;
namespace android::drm_hwcomposer {
class ChangedLayer;
class DrmHwc;
class EdidWrapper;
class FlatteningController;
class VSyncWorker;
struct AtomicCommitArgs;
struct CompositionAttributes;
struct CompositionStats;
struct DrmDisplayPipeline;
using DisplayHandle = int64_t;
using EdidWrapperUnique = std::unique_ptr<EdidWrapper>;
class CompositionPlanner;
class DrmHwc;
class FlatteningController;
class FrontendDisplayBase {
public:
virtual ~FrontendDisplayBase() = default;

View file

@ -21,8 +21,9 @@
#include <cmath>
#include <cstring>
#include "compositor/DisplayInfo.h"
#include "drm/DrmConnector.h"
#include "drm/DrmMode.h"
#include "utils/log.h"
#include "utils/properties.h"
constexpr uint32_t kSyncLen = 10;

View file

@ -18,8 +18,10 @@
#include "HwcLayer.h"
#include "HwcDisplay.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "drm/DrmDevice.h"
#include "drm/DrmDisplayPipeline.h"
#include "drm/DrmFbImporter.h"
#include "hwc/HwcDisplay.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -16,10 +16,10 @@
#pragma once
#include <map>
#include <memory>
#include "bufferinfo/BufferInfo.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "compositor/LayerData.h"
#include "utils/fd.h"

View file

@ -20,8 +20,8 @@
#include <cinttypes>
#include "compositor/CompositionPlanner.h"
#include "utils/log.h"
#include "drm/DrmHwc.h"
#include "hwc/HwcDisplay.h"
namespace android::drm_hwcomposer {

View file

@ -19,6 +19,7 @@
#include <hardware/hwcomposer2.h>
#include "drm/DrmHwc.h"
#include "hwc/HwcDisplay.h"
namespace android::drm_hwcomposer {

View file

@ -25,15 +25,17 @@
#include <optional>
#include <cutils/native_handle.h>
#include <hardware/hwcomposer2.h>
#include <system/graphics-base-v1.1.h>
#include <ui/GraphicTypes.h>
#include "DrmHwcTwo.h"
#include "compositor/CompositionPlanner.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "compositor/DisplayInfo.h"
#include "hardware/hwcomposer2.h"
#include "hwc/HwcDisplay.h"
#include "hwc/HwcLayer.h"
#include "system/graphics-base-v1.1.h"
#include "hwc2_device/DrmHwcTwo.h"
#include "utils/log.h"
#include "utils/properties.h"
namespace android::drm_hwcomposer {

View file

@ -17,17 +17,19 @@
#include <unordered_map>
#include <vector>
#include <aidl/android/hardware/graphics/composer3/CommandError.h>
#include <aidl/android/hardware/graphics/composer3/CommandResultPayload.h>
#include <aidl/android/hardware/graphics/composer3/PresentFence.h>
#include <aidl/android/hardware/graphics/composer3/PresentOrValidate.h>
#include <aidl/android/hardware/graphics/composer3/ReleaseFences.h>
#include <android-base/unique_fd.h>
#include "Utils.h"
#include "aidl/android/hardware/graphics/composer3/CommandError.h"
#include "aidl/android/hardware/graphics/composer3/CommandResultPayload.h"
#include "aidl/android/hardware/graphics/composer3/PresentFence.h"
#include "aidl/android/hardware/graphics/composer3/PresentOrValidate.h"
#include "aidl/android/hardware/graphics/composer3/ReleaseFences.h"
namespace aidl::android::hardware::graphics::composer3 {
namespace hwc3 {
enum class Error;
} // namespace hwc3
struct DisplayChanges {
std::optional<ChangedCompositionTypes> composition_changes;
std::optional<DisplayRequest> display_request_changes;

View file

@ -19,12 +19,10 @@
#include "Composer.h"
#include <android-base/logging.h>
#include <android/binder_ibinder_platform.h>
#include "hwc3/ComposerClient.h"
#include "hwc3/Utils.h"
#include "utils/log.h"
#include "utils/properties.h"
using ::android::drm_hwcomposer::Properties;

View file

@ -34,7 +34,6 @@
#include <aidl/android/hardware/graphics/composer3/PresentOrValidate.h>
#include <aidl/android/hardware/graphics/composer3/RenderIntent.h>
#include <aidlcommonsupport/NativeHandle.h>
#include <android-base/logging.h>
#include <android/binder_auto_utils.h>
#include <android/binder_ibinder_platform.h>
#include <cutils/native_handle.h>
@ -42,14 +41,19 @@
#include <utils/Trace.h>
#include "bufferinfo/BufferInfo.h"
#include "bufferinfo/BufferInfoGetter.h"
#include "compositor/DisplayInfo.h"
#include "hwc/HwcDisplay.h"
#include "hwc/HwcDisplayConfigs.h"
#include "hwc/HwcLayer.h"
#include "hwc3/CommandResultWriter.h"
#include "hwc3/DrmHwcThree.h"
#include "hwc3/Utils.h"
#include "stats/CompositionStatsAtomReporter.h"
#include "stats/CompositionStatsPoller.h"
#include "utils/fd.h"
#include "utils/log.h"
#include "utils/properties.h"
using ::android::drm_hwcomposer::BufferBlendMode;
using ::android::drm_hwcomposer::BufferColorSpace;
@ -513,7 +517,7 @@ ComposerClient::~ComposerClient() {
hwc_->DeinitDisplays();
hwc_.reset();
}
LOG(DEBUG) << "removed composer client";
ALOGD("removed composer client");
}
ndk::ScopedAStatus ComposerClient::createLayer(int64_t display_handle,
@ -1087,7 +1091,8 @@ ndk::ScopedAStatus ComposerClient::getDisplayPhysicalOrientation(
*orientation = common::Transform::ROT_90;
break;
default:
ALOGE("Unknown panel orientation value: %d", drm_orientation);
ALOGE("Unknown panel orientation value: %d",
static_cast<int>(drm_orientation));
return ToBinderStatus(hwc3::Error::kBadDisplay);
}
@ -1566,7 +1571,7 @@ ndk::ScopedAStatus ComposerClient::startHdcpNegotiation(
if (levels.connectedLevel != drm::HdcpLevel::HDCP_NONE &&
levels.connectedLevel != drm::HdcpLevel::HDCP_UNKNOWN) {
ALOGI("Requested to start HDCP for connected level : %d",
levels.connectedLevel);
static_cast<int>(levels.connectedLevel));
if (!display->StartHdcp(true)) {
return ToBinderStatus(hwc3::Error::kUnsupported);
}

View file

@ -18,12 +18,10 @@
#include <memory>
#include "aidl/android/hardware/graphics/composer3/BnComposerClient.h"
#include "aidl/android/hardware/graphics/composer3/LayerCommand.h"
#include <aidl/android/hardware/graphics/composer3/BnComposerClient.h>
#include <aidl/android/hardware/graphics/composer3/LayerCommand.h>
#include "hwc/HwcLayer.h"
#include "hwc3/CommandResultWriter.h"
#include "hwc3/Utils.h"
#include "utils/Mutex.h"
using AidlPixelFormat = aidl::android::hardware::graphics::common::PixelFormat;
using AidlNativeHandle = aidl::android::hardware::common::NativeHandle;
@ -33,6 +31,14 @@ class CompositionStatsPoller;
class HwcDisplay;
} // namespace android::drm_hwcomposer
namespace aidl::android::hardware::graphics::composer3 {
class CommandResultWriter;
namespace hwc3 {
enum class Error;
} // namespace hwc3
} // namespace aidl::android::hardware::graphics::composer3
namespace aidl::android::hardware::graphics::composer3::impl {
using AidlColorMode = ColorMode;

View file

@ -20,9 +20,11 @@
#include <cinttypes>
#include "Utils.h"
#include "aidl/android/hardware/graphics/common/Dataspace.h"
#include "aidl/android/hardware/graphics/common/DisplayHotplugEvent.h"
#include <aidl/android/hardware/graphics/common/Dataspace.h>
#include <aidl/android/hardware/graphics/common/DisplayHotplugEvent.h>
#include "drm/DrmHwc.h"
#include "hwc/HwcDisplay.h"
namespace aidl::android::hardware::graphics::composer3::impl {

View file

@ -17,10 +17,11 @@
#pragma once
#include <aidl/android/hardware/graphics/composer3/IComposerClient.h>
#include <log/log.h>
#include <cstdint>
#include "utils/log.h"
// NOLINTNEXTLINE
#define DEBUG_FUNC() ALOGV("%s", __func__)

View file

@ -21,7 +21,7 @@
#include <android/binder_process.h>
#include <sched.h>
#include "Composer.h"
#include "hwc3/Composer.h"
#include "utils/log.h"
using aidl::android::hardware::graphics::composer3::impl::Composer;

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "stats/CompositionStats.h"
#include "CompositionStats.h"
namespace android::drm_hwcomposer {

View file

@ -18,8 +18,8 @@
#include <memory>
#include "CompositionStats.h"
#include "compositor/CompositionPlanner.h"
#include "stats/CompositionStats.h"
namespace android::drm_hwcomposer {

View file

@ -25,9 +25,9 @@
#include <aidl/android/frameworks/stats/IStats.h>
#include <android/binder_manager.h>
#include "CompositionStats.h"
#include "compositor/CompositionPlanner.h"
#include "desktopatoms.h"
#include "stats/CompositionStats.h"
#include "utils/log.h"
using aidl::android::frameworks::stats::IStats;

View file

@ -16,8 +16,6 @@
#pragma once
#include "stats/CompositionStats.h"
#include <condition_variable>
#include <memory>
#include <mutex>
@ -25,6 +23,8 @@
#include <android-base/thread_annotations.h>
#include "stats/CompositionStats.h"
namespace android::drm_hwcomposer {
class CompositionStatsAtomReporter;

View file

@ -18,9 +18,12 @@
#if HAS_LIBDISPLAY_INFO
#include "EdidWrapper.h"
#include <ui/GraphicTypes.h>
#include "utils/EdidWrapper.h"
#include "compositor/DisplayInfo.h"
#include "drm/DrmUnique.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {

View file

@ -26,8 +26,8 @@
#include <optional>
#include <string>
#include "fd.h"
#include "log.h"
#include "utils/fd.h"
#include "utils/log.h"
namespace android::drm_hwcomposer {