Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 1 | /* |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 2 | * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions are |
| 6 | * met: |
| 7 | * * Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * * Redistributions in binary form must reproduce the above |
| 10 | * copyright notice, this list of conditions and the following |
| 11 | * disclaimer in the documentation and/or other materials provided |
| 12 | * with the distribution. |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 13 | * * Neither the name of The Linux Foundation nor the names of its |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 14 | * contributors may be used to endorse or promote products derived |
| 15 | * from this software without specific prior written permission. |
| 16 | * |
| 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | */ |
| 29 | |
| 30 | #include <stdlib.h> |
Saurabh Shah | db7ae31 | 2013-03-19 15:45:24 -0700 | [diff] [blame^] | 31 | #include <math.h> |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 32 | #include <utils/Log.h> |
| 33 | #include <linux/msm_mdp.h> |
| 34 | #include <cutils/properties.h> |
| 35 | #include "gralloc_priv.h" |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 36 | #include "overlayUtils.h" |
| 37 | #include "mdpWrapper.h" |
Saurabh Shah | 94822ee | 2012-08-17 16:48:43 -0700 | [diff] [blame] | 38 | #include "mdp_version.h" |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 39 | |
| 40 | // just a helper static thingy |
| 41 | namespace { |
| 42 | struct IOFile { |
| 43 | IOFile(const char* s, const char* mode) : fp(0) { |
| 44 | fp = ::fopen(s, mode); |
| 45 | if(!fp) { |
| 46 | ALOGE("Failed open %s", s); |
| 47 | } |
| 48 | } |
| 49 | template <class T> |
| 50 | size_t read(T& r, size_t elem) { |
| 51 | if(fp) { |
| 52 | return ::fread(&r, sizeof(T), elem, fp); |
| 53 | } |
| 54 | return 0; |
| 55 | } |
| 56 | size_t write(const char* s, uint32_t val) { |
| 57 | if(fp) { |
| 58 | return ::fprintf(fp, s, val); |
| 59 | } |
| 60 | return 0; |
| 61 | } |
| 62 | bool valid() const { return fp != 0; } |
| 63 | ~IOFile() { |
| 64 | if(fp) ::fclose(fp); |
| 65 | fp=0; |
| 66 | } |
| 67 | FILE* fp; |
| 68 | }; |
| 69 | } |
| 70 | |
| 71 | namespace overlay { |
| 72 | |
| 73 | //----------From class Res ------------------------------ |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 74 | const char* const Res::fbPath = "/dev/graphics/fb%u"; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 75 | const char* const Res::rotPath = "/dev/msm_rotator"; |
| 76 | const char* const Res::format3DFile = |
| 77 | "/sys/class/graphics/fb1/format_3d"; |
| 78 | const char* const Res::edid3dInfoFile = |
| 79 | "/sys/class/graphics/fb1/3d_present"; |
| 80 | const char* const Res::barrierFile = |
| 81 | "/sys/devices/platform/mipi_novatek.0/enable_3d_barrier"; |
| 82 | //-------------------------------------------------------- |
| 83 | |
| 84 | |
| 85 | |
| 86 | namespace utils { |
Ajay Dudani | cb3da0a | 2012-09-07 13:37:49 -0700 | [diff] [blame] | 87 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 88 | //-------------------------------------------------------- |
Naseer Ahmed | af49e21 | 2012-07-31 19:13:41 -0700 | [diff] [blame] | 89 | //Refer to graphics.h, gralloc_priv.h, msm_mdp.h |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 90 | int getMdpFormat(int format) { |
| 91 | switch (format) { |
Naseer Ahmed | af49e21 | 2012-07-31 19:13:41 -0700 | [diff] [blame] | 92 | //From graphics.h |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 93 | case HAL_PIXEL_FORMAT_RGBA_8888 : |
| 94 | return MDP_RGBA_8888; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 95 | case HAL_PIXEL_FORMAT_RGBX_8888: |
| 96 | return MDP_RGBX_8888; |
Naseer Ahmed | af49e21 | 2012-07-31 19:13:41 -0700 | [diff] [blame] | 97 | case HAL_PIXEL_FORMAT_RGB_888: |
| 98 | return MDP_RGB_888; |
| 99 | case HAL_PIXEL_FORMAT_RGB_565: |
| 100 | return MDP_RGB_565; |
| 101 | case HAL_PIXEL_FORMAT_BGRA_8888: |
| 102 | return MDP_BGRA_8888; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 103 | case HAL_PIXEL_FORMAT_YV12: |
Saurabh Shah | ae1044e | 2012-08-21 16:03:32 -0700 | [diff] [blame] | 104 | return MDP_Y_CR_CB_GH2V2; |
Naseer Ahmed | af49e21 | 2012-07-31 19:13:41 -0700 | [diff] [blame] | 105 | case HAL_PIXEL_FORMAT_YCbCr_422_SP: |
| 106 | return MDP_Y_CBCR_H2V1; |
| 107 | case HAL_PIXEL_FORMAT_YCrCb_420_SP: |
| 108 | return MDP_Y_CRCB_H2V2; |
| 109 | |
| 110 | //From gralloc_priv.h |
| 111 | case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED: |
| 112 | return MDP_Y_CBCR_H2V2_TILE; |
| 113 | case HAL_PIXEL_FORMAT_YCbCr_420_SP: |
| 114 | return MDP_Y_CBCR_H2V2; |
| 115 | case HAL_PIXEL_FORMAT_YCrCb_422_SP: |
| 116 | return MDP_Y_CRCB_H2V1; |
| 117 | case HAL_PIXEL_FORMAT_YCbCr_444_SP: |
| 118 | return MDP_Y_CBCR_H1V1; |
| 119 | case HAL_PIXEL_FORMAT_YCrCb_444_SP: |
| 120 | return MDP_Y_CRCB_H1V1; |
Sushil Chauhan | c5e6148 | 2012-08-22 17:13:32 -0700 | [diff] [blame] | 121 | case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS: |
| 122 | return MDP_Y_CBCR_H2V2_VENUS; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 123 | default: |
Naseer Ahmed | af49e21 | 2012-07-31 19:13:41 -0700 | [diff] [blame] | 124 | //Unsupported by MDP |
| 125 | //---graphics.h-------- |
| 126 | //HAL_PIXEL_FORMAT_RGBA_5551 |
| 127 | //HAL_PIXEL_FORMAT_RGBA_4444 |
| 128 | //HAL_PIXEL_FORMAT_YCbCr_422_I |
| 129 | //---gralloc_priv.h----- |
| 130 | //HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO = 0x7FA30C01 |
| 131 | //HAL_PIXEL_FORMAT_R_8 = 0x10D |
| 132 | //HAL_PIXEL_FORMAT_RG_88 = 0x10E |
Saurabh Shah | fc3652f | 2013-02-15 13:15:45 -0800 | [diff] [blame] | 133 | ALOGE("%s: Unsupported HAL format = 0x%x", __func__, format); |
| 134 | return -1; |
| 135 | } |
| 136 | // not reached |
| 137 | return -1; |
| 138 | } |
| 139 | |
| 140 | //Takes mdp format as input and translates to equivalent HAL format |
| 141 | //Refer to graphics.h, gralloc_priv.h, msm_mdp.h for formats. |
| 142 | int getHALFormat(int mdpFormat) { |
| 143 | switch (mdpFormat) { |
| 144 | //From graphics.h |
| 145 | case MDP_RGBA_8888: |
| 146 | return HAL_PIXEL_FORMAT_RGBA_8888; |
| 147 | case MDP_RGBX_8888: |
| 148 | return HAL_PIXEL_FORMAT_RGBX_8888; |
| 149 | case MDP_RGB_888: |
| 150 | return HAL_PIXEL_FORMAT_RGB_888; |
| 151 | case MDP_RGB_565: |
| 152 | return HAL_PIXEL_FORMAT_RGB_565; |
| 153 | case MDP_BGRA_8888: |
| 154 | return HAL_PIXEL_FORMAT_BGRA_8888; |
| 155 | case MDP_Y_CR_CB_GH2V2: |
| 156 | return HAL_PIXEL_FORMAT_YV12; |
| 157 | case MDP_Y_CBCR_H2V1: |
| 158 | return HAL_PIXEL_FORMAT_YCbCr_422_SP; |
| 159 | case MDP_Y_CRCB_H2V2: |
| 160 | return HAL_PIXEL_FORMAT_YCrCb_420_SP; |
| 161 | |
| 162 | //From gralloc_priv.h |
| 163 | case MDP_Y_CBCR_H2V2_TILE: |
| 164 | return HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED; |
| 165 | case MDP_Y_CBCR_H2V2: |
| 166 | return HAL_PIXEL_FORMAT_YCbCr_420_SP; |
| 167 | case MDP_Y_CRCB_H2V1: |
| 168 | return HAL_PIXEL_FORMAT_YCrCb_422_SP; |
| 169 | case MDP_Y_CBCR_H1V1: |
| 170 | return HAL_PIXEL_FORMAT_YCbCr_444_SP; |
| 171 | case MDP_Y_CRCB_H1V1: |
| 172 | return HAL_PIXEL_FORMAT_YCrCb_444_SP; |
| 173 | case MDP_Y_CBCR_H2V2_VENUS: |
| 174 | return HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS; |
| 175 | default: |
| 176 | ALOGE("%s: Unsupported MDP format = 0x%x", __func__, mdpFormat); |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 177 | return -1; |
| 178 | } |
| 179 | // not reached |
| 180 | return -1; |
| 181 | } |
| 182 | |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 183 | int getDownscaleFactor(const int& src_w, const int& src_h, |
| 184 | const int& dst_w, const int& dst_h) { |
| 185 | int dscale_factor = utils::ROT_DS_NONE; |
| 186 | // We need this check to engage the rotator whenever possible to assist MDP |
| 187 | // in performing video downscale. |
| 188 | // This saves bandwidth and avoids causing the driver to make too many panel |
| 189 | // -mode switches between BLT (writeback) and non-BLT (Direct) modes. |
| 190 | // Use-case: Video playback [with downscaling and rotation]. |
| 191 | if (dst_w && dst_h) |
| 192 | { |
Saurabh Shah | db7ae31 | 2013-03-19 15:45:24 -0700 | [diff] [blame^] | 193 | float fDscale = (float)(src_w * src_h) / (float)(dst_w * dst_h); |
| 194 | uint32_t dscale = (int)sqrtf(fDscale); |
| 195 | |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 196 | if(dscale < 2) { |
| 197 | // Down-scale to > 50% of orig. |
| 198 | dscale_factor = utils::ROT_DS_NONE; |
| 199 | } else if(dscale < 4) { |
| 200 | // Down-scale to between > 25% to <= 50% of orig. |
| 201 | dscale_factor = utils::ROT_DS_HALF; |
| 202 | } else if(dscale < 8) { |
| 203 | // Down-scale to between > 12.5% to <= 25% of orig. |
| 204 | dscale_factor = utils::ROT_DS_FOURTH; |
| 205 | } else { |
| 206 | // Down-scale to <= 12.5% of orig. |
| 207 | dscale_factor = utils::ROT_DS_EIGHTH; |
| 208 | } |
| 209 | } |
| 210 | return dscale_factor; |
| 211 | } |
| 212 | |
| 213 | static inline int compute(const uint32_t& x, const uint32_t& y, |
| 214 | const uint32_t& z) { |
| 215 | return x - ( y + z ); |
| 216 | } |
| 217 | |
Saurabh Shah | 76fd655 | 2013-03-14 14:45:38 -0700 | [diff] [blame] | 218 | //Expects transform to be adjusted for clients of Android. |
| 219 | //i.e flips switched if 90 component present. |
| 220 | //See getMdpOrient() |
| 221 | void preRotateSource(const eTransform& tr, Whf& whf, Dim& srcCrop) { |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 222 | if(tr & OVERLAY_TRANSFORM_FLIP_H) { |
| 223 | srcCrop.x = compute(whf.w, srcCrop.x, srcCrop.w); |
| 224 | } |
| 225 | if(tr & OVERLAY_TRANSFORM_FLIP_V) { |
| 226 | srcCrop.y = compute(whf.h, srcCrop.y, srcCrop.h); |
| 227 | } |
| 228 | if(tr & OVERLAY_TRANSFORM_ROT_90) { |
| 229 | int tmp = srcCrop.x; |
| 230 | srcCrop.x = compute(whf.h, |
| 231 | srcCrop.y, |
| 232 | srcCrop.h); |
| 233 | srcCrop.y = tmp; |
| 234 | swap(whf.w, whf.h); |
| 235 | swap(srcCrop.w, srcCrop.h); |
| 236 | } |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 237 | } |
| 238 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 239 | bool is3DTV() { |
| 240 | char is3DTV = '0'; |
| 241 | IOFile fp(Res::edid3dInfoFile, "r"); |
| 242 | (void)fp.read(is3DTV, 1); |
| 243 | ALOGI("3DTV EDID flag: %d", is3DTV); |
| 244 | return (is3DTV == '0') ? false : true; |
| 245 | } |
| 246 | |
| 247 | bool isPanel3D() { |
| 248 | OvFD fd; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 249 | if(!overlay::open(fd, 0 /*fb*/, Res::fbPath)){ |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 250 | ALOGE("isPanel3D Can't open framebuffer 0"); |
| 251 | return false; |
| 252 | } |
| 253 | fb_fix_screeninfo finfo; |
| 254 | if(!mdp_wrapper::getFScreenInfo(fd.getFD(), finfo)) { |
| 255 | ALOGE("isPanel3D read fb0 failed"); |
| 256 | } |
| 257 | fd.close(); |
| 258 | return (FB_TYPE_3D_PANEL == finfo.type) ? true : false; |
| 259 | } |
| 260 | |
| 261 | bool usePanel3D() { |
| 262 | if(!isPanel3D()) |
| 263 | return false; |
| 264 | char value[PROPERTY_VALUE_MAX]; |
| 265 | property_get("persist.user.panel3D", value, "0"); |
| 266 | int usePanel3D = atoi(value); |
| 267 | return usePanel3D ? true : false; |
| 268 | } |
| 269 | |
| 270 | bool send3DInfoPacket (uint32_t format3D) { |
| 271 | IOFile fp(Res::format3DFile, "wb"); |
| 272 | (void)fp.write("%d", format3D); |
| 273 | if(!fp.valid()) { |
| 274 | ALOGE("send3DInfoPacket: no sysfs entry for setting 3d mode"); |
| 275 | return false; |
| 276 | } |
| 277 | return true; |
| 278 | } |
| 279 | |
| 280 | bool enableBarrier (uint32_t orientation) { |
| 281 | IOFile fp(Res::barrierFile, "wb"); |
| 282 | (void)fp.write("%d", orientation); |
| 283 | if(!fp.valid()) { |
| 284 | ALOGE("enableBarrier no sysfs entry for " |
| 285 | "enabling barriers on 3D panel"); |
| 286 | return false; |
| 287 | } |
| 288 | return true; |
| 289 | } |
| 290 | |
| 291 | uint32_t getS3DFormat(uint32_t fmt) { |
| 292 | // The S3D is part of the HAL_PIXEL_FORMAT_YV12 value. Add |
| 293 | // an explicit check for the format |
| 294 | if (fmt == HAL_PIXEL_FORMAT_YV12) { |
| 295 | return 0; |
| 296 | } |
| 297 | uint32_t fmt3D = format3D(fmt); |
| 298 | uint32_t fIn3D = format3DInput(fmt3D); // MSB 2 bytes - inp |
| 299 | uint32_t fOut3D = format3DOutput(fmt3D); // LSB 2 bytes - out |
| 300 | fmt3D = fIn3D | fOut3D; |
| 301 | if (!fIn3D) { |
| 302 | fmt3D |= fOut3D << SHIFT_TOT_3D; //Set the input format |
| 303 | } |
| 304 | if (!fOut3D) { |
| 305 | switch (fIn3D) { |
| 306 | case HAL_3D_IN_SIDE_BY_SIDE_L_R: |
| 307 | case HAL_3D_IN_SIDE_BY_SIDE_R_L: |
| 308 | // For all side by side formats, set the output |
| 309 | // format as Side-by-Side i.e 0x1 |
| 310 | fmt3D |= HAL_3D_IN_SIDE_BY_SIDE_L_R >> SHIFT_TOT_3D; |
| 311 | break; |
| 312 | default: |
| 313 | fmt3D |= fIn3D >> SHIFT_TOT_3D; //Set the output format |
| 314 | } |
| 315 | } |
| 316 | return fmt3D; |
| 317 | } |
| 318 | |
Sushil Chauhan | b4d184f | 2013-02-11 16:13:10 -0800 | [diff] [blame] | 319 | bool isMdssRotator() { |
| 320 | int mdpVersion = qdutils::MDPVersion::getInstance().getMDPVersion(); |
| 321 | return (mdpVersion >= qdutils::MDSS_V5); |
| 322 | } |
| 323 | |
Saurabh Shah | 0d0a7cb | 2013-02-12 17:58:19 -0800 | [diff] [blame] | 324 | void getDump(char *buf, size_t len, const char *prefix, |
| 325 | const mdp_overlay& ov) { |
| 326 | char str[256] = {'\0'}; |
| 327 | snprintf(str, 256, |
| 328 | "%s id=%d z=%d fg=%d alpha=%d mask=%d flags=0x%x\n", |
| 329 | prefix, ov.id, ov.z_order, ov.is_fg, ov.alpha, |
| 330 | ov.transp_mask, ov.flags); |
| 331 | strncat(buf, str, strlen(str)); |
| 332 | getDump(buf, len, "\tsrc(msmfb_img)", ov.src); |
| 333 | getDump(buf, len, "\tsrc_rect(mdp_rect)", ov.src_rect); |
| 334 | getDump(buf, len, "\tdst_rect(mdp_rect)", ov.dst_rect); |
| 335 | } |
| 336 | |
| 337 | void getDump(char *buf, size_t len, const char *prefix, |
| 338 | const msmfb_img& ov) { |
| 339 | char str_src[256] = {'\0'}; |
| 340 | snprintf(str_src, 256, |
| 341 | "%s w=%d h=%d format=%d %s\n", |
| 342 | prefix, ov.width, ov.height, ov.format, |
| 343 | overlay::utils::getFormatString(ov.format)); |
| 344 | strncat(buf, str_src, strlen(str_src)); |
| 345 | } |
| 346 | |
| 347 | void getDump(char *buf, size_t len, const char *prefix, |
| 348 | const mdp_rect& ov) { |
| 349 | char str_rect[256] = {'\0'}; |
| 350 | snprintf(str_rect, 256, |
| 351 | "%s x=%d y=%d w=%d h=%d\n", |
| 352 | prefix, ov.x, ov.y, ov.w, ov.h); |
| 353 | strncat(buf, str_rect, strlen(str_rect)); |
| 354 | } |
| 355 | |
| 356 | void getDump(char *buf, size_t len, const char *prefix, |
| 357 | const msmfb_overlay_data& ov) { |
| 358 | char str[256] = {'\0'}; |
| 359 | snprintf(str, 256, |
| 360 | "%s id=%d\n", |
| 361 | prefix, ov.id); |
| 362 | strncat(buf, str, strlen(str)); |
| 363 | getDump(buf, len, "\tdata(msmfb_data)", ov.data); |
| 364 | } |
| 365 | |
| 366 | void getDump(char *buf, size_t len, const char *prefix, |
| 367 | const msmfb_data& ov) { |
| 368 | char str_data[256] = {'\0'}; |
| 369 | snprintf(str_data, 256, |
| 370 | "%s offset=%d memid=%d id=%d flags=0x%x priv=%d\n", |
| 371 | prefix, ov.offset, ov.memory_id, ov.id, ov.flags, |
| 372 | ov.priv); |
| 373 | strncat(buf, str_data, strlen(str_data)); |
| 374 | } |
| 375 | |
| 376 | void getDump(char *buf, size_t len, const char *prefix, |
| 377 | const msm_rotator_img_info& rot) { |
| 378 | char str[256] = {'\0'}; |
| 379 | snprintf(str, 256, "%s sessid=%u rot=%d, enable=%d downscale=%d\n", |
| 380 | prefix, rot.session_id, rot.rotations, rot.enable, |
| 381 | rot.downscale_ratio); |
| 382 | strncat(buf, str, strlen(str)); |
| 383 | getDump(buf, len, "\tsrc", rot.src); |
| 384 | getDump(buf, len, "\tdst", rot.dst); |
| 385 | getDump(buf, len, "\tsrc_rect", rot.src_rect); |
| 386 | } |
| 387 | |
| 388 | void getDump(char *buf, size_t len, const char *prefix, |
| 389 | const msm_rotator_data_info& rot) { |
| 390 | char str[256] = {'\0'}; |
| 391 | snprintf(str, 256, |
| 392 | "%s sessid=%u verkey=%d\n", |
| 393 | prefix, rot.session_id, rot.version_key); |
| 394 | strncat(buf, str, strlen(str)); |
| 395 | getDump(buf, len, "\tsrc", rot.src); |
| 396 | getDump(buf, len, "\tdst", rot.dst); |
| 397 | getDump(buf, len, "\tsrc_chroma", rot.src_chroma); |
| 398 | getDump(buf, len, "\tdst_chroma", rot.dst_chroma); |
| 399 | } |
| 400 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 401 | } // utils |
| 402 | |
| 403 | } // overlay |