summaryrefslogtreecommitdiff
path: root/sdm/libs/hwc2/hwc_layers.cpp
diff options
context:
space:
mode:
authorRamkumar Radhakrishnan <ramkumar@codeaurora.org>2016-08-26 22:37:23 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-28 11:14:48 -0700
commitb27735ff9406f8cd8d642a3a4ec9388fcdade659 (patch)
treee249d6e3f5d2892c44e8a09a00e6ae98a463c5e2 /sdm/libs/hwc2/hwc_layers.cpp
parent81c6c49dc4c14a668075d41ac943656203580083 (diff)
downloaddisplay-b27735ff9406f8cd8d642a3a4ec9388fcdade659.tar.gz
sdm: Add rect mapping and interface to store actual resolution
1. Add rectangle mapping function to map a rectangle from one coordinate system to another coordinate system. 2. Add unaligned_width and unaligned_height in layer buffer to store the actual buffer resolution without alignment. 3. Populate unaligned width and height information of SDM layer buffer from private handle Change-Id: Ic4c03cc5779418959732332d26b8ecb59c2483b5 CRs-Fixed: 1040942
Diffstat (limited to 'sdm/libs/hwc2/hwc_layers.cpp')
-rw-r--r--sdm/libs/hwc2/hwc_layers.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/sdm/libs/hwc2/hwc_layers.cpp b/sdm/libs/hwc2/hwc_layers.cpp
index a18cb4a8..588ee8c3 100644
--- a/sdm/libs/hwc2/hwc_layers.cpp
+++ b/sdm/libs/hwc2/hwc_layers.cpp
@@ -75,8 +75,18 @@ HWC2::Error HWCLayer::SetLayerBuffer(buffer_handle_t buffer, int32_t acquire_fen
}
LayerBuffer *layer_buffer = layer_->input_buffer;
- layer_buffer->width = UINT32(handle->width);
- layer_buffer->height = UINT32(handle->height);
+ int aligned_width, aligned_height;
+ int unaligned_width, unaligned_height;
+
+ AdrenoMemInfo::getInstance().getAlignedWidthAndHeight(handle, aligned_width, aligned_height);
+ AdrenoMemInfo::getInstance().getUnalignedWidthAndHeight(handle, unaligned_width,
+ unaligned_height);
+
+ layer_buffer->width = UINT32(aligned_width);
+ layer_buffer->height = UINT32(aligned_height);
+ layer_buffer->unaligned_width = UINT32(unaligned_width);
+ layer_buffer->unaligned_height = UINT32(unaligned_height);
+
layer_buffer->format = GetSDMFormat(handle->format, handle->flags);
if (SetMetaData(handle, layer_) != kErrorNone) {
return HWC2::Error::BadLayer;
@@ -456,14 +466,6 @@ DisplayError HWCLayer::SetMetaData(const private_handle_t *pvt_handle, Layer *la
layer_buffer->format = GetSDMFormat(INT32(meta_data->linearFormat), 0);
}
- if (meta_data->operation & UPDATE_BUFFER_GEOMETRY) {
- int actual_width = pvt_handle->width;
- int actual_height = pvt_handle->height;
- AdrenoMemInfo::getInstance().getAlignedWidthAndHeight(pvt_handle, actual_width, actual_height);
- layer_buffer->width = UINT32(actual_width);
- layer_buffer->height = UINT32(actual_height);
- }
-
if (meta_data->operation & S3D_FORMAT) {
layer_buffer->s3d_format = GetS3DFormat(meta_data->s3dFormat);
}