hwc: utils: Include orientation while screen-fitting.
MDP doesn't like out-of-screen-bounds parameters. So based on the position of
the layer, we adjust the portion of layer the MDP should pick.
However, this did not factor in orientation, so far. This patch does that and
allows panning to work in other orientations, without having to use GPU.
Bug: 7313955
Change-Id: Ice17ad144abcd60279c2ef9ad87fc617a1bd3621
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/libhwcomposer/hwc_video.cpp b/libhwcomposer/hwc_video.cpp
index cb5cf1e..77c9328 100644
--- a/libhwcomposer/hwc_video.cpp
+++ b/libhwcomposer/hwc_video.cpp
@@ -143,6 +143,10 @@
ovutils::PipeArgs pargs[ovutils::MAX_PIPES] = { parg, parg, parg };
ov.setSource(pargs, ovutils::OV_PIPE0);
+ int transform = layer->transform & FINAL_TRANSFORM_MASK;
+ ovutils::eTransform orient =
+ static_cast<ovutils::eTransform>(transform);
+
hwc_rect_t sourceCrop = layer->sourceCrop;
hwc_rect_t displayFrame = layer->displayFrame;
@@ -157,7 +161,8 @@
displayFrame.top < 0 ||
displayFrame.right > fbWidth ||
displayFrame.bottom > fbHeight) {
- calculate_crop_rects(sourceCrop, displayFrame, fbWidth, fbHeight);
+ calculate_crop_rects(sourceCrop, displayFrame, fbWidth, fbHeight,
+ transform);
}
// source crop x,y,w,h
@@ -167,9 +172,6 @@
//Only for Primary
ov.setCrop(dcrop, ovutils::OV_PIPE0);
- int transform = layer->transform;
- ovutils::eTransform orient =
- static_cast<ovutils::eTransform>(transform);
ov.setTransform(orient, ovutils::OV_PIPE0);
// position x,y,w,h