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
This commit is contained in:
		
				
					committed by
					
						
						Andrew Sutherland
					
				
			
			
				
	
			
			
			
						parent
						
							0dbb7ae83c
						
					
				
				
					commit
					db76cc05a0
				
			@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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<ovutils::eTransform>(transform);
 | 
			
		||||
            static_cast<ovutils::eTransform>(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<ovutils::eTransform>(transform);
 | 
			
		||||
            static_cast<ovutils::eTransform>(layer->transform);
 | 
			
		||||
    ov.setTransform(orient, ovutils::OV_PIPE1);
 | 
			
		||||
 | 
			
		||||
    ov.setPosition(dpos, ovutils::OV_PIPE1);
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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<ovutils::eTransform>(transform);
 | 
			
		||||
            static_cast<ovutils::eTransform>(layer->transform);
 | 
			
		||||
    ov.setTransform(orient, ovutils::OV_PIPE0);
 | 
			
		||||
 | 
			
		||||
    // position x,y,w,h
 | 
			
		||||
 
 | 
			
		||||
@@ -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]":"",
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user