snadge

Nasty andromadus build hack - 1st Jul

Jul 2nd, 2013
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 10.97 KB | None | 0 0
  1.  
  2. project hardware/qcom/display/
  3. diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
  4. index 196d5a7..fd600f9 100644
  5. --- a/libgralloc/alloc_controller.cpp
  6. +++ b/libgralloc/alloc_controller.cpp
  7. @@ -34,7 +34,9 @@
  8.  #include "gralloc_priv.h"
  9.  #include "alloc_controller.h"
  10.  #include "memalloc.h"
  11. +#ifdef USE_ION
  12.  #include "ionalloc.h"
  13. +#endif
  14.  #include "pmemalloc.h"
  15.  #include "ashmemalloc.h"
  16.  #include "gr.h"
  17.  
  18. project hardware/qcom/media-caf/
  19. diff --git a/mm-video/vidc/vdec/Android.mk b/mm-video/vidc/vdec/Android.mk
  20. index 4ff6290..5da6869 100644
  21. --- a/mm-video/vidc/vdec/Android.mk
  22. +++ b/mm-video/vidc/vdec/Android.mk
  23. @@ -43,9 +43,9 @@ endif
  24.  
  25.  libOmxVdec-def += -D_ANDROID_ICS_
  26.  
  27. -#ifeq ($(TARGET_USES_ION),true)
  28. +ifeq ($(TARGET_USES_ION),true)
  29.  libOmxVdec-def += -DUSE_ION
  30. -#endif
  31. +endif
  32.  
  33.  # ---------------------------------------------------------------------------------
  34.  #          Make the Shared library (libOmxVdec)
  35. @@ -78,9 +78,7 @@ libmm-vdec-inc          += frameworks/av/include/media/stagefright
  36.  libmm-vdec-inc          += hardware/qcom/$(DISPLAY)/libqservice
  37.  libmm-vdec-inc          += frameworks/av/media/libmediaplayerservice
  38.  libmm-vdec-inc          += frameworks/native/include/binder
  39. -ifeq ($(DISPLAY),display-caf)
  40.  libmm-vdec-inc          += hardware/qcom/$(DISPLAY)/libqdutils
  41. -endif
  42.  
  43.  
  44.  LOCAL_MODULE                    := libOmxVdec
  45. diff --git a/mm-video/vidc/vdec/inc/omx_vdec.h b/mm-video/vidc/vdec/inc/omx_vdec.h
  46. index d2e8a55..02f7388 100644
  47. --- a/mm-video/vidc/vdec/inc/omx_vdec.h
  48. +++ b/mm-video/vidc/vdec/inc/omx_vdec.h
  49. @@ -886,7 +886,9 @@ private:
  50.          OMX_QCOM_PLATFORM_PRIVATE_ENTRY     m_platform_entry_client[MAX_COUNT];
  51.          OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO m_pmem_info_client[MAX_COUNT];
  52.          OMX_BUFFERHEADERTYPE  m_out_mem_ptr_client[MAX_COUNT];
  53. +#ifdef USE_ION
  54.          struct vdec_ion op_buf_ion_info[MAX_COUNT];
  55. +#endif
  56.          unsigned char *pmem_baseaddress[MAX_COUNT];
  57.          int pmem_fd[MAX_COUNT];
  58.          struct vidc_heap
  59. diff --git a/mm-video/vidc/vdec/src/omx_vdec.cpp b/mm-video/vidc/vdec/src/omx_vdec.cpp
  60. index b3df6b5..33af484 100644
  61. --- a/mm-video/vidc/vdec/src/omx_vdec.cpp
  62. +++ b/mm-video/vidc/vdec/src/omx_vdec.cpp
  63. @@ -1317,11 +1317,13 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
  64.        goto cleanup;
  65.    }
  66.  
  67. +#if 0
  68.    ioctl_msg = {NULL,NULL};
  69.    ioctl_msg.out = (void*)&current_performance;
  70.    (void)(ioctl(drv_ctx.video_driver_fd, VDEC_IOCTL_GET_PERF_LEVEL, &ioctl_msg));
  71.    DEBUG_PRINT_HIGH("component_init: current performance level = %u ",
  72.                                      current_performance);
  73. +#endif
  74.  
  75.  #ifdef _ANDROID_
  76.    if(is_secure)
  77. @@ -4351,7 +4353,7 @@ OMX_ERRORTYPE  omx_vdec::use_output_buffer(
  78.          drv_ctx.ptr_outputbuffer[i].bufferaddr = buff;
  79.          drv_ctx.ptr_outputbuffer[i].mmaped_size =
  80.              drv_ctx.ptr_outputbuffer[i].buffer_len = drv_ctx.op_buf.buffer_size;
  81. -#if defined(_ANDROID_ICS_)
  82. +#if 0
  83.          if (drv_ctx.interlace != VDEC_InterlaceFrameProgressive) {
  84.              int enable = 1;
  85.              setMetaData(handle, PP_PARAM_INTERLACED, (void*)&enable);
  86. @@ -7121,11 +7123,9 @@ int omx_vdec::async_message_process (void *context, void* message)
  87.      }
  88.  
  89.      DEBUG_PRINT_LOW("[RespBufDone] Buf(%p), Data_len(%d), Ts(%lld), Pic_type(%u), "\
  90. -      "Flags(0x%x), MetadataInfo: len(%d), offset(%d)", omxhdr,
  91. +      "Flags(0x%x)", omxhdr,
  92.        vdec_msg->msgdata.output_frame.len, vdec_msg->msgdata.output_frame.time_stamp,
  93. -      vdec_msg->msgdata.output_frame.pic_type, vdec_msg->msgdata.output_frame.flags,
  94. -      vdec_msg->msgdata.output_frame.metadata_len,
  95. -      vdec_msg->msgdata.output_frame.metadata_offset);
  96. +      vdec_msg->msgdata.output_frame.pic_type, vdec_msg->msgdata.output_frame.flags);
  97.  
  98.      if (omxhdr && omxhdr->pOutputPortPrivate &&
  99.          ((omxhdr - omx->m_out_mem_ptr) < omx->drv_ctx.op_buf.actualcount) &&
  100. @@ -7171,8 +7171,6 @@ int omx_vdec::async_message_process (void *context, void* message)
  101.            vdec_msg->msgdata.output_frame.framesize.top;
  102.          output_respbuf->len = vdec_msg->msgdata.output_frame.len;
  103.          output_respbuf->offset = vdec_msg->msgdata.output_frame.offset;
  104. -        output_respbuf->metadata_len = vdec_msg->msgdata.output_frame.metadata_len;
  105. -        output_respbuf->metadata_offset = vdec_msg->msgdata.output_frame.metadata_offset;
  106.          output_respbuf->time_stamp = vdec_msg->msgdata.output_frame.time_stamp;
  107.          output_respbuf->flags = vdec_msg->msgdata.output_frame.flags;
  108.          output_respbuf->pic_type = vdec_msg->msgdata.output_frame.pic_type;
  109. @@ -8734,12 +8732,6 @@ void omx_vdec::handle_extradata(OMX_BUFFERHEADERTYPE *p_buf_hdr)
  110.  
  111.    if (drv_ctx.extradata && (p_buf_hdr->nFlags & OMX_BUFFERFLAG_EXTRADATA))
  112.    {
  113. -    if (output_respbuf->metadata_offset != p_buf_hdr->nFilledLen)
  114. -    {
  115. -      DEBUG_PRINT_HIGH("WARN: metadata_offset(%d) != nAllocLen(%d)",
  116. -         output_respbuf->metadata_offset, p_buf_hdr->nFilledLen);
  117. -      p_extra = NULL;
  118. -    }
  119.      // Process driver extradata
  120.      while(p_extra && p_extra->eType != VDEC_EXTRADATA_NONE)
  121.      {
  122. @@ -9146,7 +9138,7 @@ void omx_vdec::append_interlace_extradata(OMX_OTHER_EXTRADATATYPE *extra,
  123.      interlace_format->bInterlaceFormat = OMX_FALSE;
  124.      interlace_format->nInterlaceFormats = OMX_InterlaceFrameProgressive;
  125.      drv_ctx.interlace = VDEC_InterlaceFrameProgressive;
  126. -#if defined(_ANDROID_ICS_)
  127. +#if 0
  128.      if(handle)
  129.      {
  130.        setMetaData(handle, PP_PARAM_INTERLACED, (void*)&enable);
  131. @@ -9158,7 +9150,7 @@ void omx_vdec::append_interlace_extradata(OMX_OTHER_EXTRADATATYPE *extra,
  132.      interlace_format->bInterlaceFormat = OMX_TRUE;
  133.      interlace_format->nInterlaceFormats = OMX_InterlaceInterleaveFrameTopFieldFirst;
  134.      drv_ctx.interlace = VDEC_InterlaceInterleaveFrameTopFieldFirst;
  135. -#if defined(_ANDROID_ICS_)
  136. +#if 0
  137.      enable = 1;
  138.      if(handle)
  139.      {
  140. @@ -9844,7 +9836,9 @@ void omx_vdec::allocate_color_convert_buf::init_members() {
  141.    memset(m_platform_entry_client,0,sizeof(m_platform_entry_client));
  142.    memset(m_pmem_info_client,0,sizeof(m_pmem_info_client));
  143.    memset(m_out_mem_ptr_client,0,sizeof(m_out_mem_ptr_client));
  144. +#ifdef USE_ION
  145.    memset(op_buf_ion_info,0,sizeof(m_platform_entry_client));
  146. +#endif
  147.    for (int i = 0; i < MAX_COUNT;i++)
  148.      pmem_fd[i] = -1;
  149.  }
  150. @@ -10037,7 +10031,9 @@ OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::free_output_buffer(
  151.      close(pmem_fd[index]);
  152.    }
  153.    pmem_fd[index] = -1;
  154. +#ifdef USE_ION
  155.    omx->free_ion_memory(&op_buf_ion_info[index]);
  156. +#endif
  157.    m_heap_ptr[index].video_heap_ptr = NULL;
  158.    if (allocated_count > 0)
  159.      allocated_count--;
  160. @@ -10087,6 +10083,7 @@ OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::allocate_buffers_color_conve
  161.      return OMX_ErrorUndefined;
  162.    }
  163.    unsigned int i = allocated_count;
  164. +#ifdef USE_ION
  165.    op_buf_ion_info[i].ion_device_fd = omx->alloc_map_ion_memory(
  166.      buffer_size_req,buffer_alignment_req,
  167.      &op_buf_ion_info[i].ion_alloc_data,&op_buf_ion_info[i].fd_ion_data,
  168. @@ -10097,18 +10094,23 @@ OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::allocate_buffers_color_conve
  169.      DEBUG_PRINT_ERROR("\n alloc_map_ion failed in color_convert");
  170.      return OMX_ErrorInsufficientResources;
  171.    }
  172. +#endif
  173.    pmem_baseaddress[i] = (unsigned char *)mmap(NULL,buffer_size_req,
  174.                       PROT_READ|PROT_WRITE,MAP_SHARED,pmem_fd[i],0);
  175.  
  176.    if (pmem_baseaddress[i] == MAP_FAILED) {
  177.      DEBUG_PRINT_ERROR("\n MMAP failed for Size %d",buffer_size_req);
  178.      close(pmem_fd[i]);
  179. +#ifdef USE_ION
  180.      omx->free_ion_memory(&op_buf_ion_info[i]);
  181. +#endif
  182.      return OMX_ErrorInsufficientResources;
  183.    }
  184. +#ifdef USE_ION
  185.    m_heap_ptr[i].video_heap_ptr = new VideoHeap (
  186.      op_buf_ion_info[i].ion_device_fd,buffer_size_req,
  187.      pmem_baseaddress[i],op_buf_ion_info[i].ion_alloc_data.handle,pmem_fd[i]);
  188. +#endif
  189.    m_pmem_info_client[i].pmem_fd = (OMX_U32)m_heap_ptr[i].video_heap_ptr.get();
  190.    m_pmem_info_client[i].offset = 0;
  191.    m_platform_entry_client[i].entry = (void *)&m_pmem_info_client[i];
  192. @@ -10202,11 +10204,13 @@ int omx_vdec::set_turbo_mode(bool mode)
  193.      if (mode == (int)true) {
  194.          struct vdec_ioctl_msg ioctl_msg;
  195.          DEBUG_PRINT_HIGH("Enable Turbo mode");
  196. +#if 0
  197.          if (ioctl(drv_ctx.video_driver_fd,VDEC_IOCTL_SET_PERF_CLK,
  198.              &ioctl_msg) < 0) {
  199.              DEBUG_PRINT_ERROR("ioctl VDEC_IOCTL_SET_PERF_CLK failed");
  200.              return 1;
  201.          }
  202. +#endif
  203.      } else {
  204.          DEBUG_PRINT_HIGH("Disable Turbo mode not suported");
  205.          return 1;
  206. diff --git a/mm-video/vidc/venc/src/omx_video_base.cpp b/mm-video/vidc/venc/src/omx_video_base.cpp
  207. index 6c5350f..6671495 100644
  208. --- a/mm-video/vidc/venc/src/omx_video_base.cpp
  209. +++ b/mm-video/vidc/venc/src/omx_video_base.cpp
  210. @@ -2970,11 +2970,13 @@ OMX_ERRORTYPE  omx_video::allocate_output_buffer(
  211.  
  212.        m_out_bm_count = BITMASK_SET_U32(m_out_bm_count,i);
  213.  
  214. +#ifdef USE_ION
  215.        DEBUG_PRINT_HIGH("alloc_output: idx = %d, fd = %d, addr = %p, offset = %d, "
  216.           "ion_device_fd = %d, ion_handle = %p, length = %d", i,
  217.           m_pOutput_pmem[i].fd, m_pOutput_pmem[i].buffer, m_pOutput_pmem[i].offset,
  218.           m_pOutput_ion[i].ion_device_fd, m_pOutput_ion[i].ion_alloc_data.handle,
  219.           m_pOutput_pmem[i].size);
  220. +#endif
  221.  
  222.        if(dev_use_buf(&m_pOutput_pmem[i],PORT_INDEX_OUT,i) != true)
  223.        {
  224. diff --git a/mm-video/vidc/venc/src/omx_video_encoder.cpp b/mm-video/vidc/venc/src/omx_video_encoder.cpp
  225. index df5c720..508bc28 100644
  226. --- a/mm-video/vidc/venc/src/omx_video_encoder.cpp
  227. +++ b/mm-video/vidc/venc/src/omx_video_encoder.cpp
  228. @@ -1710,8 +1710,10 @@ int omx_venc::async_message_process (void *context, void* message)
  229.          omxhdr->nOffset = m_sVenc_msg->buf.offset;
  230.          omxhdr->nTimeStamp = m_sVenc_msg->buf.timestamp;
  231.          omxhdr->nFlags = m_sVenc_msg->buf.flags;
  232. +#if 0
  233.          omx->extradata_len[idx] = m_sVenc_msg->buf.metadata_len;
  234.          omx->extradata_offset[idx] = m_sVenc_msg->buf.metadata_offset;
  235. +#endif
  236.          DEBUG_PRINT_LOW("[RespBufDone]: pBuffer = 0x%x, nFilledLen = %d, "\
  237.              "nAllocLen = %d, Ts = %lld, nFlags = 0x%x, nOffset = %d, "\
  238.              "Extradata Info: Idx = %d, Offset(%d), len(%d)",
  239. diff --git a/mm-video/vidc/venc/src/video_encoder_device.cpp b/mm-video/vidc/venc/src/video_encoder_device.cpp
  240. index 385d6df..6e81a34 100644
  241. --- a/mm-video/vidc/venc/src/video_encoder_device.cpp
  242. +++ b/mm-video/vidc/venc/src/video_encoder_device.cpp
  243. @@ -556,6 +556,7 @@ bool venc_dev::venc_get_buf_req(unsigned long *min_buff_count,
  244.  
  245.  bool venc_dev::venc_get_curr_perf_lvl(OMX_PTR curr_perf)
  246.  {
  247. +#if 0
  248.      struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
  249.      ioctl_msg.out = (void*)curr_perf;
  250.      if (ioctl(m_nDriver_fd, VEN_IOCTL_GET_PERF_LEVEL, &ioctl_msg) < 0)
  251. @@ -564,6 +565,7 @@ bool venc_dev::venc_get_curr_perf_lvl(OMX_PTR curr_perf)
  252.        return false;
  253.      }
  254.      DEBUG_PRINT_HIGH("get_curr_perf_lvl = %u", *(OMX_U32 *)(curr_perf));
  255. +#endif
  256.      return true;
  257.  }
Add Comment
Please, Sign In to add comment