From db76cc05a0b2c576448cade7671da6216e30efbf Mon Sep 17 00:00:00 2001 From: "Arun Kumar K.R" Date: Tue, 28 Aug 2012 18:33:09 -0700 Subject: [PATCH] display: Add support for video rotation on Ext display - sourceTransform in the hwc_layer_t has the source buffer transform, use this transform for external display. - This helps in showing videos with source orientation properly on the external display - Remove unsed flag FINAL_TRANSFORM_MASK Change-Id: I66f7db95166c51ecee8b6b5cc126a67df3dd4602 CRs-fixed: 387357 --- libhwcomposer/hwc_copybit.cpp | 2 -- libhwcomposer/hwc_pip.cpp | 8 ++------ libhwcomposer/hwc_utils.h | 1 - libhwcomposer/hwc_video.cpp | 5 +---- libqdutils/qcom_ui.cpp | 15 +++++++-------- libqdutils/qcom_ui.h | 7 ------- 6 files changed, 10 insertions(+), 28 deletions(-) diff --git a/libhwcomposer/hwc_copybit.cpp b/libhwcomposer/hwc_copybit.cpp index 6717272..2937e9e 100644 --- a/libhwcomposer/hwc_copybit.cpp +++ b/libhwcomposer/hwc_copybit.cpp @@ -252,8 +252,6 @@ int CopyBit::drawLayerUsingCopybit(hwc_context_t *dev, hwc_layer_t *layer, // this needs to change to accomodate vertical stride // if needed in the future src.vert_padding = 0; - // Remove the srcBufferTransform if any - layer->transform = (layer->transform & FINAL_TRANSFORM_MASK); // Copybit source rect hwc_rect_t sourceCrop = layer->sourceCrop; diff --git a/libhwcomposer/hwc_pip.cpp b/libhwcomposer/hwc_pip.cpp index 1ac1c5e..89cca8f 100644 --- a/libhwcomposer/hwc_pip.cpp +++ b/libhwcomposer/hwc_pip.cpp @@ -25,8 +25,6 @@ namespace qhwc { -#define FINAL_TRANSFORM_MASK 0x000F - //Static Members ovutils::eOverlayState VideoPIP::sState = ovutils::OV_CLOSED; int VideoPIP::sYuvCount = 0; @@ -165,9 +163,8 @@ bool configPrimaryVideo(hwc_context_t *ctx, hwc_layer_t *layer) { //Only for Primary ov.setCrop(dcrop, ovutils::OV_PIPE0); - int transform = layer->transform & FINAL_TRANSFORM_MASK; ovutils::eTransform orient = - static_cast(transform); + static_cast(layer->transform); ov.setTransform(orient, ovutils::OV_PIPE0); ov.setPosition(dpos, ovutils::OV_PIPE0); @@ -246,9 +243,8 @@ bool configPIPVideo(hwc_context_t *ctx, hwc_layer_t *layer) { //Only for Primary ov.setCrop(dcrop, ovutils::OV_PIPE1); - int transform = layer->transform & FINAL_TRANSFORM_MASK; ovutils::eTransform orient = - static_cast(transform); + static_cast(layer->transform); ov.setTransform(orient, ovutils::OV_PIPE1); ov.setPosition(dpos, ovutils::OV_PIPE1); diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h index 51c9491..dfac883 100644 --- a/libhwcomposer/hwc_utils.h +++ b/libhwcomposer/hwc_utils.h @@ -24,7 +24,6 @@ #define ALIGN_TO(x, align) (((x) + ((align)-1)) & ~((align)-1)) #define LIKELY( exp ) (__builtin_expect( (exp) != 0, true )) #define UNLIKELY( exp ) (__builtin_expect( (exp) != 0, false )) -#define FINAL_TRANSFORM_MASK 0x000F //Fwrd decls struct hwc_context_t; diff --git a/libhwcomposer/hwc_video.cpp b/libhwcomposer/hwc_video.cpp index 78784cf..62749ba 100644 --- a/libhwcomposer/hwc_video.cpp +++ b/libhwcomposer/hwc_video.cpp @@ -23,8 +23,6 @@ namespace qhwc { -#define FINAL_TRANSFORM_MASK 0x000F - //Static Members ovutils::eOverlayState VideoOverlay::sState = ovutils::OV_CLOSED; int VideoOverlay::sYuvCount = 0; @@ -157,9 +155,8 @@ bool configPrimVid(hwc_context_t *ctx, hwc_layer_t *layer) { //Only for Primary ov.setCrop(dcrop, ovutils::OV_PIPE0); - int transform = layer->transform & FINAL_TRANSFORM_MASK; ovutils::eTransform orient = - static_cast(transform); + static_cast(layer->transform); ov.setTransform(orient, ovutils::OV_PIPE0); // position x,y,w,h diff --git a/libqdutils/qcom_ui.cpp b/libqdutils/qcom_ui.cpp index d060439..6b8652b 100644 --- a/libqdutils/qcom_ui.cpp +++ b/libqdutils/qcom_ui.cpp @@ -619,7 +619,6 @@ void dumpLayer(int moduleCompositionType, int listFlags, size_t layerIndex, hwc_rect_t displayFrame = layer->displayFrame; private_handle_t *hnd = (private_handle_t *)layer->handle; char pixelformatstr[32] = "None"; - uint32_t transform = layer->transform & FINAL_TRANSFORM_MASK; if (hnd) getHalPixelFormatStr(hnd->format, pixelformatstr); @@ -644,13 +643,13 @@ void dumpLayer(int moduleCompositionType, int listFlags, size_t layerIndex, (layer->compositionType == HWC_OVERLAY)? "Overlay": (layer->compositionType == HWC_USE_COPYBIT)? "Copybit": "???", pixelformatstr, - (transform == Transform::ROT_0)? "ROT_0": - (transform == Transform::FLIP_H)? "FLIP_H": - (transform == Transform::FLIP_V)? "FLIP_V": - (transform == Transform::ROT_90)? "ROT_90": - (transform == Transform::ROT_180)? "ROT_180": - (transform == Transform::ROT_270)? "ROT_270": - (transform == Transform::ROT_INVALID)? "ROT_INVALID":"???", + (layer->transform == Transform::ROT_0)? "ROT_0": + (layer->transform == Transform::FLIP_H)? "FLIP_H": + (layer->transform == Transform::FLIP_V)? "FLIP_V": + (layer->transform == Transform::ROT_90)? "ROT_90": + (layer->transform == Transform::ROT_180)? "ROT_180": + (layer->transform == Transform::ROT_270)? "ROT_270": + (layer->transform == Transform::ROT_INVALID)? "ROT_INVALID":"???", (layer->flags == 0)? "[None]":"", (layer->flags & HWC_SKIP_LAYER)? "[Skip layer]":"", (layer->flags & HWC_LAYER_NOT_UPDATING)? "[Layer not updating]":"", diff --git a/libqdutils/qcom_ui.h b/libqdutils/qcom_ui.h index 6a96978..ba006cb 100644 --- a/libqdutils/qcom_ui.h +++ b/libqdutils/qcom_ui.h @@ -73,13 +73,6 @@ enum { LAYER_ASYNCHRONOUS = 1<<1, }; -/* - * Layer Transformation - refers to Layer::setGeometry() - */ -#define SHIFT_SRC_TRANSFORM 4 -#define SRC_TRANSFORM_MASK 0x00F0 -#define FINAL_TRANSFORM_MASK 0x000F - /* * Flags set by the layer and sent to HWC */