void res_trk_init(struct device *device, u32 irq) { if (resource_context.device || resource_context.irq_num || !device) { VCDRES_MSG_ERROR("%s() Resource Tracker Init error\n", __func__); } else { memset(&resource_context, 0, sizeof(resource_context)); mutex_init(&resource_context.lock); mutex_init(&resource_context.secure_lock); resource_context.device = device; resource_context.irq_num = irq; resource_context.vidc_platform_data = (struct msm_vidc_platform_data *) device->platform_data; if (resource_context.vidc_platform_data) { resource_context.memtype = resource_context.vidc_platform_data->memtype; resource_context.fw_mem_type = resource_context.vidc_platform_data->memtype; resource_context.cmd_mem_type = resource_context.vidc_platform_data->memtype; if (resource_context.vidc_platform_data->enable_ion) { resource_context.res_ion_client = res_trk_create_ion_client(); if (!(resource_context.res_ion_client)) { VCDRES_MSG_ERROR("%s()ION createfail\n", __func__); return; } resource_context.fw_mem_type = ION_MM_FIRMWARE_HEAP_ID; resource_context.cmd_mem_type = ION_CP_MFC_HEAP_ID; } resource_context.disable_dmx = resource_context.vidc_platform_data->disable_dmx; resource_context.disable_fullhd = resource_context.vidc_platform_data->disable_fullhd; #ifdef CONFIG_MSM_BUS_SCALING resource_context.vidc_bus_client_pdata = resource_context.vidc_platform_data-> vidc_bus_client_pdata; #endif } else { resource_context.memtype = -1; resource_context.disable_dmx = 0; } resource_context.core_type = VCD_CORE_1080P; resource_context.firmware_addr.mem_type = DDL_FW_MEM; if (!res_trk_pmem_alloc(&resource_context.firmware_addr, VIDC_FW_SIZE, DDL_KILO_BYTE(128))) { pr_err("%s() Firmware buffer allocation failed", __func__); if (!res_trk_check_for_sec_session()) memset(&resource_context.firmware_addr, 0, sizeof(resource_context.firmware_addr)); } } }
void res_trk_init(struct device *device, u32 irq) { VCDRES_MSG_LOW("%s", __func__); if (resource_context.device || resource_context.irq_num || !device) { VCDRES_MSG_ERROR("%s() Resource Tracker Init error\n", __func__); return; } memset(&resource_context, 0, sizeof(resource_context)); mutex_init(&resource_context.lock); resource_context.device = device; resource_context.irq_num = irq; resource_context.core_type = VCD_CORE_720P; resource_context.regulator = regulator_get(NULL, "fs_mfc"); resource_context.vidc_platform_data = (struct msm_vidc_platform_data *) device->platform_data; if (resource_context.vidc_platform_data) { resource_context.memtype = resource_context.vidc_platform_data->memtype; VCDRES_MSG_LOW("%s(): resource_context.memtype = 0x%x", __func__, (u32)resource_context.memtype); if (resource_context.vidc_platform_data->enable_ion) { resource_context.res_ion_client = res_trk_create_ion_client(); if (!(resource_context.res_ion_client)) { VCDRES_MSG_ERROR("%s()ION createfail\n", __func__); return; } VCDRES_MSG_LOW("%s(): ion_client = 0x%x", __func__, (u32)resource_context.res_ion_client); } else { VCDRES_MSG_ERROR("%s(): ION not disabled\n", __func__); } } else { resource_context.memtype = -1; VCDRES_MSG_ERROR("%s(): vidc_platform_data is NULL", __func__); } }
void res_trk_init(struct device *device, u32 irq) { if (resource_context.device || resource_context.irq_num || !device) { VCDRES_MSG_ERROR("%s() Resource Tracker Init error\n", __func__); } else { memset(&resource_context, 0, sizeof(resource_context)); mutex_init(&resource_context.lock); mutex_init(&resource_context.secure_lock); resource_context.device = device; resource_context.irq_num = irq; resource_context.vidc_platform_data = (struct msm_vidc_platform_data *) device->platform_data; if (resource_context.vidc_platform_data) { if (res_trk_get_enable_ion()) { resource_context.res_ion_client = res_trk_create_ion_client(); if (!(resource_context.res_ion_client)) { VCDRES_MSG_ERROR("%s()ION createfail\n", __func__); return; } } resource_context.disable_dmx = resource_context.vidc_platform_data->disable_dmx; resource_context.disable_fullhd = resource_context.vidc_platform_data->disable_fullhd; #ifdef CONFIG_MSM_BUS_SCALING resource_context.vidc_bus_client_pdata = resource_context.vidc_platform_data-> vidc_bus_client_pdata; #endif } else { resource_context.memtype = -1; resource_context.disable_dmx = 0; } resource_context.core_type = VCD_CORE_1080P; resource_context.firmware_addr.mem_type = DDL_FW_MEM; } }