diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-06-30 22:36:20 -0600 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2016-06-30 22:36:20 -0600 |
| commit | 30d7aed7ec8a6da8d6c8a19dacec9a3c7a815a02 (patch) | |
| tree | 4cb752409b64d1a4e91ec85ba0173d5148322cb9 | |
| parent | a9a43857334b27654eb7ddf375cff2eb7e9ceaba (diff) | |
| parent | e81f027c38e8c55880beea16a536e04d761f3930 (diff) | |
| download | hardware_qcom_display-30d7aed7ec8a6da8d6c8a19dacec9a3c7a815a02.tar.gz hardware_qcom_display-30d7aed7ec8a6da8d6c8a19dacec9a3c7a815a02.tar.bz2 hardware_qcom_display-30d7aed7ec8a6da8d6c8a19dacec9a3c7a815a02.zip | |
Promotion of display.lnx.2.0-00039.
CRs Change ID Subject
--------------------------------------------------------------------------------------------------------------
999055 Ie78b0310ac5212f41bbd46f4f049ecdde623822d sdm: Remain display framerate after dynamic resolution c
1036562 I167d487f9ee769dcf1ae26e68fc63fd8d94653f8 sdm: Fix dynamic refresh rate setting during S3D video p
999055 Ic39d0c0dd47c71e8a677d1e52af2c485494235b3 sdm: Notify surfaceflinger to draw S3D framebuffer targe
1036562 Ie055238da203de58d4a0e5310659e9277c71d602 sdm: Fix rotator input buffer fence initialization for S
1036562 Ib22e16cfe75f558531196b990e6d5a40310c8ead hdmi: Set correct S3D configuration on bootup
Change-Id: Ic3a5c129bf81aedd33e5aaf33c43c56f1d50ca81
CRs-Fixed: 999055, 1036562
| -rw-r--r-- | libqdutils/qdMetaData.cpp | 42 | ||||
| -rw-r--r-- | libqdutils/qdMetaData.h | 13 | ||||
| -rw-r--r-- | sdm/include/core/layer_stack.h | 4 | ||||
| -rw-r--r-- | sdm/include/private/hw_info_types.h | 3 | ||||
| -rw-r--r-- | sdm/libs/core/fb/hw_device.cpp | 2 | ||||
| -rw-r--r-- | sdm/libs/core/fb/hw_hdmi.cpp | 23 | ||||
| -rw-r--r-- | sdm/libs/core/fb/hw_hdmi.h | 4 | ||||
| -rw-r--r-- | sdm/libs/hwc/hwc_display.cpp | 16 | ||||
| -rw-r--r-- | sdm/libs/hwc/hwc_display_external.cpp | 2 | ||||
| -rw-r--r-- | sdm/libs/hwc/hwc_session.cpp | 2 |
10 files changed, 93 insertions, 18 deletions
diff --git a/libqdutils/qdMetaData.cpp b/libqdutils/qdMetaData.cpp index 72edfdf4c..279a4d803 100644 --- a/libqdutils/qdMetaData.cpp +++ b/libqdutils/qdMetaData.cpp @@ -87,6 +87,44 @@ int setMetaData(private_handle_t *handle, DispParamType paramType, case SET_SINGLE_BUFFER_MODE: data->isSingleBufferMode = *((uint32_t *)param); break; + case SET_S3D_RENDER: + data->s3dRender = *((S3DSFRender_t *)param); + break; + default: + ALOGE("Unknown paramType %d", paramType); + break; + } + if(munmap(base, size)) + ALOGE("%s: failed to unmap ptr %p, err %d", __func__, (void*)base, + errno); + return 0; +} + +int clearMetaData(private_handle_t *handle, DispParamType paramType) { + if (!handle) { + ALOGE("%s: Private handle is null!", __func__); + return -1; + } + if (handle->fd_metadata == -1) { + ALOGE("%s: Bad fd for extra data!", __func__); + return -1; + } + + unsigned long size = ROUND_UP_PAGESIZE(sizeof(MetaData_t)); + void *base = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, + handle->fd_metadata, 0); + if (base == reinterpret_cast<void*>(MAP_FAILED)) { + ALOGE("%s: mmap() failed: error is %s!", __func__, strerror(errno)); + return -1; + } + MetaData_t *data = reinterpret_cast <MetaData_t *>(base); + data->operation &= ~paramType; + switch (paramType) { + case SET_S3D_RENDER: + data->s3dRender.DisplayId = 0; + data->s3dRender.GpuRender = 0; + data->s3dRender.GpuS3dFormat = 0; + break; default: ALOGE("Unknown paramType %d", paramType); break; @@ -120,7 +158,6 @@ int getMetaData(private_handle_t *handle, DispFetchParamType paramType, } MetaData_t *data = reinterpret_cast <MetaData_t *>(base); - data->operation |= paramType; switch (paramType) { case GET_PP_PARAM_INTERLACED: *((int32_t *)param) = data->interlaced; @@ -149,6 +186,9 @@ int getMetaData(private_handle_t *handle, DispFetchParamType paramType, case GET_SINGLE_BUFFER_MODE: *((uint32_t *)param) = data->isSingleBufferMode ; break; + case GET_S3D_RENDER: + *((S3DSFRender_t *)param) = data->s3dRender; + break; default: ALOGE("Unknown paramType %d", paramType); break; diff --git a/libqdutils/qdMetaData.h b/libqdutils/qdMetaData.h index fd4f4447a..9a33eee8d 100644 --- a/libqdutils/qdMetaData.h +++ b/libqdutils/qdMetaData.h @@ -57,6 +57,12 @@ struct BufferDim_t { int32_t sliceHeight; }; +struct S3DSFRender_t { + uint32_t DisplayId; + uint32_t GpuRender; + uint32_t GpuS3dFormat; +}; + struct MetaData_t { int32_t operation; int32_t interlaced; @@ -79,6 +85,8 @@ struct MetaData_t { /* Set by graphics to indicate that this buffer will be written to but not * swapped out */ uint32_t isSingleBufferMode; + /* Indicate GPU to help draw S3D layer on dedicate display device */ + struct S3DSFRender_t s3dRender; }; enum DispParamType { @@ -97,6 +105,7 @@ enum DispParamType { LINEAR_FORMAT = 0x1000, SET_IGC = 0x2000, SET_SINGLE_BUFFER_MODE = 0x4000, + SET_S3D_RENDER = 0x8000, }; enum DispFetchParamType { @@ -109,6 +118,7 @@ enum DispFetchParamType { GET_LINEAR_FORMAT = 0x1000, GET_IGC = 0x2000, GET_SINGLE_BUFFER_MODE = 0x4000, + GET_S3D_RENDER = 0x8000, }; struct private_handle_t; @@ -119,6 +129,9 @@ int getMetaData(struct private_handle_t *handle, enum DispFetchParamType paramTy void *param); int copyMetaData(struct private_handle_t *src, struct private_handle_t *dst); + +int clearMetaData(struct private_handle_t *handle, enum DispParamType paramType); + #ifdef __cplusplus } #endif diff --git a/sdm/include/core/layer_stack.h b/sdm/include/core/layer_stack.h index 34c68fec6..2e3015f34 100644 --- a/sdm/include/core/layer_stack.h +++ b/sdm/include/core/layer_stack.h @@ -66,6 +66,10 @@ enum LayerComposition { //!< device will mark the layer for GPU composition if it can not handle //!< it completely. + kCompositionGPUS3D, //!< This layer will be drawn onto the target buffer in s3d mode by GPU. + //!< Display device will mark the layer for GPU composition if it can not + //!< handle it completely. + kCompositionSDE, //!< This layer will be handled by SDE. It must not be composed by GPU. kCompositionHWCursor, //!< This layer will be handled by SDE using HWCursor. It must not be diff --git a/sdm/include/private/hw_info_types.h b/sdm/include/private/hw_info_types.h index ec1b6e57e..97573c973 100644 --- a/sdm/include/private/hw_info_types.h +++ b/sdm/include/private/hw_info_types.h @@ -158,6 +158,7 @@ struct HWSplitInfo { }; enum HWS3DMode { + kS3DModeInvalid = -1, kS3DModeNone, kS3DModeLR, kS3DModeRL, @@ -184,7 +185,7 @@ struct HWPanelInfo { bool is_pluggable = false; // Panel is pluggable HWSplitInfo split_info; // Panel split configuration char panel_name[256] = {0}; // Panel name - HWS3DMode s3d_mode = kS3DModeNone; // Panel's current s3d mode. + HWS3DMode s3d_mode = kS3DModeInvalid; // Panel's current s3d mode. int panel_max_brightness = 0; // Max panel brightness bool operator !=(const HWPanelInfo &panel_info) { diff --git a/sdm/libs/core/fb/hw_device.cpp b/sdm/libs/core/fb/hw_device.cpp index 2e9e334cd..097ad8bfc 100644 --- a/sdm/libs/core/fb/hw_device.cpp +++ b/sdm/libs/core/fb/hw_device.cpp @@ -437,6 +437,8 @@ DisplayError HWDevice::Commit(HWLayers *hw_layers) { if (hw_rotator_session->hw_block_count) { input_buffer = &hw_rotator_session->output_buffer; + input_buffer->release_fence_fd = Sys::dup_(mdp_commit.release_fence); + continue; } // Make sure the release fence is duplicated only once for each buffer. diff --git a/sdm/libs/core/fb/hw_hdmi.cpp b/sdm/libs/core/fb/hw_hdmi.cpp index ec76b4170..1665d2431 100644 --- a/sdm/libs/core/fb/hw_hdmi.cpp +++ b/sdm/libs/core/fb/hw_hdmi.cpp @@ -220,6 +220,12 @@ DisplayError HWHDMI::ReadEDIDInfo() { return kErrorNone; } +void HWHDMI::PopulateHWPanelInfo() { + HWDevice::PopulateHWPanelInfo(); + hw_panel_info_.s3d_mode = active_s3d_mode_; + DLOGI("S3DMode = %d", hw_panel_info_.s3d_mode); +} + DisplayError HWHDMI::GetDisplayAttributes(uint32_t index, HWDisplayAttributes *display_attributes) { DTRACE_SCOPED(); @@ -652,6 +658,10 @@ bool HWHDMI::IsSupportedS3DMode(HWS3DMode s3d_mode) { } DisplayError HWHDMI::SetS3DMode(HWS3DMode s3d_mode) { + if (active_s3d_mode_ == s3d_mode) { + return kErrorNone; + } + if (!IsSupportedS3DMode(s3d_mode)) { DLOGW("S3D mode is not supported s3d_mode = %d", s3d_mode); return kErrorNotSupported; @@ -663,14 +673,6 @@ DisplayError HWHDMI::SetS3DMode(HWS3DMode s3d_mode) { } msm_hdmi_s3d_mode s3d_mdp_mode = it->second; - if (active_mdp_s3d_mode_ == s3d_mdp_mode) { - // HDMI_S3D_SIDE_BY_SIDE is an mdp mapping for kS3DModeLR and kS3DModeRL s3d modes. So no need - // to update the s3d_mode node. hw_panel_info needs to be updated to differentiate these two s3d - // modes in strategy - hw_panel_info_.s3d_mode = s3d_mode; - return kErrorNone; - } - ssize_t length = -1; char s3d_mode_path[kMaxStringLength] = {'\0'}; char s3d_mode_string[kMaxStringLength] = {'\0'}; @@ -690,7 +692,7 @@ DisplayError HWHDMI::SetS3DMode(HWS3DMode s3d_mode) { return kErrorNotSupported; } - active_mdp_s3d_mode_ = s3d_mdp_mode; + active_s3d_mode_ = s3d_mode; hw_panel_info_.s3d_mode = s3d_mode; Sys::close_(s3d_mode_node); @@ -845,9 +847,6 @@ DisplayError HWHDMI::SetRefreshRate(uint32_t refresh_rate) { return error; } -// GetDisplayAttributes(config_index, &display_attributes_); -// UpdateMixerAttributes(); - frame_rate_ = refresh_rate; active_config_index_ = config_index; diff --git a/sdm/libs/core/fb/hw_hdmi.h b/sdm/libs/core/fb/hw_hdmi.h index 28adc39e6..1be151d7c 100644 --- a/sdm/libs/core/fb/hw_hdmi.h +++ b/sdm/libs/core/fb/hw_hdmi.h @@ -106,6 +106,7 @@ class HWHDMI : public HWDevice { DisplayError GetDynamicFrameRateMode(uint32_t refresh_rate, uint32_t*mode, DynamicFPSData *data, uint32_t *config_index); + void PopulateHWPanelInfo(); uint32_t hdmi_mode_count_; uint32_t hdmi_modes_[256]; // Holds the hdmi timing information. Ex: resolution, fps etc., @@ -114,7 +115,8 @@ class HWHDMI : public HWDevice { uint32_t active_config_index_; std::map<HWS3DMode, msm_hdmi_s3d_mode> s3d_mode_sdm_to_mdp_; std::vector<HWS3DMode> supported_s3d_modes_; - int active_mdp_s3d_mode_ = HDMI_S3D_NONE; + // Reset this variable to ensure valid S3D configuration is set. + HWS3DMode active_s3d_mode_ = kS3DModeInvalid; uint32_t frame_rate_ = 0; }; diff --git a/sdm/libs/hwc/hwc_display.cpp b/sdm/libs/hwc/hwc_display.cpp index 1a2c24400..afae70dcf 100644 --- a/sdm/libs/hwc/hwc_display.cpp +++ b/sdm/libs/hwc/hwc_display.cpp @@ -659,6 +659,10 @@ int HWCDisplay::PrepareLayerStack(hwc_display_contents_1_t *content_list) { hwc_layer_1_t &hwc_layer = content_list->hwLayers[i]; Layer &layer = layer_stack_.layers[i]; LayerComposition composition = layer.composition; + private_handle_t* pvt_handle = static_cast<private_handle_t*> + (const_cast<native_handle_t*>(hwc_layer.handle)); + MetaData_t *meta_data = pvt_handle ? + reinterpret_cast<MetaData_t *>(pvt_handle->base_metadata) : NULL; if ((composition == kCompositionSDE) || (composition == kCompositionHybrid) || (composition == kCompositionBlit)) { @@ -670,6 +674,14 @@ int HWCDisplay::PrepareLayerStack(hwc_display_contents_1_t *content_list) { layer_stack_cache_.in_use = true; } SetComposition(composition, &hwc_layer.compositionType); + + if(meta_data != NULL) { + if (composition == kCompositionGPUS3D) { + meta_data->s3dRender.DisplayId = uint32_t(id_); + meta_data->s3dRender.GpuRender = 1; + meta_data->s3dRender.GpuS3dFormat = layer.input_buffer->s3d_format; + } + } } CacheLayerStackInfo(content_list); @@ -918,6 +930,7 @@ void HWCDisplay::SetComposition(const LayerComposition &source, int32_t *target) switch (source) { case kCompositionGPUTarget: *target = HWC_FRAMEBUFFER_TARGET; break; case kCompositionGPU: *target = HWC_FRAMEBUFFER; break; + case kCompositionGPUS3D: *target = HWC_FRAMEBUFFER; break; case kCompositionHWCursor: *target = HWC_CURSOR_OVERLAY; break; default: *target = HWC_OVERLAY; break; } @@ -1475,7 +1488,8 @@ bool HWCDisplay::SingleVideoLayerUpdating(uint32_t app_layer_count) { for (uint i = 0; i < app_layer_count; i++) { Layer *layer = &layer_stack_.layers[i]; - if (layer->flags.updating && (layer->input_buffer->flags.video == true)) { + if (layer->flags.updating && (layer->input_buffer->flags.video == true) && + (layer->input_buffer->s3d_format == kS3dFormatNone)) { updating_count++; } } diff --git a/sdm/libs/hwc/hwc_display_external.cpp b/sdm/libs/hwc/hwc_display_external.cpp index 47fb2e5fb..ad46783a8 100644 --- a/sdm/libs/hwc/hwc_display_external.cpp +++ b/sdm/libs/hwc/hwc_display_external.cpp @@ -290,7 +290,7 @@ uint32_t HWCDisplayExternal::GetOptimalRefreshRate(bool one_updating_layer) { return metadata_refresh_rate_; } - return max_refresh_rate_; + return current_refresh_rate_; } int HWCDisplayExternal::Perform(uint32_t operation, ...) { diff --git a/sdm/libs/hwc/hwc_session.cpp b/sdm/libs/hwc/hwc_session.cpp index 77b9affee..df7a4ca7a 100644 --- a/sdm/libs/hwc/hwc_session.cpp +++ b/sdm/libs/hwc/hwc_session.cpp @@ -289,7 +289,7 @@ int HWCSession::Prepare(hwc_composer_device_1 *device, size_t num_displays, if (hwc_session->color_mgr_) { HWCDisplay *primary_display = hwc_session->hwc_display_[HWC_DISPLAY_PRIMARY]; - if (primary_display) { + if (primary_display && !hwc_session->is_hdmi_primary_) { int ret = hwc_session->color_mgr_->SolidFillLayersPrepare(displays, primary_display); if (ret) return 0; |
