summaryrefslogtreecommitdiffstats
path: root/sdm
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-05-08 23:08:57 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-05-08 23:08:57 -0700
commit1f4f1bdbb98b15af2abc48cbf5764931f0f1e26f (patch)
tree4e2628a5a12ae7e73091f46cee03f54c321a55da /sdm
parent533df36ef8dfa92a9ab64d3079739b417a62c143 (diff)
parentf125251d7d8d1e849cbbdb996f2c7eb4f07376f3 (diff)
downloadandroid_hardware_qcom_sdm710_display-1f4f1bdbb98b15af2abc48cbf5764931f0f1e26f.tar.gz
android_hardware_qcom_sdm710_display-1f4f1bdbb98b15af2abc48cbf5764931f0f1e26f.tar.bz2
android_hardware_qcom_sdm710_display-1f4f1bdbb98b15af2abc48cbf5764931f0f1e26f.zip
Merge "sdm: Add missing default initializations"
Diffstat (limited to 'sdm')
-rw-r--r--sdm/include/private/hw_info_types.h71
-rw-r--r--sdm/libs/core/resource_default.cpp6
2 files changed, 29 insertions, 48 deletions
diff --git a/sdm/include/private/hw_info_types.h b/sdm/include/private/hw_info_types.h
index 456d72a8..c9b01f6b 100644
--- a/sdm/include/private/hw_info_types.h
+++ b/sdm/include/private/hw_info_types.h
@@ -156,8 +156,6 @@ struct HWRotatorInfo {
std::string device_path = "";
float min_downscale = 2.0f;
bool downscale_compression = false;
-
- void Reset() { *this = HWRotatorInfo(); }
};
enum HWQseedStepVersion {
@@ -237,8 +235,6 @@ struct HWResourceInfo {
uint32_t cache_size = 0; // cache size in bytes
HWQseedStepVersion pipe_qseed3_version = kQseed3v2; // only valid when has_qseed3=true
uint32_t min_prefill_lines = 0;
-
- void Reset() { *this = HWResourceInfo(); }
};
struct HWSplitInfo {
@@ -334,8 +330,8 @@ struct HWPanelInfo {
};
struct HWSessionConfig {
- LayerRect src_rect;
- LayerRect dst_rect;
+ LayerRect src_rect {};
+ LayerRect dst_rect {};
uint32_t buffer_count = 0;
bool secure = false;
uint32_t frame_rate = 0;
@@ -366,21 +362,19 @@ enum HWRotatorMode {
struct HWRotateInfo {
int pipe_id = -1; // Not actual pipe id, but the relative DMA id
int writeback_id = -1; // Writeback block id, but this is the same as DMA id
- LayerRect src_roi; // Source crop of each split
- LayerRect dst_roi; // Destination crop of each split
+ LayerRect src_roi {}; // Source crop of each split
+ LayerRect dst_roi {}; // Destination crop of each split
bool valid = false;
int rotate_id = -1; // Actual rotator session id with driver
-
- void Reset() { *this = HWRotateInfo(); }
};
struct HWRotatorSession {
- HWRotateInfo hw_rotate_info[kMaxRotatePerLayer];
+ HWRotateInfo hw_rotate_info[kMaxRotatePerLayer] {};
uint32_t hw_block_count = 0; // number of rotator hw blocks used by rotator session
int session_id = -1; // A handle with Session Manager
- HWSessionConfig hw_session_config;
- LayerBuffer input_buffer; // Input to rotator
- LayerBuffer output_buffer; // Output of rotator, crop width and stride are same
+ HWSessionConfig hw_session_config {};
+ LayerBuffer input_buffer {}; // Input to rotator
+ LayerBuffer output_buffer {}; // Output of rotator, crop width and stride are same
float input_compression = 1.0f;
float output_compression = 1.0f;
bool is_buffer_cached = false;
@@ -420,10 +414,10 @@ struct HWPlane {
int32_t phase_step_x = 0;
int32_t init_phase_y = 0;
int32_t phase_step_y = 0;
- HWPixelExtension left;
- HWPixelExtension top;
- HWPixelExtension right;
- HWPixelExtension bottom;
+ HWPixelExtension left {};
+ HWPixelExtension top {};
+ HWPixelExtension right {};
+ HWPixelExtension bottom {};
uint32_t roi_width = 0;
int32_t preload_x = 0;
int32_t preload_y = 0;
@@ -439,7 +433,7 @@ struct HWScaleData {
} enable;
uint32_t dst_width = 0;
uint32_t dst_height = 0;
- HWPlane plane[MAX_PLANES];
+ HWPlane plane[MAX_PLANES] {};
// scale_v2_data fields
ScalingFilterConfig y_rgb_filter_cfg = kFilterEdgeDirected;
ScalingFilterConfig uv_filter_cfg = kFilterEdgeDirected;
@@ -461,8 +455,7 @@ struct HWScaleData {
uint32_t uv_cir_lut_idx = 0;
uint32_t y_rgb_sep_lut_idx = 0;
uint32_t uv_sep_lut_idx = 0;
-
- HWDetailEnhanceData detail_enhance;
+ HWDetailEnhanceData detail_enhance {};
};
struct HWDestScaleInfo {
@@ -485,17 +478,15 @@ struct HWPipeInfo {
uint8_t rect = 255;
uint32_t pipe_id = 0;
HWSubBlockType sub_block_type = kHWSubBlockMax;
- LayerRect src_roi;
- LayerRect dst_roi;
+ LayerRect src_roi {};
+ LayerRect dst_roi {};
uint8_t horizontal_decimation = 0;
uint8_t vertical_decimation = 0;
- HWScaleData scale_data;
+ HWScaleData scale_data {};
uint32_t z_order = 0;
uint8_t flags = 0;
bool valid = false;
bool is_virtual = 0;
-
- void Reset() { *this = HWPipeInfo(); }
};
struct HWSolidfillStage {
@@ -507,15 +498,12 @@ struct HWSolidfillStage {
};
struct HWLayerConfig {
- HWPipeInfo left_pipe; // pipe for left side of output
- HWPipeInfo right_pipe; // pipe for right side of output
- HWRotatorSession hw_rotator_session;
- HWSolidfillStage hw_solidfill_stage;
-
+ HWPipeInfo left_pipe {}; // pipe for left side of output
+ HWPipeInfo right_pipe {}; // pipe for right side of output
+ HWRotatorSession hw_rotator_session {};
+ HWSolidfillStage hw_solidfill_stage {};
float compression = 1.0f;
bool use_solidfill_stage = false;
-
- void Reset() { *this = HWLayerConfig(); }
};
struct HWHDRLayerInfo {
@@ -533,17 +521,12 @@ struct HWLayersInfo {
LayerStack *stack = NULL; // Input layer stack. Set by the caller.
uint32_t app_layer_count = 0; // Total number of app layers. Must not be 0.
uint32_t gpu_target_index = 0; // GPU target layer index. 0 if not present.
-
std::vector<Layer> hw_layers = {}; // Layers which need to be programmed on the HW
-
- std::vector<uint32_t> index; // Indexes of the layers from the layer stack which need to
- // be programmed on hardware.
- std::vector<uint32_t> roi_index; // Stores the ROI index where the layers are visible.
-
+ std::vector<uint32_t> index {}; // Indexes of the layers from the layer stack which need to
+ std::vector<uint32_t> roi_index {}; // Stores the ROI index where the layers are visible.
int sync_handle = -1; // Release fence id for current draw cycle.
int set_idle_time_ms = -1; // Set idle time to the new specified value.
// -1 indicates no change in idle time since last set value.
-
std::vector<LayerRect> left_frame_roi = {}; // Left ROI.
std::vector<LayerRect> right_frame_roi = {}; // Right ROI.
LayerRect partial_fb_roi = {}; // Damaged area in framebuffer.
@@ -567,8 +550,8 @@ struct HWQosData {
};
struct HWLayers {
- HWLayersInfo info;
- HWLayerConfig config[kMaxSDELayers];
+ HWLayersInfo info {};
+ HWLayerConfig config[kMaxSDELayers] {};
float output_compression = 1.0f;
HWQosData qos_data = {};
HWAVRInfo hw_avr_info = {};
@@ -581,12 +564,10 @@ struct HWDisplayAttributes : DisplayConfigVariableInfo {
uint32_t v_pulse_width = 0; //!< Vertical pulse width of panel
uint32_t h_total = 0; //!< Total width of panel (hActive + hFP + hBP + hPulseWidth)
uint32_t v_total = 0; //!< Total height of panel (vActive + vFP + vBP + vPulseWidth)
- std::bitset<32> s3d_config; //!< Stores the bit mask of S3D modes
+ std::bitset<32> s3d_config {}; //!< Stores the bit mask of S3D modes
uint32_t clock_khz = 0; //!< Stores the pixel clock of panel in khz
HWTopology topology = kUnknown; //!< Stores the topology information.
- void Reset() { *this = HWDisplayAttributes(); }
-
bool operator !=(const HWDisplayAttributes &display_attributes) {
return ((is_device_split != display_attributes.is_device_split) ||
(x_pixels != display_attributes.x_pixels) ||
diff --git a/sdm/libs/core/resource_default.cpp b/sdm/libs/core/resource_default.cpp
index f8909f47..e8cce43f 100644
--- a/sdm/libs/core/resource_default.cpp
+++ b/sdm/libs/core/resource_default.cpp
@@ -478,7 +478,7 @@ DisplayError ResourceDefault::SrcSplitConfig(DisplayResourceContext *display_res
left_pipe->src_roi = src_rect;
left_pipe->dst_roi = dst_rect;
left_pipe->valid = true;
- right_pipe->Reset();
+ *right_pipe = {};
}
return kErrorNone;
@@ -515,8 +515,8 @@ DisplayError ResourceDefault::DisplaySplitConfig(DisplayResourceContext *display
}
// Reset left_pipe and right_pipe to invalid by default
- left_pipe->Reset();
- right_pipe->Reset();
+ *left_pipe = {};
+ *right_pipe = {};
if (crop_left_valid) {
// assign left pipe