diff options
author | Gu, Wangyi <wangyi.gu@intel.com> | 2013-07-31 09:24:43 +0800 |
---|---|---|
committer | cactus <cactus@intel.com> | 2013-08-07 08:37:27 -0700 |
commit | 3b504f17c549162791a884dc974d0ffc2c69fa3c (patch) | |
tree | 974c54a851b0d286669b9d1221f5193bae834f4f /ips | |
parent | 47fc445a4dbc3f7d6d71139ed82a114e59616b0b (diff) | |
download | hwcomposer-3b504f17c549162791a884dc974d0ffc2c69fa3c.tar.gz |
hwc: enable memory tiling with overlay mode for video playback
BZ: 127417
enable memory tiling with overlay mode for video playback
this patch need work with gfx effect to get the final solution for video overlay
playback, but we can merge this patch first for it can be controlled by video
driver, so it has no side effect.
Signed-off-by: Gu, Wangyi <wangyi.gu@intel.com>
Change-Id: I51413ede1763a7dabb78dc0c193124145cc27200
Reviewed-on: http://android.intel.com:8080/122082
Reviewed-by: buildbot <buildbot@intel.com>
Reviewed-by: Gu, Wangyi <wangyi.gu@intel.com>
Reviewed-by: Qiu, Junhai <junhai.qiu@intel.com>
Reviewed-by: Feng, Wei <wei.feng@intel.com>
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: cactus <cactus@intel.com>
Diffstat (limited to 'ips')
-rw-r--r-- | ips/common/GrallocBufferBase.cpp | 1 | ||||
-rw-r--r-- | ips/common/OverlayPlaneBase.cpp | 23 | ||||
-rw-r--r-- | ips/common/PlaneCapabilities.cpp | 1 | ||||
-rw-r--r-- | ips/tangier/TngDisplayQuery.cpp | 1 |
4 files changed, 25 insertions, 1 deletions
diff --git a/ips/common/GrallocBufferBase.cpp b/ips/common/GrallocBufferBase.cpp index 2a7c4ab..1be9257 100644 --- a/ips/common/GrallocBufferBase.cpp +++ b/ips/common/GrallocBufferBase.cpp @@ -74,6 +74,7 @@ void GrallocBufferBase::initStride() mStride.yuv.uvStride = uvStride; break; case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar: + case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled: yStride = align_to(align_to(mWidth, 32), 64); uvStride = yStride; mStride.yuv.yStride = yStride; diff --git a/ips/common/OverlayPlaneBase.cpp b/ips/common/OverlayPlaneBase.cpp index 1e987e9..a0c08d3 100644 --- a/ips/common/OverlayPlaneBase.cpp +++ b/ips/common/OverlayPlaneBase.cpp @@ -389,6 +389,7 @@ BufferMapper* OverlayPlaneBase::getTTMMapper(BufferMapper& grallocMapper) stride.yuv.uvStride = uvStride; break; case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar: + case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled: yStride = align_to(align_to(w, 32), 64); uvStride = yStride; stride.yuv.yStride = yStride; @@ -531,7 +532,8 @@ bool OverlayPlaneBase::rotatedBufferReady(BufferMapper& mapper) // only NV12_VED has rotated buffer format = mapper.getFormat(); - if (format != OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar) + if (format != OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar && + format != OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled) return false; payload = (struct VideoPayloadBuffer *)mapper.getCpuAddress(SUB_BUFFER1); @@ -597,6 +599,7 @@ bool OverlayPlaneBase::bufferOffsetSetup(BufferMapper& mapper) // clear original format setting backBuffer->OCMD &= ~(0xf << 10); + backBuffer->OCMD &= ~OVERLAY_MEMORY_LAYOUT_TILED; // Y/U/V plane must be 4k bytes aligned. backBuffer->OSTART_0Y = gttOffsetInBytes; @@ -635,6 +638,23 @@ bool OverlayPlaneBase::bufferOffsetSetup(BufferMapper& mapper) backBuffer->OBUF_0V = 0; backBuffer->OCMD |= OVERLAY_FORMAT_PLANAR_NV12_2; break; + case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled: //NV12_tiled + backBuffer->OBUF_0Y = 0; + backBuffer->OBUF_0U = yStride * align_to(h, 32); + backBuffer->OBUF_0V = 0; + backBuffer->OSTART_0U += yStride * align_to(h, 32); + backBuffer->OSTART_0V += yStride * align_to(h, 32); + backBuffer->OSTART_1U = backBuffer->OSTART_0U; + backBuffer->OSTART_1V = backBuffer->OSTART_0V; + backBuffer->OTILEOFF_0Y = srcX + (srcY << 16); + backBuffer->OTILEOFF_1Y = backBuffer->OTILEOFF_0Y; + backBuffer->OTILEOFF_0U = srcX + ((srcY / 2) << 16); + backBuffer->OTILEOFF_1U = backBuffer->OTILEOFF_0U; + backBuffer->OTILEOFF_0V = backBuffer->OTILEOFF_0U; + backBuffer->OTILEOFF_1V = backBuffer->OTILEOFF_0U; + backBuffer->OCMD |= OVERLAY_FORMAT_PLANAR_NV12_2; + backBuffer->OCMD |= OVERLAY_MEMORY_LAYOUT_TILED; + break; case HAL_PIXEL_FORMAT_YUY2: // YUY2 backBuffer->OBUF_0Y = 0; backBuffer->OBUF_0U = 0; @@ -704,6 +724,7 @@ bool OverlayPlaneBase::coordinateSetup(BufferMapper& mapper) case HAL_PIXEL_FORMAT_YV12: // YV12 case HAL_PIXEL_FORMAT_I420: // I420 case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar: // NV12 + case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled: // NV12_tiled break; case HAL_PIXEL_FORMAT_YUY2: // YUY2 case HAL_PIXEL_FORMAT_UYVY: // UYVY diff --git a/ips/common/PlaneCapabilities.cpp b/ips/common/PlaneCapabilities.cpp index 0529629..4c90a51 100644 --- a/ips/common/PlaneCapabilities.cpp +++ b/ips/common/PlaneCapabilities.cpp @@ -55,6 +55,7 @@ bool PlaneCapabilities::isFormatSupported(int planeType, uint32_t format, uint32 return trans ? false : true; case HAL_PIXEL_FORMAT_I420: case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar: + case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled: case HAL_PIXEL_FORMAT_YUY2: case HAL_PIXEL_FORMAT_UYVY: return true; diff --git a/ips/tangier/TngDisplayQuery.cpp b/ips/tangier/TngDisplayQuery.cpp index bdc305a..1eb127d 100644 --- a/ips/tangier/TngDisplayQuery.cpp +++ b/ips/tangier/TngDisplayQuery.cpp @@ -39,6 +39,7 @@ bool DisplayQuery::isVideoFormat(uint32_t format) { switch (format) { case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar: + case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled: return true; default: return false; |