You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

229 lines
5.1 KiB

/*
* Copyright (c) Hisilicon Technologies Co., Ltd.. 2016-2019. All rights reserved.
* Description: On behalf of a display device, hwcomposer is called for composition and sent for display
* Author: Hisilicon
* Created: 2019.12.02
*/
#include "HWCIapiAdapter.h"
#include "HWCCallbacks.h"
#include "HWCCommon.h"
#include "HWCLayer.h"
#include "HWCIapiComImpl.h"
namespace android {
HWCIapiAdapter& HWCIapiAdapter::GetInstance()
{
static std::unique_ptr<HWCIapiAdapter> sInstance;
static std::once_flag sOnceFlag;
std::call_once(sOnceFlag, [] { sInstance.reset(new HWCIapiComImpl()); });
return *sInstance.get();
}
bool HWCIapiAdapter::IsDisplayConnected(const int dislpay)
{
UNUSED(dislpay);
return false;
}
int HWCIapiAdapter::GetHdmiMaxPara(const int displayId, float &maxWidth, float &maxHeight)
{
UNUSED(displayId);
UNUSED(maxWidth);
UNUSED(maxHeight);
return HWC_FAILURE;
}
int HWCIapiAdapter::RegisterHdmiCallback(const int displayId, HWCHdmiCallback callback)
{
UNUSED(displayId);
UNUSED(callback);
return HWC_FAILURE;
}
int HWCIapiAdapter::UnregisterHdmiCallback(const int displayId)
{
UNUSED(displayId);
return HWC_FAILURE;
}
int HWCIapiAdapter::InitIapiModules()
{
return HWC_FAILURE;
}
int HWCIapiAdapter::DeInitIapiModules()
{
return HWC_FAILURE;
}
int HWCIapiAdapter::GetFbDevId(const hwc2_display_t displayId) const
{
UNUSED(displayId);
return 0;
}
int HWCIapiAdapter::GetExternalDisplayStatus(uapi_disp_state *state)
{
UNUSED(state);
return HWC_FAILURE;
}
bool HWCIapiAdapter::IsDisplaySwitched()
{
return false;
}
void HWCIapiAdapter::UpdateVirtualScreen(const uint64_t displayId, const unsigned int width,
const unsigned int height) const
{
UNUSED(displayId);
UNUSED(width);
UNUSED(height);
return;
}
void HWCIapiAdapter::SetVoWindowPosition(const native_handle_t &sideband, const hwc_rect_t &hwcRect, int zorder,
int absZorder) const
{
UNUSED(sideband);
UNUSED(hwcRect);
UNUSED(zorder);
UNUSED(absZorder);
return;
}
void HWCIapiAdapter::DisableVoWindow(const native_handle_t &sideband) const
{
UNUSED(sideband);
return;
}
int HWCIapiAdapter::OpenGfx2dAndInitCapability()
{
return HWC_FAILURE;
}
int HWCIapiAdapter::CloseGfx2d()
{
return HWC_FAILURE;
}
int HWCIapiAdapter::PrepareGfx2dBasicArg(const int layerNumber)
{
UNUSED(layerNumber);
return HWC_FAILURE;
}
int HWCIapiAdapter::PrepareGfx2dLayerArg(const HWCLayer &layer, const unsigned int i, const int fbWidht,
const int fbHeight, const bool isAsync)
{
UNUSED(layer);
UNUSED(i);
UNUSED(fbWidht);
UNUSED(fbHeight);
UNUSED(fbWidht);
return isAsync;
}
int HWCIapiAdapter::PrepareGfx2dDestArg(const int framebufferFd, const HWCBuffer &fbBuffer,
const bool hwcCompress)
{
UNUSED(framebufferFd);
UNUSED(fbBuffer);
UNUSED(hwcCompress);
return HWC_FAILURE;
}
int HWCIapiAdapter::Gfx2dCompose(int layerReleaseFence[], const int layerNumber, int &fbRealeaseFence,
const bool isAsync)
{
UNUSED(layerReleaseFence);
UNUSED(layerNumber);
UNUSED(fbRealeaseFence);
UNUSED(isAsync);
return HWC_FAILURE;
}
void HWCIapiAdapter::PostGfx2dCompose()
{
return;
}
int HWCIapiAdapter::FreshDirect(const int framebufferFd, HWCBuffer &layerBuffer) const
{
UNUSED(framebufferFd);
UNUSED(layerBuffer);
return HWC_FAILURE;
}
int HWCIapiAdapter::FreshFb(const int framebufferFd, HWCBuffer &fbBuffer, const int composeType,
const bool hwcCompress, const bool discardFrame) const
{
UNUSED(framebufferFd);
UNUSED(fbBuffer);
UNUSED(composeType);
UNUSED(hwcCompress);
UNUSED(discardFrame);
return HWC_FAILURE;
}
int HWCIapiAdapter::GetHdrInfo(const hwc2_display_t display, HdrCap &info) const
{
UNUSED(display);
UNUSED(info);
return HWC_FAILURE;
}
int64_t HWCIapiAdapter::GetVsyncTime(const int framebufferFd, unsigned int &freshRate) const
{
UNUSED(freshRate);
UNUSED(framebufferFd);
return HWC_FAILURE;
}
int HWCIapiAdapter::InitDisplayConfigs(const hwc2_display_t display, DisplayConfigs &configs,
const framebuffer_device_t &device, unsigned int &active) const
{
UNUSED(display);
DisplayConfigInfo displayConfig = { device.width, device.height, device.xdpi, device.ydpi, device.fps };
configs.clear();
configs.emplace(0, displayConfig);
active = 0;
return HWC_SUCCESS;
}
bool HWCIapiAdapter::IsSupportGfx2dCompose()
{
return false;
}
bool HWCIapiAdapter::CheckLayerNum(const size_t layerSize) const
{
UNUSED(layerSize);
return true;
}
bool HWCIapiAdapter::CheckLayerSize(const unsigned int cropWidth, const unsigned int cropHeight,
const unsigned int dispWidth, const unsigned int dispHeight) const
{
UNUSED(cropWidth);
UNUSED(cropHeight);
UNUSED(dispWidth);
UNUSED(dispHeight);
return true;
}
bool HWCIapiAdapter::CheckResizeNum(const int layerNum, const int videoLayerNum) const
{
UNUSED(layerNum);
UNUSED(videoLayerNum);
return true;
}
void HWCIapiAdapter::SetDispPowerState(const int displayId, const HWC2::PowerMode mode) const
{
UNUSED(displayId);
UNUSED(mode);
}
} // namespace android