From bfa855c7b550e0536a2736f18dd3554b155e406e Mon Sep 17 00:00:00 2001 From: Rohit Kulkarni Date: Thu, 29 Jun 2017 17:52:10 -0700 Subject: [PATCH] sdm: Qseed3 scalar updates - New 2D alpha interpolation config mode for scalar. - Recognize qseed3 versions. Change-Id: I4fb93e2c5f6280a4ac2627d00d2d573af10e70fe CRs-Fixed: 2069565 --- libdrmutils/drm_interface.h | 8 ++++++++ sdm/include/private/hw_info_types.h | 8 ++++++++ sdm/libs/core/drm/hw_info_drm.cpp | 18 ++++++++++++++++++ sdm/libs/core/drm/hw_info_drm.h | 1 - sdm/libs/core/drm/hw_scale_drm.cpp | 2 ++ 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/libdrmutils/drm_interface.h b/libdrmutils/drm_interface.h index 35285eed..91cee487 100644 --- a/libdrmutils/drm_interface.h +++ b/libdrmutils/drm_interface.h @@ -318,6 +318,13 @@ enum struct QSEEDVersion { V3, }; +/* QSEED3 Step version */ +enum struct QSEEDStepVersion { + V2, + V3, + V4, +}; + enum struct SmartDMARevision { V1, V2, @@ -372,6 +379,7 @@ struct DRMPlaneTypeInfo { uint32_t max_vertical_deci; uint64_t max_pipe_bandwidth; uint32_t cache_size; // cache size in bytes for inline rotation support. + QSEEDStepVersion qseed3_version; }; // All DRM Planes as map listed from highest to lowest priority diff --git a/sdm/include/private/hw_info_types.h b/sdm/include/private/hw_info_types.h index 752d0c44..b12287e4 100644 --- a/sdm/include/private/hw_info_types.h +++ b/sdm/include/private/hw_info_types.h @@ -88,6 +88,7 @@ enum HWSubBlockType { enum HWAlphaInterpolation { kInterpolationPixelRepeat, kInterpolationBilinear, + kInterpolation2D, kInterpolationMax, }; @@ -136,6 +137,12 @@ struct HWRotatorInfo { void Reset() { *this = HWRotatorInfo(); } }; +enum HWQseedStepVersion { + kQseed3v2, + kQseed3v3, + kQseed3v4, +}; + struct HWDestScalarInfo { uint32_t count = 0; uint32_t max_input_width = 0; @@ -205,6 +212,7 @@ struct HWResourceInfo { CompRatioMap comp_ratio_rt_map; CompRatioMap comp_ratio_nrt_map; uint32_t cache_size = 0; // cache size in bytes + HWQseedStepVersion pipe_qseed3_version = kQseed3v2; // only valid when has_qseed3=true void Reset() { *this = HWResourceInfo(); } }; diff --git a/sdm/libs/core/drm/hw_info_drm.cpp b/sdm/libs/core/drm/hw_info_drm.cpp index 69af1bd4..b8eb564e 100644 --- a/sdm/libs/core/drm/hw_info_drm.cpp +++ b/sdm/libs/core/drm/hw_info_drm.cpp @@ -101,6 +101,23 @@ class DRMLoggerImpl : public DRMLogger { char buf_[1024] = {}; }; +static HWQseedStepVersion GetQseedStepVersion(sde_drm::QSEEDStepVersion drm_version) { + HWQseedStepVersion sdm_version; + switch (drm_version) { + case sde_drm::QSEEDStepVersion::V2: + default: + sdm_version = kQseed3v2; + break; + case sde_drm::QSEEDStepVersion::V3: + sdm_version = kQseed3v3; + break; + case sde_drm::QSEEDStepVersion::V4: + sdm_version = kQseed3v4; + break; + } + return sdm_version; +} + HWResourceInfo *HWInfoDRM::hw_resource_ = nullptr; HWInfoDRM::HWInfoDRM() { @@ -374,6 +391,7 @@ void HWInfoDRM::PopulatePipeCaps(const sde_drm::DRMPlaneTypeInfo &info, hw_resource->has_decimation = info.max_horizontal_deci > 1 && info.max_vertical_deci > 1; hw_resource->max_pipe_bw = info.max_pipe_bandwidth / kKiloUnit; hw_resource->cache_size = info.cache_size; + hw_resource->pipe_qseed3_version = GetQseedStepVersion(info.qseed3_version); } void HWInfoDRM::PopulateSupportedFmts(HWSubBlockType sub_blk_type, diff --git a/sdm/libs/core/drm/hw_info_drm.h b/sdm/libs/core/drm/hw_info_drm.h index 5d92c41b..78835928 100644 --- a/sdm/libs/core/drm/hw_info_drm.h +++ b/sdm/libs/core/drm/hw_info_drm.h @@ -64,7 +64,6 @@ class HWInfoDRM: public HWInfoInterface { HWResourceInfo *hw_resource); void PopulatePipeCaps(const sde_drm::DRMPlaneTypeInfo &info, HWResourceInfo *hw_resource); - sde_drm::DRMManagerInterface *drm_mgr_intf_ = {}; bool default_mode_ = false; diff --git a/sdm/libs/core/drm/hw_scale_drm.cpp b/sdm/libs/core/drm/hw_scale_drm.cpp index 96f084e0..de0ccb28 100644 --- a/sdm/libs/core/drm/hw_scale_drm.cpp +++ b/sdm/libs/core/drm/hw_scale_drm.cpp @@ -58,6 +58,8 @@ static uint32_t GetAlphaInterpolation(HWAlphaInterpolation alpha_filter_cfg) { return FILTER_ALPHA_DROP_REPEAT; case kInterpolationBilinear: return FILTER_ALPHA_BILINEAR; + case kInterpolation2D: + return FILTER_ALPHA_2D; default: DLOGE("Invalid Alpha Interpolation"); return kInterpolationMax;