mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
msm: vidc: print session_id in logs
Print session_id details in all possible call flow paths. Change-Id: I0c583dc99d4ebee7fbcb4e36d917ba9120fa670e Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
parent
19cea22246
commit
c705bf58ef
34 changed files with 2886 additions and 3270 deletions
|
|
@ -6,8 +6,8 @@
|
|||
#include "hfi_common.h"
|
||||
#include "hfi_io_common.h"
|
||||
|
||||
void __interrupt_init_ar50(struct venus_hfi_device *device)
|
||||
void __interrupt_init_ar50(struct venus_hfi_device *device, u32 sid)
|
||||
{
|
||||
__write_register(device, WRAPPER_INTR_MASK,
|
||||
WRAPPER_INTR_MASK_A2HVCODEC_BMSK);
|
||||
WRAPPER_INTR_MASK_A2HVCODEC_BMSK, sid);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -235,17 +235,18 @@ enum reset_state {
|
|||
struct venus_hfi_device;
|
||||
|
||||
struct venus_hfi_vpu_ops {
|
||||
void (*interrupt_init)(struct venus_hfi_device *device);
|
||||
void (*setup_ucregion_memmap)(struct venus_hfi_device *device);
|
||||
void (*clock_config_on_enable)(struct venus_hfi_device *device);
|
||||
int (*reset_ahb2axi_bridge)(struct venus_hfi_device *device);
|
||||
void (*interrupt_init)(struct venus_hfi_device *device, u32 sid);
|
||||
void (*setup_ucregion_memmap)(struct venus_hfi_device *device, u32 sid);
|
||||
void (*clock_config_on_enable)(struct venus_hfi_device *device,
|
||||
u32 sid);
|
||||
int (*reset_ahb2axi_bridge)(struct venus_hfi_device *device, u32 sid);
|
||||
void (*power_off)(struct venus_hfi_device *device);
|
||||
int (*prepare_pc)(struct venus_hfi_device *device);
|
||||
void (*raise_interrupt)(struct venus_hfi_device *device);
|
||||
void (*raise_interrupt)(struct venus_hfi_device *device, u32 sid);
|
||||
bool (*watchdog)(u32 intr_status);
|
||||
void (*noc_error_info)(struct venus_hfi_device *device);
|
||||
void (*core_clear_interrupt)(struct venus_hfi_device *device);
|
||||
int (*boot_firmware)(struct venus_hfi_device *device);
|
||||
int (*boot_firmware)(struct venus_hfi_device *device, u32 sid);
|
||||
};
|
||||
|
||||
struct venus_hfi_device {
|
||||
|
|
@ -290,30 +291,34 @@ int venus_hfi_initialize(struct hfi_device *hdev, u32 device_id,
|
|||
struct msm_vidc_platform_resources *res,
|
||||
hfi_cmd_response_callback callback);
|
||||
|
||||
void __write_register(struct venus_hfi_device *device, u32 reg, u32 value);
|
||||
int __read_register(struct venus_hfi_device *device, u32 reg);
|
||||
void __write_register(struct venus_hfi_device *device,
|
||||
u32 reg, u32 value, u32 sid);
|
||||
int __read_register(struct venus_hfi_device *device, u32 reg, u32 sid);
|
||||
void __disable_unprepare_clks(struct venus_hfi_device *device);
|
||||
int __disable_regulators(struct venus_hfi_device *device);
|
||||
int __unvote_buses(struct venus_hfi_device *device);
|
||||
int __reset_ahb2axi_bridge_common(struct venus_hfi_device *device);
|
||||
int __unvote_buses(struct venus_hfi_device *device, u32 sid);
|
||||
int __reset_ahb2axi_bridge_common(struct venus_hfi_device *device, u32 sid);
|
||||
int __prepare_pc(struct venus_hfi_device *device);
|
||||
|
||||
/* AR50 specific */
|
||||
void __interrupt_init_ar50(struct venus_hfi_device *device);
|
||||
void __interrupt_init_ar50(struct venus_hfi_device *device, u32 sid);
|
||||
/* IRIS1 specific */
|
||||
void __interrupt_init_iris1(struct venus_hfi_device *device);
|
||||
void __interrupt_init_iris1(struct venus_hfi_device *device, u32 sid);
|
||||
void __setup_dsp_uc_memmap_iris1(struct venus_hfi_device *device);
|
||||
void __clock_config_on_enable_iris1(struct venus_hfi_device *device);
|
||||
void __setup_ucregion_memory_map_iris1(struct venus_hfi_device *device);
|
||||
void __clock_config_on_enable_iris1(struct venus_hfi_device *device,
|
||||
u32 sid);
|
||||
void __setup_ucregion_memory_map_iris1(struct venus_hfi_device *device,
|
||||
u32 sid);
|
||||
/* IRIS2 specific */
|
||||
void __interrupt_init_iris2(struct venus_hfi_device *device);
|
||||
void __setup_ucregion_memory_map_iris2(struct venus_hfi_device *device);
|
||||
void __interrupt_init_iris2(struct venus_hfi_device *device, u32 sid);
|
||||
void __setup_ucregion_memory_map_iris2(struct venus_hfi_device *device,
|
||||
u32 sid);
|
||||
void __power_off_iris2(struct venus_hfi_device *device);
|
||||
int __prepare_pc_iris2(struct venus_hfi_device *device);
|
||||
void __raise_interrupt_iris2(struct venus_hfi_device *device);
|
||||
void __raise_interrupt_iris2(struct venus_hfi_device *device, u32 sid);
|
||||
bool __watchdog_iris2(u32 intr_status);
|
||||
void __noc_error_info_iris2(struct venus_hfi_device *device);
|
||||
void __core_clear_interrupt_iris2(struct venus_hfi_device *device);
|
||||
int __boot_firmware_iris2(struct venus_hfi_device *device);
|
||||
int __boot_firmware_iris2(struct venus_hfi_device *device, u32 sid);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,55 +6,55 @@
|
|||
#include "hfi_common.h"
|
||||
#include "hfi_io_common.h"
|
||||
|
||||
void __interrupt_init_iris1(struct venus_hfi_device *device)
|
||||
void __interrupt_init_iris1(struct venus_hfi_device *device, u32 sid)
|
||||
{
|
||||
u32 mask_val = 0;
|
||||
|
||||
/* All interrupts should be disabled initially 0x1F6 : Reset value */
|
||||
mask_val = __read_register(device, WRAPPER_INTR_MASK);
|
||||
mask_val = __read_register(device, WRAPPER_INTR_MASK, sid);
|
||||
|
||||
/* Write 0 to unmask CPU and WD interrupts */
|
||||
mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BMSK |
|
||||
WRAPPER_INTR_MASK_A2HCPU_BMSK);
|
||||
__write_register(device, WRAPPER_INTR_MASK, mask_val);
|
||||
__write_register(device, WRAPPER_INTR_MASK, mask_val, sid);
|
||||
}
|
||||
|
||||
void __setup_ucregion_memory_map_iris1(struct venus_hfi_device *device)
|
||||
void __setup_ucregion_memory_map_iris1(struct venus_hfi_device *device, u32 sid)
|
||||
{
|
||||
/* initialize CPU QTBL & UCREGION */
|
||||
__write_register(device, UC_REGION_ADDR,
|
||||
(u32)device->iface_q_table.align_device_addr);
|
||||
__write_register(device, UC_REGION_SIZE, SHARED_QSIZE);
|
||||
(u32)device->iface_q_table.align_device_addr, sid);
|
||||
__write_register(device, UC_REGION_SIZE, SHARED_QSIZE, sid);
|
||||
__write_register(device, QTBL_ADDR,
|
||||
(u32)device->iface_q_table.align_device_addr);
|
||||
__write_register(device, QTBL_INFO, 0x01);
|
||||
if (device->sfr.align_device_addr)
|
||||
(u32)device->iface_q_table.align_device_addr, sid);
|
||||
__write_register(device, QTBL_INFO, 0x01, sid);
|
||||
if (device->sfr.align_device_addr, sid)
|
||||
__write_register(device, SFR_ADDR,
|
||||
(u32)device->sfr.align_device_addr);
|
||||
(u32)device->sfr.align_device_addr, sid);
|
||||
if (device->qdss.align_device_addr)
|
||||
__write_register(device, MMAP_ADDR,
|
||||
(u32)device->qdss.align_device_addr);
|
||||
(u32)device->qdss.align_device_addr, sid);
|
||||
|
||||
/* initialize DSP QTBL & UCREGION with CPU queues by default */
|
||||
__write_register(device, HFI_DSP_QTBL_ADDR,
|
||||
(u32)device->iface_q_table.align_device_addr);
|
||||
(u32)device->iface_q_table.align_device_addr, sid);
|
||||
__write_register(device, HFI_DSP_UC_REGION_ADDR,
|
||||
(u32)device->iface_q_table.align_device_addr);
|
||||
__write_register(device, HFI_DSP_UC_REGION_SIZE, SHARED_QSIZE);
|
||||
(u32)device->iface_q_table.align_device_addr, sid);
|
||||
__write_register(device, HFI_DSP_UC_REGION_SIZE, SHARED_QSIZE, sid);
|
||||
if (device->res->cvp_internal) {
|
||||
/* initialize DSP QTBL & UCREGION with DSP queues */
|
||||
__write_register(device, HFI_DSP_QTBL_ADDR,
|
||||
(u32)device->dsp_iface_q_table.align_device_addr);
|
||||
(u32)device->dsp_iface_q_table.align_device_addr, sid);
|
||||
__write_register(device, HFI_DSP_UC_REGION_ADDR,
|
||||
(u32)device->dsp_iface_q_table.align_device_addr);
|
||||
(u32)device->dsp_iface_q_table.align_device_addr, sid);
|
||||
__write_register(device, HFI_DSP_UC_REGION_SIZE,
|
||||
device->dsp_iface_q_table.mem_data.size);
|
||||
device->dsp_iface_q_table.mem_data.size, sid);
|
||||
}
|
||||
}
|
||||
|
||||
void __clock_config_on_enable_iris1(struct venus_hfi_device *device)
|
||||
void __clock_config_on_enable_iris1(struct venus_hfi_device *device, u32 sid)
|
||||
{
|
||||
__write_register(device, WRAPPER_CPU_CGC_DIS, 0);
|
||||
__write_register(device, WRAPPER_CPU_CLOCK_CONFIG, 0);
|
||||
__write_register(device, WRAPPER_CPU_CGC_DIS, 0, sid);
|
||||
__write_register(device, WRAPPER_CPU_CLOCK_CONFIG, 0, sid);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -138,43 +138,45 @@
|
|||
#define VCODEC_NOC_ERL_MAIN_ERRLOG3_LOW 0x00011238
|
||||
#define VCODEC_NOC_ERL_MAIN_ERRLOG3_HIGH 0x0001123C
|
||||
|
||||
void __interrupt_init_iris2(struct venus_hfi_device *device)
|
||||
void __interrupt_init_iris2(struct venus_hfi_device *device, u32 sid)
|
||||
{
|
||||
u32 mask_val = 0;
|
||||
|
||||
/* All interrupts should be disabled initially 0x1F6 : Reset value */
|
||||
mask_val = __read_register(device, WRAPPER_INTR_MASK_IRIS2);
|
||||
mask_val = __read_register(device, WRAPPER_INTR_MASK_IRIS2, sid);
|
||||
|
||||
/* Write 0 to unmask CPU and WD interrupts */
|
||||
mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BMSK_IRIS2|
|
||||
WRAPPER_INTR_MASK_A2HCPU_BMSK_IRIS2);
|
||||
__write_register(device, WRAPPER_INTR_MASK_IRIS2, mask_val);
|
||||
__write_register(device, WRAPPER_INTR_MASK_IRIS2, mask_val, sid);
|
||||
}
|
||||
|
||||
void __setup_ucregion_memory_map_iris2(struct venus_hfi_device *device)
|
||||
void __setup_ucregion_memory_map_iris2(struct venus_hfi_device *device, u32 sid)
|
||||
{
|
||||
__write_register(device, UC_REGION_ADDR_IRIS2,
|
||||
(u32)device->iface_q_table.align_device_addr);
|
||||
__write_register(device, UC_REGION_SIZE_IRIS2, SHARED_QSIZE);
|
||||
(u32)device->iface_q_table.align_device_addr, sid);
|
||||
__write_register(device, UC_REGION_SIZE_IRIS2, SHARED_QSIZE, sid);
|
||||
__write_register(device, QTBL_ADDR_IRIS2,
|
||||
(u32)device->iface_q_table.align_device_addr);
|
||||
__write_register(device, QTBL_INFO_IRIS2, 0x01);
|
||||
(u32)device->iface_q_table.align_device_addr, sid);
|
||||
__write_register(device, QTBL_INFO_IRIS2, 0x01, sid);
|
||||
if (device->sfr.align_device_addr)
|
||||
__write_register(device, SFR_ADDR_IRIS2,
|
||||
(u32)device->sfr.align_device_addr);
|
||||
(u32)device->sfr.align_device_addr, sid);
|
||||
if (device->qdss.align_device_addr)
|
||||
__write_register(device, MMAP_ADDR_IRIS2,
|
||||
(u32)device->qdss.align_device_addr);
|
||||
(u32)device->qdss.align_device_addr, sid);
|
||||
/* update queues vaddr for debug purpose */
|
||||
__write_register(device, CPU_CS_VCICMDARG0_IRIS2,
|
||||
(u32)device->iface_q_table.align_virtual_addr);
|
||||
(u32)device->iface_q_table.align_virtual_addr, sid);
|
||||
__write_register(device, CPU_CS_VCICMDARG1_IRIS2,
|
||||
(u32)((u64)device->iface_q_table.align_virtual_addr >> 32));
|
||||
(u32)((u64)device->iface_q_table.align_virtual_addr >> 32),
|
||||
sid);
|
||||
}
|
||||
|
||||
void __power_off_iris2(struct venus_hfi_device *device)
|
||||
{
|
||||
u32 lpi_status, reg_status = 0, count = 0, max_count = 10;
|
||||
u32 sid = DEFAULT_SID;
|
||||
|
||||
if (!device->power_enabled)
|
||||
return;
|
||||
|
|
@ -184,78 +186,70 @@ void __power_off_iris2(struct venus_hfi_device *device)
|
|||
device->intr_status = 0;
|
||||
|
||||
/* HPG 6.1.2 Step 1 */
|
||||
__write_register(device, CPU_CS_X2RPMh_IRIS2, 0x3);
|
||||
__write_register(device, CPU_CS_X2RPMh_IRIS2, 0x3, sid);
|
||||
|
||||
/* HPG 6.1.2 Step 2, noc to low power */
|
||||
__write_register(device, AON_WRAPPER_MVP_NOC_LPI_CONTROL, 0x1);
|
||||
__write_register(device, AON_WRAPPER_MVP_NOC_LPI_CONTROL, 0x1, sid);
|
||||
while (!reg_status && count < max_count) {
|
||||
lpi_status =
|
||||
__read_register(device,
|
||||
AON_WRAPPER_MVP_NOC_LPI_STATUS);
|
||||
AON_WRAPPER_MVP_NOC_LPI_STATUS, sid);
|
||||
reg_status = lpi_status & BIT(0);
|
||||
dprintk(VIDC_HIGH,
|
||||
"Noc: lpi_status %d noc_status %d (count %d)\n",
|
||||
d_vpr_h("Noc: lpi_status %d noc_status %d (count %d)\n",
|
||||
lpi_status, reg_status, count);
|
||||
usleep_range(50, 100);
|
||||
count++;
|
||||
}
|
||||
if (count == max_count) {
|
||||
dprintk(VIDC_ERR,
|
||||
"NOC not in qaccept status %d\n", reg_status);
|
||||
d_vpr_e("NOC not in qaccept status %d\n", reg_status);
|
||||
}
|
||||
|
||||
/* HPG 6.1.2 Step 3, debug bridge to low power */
|
||||
__write_register(device,
|
||||
WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_IRIS2, 0x7);
|
||||
WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_IRIS2, 0x7, sid);
|
||||
reg_status = 0;
|
||||
count = 0;
|
||||
while ((reg_status != 0x7) && count < max_count) {
|
||||
lpi_status = __read_register(device,
|
||||
WRAPPER_DEBUG_BRIDGE_LPI_STATUS_IRIS2);
|
||||
WRAPPER_DEBUG_BRIDGE_LPI_STATUS_IRIS2, sid);
|
||||
reg_status = lpi_status & 0x7;
|
||||
dprintk(VIDC_HIGH,
|
||||
"DBLP Set : lpi_status %d reg_status %d (count %d)\n",
|
||||
d_vpr_h("DBLP Set : lpi_status %d reg_status %d (count %d)\n",
|
||||
lpi_status, reg_status, count);
|
||||
usleep_range(50, 100);
|
||||
count++;
|
||||
}
|
||||
if (count == max_count) {
|
||||
dprintk(VIDC_ERR,
|
||||
"DBLP Set: status %d\n", reg_status);
|
||||
}
|
||||
if (count == max_count)
|
||||
d_vpr_e("DBLP Set: status %d\n", reg_status);
|
||||
|
||||
/* HPG 6.1.2 Step 4, debug bridge to lpi release */
|
||||
__write_register(device,
|
||||
WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_IRIS2, 0x0);
|
||||
WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_IRIS2, 0x0, sid);
|
||||
lpi_status = 0x1;
|
||||
count = 0;
|
||||
while (lpi_status && count < max_count) {
|
||||
lpi_status = __read_register(device,
|
||||
WRAPPER_DEBUG_BRIDGE_LPI_STATUS_IRIS2);
|
||||
dprintk(VIDC_HIGH,
|
||||
"DBLP Release: lpi_status %d(count %d)\n",
|
||||
WRAPPER_DEBUG_BRIDGE_LPI_STATUS_IRIS2, sid);
|
||||
d_vpr_h("DBLP Release: lpi_status %d(count %d)\n",
|
||||
lpi_status, count);
|
||||
usleep_range(50, 100);
|
||||
count++;
|
||||
}
|
||||
if (count == max_count) {
|
||||
dprintk(VIDC_ERR,
|
||||
"DBLP Release: lpi_status %d\n", lpi_status);
|
||||
}
|
||||
if (count == max_count)
|
||||
d_vpr_e("DBLP Release: lpi_status %d\n", lpi_status);
|
||||
|
||||
/* HPG 6.1.2 Step 6 */
|
||||
__disable_unprepare_clks(device);
|
||||
|
||||
/* HPG 6.1.2 Step 7 & 8 */
|
||||
if (call_venus_op(device, reset_ahb2axi_bridge, device))
|
||||
dprintk(VIDC_ERR, "Failed to reset ahb2axi\n");
|
||||
if (call_venus_op(device, reset_ahb2axi_bridge, device, sid))
|
||||
d_vpr_e("%s: Failed to reset ahb2axi\n", __func__);
|
||||
|
||||
/* HPG 6.1.2 Step 5 */
|
||||
if (__disable_regulators(device))
|
||||
dprintk(VIDC_ERR, "Failed to disable regulators\n");
|
||||
d_vpr_e("%s: Failed to disable regulators\n", __func__);
|
||||
|
||||
if (__unvote_buses(device))
|
||||
dprintk(VIDC_ERR, "Failed to unvote for buses\n");
|
||||
if (__unvote_buses(device, sid))
|
||||
d_vpr_e("%s: Failed to unvote for buses\n", __func__);
|
||||
device->power_enabled = false;
|
||||
}
|
||||
|
||||
|
|
@ -267,32 +261,33 @@ int __prepare_pc_iris2(struct venus_hfi_device *device)
|
|||
int count = 0;
|
||||
const int max_tries = 10;
|
||||
|
||||
ctrl_status = __read_register(device, CTRL_STATUS_IRIS2);
|
||||
ctrl_status = __read_register(device, CTRL_STATUS_IRIS2, DEFAULT_SID);
|
||||
pc_ready = ctrl_status & CTRL_STATUS_PC_READY_IRIS2;
|
||||
idle_status = ctrl_status & BIT(30);
|
||||
|
||||
if (pc_ready) {
|
||||
dprintk(VIDC_HIGH, "Already in pc_ready state\n");
|
||||
d_vpr_h("Already in pc_ready state\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
wfi_status = BIT(0) & __read_register(device,
|
||||
WRAPPER_TZ_CPU_STATUS);
|
||||
wfi_status = BIT(0) & __read_register(device, WRAPPER_TZ_CPU_STATUS,
|
||||
DEFAULT_SID);
|
||||
if (!wfi_status || !idle_status) {
|
||||
dprintk(VIDC_ERR, "Skipping PC, wfi status not set\n");
|
||||
d_vpr_e("Skipping PC, wfi status not set\n");
|
||||
goto skip_power_off;
|
||||
}
|
||||
|
||||
rc = __prepare_pc(device);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed __prepare_pc %d\n", rc);
|
||||
d_vpr_e("Failed __prepare_pc %d\n", rc);
|
||||
goto skip_power_off;
|
||||
}
|
||||
|
||||
while (count < max_tries) {
|
||||
wfi_status = BIT(0) & __read_register(device,
|
||||
WRAPPER_TZ_CPU_STATUS);
|
||||
ctrl_status = __read_register(device, CTRL_STATUS_IRIS2);
|
||||
WRAPPER_TZ_CPU_STATUS, DEFAULT_SID);
|
||||
ctrl_status = __read_register(device,
|
||||
CTRL_STATUS_IRIS2, DEFAULT_SID);
|
||||
if (wfi_status && (ctrl_status & CTRL_STATUS_PC_READY_IRIS2))
|
||||
break;
|
||||
usleep_range(150, 250);
|
||||
|
|
@ -300,22 +295,22 @@ int __prepare_pc_iris2(struct venus_hfi_device *device)
|
|||
}
|
||||
|
||||
if (count == max_tries) {
|
||||
dprintk(VIDC_ERR, "Skip PC. Core is not in right state\n");
|
||||
d_vpr_e("Skip PC. Core is not in right state\n");
|
||||
goto skip_power_off;
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
||||
skip_power_off:
|
||||
dprintk(VIDC_ERR, "Skip PC, wfi=%#x, idle=%#x, pcr=%#x, ctrl=%#x)\n",
|
||||
d_vpr_e("Skip PC, wfi=%#x, idle=%#x, pcr=%#x, ctrl=%#x)\n",
|
||||
wfi_status, idle_status, pc_ready, ctrl_status);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
void __raise_interrupt_iris2(struct venus_hfi_device *device)
|
||||
void __raise_interrupt_iris2(struct venus_hfi_device *device, u32 sid)
|
||||
{
|
||||
__write_register(device, CPU_IC_SOFTINT_IRIS2,
|
||||
1 << CPU_IC_SOFTINT_H2A_SHFT_IRIS2);
|
||||
1 << CPU_IC_SOFTINT_H2A_SHFT_IRIS2, sid);
|
||||
}
|
||||
|
||||
bool __watchdog_iris2(u32 intr_status)
|
||||
|
|
@ -331,33 +326,34 @@ bool __watchdog_iris2(u32 intr_status)
|
|||
void __noc_error_info_iris2(struct venus_hfi_device *device)
|
||||
{
|
||||
u32 val = 0;
|
||||
u32 sid = DEFAULT_SID;
|
||||
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_SWID_LOW);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_SWID_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_SWID_HIGH);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_SWID_HIGH: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_MAINCTL_LOW);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_MAINCTL_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRVLD_LOW);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_ERRVLD_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRCLR_LOW);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_ERRCLR_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG0_LOW);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_ERRLOG0_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG0_HIGH);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_ERRLOG0_HIGH: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG1_LOW);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_ERRLOG1_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG1_HIGH);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_ERRLOG1_HIGH: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG2_LOW);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_ERRLOG2_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG2_HIGH);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_ERRLOG2_HIGH: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG3_LOW);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_ERRLOG3_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG3_HIGH);
|
||||
dprintk(VIDC_ERR, "VCODEC_NOC_ERL_MAIN_ERRLOG3_HIGH: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_SWID_LOW, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_SWID_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_SWID_HIGH, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_SWID_HIGH: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_MAINCTL_LOW, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_MAINCTL_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRVLD_LOW, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_ERRVLD_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRCLR_LOW, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_ERRCLR_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG0_LOW, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_ERRLOG0_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG0_HIGH, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_ERRLOG0_HIGH: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG1_LOW, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_ERRLOG1_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG1_HIGH, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_ERRLOG1_HIGH: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG2_LOW, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_ERRLOG2_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG2_HIGH, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_ERRLOG2_HIGH: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG3_LOW, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_ERRLOG3_LOW: %#x\n", val);
|
||||
val = __read_register(device, VCODEC_NOC_ERL_MAIN_ERRLOG3_HIGH, sid);
|
||||
d_vpr_e("VCODEC_NOC_ERL_MAIN_ERRLOG3_HIGH: %#x\n", val);
|
||||
}
|
||||
|
||||
void __core_clear_interrupt_iris2(struct venus_hfi_device *device)
|
||||
|
|
@ -365,11 +361,12 @@ void __core_clear_interrupt_iris2(struct venus_hfi_device *device)
|
|||
u32 intr_status = 0, mask = 0;
|
||||
|
||||
if (!device) {
|
||||
dprintk(VIDC_ERR, "%s: NULL device\n", __func__);
|
||||
d_vpr_e("%s: NULL device\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
intr_status = __read_register(device, WRAPPER_INTR_STATUS_IRIS2);
|
||||
intr_status = __read_register(device, WRAPPER_INTR_STATUS_IRIS2,
|
||||
DEFAULT_SID);
|
||||
mask = (WRAPPER_INTR_STATUS_A2H_BMSK_IRIS2|
|
||||
WRAPPER_INTR_STATUS_A2HWD_BMSK_IRIS2|
|
||||
CTRL_INIT_IDLE_MSG_BMSK_IRIS2);
|
||||
|
|
@ -377,17 +374,16 @@ void __core_clear_interrupt_iris2(struct venus_hfi_device *device)
|
|||
if (intr_status & mask) {
|
||||
device->intr_status |= intr_status;
|
||||
device->reg_count++;
|
||||
dprintk(VIDC_LOW,
|
||||
"INTERRUPT for device: %pK: times: %d interrupt_status: %d\n",
|
||||
device, device->reg_count, intr_status);
|
||||
d_vpr_l("INTERRUPT: times: %d interrupt_status: %d\n",
|
||||
device->reg_count, intr_status);
|
||||
} else {
|
||||
device->spur_count++;
|
||||
}
|
||||
|
||||
__write_register(device, CPU_CS_A2HSOFTINTCLR_IRIS2, 1);
|
||||
__write_register(device, CPU_CS_A2HSOFTINTCLR_IRIS2, 1, DEFAULT_SID);
|
||||
}
|
||||
|
||||
int __boot_firmware_iris2(struct venus_hfi_device *device)
|
||||
int __boot_firmware_iris2(struct venus_hfi_device *device, u32 sid)
|
||||
{
|
||||
int rc = 0;
|
||||
u32 ctrl_init_val = 0, ctrl_status = 0, count = 0, max_tries = 1000;
|
||||
|
|
@ -396,11 +392,11 @@ int __boot_firmware_iris2(struct venus_hfi_device *device)
|
|||
if (device->res->cvp_internal)
|
||||
ctrl_init_val |= BIT(1);
|
||||
|
||||
__write_register(device, CTRL_INIT_IRIS2, ctrl_init_val);
|
||||
__write_register(device, CTRL_INIT_IRIS2, ctrl_init_val, sid);
|
||||
while (!ctrl_status && count < max_tries) {
|
||||
ctrl_status = __read_register(device, CTRL_STATUS_IRIS2);
|
||||
ctrl_status = __read_register(device, CTRL_STATUS_IRIS2, sid);
|
||||
if ((ctrl_status & CTRL_ERROR_STATUS__M_IRIS2) == 0x4) {
|
||||
dprintk(VIDC_ERR, "invalid setting for UC_REGION\n");
|
||||
s_vpr_e(sid, "invalid setting for UC_REGION\n");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -409,13 +405,13 @@ int __boot_firmware_iris2(struct venus_hfi_device *device)
|
|||
}
|
||||
|
||||
if (count >= max_tries) {
|
||||
dprintk(VIDC_ERR, "Error booting up vidc firmware\n");
|
||||
s_vpr_e(sid, "Error booting up vidc firmware\n");
|
||||
rc = -ETIME;
|
||||
}
|
||||
|
||||
/* Enable interrupt before sending commands to venus */
|
||||
__write_register(device, CPU_CS_H2XSOFTINTEN_IRIS2, 0x1);
|
||||
__write_register(device, CPU_CS_X2RPMh_IRIS2, 0x0);
|
||||
__write_register(device, CPU_CS_H2XSOFTINTEN_IRIS2, 0x1, sid);
|
||||
__write_register(device, CPU_CS_X2RPMh_IRIS2, 0x0, sid);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,81 +5,7 @@
|
|||
#include "hfi_packetization.h"
|
||||
#include "msm_vidc_debug.h"
|
||||
|
||||
/* Set up look-up tables to convert HAL_* to HFI_*.
|
||||
*
|
||||
* The tables below mostly take advantage of the fact that most
|
||||
* HAL_* types are defined bitwise. So if we index them normally
|
||||
* when declaring the tables, we end up with huge arrays with wasted
|
||||
* space. So before indexing them, we apply log2 to use a more
|
||||
* sensible index.
|
||||
*/
|
||||
|
||||
enum hal_domain vidc_get_hal_domain(u32 hfi_domain)
|
||||
{
|
||||
enum hal_domain hal_domain = 0;
|
||||
|
||||
switch (hfi_domain) {
|
||||
case HFI_VIDEO_DOMAIN_VPE:
|
||||
hal_domain = HAL_VIDEO_DOMAIN_VPE;
|
||||
break;
|
||||
case HFI_VIDEO_DOMAIN_ENCODER:
|
||||
hal_domain = HAL_VIDEO_DOMAIN_ENCODER;
|
||||
break;
|
||||
case HFI_VIDEO_DOMAIN_DECODER:
|
||||
hal_domain = HAL_VIDEO_DOMAIN_DECODER;
|
||||
break;
|
||||
case HFI_VIDEO_DOMAIN_CVP:
|
||||
hal_domain = HAL_VIDEO_DOMAIN_CVP;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR, "%s: invalid domain %x\n",
|
||||
__func__, hfi_domain);
|
||||
hal_domain = 0;
|
||||
break;
|
||||
}
|
||||
return hal_domain;
|
||||
}
|
||||
|
||||
enum hal_video_codec vidc_get_hal_codec(u32 hfi_codec)
|
||||
{
|
||||
enum hal_video_codec hal_codec = 0;
|
||||
|
||||
switch (hfi_codec) {
|
||||
case HFI_VIDEO_CODEC_H264:
|
||||
hal_codec = HAL_VIDEO_CODEC_H264;
|
||||
break;
|
||||
case HFI_VIDEO_CODEC_MPEG1:
|
||||
hal_codec = HAL_VIDEO_CODEC_MPEG1;
|
||||
break;
|
||||
case HFI_VIDEO_CODEC_MPEG2:
|
||||
hal_codec = HAL_VIDEO_CODEC_MPEG2;
|
||||
break;
|
||||
case HFI_VIDEO_CODEC_VP8:
|
||||
hal_codec = HAL_VIDEO_CODEC_VP8;
|
||||
break;
|
||||
case HFI_VIDEO_CODEC_HEVC:
|
||||
hal_codec = HAL_VIDEO_CODEC_HEVC;
|
||||
break;
|
||||
case HFI_VIDEO_CODEC_VP9:
|
||||
hal_codec = HAL_VIDEO_CODEC_VP9;
|
||||
break;
|
||||
case HFI_VIDEO_CODEC_TME:
|
||||
hal_codec = HAL_VIDEO_CODEC_TME;
|
||||
break;
|
||||
case HFI_VIDEO_CODEC_CVP:
|
||||
hal_codec = HAL_VIDEO_CODEC_CVP;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_HIGH, "%s: invalid codec 0x%x\n",
|
||||
__func__, hfi_codec);
|
||||
hal_codec = 0;
|
||||
break;
|
||||
}
|
||||
return hal_codec;
|
||||
}
|
||||
|
||||
|
||||
u32 vidc_get_hfi_domain(enum hal_domain hal_domain)
|
||||
u32 vidc_get_hfi_domain(enum hal_domain hal_domain, u32 sid)
|
||||
{
|
||||
u32 hfi_domain;
|
||||
|
||||
|
|
@ -97,7 +23,7 @@ u32 vidc_get_hfi_domain(enum hal_domain hal_domain)
|
|||
hfi_domain = HFI_VIDEO_DOMAIN_CVP;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR, "%s: invalid domain 0x%x\n",
|
||||
s_vpr_e(sid, "%s: invalid domain 0x%x\n",
|
||||
__func__, hal_domain);
|
||||
hfi_domain = 0;
|
||||
break;
|
||||
|
|
@ -105,7 +31,7 @@ u32 vidc_get_hfi_domain(enum hal_domain hal_domain)
|
|||
return hfi_domain;
|
||||
}
|
||||
|
||||
u32 vidc_get_hfi_codec(enum hal_video_codec hal_codec)
|
||||
u32 vidc_get_hfi_codec(enum hal_video_codec hal_codec, u32 sid)
|
||||
{
|
||||
u32 hfi_codec = 0;
|
||||
|
||||
|
|
@ -135,7 +61,7 @@ u32 vidc_get_hfi_codec(enum hal_video_codec hal_codec)
|
|||
hfi_codec = HFI_VIDEO_CODEC_CVP;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_HIGH, "%s: invalid codec 0x%x\n",
|
||||
s_vpr_h(sid, "%s: invalid codec 0x%x\n",
|
||||
__func__, hal_codec);
|
||||
hfi_codec = 0;
|
||||
break;
|
||||
|
|
@ -194,10 +120,10 @@ int create_pkt_cmd_sys_debug_config(
|
|||
|
||||
int create_pkt_cmd_sys_coverage_config(
|
||||
struct hfi_cmd_sys_set_property_packet *pkt,
|
||||
u32 mode)
|
||||
u32 mode, u32 sid)
|
||||
{
|
||||
if (!pkt) {
|
||||
dprintk(VIDC_ERR, "In %s(), No input packet\n", __func__);
|
||||
s_vpr_e(sid, "In %s(), No input packet\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -207,8 +133,7 @@ int create_pkt_cmd_sys_coverage_config(
|
|||
pkt->num_properties = 1;
|
||||
pkt->rg_property_data[0] = HFI_PROPERTY_SYS_CONFIG_COVERAGE;
|
||||
pkt->rg_property_data[1] = mode;
|
||||
dprintk(VIDC_HIGH, "Firmware coverage mode %d\n",
|
||||
pkt->rg_property_data[1]);
|
||||
s_vpr_h(sid, "Firmware coverage mode %d\n", pkt->rg_property_data[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -221,8 +146,7 @@ int create_pkt_cmd_sys_set_resource(
|
|||
u32 i = 0;
|
||||
|
||||
if (!pkt || !res_hdr || !res_value) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Invalid paramas pkt %pK res_hdr %pK res_value %pK\n",
|
||||
d_vpr_e("Invalid paramas pkt %pK res_hdr %pK res_value %pK\n",
|
||||
pkt, res_hdr, res_value);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -256,14 +180,13 @@ int create_pkt_cmd_sys_set_resource(
|
|||
|
||||
for (i = 0; i < hfi_sc_info->num_entries; i++) {
|
||||
hfi_sc[i] = res_sc[i];
|
||||
dprintk(VIDC_HIGH, "entry hfi#%d, sc_id %d, size %d\n",
|
||||
d_vpr_h("entry hfi#%d, sc_id %d, size %d\n",
|
||||
i, hfi_sc[i].sc_id, hfi_sc[i].size);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
dprintk(VIDC_ERR,
|
||||
"Invalid resource_id %d\n", res_hdr->resource_id);
|
||||
d_vpr_e("Invalid resource_id %d\n", res_hdr->resource_id);
|
||||
rc = -ENOTSUPP;
|
||||
}
|
||||
|
||||
|
|
@ -277,8 +200,7 @@ int create_pkt_cmd_sys_release_resource(
|
|||
int rc = 0;
|
||||
|
||||
if (!pkt || !res_hdr) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Invalid paramas pkt %pK res_hdr %pK\n",
|
||||
d_vpr_e("Invalid paramas pkt %pK res_hdr %pK\n",
|
||||
pkt, res_hdr);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -292,13 +214,11 @@ int create_pkt_cmd_sys_release_resource(
|
|||
pkt->resource_type = HFI_RESOURCE_SYSCACHE;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR,
|
||||
"Invalid resource_id %d\n", res_hdr->resource_id);
|
||||
d_vpr_e("Invalid resource_id %d\n", res_hdr->resource_id);
|
||||
rc = -ENOTSUPP;
|
||||
}
|
||||
|
||||
dprintk(VIDC_HIGH,
|
||||
"rel_res: pkt_type 0x%x res_type 0x%x prepared\n",
|
||||
d_vpr_h("rel_res: pkt_type 0x%x res_type 0x%x prepared\n",
|
||||
pkt->packet_type, pkt->resource_type);
|
||||
|
||||
return rc;
|
||||
|
|
@ -306,8 +226,7 @@ int create_pkt_cmd_sys_release_resource(
|
|||
|
||||
inline int create_pkt_cmd_sys_session_init(
|
||||
struct hfi_cmd_sys_session_init_packet *pkt,
|
||||
struct hal_session *session,
|
||||
u32 session_domain, u32 session_codec)
|
||||
u32 sid, u32 session_domain, u32 session_codec)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
|
|
@ -316,9 +235,9 @@ inline int create_pkt_cmd_sys_session_init(
|
|||
|
||||
pkt->size = sizeof(struct hfi_cmd_sys_session_init_packet);
|
||||
pkt->packet_type = HFI_CMD_SYS_SESSION_INIT;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->session_domain = vidc_get_hfi_domain(session_domain);
|
||||
pkt->session_codec = vidc_get_hfi_codec(session_codec);
|
||||
pkt->sid = sid;
|
||||
pkt->session_domain = vidc_get_hfi_domain(session_domain, sid);
|
||||
pkt->session_codec = vidc_get_hfi_codec(session_codec, sid);
|
||||
if (!pkt->session_codec)
|
||||
return -EINVAL;
|
||||
|
||||
|
|
@ -369,9 +288,8 @@ int create_pkt_cmd_sys_ubwc_config(
|
|||
return rc;
|
||||
}
|
||||
|
||||
|
||||
int create_pkt_cmd_session_cmd(struct vidc_hal_session_cmd_pkt *pkt,
|
||||
int pkt_type, struct hal_session *session)
|
||||
int pkt_type, u32 sid)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
|
|
@ -380,7 +298,7 @@ int create_pkt_cmd_session_cmd(struct vidc_hal_session_cmd_pkt *pkt,
|
|||
|
||||
pkt->size = sizeof(struct vidc_hal_session_cmd_pkt);
|
||||
pkt->packet_type = pkt_type;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->sid = sid;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -391,7 +309,7 @@ int create_pkt_cmd_sys_power_control(
|
|||
struct hfi_enable *hfi;
|
||||
|
||||
if (!pkt) {
|
||||
dprintk(VIDC_ERR, "No input packet\n");
|
||||
d_vpr_e("%s: No input packet\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -405,7 +323,7 @@ int create_pkt_cmd_sys_power_control(
|
|||
return 0;
|
||||
}
|
||||
|
||||
static u32 get_hfi_buffer(int hal_buffer)
|
||||
static u32 get_hfi_buffer(int hal_buffer, u32 sid)
|
||||
{
|
||||
u32 buffer;
|
||||
|
||||
|
|
@ -444,8 +362,7 @@ static u32 get_hfi_buffer(int hal_buffer)
|
|||
buffer = HFI_BUFFER_INTERNAL_PERSIST_1;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR, "Invalid buffer: %#x\n",
|
||||
hal_buffer);
|
||||
s_vpr_e(sid, "Invalid buffer: %#x\n", hal_buffer);
|
||||
buffer = 0;
|
||||
break;
|
||||
}
|
||||
|
|
@ -454,17 +371,16 @@ static u32 get_hfi_buffer(int hal_buffer)
|
|||
|
||||
int create_pkt_cmd_session_set_buffers(
|
||||
struct hfi_cmd_session_set_buffers_packet *pkt,
|
||||
struct hal_session *session,
|
||||
struct vidc_buffer_addr_info *buffer_info)
|
||||
u32 sid, struct vidc_buffer_addr_info *buffer_info)
|
||||
{
|
||||
int rc = 0;
|
||||
u32 i = 0;
|
||||
|
||||
if (!pkt || !session)
|
||||
if (!pkt)
|
||||
return -EINVAL;
|
||||
|
||||
pkt->packet_type = HFI_CMD_SESSION_SET_BUFFERS;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->sid = sid;
|
||||
pkt->buffer_size = buffer_info->buffer_size;
|
||||
pkt->min_buffer_size = buffer_info->buffer_size;
|
||||
pkt->num_buffers = buffer_info->num_buffers;
|
||||
|
|
@ -495,7 +411,8 @@ int create_pkt_cmd_session_set_buffers(
|
|||
}
|
||||
}
|
||||
|
||||
pkt->buffer_type = get_hfi_buffer(buffer_info->buffer_type);
|
||||
pkt->buffer_type =
|
||||
get_hfi_buffer(buffer_info->buffer_type, pkt->sid);
|
||||
if (!pkt->buffer_type)
|
||||
return -EINVAL;
|
||||
|
||||
|
|
@ -504,17 +421,16 @@ int create_pkt_cmd_session_set_buffers(
|
|||
|
||||
int create_pkt_cmd_session_release_buffers(
|
||||
struct hfi_cmd_session_release_buffer_packet *pkt,
|
||||
struct hal_session *session,
|
||||
struct vidc_buffer_addr_info *buffer_info)
|
||||
u32 sid, struct vidc_buffer_addr_info *buffer_info)
|
||||
{
|
||||
int rc = 0;
|
||||
u32 i = 0;
|
||||
|
||||
if (!pkt || !session)
|
||||
if (!pkt)
|
||||
return -EINVAL;
|
||||
|
||||
pkt->packet_type = HFI_CMD_SESSION_RELEASE_BUFFERS;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->sid = sid;
|
||||
pkt->buffer_size = buffer_info->buffer_size;
|
||||
pkt->num_buffers = buffer_info->num_buffers;
|
||||
|
||||
|
|
@ -542,7 +458,8 @@ int create_pkt_cmd_session_release_buffers(
|
|||
((buffer_info->num_buffers - 1) * sizeof(u32));
|
||||
}
|
||||
pkt->response_req = buffer_info->response_required;
|
||||
pkt->buffer_type = get_hfi_buffer(buffer_info->buffer_type);
|
||||
pkt->buffer_type =
|
||||
get_hfi_buffer(buffer_info->buffer_type, pkt->sid);
|
||||
if (!pkt->buffer_type)
|
||||
return -EINVAL;
|
||||
return rc;
|
||||
|
|
@ -550,20 +467,18 @@ int create_pkt_cmd_session_release_buffers(
|
|||
|
||||
int create_pkt_cmd_session_register_buffer(
|
||||
struct hfi_cmd_session_register_buffers_packet *pkt,
|
||||
struct hal_session *session,
|
||||
struct vidc_register_buffer *buffer)
|
||||
u32 sid, struct vidc_register_buffer *buffer)
|
||||
{
|
||||
int rc = 0;
|
||||
u32 i;
|
||||
struct hfi_buffer_mapping_type *buf;
|
||||
|
||||
if (!pkt || !session) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
if (!pkt) {
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, pkt);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pkt->packet_type = HFI_CMD_SESSION_REGISTER_BUFFERS;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->sid = sid;
|
||||
pkt->client_data = buffer->client_data;
|
||||
pkt->response_req = buffer->response_required;
|
||||
pkt->num_buffers = 1;
|
||||
|
|
@ -584,20 +499,18 @@ int create_pkt_cmd_session_register_buffer(
|
|||
|
||||
int create_pkt_cmd_session_unregister_buffer(
|
||||
struct hfi_cmd_session_unregister_buffers_packet *pkt,
|
||||
struct hal_session *session,
|
||||
struct vidc_unregister_buffer *buffer)
|
||||
u32 sid, struct vidc_unregister_buffer *buffer)
|
||||
{
|
||||
int rc = 0;
|
||||
u32 i;
|
||||
struct hfi_buffer_mapping_type *buf;
|
||||
|
||||
if (!pkt || !session) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
if (!pkt) {
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, pkt);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pkt->packet_type = HFI_CMD_SESSION_UNREGISTER_BUFFERS;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->sid = sid;
|
||||
pkt->client_data = buffer->client_data;
|
||||
pkt->response_req = buffer->response_required;
|
||||
pkt->num_buffers = 1;
|
||||
|
|
@ -618,17 +531,17 @@ int create_pkt_cmd_session_unregister_buffer(
|
|||
|
||||
int create_pkt_cmd_session_etb_decoder(
|
||||
struct hfi_cmd_session_empty_buffer_compressed_packet *pkt,
|
||||
struct hal_session *session, struct vidc_frame_data *input_frame)
|
||||
u32 sid, struct vidc_frame_data *input_frame)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!pkt || !session)
|
||||
if (!pkt)
|
||||
return -EINVAL;
|
||||
|
||||
pkt->size =
|
||||
sizeof(struct hfi_cmd_session_empty_buffer_compressed_packet);
|
||||
pkt->packet_type = HFI_CMD_SESSION_EMPTY_BUFFER;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->sid = sid;
|
||||
pkt->time_stamp_hi = upper_32_bits(input_frame->timestamp);
|
||||
pkt->time_stamp_lo = lower_32_bits(input_frame->timestamp);
|
||||
pkt->flags = input_frame->flags;
|
||||
|
|
@ -650,17 +563,17 @@ int create_pkt_cmd_session_etb_decoder(
|
|||
|
||||
int create_pkt_cmd_session_etb_encoder(
|
||||
struct hfi_cmd_session_empty_buffer_uncompressed_plane0_packet *pkt,
|
||||
struct hal_session *session, struct vidc_frame_data *input_frame)
|
||||
u32 sid, struct vidc_frame_data *input_frame)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!pkt || !session)
|
||||
if (!pkt)
|
||||
return -EINVAL;
|
||||
|
||||
pkt->size = sizeof(struct
|
||||
hfi_cmd_session_empty_buffer_uncompressed_plane0_packet);
|
||||
pkt->packet_type = HFI_CMD_SESSION_EMPTY_BUFFER;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->sid = sid;
|
||||
pkt->view_id = 0;
|
||||
pkt->time_stamp_hi = upper_32_bits(input_frame->timestamp);
|
||||
pkt->time_stamp_lo = lower_32_bits(input_frame->timestamp);
|
||||
|
|
@ -683,17 +596,16 @@ int create_pkt_cmd_session_etb_encoder(
|
|||
}
|
||||
|
||||
int create_pkt_cmd_session_ftb(struct hfi_cmd_session_fill_buffer_packet *pkt,
|
||||
struct hal_session *session,
|
||||
struct vidc_frame_data *output_frame)
|
||||
u32 sid, struct vidc_frame_data *output_frame)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!pkt || !session || !output_frame)
|
||||
if (!pkt || !output_frame)
|
||||
return -EINVAL;
|
||||
|
||||
pkt->size = sizeof(struct hfi_cmd_session_fill_buffer_packet);
|
||||
pkt->packet_type = HFI_CMD_SESSION_FILL_BUFFER;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->sid = sid;
|
||||
|
||||
if (output_frame->buffer_type == HAL_BUFFER_OUTPUT)
|
||||
pkt->stream_id = 0;
|
||||
|
|
@ -720,16 +632,16 @@ int create_pkt_cmd_session_ftb(struct hfi_cmd_session_fill_buffer_packet *pkt,
|
|||
|
||||
int create_pkt_cmd_session_get_buf_req(
|
||||
struct hfi_cmd_session_get_property_packet *pkt,
|
||||
struct hal_session *session)
|
||||
u32 sid)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!pkt || !session)
|
||||
if (!pkt)
|
||||
return -EINVAL;
|
||||
|
||||
pkt->size = sizeof(struct hfi_cmd_session_get_property_packet);
|
||||
pkt->packet_type = HFI_CMD_SESSION_GET_PROPERTY;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->sid = sid;
|
||||
pkt->num_properties = 1;
|
||||
pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS;
|
||||
|
||||
|
|
@ -737,16 +649,16 @@ int create_pkt_cmd_session_get_buf_req(
|
|||
}
|
||||
|
||||
int create_pkt_cmd_session_flush(struct hfi_cmd_session_flush_packet *pkt,
|
||||
struct hal_session *session, enum hal_flush flush_mode)
|
||||
u32 sid, enum hal_flush flush_mode)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!pkt || !session)
|
||||
if (!pkt)
|
||||
return -EINVAL;
|
||||
|
||||
pkt->size = sizeof(struct hfi_cmd_session_flush_packet);
|
||||
pkt->packet_type = HFI_CMD_SESSION_FLUSH;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->sid = sid;
|
||||
switch (flush_mode) {
|
||||
case HAL_FLUSH_INPUT:
|
||||
pkt->flush_type = HFI_FLUSH_INPUT;
|
||||
|
|
@ -758,7 +670,7 @@ int create_pkt_cmd_session_flush(struct hfi_cmd_session_flush_packet *pkt,
|
|||
pkt->flush_type = HFI_FLUSH_ALL;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR, "Invalid flush mode: %#x\n", flush_mode);
|
||||
s_vpr_e(pkt->sid, "Invalid flush mode: %#x\n", flush_mode);
|
||||
return -EINVAL;
|
||||
}
|
||||
return rc;
|
||||
|
|
@ -766,22 +678,22 @@ int create_pkt_cmd_session_flush(struct hfi_cmd_session_flush_packet *pkt,
|
|||
|
||||
int create_pkt_cmd_session_set_property(
|
||||
struct hfi_cmd_session_set_property_packet *pkt,
|
||||
struct hal_session *session,
|
||||
u32 sid,
|
||||
u32 ptype, void *pdata, u32 size)
|
||||
{
|
||||
if (!pkt || !session)
|
||||
if (!pkt)
|
||||
return -EINVAL;
|
||||
|
||||
pkt->size = sizeof(struct hfi_cmd_session_set_property_packet);
|
||||
pkt->packet_type = HFI_CMD_SESSION_SET_PROPERTY;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->sid = sid;
|
||||
pkt->num_properties = 1;
|
||||
pkt->size += size;
|
||||
pkt->rg_property_data[0] = ptype;
|
||||
if (size && pdata)
|
||||
memcpy(&pkt->rg_property_data[1], pdata, size);
|
||||
|
||||
dprintk(VIDC_HIGH, "Setting HAL Property = 0x%x\n", ptype);
|
||||
s_vpr_h(pkt->sid, "Setting HAL Property = 0x%x\n", ptype);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -800,8 +712,7 @@ static int get_hfi_ssr_type(enum hal_ssr_trigger_type type)
|
|||
rc = HFI_TEST_SSR_HW_WDOG_IRQ;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR,
|
||||
"SSR trigger type not recognized, using WDOG.\n");
|
||||
d_vpr_e("SSR trigger type not recognized, using WDOG.\n");
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -810,7 +721,7 @@ int create_pkt_ssr_cmd(enum hal_ssr_trigger_type type,
|
|||
struct hfi_cmd_sys_test_ssr_packet *pkt)
|
||||
{
|
||||
if (!pkt) {
|
||||
dprintk(VIDC_ERR, "Invalid params, device: %pK\n", pkt);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
pkt->size = sizeof(struct hfi_cmd_sys_test_ssr_packet);
|
||||
|
|
@ -823,7 +734,7 @@ int create_pkt_cmd_sys_image_version(
|
|||
struct hfi_cmd_sys_get_property_packet *pkt)
|
||||
{
|
||||
if (!pkt) {
|
||||
dprintk(VIDC_ERR, "%s invalid param :%pK\n", __func__, pkt);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
pkt->size = sizeof(struct hfi_cmd_sys_get_property_packet);
|
||||
|
|
@ -834,16 +745,15 @@ int create_pkt_cmd_sys_image_version(
|
|||
}
|
||||
|
||||
int create_pkt_cmd_session_sync_process(
|
||||
struct hfi_cmd_session_sync_process_packet *pkt,
|
||||
struct hal_session *session)
|
||||
struct hfi_cmd_session_sync_process_packet *pkt, u32 sid)
|
||||
{
|
||||
if (!pkt || !session)
|
||||
if (!pkt)
|
||||
return -EINVAL;
|
||||
|
||||
*pkt = (struct hfi_cmd_session_sync_process_packet) {0};
|
||||
pkt->size = sizeof(*pkt);
|
||||
pkt->packet_type = HFI_CMD_SESSION_SYNC;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->sid = sid;
|
||||
pkt->sync_id = 0;
|
||||
|
||||
return 0;
|
||||
|
|
@ -878,8 +788,7 @@ static struct hfi_packetization_ops hfi_default = {
|
|||
struct hfi_packetization_ops *hfi_get_pkt_ops_handle(
|
||||
enum hfi_packetization_type type)
|
||||
{
|
||||
dprintk(VIDC_HIGH, "%s selected\n",
|
||||
type == HFI_PACKETIZATION_4XX ?
|
||||
d_vpr_h("%s selected\n", type == HFI_PACKETIZATION_4XX ?
|
||||
"4xx packetization" : "Unknown hfi");
|
||||
|
||||
switch (type) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ struct hfi_packetization_ops {
|
|||
int (*sys_debug_config)(struct hfi_cmd_sys_set_property_packet *pkt,
|
||||
u32 mode);
|
||||
int (*sys_coverage_config)(struct hfi_cmd_sys_set_property_packet *pkt,
|
||||
u32 mode);
|
||||
u32 mode, u32 sid);
|
||||
int (*sys_release_resource)(
|
||||
struct hfi_cmd_sys_release_resource_packet *pkt,
|
||||
struct vidc_resource_hdr *resource_hdr);
|
||||
|
|
@ -41,49 +41,38 @@ struct hfi_packetization_ops {
|
|||
struct hfi_cmd_sys_test_ssr_packet *pkt);
|
||||
int (*session_init)(
|
||||
struct hfi_cmd_sys_session_init_packet *pkt,
|
||||
struct hal_session *session,
|
||||
u32 session_domain, u32 session_codec);
|
||||
u32 sid, u32 session_domain, u32 session_codec);
|
||||
int (*session_cmd)(struct vidc_hal_session_cmd_pkt *pkt,
|
||||
int pkt_type, struct hal_session *session);
|
||||
int pkt_type, u32 sid);
|
||||
int (*session_set_buffers)(
|
||||
struct hfi_cmd_session_set_buffers_packet *pkt,
|
||||
struct hal_session *session,
|
||||
struct vidc_buffer_addr_info *buffer_info);
|
||||
u32 sid, struct vidc_buffer_addr_info *buffer_info);
|
||||
int (*session_release_buffers)(
|
||||
struct hfi_cmd_session_release_buffer_packet *pkt,
|
||||
struct hal_session *session,
|
||||
struct vidc_buffer_addr_info *buffer_info);
|
||||
u32 sid, struct vidc_buffer_addr_info *buffer_info);
|
||||
int (*session_register_buffer)(
|
||||
struct hfi_cmd_session_register_buffers_packet *pkt,
|
||||
struct hal_session *session,
|
||||
struct vidc_register_buffer *buffer);
|
||||
u32 sid, struct vidc_register_buffer *buffer);
|
||||
int (*session_unregister_buffer)(
|
||||
struct hfi_cmd_session_unregister_buffers_packet *pkt,
|
||||
struct hal_session *session,
|
||||
struct vidc_unregister_buffer *buffer);
|
||||
u32 sid, struct vidc_unregister_buffer *buffer);
|
||||
int (*session_etb_decoder)(
|
||||
struct hfi_cmd_session_empty_buffer_compressed_packet *pkt,
|
||||
struct hal_session *session,
|
||||
struct vidc_frame_data *input_frame);
|
||||
u32 sid, struct vidc_frame_data *input_frame);
|
||||
int (*session_etb_encoder)(
|
||||
struct hfi_cmd_session_empty_buffer_uncompressed_plane0_packet
|
||||
*pkt, struct hal_session *session,
|
||||
struct vidc_frame_data *input_frame);
|
||||
*pkt, u32 sid, struct vidc_frame_data *input_frame);
|
||||
int (*session_ftb)(struct hfi_cmd_session_fill_buffer_packet *pkt,
|
||||
struct hal_session *session,
|
||||
struct vidc_frame_data *output_frame);
|
||||
u32 sid, struct vidc_frame_data *output_frame);
|
||||
int (*session_get_buf_req)(
|
||||
struct hfi_cmd_session_get_property_packet *pkt,
|
||||
struct hal_session *session);
|
||||
struct hfi_cmd_session_get_property_packet *pkt, u32 sid);
|
||||
int (*session_flush)(struct hfi_cmd_session_flush_packet *pkt,
|
||||
struct hal_session *session, enum hal_flush flush_mode);
|
||||
u32 sid, enum hal_flush flush_mode);
|
||||
int (*session_set_property)(
|
||||
struct hfi_cmd_session_set_property_packet *pkt,
|
||||
struct hal_session *session,
|
||||
u32 ptype, void *pdata, u32 size);
|
||||
u32 sid, u32 ptype, void *pdata, u32 size);
|
||||
int (*session_sync_process)(
|
||||
struct hfi_cmd_session_sync_process_packet *pkt,
|
||||
struct hal_session *session);
|
||||
struct hfi_cmd_session_sync_process_packet *pkt, u32 sid);
|
||||
};
|
||||
|
||||
struct hfi_packetization_ops *hfi_get_pkt_ops_handle(
|
||||
|
|
|
|||
|
|
@ -79,22 +79,21 @@ static enum vidc_status hfi_map_err_status(u32 hfi_err)
|
|||
return vidc_err;
|
||||
}
|
||||
|
||||
static int get_hal_pixel_depth(u32 hfi_bit_depth)
|
||||
static int get_hal_pixel_depth(u32 hfi_bit_depth, u32 sid)
|
||||
{
|
||||
switch (hfi_bit_depth) {
|
||||
case HFI_BITDEPTH_8: return MSM_VIDC_BIT_DEPTH_8;
|
||||
case HFI_BITDEPTH_9:
|
||||
case HFI_BITDEPTH_10: return MSM_VIDC_BIT_DEPTH_10;
|
||||
}
|
||||
dprintk(VIDC_ERR, "Unsupported bit depth: %d\n", hfi_bit_depth);
|
||||
s_vpr_e(sid, "Unsupported bit depth: %d\n", hfi_bit_depth);
|
||||
return MSM_VIDC_BIT_DEPTH_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static inline int validate_pkt_size(u32 rem_size, u32 msg_size)
|
||||
{
|
||||
if (rem_size < msg_size) {
|
||||
dprintk(VIDC_ERR, "%s: bad_packet_size: %d\n",
|
||||
__func__, rem_size);
|
||||
d_vpr_e("%s: bad_packet_size: %d\n", __func__, rem_size);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -117,13 +116,15 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
|
|||
int prop_id;
|
||||
int luma_bit_depth, chroma_bit_depth;
|
||||
struct hfi_colour_space *colour_info;
|
||||
u32 sid;
|
||||
|
||||
if (!validate_pkt_size(pkt->size,
|
||||
sizeof(struct hfi_msg_event_notify_packet)))
|
||||
return -E2BIG;
|
||||
|
||||
sid = pkt->sid;
|
||||
event_notify.device_id = device_id;
|
||||
event_notify.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
event_notify.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
event_notify.status = VIDC_ERR_NONE;
|
||||
num_properties_changed = pkt->event_data2;
|
||||
switch (pkt->event_data1) {
|
||||
|
|
@ -158,8 +159,7 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
|
|||
(struct hfi_frame_size *) data_ptr;
|
||||
event_notify.width = frame_sz->width;
|
||||
event_notify.height = frame_sz->height;
|
||||
dprintk(VIDC_HIGH|VIDC_PERF,
|
||||
"height: %d width: %d\n",
|
||||
s_vpr_hp(sid, "height: %d width: %d\n",
|
||||
frame_sz->height, frame_sz->width);
|
||||
data_ptr +=
|
||||
sizeof(struct hfi_frame_size);
|
||||
|
|
@ -174,8 +174,7 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
|
|||
(struct hfi_profile_level *) data_ptr;
|
||||
event_notify.profile = profile_level->profile;
|
||||
event_notify.level = profile_level->level;
|
||||
dprintk(VIDC_HIGH|VIDC_PERF,
|
||||
"profile: %d level: %d\n",
|
||||
s_vpr_hp(sid, "profile: %d level: %d\n",
|
||||
profile_level->profile,
|
||||
profile_level->level);
|
||||
data_ptr +=
|
||||
|
|
@ -200,10 +199,10 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
|
|||
*/
|
||||
luma_bit_depth = get_hal_pixel_depth(
|
||||
pixel_depth->bit_depth &
|
||||
GENMASK(15, 0));
|
||||
GENMASK(15, 0), sid);
|
||||
chroma_bit_depth = get_hal_pixel_depth(
|
||||
(pixel_depth->bit_depth &
|
||||
GENMASK(31, 16)) >> 16);
|
||||
GENMASK(31, 16)) >> 16, sid);
|
||||
if (luma_bit_depth == MSM_VIDC_BIT_DEPTH_10 ||
|
||||
chroma_bit_depth ==
|
||||
MSM_VIDC_BIT_DEPTH_10)
|
||||
|
|
@ -211,7 +210,7 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
|
|||
MSM_VIDC_BIT_DEPTH_10;
|
||||
else
|
||||
event_notify.bit_depth = luma_bit_depth;
|
||||
dprintk(VIDC_HIGH|VIDC_PERF,
|
||||
s_vpr_hp(sid,
|
||||
"bitdepth(%d), luma_bit_depth(%d), chroma_bit_depth(%d)\n",
|
||||
event_notify.bit_depth, luma_bit_depth,
|
||||
chroma_bit_depth);
|
||||
|
|
@ -226,8 +225,7 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
|
|||
pic_struct = (struct hfi_pic_struct *) data_ptr;
|
||||
event_notify.pic_struct =
|
||||
pic_struct->progressive_only;
|
||||
dprintk(VIDC_HIGH|VIDC_PERF,
|
||||
"Progressive only flag: %d\n",
|
||||
s_vpr_hp(sid, "Progressive only flag: %d\n",
|
||||
pic_struct->progressive_only);
|
||||
data_ptr +=
|
||||
sizeof(struct hfi_pic_struct);
|
||||
|
|
@ -242,8 +240,7 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
|
|||
(struct hfi_colour_space *) data_ptr;
|
||||
event_notify.colour_space =
|
||||
colour_info->colour_space;
|
||||
dprintk(VIDC_HIGH,
|
||||
"Colour space value is: %d\n",
|
||||
s_vpr_h(sid, "Colour space value is: %d\n",
|
||||
colour_info->colour_space);
|
||||
data_ptr +=
|
||||
sizeof(struct hfi_colour_space);
|
||||
|
|
@ -255,8 +252,8 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
|
|||
data_ptr = data_ptr + sizeof(u32);
|
||||
entropy_mode = *(u32 *)data_ptr;
|
||||
event_notify.entropy_mode = entropy_mode;
|
||||
dprintk(VIDC_HIGH|VIDC_PERF,
|
||||
"Entropy Mode: 0x%x\n", entropy_mode);
|
||||
s_vpr_hp(sid, "Entropy Mode: 0x%x\n",
|
||||
entropy_mode);
|
||||
data_ptr +=
|
||||
sizeof(u32);
|
||||
rem_size -= sizeof(u32);
|
||||
|
|
@ -271,8 +268,7 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
|
|||
data_ptr;
|
||||
event_notify.capture_buf_count =
|
||||
buf_req->buffer_count_min;
|
||||
dprintk(VIDC_HIGH|VIDC_PERF,
|
||||
"Capture Count : 0x%x\n",
|
||||
s_vpr_hp(sid, "Capture Count : 0x%x\n",
|
||||
event_notify.capture_buf_count);
|
||||
data_ptr +=
|
||||
sizeof(struct hfi_buffer_requirements);
|
||||
|
|
@ -292,14 +288,12 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
|
|||
event_notify.crop_data.width = crop_info->width;
|
||||
event_notify.crop_data.height =
|
||||
crop_info->height;
|
||||
dprintk(VIDC_HIGH,
|
||||
s_vpr_h(sid,
|
||||
"CROP info : Left = %d Top = %d\n",
|
||||
crop_info->left,
|
||||
crop_info->top);
|
||||
dprintk(VIDC_HIGH,
|
||||
crop_info->left, crop_info->top);
|
||||
s_vpr_h(sid,
|
||||
"CROP info : Width = %d Height = %d\n",
|
||||
crop_info->width,
|
||||
crop_info->height);
|
||||
crop_info->width, crop_info->height);
|
||||
data_ptr +=
|
||||
sizeof(struct
|
||||
hfi_index_extradata_input_crop_payload);
|
||||
|
|
@ -307,8 +301,7 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
|
|||
hfi_index_extradata_input_crop_payload);
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR,
|
||||
"%s cmd: %#x not supported\n",
|
||||
s_vpr_e(sid, "%s: cmd: %#x not supported\n",
|
||||
__func__, prop_id);
|
||||
break;
|
||||
}
|
||||
|
|
@ -329,25 +322,24 @@ static int hfi_process_evt_release_buffer_ref(u32 device_id,
|
|||
struct msm_vidc_cb_event event_notify = {0};
|
||||
struct hfi_msg_release_buffer_ref_event_packet *data;
|
||||
|
||||
dprintk(VIDC_LOW,
|
||||
"RECEIVED: EVENT_NOTIFY - release_buffer_reference\n");
|
||||
if (sizeof(struct hfi_msg_event_notify_packet)
|
||||
> pkt->size) {
|
||||
dprintk(VIDC_ERR, "%s: bad_pkt_size\n", __func__);
|
||||
d_vpr_e("%s: bad_pkt_size\n", __func__);
|
||||
return -E2BIG;
|
||||
}
|
||||
if (pkt->size < sizeof(struct hfi_msg_event_notify_packet) - sizeof(u32)
|
||||
+ sizeof(struct hfi_msg_release_buffer_ref_event_packet)) {
|
||||
dprintk(VIDC_ERR, "%s: bad_pkt_size: %d\n",
|
||||
__func__, pkt->size);
|
||||
d_vpr_e("%s: bad_pkt_size: %d\n", __func__, pkt->size);
|
||||
return -E2BIG;
|
||||
}
|
||||
|
||||
data = (struct hfi_msg_release_buffer_ref_event_packet *)
|
||||
pkt->rg_ext_event_data;
|
||||
s_vpr_l(pkt->sid,
|
||||
"RECEIVED: EVENT_NOTIFY - release_buffer_reference\n");
|
||||
|
||||
event_notify.device_id = device_id;
|
||||
event_notify.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
event_notify.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
event_notify.status = VIDC_ERR_NONE;
|
||||
event_notify.hal_event_type = HAL_EVENT_RELEASE_BUFFER_REFERENCE;
|
||||
event_notify.packet_buffer = data->packet_buffer;
|
||||
|
|
@ -379,24 +371,24 @@ static int hfi_process_session_error(u32 device_id,
|
|||
struct msm_vidc_cb_info *info)
|
||||
{
|
||||
struct msm_vidc_cb_cmd_done cmd_done = {0};
|
||||
u32 sid = pkt->sid;
|
||||
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = hfi_map_err_status(pkt->event_data1);
|
||||
info->response.cmd = cmd_done;
|
||||
dprintk(VIDC_HIGH, "Received: SESSION_ERROR with event id : %#x %#x\n",
|
||||
s_vpr_h(sid, "RECEIVED: SESSION_ERROR with event id : %#x %#x\n",
|
||||
pkt->event_data1, pkt->event_data2);
|
||||
switch (pkt->event_data1) {
|
||||
/* Ignore below errors */
|
||||
case HFI_ERR_SESSION_INVALID_SCALE_FACTOR:
|
||||
case HFI_ERR_SESSION_UPSCALE_NOT_SUPPORTED:
|
||||
dprintk(VIDC_HIGH, "Non Fatal: HFI_EVENT_SESSION_ERROR\n");
|
||||
s_vpr_h(sid, "Non Fatal: HFI_EVENT_SESSION_ERROR\n");
|
||||
info->response_type = HAL_RESPONSE_UNUSED;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: session %x data1 %#x, data2 %#x\n", __func__,
|
||||
pkt->session_id, pkt->event_data1, pkt->event_data2);
|
||||
s_vpr_e(sid, "%s: data1 %#x, data2 %#x\n", __func__,
|
||||
pkt->event_data1, pkt->event_data2);
|
||||
info->response_type = HAL_SESSION_ERROR;
|
||||
break;
|
||||
}
|
||||
|
|
@ -409,31 +401,30 @@ static int hfi_process_event_notify(u32 device_id,
|
|||
struct msm_vidc_cb_info *info)
|
||||
{
|
||||
struct hfi_msg_event_notify_packet *pkt = _pkt;
|
||||
dprintk(VIDC_LOW, "Received: EVENT_NOTIFY\n");
|
||||
|
||||
if (pkt->size < sizeof(struct hfi_msg_event_notify_packet)) {
|
||||
dprintk(VIDC_ERR, "Invalid Params\n");
|
||||
d_vpr_e("%s: invalid params %u %u\n", __func__,
|
||||
pkt->size, sizeof(struct hfi_msg_event_notify_packet));
|
||||
return -E2BIG;
|
||||
}
|
||||
|
||||
s_vpr_l(pkt->sid, "RECEIVED: EVENT_NOTIFY\n");
|
||||
|
||||
switch (pkt->event_id) {
|
||||
case HFI_EVENT_SYS_ERROR:
|
||||
dprintk(VIDC_ERR, "HFI_EVENT_SYS_ERROR: %d, %#x\n",
|
||||
s_vpr_e(pkt->sid, "HFI_EVENT_SYS_ERROR: %d, %#x\n",
|
||||
pkt->event_data1, pkt->event_data2);
|
||||
return hfi_process_sys_error(device_id, pkt, info);
|
||||
case HFI_EVENT_SESSION_ERROR:
|
||||
dprintk(VIDC_HIGH, "HFI_EVENT_SESSION_ERROR[%#x]\n",
|
||||
pkt->session_id);
|
||||
s_vpr_h(pkt->sid, "HFI_EVENT_SESSION_ERROR\n");
|
||||
return hfi_process_session_error(device_id, pkt, info);
|
||||
|
||||
case HFI_EVENT_SESSION_SEQUENCE_CHANGED:
|
||||
dprintk(VIDC_HIGH, "HFI_EVENT_SESSION_SEQUENCE_CHANGED[%#x]\n",
|
||||
pkt->session_id);
|
||||
s_vpr_h(pkt->sid, "HFI_EVENT_SESSION_SEQUENCE_CHANGED\n");
|
||||
return hfi_process_sess_evt_seq_changed(device_id, pkt, info);
|
||||
|
||||
case HFI_EVENT_RELEASE_BUFFER_REFERENCE:
|
||||
dprintk(VIDC_LOW, "HFI_EVENT_RELEASE_BUFFER_REFERENCE[%#x]\n",
|
||||
pkt->session_id);
|
||||
s_vpr_l(pkt->sid, "HFI_EVENT_RELEASE_BUFFER_REFERENCE\n");
|
||||
return hfi_process_evt_release_buffer_ref(device_id, pkt, info);
|
||||
|
||||
case HFI_EVENT_SESSION_PROPERTY_CHANGED:
|
||||
|
|
@ -454,19 +445,19 @@ static int hfi_process_sys_init_done(u32 device_id,
|
|||
struct msm_vidc_cb_cmd_done cmd_done = {0};
|
||||
enum vidc_status status = VIDC_ERR_NONE;
|
||||
|
||||
dprintk(VIDC_HIGH, "RECEIVED: SYS_INIT_DONE\n");
|
||||
if (sizeof(struct hfi_msg_sys_init_done_packet) > pkt->size) {
|
||||
dprintk(VIDC_ERR, "%s: bad_pkt_size: %d\n", __func__,
|
||||
d_vpr_e("%s: bad_pkt_size: %d\n", __func__,
|
||||
pkt->size);
|
||||
return -E2BIG;
|
||||
}
|
||||
d_vpr_h("RECEIVED: SYS_INIT_DONE\n");
|
||||
|
||||
status = hfi_map_err_status(pkt->error_type);
|
||||
if (status)
|
||||
dprintk(VIDC_ERR, "%s: status %#x\n",
|
||||
__func__, status);
|
||||
d_vpr_e("%s: status %#x\n", __func__, status);
|
||||
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.session_id = NULL;
|
||||
cmd_done.inst_id = NULL;
|
||||
cmd_done.status = (u32)status;
|
||||
cmd_done.size = sizeof(struct vidc_hal_sys_init_done);
|
||||
|
||||
|
|
@ -485,18 +476,17 @@ static int hfi_process_sys_rel_resource_done(u32 device_id,
|
|||
enum vidc_status status = VIDC_ERR_NONE;
|
||||
u32 pkt_size;
|
||||
|
||||
dprintk(VIDC_HIGH, "RECEIVED: SYS_RELEASE_RESOURCE_DONE\n");
|
||||
pkt_size = sizeof(struct hfi_msg_sys_release_resource_done_packet);
|
||||
if (pkt_size > pkt->size) {
|
||||
dprintk(VIDC_ERR,
|
||||
"hal_process_sys_rel_resource_done: bad size: %d\n",
|
||||
d_vpr_e("hal_process_sys_rel_resource_done: bad size: %d\n",
|
||||
pkt->size);
|
||||
return -E2BIG;
|
||||
}
|
||||
d_vpr_h("RECEIVED: SYS_RELEASE_RESOURCE_DONE\n");
|
||||
|
||||
status = hfi_map_err_status(pkt->error_type);
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.session_id = NULL;
|
||||
cmd_done.inst_id = NULL;
|
||||
cmd_done.status = (u32) status;
|
||||
cmd_done.size = 0;
|
||||
|
||||
|
|
@ -508,15 +498,13 @@ static int hfi_process_sys_rel_resource_done(u32 device_id,
|
|||
|
||||
static void hfi_process_sess_get_prop_buf_req(
|
||||
struct hfi_msg_session_property_info_packet *prop,
|
||||
struct buffer_requirements *buffreq)
|
||||
struct buffer_requirements *buffreq, u32 sid)
|
||||
{
|
||||
struct hfi_buffer_requirements *hfi_buf_req;
|
||||
u32 req_bytes;
|
||||
|
||||
if (!prop) {
|
||||
dprintk(VIDC_ERR,
|
||||
"hal_process_sess_get_prop_buf_req: bad_prop: %pK\n",
|
||||
prop);
|
||||
s_vpr_e(sid, "%s: bad_prop: %pK\n", __func__, prop);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -524,9 +512,7 @@ static void hfi_process_sess_get_prop_buf_req(
|
|||
struct hfi_msg_session_property_info_packet);
|
||||
if (!req_bytes || req_bytes % sizeof(struct hfi_buffer_requirements) ||
|
||||
!prop->rg_property_data[1]) {
|
||||
dprintk(VIDC_ERR,
|
||||
"hal_process_sess_get_prop_buf_req: bad_pkt: %d\n",
|
||||
req_bytes);
|
||||
s_vpr_e(sid, "%s: bad_pkt: %d\n", __func__, req_bytes);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -534,13 +520,12 @@ static void hfi_process_sess_get_prop_buf_req(
|
|||
&prop->rg_property_data[1];
|
||||
|
||||
if (!hfi_buf_req) {
|
||||
dprintk(VIDC_ERR, "%s - invalid buffer req pointer\n",
|
||||
__func__);
|
||||
s_vpr_e(sid, "%s: invalid buffer req pointer\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
while (req_bytes) {
|
||||
dprintk(VIDC_HIGH, "got buffer requirements for: %d\n",
|
||||
s_vpr_h(sid, "got buffer requirements for: %d\n",
|
||||
hfi_buf_req->buffer_type);
|
||||
switch (hfi_buf_req->buffer_type) {
|
||||
case HFI_BUFFER_INPUT:
|
||||
|
|
@ -613,9 +598,8 @@ static void hfi_process_sess_get_prop_buf_req(
|
|||
HAL_BUFFER_INTERNAL_RECON;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR,
|
||||
"hal_process_sess_get_prop_buf_req: bad_buffer_type: %d\n",
|
||||
hfi_buf_req->buffer_type);
|
||||
s_vpr_e(sid, "%s: bad_buffer_type: %d\n",
|
||||
__func__, hfi_buf_req->buffer_type);
|
||||
break;
|
||||
}
|
||||
req_bytes -= sizeof(struct hfi_buffer_requirements);
|
||||
|
|
@ -631,24 +615,20 @@ static int hfi_process_session_prop_info(u32 device_id,
|
|||
struct msm_vidc_cb_cmd_done cmd_done = {0};
|
||||
struct buffer_requirements buff_req = { { {0} } };
|
||||
|
||||
dprintk(VIDC_HIGH, "Received SESSION_PROPERTY_INFO[%#x]\n",
|
||||
pkt->session_id);
|
||||
|
||||
if (pkt->size < sizeof(struct hfi_msg_session_property_info_packet)) {
|
||||
dprintk(VIDC_ERR,
|
||||
"hal_process_session_prop_info: bad_pkt_size\n");
|
||||
d_vpr_e("hal_process_session_prop_info: bad_pkt_size\n");
|
||||
return -E2BIG;
|
||||
} else if (!pkt->num_properties) {
|
||||
dprintk(VIDC_ERR,
|
||||
"hal_process_session_prop_info: no_properties\n");
|
||||
d_vpr_e("hal_process_session_prop_info: no_properties\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
s_vpr_h(pkt->sid, "Received SESSION_PROPERTY_INFO\n");
|
||||
|
||||
switch (pkt->rg_property_data[0]) {
|
||||
case HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS:
|
||||
hfi_process_sess_get_prop_buf_req(pkt, &buff_req);
|
||||
hfi_process_sess_get_prop_buf_req(pkt, &buff_req, pkt->sid);
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = VIDC_ERR_NONE;
|
||||
cmd_done.data.property.buf_req = buff_req;
|
||||
cmd_done.size = sizeof(buff_req);
|
||||
|
|
@ -658,9 +638,8 @@ static int hfi_process_session_prop_info(u32 device_id,
|
|||
|
||||
return 0;
|
||||
default:
|
||||
dprintk(VIDC_HIGH,
|
||||
"hal_process_session_prop_info: unknown_prop_id: %x\n",
|
||||
pkt->rg_property_data[0]);
|
||||
s_vpr_h(pkt->sid, "%s: unknown_prop_id: %x\n",
|
||||
__func__, pkt->rg_property_data[0]);
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
}
|
||||
|
|
@ -672,16 +651,14 @@ static int hfi_process_session_init_done(u32 device_id,
|
|||
struct hfi_msg_sys_session_init_done_packet *pkt = _pkt;
|
||||
struct msm_vidc_cb_cmd_done cmd_done = {0};
|
||||
|
||||
dprintk(VIDC_HIGH, "RECEIVED: SESSION_INIT_DONE[%x]\n", pkt->session_id);
|
||||
|
||||
if (sizeof(struct hfi_msg_sys_session_init_done_packet) > pkt->size) {
|
||||
dprintk(VIDC_ERR,
|
||||
"hal_process_session_init_done: bad_pkt_size\n");
|
||||
d_vpr_e("hal_process_session_init_done: bad_pkt_size\n");
|
||||
return -E2BIG;
|
||||
}
|
||||
s_vpr_h(pkt->sid, "RECEIVED: SESSION_INIT_DONE\n");
|
||||
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = hfi_map_err_status(pkt->error_type);
|
||||
|
||||
info->response_type = HAL_SESSION_INIT_DONE;
|
||||
|
|
@ -697,19 +674,15 @@ static int hfi_process_session_load_res_done(u32 device_id,
|
|||
struct hfi_msg_session_load_resources_done_packet *pkt = _pkt;
|
||||
struct msm_vidc_cb_cmd_done cmd_done = {0};
|
||||
|
||||
dprintk(VIDC_HIGH, "RECEIVED: SESSION_LOAD_RESOURCES_DONE[%#x]\n",
|
||||
pkt->session_id);
|
||||
|
||||
if (sizeof(struct hfi_msg_session_load_resources_done_packet) !=
|
||||
pkt->size) {
|
||||
dprintk(VIDC_ERR,
|
||||
"hal_process_session_load_res_done: bad packet size: %d\n",
|
||||
pkt->size);
|
||||
d_vpr_e("%s: bad packet size: %d\n", __func__, pkt->size);
|
||||
return -E2BIG;
|
||||
}
|
||||
s_vpr_h(pkt->sid, "RECEIVED: SESSION_LOAD_RESOURCES_DONE\n");
|
||||
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = hfi_map_err_status(pkt->error_type);
|
||||
cmd_done.size = 0;
|
||||
|
||||
|
|
@ -726,18 +699,15 @@ static int hfi_process_session_flush_done(u32 device_id,
|
|||
struct hfi_msg_session_flush_done_packet *pkt = _pkt;
|
||||
struct msm_vidc_cb_cmd_done cmd_done = {0};
|
||||
|
||||
dprintk(VIDC_HIGH, "RECEIVED: SESSION_FLUSH_DONE[%#x]\n",
|
||||
pkt->session_id);
|
||||
|
||||
if (sizeof(struct hfi_msg_session_flush_done_packet) != pkt->size) {
|
||||
dprintk(VIDC_ERR,
|
||||
"hal_process_session_flush_done: bad packet size: %d\n",
|
||||
d_vpr_e("hal_process_session_flush_done: bad packet size: %d\n",
|
||||
pkt->size);
|
||||
return -E2BIG;
|
||||
}
|
||||
s_vpr_h(pkt->sid, "RECEIVED: SESSION_FLUSH_DONE\n");
|
||||
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = hfi_map_err_status(pkt->error_type);
|
||||
cmd_done.size = sizeof(u32);
|
||||
|
||||
|
|
@ -752,8 +722,7 @@ static int hfi_process_session_flush_done(u32 device_id,
|
|||
cmd_done.data.flush_type = HAL_FLUSH_ALL;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: invalid flush type!", __func__);
|
||||
s_vpr_e(pkt->sid, "%s: invalid flush type!", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -770,14 +739,14 @@ static int hfi_process_session_etb_done(u32 device_id,
|
|||
struct hfi_msg_session_empty_buffer_done_packet *pkt = _pkt;
|
||||
struct msm_vidc_cb_data_done data_done = {0};
|
||||
|
||||
dprintk(VIDC_LOW, "RECEIVED: SESSION_ETB_DONE[%#x]\n", pkt->session_id);
|
||||
|
||||
if (!pkt || pkt->size <
|
||||
sizeof(struct hfi_msg_session_empty_buffer_done_packet))
|
||||
goto bad_packet_size;
|
||||
|
||||
s_vpr_l(pkt->sid, "RECEIVED: SESSION_ETB_DONE\n");
|
||||
|
||||
data_done.device_id = device_id;
|
||||
data_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
data_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
data_done.status = hfi_map_err_status(pkt->error_type);
|
||||
data_done.size = sizeof(struct msm_vidc_cb_data_done);
|
||||
data_done.input_done.input_tag = pkt->input_tag;
|
||||
|
|
@ -805,7 +774,7 @@ static int hfi_process_session_etb_done(u32 device_id,
|
|||
|
||||
return 0;
|
||||
bad_packet_size:
|
||||
dprintk(VIDC_ERR, "%s: bad_pkt_size: %d\n",
|
||||
d_vpr_e("%s: ebd - bad_pkt_size: %d\n",
|
||||
__func__, pkt ? pkt->size : 0);
|
||||
return -E2BIG;
|
||||
}
|
||||
|
|
@ -819,7 +788,7 @@ static int hfi_process_session_ftb_done(
|
|||
bool is_decoder = false, is_encoder = false;
|
||||
|
||||
if (!msg_hdr) {
|
||||
dprintk(VIDC_ERR, "Invalid Params\n");
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -829,7 +798,7 @@ static int hfi_process_session_ftb_done(
|
|||
hfi_msg_session_fbd_uncompressed_plane0_packet) + 4;
|
||||
|
||||
if (!(is_encoder ^ is_decoder)) {
|
||||
dprintk(VIDC_ERR, "Ambiguous packet (%#x) received (size %d)\n",
|
||||
d_vpr_e("Ambiguous packet (%#x) received (size %d)\n",
|
||||
msg_hdr->packet, msg_hdr->size);
|
||||
return -EBADHANDLE;
|
||||
}
|
||||
|
|
@ -838,23 +807,20 @@ static int hfi_process_session_ftb_done(
|
|||
struct hfi_msg_session_fill_buffer_done_compressed_packet *pkt =
|
||||
(struct hfi_msg_session_fill_buffer_done_compressed_packet *)
|
||||
msg_hdr;
|
||||
dprintk(VIDC_LOW, "RECEIVED: SESSION_FTB_DONE[%#x]\n",
|
||||
pkt->session_id);
|
||||
if (sizeof(struct
|
||||
hfi_msg_session_fill_buffer_done_compressed_packet)
|
||||
> pkt->size) {
|
||||
dprintk(VIDC_ERR,
|
||||
"hal_process_session_ftb_done: bad_pkt_size\n");
|
||||
d_vpr_e("hal_process_session_ftb_done: bad_pkt_size\n");
|
||||
return -E2BIG;
|
||||
} else if (pkt->error_type != HFI_ERR_NONE) {
|
||||
dprintk(VIDC_ERR,
|
||||
"got buffer back with error %x\n",
|
||||
s_vpr_e(pkt->sid, "got buffer back with error %x\n",
|
||||
pkt->error_type);
|
||||
/* Proceed with the FBD */
|
||||
}
|
||||
s_vpr_l(pkt->sid, "RECEIVED: SESSION_FTB_DONE\n");
|
||||
|
||||
data_done.device_id = device_id;
|
||||
data_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
data_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
data_done.status = hfi_map_err_status(pkt->error_type);
|
||||
data_done.size = sizeof(struct msm_vidc_cb_data_done);
|
||||
|
||||
|
|
@ -875,19 +841,16 @@ static int hfi_process_session_ftb_done(
|
|||
struct hfi_msg_session_fbd_uncompressed_plane0_packet *pkt =
|
||||
(struct hfi_msg_session_fbd_uncompressed_plane0_packet *)
|
||||
msg_hdr;
|
||||
|
||||
dprintk(VIDC_LOW, "RECEIVED: SESSION_FTB_DONE[%#x]\n",
|
||||
pkt->session_id);
|
||||
if (sizeof(
|
||||
struct hfi_msg_session_fbd_uncompressed_plane0_packet) >
|
||||
pkt->size) {
|
||||
dprintk(VIDC_ERR,
|
||||
"hal_process_session_ftb_done: bad_pkt_size\n");
|
||||
d_vpr_e("hal_process_session_ftb_done: bad_pkt_size\n");
|
||||
return -E2BIG;
|
||||
}
|
||||
s_vpr_l(pkt->sid, "RECEIVED: SESSION_FTB_DONE\n");
|
||||
|
||||
data_done.device_id = device_id;
|
||||
data_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
data_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
data_done.status = hfi_map_err_status(pkt->error_type);
|
||||
data_done.size = sizeof(struct msm_vidc_cb_data_done);
|
||||
|
||||
|
|
@ -938,18 +901,15 @@ static int hfi_process_session_start_done(u32 device_id,
|
|||
struct hfi_msg_session_start_done_packet *pkt = _pkt;
|
||||
struct msm_vidc_cb_cmd_done cmd_done = {0};
|
||||
|
||||
dprintk(VIDC_HIGH, "RECEIVED: SESSION_START_DONE[%#x]\n",
|
||||
pkt->session_id);
|
||||
|
||||
if (!pkt || pkt->size !=
|
||||
sizeof(struct hfi_msg_session_start_done_packet)) {
|
||||
dprintk(VIDC_ERR, "%s: bad packet/packet size\n",
|
||||
__func__);
|
||||
d_vpr_e("%s: bad packet/packet size\n", __func__);
|
||||
return -E2BIG;
|
||||
}
|
||||
s_vpr_h(pkt->sid, "RECEIVED: SESSION_START_DONE\n");
|
||||
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = hfi_map_err_status(pkt->error_type);
|
||||
cmd_done.size = 0;
|
||||
|
||||
|
|
@ -965,18 +925,15 @@ static int hfi_process_session_stop_done(u32 device_id,
|
|||
struct hfi_msg_session_stop_done_packet *pkt = _pkt;
|
||||
struct msm_vidc_cb_cmd_done cmd_done = {0};
|
||||
|
||||
dprintk(VIDC_HIGH, "RECEIVED: SESSION_STOP_DONE[%#x]\n",
|
||||
pkt->session_id);
|
||||
|
||||
if (!pkt || pkt->size !=
|
||||
sizeof(struct hfi_msg_session_stop_done_packet)) {
|
||||
dprintk(VIDC_ERR, "%s: bad packet/packet size\n",
|
||||
__func__);
|
||||
d_vpr_e("%s: bad packet/packet size\n", __func__);
|
||||
return -E2BIG;
|
||||
}
|
||||
s_vpr_h(pkt->sid, "RECEIVED: SESSION_STOP_DONE\n");
|
||||
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = hfi_map_err_status(pkt->error_type);
|
||||
cmd_done.size = 0;
|
||||
|
||||
|
|
@ -993,18 +950,15 @@ static int hfi_process_session_rel_res_done(u32 device_id,
|
|||
struct hfi_msg_session_release_resources_done_packet *pkt = _pkt;
|
||||
struct msm_vidc_cb_cmd_done cmd_done = {0};
|
||||
|
||||
dprintk(VIDC_HIGH, "RECEIVED: SESSION_RELEASE_RESOURCES_DONE[%#x]\n",
|
||||
pkt->session_id);
|
||||
|
||||
if (!pkt || pkt->size !=
|
||||
sizeof(struct hfi_msg_session_release_resources_done_packet)) {
|
||||
dprintk(VIDC_ERR, "%s: bad packet/packet size\n",
|
||||
__func__);
|
||||
d_vpr_e("%s: bad packet/packet size\n", __func__);
|
||||
return -E2BIG;
|
||||
}
|
||||
s_vpr_h(pkt->sid, "RECEIVED: SESSION_RELEASE_RESOURCES_DONE\n");
|
||||
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = hfi_map_err_status(pkt->error_type);
|
||||
cmd_done.size = 0;
|
||||
|
||||
|
|
@ -1023,16 +977,15 @@ static int hfi_process_session_rel_buf_done(u32 device_id,
|
|||
|
||||
if (!pkt || pkt->size <
|
||||
sizeof(struct hfi_msg_session_release_buffers_done_packet)) {
|
||||
dprintk(VIDC_ERR, "bad packet/packet size %d\n",
|
||||
d_vpr_e("bad packet/packet size %d\n",
|
||||
pkt ? pkt->size : 0);
|
||||
return -E2BIG;
|
||||
}
|
||||
dprintk(VIDC_HIGH, "RECEIVED:SESSION_RELEASE_BUFFER_DONE[%#x]\n",
|
||||
pkt->session_id);
|
||||
s_vpr_h(pkt->sid, "RECEIVED:SESSION_RELEASE_BUFFER_DONE\n");
|
||||
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.size = sizeof(struct msm_vidc_cb_cmd_done);
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = hfi_map_err_status(pkt->error_type);
|
||||
cmd_done.data.buffer_info.buffer_addr = *pkt->rg_buffer_info;
|
||||
cmd_done.size = sizeof(struct hal_buffer_info);
|
||||
|
|
@ -1052,16 +1005,15 @@ static int hfi_process_session_register_buffer_done(u32 device_id,
|
|||
|
||||
if (!pkt || pkt->size <
|
||||
sizeof(struct hfi_msg_session_register_buffers_done_packet)) {
|
||||
dprintk(VIDC_ERR, "%s: bad packet/packet size %d\n",
|
||||
d_vpr_e("%s: bad packet/packet size %d\n",
|
||||
__func__, pkt ? pkt->size : 0);
|
||||
return -E2BIG;
|
||||
}
|
||||
dprintk(VIDC_HIGH, "RECEIVED: SESSION_REGISTER_BUFFERS_DONE[%#x]\n",
|
||||
pkt->session_id);
|
||||
s_vpr_h(pkt->sid, "RECEIVED: SESSION_REGISTER_BUFFERS_DONE\n");
|
||||
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.size = sizeof(struct msm_vidc_cb_cmd_done);
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = hfi_map_err_status(pkt->error_type);
|
||||
cmd_done.data.regbuf.client_data = pkt->client_data;
|
||||
|
||||
|
|
@ -1080,16 +1032,15 @@ static int hfi_process_session_unregister_buffer_done(u32 device_id,
|
|||
|
||||
if (!pkt || pkt->size <
|
||||
sizeof(struct hfi_msg_session_unregister_buffers_done_packet)) {
|
||||
dprintk(VIDC_ERR, "%s: bad packet/packet size %d\n",
|
||||
d_vpr_e("%s: bad packet/packet size %d\n",
|
||||
__func__, pkt ? pkt->size : 0);
|
||||
return -E2BIG;
|
||||
}
|
||||
dprintk(VIDC_HIGH, "RECEIVED: SESSION_UNREGISTER_BUFFERS_DONE[%#x]\n",
|
||||
pkt->session_id);
|
||||
s_vpr_h(pkt->sid, "RECEIVED: SESSION_UNREGISTER_BUFFERS_DONE\n");
|
||||
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.size = sizeof(struct msm_vidc_cb_cmd_done);
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = hfi_map_err_status(pkt->error_type);
|
||||
cmd_done.data.unregbuf.client_data = pkt->client_data;
|
||||
|
||||
|
|
@ -1106,16 +1057,15 @@ static int hfi_process_session_end_done(u32 device_id,
|
|||
struct hfi_msg_sys_session_end_done_packet *pkt = _pkt;
|
||||
struct msm_vidc_cb_cmd_done cmd_done = {0};
|
||||
|
||||
dprintk(VIDC_HIGH, "RECEIVED: SESSION_END_DONE[%#x]\n", pkt->session_id);
|
||||
|
||||
if (!pkt || pkt->size !=
|
||||
sizeof(struct hfi_msg_sys_session_end_done_packet)) {
|
||||
dprintk(VIDC_ERR, "%s: bad packet/packet size\n", __func__);
|
||||
d_vpr_e("%s: bad packet/packet size\n", __func__);
|
||||
return -E2BIG;
|
||||
}
|
||||
s_vpr_h(pkt->sid, "RECEIVED: SESSION_END_DONE\n");
|
||||
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = hfi_map_err_status(pkt->error_type);
|
||||
cmd_done.size = 0;
|
||||
|
||||
|
|
@ -1132,17 +1082,15 @@ static int hfi_process_session_abort_done(u32 device_id,
|
|||
struct hfi_msg_sys_session_abort_done_packet *pkt = _pkt;
|
||||
struct msm_vidc_cb_cmd_done cmd_done = {0};
|
||||
|
||||
dprintk(VIDC_HIGH, "RECEIVED: SESSION_ABORT_DONE[%#x]\n",
|
||||
pkt->session_id);
|
||||
|
||||
if (!pkt || pkt->size !=
|
||||
sizeof(struct hfi_msg_sys_session_abort_done_packet)) {
|
||||
dprintk(VIDC_ERR, "%s: bad packet/packet size: %d\n",
|
||||
d_vpr_e("%s: bad packet/packet size: %d\n",
|
||||
__func__, pkt ? pkt->size : 0);
|
||||
return -E2BIG;
|
||||
}
|
||||
s_vpr_h(pkt->sid, "RECEIVED: SESSION_ABORT_DONE\n");
|
||||
cmd_done.device_id = device_id;
|
||||
cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
|
||||
cmd_done.inst_id = (void *)(uintptr_t)pkt->sid;
|
||||
cmd_done.status = hfi_map_err_status(pkt->error_type);
|
||||
cmd_done.size = 0;
|
||||
|
||||
|
|
@ -1168,7 +1116,7 @@ static void hfi_process_sys_get_prop_image_version(
|
|||
if (req_bytes < version_string_size ||
|
||||
!pkt->rg_property_data[1] ||
|
||||
pkt->num_properties > 1) {
|
||||
dprintk(VIDC_ERR, "%s: bad_pkt: %d\n", __func__, req_bytes);
|
||||
d_vpr_e("%s: bad_pkt: %d\n", __func__, req_bytes);
|
||||
return;
|
||||
}
|
||||
str_image_version = (u8 *)&pkt->rg_property_data[1];
|
||||
|
|
@ -1184,7 +1132,7 @@ static void hfi_process_sys_get_prop_image_version(
|
|||
version[i] = ' ';
|
||||
}
|
||||
version[i] = '\0';
|
||||
dprintk(VIDC_HIGH, "F/W version: %s\n", version);
|
||||
d_vpr_h("F/W version: %s\n", version);
|
||||
|
||||
smem_table_ptr = qcom_smem_get(QCOM_SMEM_HOST_ANY,
|
||||
SMEM_IMAGE_VERSION_TABLE, &smem_block_size);
|
||||
|
|
@ -1200,15 +1148,13 @@ static int hfi_process_sys_property_info(u32 device_id,
|
|||
{
|
||||
struct hfi_msg_sys_property_info_packet *pkt = _pkt;
|
||||
if (!pkt) {
|
||||
dprintk(VIDC_ERR, "%s: invalid param\n", __func__);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
} else if (pkt->size < sizeof(*pkt)) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: bad_pkt_size\n", __func__);
|
||||
d_vpr_e("%s: bad_pkt_size\n", __func__);
|
||||
return -E2BIG;
|
||||
} else if (!pkt->num_properties) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: no_properties\n", __func__);
|
||||
d_vpr_e("%s: no_properties\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -1221,8 +1167,7 @@ static int hfi_process_sys_property_info(u32 device_id,
|
|||
};
|
||||
return 0;
|
||||
default:
|
||||
dprintk(VIDC_HIGH,
|
||||
"%s: unknown_prop_id: %x\n",
|
||||
d_vpr_h("%s: unknown_prop_id: %x\n",
|
||||
__func__, pkt->rg_property_data[0]);
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
|
@ -1236,6 +1181,7 @@ static int hfi_process_ignore(u32 device_id,
|
|||
*info = (struct msm_vidc_cb_info) {
|
||||
.response_type = HAL_RESPONSE_UNUSED,
|
||||
};
|
||||
d_vpr_h("RECEIVED: SESSION_SYNC_DONE\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1247,17 +1193,15 @@ int hfi_process_msg_packet(u32 device_id, struct vidc_hal_msg_pkt_hdr *msg_hdr,
|
|||
pkt_func_def pkt_func = NULL;
|
||||
|
||||
if (!info || !msg_hdr || msg_hdr->size < VIDC_IFACEQ_MIN_PKT_SIZE) {
|
||||
dprintk(VIDC_ERR, "%s: bad packet/packet size\n",
|
||||
__func__);
|
||||
d_vpr_e("%s: bad packet/packet size\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dprintk(VIDC_LOW, "Parse response %#x\n", msg_hdr->packet);
|
||||
switch (msg_hdr->packet) {
|
||||
case HFI_MSG_EVENT_NOTIFY:
|
||||
pkt_func = (pkt_func_def)hfi_process_event_notify;
|
||||
break;
|
||||
case HFI_MSG_SYS_INIT_DONE:
|
||||
case HFI_MSG_SYS_INIT_DONE:
|
||||
pkt_func = (pkt_func_def)hfi_process_sys_init_done;
|
||||
break;
|
||||
case HFI_MSG_SYS_SESSION_INIT_DONE:
|
||||
|
|
@ -1314,8 +1258,7 @@ int hfi_process_msg_packet(u32 device_id, struct vidc_hal_msg_pkt_hdr *msg_hdr,
|
|||
pkt_func = (pkt_func_def)hfi_process_ignore;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_LOW, "Unable to parse message: %#x\n",
|
||||
msg_hdr->packet);
|
||||
d_vpr_l("Unable to parse message: %#x\n", msg_hdr->packet);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,17 +19,18 @@ static void print_cvp_buffer(u32 tag, const char *str,
|
|||
return;
|
||||
|
||||
cvp = inst->cvp;
|
||||
dprintk(tag,
|
||||
dprintk(tag, inst->sid,
|
||||
"%s: %x : idx %d fd %d size %d offset %d dbuf %pK kvaddr %pK\n",
|
||||
str, cvp->session_id, cbuf->index, cbuf->fd, cbuf->size,
|
||||
str, cvp->sid, cbuf->index, cbuf->fd, cbuf->size,
|
||||
cbuf->offset, cbuf->dbuf, cbuf->kvaddr);
|
||||
}
|
||||
|
||||
static int fill_cvp_buffer(struct msm_cvp_buffer_type *dst,
|
||||
struct msm_cvp_buf *src)
|
||||
struct msm_cvp_buf *src, u32 sid)
|
||||
{
|
||||
if (!dst || !src) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
s_vpr_e(sid, "%s: invalid params %pK %pK\n",
|
||||
__func__, dst, src);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -50,8 +51,9 @@ static int msm_cvp_get_version_info(struct msm_vidc_inst *inst)
|
|||
struct cvp_kmd_sys_property *prop_data;
|
||||
u32 version;
|
||||
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -66,11 +68,11 @@ static int msm_cvp_get_version_info(struct msm_vidc_inst *inst)
|
|||
prop_data->prop_type = CVP_KMD_HFI_VERSION_PROP_TYPE;
|
||||
rc = msm_cvp_private(cvp->priv, CVP_KMD_GET_SYS_PROPERTY, arg);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: failed, rc %d\n", __func__, rc);
|
||||
s_vpr_e(inst->sid, "%s: failed, rc %d\n", __func__, rc);
|
||||
return rc;
|
||||
}
|
||||
version = prop_data->data;
|
||||
dprintk(VIDC_HIGH, "%s: version %#x\n", __func__, version);
|
||||
s_vpr_h(inst->sid, "%s: version %#x\n", __func__, version);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -84,7 +86,7 @@ static int msm_cvp_set_priority(struct msm_vidc_inst *inst)
|
|||
struct cvp_kmd_sys_property *prop_array;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -101,10 +103,10 @@ static int msm_cvp_set_priority(struct msm_vidc_inst *inst)
|
|||
prop_array[0].data = VIDEO_REALTIME;
|
||||
else
|
||||
prop_array[0].data = VIDEO_NONREALTIME;
|
||||
dprintk(VIDC_HIGH, "%s: %d\n", __func__, prop_array[0].data);
|
||||
s_vpr_h(inst->sid, "%s: %d\n", __func__, prop_array[0].data);
|
||||
rc = msm_cvp_private(cvp->priv, CVP_KMD_SET_SYS_PROPERTY, arg);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: failed, rc %d\n", __func__, rc);
|
||||
s_vpr_e(inst->sid, "%s: failed, rc %d\n", __func__, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -112,7 +114,7 @@ static int msm_cvp_set_priority(struct msm_vidc_inst *inst)
|
|||
}
|
||||
|
||||
static int msm_cvp_fill_planeinfo(struct msm_cvp_color_plane_info *plane_info,
|
||||
u32 color_fmt, u32 width, u32 height)
|
||||
u32 color_fmt, u32 width, u32 height, u32 sid)
|
||||
{
|
||||
int rc = 0;
|
||||
u32 y_stride, y_sclines, uv_stride, uv_sclines;
|
||||
|
|
@ -169,7 +171,7 @@ static int msm_cvp_fill_planeinfo(struct msm_cvp_color_plane_info *plane_info,
|
|||
break;
|
||||
}
|
||||
default:
|
||||
dprintk(VIDC_ERR, "%s: invalid color_fmt %#x\n",
|
||||
s_vpr_e(sid, "%s: invalid color_fmt %#x\n",
|
||||
__func__, color_fmt);
|
||||
rc = -EINVAL;
|
||||
break;
|
||||
|
|
@ -184,7 +186,8 @@ static int msm_cvp_free_buffer(struct msm_vidc_inst *inst,
|
|||
struct msm_cvp_external *cvp;
|
||||
|
||||
if (!inst || !inst->cvp || !buffer) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK %pK\n",
|
||||
__func__, inst, buffer);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -210,7 +213,8 @@ static int msm_cvp_allocate_buffer(struct msm_vidc_inst *inst,
|
|||
struct dma_buf *dbuf;
|
||||
|
||||
if (!inst || !inst->cvp || !buffer) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK %pK\n",
|
||||
__func__, inst, buffer);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -223,7 +227,7 @@ static int msm_cvp_allocate_buffer(struct msm_vidc_inst *inst,
|
|||
|
||||
dbuf = ion_alloc(buffer->size, heap_mask, ion_flags);
|
||||
if (IS_ERR_OR_NULL(dbuf)) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: failed to allocate, size %d heap_mask %#lx flags %d\n",
|
||||
__func__, buffer->size, heap_mask, ion_flags);
|
||||
rc = -ENOMEM;
|
||||
|
|
@ -235,7 +239,7 @@ static int msm_cvp_allocate_buffer(struct msm_vidc_inst *inst,
|
|||
if (kernel_map) {
|
||||
buffer->kvaddr = dma_buf_vmap(dbuf);
|
||||
if (!buffer->kvaddr) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: dma_buf_vmap failed\n", __func__);
|
||||
rc = -EINVAL;
|
||||
goto error;
|
||||
|
|
@ -263,7 +267,7 @@ static int msm_cvp_set_clocks_and_bus(struct msm_vidc_inst *inst)
|
|||
const u32 fps_max = CVP_FRAME_RATE_MAX;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -279,14 +283,15 @@ static int msm_cvp_set_clocks_and_bus(struct msm_vidc_inst *inst)
|
|||
desc.is_downscale = cvp->downscale;
|
||||
desc.fps = min(cvp->frame_rate >> 16, fps_max);
|
||||
desc.op_rate = cvp->operating_rate >> 16;
|
||||
desc.colorfmt = msm_comm_convert_color_fmt(fmt->fmt.pix_mp.pixelformat);
|
||||
desc.colorfmt =
|
||||
msm_comm_convert_color_fmt(fmt->fmt.pix_mp.pixelformat,
|
||||
inst->sid);
|
||||
rc = msm_cvp_est_cycles(&desc, &power);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: estimate failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: estimate failed\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
dprintk(VIDC_HIGH,
|
||||
"%s: core %d controller %d ddr bw %d\n",
|
||||
s_vpr_h(inst->sid, "%s: core %d controller %d ddr bw %d\n",
|
||||
__func__, power.clock_cycles_a, power.clock_cycles_b,
|
||||
power.ddr_bw);
|
||||
|
||||
|
|
@ -296,8 +301,8 @@ static int msm_cvp_set_clocks_and_bus(struct msm_vidc_inst *inst)
|
|||
sizeof(struct cvp_kmd_request_power));
|
||||
rc = msm_cvp_private(cvp->priv, CVP_KMD_REQUEST_POWER, arg);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: request_power failed with %d\n", __func__, rc);
|
||||
s_vpr_e(inst->sid, "%s: request_power failed with %d\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -311,7 +316,7 @@ static int msm_cvp_init_downscale_resolution(struct msm_vidc_inst *inst)
|
|||
u32 width, height, ds_width, ds_height, temp;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -320,7 +325,7 @@ static int msm_cvp_init_downscale_resolution(struct msm_vidc_inst *inst)
|
|||
ds_height = cvp->height;
|
||||
|
||||
if (!cvp->downscale) {
|
||||
dprintk(VIDC_HIGH, "%s: downscaling not enabled\n", __func__);
|
||||
s_vpr_h(inst->sid, "%s: downscaling not enabled\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
|
@ -369,11 +374,11 @@ static void msm_cvp_deinit_downscale_buffers(struct msm_vidc_inst *inst)
|
|||
struct msm_cvp_external *cvp;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
dprintk(VIDC_HIGH, "%s:\n", __func__);
|
||||
s_vpr_h(inst->sid, "%s:\n", __func__);
|
||||
|
||||
if (cvp->src_buffer.dbuf) {
|
||||
print_cvp_buffer(VIDC_HIGH, "free: src_buffer",
|
||||
|
|
@ -399,16 +404,16 @@ static int msm_cvp_init_downscale_buffers(struct msm_vidc_inst *inst)
|
|||
struct msm_cvp_external *cvp;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
||||
if (!cvp->downscale) {
|
||||
dprintk(VIDC_HIGH, "%s: downscaling not enabled\n", __func__);
|
||||
s_vpr_h(inst->sid, "%s: downscaling not enabled\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
dprintk(VIDC_HIGH, "%s:\n", __func__);
|
||||
s_vpr_h(inst->sid, "%s:\n", __func__);
|
||||
|
||||
cvp->src_buffer.size = VENUS_BUFFER_SIZE(COLOR_FMT_NV12_UBWC,
|
||||
cvp->ds_width, cvp->ds_height);
|
||||
|
|
@ -445,11 +450,11 @@ static void msm_cvp_deinit_context_buffers(struct msm_vidc_inst *inst)
|
|||
struct msm_cvp_external *cvp;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
dprintk(VIDC_HIGH, "%s:\n", __func__);
|
||||
s_vpr_h(inst->sid, "%s:\n", __func__);
|
||||
|
||||
if (cvp->context_buffer.dbuf) {
|
||||
print_cvp_buffer(VIDC_HIGH, "free: context_buffer",
|
||||
|
|
@ -475,11 +480,11 @@ static int msm_cvp_init_context_buffers(struct msm_vidc_inst *inst)
|
|||
struct msm_cvp_external *cvp;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
dprintk(VIDC_HIGH, "%s:\n", __func__);
|
||||
s_vpr_h(inst->sid, "%s:\n", __func__);
|
||||
|
||||
cvp->context_buffer.size = HFI_DME_FRAME_CONTEXT_BUFFER_SIZE;
|
||||
rc = msm_cvp_allocate_buffer(inst, &cvp->context_buffer, false);
|
||||
|
|
@ -516,12 +521,12 @@ static void msm_cvp_deinit_internal_buffers(struct msm_vidc_inst *inst)
|
|||
struct msm_cvp_external *cvp;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return;
|
||||
}
|
||||
|
||||
cvp = inst->cvp;
|
||||
dprintk(VIDC_HIGH, "%s:\n", __func__);
|
||||
s_vpr_h(inst->sid, "%s:\n", __func__);
|
||||
|
||||
if (cvp->output_buffer.dbuf) {
|
||||
print_cvp_buffer(VIDC_HIGH, "free: output_buffer",
|
||||
|
|
@ -552,7 +557,7 @@ static int msm_cvp_set_persist_buffer(struct msm_vidc_inst *inst)
|
|||
struct msm_cvp_session_set_persist_buffers_packet persist2_packet = {0};
|
||||
|
||||
if (!inst || !inst->cvp || !inst->cvp->arg) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -561,10 +566,10 @@ static int msm_cvp_set_persist_buffer(struct msm_vidc_inst *inst)
|
|||
persist2_packet.size =
|
||||
sizeof(struct msm_cvp_session_set_persist_buffers_packet);
|
||||
persist2_packet.packet_type = HFI_CMD_SESSION_CVP_SET_PERSIST_BUFFERS;
|
||||
persist2_packet.session_id = cvp->session_id;
|
||||
persist2_packet.sid = cvp->sid;
|
||||
persist2_packet.cvp_op = CVP_DME;
|
||||
fill_cvp_buffer(&persist2_packet.persist2_buffer,
|
||||
&cvp->persist2_buffer);
|
||||
&cvp->persist2_buffer, inst->sid);
|
||||
|
||||
memset(arg, 0, sizeof(struct cvp_kmd_arg));
|
||||
arg->type = CVP_KMD_HFI_PERSIST_CMD;
|
||||
|
|
@ -593,7 +598,7 @@ static int msm_cvp_init_internal_buffers(struct msm_vidc_inst *inst)
|
|||
struct msm_cvp_external *cvp;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -643,38 +648,39 @@ static int msm_cvp_prepare_extradata(struct msm_vidc_inst *inst,
|
|||
int nIsValid_offset = 232;
|
||||
|
||||
if (!inst || !inst->cvp || !mbuf) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK %pK\n",
|
||||
__func__, inst, mbuf);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
||||
vb = &mbuf->vvb.vb2_buf;
|
||||
if (vb->num_planes <= 1) {
|
||||
dprintk(VIDC_ERR, "%s: extradata plane not enabled\n",
|
||||
s_vpr_e(inst->sid, "%s: extradata plane not enabled\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dbuf = dma_buf_get(vb->planes[1].m.fd);
|
||||
if (!dbuf) {
|
||||
dprintk(VIDC_ERR, "%s: dma_buf_get(%d) failed\n",
|
||||
s_vpr_e(inst->sid, "%s: dma_buf_get(%d) failed\n",
|
||||
__func__, vb->planes[1].m.fd);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (dbuf->size < vb->planes[1].length) {
|
||||
dprintk(VIDC_ERR, "%s: invalid size %d vs %d\n", __func__,
|
||||
s_vpr_e(inst->sid, "%s: invalid size %d vs %d\n", __func__,
|
||||
dbuf->size, vb->planes[1].length);
|
||||
rc = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
rc = dma_buf_begin_cpu_access(dbuf, DMA_BIDIRECTIONAL);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: begin_cpu_access failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: begin_cpu_access failed\n", __func__);
|
||||
goto error;
|
||||
}
|
||||
kvaddr = dma_buf_vmap(dbuf);
|
||||
if (!kvaddr) {
|
||||
dprintk(VIDC_ERR, "%s: dma_buf_vmap(%d) failed\n",
|
||||
s_vpr_e(inst->sid, "%s: dma_buf_vmap(%d) failed\n",
|
||||
__func__, vb->planes[1].m.fd);
|
||||
rc = -EINVAL;
|
||||
goto error;
|
||||
|
|
@ -698,7 +704,7 @@ static int msm_cvp_prepare_extradata(struct msm_vidc_inst *inst,
|
|||
e_hdr += e_hdr->size;
|
||||
}
|
||||
if (!found_end) {
|
||||
dprintk(VIDC_ERR, "%s: extradata_none not found\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: extradata_none not found\n", __func__);
|
||||
e_hdr = (struct msm_vidc_extradata_header *)((char *)kvaddr +
|
||||
vb->planes[1].data_offset);
|
||||
}
|
||||
|
|
@ -707,7 +713,7 @@ static int msm_cvp_prepare_extradata(struct msm_vidc_inst *inst,
|
|||
sizeof(struct msm_vidc_enc_cvp_metadata_payload) +
|
||||
sizeof(struct msm_vidc_extradata_header)) >
|
||||
(kvaddr + dbuf->size)) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: couldn't append extradata, (e_hdr[%pK] - kvaddr[%pK]) %#x, size %d\n",
|
||||
__func__, e_hdr, kvaddr, (char *)e_hdr - (char *)kvaddr,
|
||||
dbuf->size);
|
||||
|
|
@ -730,8 +736,7 @@ static int msm_cvp_prepare_extradata(struct msm_vidc_inst *inst,
|
|||
sizeof(struct msm_vidc_enc_cvp_metadata_payload));
|
||||
cvpframe = (char *) e_hdr->data;
|
||||
cvp_metadata_valid_flag = *(u32*)(cvpframe + nIsValid_offset);
|
||||
dprintk(VIDC_HIGH,
|
||||
"CVP metadata nIsValid flag = %u frame: %u",
|
||||
s_vpr_h(inst->sid, "CVP metadata nIsValid flag = %u frame: %u",
|
||||
cvp_metadata_valid_flag, cvp->framecount);
|
||||
dma_buf_end_cpu_access(cvp->output_buffer.dbuf,
|
||||
DMA_BIDIRECTIONAL);
|
||||
|
|
@ -770,7 +775,7 @@ static int msm_cvp_reference_management(struct msm_vidc_inst *inst)
|
|||
struct msm_cvp_buf temp;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -800,7 +805,7 @@ static int msm_vidc_cvp_session_start(struct msm_vidc_inst *inst)
|
|||
struct cvp_kmd_arg *arg = NULL;
|
||||
|
||||
if (!inst || !inst->cvp || !inst->cvp->arg) {
|
||||
dprintk(VIDC_ERR, "%s: invalid param\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -813,7 +818,7 @@ static int msm_vidc_cvp_session_start(struct msm_vidc_inst *inst)
|
|||
|
||||
rc = msm_cvp_private(cvp->priv, CVP_KMD_SESSION_CONTROL, arg);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: CVP_KMD_SESSION_CONTROL failed, rc %d\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
|
|
@ -830,7 +835,7 @@ static int msm_vidc_cvp_session_stop(struct msm_vidc_inst *inst)
|
|||
struct cvp_kmd_arg *arg = NULL;
|
||||
|
||||
if (!inst || !inst->cvp || !inst->cvp->arg) {
|
||||
dprintk(VIDC_ERR, "%s: invalid param\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -846,7 +851,7 @@ static int msm_vidc_cvp_session_stop(struct msm_vidc_inst *inst)
|
|||
|
||||
rc = msm_cvp_private(cvp->priv, CVP_KMD_SESSION_CONTROL, arg);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: CVP_KMD_SESSION_CONTROL failed, rc %d\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
|
|
@ -869,7 +874,8 @@ static int msm_cvp_frame_process(struct msm_vidc_inst *inst,
|
|||
bool first_frame = false;
|
||||
|
||||
if (!inst || !inst->cvp || !inst->cvp->arg || !mbuf) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK %pK\n",
|
||||
__func__, inst, mbuf);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -894,7 +900,7 @@ static int msm_cvp_frame_process(struct msm_vidc_inst *inst,
|
|||
cvp->operating_rate = inst->clk_data.operating_rate;
|
||||
rc = msm_cvp_set_clocks_and_bus(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: unsupported dynamic changes %#x %#x\n",
|
||||
__func__, cvp->frame_rate, cvp->operating_rate);
|
||||
goto error;
|
||||
|
|
@ -945,7 +951,7 @@ static int msm_cvp_frame_process(struct msm_vidc_inst *inst,
|
|||
frame = (struct msm_cvp_dme_frame_packet *)&arg->data.hfi_pkt.pkt_data;
|
||||
frame->size = sizeof(struct msm_cvp_dme_frame_packet);
|
||||
frame->packet_type = HFI_CMD_SESSION_CVP_DME_FRAME;
|
||||
frame->session_id = cvp->session_id;
|
||||
frame->sid = cvp->sid;
|
||||
if (first_frame)
|
||||
frame->skip_mv_calc = 1;
|
||||
else
|
||||
|
|
@ -957,18 +963,20 @@ static int msm_cvp_frame_process(struct msm_vidc_inst *inst,
|
|||
frame->ncc_robustness_threshold = 0;
|
||||
|
||||
fill_cvp_buffer(&frame->fullres_srcbuffer,
|
||||
&cvp->fullres_buffer);
|
||||
&cvp->fullres_buffer, inst->sid);
|
||||
fill_cvp_buffer(&frame->videospatialtemporal_statsbuffer,
|
||||
&cvp->output_buffer);
|
||||
fill_cvp_buffer(&frame->src_buffer, &cvp->fullres_buffer);
|
||||
&cvp->output_buffer, inst->sid);
|
||||
fill_cvp_buffer(&frame->src_buffer, &cvp->fullres_buffer, inst->sid);
|
||||
if (cvp->downscale) {
|
||||
fill_cvp_buffer(&frame->src_buffer, &cvp->src_buffer);
|
||||
fill_cvp_buffer(&frame->ref_buffer, &cvp->ref_buffer);
|
||||
fill_cvp_buffer(&frame->src_buffer, &cvp->src_buffer,
|
||||
inst->sid);
|
||||
fill_cvp_buffer(&frame->ref_buffer, &cvp->ref_buffer,
|
||||
inst->sid);
|
||||
}
|
||||
fill_cvp_buffer(&frame->srcframe_contextbuffer,
|
||||
&cvp->context_buffer);
|
||||
&cvp->context_buffer, inst->sid);
|
||||
fill_cvp_buffer(&frame->refframe_contextbuffer,
|
||||
&cvp->refcontext_buffer);
|
||||
&cvp->refcontext_buffer, inst->sid);
|
||||
|
||||
print_cvp_buffer(VIDC_LOW, "input frame", inst, &cvp->fullres_buffer);
|
||||
rc = msm_cvp_private(cvp->priv, CVP_KMD_SEND_CMD_PKT, arg);
|
||||
|
|
@ -999,11 +1007,12 @@ int msm_vidc_cvp_preprocess(struct msm_vidc_inst *inst,
|
|||
struct msm_cvp_external *cvp;
|
||||
|
||||
if (!inst || !inst->cvp || !mbuf) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK %pK\n",
|
||||
__func__, inst, mbuf);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (inst->state != MSM_VIDC_START_DONE) {
|
||||
dprintk(VIDC_ERR, "%s: invalid inst state %d\n",
|
||||
s_vpr_e(inst->sid, "%s: invalid inst state %d\n",
|
||||
__func__, inst->state);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1011,19 +1020,19 @@ int msm_vidc_cvp_preprocess(struct msm_vidc_inst *inst,
|
|||
|
||||
rc = msm_cvp_frame_process(inst, mbuf);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: cvp process failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: cvp process failed\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = msm_cvp_prepare_extradata(inst, mbuf);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: prepare extradata failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: prepare extradata failed\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = msm_cvp_reference_management(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: ref management failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: ref management failed\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -1038,7 +1047,7 @@ static int msm_vidc_cvp_session_delete(struct msm_vidc_inst *inst)
|
|||
struct cvp_kmd_arg *arg = NULL;
|
||||
|
||||
if (!inst || !inst->cvp || !inst->cvp->arg) {
|
||||
dprintk(VIDC_ERR, "%s: invalid param\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -1051,7 +1060,7 @@ static int msm_vidc_cvp_session_delete(struct msm_vidc_inst *inst)
|
|||
|
||||
rc = msm_cvp_private(cvp->priv, CVP_KMD_SESSION_CONTROL, arg);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: CVP_KMD_SESSION_CONTROL failed, rc %d\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
|
|
@ -1066,12 +1075,12 @@ static int msm_cvp_mem_deinit(struct msm_vidc_inst *inst)
|
|||
struct msm_cvp_external *cvp;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: cvp session %#x\n", __func__, cvp->session_id);
|
||||
s_vpr_h(inst->sid, "%s: cvp session %#x\n", __func__, cvp->sid);
|
||||
msm_cvp_deinit_internal_buffers(inst);
|
||||
msm_cvp_deinit_context_buffers(inst);
|
||||
msm_cvp_deinit_downscale_buffers(inst);
|
||||
|
|
@ -1090,13 +1099,13 @@ static int msm_vidc_cvp_deinit(struct msm_vidc_inst *inst)
|
|||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = msm_vidc_cvp_session_stop(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: cvp stop failed with error %d\n",
|
||||
s_vpr_e(inst->sid, "%s: cvp stop failed with error %d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
|
||||
|
|
@ -1111,16 +1120,16 @@ static int msm_vidc_cvp_close(struct msm_vidc_inst *inst)
|
|||
struct msm_cvp_external *cvp;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: cvp session %#x\n", __func__, cvp->session_id);
|
||||
s_vpr_h(inst->sid, "%s: cvp session %#x\n", __func__, cvp->sid);
|
||||
rc = msm_cvp_close(cvp->priv);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: cvp close failed with error %d\n", __func__, rc);
|
||||
s_vpr_e(inst->sid, "%s: cvp close failed with error %d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
|
@ -1129,11 +1138,11 @@ static int msm_vidc_cvp_close(struct msm_vidc_inst *inst)
|
|||
int msm_vidc_cvp_unprepare_preprocess(struct msm_vidc_inst *inst)
|
||||
{
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!inst->cvp) {
|
||||
dprintk(VIDC_HIGH, "%s: cvp not enabled or closed\n", __func__);
|
||||
s_vpr_h(inst->sid, "%s: cvp not enabled or closed\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1152,7 +1161,7 @@ static int msm_vidc_cvp_session_create(struct msm_vidc_inst *inst)
|
|||
struct cvp_kmd_arg *arg = NULL;
|
||||
|
||||
if (!inst || !inst->cvp || !inst->cvp->arg) {
|
||||
dprintk(VIDC_ERR, "%s: invalid param\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -1165,7 +1174,7 @@ static int msm_vidc_cvp_session_create(struct msm_vidc_inst *inst)
|
|||
|
||||
rc = msm_cvp_private(cvp->priv, CVP_KMD_SESSION_CONTROL, arg);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: CVP_KMD_SESSION_CONTROL failed, rc %d\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
|
|
@ -1181,7 +1190,7 @@ static int msm_vidc_cvp_getsessioninfo(struct msm_vidc_inst *inst)
|
|||
struct cvp_kmd_arg *arg;
|
||||
|
||||
if (!inst || !inst->cvp || !inst->cvp->arg) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -1191,16 +1200,16 @@ static int msm_vidc_cvp_getsessioninfo(struct msm_vidc_inst *inst)
|
|||
arg->type = CVP_KMD_GET_SESSION_INFO;
|
||||
rc = msm_cvp_private(cvp->priv, CVP_KMD_GET_SESSION_INFO, arg);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: get_session_info failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: get_session_info failed\n", __func__);
|
||||
goto error;
|
||||
}
|
||||
cvp->session_id = arg->data.session.session_id;
|
||||
dprintk(VIDC_HIGH, "%s: cvp session id %#x\n",
|
||||
__func__, cvp->session_id);
|
||||
cvp->sid = arg->data.session.session_id;
|
||||
s_vpr_h(inst->sid, "%s: cvp session id %#x\n",
|
||||
__func__, cvp->sid);
|
||||
|
||||
rc = msm_cvp_get_version_info(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: get_version_info failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: get_version_info failed\n", __func__);
|
||||
goto error;
|
||||
}
|
||||
return rc;
|
||||
|
|
@ -1220,7 +1229,7 @@ static int msm_vidc_cvp_dme_basic_config(struct msm_vidc_inst *inst)
|
|||
u32 color_fmt;
|
||||
|
||||
if (!inst || !inst->cvp || !inst->cvp->arg) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -1232,24 +1241,28 @@ static int msm_vidc_cvp_dme_basic_config(struct msm_vidc_inst *inst)
|
|||
&arg->data.hfi_pkt.pkt_data;
|
||||
dmecfg->size = sizeof(struct msm_cvp_dme_basic_config_packet);
|
||||
dmecfg->packet_type = HFI_CMD_SESSION_CVP_DME_BASIC_CONFIG;
|
||||
dmecfg->session_id = cvp->session_id;
|
||||
dmecfg->sid = cvp->sid;
|
||||
/* source buffer format should be NV12_UBWC always */
|
||||
dmecfg->srcbuffer_format = HFI_COLOR_FORMAT_NV12_UBWC;
|
||||
dmecfg->src_width = cvp->ds_width;
|
||||
dmecfg->src_height = cvp->ds_height;
|
||||
rc = msm_cvp_fill_planeinfo(&dmecfg->srcbuffer_planeinfo,
|
||||
COLOR_FMT_NV12_UBWC, dmecfg->src_width, dmecfg->src_height);
|
||||
COLOR_FMT_NV12_UBWC, dmecfg->src_width,
|
||||
dmecfg->src_height, inst->sid);
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
fmt = &inst->fmts[INPUT_PORT].v4l2_fmt;
|
||||
color_fmt = msm_comm_convert_color_fmt(fmt->fmt.pix_mp.pixelformat);
|
||||
color_fmt =
|
||||
msm_comm_convert_color_fmt(fmt->fmt.pix_mp.pixelformat,
|
||||
inst->sid);
|
||||
dmecfg->fullresbuffer_format = msm_comm_get_hfi_uncompressed(
|
||||
fmt->fmt.pix_mp.pixelformat);
|
||||
fmt->fmt.pix_mp.pixelformat, inst->sid);
|
||||
dmecfg->fullres_width = cvp->width;
|
||||
dmecfg->fullres_height = cvp->height;
|
||||
rc = msm_cvp_fill_planeinfo(&dmecfg->fullresbuffer_planeinfo,
|
||||
color_fmt, dmecfg->fullres_width, dmecfg->fullres_height);
|
||||
color_fmt, dmecfg->fullres_width,
|
||||
dmecfg->fullres_height, inst->sid);
|
||||
if (rc)
|
||||
goto error;
|
||||
dmecfg->ds_enable = cvp->downscale;
|
||||
|
|
@ -1257,7 +1270,7 @@ static int msm_vidc_cvp_dme_basic_config(struct msm_vidc_inst *inst)
|
|||
dmecfg->enable_inlier_tracking = 1;
|
||||
rc = msm_cvp_private(cvp->priv, CVP_KMD_SEND_CMD_PKT, arg);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: cvp configuration failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: cvp configuration failed\n", __func__);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
@ -1272,13 +1285,13 @@ static int msm_cvp_mem_init(struct msm_vidc_inst *inst)
|
|||
struct v4l2_format *fmt;
|
||||
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
inst->cvp = kzalloc(sizeof(struct msm_cvp_external), GFP_KERNEL);
|
||||
if (!inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: failed to allocate\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: failed to allocate\n", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
|
@ -1304,7 +1317,7 @@ static int msm_cvp_mem_init(struct msm_vidc_inst *inst)
|
|||
if (rc)
|
||||
goto error;
|
||||
|
||||
dprintk(VIDC_HIGH,
|
||||
s_vpr_h(inst->sid,
|
||||
"%s: pixelformat %#x, wxh %dx%d downscale %d ds_wxh %dx%d fps %d op_rate %d\n",
|
||||
__func__, fmt->fmt.pix_mp.pixelformat,
|
||||
cvp->width, cvp->height, cvp->downscale,
|
||||
|
|
@ -1334,15 +1347,16 @@ static int msm_vidc_cvp_open(struct msm_vidc_inst *inst)
|
|||
struct msm_cvp_external *cvp;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: opening cvp\n", __func__);
|
||||
s_vpr_h(inst->sid, "%s: opening cvp\n", __func__);
|
||||
cvp->priv = msm_cvp_open(0, MSM_VIDC_CVP);
|
||||
if (!cvp->priv) {
|
||||
dprintk(VIDC_ERR, "%s: failed to open cvp session\n", __func__);
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: failed to open cvp session\n", __func__);
|
||||
rc = -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -1393,7 +1407,7 @@ int msm_vidc_cvp_prepare_preprocess(struct msm_vidc_inst *inst)
|
|||
int rc;
|
||||
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ struct msm_cvp_buffer_type {
|
|||
struct msm_cvp_session_release_persist_buffers_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
struct msm_cvp_client_data client_data;
|
||||
u32 cvp_op;
|
||||
struct msm_cvp_buffer_type persist1_buffer;
|
||||
|
|
@ -92,7 +92,7 @@ struct msm_cvp_session_release_persist_buffers_packet {
|
|||
struct msm_cvp_session_set_persist_buffers_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
struct msm_cvp_client_data client_data;
|
||||
u32 cvp_op;
|
||||
struct msm_cvp_buffer_type persist1_buffer;
|
||||
|
|
@ -102,7 +102,7 @@ struct msm_cvp_session_set_persist_buffers_packet {
|
|||
struct msm_cvp_dme_frame_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
struct msm_cvp_client_data client_data;
|
||||
u32 stream_idx;
|
||||
u32 skip_mv_calc;
|
||||
|
|
@ -126,7 +126,7 @@ struct msm_cvp_dme_frame_packet {
|
|||
struct msm_cvp_dme_basic_config_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
struct msm_cvp_client_data client_data;
|
||||
u32 stream_idx;
|
||||
u32 srcbuffer_format;
|
||||
|
|
@ -167,7 +167,7 @@ struct msm_cvp_buf {
|
|||
struct msm_cvp_external {
|
||||
void *priv;
|
||||
void *arg;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 width;
|
||||
u32 height;
|
||||
u32 ds_width;
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ static void print_client_buffer(u32 tag, const char *str,
|
|||
if (!(tag & msm_vidc_debug) || !inst || !cbuf)
|
||||
return;
|
||||
|
||||
dprintk(tag,
|
||||
"%s: %x : idx %2d fd %d off %d size %d type %d flags 0x%x\n",
|
||||
str, hash32_ptr(inst->session), cbuf->index, cbuf->fd,
|
||||
dprintk(tag, inst->sid,
|
||||
"%s: idx %2d fd %d off %d size %d type %d flags 0x%x\n",
|
||||
str, cbuf->index, cbuf->fd,
|
||||
cbuf->offset, cbuf->size, cbuf->type, cbuf->flags);
|
||||
}
|
||||
|
||||
|
|
@ -31,14 +31,15 @@ static void print_cvp_buffer(u32 tag, const char *str,
|
|||
if (!(tag & msm_vidc_debug) || !inst || !cbuf)
|
||||
return;
|
||||
|
||||
dprintk(tag,
|
||||
"%s: %x : idx %2d fd %d off %d daddr %x size %d type %d flags 0x%x\n",
|
||||
str, hash32_ptr(inst->session), cbuf->buf.index, cbuf->buf.fd,
|
||||
dprintk(tag, inst->sid,
|
||||
"%s: idx %2d fd %d off %d daddr %x size %d type %d flags 0x%x\n",
|
||||
str, cbuf->buf.index, cbuf->buf.fd,
|
||||
cbuf->buf.offset, cbuf->smem.device_addr, cbuf->buf.size,
|
||||
cbuf->buf.type, cbuf->buf.flags);
|
||||
}
|
||||
|
||||
static enum hal_buffer get_hal_buftype(const char *str, unsigned int type)
|
||||
static enum hal_buffer get_hal_buftype(const char *str,
|
||||
unsigned int type, u32 sid)
|
||||
{
|
||||
enum hal_buffer buftype = HAL_BUFFER_NONE;
|
||||
|
||||
|
|
@ -51,7 +52,7 @@ static enum hal_buffer get_hal_buftype(const char *str, unsigned int type)
|
|||
else if (type == MSM_CVP_BUFTYPE_INTERNAL_2)
|
||||
buftype = HAL_BUFFER_INTERNAL_SCRATCH_1;
|
||||
else
|
||||
dprintk(VIDC_ERR, "%s: unknown buffer type %#x\n",
|
||||
s_vpr_e(sid, "%s: unknown buffer type %#x\n",
|
||||
str, type);
|
||||
|
||||
return buftype;
|
||||
|
|
@ -68,14 +69,14 @@ void handle_session_register_buffer_done(enum hal_command_response cmd,
|
|||
bool found;
|
||||
|
||||
if (!response) {
|
||||
dprintk(VIDC_ERR, "%s: invalid response\n", __func__);
|
||||
d_vpr_e("%s: invalid response\n", __func__);
|
||||
return;
|
||||
}
|
||||
inst = get_inst(get_vidc_core(response->device_id),
|
||||
response->session_id);
|
||||
response->inst_id);
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "%s: invalid session %pK\n", __func__,
|
||||
response->session_id);
|
||||
d_vpr_e("%s: invalid session %pK\n", __func__,
|
||||
response->inst_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +91,7 @@ void handle_session_register_buffer_done(enum hal_command_response cmd,
|
|||
}
|
||||
mutex_unlock(&inst->cvpbufs.lock);
|
||||
if (!found) {
|
||||
dprintk(VIDC_ERR, "%s: client_data %x not found\n",
|
||||
s_vpr_e(inst->sid, "%s: client_data %x not found\n",
|
||||
__func__, response->data.regbuf.client_data);
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -106,6 +107,7 @@ void handle_session_register_buffer_done(enum hal_command_response cmd,
|
|||
|
||||
exit:
|
||||
put_inst(inst);
|
||||
s_vpr_l(inst->sid, "handled: SESSION_REGISTER_BUFFER_DONE\n");
|
||||
}
|
||||
|
||||
void handle_session_unregister_buffer_done(enum hal_command_response cmd,
|
||||
|
|
@ -120,14 +122,14 @@ void handle_session_unregister_buffer_done(enum hal_command_response cmd,
|
|||
bool found;
|
||||
|
||||
if (!response) {
|
||||
dprintk(VIDC_ERR, "%s: invalid response\n", __func__);
|
||||
d_vpr_e("%s: invalid response\n", __func__);
|
||||
return;
|
||||
}
|
||||
inst = get_inst(get_vidc_core(response->device_id),
|
||||
response->session_id);
|
||||
response->inst_id);
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "%s: invalid session %pK\n", __func__,
|
||||
response->session_id);
|
||||
d_vpr_e("%s: invalid session %pK\n", __func__,
|
||||
response->inst_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +144,7 @@ void handle_session_unregister_buffer_done(enum hal_command_response cmd,
|
|||
}
|
||||
mutex_unlock(&inst->cvpbufs.lock);
|
||||
if (!found) {
|
||||
dprintk(VIDC_ERR, "%s: client_data %x not found\n",
|
||||
s_vpr_e(inst->sid, "%s: client_data %x not found\n",
|
||||
__func__, response->data.unregbuf.client_data);
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -169,6 +171,7 @@ void handle_session_unregister_buffer_done(enum hal_command_response cmd,
|
|||
cbuf = NULL;
|
||||
exit:
|
||||
put_inst(inst);
|
||||
s_vpr_l(inst->sid, "handled: SESSION_UNREGISTER_BUFFER_DONE\n");
|
||||
}
|
||||
|
||||
static void print_cvp_cycles(struct msm_vidc_inst *inst)
|
||||
|
|
@ -183,8 +186,7 @@ static void print_cvp_cycles(struct msm_vidc_inst *inst)
|
|||
mutex_lock(&core->lock);
|
||||
list_for_each_entry(temp, &core->instances, list) {
|
||||
if (temp->session_type == MSM_VIDC_CVP) {
|
||||
dprintk(VIDC_ERR, "session %#x, vpss %d ise %d\n",
|
||||
hash32_ptr(temp->session),
|
||||
s_vpr_e(temp->sid, "vpss %d ise %d\n",
|
||||
temp->clk_data.vpss_cycles,
|
||||
temp->clk_data.ise_cycles);
|
||||
}
|
||||
|
|
@ -201,7 +203,7 @@ static bool msm_cvp_check_session_supported(struct msm_vidc_inst *inst,
|
|||
u32 total_ise_cycles = 0;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return false;
|
||||
}
|
||||
core = inst->core;
|
||||
|
|
@ -227,23 +229,21 @@ static int msm_cvp_scale_clocks_and_bus(struct msm_vidc_inst *inst)
|
|||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = msm_vidc_set_clocks(inst->core);
|
||||
rc = msm_vidc_set_clocks(inst->core, inst->sid);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: failed set_clocks for inst %pK (%#x)\n",
|
||||
__func__, inst, hash32_ptr(inst->session));
|
||||
s_vpr_e(inst->sid, "%s: failed set_clocks for inst %pK\n",
|
||||
__func__, inst);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
rc = msm_comm_vote_bus(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: failed vote_bus for inst %pK (%#x)\n",
|
||||
__func__, inst, hash32_ptr(inst->session));
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: failed vote_bus for inst %pK\n", __func__, inst);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
|
@ -257,12 +257,13 @@ static int msm_cvp_get_session_info(struct msm_vidc_inst *inst,
|
|||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->core || !session) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK %pK\n",
|
||||
__func__, inst, session);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
session->session_id = hash32_ptr(inst->session);
|
||||
dprintk(VIDC_HIGH, "%s: id 0x%x\n", __func__, session->session_id);
|
||||
session->session_id = inst->sid;
|
||||
s_vpr_h(inst->sid, "%s: id 0x%x\n", __func__, session->session_id);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -273,11 +274,12 @@ static int msm_cvp_request_power(struct msm_vidc_inst *inst,
|
|||
int rc = 0;
|
||||
|
||||
if (!inst || !power) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK %pK\n",
|
||||
__func__, inst, power);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dprintk(VIDC_HIGH,
|
||||
s_vpr_h(inst->sid,
|
||||
"%s: clock_cycles_a %d, clock_cycles_b %d, ddr_bw %d sys_cache_bw %d\n",
|
||||
__func__, power->clock_cycles_a, power->clock_cycles_b,
|
||||
power->ddr_bw, power->sys_cache_bw);
|
||||
|
|
@ -285,10 +287,8 @@ static int msm_cvp_request_power(struct msm_vidc_inst *inst,
|
|||
rc = msm_cvp_check_session_supported(inst, power->clock_cycles_a,
|
||||
power->clock_cycles_b);
|
||||
if (!rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: session %#x rejected, cycles: vpss %d, ise %d\n",
|
||||
__func__, hash32_ptr(inst->session),
|
||||
power->clock_cycles_a, power->clock_cycles_b);
|
||||
s_vpr_e(inst->sid, "%s: rejected, cycles: vpss %d, ise %d\n",
|
||||
__func__, power->clock_cycles_a, power->clock_cycles_b);
|
||||
print_cvp_cycles(inst);
|
||||
msm_comm_kill_session(inst);
|
||||
return -EOVERFLOW;
|
||||
|
|
@ -301,9 +301,9 @@ static int msm_cvp_request_power(struct msm_vidc_inst *inst,
|
|||
inst->clk_data.sys_cache_bw = power->sys_cache_bw / 1000;
|
||||
rc = msm_cvp_scale_clocks_and_bus(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: failed to scale clocks and bus for inst %pK (%#x)\n",
|
||||
__func__, inst, hash32_ptr(inst->session));
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: failed to scale clocks and bus for inst %pK\n",
|
||||
__func__, inst);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
|
@ -311,17 +311,13 @@ static int msm_cvp_request_power(struct msm_vidc_inst *inst,
|
|||
!inst->clk_data.sys_cache_bw) {
|
||||
rc = msm_cvp_inst_pause(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: failed to pause inst %pK (%#x)\n",
|
||||
__func__, inst, hash32_ptr(inst->session));
|
||||
s_vpr_e(inst->sid, "%s: failed to pause\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
} else {
|
||||
rc = msm_cvp_inst_resume(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: failed to resume inst %pK (%#x)\n",
|
||||
__func__, inst, hash32_ptr(inst->session));
|
||||
s_vpr_e(inst->sid, "%s: failed to resume\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
|
@ -340,7 +336,8 @@ static int msm_cvp_register_buffer(struct msm_vidc_inst *inst,
|
|||
struct vidc_register_buffer vbuf;
|
||||
|
||||
if (!inst || !inst->core || !buf) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK %pK\n",
|
||||
__func__, inst, buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
|
@ -364,7 +361,7 @@ static int msm_cvp_register_buffer(struct msm_vidc_inst *inst,
|
|||
|
||||
cbuf = kzalloc(sizeof(struct msm_vidc_cvp_buffer), GFP_KERNEL);
|
||||
if (!cbuf) {
|
||||
dprintk(VIDC_ERR, "%s: cbuf alloc failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: cbuf alloc failed\n", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
mutex_lock(&inst->cvpbufs.lock);
|
||||
|
|
@ -372,7 +369,8 @@ static int msm_cvp_register_buffer(struct msm_vidc_inst *inst,
|
|||
mutex_unlock(&inst->cvpbufs.lock);
|
||||
|
||||
memcpy(&cbuf->buf, buf, sizeof(struct msm_cvp_buffer));
|
||||
cbuf->smem.buffer_type = get_hal_buftype(__func__, buf->type);
|
||||
cbuf->smem.buffer_type = get_hal_buftype(__func__, buf->type,
|
||||
inst->sid);
|
||||
cbuf->smem.fd = buf->fd;
|
||||
cbuf->smem.offset = buf->offset;
|
||||
cbuf->smem.size = buf->size;
|
||||
|
|
@ -384,7 +382,7 @@ static int msm_cvp_register_buffer(struct msm_vidc_inst *inst,
|
|||
|
||||
memset(&vbuf, 0, sizeof(struct vidc_register_buffer));
|
||||
vbuf.index = buf->index;
|
||||
vbuf.type = get_hal_buftype(__func__, buf->type);
|
||||
vbuf.type = get_hal_buftype(__func__, buf->type, inst->sid);
|
||||
vbuf.size = buf->size;
|
||||
vbuf.device_addr = cbuf->smem.device_addr;
|
||||
vbuf.client_data = cbuf->smem.device_addr;
|
||||
|
|
@ -419,7 +417,8 @@ static int msm_cvp_unregister_buffer(struct msm_vidc_inst *inst,
|
|||
struct vidc_unregister_buffer vbuf;
|
||||
|
||||
if (!inst || !inst->core || !buf) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK %pK\n",
|
||||
__func__, inst, buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
|
@ -443,7 +442,7 @@ static int msm_cvp_unregister_buffer(struct msm_vidc_inst *inst,
|
|||
|
||||
memset(&vbuf, 0, sizeof(struct vidc_unregister_buffer));
|
||||
vbuf.index = cbuf->buf.index;
|
||||
vbuf.type = get_hal_buftype(__func__, cbuf->buf.type);
|
||||
vbuf.type = get_hal_buftype(__func__, cbuf->buf.type, inst->sid);
|
||||
vbuf.size = cbuf->buf.size;
|
||||
vbuf.device_addr = cbuf->smem.device_addr;
|
||||
vbuf.client_data = cbuf->smem.device_addr;
|
||||
|
|
@ -461,7 +460,8 @@ int msm_vidc_cvp(struct msm_vidc_inst *inst, struct msm_vidc_arg *arg)
|
|||
int rc = 0;
|
||||
|
||||
if (!inst || !arg) {
|
||||
dprintk(VIDC_ERR, "%s: invalid args\n", __func__);
|
||||
d_vpr_e("%s: invalid args %pK %pK\n",
|
||||
__func__, inst, arg);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -499,7 +499,7 @@ int msm_vidc_cvp(struct msm_vidc_inst *inst, struct msm_vidc_arg *arg)
|
|||
break;
|
||||
}
|
||||
default:
|
||||
dprintk(VIDC_ERR, "%s: unknown arg type 0x%x\n",
|
||||
s_vpr_e(inst->sid, "%s: unknown arg type 0x%x\n",
|
||||
__func__, arg->type);
|
||||
rc = -ENOTSUPP;
|
||||
break;
|
||||
|
|
@ -535,15 +535,14 @@ int msm_cvp_inst_pause(struct msm_vidc_inst *inst)
|
|||
struct hfi_device *hdev;
|
||||
|
||||
if (!inst || !inst->core || !inst->core->device) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
||||
rc = call_hfi_op(hdev, session_pause, (void *)inst->session);
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: failed to pause inst %pK (%#x)\n",
|
||||
__func__, inst, hash32_ptr(inst->session));
|
||||
s_vpr_e(inst->sid, "%s: failed to pause\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -554,15 +553,14 @@ int msm_cvp_inst_resume(struct msm_vidc_inst *inst)
|
|||
struct hfi_device *hdev;
|
||||
|
||||
if (!inst || !inst->core || !inst->core->device) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
||||
rc = call_hfi_op(hdev, session_resume, (void *)inst->session);
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: failed to resume inst %pK (%#x)\n",
|
||||
__func__, inst, hash32_ptr(inst->session));
|
||||
s_vpr_e(inst->sid, "%s: failed to resume\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -573,22 +571,21 @@ int msm_cvp_inst_deinit(struct msm_vidc_inst *inst)
|
|||
struct msm_vidc_cvp_buffer *cbuf, *temp;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
dprintk(VIDC_HIGH, "%s: inst %pK (%#x)\n", __func__,
|
||||
inst, hash32_ptr(inst->session));
|
||||
s_vpr_h(inst->sid, "%s: inst %pK\n", __func__, inst);
|
||||
|
||||
rc = msm_comm_try_state(inst, MSM_VIDC_CLOSE_DONE);
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: close failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: close failed\n", __func__);
|
||||
|
||||
mutex_lock(&inst->cvpbufs.lock);
|
||||
list_for_each_entry_safe(cbuf, temp, &inst->cvpbufs.list, list) {
|
||||
print_cvp_buffer(VIDC_ERR, "unregistered", inst, cbuf);
|
||||
rc = inst->smem_ops->smem_unmap_dma_buf(inst, &cbuf->smem);
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: unmap failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: unmap failed\n", __func__);
|
||||
list_del(&cbuf->list);
|
||||
kfree(cbuf);
|
||||
}
|
||||
|
|
@ -599,7 +596,7 @@ int msm_cvp_inst_deinit(struct msm_vidc_inst *inst)
|
|||
inst->clk_data.sys_cache_bw = 0;
|
||||
rc = msm_cvp_scale_clocks_and_bus(inst);
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: failed to scale_clocks_and_bus\n",
|
||||
s_vpr_e(inst->sid, "%s: failed to scale_clocks_and_bus\n",
|
||||
__func__);
|
||||
|
||||
return rc;
|
||||
|
|
@ -610,12 +607,11 @@ int msm_cvp_inst_init(struct msm_vidc_inst *inst)
|
|||
int rc = 0;
|
||||
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: inst %pK (%#x)\n", __func__,
|
||||
inst, hash32_ptr(inst->session));
|
||||
s_vpr_h(inst->sid, "%s: inst %pK\n", __func__, inst);
|
||||
|
||||
/* set default frequency */
|
||||
inst->clk_data.core_id = VIDC_CORE_ID_2;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ static int msm_dma_get_device_address(struct dma_buf *dbuf, unsigned long align,
|
|||
dma_addr_t *iova, unsigned long *buffer_size,
|
||||
unsigned long flags, enum hal_buffer buffer_type,
|
||||
unsigned long session_type, struct msm_vidc_platform_resources *res,
|
||||
struct dma_mapping_info *mapping_info)
|
||||
struct dma_mapping_info *mapping_info, u32 sid)
|
||||
{
|
||||
int rc = 0;
|
||||
struct dma_buf_attachment *attach;
|
||||
|
|
@ -29,18 +29,17 @@ static int msm_dma_get_device_address(struct dma_buf *dbuf, unsigned long align,
|
|||
struct context_bank_info *cb = NULL;
|
||||
|
||||
if (!dbuf || !iova || !buffer_size || !mapping_info) {
|
||||
dprintk(VIDC_ERR, "Invalid params: %pK, %pK, %pK, %pK\n",
|
||||
dbuf, iova, buffer_size, mapping_info);
|
||||
s_vpr_e(sid, "%s: invalid params: %pK, %pK, %pK, %pK\n",
|
||||
__func__, dbuf, iova, buffer_size, mapping_info);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (is_iommu_present(res)) {
|
||||
cb = msm_smem_get_context_bank(
|
||||
session_type, (flags & SMEM_SECURE),
|
||||
res, buffer_type);
|
||||
res, buffer_type, sid);
|
||||
if (!cb) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: Failed to get context bank device\n",
|
||||
s_vpr_e(sid, "%s: Failed to get context bank device\n",
|
||||
__func__);
|
||||
rc = -EIO;
|
||||
goto mem_map_failed;
|
||||
|
|
@ -49,7 +48,7 @@ static int msm_dma_get_device_address(struct dma_buf *dbuf, unsigned long align,
|
|||
/* Check if the dmabuf size matches expected size */
|
||||
if (dbuf->size < *buffer_size) {
|
||||
rc = -EINVAL;
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(sid,
|
||||
"Size mismatch: Dmabuf size: %zu Expected Size: %lu",
|
||||
dbuf->size, *buffer_size);
|
||||
msm_vidc_res_handle_fatal_hw_error(res,
|
||||
|
|
@ -61,7 +60,7 @@ static int msm_dma_get_device_address(struct dma_buf *dbuf, unsigned long align,
|
|||
attach = dma_buf_attach(dbuf, cb->dev);
|
||||
if (IS_ERR_OR_NULL(attach)) {
|
||||
rc = PTR_ERR(attach) ? PTR_ERR(attach) : -ENOMEM;
|
||||
dprintk(VIDC_ERR, "Failed to attach dmabuf\n");
|
||||
s_vpr_e(sid, "Failed to attach dmabuf\n");
|
||||
goto mem_buf_attach_failed;
|
||||
}
|
||||
|
||||
|
|
@ -84,7 +83,7 @@ static int msm_dma_get_device_address(struct dma_buf *dbuf, unsigned long align,
|
|||
table = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL);
|
||||
if (IS_ERR_OR_NULL(table)) {
|
||||
rc = PTR_ERR(table) ? PTR_ERR(table) : -ENOMEM;
|
||||
dprintk(VIDC_ERR, "Failed to map table\n");
|
||||
s_vpr_e(sid, "Failed to map table\n");
|
||||
goto mem_map_table_failed;
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +95,7 @@ static int msm_dma_get_device_address(struct dma_buf *dbuf, unsigned long align,
|
|||
*iova = table->sgl->dma_address;
|
||||
*buffer_size = table->sgl->dma_length;
|
||||
} else {
|
||||
dprintk(VIDC_ERR, "sgl is NULL\n");
|
||||
s_vpr_e(sid, "sgl is NULL\n");
|
||||
rc = -ENOMEM;
|
||||
goto mem_map_sg_failed;
|
||||
}
|
||||
|
|
@ -111,7 +110,7 @@ static int msm_dma_get_device_address(struct dma_buf *dbuf, unsigned long align,
|
|||
trace_msm_smem_buffer_iommu_op_end("MAP", 0, 0,
|
||||
align, *iova, *buffer_size);
|
||||
} else {
|
||||
dprintk(VIDC_HIGH, "iommu not present, use phys mem addr\n");
|
||||
s_vpr_h(sid, "iommu not present, use phys mem addr\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -127,19 +126,19 @@ mem_map_failed:
|
|||
|
||||
static int msm_dma_put_device_address(u32 flags,
|
||||
struct dma_mapping_info *mapping_info,
|
||||
enum hal_buffer buffer_type)
|
||||
enum hal_buffer buffer_type, u32 sid)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!mapping_info) {
|
||||
dprintk(VIDC_ERR, "Invalid mapping_info\n");
|
||||
s_vpr_e(sid, "Invalid mapping_info\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!mapping_info->dev || !mapping_info->table ||
|
||||
!mapping_info->buf || !mapping_info->attach ||
|
||||
!mapping_info->cb_info) {
|
||||
dprintk(VIDC_ERR, "Invalid params\n");
|
||||
s_vpr_e(sid, "%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -156,17 +155,16 @@ static int msm_dma_put_device_address(u32 flags,
|
|||
mapping_info->buf = NULL;
|
||||
mapping_info->cb_info = NULL;
|
||||
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
struct dma_buf *msm_smem_get_dma_buf(int fd)
|
||||
struct dma_buf *msm_smem_get_dma_buf(int fd, u32 sid)
|
||||
{
|
||||
struct dma_buf *dma_buf;
|
||||
|
||||
dma_buf = dma_buf_get(fd);
|
||||
if (IS_ERR_OR_NULL(dma_buf)) {
|
||||
dprintk(VIDC_ERR, "Failed to get dma_buf for %d, error %ld\n",
|
||||
s_vpr_e(sid, "Failed to get dma_buf for %d, error %ld\n",
|
||||
fd, PTR_ERR(dma_buf));
|
||||
dma_buf = NULL;
|
||||
}
|
||||
|
|
@ -174,10 +172,10 @@ struct dma_buf *msm_smem_get_dma_buf(int fd)
|
|||
return dma_buf;
|
||||
}
|
||||
|
||||
void msm_smem_put_dma_buf(void *dma_buf)
|
||||
void msm_smem_put_dma_buf(void *dma_buf, u32 sid)
|
||||
{
|
||||
if (!dma_buf) {
|
||||
dprintk(VIDC_ERR, "%s: NULL dma_buf\n", __func__);
|
||||
s_vpr_e(sid, "%s: NULL dma_buf\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -196,7 +194,7 @@ int msm_smem_map_dma_buf(struct msm_vidc_inst *inst, struct msm_smem *smem)
|
|||
unsigned long ion_flags = 0;
|
||||
|
||||
if (!inst || !smem) {
|
||||
dprintk(VIDC_ERR, "%s: Invalid params: %pK %pK\n",
|
||||
d_vpr_e("%s: invalid params: %pK %pK\n",
|
||||
__func__, inst, smem);
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
|
|
@ -207,7 +205,7 @@ int msm_smem_map_dma_buf(struct msm_vidc_inst *inst, struct msm_smem *smem)
|
|||
goto exit;
|
||||
}
|
||||
|
||||
dbuf = msm_smem_get_dma_buf(smem->fd);
|
||||
dbuf = msm_smem_get_dma_buf(smem->fd, inst->sid);
|
||||
if (!dbuf) {
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
|
|
@ -217,7 +215,7 @@ int msm_smem_map_dma_buf(struct msm_vidc_inst *inst, struct msm_smem *smem)
|
|||
|
||||
rc = dma_buf_get_flags(dbuf, &ion_flags);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to get dma buf flags: %d\n", rc);
|
||||
s_vpr_e(inst->sid, "Failed to get dma buf flags: %d\n", rc);
|
||||
goto exit;
|
||||
}
|
||||
if (ion_flags & ION_FLAG_CACHED)
|
||||
|
|
@ -230,14 +228,15 @@ int msm_smem_map_dma_buf(struct msm_vidc_inst *inst, struct msm_smem *smem)
|
|||
|
||||
rc = msm_dma_get_device_address(dbuf, align, &iova, &buffer_size,
|
||||
smem->flags, smem->buffer_type, inst->session_type,
|
||||
&(inst->core->resources), &smem->mapping_info);
|
||||
&(inst->core->resources), &smem->mapping_info,
|
||||
inst->sid);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to get device address: %d\n", rc);
|
||||
s_vpr_e(inst->sid, "Failed to get device address: %d\n", rc);
|
||||
goto exit;
|
||||
}
|
||||
temp = (u32)iova;
|
||||
if ((dma_addr_t)temp != iova) {
|
||||
dprintk(VIDC_ERR, "iova(%pa) truncated to %#x", &iova, temp);
|
||||
s_vpr_e(inst->sid, "iova(%pa) truncated to %#x", &iova, temp);
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -254,7 +253,7 @@ int msm_smem_unmap_dma_buf(struct msm_vidc_inst *inst, struct msm_smem *smem)
|
|||
int rc = 0;
|
||||
|
||||
if (!inst || !smem) {
|
||||
dprintk(VIDC_ERR, "%s: Invalid params: %pK %pK\n",
|
||||
d_vpr_e("%s: invalid params: %pK %pK\n",
|
||||
__func__, inst, smem);
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
|
|
@ -263,7 +262,7 @@ int msm_smem_unmap_dma_buf(struct msm_vidc_inst *inst, struct msm_smem *smem)
|
|||
if (smem->refcount) {
|
||||
smem->refcount--;
|
||||
} else {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"unmap called while refcount is zero already\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -272,13 +271,13 @@ int msm_smem_unmap_dma_buf(struct msm_vidc_inst *inst, struct msm_smem *smem)
|
|||
goto exit;
|
||||
|
||||
rc = msm_dma_put_device_address(smem->flags, &smem->mapping_info,
|
||||
smem->buffer_type);
|
||||
smem->buffer_type, inst->sid);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to put device address: %d\n", rc);
|
||||
s_vpr_e(inst->sid, "Failed to put device address: %d\n", rc);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
msm_smem_put_dma_buf(smem->dma_buf);
|
||||
msm_smem_put_dma_buf(smem->dma_buf, inst->sid);
|
||||
|
||||
smem->device_addr = 0x0;
|
||||
smem->dma_buf = NULL;
|
||||
|
|
@ -325,7 +324,7 @@ static int get_secure_flag_for_buffer_type(
|
|||
static int alloc_dma_mem(size_t size, u32 align, u32 flags,
|
||||
enum hal_buffer buffer_type, int map_kernel,
|
||||
struct msm_vidc_platform_resources *res, u32 session_type,
|
||||
struct msm_smem *mem)
|
||||
struct msm_smem *mem, u32 sid)
|
||||
{
|
||||
dma_addr_t iova = 0;
|
||||
unsigned long buffer_size = 0;
|
||||
|
|
@ -335,7 +334,7 @@ static int alloc_dma_mem(size_t size, u32 align, u32 flags,
|
|||
struct dma_buf *dbuf = NULL;
|
||||
|
||||
if (!res) {
|
||||
dprintk(VIDC_ERR, "%s: NULL res\n", __func__);
|
||||
s_vpr_e(sid, "%s: NULL res\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -344,13 +343,13 @@ static int alloc_dma_mem(size_t size, u32 align, u32 flags,
|
|||
|
||||
if (is_iommu_present(res)) {
|
||||
if (flags & SMEM_ADSP) {
|
||||
dprintk(VIDC_HIGH, "Allocating from ADSP heap\n");
|
||||
s_vpr_h(sid, "Allocating from ADSP heap\n");
|
||||
heap_mask = ION_HEAP(ION_ADSP_HEAP_ID);
|
||||
} else {
|
||||
heap_mask = ION_HEAP(ION_SYSTEM_HEAP_ID);
|
||||
}
|
||||
} else {
|
||||
dprintk(VIDC_HIGH,
|
||||
s_vpr_h(sid,
|
||||
"allocate shared memory from adsp heap size %zx align %d\n",
|
||||
size, align);
|
||||
heap_mask = ION_HEAP(ION_ADSP_HEAP_ID);
|
||||
|
|
@ -385,8 +384,7 @@ static int alloc_dma_mem(size_t size, u32 align, u32 flags,
|
|||
heap_mask, size, align, flags, map_kernel);
|
||||
dbuf = ion_alloc(size, heap_mask, ion_flags);
|
||||
if (IS_ERR_OR_NULL(dbuf)) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to allocate shared memory = %zx, %#x\n",
|
||||
s_vpr_e(sid, "Failed to allocate shared memory = %zx, %#x\n",
|
||||
size, flags);
|
||||
rc = -ENOMEM;
|
||||
goto fail_shared_mem_alloc;
|
||||
|
|
@ -403,15 +401,15 @@ static int alloc_dma_mem(size_t size, u32 align, u32 flags,
|
|||
|
||||
rc = msm_dma_get_device_address(dbuf, align, &iova,
|
||||
&buffer_size, flags, buffer_type,
|
||||
session_type, res, &mem->mapping_info);
|
||||
session_type, res, &mem->mapping_info, sid);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to get device address: %d\n",
|
||||
s_vpr_e(sid, "Failed to get device address: %d\n",
|
||||
rc);
|
||||
goto fail_device_address;
|
||||
}
|
||||
mem->device_addr = (u32)iova;
|
||||
if ((dma_addr_t)mem->device_addr != iova) {
|
||||
dprintk(VIDC_ERR, "iova(%pa) truncated to %#x",
|
||||
s_vpr_e(sid, "iova(%pa) truncated to %#x",
|
||||
&iova, mem->device_addr);
|
||||
goto fail_device_address;
|
||||
}
|
||||
|
|
@ -420,14 +418,13 @@ static int alloc_dma_mem(size_t size, u32 align, u32 flags,
|
|||
dma_buf_begin_cpu_access(dbuf, DMA_BIDIRECTIONAL);
|
||||
mem->kvaddr = dma_buf_vmap(dbuf);
|
||||
if (!mem->kvaddr) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to map shared mem in kernel\n");
|
||||
s_vpr_e(sid, "Failed to map shared mem in kernel\n");
|
||||
rc = -EIO;
|
||||
goto fail_map;
|
||||
}
|
||||
}
|
||||
|
||||
dprintk(VIDC_HIGH,
|
||||
s_vpr_h(sid,
|
||||
"%s: dma_buf = %pK, device_addr = %x, size = %d, kvaddr = %pK, buffer_type = %#x, flags = %#lx\n",
|
||||
__func__, mem->dma_buf, mem->device_addr, mem->size,
|
||||
mem->kvaddr, mem->buffer_type, mem->flags);
|
||||
|
|
@ -442,16 +439,16 @@ fail_shared_mem_alloc:
|
|||
return rc;
|
||||
}
|
||||
|
||||
static int free_dma_mem(struct msm_smem *mem)
|
||||
static int free_dma_mem(struct msm_smem *mem, u32 sid)
|
||||
{
|
||||
dprintk(VIDC_HIGH,
|
||||
s_vpr_h(sid,
|
||||
"%s: dma_buf = %pK, device_addr = %x, size = %d, kvaddr = %pK, buffer_type = %#x\n",
|
||||
__func__, mem->dma_buf, mem->device_addr, mem->size,
|
||||
mem->kvaddr, mem->buffer_type);
|
||||
|
||||
if (mem->device_addr) {
|
||||
msm_dma_put_device_address(mem->flags,
|
||||
&mem->mapping_info, mem->buffer_type);
|
||||
&mem->mapping_info, mem->buffer_type, sid);
|
||||
mem->device_addr = 0x0;
|
||||
}
|
||||
|
||||
|
|
@ -476,51 +473,52 @@ static int free_dma_mem(struct msm_smem *mem)
|
|||
|
||||
int msm_smem_alloc(size_t size, u32 align, u32 flags,
|
||||
enum hal_buffer buffer_type, int map_kernel,
|
||||
void *res, u32 session_type, struct msm_smem *smem)
|
||||
void *res, u32 session_type, struct msm_smem *smem, u32 sid)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!smem || !size) {
|
||||
dprintk(VIDC_ERR, "%s: NULL smem or %d size\n",
|
||||
s_vpr_e(sid, "%s: NULL smem or %d size\n",
|
||||
__func__, (u32)size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = alloc_dma_mem(size, align, flags, buffer_type, map_kernel,
|
||||
(struct msm_vidc_platform_resources *)res,
|
||||
session_type, smem);
|
||||
session_type, smem, sid);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int msm_smem_free(struct msm_smem *smem)
|
||||
int msm_smem_free(struct msm_smem *smem, u32 sid)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!smem) {
|
||||
dprintk(VIDC_ERR, "NULL smem passed\n");
|
||||
s_vpr_e(sid, "NULL smem passed\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
rc = free_dma_mem(smem);
|
||||
rc = free_dma_mem(smem, sid);
|
||||
|
||||
return rc;
|
||||
};
|
||||
|
||||
int msm_smem_cache_operations(struct dma_buf *dbuf,
|
||||
enum smem_cache_ops cache_op, unsigned long offset, unsigned long size)
|
||||
enum smem_cache_ops cache_op, unsigned long offset,
|
||||
unsigned long size, u32 sid)
|
||||
{
|
||||
int rc = 0;
|
||||
unsigned long flags = 0;
|
||||
|
||||
if (!dbuf) {
|
||||
dprintk(VIDC_ERR, "%s: Invalid params\n", __func__);
|
||||
s_vpr_e(sid, "%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Return if buffer doesn't support caching */
|
||||
rc = dma_buf_get_flags(dbuf, &flags);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: dma_buf_get_flags failed, err %d\n",
|
||||
s_vpr_e(sid, "%s: dma_buf_get_flags failed, err %d\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
} else if (!(flags & ION_FLAG_CACHED)) {
|
||||
|
|
@ -546,7 +544,7 @@ int msm_smem_cache_operations(struct dma_buf *dbuf,
|
|||
offset, size);
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR, "%s: cache (%d) operation not supported\n",
|
||||
s_vpr_e(sid, "%s: cache (%d) operation not supported\n",
|
||||
__func__, cache_op);
|
||||
rc = -EINVAL;
|
||||
break;
|
||||
|
|
@ -557,7 +555,7 @@ int msm_smem_cache_operations(struct dma_buf *dbuf,
|
|||
|
||||
struct context_bank_info *msm_smem_get_context_bank(u32 session_type,
|
||||
bool is_secure, struct msm_vidc_platform_resources *res,
|
||||
enum hal_buffer buffer_type)
|
||||
enum hal_buffer buffer_type, u32 sid)
|
||||
{
|
||||
struct context_bank_info *cb = NULL, *match = NULL;
|
||||
|
||||
|
|
@ -585,7 +583,7 @@ struct context_bank_info *msm_smem_get_context_bank(u32 session_type,
|
|||
}
|
||||
}
|
||||
if (!match)
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(sid,
|
||||
"%s: cb not found for buffer_type %x, is_secure %d\n",
|
||||
__func__, buffer_type, is_secure);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ static int convert_from_user(struct msm_vidc_arg *kp, unsigned long arg)
|
|||
struct msm_vidc_arg __user *up = compat_ptr(arg);
|
||||
|
||||
if (!kp || !up) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params%pK %pK\n", __func__, kp, up);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ static int convert_from_user(struct msm_vidc_arg *kp, unsigned long arg)
|
|||
break;
|
||||
}
|
||||
default:
|
||||
dprintk(VIDC_ERR, "%s: unknown cmd type 0x%x\n",
|
||||
d_vpr_e("%s: unknown cmd type 0x%x\n",
|
||||
__func__, kp->type);
|
||||
rc = -EINVAL;
|
||||
break;
|
||||
|
|
@ -104,7 +104,7 @@ static int convert_to_user(struct msm_vidc_arg *kp, unsigned long arg)
|
|||
struct msm_vidc_arg __user *up = compat_ptr(arg);
|
||||
|
||||
if (!kp || !up) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK %pK\n", __func__, kp, up);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -180,8 +180,7 @@ static int convert_to_user(struct msm_vidc_arg *kp, unsigned long arg)
|
|||
break;
|
||||
}
|
||||
default:
|
||||
dprintk(VIDC_ERR, "%s: unknown cmd type 0x%x\n",
|
||||
__func__, kp->type);
|
||||
d_vpr_e("%s: unknown cmd type 0x%x\n", __func__, kp->type);
|
||||
rc = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
|
@ -196,7 +195,7 @@ long msm_v4l2_private(struct file *filp, unsigned int cmd, unsigned long arg)
|
|||
struct msm_vidc_arg karg;
|
||||
|
||||
if (!filp || !filp->private_data) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, filp);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -214,8 +213,7 @@ long msm_v4l2_private(struct file *filp, unsigned int cmd, unsigned long arg)
|
|||
|
||||
rc = msm_vidc_private((void *)inst, cmd, &karg);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: failed cmd type %x\n",
|
||||
__func__, karg.type);
|
||||
d_vpr_e("%s: failed cmd type %x\n", __func__, karg.type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ static int msm_v4l2_open(struct file *filp)
|
|||
trace_msm_v4l2_vidc_open_start("msm v4l2_open start");
|
||||
vidc_inst = msm_vidc_open(core->id, vid_dev->type);
|
||||
if (!vidc_inst) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to create video instance, core: %d, type = %d\n",
|
||||
d_vpr_e("Failed to create instance, core: %d, type = %d\n",
|
||||
core->id, vid_dev->type);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
@ -270,11 +269,10 @@ static int read_platform_resources(struct msm_vidc_core *core,
|
|||
int rc = 0;
|
||||
|
||||
if (!core || !pdev) {
|
||||
dprintk(VIDC_ERR, "%s: Invalid params %pK %pK\n",
|
||||
d_vpr_e("%s: invalid params %pK %pK\n",
|
||||
__func__, core, pdev);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
core->hfi_type = VIDC_HFI_VENUS;
|
||||
core->resources.pdev = pdev;
|
||||
if (pdev->dev.of_node) {
|
||||
|
|
@ -282,7 +280,7 @@ static int read_platform_resources(struct msm_vidc_core *core,
|
|||
rc = read_platform_resources_from_drv_data(core);
|
||||
rc = read_platform_resources_from_dt(&core->resources);
|
||||
} else {
|
||||
dprintk(VIDC_ERR, "pdev node is NULL\n");
|
||||
d_vpr_e("pdev node is NULL\n");
|
||||
rc = -EINVAL;
|
||||
}
|
||||
return rc;
|
||||
|
|
@ -298,7 +296,7 @@ static int msm_vidc_initialize_core(struct platform_device *pdev,
|
|||
return -EINVAL;
|
||||
rc = read_platform_resources(core, pdev);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to get platform resources\n");
|
||||
d_vpr_e("Failed to get platform resources\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -391,11 +389,10 @@ static ssize_t thermal_level_store(struct device *dev,
|
|||
|
||||
rc = kstrtoint(buf, 0, &val);
|
||||
if (rc || val < 0) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Invalid thermal level value: %s\n", buf);
|
||||
d_vpr_e("Invalid thermal level value: %s\n", buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
dprintk(VIDC_HIGH, "Thermal level old %d new %d\n",
|
||||
d_vpr_h("Thermal level old %d new %d\n",
|
||||
vidc_driver->thermal_level, val);
|
||||
|
||||
if (val == vidc_driver->thermal_level)
|
||||
|
|
@ -451,14 +448,14 @@ static int msm_vidc_register_video_device(enum session_type sess_type,
|
|||
rc = video_register_device(&core->vdev[sess_type].vdev,
|
||||
VFL_TYPE_GRABBER, nr);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to register the video device\n");
|
||||
d_vpr_e("Failed to register the video device\n");
|
||||
return rc;
|
||||
}
|
||||
video_set_drvdata(&core->vdev[sess_type].vdev, core);
|
||||
dev = &core->vdev[sess_type].vdev.dev;
|
||||
rc = device_create_file(dev, &dev_attr_link_name);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to create video device file\n");
|
||||
d_vpr_e("Failed to create video device file\n");
|
||||
video_unregister_device(&core->vdev[sess_type].vdev);
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -472,7 +469,7 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
|
|||
int nr = BASE_DEVICE_NUMBER;
|
||||
|
||||
if (!vidc_driver) {
|
||||
dprintk(VIDC_ERR, "Invalid vidc driver\n");
|
||||
d_vpr_e("Invalid vidc driver\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -484,13 +481,12 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
|
|||
dev_set_drvdata(&pdev->dev, core);
|
||||
rc = msm_vidc_initialize_core(pdev, core);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to init core\n");
|
||||
d_vpr_e("Failed to init core\n");
|
||||
goto err_core_init;
|
||||
}
|
||||
rc = sysfs_create_group(&pdev->dev.kobj, &msm_vidc_core_attr_group);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to create attributes\n");
|
||||
d_vpr_e("Failed to create attributes\n");
|
||||
goto err_core_init;
|
||||
}
|
||||
|
||||
|
|
@ -498,7 +494,7 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
|
|||
|
||||
rc = v4l2_device_register(&pdev->dev, &core->v4l2_dev);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to register v4l2 device\n");
|
||||
d_vpr_e("Failed to register v4l2 device\n");
|
||||
goto err_v4l2_register;
|
||||
}
|
||||
|
||||
|
|
@ -506,7 +502,7 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
|
|||
rc = msm_vidc_register_video_device(MSM_VIDC_DECODER,
|
||||
nr, core, dev);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to register video decoder\n");
|
||||
d_vpr_e("Failed to register video decoder\n");
|
||||
goto err_dec;
|
||||
}
|
||||
|
||||
|
|
@ -514,7 +510,7 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
|
|||
rc = msm_vidc_register_video_device(MSM_VIDC_ENCODER,
|
||||
nr + 1, core, dev);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to register video encoder\n");
|
||||
d_vpr_e("Failed to register video encoder\n");
|
||||
goto err_enc;
|
||||
}
|
||||
|
||||
|
|
@ -523,7 +519,7 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
|
|||
rc = msm_vidc_register_video_device(MSM_VIDC_CVP,
|
||||
nr + 2, core, dev);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to register video CVP\n");
|
||||
d_vpr_e("Failed to register video CVP\n");
|
||||
goto err_cvp;
|
||||
}
|
||||
}
|
||||
|
|
@ -532,8 +528,8 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
|
|||
mutex_lock(&vidc_driver->lock);
|
||||
if (vidc_driver->num_cores + 1 > MSM_VIDC_CORES_MAX) {
|
||||
mutex_unlock(&vidc_driver->lock);
|
||||
dprintk(VIDC_ERR, "Maximum cores already exist, core_no = %d\n",
|
||||
vidc_driver->num_cores);
|
||||
d_vpr_e("Maximum cores already exist, core_no = %d\n",
|
||||
vidc_driver->num_cores);
|
||||
goto err_cores_exceeded;
|
||||
}
|
||||
vidc_driver->num_cores++;
|
||||
|
|
@ -549,16 +545,16 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
|
|||
rc = PTR_ERR(core->device) ?
|
||||
PTR_ERR(core->device) : -EBADHANDLE;
|
||||
if (rc != -EPROBE_DEFER)
|
||||
dprintk(VIDC_ERR, "Failed to create HFI device\n");
|
||||
d_vpr_e("Failed to create HFI device\n");
|
||||
else
|
||||
dprintk(VIDC_HIGH, "msm_vidc: request probe defer\n");
|
||||
d_vpr_h("msm_vidc: request probe defer\n");
|
||||
goto err_cores_exceeded;
|
||||
}
|
||||
|
||||
core->vidc_core_workq = create_singlethread_workqueue(
|
||||
"vidc_core_workq");
|
||||
if (!core->vidc_core_workq) {
|
||||
dprintk(VIDC_ERR, "%s: create core workq failed\n", __func__);
|
||||
d_vpr_e("%s: create core workq failed\n", __func__);
|
||||
goto err_core_workq;
|
||||
}
|
||||
mutex_lock(&vidc_driver->lock);
|
||||
|
|
@ -570,7 +566,7 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
|
|||
|
||||
vidc_driver->sku_version = core->resources.sku_version;
|
||||
|
||||
dprintk(VIDC_HIGH, "populating sub devices\n");
|
||||
d_vpr_h("populating sub devices\n");
|
||||
/*
|
||||
* Trigger probe for each sub-device i.e. qcom,msm-vidc,context-bank.
|
||||
* When msm_vidc_probe is called for each sub-device, parse the
|
||||
|
|
@ -580,7 +576,7 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
|
|||
rc = of_platform_populate(pdev->dev.of_node, msm_vidc_dt_match, NULL,
|
||||
&pdev->dev);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to trigger probe for sub-devices\n");
|
||||
d_vpr_e("Failed to trigger probe for sub-devices\n");
|
||||
goto err_fail_sub_device_probe;
|
||||
}
|
||||
|
||||
|
|
@ -661,13 +657,13 @@ static int msm_vidc_remove(struct platform_device *pdev)
|
|||
struct msm_vidc_core *core;
|
||||
|
||||
if (!pdev) {
|
||||
dprintk(VIDC_ERR, "%s invalid input %pK", __func__, pdev);
|
||||
d_vpr_e("%s: invalid input %pK", __func__, pdev);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
core = dev_get_drvdata(&pdev->dev);
|
||||
if (!core) {
|
||||
dprintk(VIDC_ERR, "%s invalid core", __func__);
|
||||
d_vpr_e("%s: invalid core", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -712,7 +708,7 @@ static int msm_vidc_pm_suspend(struct device *dev)
|
|||
|
||||
core = dev_get_drvdata(dev);
|
||||
if (!core) {
|
||||
dprintk(VIDC_ERR, "%s invalid core\n", __func__);
|
||||
d_vpr_e("%s: invalid core\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -720,7 +716,7 @@ static int msm_vidc_pm_suspend(struct device *dev)
|
|||
if (rc == -ENOTSUPP)
|
||||
rc = 0;
|
||||
else if (rc)
|
||||
dprintk(VIDC_ERR, "Failed to suspend: %d\n", rc);
|
||||
d_vpr_e("Failed to suspend: %d\n", rc);
|
||||
|
||||
|
||||
return rc;
|
||||
|
|
@ -728,7 +724,7 @@ static int msm_vidc_pm_suspend(struct device *dev)
|
|||
|
||||
static int msm_vidc_pm_resume(struct device *dev)
|
||||
{
|
||||
dprintk(VIDC_HIGH, "%s\n", __func__);
|
||||
d_vpr_h("%s\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -755,8 +751,7 @@ static int __init msm_vidc_init(void)
|
|||
vidc_driver = kzalloc(sizeof(*vidc_driver),
|
||||
GFP_KERNEL);
|
||||
if (!vidc_driver) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to allocate memroy for msm_vidc_drv\n");
|
||||
d_vpr_e("Failed to allocate memroy for msm_vidc_drv\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
|
@ -764,13 +759,11 @@ static int __init msm_vidc_init(void)
|
|||
mutex_init(&vidc_driver->lock);
|
||||
vidc_driver->debugfs_root = msm_vidc_debugfs_init_drv();
|
||||
if (!vidc_driver->debugfs_root)
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to create debugfs for msm_vidc\n");
|
||||
d_vpr_e("Failed to create debugfs for msm_vidc\n");
|
||||
|
||||
rc = platform_driver_register(&msm_vidc_driver);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to register platform driver\n");
|
||||
d_vpr_e("Failed to register platform driver\n");
|
||||
debugfs_remove_recursive(vidc_driver->debugfs_root);
|
||||
kfree(vidc_driver);
|
||||
vidc_driver = NULL;
|
||||
|
|
|
|||
|
|
@ -515,7 +515,7 @@ int msm_vdec_update_stream_output_mode(struct msm_vidc_inst *inst)
|
|||
u32 fourcc;
|
||||
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "%s invalid parameters\n", __func__);
|
||||
d_vpr_e("%s: invalid parameters\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -548,7 +548,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||
u32 color_format;
|
||||
|
||||
if (!inst || !f) {
|
||||
dprintk(VIDC_ERR, "%s invalid parameters\n", __func__);
|
||||
d_vpr_e("%s: invalid parameters %pK %pK\n", __func__, inst, f);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -562,9 +562,9 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||
fmt = &inst->fmts[OUTPUT_PORT];
|
||||
fmt_desc = msm_comm_get_pixel_fmt_fourcc(vdec_output_formats,
|
||||
ARRAY_SIZE(vdec_output_formats),
|
||||
f->fmt.pix_mp.pixelformat);
|
||||
f->fmt.pix_mp.pixelformat, inst->sid);
|
||||
if (!fmt_desc) {
|
||||
dprintk(VIDC_ERR, "Invalid fmt set : %x\n",
|
||||
s_vpr_e(inst->sid, "Invalid fmt set : %x\n",
|
||||
f->fmt.pix_mp.pixelformat);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -586,7 +586,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||
mplane->plane_fmt[1].sizeimage =
|
||||
msm_vidc_calculate_dec_output_extra_size(inst);
|
||||
color_format = msm_comm_convert_color_fmt(
|
||||
f->fmt.pix_mp.pixelformat);
|
||||
f->fmt.pix_mp.pixelformat, inst->sid);
|
||||
mplane->plane_fmt[0].bytesperline =
|
||||
VENUS_Y_STRIDE(color_format, f->fmt.pix_mp.width);
|
||||
mplane->plane_fmt[0].reserved[0] =
|
||||
|
|
@ -601,14 +601,14 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||
|
||||
rc = msm_vidc_check_session_supported(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: session not supported\n", __func__);
|
||||
goto err_invalid_fmt;
|
||||
}
|
||||
|
||||
rc = msm_vdec_update_stream_output_mode(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: failed to update output stream mode\n",
|
||||
__func__);
|
||||
goto err_invalid_fmt;
|
||||
|
|
@ -619,9 +619,9 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||
fmt = &inst->fmts[INPUT_PORT];
|
||||
fmt_desc = msm_comm_get_pixel_fmt_fourcc(vdec_input_formats,
|
||||
ARRAY_SIZE(vdec_input_formats),
|
||||
f->fmt.pix_mp.pixelformat);
|
||||
f->fmt.pix_mp.pixelformat, inst->sid);
|
||||
if (!fmt_desc) {
|
||||
dprintk(VIDC_ERR, "Invalid fmt set : %x\n",
|
||||
s_vpr_e(inst->sid, "Invalid fmt set : %x\n",
|
||||
f->fmt.pix_mp.pixelformat);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -631,7 +631,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||
|
||||
if (f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_VP9) {
|
||||
if (msm_vidc_check_for_vp9d_overload(inst->core)) {
|
||||
dprintk(VIDC_ERR, "VP9 Decode overload\n");
|
||||
s_vpr_e(inst->sid, "VP9 Decode overload\n");
|
||||
rc = -ENOTSUPP;
|
||||
goto err_invalid_fmt;
|
||||
}
|
||||
|
|
@ -644,7 +644,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||
mplane->pixelformat = f->fmt.pix_mp.pixelformat;
|
||||
rc = msm_comm_try_state(inst, MSM_VIDC_OPEN_DONE);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to open instance\n");
|
||||
s_vpr_e(inst->sid, "Failed to open instance\n");
|
||||
goto err_invalid_fmt;
|
||||
}
|
||||
|
||||
|
|
@ -653,7 +653,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||
|
||||
rc = msm_vidc_check_session_supported(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: session not supported\n", __func__);
|
||||
goto err_invalid_fmt;
|
||||
}
|
||||
|
|
@ -694,7 +694,7 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||
msm_vidc_calculate_dec_input_frame_size(inst);
|
||||
memcpy(f, fmt, sizeof(struct v4l2_format));
|
||||
} else {
|
||||
dprintk(VIDC_ERR, "%s - Unsupported buf type: %d\n",
|
||||
s_vpr_e(inst->sid, "%s: Unsupported buf type: %d\n",
|
||||
__func__, f->type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -708,16 +708,15 @@ int msm_vdec_enum_fmt(struct msm_vidc_inst *inst, struct v4l2_fmtdesc *f)
|
|||
int rc = 0;
|
||||
|
||||
if (!inst || !f) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Invalid input, inst = %pK, f = %pK\n", inst, f);
|
||||
d_vpr_e("Invalid input, inst = %pK, f = %pK\n", inst, f);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (f->type == OUTPUT_MPLANE) {
|
||||
fmt_desc = msm_comm_get_pixel_fmt_index(vdec_output_formats,
|
||||
ARRAY_SIZE(vdec_output_formats), f->index);
|
||||
ARRAY_SIZE(vdec_output_formats), f->index, inst->sid);
|
||||
} else if (f->type == INPUT_MPLANE) {
|
||||
fmt_desc = msm_comm_get_pixel_fmt_index(vdec_input_formats,
|
||||
ARRAY_SIZE(vdec_input_formats), f->index);
|
||||
ARRAY_SIZE(vdec_input_formats), f->index, inst->sid);
|
||||
f->flags = V4L2_FMT_FLAG_COMPRESSED;
|
||||
}
|
||||
|
||||
|
|
@ -727,7 +726,7 @@ int msm_vdec_enum_fmt(struct msm_vidc_inst *inst, struct v4l2_fmtdesc *f)
|
|||
sizeof(f->description));
|
||||
f->pixelformat = fmt_desc->fourcc;
|
||||
} else {
|
||||
dprintk(VIDC_HIGH, "No more formats found\n");
|
||||
s_vpr_h(inst->sid, "No more formats found\n");
|
||||
rc = -EINVAL;
|
||||
}
|
||||
return rc;
|
||||
|
|
@ -741,7 +740,7 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst)
|
|||
struct v4l2_format *f = NULL;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "Invalid input = %pK\n", inst);
|
||||
d_vpr_e("Invalid input = %pK\n", inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
|
|
@ -757,9 +756,10 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst)
|
|||
f->fmt.pix_mp.plane_fmt[1].sizeimage =
|
||||
msm_vidc_calculate_dec_output_extra_size(inst);
|
||||
fmt_desc = msm_comm_get_pixel_fmt_fourcc(vdec_output_formats,
|
||||
ARRAY_SIZE(vdec_output_formats), f->fmt.pix_mp.pixelformat);
|
||||
ARRAY_SIZE(vdec_output_formats),
|
||||
f->fmt.pix_mp.pixelformat, inst->sid);
|
||||
if (!fmt_desc) {
|
||||
dprintk(VIDC_ERR, "Invalid fmt set : %x\n",
|
||||
s_vpr_e(inst->sid, "Invalid fmt set: %x\n",
|
||||
f->fmt.pix_mp.pixelformat);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -775,9 +775,10 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst)
|
|||
f->fmt.pix_mp.plane_fmt[0].sizeimage =
|
||||
msm_vidc_calculate_dec_input_frame_size(inst);
|
||||
fmt_desc = msm_comm_get_pixel_fmt_fourcc(vdec_input_formats,
|
||||
ARRAY_SIZE(vdec_input_formats), f->fmt.pix_mp.pixelformat);
|
||||
ARRAY_SIZE(vdec_input_formats), f->fmt.pix_mp.pixelformat,
|
||||
inst->sid);
|
||||
if (!fmt_desc) {
|
||||
dprintk(VIDC_ERR, "Invalid fmt set : %x\n",
|
||||
s_vpr_e(inst->sid, "Invalid fmt set: %x\n",
|
||||
f->fmt.pix_mp.pixelformat);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -829,14 +830,12 @@ int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
|
|||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->core->device) {
|
||||
dprintk(VIDC_ERR, "%s invalid parameters\n", __func__);
|
||||
d_vpr_e("%s: invalid parameters\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dprintk(VIDC_HIGH,
|
||||
"%s: %x : control name = %s, id = 0x%x value = %d\n",
|
||||
__func__, hash32_ptr(inst->session), ctrl->name,
|
||||
ctrl->id, ctrl->val);
|
||||
s_vpr_h(inst->sid, "%s: control name = %s, id = 0x%x value = %d\n",
|
||||
__func__, ctrl->name, ctrl->id, ctrl->val);
|
||||
|
||||
switch (ctrl->id) {
|
||||
case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
|
||||
|
|
@ -844,18 +843,21 @@ int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
|
|||
case V4L2_CID_MPEG_VIDEO_VP8_PROFILE:
|
||||
case V4L2_CID_MPEG_VIDEO_VP9_PROFILE:
|
||||
case V4L2_CID_MPEG_VIDC_VIDEO_MPEG2_PROFILE:
|
||||
inst->profile = msm_comm_v4l2_to_hfi(ctrl->id, ctrl->val);
|
||||
inst->profile = msm_comm_v4l2_to_hfi(ctrl->id, ctrl->val,
|
||||
inst->sid);
|
||||
break;
|
||||
case V4L2_CID_MPEG_VIDEO_H264_LEVEL:
|
||||
case V4L2_CID_MPEG_VIDEO_HEVC_LEVEL:
|
||||
case V4L2_CID_MPEG_VIDC_VIDEO_VP8_PROFILE_LEVEL:
|
||||
case V4L2_CID_MPEG_VIDC_VIDEO_VP9_LEVEL:
|
||||
case V4L2_CID_MPEG_VIDC_VIDEO_MPEG2_LEVEL:
|
||||
inst->level = msm_comm_v4l2_to_hfi(ctrl->id, ctrl->val);
|
||||
inst->level = msm_comm_v4l2_to_hfi(ctrl->id, ctrl->val,
|
||||
inst->sid);
|
||||
break;
|
||||
case V4L2_CID_MPEG_VIDEO_HEVC_TIER:
|
||||
inst->level |=
|
||||
(msm_comm_v4l2_to_hfi(ctrl->id, ctrl->val) << 28);
|
||||
(msm_comm_v4l2_to_hfi(ctrl->id, ctrl->val,
|
||||
inst->sid) << 28);
|
||||
break;
|
||||
case V4L2_CID_MPEG_VIDC_VIDEO_DECODE_ORDER:
|
||||
case V4L2_CID_MPEG_VIDC_VIDEO_CONCEAL_COLOR_8BIT:
|
||||
|
|
@ -868,9 +870,9 @@ int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
|
|||
|
||||
rc = msm_vidc_calculate_buffer_counts(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: %x : failed to calculate thumbnail buffer count\n",
|
||||
__func__, hash32_ptr(inst->session));
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: failed to calculate thumbnail buffer count\n",
|
||||
__func__);
|
||||
return rc;
|
||||
}
|
||||
break;
|
||||
|
|
@ -879,7 +881,7 @@ int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
|
|||
if (ctrl->val)
|
||||
inst->flags |= VIDC_SECURE;
|
||||
if (msm_comm_check_for_inst_overload(inst->core)) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: Instance count reached Max limit, rejecting session",
|
||||
__func__);
|
||||
return -ENOTSUPP;
|
||||
|
|
@ -914,8 +916,7 @@ int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
|
|||
inst->clk_data.low_latency_mode = !!ctrl->val;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR,
|
||||
"Unknown control %#x\n", ctrl->id);
|
||||
s_vpr_e(inst->sid, "Unknown control %#x\n", ctrl->id);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -930,7 +931,7 @@ int msm_vdec_set_frame_size(struct msm_vidc_inst *inst)
|
|||
struct v4l2_format *f;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
|
@ -939,12 +940,12 @@ int msm_vdec_set_frame_size(struct msm_vidc_inst *inst)
|
|||
frame_size.buffer_type = HFI_BUFFER_INPUT;
|
||||
frame_size.width = f->fmt.pix_mp.width;
|
||||
frame_size.height = f->fmt.pix_mp.height;
|
||||
dprintk(VIDC_HIGH, "%s: input wxh %dx%d\n", __func__,
|
||||
s_vpr_h(inst->sid, "%s: input wxh %dx%d\n", __func__,
|
||||
frame_size.width, frame_size.height);
|
||||
rc = call_hfi_op(hdev, session_set_property, inst->session,
|
||||
HFI_PROPERTY_PARAM_FRAME_SIZE, &frame_size, sizeof(frame_size));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: set property failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -956,7 +957,7 @@ int msm_vdec_set_color_format(struct msm_vidc_inst *inst)
|
|||
struct msm_vidc_format_constraint *fmt_constraint;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
|
@ -965,21 +966,20 @@ int msm_vdec_set_color_format(struct msm_vidc_inst *inst)
|
|||
msm_comm_get_hal_output_buffer(inst),
|
||||
inst->clk_data.opb_fourcc);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: set color format (%#x) failed\n",
|
||||
s_vpr_e(inst->sid, "%s: set color format (%#x) failed\n",
|
||||
__func__, inst->clk_data.opb_fourcc);
|
||||
return rc;
|
||||
}
|
||||
fmt_constraint = msm_comm_get_pixel_fmt_constraints(
|
||||
dec_pix_format_constraints,
|
||||
ARRAY_SIZE(dec_pix_format_constraints),
|
||||
inst->clk_data.opb_fourcc);
|
||||
inst->clk_data.opb_fourcc, inst->sid);
|
||||
if (fmt_constraint) {
|
||||
rc = msm_comm_set_color_format_constraints(inst,
|
||||
msm_comm_get_hal_output_buffer(inst),
|
||||
fmt_constraint);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: Set constraints for color format %#x failed\n",
|
||||
__func__, inst->clk_data.opb_fourcc);
|
||||
return rc;
|
||||
|
|
@ -997,7 +997,7 @@ int msm_vdec_set_input_buffer_counts(struct msm_vidc_inst *inst)
|
|||
enum hal_buffer buffer_type;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
|
@ -1009,7 +1009,7 @@ int msm_vdec_set_input_buffer_counts(struct msm_vidc_inst *inst)
|
|||
fmt->count_actual,
|
||||
buffer_type);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: failed to set bufreqs(%#x)\n",
|
||||
s_vpr_e(inst->sid, "%s: failed to set bufreqs(%#x)\n",
|
||||
__func__, buffer_type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1025,7 +1025,7 @@ int msm_vdec_set_output_buffer_counts(struct msm_vidc_inst *inst)
|
|||
enum hal_buffer buffer_type;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
|
@ -1043,7 +1043,7 @@ int msm_vdec_set_output_buffer_counts(struct msm_vidc_inst *inst)
|
|||
fmt->count_min,
|
||||
HAL_BUFFER_OUTPUT);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: failed to set buffer count(%#x)\n",
|
||||
__func__, buffer_type);
|
||||
return -EINVAL;
|
||||
|
|
@ -1054,7 +1054,7 @@ int msm_vdec_set_output_buffer_counts(struct msm_vidc_inst *inst)
|
|||
fmt->count_actual,
|
||||
buffer_type);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: failed to set bufreqs(%#x)\n",
|
||||
s_vpr_e(inst->sid, "%s: failed to set bufreqs(%#x)\n",
|
||||
__func__, buffer_type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1069,7 +1069,7 @@ int msm_vdec_set_profile_level(struct msm_vidc_inst *inst)
|
|||
struct hfi_profile_level profile_level;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
|
@ -1077,13 +1077,13 @@ int msm_vdec_set_profile_level(struct msm_vidc_inst *inst)
|
|||
profile_level.profile = inst->profile;
|
||||
profile_level.level = inst->level;
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: %#x %#x\n", __func__,
|
||||
s_vpr_h(inst->sid, "%s: %#x %#x\n", __func__,
|
||||
profile_level.profile, profile_level.level);
|
||||
rc = call_hfi_op(hdev, session_set_property, inst->session,
|
||||
HFI_PROPERTY_PARAM_PROFILE_LEVEL_CURRENT, &profile_level,
|
||||
sizeof(profile_level));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: set property failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1096,13 +1096,13 @@ int msm_vdec_set_output_order(struct msm_vidc_inst *inst)
|
|||
u32 output_order;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
||||
ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_DECODE_ORDER);
|
||||
dprintk(VIDC_HIGH, "%s: %d\n", __func__, ctrl->val);
|
||||
s_vpr_h(inst->sid, "%s: %d\n", __func__, ctrl->val);
|
||||
if (ctrl->val == V4L2_MPEG_MSM_VIDC_ENABLE)
|
||||
output_order = HFI_OUTPUT_ORDER_DECODE;
|
||||
else
|
||||
|
|
@ -1112,7 +1112,7 @@ int msm_vdec_set_output_order(struct msm_vidc_inst *inst)
|
|||
HFI_PROPERTY_PARAM_VDEC_OUTPUT_ORDER, &output_order,
|
||||
sizeof(u32));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: set property failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1125,7 +1125,7 @@ int msm_vdec_set_sync_frame_mode(struct msm_vidc_inst *inst)
|
|||
struct hfi_enable hfi_property;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
|
@ -1133,12 +1133,12 @@ int msm_vdec_set_sync_frame_mode(struct msm_vidc_inst *inst)
|
|||
ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_SYNC_FRAME_DECODE);
|
||||
hfi_property.enable = (bool)ctrl->val;
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: %#x\n", __func__, hfi_property.enable);
|
||||
s_vpr_h(inst->sid, "%s: %#x\n", __func__, hfi_property.enable);
|
||||
rc = call_hfi_op(hdev, session_set_property, inst->session,
|
||||
HFI_PROPERTY_PARAM_VDEC_THUMBNAIL_MODE, &hfi_property,
|
||||
sizeof(hfi_property));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: set property failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1151,7 +1151,7 @@ int msm_vdec_set_secure_mode(struct msm_vidc_inst *inst)
|
|||
u32 codec;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
|
@ -1164,18 +1164,18 @@ int msm_vdec_set_secure_mode(struct msm_vidc_inst *inst)
|
|||
codec == V4L2_PIX_FMT_H264 ||
|
||||
codec == V4L2_PIX_FMT_VP9 ||
|
||||
codec == V4L2_PIX_FMT_MPEG2)) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"%s: Secure allowed for HEVC/H264/VP9/MPEG2\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: %#x\n", __func__, ctrl->val);
|
||||
s_vpr_h(inst->sid, "%s: %#x\n", __func__, ctrl->val);
|
||||
rc = call_hfi_op(hdev, session_set_property, inst->session,
|
||||
HFI_PROPERTY_PARAM_SECURE_SESSION, &ctrl->val, sizeof(u32));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: set property failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1187,12 +1187,14 @@ int msm_vdec_set_output_stream_mode(struct msm_vidc_inst *inst)
|
|||
struct hfi_multi_stream multi_stream;
|
||||
struct hfi_frame_size frame_sz;
|
||||
struct v4l2_format *f;
|
||||
u32 sid;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
sid = inst->sid;
|
||||
|
||||
if (is_primary_output_mode(inst)) {
|
||||
multi_stream.buffer_type = HFI_BUFFER_OUTPUT;
|
||||
|
|
@ -1201,8 +1203,8 @@ int msm_vdec_set_output_stream_mode(struct msm_vidc_inst *inst)
|
|||
HFI_PROPERTY_PARAM_VDEC_MULTI_STREAM, &multi_stream,
|
||||
sizeof(multi_stream));
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: set prop multistream primary failed : %d\n",
|
||||
s_vpr_e(sid,
|
||||
"%s: set prop multistream primary failed: %d\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1212,7 +1214,7 @@ int msm_vdec_set_output_stream_mode(struct msm_vidc_inst *inst)
|
|||
HFI_PROPERTY_PARAM_VDEC_MULTI_STREAM, &multi_stream,
|
||||
sizeof(multi_stream));
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(sid,
|
||||
"%s: set prop multistream primary2 failed : %d\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
|
|
@ -1229,7 +1231,7 @@ int msm_vdec_set_output_stream_mode(struct msm_vidc_inst *inst)
|
|||
HFI_PROPERTY_PARAM_VDEC_MULTI_STREAM, &multi_stream,
|
||||
sizeof(multi_stream));
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(sid,
|
||||
"%s: set prop multistream secondary failed : %d\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
|
|
@ -1240,8 +1242,8 @@ int msm_vdec_set_output_stream_mode(struct msm_vidc_inst *inst)
|
|||
HFI_PROPERTY_PARAM_VDEC_MULTI_STREAM, &multi_stream,
|
||||
sizeof(multi_stream));
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: set prop multistream secondary2 failed : %d\n",
|
||||
s_vpr_e(sid,
|
||||
"%s: set prop multistream secondary2 failed: %d\n",
|
||||
__func__, rc);
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1249,15 +1251,14 @@ int msm_vdec_set_output_stream_mode(struct msm_vidc_inst *inst)
|
|||
f = &inst->fmts[OUTPUT_PORT].v4l2_fmt;
|
||||
frame_sz.width = f->fmt.pix_mp.width;
|
||||
frame_sz.height = f->fmt.pix_mp.height;
|
||||
dprintk(VIDC_HIGH,
|
||||
s_vpr_h(sid,
|
||||
"frame_size: hal buffer type %d, width %d, height %d\n",
|
||||
frame_sz.buffer_type, frame_sz.width, frame_sz.height);
|
||||
rc = call_hfi_op(hdev, session_set_property, inst->session,
|
||||
HFI_PROPERTY_PARAM_FRAME_SIZE, &frame_sz,
|
||||
sizeof(frame_sz));
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: set prop frame_size failed\n",
|
||||
s_vpr_e(sid, "%s: set prop frame_size failed\n",
|
||||
__func__);
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1273,19 +1274,19 @@ int msm_vdec_set_priority(struct msm_vidc_inst *inst)
|
|||
struct hfi_enable hfi_property;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
||||
hfi_property.enable = is_realtime_session(inst);
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: %#x\n", __func__, hfi_property.enable);
|
||||
s_vpr_h(inst->sid, "%s: %#x\n", __func__, hfi_property.enable);
|
||||
rc = call_hfi_op(hdev, session_set_property, inst->session,
|
||||
HFI_PROPERTY_CONFIG_REALTIME, &hfi_property,
|
||||
sizeof(hfi_property));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: set property failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1299,7 +1300,7 @@ int msm_vdec_set_conceal_color(struct msm_vidc_inst *inst)
|
|||
struct hfi_conceal_color conceal_color;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = inst->core->device;
|
||||
|
|
@ -1309,14 +1310,14 @@ int msm_vdec_set_conceal_color(struct msm_vidc_inst *inst)
|
|||
conceal_color.conceal_color_8bit = ctrl_8b->val;
|
||||
conceal_color.conceal_color_10bit = ctrl_10b->val;
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: %#x %#x\n", __func__,
|
||||
s_vpr_h(inst->sid, "%s: %#x %#x\n", __func__,
|
||||
conceal_color.conceal_color_8bit,
|
||||
conceal_color.conceal_color_10bit);
|
||||
rc = call_hfi_op(hdev, session_set_property, inst->session,
|
||||
HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR, &conceal_color,
|
||||
sizeof(conceal_color));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: set property failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1439,9 +1440,9 @@ int msm_vdec_set_properties(struct msm_vidc_inst *inst)
|
|||
|
||||
exit:
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s: failed with %d\n", __func__, rc);
|
||||
s_vpr_e(inst->sid, "%s: failed with %d\n", __func__, rc);
|
||||
else
|
||||
dprintk(VIDC_HIGH, "%s: set properties successful\n", __func__);
|
||||
s_vpr_h(inst->sid, "%s: set properties successful\n", __func__);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -383,7 +383,7 @@ int msm_vidc_get_decoder_internal_buffer_sizes(struct msm_vidc_inst *inst)
|
|||
struct v4l2_format *f;
|
||||
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "Instance is null!");
|
||||
d_vpr_e("%s: Instance is null!", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -405,8 +405,8 @@ int msm_vidc_get_decoder_internal_buffer_sizes(struct msm_vidc_inst *inst)
|
|||
dec_calculators = &mpeg2d_calculators;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR,
|
||||
"Invalid pix format. Internal buffer cal not defined : %x ",
|
||||
s_vpr_e(inst->sid,
|
||||
"Invalid pix format. Internal buffer cal not defined : %x\n",
|
||||
f->fmt.pix_mp.pixelformat);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -503,7 +503,7 @@ int msm_vidc_get_encoder_internal_buffer_sizes(struct msm_vidc_inst *inst)
|
|||
struct v4l2_format *f;
|
||||
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "Instance is null!");
|
||||
d_vpr_e("%s: Instance is null!", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -519,7 +519,7 @@ int msm_vidc_get_encoder_internal_buffer_sizes(struct msm_vidc_inst *inst)
|
|||
enc_calculators = &vp8e_calculators;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"Invalid pix format. Internal buffer cal not defined : %x ",
|
||||
f->fmt.pix_mp.pixelformat);
|
||||
return -EINVAL;
|
||||
|
|
@ -531,8 +531,7 @@ int msm_vidc_get_encoder_internal_buffer_sizes(struct msm_vidc_inst *inst)
|
|||
bframe = get_ctrl(inst, V4L2_CID_MPEG_VIDEO_B_FRAMES);
|
||||
num_bframes = bframe->val;
|
||||
if (num_bframes < 0) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: get num bframe failed\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: get num bframe failed\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -583,7 +582,7 @@ int msm_vidc_get_encoder_internal_buffer_sizes(struct msm_vidc_inst *inst)
|
|||
int msm_vidc_calculate_internal_buffer_sizes(struct msm_vidc_inst *inst)
|
||||
{
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "Instance is null!");
|
||||
d_vpr_e("%s: Instance is null!", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -617,7 +616,7 @@ int msm_vidc_calculate_input_buffer_count(struct msm_vidc_inst *inst)
|
|||
int extra_buff_count = 0;
|
||||
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
fmt = &inst->fmts[INPUT_PORT];
|
||||
|
|
@ -641,9 +640,9 @@ int msm_vidc_calculate_input_buffer_count(struct msm_vidc_inst *inst)
|
|||
fmt->count_min_host = fmt->count_actual =
|
||||
fmt->count_min + extra_buff_count;
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: %x : input min %d min_host %d actual %d\n",
|
||||
__func__, hash32_ptr(inst->session),
|
||||
fmt->count_min, fmt->count_min_host, fmt->count_actual);
|
||||
s_vpr_h(inst->sid, "%s: input min %d min_host %d actual %d\n",
|
||||
__func__, fmt->count_min,
|
||||
fmt->count_min_host, fmt->count_actual);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -655,7 +654,7 @@ int msm_vidc_calculate_output_buffer_count(struct msm_vidc_inst *inst)
|
|||
u32 codec, output_min_count;
|
||||
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
fmt = &inst->fmts[OUTPUT_PORT];
|
||||
|
|
@ -697,9 +696,9 @@ int msm_vidc_calculate_output_buffer_count(struct msm_vidc_inst *inst)
|
|||
fmt->count_min_host = fmt->count_actual =
|
||||
fmt->count_min + extra_buff_count;
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: %x : output min %d min_host %d actual %d\n",
|
||||
__func__, hash32_ptr(inst->session),
|
||||
fmt->count_min, fmt->count_min_host, fmt->count_actual);
|
||||
s_vpr_h(inst->sid, "%s: output min %d min_host %d actual %d\n",
|
||||
__func__, fmt->count_min, fmt->count_min_host,
|
||||
fmt->count_actual);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -722,7 +721,7 @@ int msm_vidc_get_extra_buff_count(struct msm_vidc_inst *inst,
|
|||
enum hal_buffer buffer_type)
|
||||
{
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s Invalid args\n", __func__);
|
||||
d_vpr_e("%s: Invalid args\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -744,7 +743,7 @@ static int msm_vidc_get_extra_input_buff_count(struct msm_vidc_inst *inst)
|
|||
struct v4l2_format *f;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -820,7 +819,7 @@ static int msm_vidc_get_extra_output_buff_count(struct msm_vidc_inst *inst)
|
|||
struct v4l2_format *f;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -914,10 +913,10 @@ u32 msm_vidc_calculate_dec_input_frame_size(struct msm_vidc_inst *inst)
|
|||
if (inst->buffer_size_limit &&
|
||||
(inst->buffer_size_limit < frame_size)) {
|
||||
frame_size = inst->buffer_size_limit;
|
||||
dprintk(VIDC_HIGH, "input buffer size limited to %d\n",
|
||||
s_vpr_h(inst->sid, "input buffer size limited to %d\n",
|
||||
frame_size);
|
||||
} else {
|
||||
dprintk(VIDC_HIGH, "set input buffer size to %d\n",
|
||||
s_vpr_h(inst->sid, "set input buffer size to %d\n",
|
||||
frame_size);
|
||||
}
|
||||
|
||||
|
|
@ -930,7 +929,8 @@ u32 msm_vidc_calculate_dec_output_frame_size(struct msm_vidc_inst *inst)
|
|||
struct v4l2_format *f;
|
||||
|
||||
f = &inst->fmts[OUTPUT_PORT].v4l2_fmt;
|
||||
hfi_fmt = msm_comm_convert_color_fmt(f->fmt.pix_mp.pixelformat);
|
||||
hfi_fmt = msm_comm_convert_color_fmt(f->fmt.pix_mp.pixelformat,
|
||||
inst->sid);
|
||||
return VENUS_BUFFER_SIZE(hfi_fmt, f->fmt.pix_mp.width,
|
||||
f->fmt.pix_mp.height);
|
||||
}
|
||||
|
|
@ -949,7 +949,8 @@ u32 msm_vidc_calculate_enc_input_frame_size(struct msm_vidc_inst *inst)
|
|||
struct v4l2_format *f;
|
||||
|
||||
f = &inst->fmts[INPUT_PORT].v4l2_fmt;
|
||||
hfi_fmt = msm_comm_convert_color_fmt(f->fmt.pix_mp.pixelformat);
|
||||
hfi_fmt = msm_comm_convert_color_fmt(f->fmt.pix_mp.pixelformat,
|
||||
inst->sid);
|
||||
return VENUS_BUFFER_SIZE(hfi_fmt, f->fmt.pix_mp.width,
|
||||
f->fmt.pix_mp.height);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ int calc_bw_iris2(struct vidc_bus_vote_data *vidc_data);
|
|||
|
||||
struct lut const *__lut(int width, int height, int fps);
|
||||
fp_t __compression_ratio(struct lut const *entry, int bpp);
|
||||
void __dump(struct dump dump[], int len);
|
||||
void __dump(struct dump dump[], int len, u32 sid);
|
||||
|
||||
static inline bool __ubwc(enum hal_uncompressed_format f)
|
||||
{
|
||||
|
|
@ -237,7 +237,7 @@ static inline bool __ubwc(enum hal_uncompressed_format f)
|
|||
}
|
||||
}
|
||||
|
||||
static inline int __bpp(enum hal_uncompressed_format f)
|
||||
static inline int __bpp(enum hal_uncompressed_format f, u32 sid)
|
||||
{
|
||||
switch (f) {
|
||||
case HAL_COLOR_FORMAT_NV12:
|
||||
|
|
@ -248,8 +248,7 @@ static inline int __bpp(enum hal_uncompressed_format f)
|
|||
case HAL_COLOR_FORMAT_P010:
|
||||
return 10;
|
||||
default:
|
||||
dprintk(VIDC_ERR,
|
||||
"Unsupported colorformat (%x)", f);
|
||||
s_vpr_e(sid, "Unsupported colorformat (%x)", f);
|
||||
return INT_MAX;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ fp_t __compression_ratio(struct lut const *entry, int bpp)
|
|||
return FP_ZERO; /* impossible */
|
||||
}
|
||||
|
||||
void __dump(struct dump dump[], int len)
|
||||
void __dump(struct dump dump[], int len, u32 sid)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ void __dump(struct dump dump[], int len)
|
|||
|
||||
}
|
||||
}
|
||||
dprintk(VIDC_BUS, "%s", formatted_line);
|
||||
s_vpr_b(sid, "%s", formatted_line);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -128,7 +128,8 @@ static unsigned long __calculate_decoder(struct vidc_bus_vote_data *d)
|
|||
|
||||
lcu_size = d->lcu_size;
|
||||
|
||||
dpb_bpp = d->num_formats >= 1 ? __bpp(d->color_formats[0]) : INT_MAX;
|
||||
dpb_bpp = d->num_formats >= 1 ?
|
||||
__bpp(d->color_formats[0], d->sid) : INT_MAX;
|
||||
|
||||
unified_dpb_opb = d->num_formats == 1;
|
||||
|
||||
|
|
@ -315,7 +316,7 @@ static unsigned long __calculate_decoder(struct vidc_bus_vote_data *d)
|
|||
{"llc line buffer write", DUMP_FP_FMT, llc.line_buffer_write},
|
||||
|
||||
};
|
||||
__dump(dump, ARRAY_SIZE(dump));
|
||||
__dump(dump, ARRAY_SIZE(dump), d->sid);
|
||||
}
|
||||
|
||||
d->calc_bw_ddr = kbps(fp_round(ddr.total));
|
||||
|
|
@ -403,7 +404,8 @@ static unsigned long __calculate_encoder(struct vidc_bus_vote_data *d)
|
|||
original_color_format = d->num_formats >= 1 ?
|
||||
d->color_formats[0] : HAL_UNUSED_COLOR;
|
||||
|
||||
dpb_bpp = d->num_formats >= 1 ? __bpp(d->color_formats[0]) : INT_MAX;
|
||||
dpb_bpp = d->num_formats >= 1 ?
|
||||
__bpp(d->color_formats[0], d->sid) : INT_MAX;
|
||||
|
||||
original_compression_enabled = __ubwc(original_color_format);
|
||||
|
||||
|
|
@ -603,7 +605,7 @@ static unsigned long __calculate_encoder(struct vidc_bus_vote_data *d)
|
|||
{"llc ref read crcb", DUMP_FP_FMT, llc.ref_read_crcb},
|
||||
{"llc line buffer", DUMP_FP_FMT, llc.line_buffer},
|
||||
};
|
||||
__dump(dump, ARRAY_SIZE(dump));
|
||||
__dump(dump, ARRAY_SIZE(dump), d->sid);
|
||||
}
|
||||
|
||||
d->calc_bw_ddr = kbps(fp_round(ddr.total));
|
||||
|
|
@ -630,7 +632,7 @@ static unsigned long __calculate(struct vidc_bus_vote_data *d)
|
|||
value = __calculate_cvp(d);
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR, "Unknown Domain");
|
||||
s_vpr_e(d->sid, "Unknown Domain %#x", d->domain);
|
||||
}
|
||||
|
||||
return value;
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ static unsigned long __calculate_decoder(struct vidc_bus_vote_data *d)
|
|||
|
||||
lcu_size = d->lcu_size;
|
||||
|
||||
dpb_bpp = __bpp(d->color_formats[0]);
|
||||
dpb_bpp = __bpp(d->color_formats[0], d->sid);
|
||||
|
||||
unified_dpb_opb = d->num_formats == 1;
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ static unsigned long __calculate_decoder(struct vidc_bus_vote_data *d)
|
|||
{"llc line buffer write", DUMP_FP_FMT, llc.line_buffer_write},
|
||||
|
||||
};
|
||||
__dump(dump, ARRAY_SIZE(dump));
|
||||
__dump(dump, ARRAY_SIZE(dump), d->sid);
|
||||
}
|
||||
|
||||
d->calc_bw_ddr = kbps(fp_round(ddr.total));
|
||||
|
|
@ -329,7 +329,7 @@ static unsigned long __calculate_encoder(struct vidc_bus_vote_data *d)
|
|||
DIV_ROUND_UP(height, lcu_size);
|
||||
tnbr_per_lcu = 16;
|
||||
|
||||
dpb_bpp = __bpp(d->color_formats[0]);
|
||||
dpb_bpp = __bpp(d->color_formats[0], d->sid);
|
||||
|
||||
y_bw_no_ubwc_8bpp = fp_div(FP_INT(width * height * fps),
|
||||
FP_INT(1000 * 1000));
|
||||
|
|
@ -507,7 +507,7 @@ static unsigned long __calculate_encoder(struct vidc_bus_vote_data *d)
|
|||
{"llc ref read crcb", DUMP_FP_FMT, llc.ref_read_crcb},
|
||||
{"llc line buffer", DUMP_FP_FMT, llc.line_buffer},
|
||||
};
|
||||
__dump(dump, ARRAY_SIZE(dump));
|
||||
__dump(dump, ARRAY_SIZE(dump), d->sid);
|
||||
}
|
||||
|
||||
d->calc_bw_ddr = kbps(fp_round(ddr.total));
|
||||
|
|
@ -534,7 +534,7 @@ static unsigned long __calculate(struct vidc_bus_vote_data *d)
|
|||
value = __calculate_cvp(d);
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR, "Unknown Domain");
|
||||
s_vpr_e(d->sid, "Unknown Domain %#x", d->domain);
|
||||
}
|
||||
|
||||
return value;
|
||||
|
|
|
|||
|
|
@ -242,15 +242,15 @@ static int fill_dynamic_stats(struct msm_vidc_inst *inst,
|
|||
vote_data->complexity_factor = max_cf;
|
||||
vote_data->input_cr = min_input_cr;
|
||||
|
||||
dprintk(VIDC_PERF,
|
||||
s_vpr_p(inst->sid,
|
||||
"Input CR = %d Recon CR = %d Complexity Factor = %d\n",
|
||||
vote_data->input_cr, vote_data->compression_ratio,
|
||||
vote_data->complexity_factor);
|
||||
vote_data->input_cr, vote_data->compression_ratio,
|
||||
vote_data->complexity_factor);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int msm_comm_set_buses(struct msm_vidc_core *core)
|
||||
int msm_comm_set_buses(struct msm_vidc_core *core, u32 sid)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_inst *inst = NULL;
|
||||
|
|
@ -258,7 +258,7 @@ int msm_comm_set_buses(struct msm_vidc_core *core)
|
|||
unsigned long total_bw_ddr = 0, total_bw_llcc = 0;
|
||||
|
||||
if (!core || !core->device) {
|
||||
dprintk(VIDC_ERR, "%s Invalid args: %pK\n", __func__, core);
|
||||
s_vpr_e(sid, "%s: Invalid args: %pK\n", __func__, core);
|
||||
return -EINVAL;
|
||||
}
|
||||
hdev = core->device;
|
||||
|
|
@ -282,8 +282,7 @@ int msm_comm_set_buses(struct msm_vidc_core *core)
|
|||
|
||||
if ((!filled_len || !device_addr) &&
|
||||
(inst->session_type != MSM_VIDC_CVP)) {
|
||||
dprintk(VIDC_LOW, "%s: no input for session %x\n",
|
||||
__func__, hash32_ptr(inst->session));
|
||||
s_vpr_l(sid, "%s: no input\n", __func__);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -297,7 +296,7 @@ int msm_comm_set_buses(struct msm_vidc_core *core)
|
|||
mutex_unlock(&core->lock);
|
||||
|
||||
rc = call_hfi_op(hdev, vote_bus, hdev->hfi_device_data,
|
||||
total_bw_ddr, total_bw_llcc);
|
||||
total_bw_ddr, total_bw_llcc, sid);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -316,7 +315,7 @@ int msm_comm_vote_bus(struct msm_vidc_inst *inst)
|
|||
int codec = 0;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s Invalid args: %pK\n", __func__, inst);
|
||||
d_vpr_e("%s: Invalid args: %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
|
|
@ -339,12 +338,12 @@ int msm_comm_vote_bus(struct msm_vidc_inst *inst)
|
|||
|
||||
if ((!filled_len || !device_addr) &&
|
||||
(inst->session_type != MSM_VIDC_CVP)) {
|
||||
dprintk(VIDC_LOW, "%s: no input for session %x\n",
|
||||
__func__, hash32_ptr(inst->session));
|
||||
s_vpr_l(inst->sid, "%s: no input\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
vote_data->domain = get_hal_domain(inst->session_type);
|
||||
vote_data->sid = inst->sid;
|
||||
vote_data->domain = get_hal_domain(inst->session_type, inst->sid);
|
||||
vote_data->power_mode = 0;
|
||||
if (inst->clk_data.buffer_counter < DCVS_FTB_WINDOW &&
|
||||
inst->session_type != MSM_VIDC_CVP)
|
||||
|
|
@ -369,12 +368,12 @@ int msm_comm_vote_bus(struct msm_vidc_inst *inst)
|
|||
codec = V4L2_PIX_FMT_CVP;
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR, "%s: invalid session_type %#x\n",
|
||||
s_vpr_e(inst->sid, "%s: invalid session_type %#x\n",
|
||||
__func__, inst->session_type);
|
||||
break;
|
||||
}
|
||||
|
||||
vote_data->codec = get_hal_codec(codec);
|
||||
vote_data->codec = get_hal_codec(codec, inst->sid);
|
||||
vote_data->input_width = inp_f->fmt.pix_mp.width;
|
||||
vote_data->input_height = inp_f->fmt.pix_mp.height;
|
||||
vote_data->output_width = out_f->fmt.pix_mp.width;
|
||||
|
|
@ -426,7 +425,7 @@ int msm_comm_vote_bus(struct msm_vidc_inst *inst)
|
|||
call_core_op(core, calc_bw, vote_data);
|
||||
}
|
||||
|
||||
rc = msm_comm_set_buses(core);
|
||||
rc = msm_comm_set_buses(core, inst->sid);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -440,12 +439,12 @@ static int msm_dcvs_scale_clocks(struct msm_vidc_inst *inst,
|
|||
struct clock_data *dcvs;
|
||||
|
||||
if (!inst || !inst->core || !inst->core->device) {
|
||||
dprintk(VIDC_ERR, "%s Invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!inst->clk_data.dcvs_mode || inst->batch.enable) {
|
||||
dprintk(VIDC_LOW, "Skip DCVS (dcvs %d, batching %d)\n",
|
||||
s_vpr_l(inst->sid, "Skip DCVS (dcvs %d, batching %d)\n",
|
||||
inst->clk_data.dcvs_mode, inst->batch.enable);
|
||||
inst->clk_data.dcvs_flags = 0;
|
||||
return 0;
|
||||
|
|
@ -491,23 +490,22 @@ static int msm_dcvs_scale_clocks(struct msm_vidc_inst *inst,
|
|||
dcvs->dcvs_flags |= MSM_VIDC_DCVS_DECR;
|
||||
}
|
||||
|
||||
dprintk(VIDC_PERF,
|
||||
"DCVS: %x: bufs_with_fw %d Th[%d %d %d] Flag %#x\n",
|
||||
hash32_ptr(inst->session), bufs_with_fw,
|
||||
dcvs->min_threshold, dcvs->nom_threshold, dcvs->max_threshold,
|
||||
s_vpr_p(inst->sid, "DCVS: bufs_with_fw %d Th[%d %d %d] Flag %#x\n",
|
||||
bufs_with_fw, dcvs->min_threshold,
|
||||
dcvs->nom_threshold, dcvs->max_threshold,
|
||||
dcvs->dcvs_flags);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static unsigned long msm_vidc_max_freq(struct msm_vidc_core *core)
|
||||
static unsigned long msm_vidc_max_freq(struct msm_vidc_core *core, u32 sid)
|
||||
{
|
||||
struct allowed_clock_rates_table *allowed_clks_tbl = NULL;
|
||||
unsigned long freq = 0;
|
||||
|
||||
allowed_clks_tbl = core->resources.allowed_clks_tbl;
|
||||
freq = allowed_clks_tbl[0].clock_rate;
|
||||
dprintk(VIDC_PERF, "Max rate = %lu\n", freq);
|
||||
s_vpr_p(sid, "Max rate = %lu\n", freq);
|
||||
return freq;
|
||||
}
|
||||
|
||||
|
|
@ -542,7 +540,7 @@ void msm_comm_update_input_cr(struct msm_vidc_inst *inst,
|
|||
if (!found) {
|
||||
temp = kzalloc(sizeof(*temp), GFP_KERNEL);
|
||||
if (!temp) {
|
||||
dprintk(VIDC_ERR, "%s: malloc failure.\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: malloc failure.\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
temp->index = index;
|
||||
|
|
@ -606,14 +604,14 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst,
|
|||
vsp_cycles += ((fps * filled_len * 8) * 10) / 7;
|
||||
|
||||
} else {
|
||||
dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__);
|
||||
return msm_vidc_max_freq(inst->core);
|
||||
s_vpr_e(inst->sid, "%s: Unknown session type\n", __func__);
|
||||
return msm_vidc_max_freq(inst->core, inst->sid);
|
||||
}
|
||||
|
||||
freq = max(vpp_cycles, vsp_cycles);
|
||||
freq = max(freq, fw_cycles);
|
||||
|
||||
dprintk(VIDC_LOW, "Update DCVS Load\n");
|
||||
s_vpr_l(inst->sid, "Update DCVS Load\n");
|
||||
allowed_clks_tbl = core->resources.allowed_clks_tbl;
|
||||
for (i = core->resources.allowed_clks_tbl_size - 1; i >= 0; i--) {
|
||||
rate = allowed_clks_tbl[i].clock_rate;
|
||||
|
|
@ -624,7 +622,7 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst,
|
|||
if (i < 0)
|
||||
i = 0;
|
||||
|
||||
dprintk(VIDC_PERF, "%s Inst %pK : Filled Len = %d Freq = %llu\n",
|
||||
s_vpr_p(inst->sid, "%s: Inst %pK : Filled Len = %d Freq = %llu\n",
|
||||
__func__, inst, filled_len, freq);
|
||||
|
||||
return (unsigned long) freq;
|
||||
|
|
@ -695,8 +693,8 @@ static unsigned long msm_vidc_calc_freq_iris1(struct msm_vidc_inst *inst,
|
|||
vsp_cycles += ((fps * filled_len * 8) * 10) / 5;
|
||||
|
||||
} else {
|
||||
dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__);
|
||||
return msm_vidc_max_freq(inst->core);
|
||||
s_vpr_e(inst->sid, "%s: Unknown session type\n", __func__);
|
||||
return msm_vidc_max_freq(inst->core, inst->sid);
|
||||
}
|
||||
|
||||
freq = max(vpp_cycles, vsp_cycles);
|
||||
|
|
@ -712,10 +710,8 @@ static unsigned long msm_vidc_calc_freq_iris1(struct msm_vidc_inst *inst,
|
|||
if (i < 0)
|
||||
i = 0;
|
||||
|
||||
dprintk(VIDC_PERF,
|
||||
"%s: inst %pK: %x : filled len %d required freq %llu\n",
|
||||
__func__, inst, hash32_ptr(inst->session),
|
||||
filled_len, freq);
|
||||
s_vpr_p(inst->sid, "%s: inst %pK: filled len %d required freq %llu\n",
|
||||
__func__, inst, filled_len, freq);
|
||||
|
||||
return (unsigned long) freq;
|
||||
}
|
||||
|
|
@ -792,8 +788,8 @@ static unsigned long msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst,
|
|||
/* vsp perf is about 0.5 bits/cycle */
|
||||
vsp_cycles += ((fps * filled_len * 8) * 10) / 5;
|
||||
} else {
|
||||
dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__);
|
||||
return msm_vidc_max_freq(inst->core);
|
||||
s_vpr_e(inst->sid, "%s: Unknown session type\n", __func__);
|
||||
return msm_vidc_max_freq(inst->core, inst->sid);
|
||||
}
|
||||
|
||||
freq = max(vpp_cycles, vsp_cycles);
|
||||
|
|
@ -809,15 +805,13 @@ static unsigned long msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst,
|
|||
if (i < 0)
|
||||
i = 0;
|
||||
|
||||
dprintk(VIDC_PERF,
|
||||
"%s: inst %pK: %x : filled len %d required freq %llu\n",
|
||||
__func__, inst, hash32_ptr(inst->session),
|
||||
filled_len, freq);
|
||||
s_vpr_p(inst->sid, "%s: inst %pK: filled len %d required freq %llu\n",
|
||||
__func__, inst, filled_len, freq);
|
||||
|
||||
return (unsigned long) freq;
|
||||
}
|
||||
|
||||
int msm_vidc_set_clocks(struct msm_vidc_core *core)
|
||||
int msm_vidc_set_clocks(struct msm_vidc_core *core, u32 sid)
|
||||
{
|
||||
struct hfi_device *hdev;
|
||||
unsigned long freq_core_1 = 0, freq_core_2 = 0, rate = 0;
|
||||
|
|
@ -832,8 +826,7 @@ int msm_vidc_set_clocks(struct msm_vidc_core *core)
|
|||
hdev = core->device;
|
||||
allowed_clks_tbl = core->resources.allowed_clks_tbl;
|
||||
if (!allowed_clks_tbl) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s Invalid parameters\n", __func__);
|
||||
s_vpr_e(sid, "%s: Invalid parameters\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -855,8 +848,7 @@ int msm_vidc_set_clocks(struct msm_vidc_core *core)
|
|||
mutex_unlock(&inst->registeredbufs.lock);
|
||||
|
||||
if (!filled_len || !device_addr) {
|
||||
dprintk(VIDC_LOW, "%s no input for session %x\n",
|
||||
__func__, hash32_ptr(inst->session));
|
||||
s_vpr_l(sid, "%s: no input\n", __func__);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -872,8 +864,7 @@ int msm_vidc_set_clocks(struct msm_vidc_core *core)
|
|||
freq_core_max = max_t(unsigned long, freq_core_1, freq_core_2);
|
||||
|
||||
if (msm_vidc_clock_voting) {
|
||||
dprintk(VIDC_PERF,
|
||||
"msm_vidc_clock_voting %d\n",
|
||||
s_vpr_p(sid, "msm_vidc_clock_voting %d\n",
|
||||
msm_vidc_clock_voting);
|
||||
freq_core_max = msm_vidc_clock_voting;
|
||||
decrement = false;
|
||||
|
|
@ -913,12 +904,12 @@ int msm_vidc_set_clocks(struct msm_vidc_core *core)
|
|||
core->curr_freq = rate;
|
||||
mutex_unlock(&core->lock);
|
||||
|
||||
dprintk(VIDC_PERF,
|
||||
s_vpr_p(sid,
|
||||
"%s: clock rate %lu requested %lu increment %d decrement %d\n",
|
||||
__func__, core->curr_freq, core->min_freq,
|
||||
increment, decrement);
|
||||
rc = call_hfi_op(hdev, scale_clocks,
|
||||
hdev->hfi_device_data, core->curr_freq);
|
||||
hdev->hfi_device_data, core->curr_freq, sid);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -932,8 +923,7 @@ int msm_comm_scale_clocks(struct msm_vidc_inst *inst)
|
|||
bool is_turbo = false;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s Invalid args: Inst = %pK\n",
|
||||
__func__, inst);
|
||||
d_vpr_e("%s: Invalid args: Inst = %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -953,14 +943,14 @@ int msm_comm_scale_clocks(struct msm_vidc_inst *inst)
|
|||
mutex_unlock(&inst->registeredbufs.lock);
|
||||
|
||||
if (!filled_len || !device_addr) {
|
||||
dprintk(VIDC_LOW, "%s no input for session %x\n",
|
||||
__func__, hash32_ptr(inst->session));
|
||||
s_vpr_l(inst->sid, "%s: no input\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (inst->clk_data.buffer_counter < DCVS_FTB_WINDOW || is_turbo ||
|
||||
msm_vidc_clock_voting) {
|
||||
inst->clk_data.min_freq = msm_vidc_max_freq(inst->core);
|
||||
inst->clk_data.min_freq =
|
||||
msm_vidc_max_freq(inst->core, inst->sid);
|
||||
inst->clk_data.dcvs_flags = 0;
|
||||
} else {
|
||||
freq = call_core_op(inst->core, calc_freq, inst, filled_len);
|
||||
|
|
@ -968,8 +958,7 @@ int msm_comm_scale_clocks(struct msm_vidc_inst *inst)
|
|||
/* update dcvs flags */
|
||||
msm_dcvs_scale_clocks(inst, freq);
|
||||
}
|
||||
|
||||
msm_vidc_set_clocks(inst->core);
|
||||
msm_vidc_set_clocks(inst->core, inst->sid);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -980,20 +969,20 @@ int msm_comm_scale_clocks_and_bus(struct msm_vidc_inst *inst, bool do_bw_calc)
|
|||
struct hfi_device *hdev;
|
||||
|
||||
if (!inst || !inst->core || !inst->core->device) {
|
||||
dprintk(VIDC_ERR, "%s Invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
hdev = core->device;
|
||||
|
||||
if (msm_comm_scale_clocks(inst)) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"Failed to scale clocks. May impact performance\n");
|
||||
}
|
||||
|
||||
if (do_bw_calc) {
|
||||
if (msm_comm_vote_bus(inst)) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"Failed to scale DDR bus. May impact perf\n");
|
||||
}
|
||||
}
|
||||
|
|
@ -1003,7 +992,7 @@ int msm_comm_scale_clocks_and_bus(struct msm_vidc_inst *inst, bool do_bw_calc)
|
|||
int msm_dcvs_try_enable(struct msm_vidc_inst *inst)
|
||||
{
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s: Invalid args: %p\n", __func__, inst);
|
||||
d_vpr_e("%s: Invalid args: %p\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -1016,7 +1005,7 @@ int msm_dcvs_try_enable(struct msm_vidc_inst *inst)
|
|||
is_turbo_session(inst) ||
|
||||
inst->rc_type == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ);
|
||||
|
||||
dprintk(VIDC_HIGH|VIDC_PERF, "DCVS %s: %pK\n",
|
||||
s_vpr_hp(inst->sid, "DCVS %s: %pK\n",
|
||||
inst->clk_data.dcvs_mode ? "enabled" : "disabled", inst);
|
||||
|
||||
return 0;
|
||||
|
|
@ -1028,13 +1017,13 @@ int msm_comm_init_clocks_and_bus_data(struct msm_vidc_inst *inst)
|
|||
int fourcc, count;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(VIDC_ERR, "%s Invalid args: Inst = %pK\n",
|
||||
d_vpr_e("%s: Invalid args: Inst = %pK\n",
|
||||
__func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->session_type == MSM_VIDC_CVP) {
|
||||
dprintk(VIDC_LOW, "%s: cvp session\n", __func__);
|
||||
s_vpr_l(inst->sid, "%s: cvp session\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1053,7 +1042,7 @@ int msm_comm_init_clocks_and_bus_data(struct msm_vidc_inst *inst)
|
|||
}
|
||||
|
||||
if (!inst->clk_data.entry) {
|
||||
dprintk(VIDC_ERR, "%s No match found\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: No match found\n", __func__);
|
||||
rc = -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -1070,13 +1059,12 @@ void msm_clock_data_reset(struct msm_vidc_inst *inst)
|
|||
struct clock_data *dcvs;
|
||||
struct msm_vidc_format *fmt;
|
||||
|
||||
dprintk(VIDC_HIGH, "Init DCVS Load\n");
|
||||
|
||||
if (!inst || !inst->core || !inst->clk_data.entry) {
|
||||
dprintk(VIDC_ERR, "%s Invalid args: Inst = %pK\n",
|
||||
d_vpr_e("%s: Invalid args: Inst = %pK\n",
|
||||
__func__, inst);
|
||||
return;
|
||||
}
|
||||
s_vpr_h(inst->sid, "Init DCVS Load\n");
|
||||
|
||||
core = inst->core;
|
||||
dcvs = &inst->clk_data;
|
||||
|
|
@ -1092,7 +1080,7 @@ void msm_clock_data_reset(struct msm_vidc_inst *inst)
|
|||
} else if (inst->session_type == MSM_VIDC_DECODER) {
|
||||
fmt = &inst->fmts[OUTPUT_PORT];
|
||||
} else {
|
||||
dprintk(VIDC_ERR, "%s: invalid session type %#x\n",
|
||||
s_vpr_e(inst->sid, "%s: invalid session type %#x\n",
|
||||
__func__, inst->session_type);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1124,7 +1112,7 @@ void msm_clock_data_reset(struct msm_vidc_inst *inst)
|
|||
rc = msm_comm_scale_clocks_and_bus(inst, 1);
|
||||
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "%s Failed to scale Clocks and Bus\n",
|
||||
s_vpr_e(inst->sid, "%s: Failed to scale Clocks and Bus\n",
|
||||
__func__);
|
||||
}
|
||||
|
||||
|
|
@ -1137,8 +1125,7 @@ int msm_vidc_decide_work_route_iris1(struct msm_vidc_inst *inst)
|
|||
u32 codec;
|
||||
|
||||
if (!inst || !inst->core || !inst->core->device) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s Invalid args: Inst = %pK\n",
|
||||
d_vpr_e("%s: Invalid args: Inst = %pK\n",
|
||||
__func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1188,7 +1175,7 @@ int msm_vidc_decide_work_route_iris1(struct msm_vidc_inst *inst)
|
|||
V4L2_MPEG_VIDEO_BITRATE_MODE_CBR_VFR &&
|
||||
mbps <= CBR_VFR_MB_LIMIT)) {
|
||||
pdata.video_work_route = 1;
|
||||
dprintk(VIDC_HIGH, "Configured work route = 1");
|
||||
s_vpr_h(inst->sid, "Configured work route = 1");
|
||||
}
|
||||
} else {
|
||||
return -EINVAL;
|
||||
|
|
@ -1201,8 +1188,7 @@ decision_done:
|
|||
(void *)inst->session, HFI_PROPERTY_PARAM_WORK_ROUTE,
|
||||
(void *)&pdata, sizeof(pdata));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR,
|
||||
" Failed to configure work route %pK\n", inst);
|
||||
s_vpr_e(inst->sid, "Failed to configure work route\n");
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1216,8 +1202,7 @@ int msm_vidc_decide_work_route_iris2(struct msm_vidc_inst *inst)
|
|||
u32 codec;
|
||||
|
||||
if (!inst || !inst->core || !inst->core->device) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s Invalid args: Inst = %pK\n",
|
||||
d_vpr_e("%s: Invalid args: Inst = %pK\n",
|
||||
__func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1249,15 +1234,14 @@ int msm_vidc_decide_work_route_iris2(struct msm_vidc_inst *inst)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
dprintk(VIDC_HIGH, "Configurng work route = %u",
|
||||
s_vpr_h(inst->sid, "Configurng work route = %u",
|
||||
pdata.video_work_route);
|
||||
|
||||
rc = call_hfi_op(hdev, session_set_property,
|
||||
(void *)inst->session, HFI_PROPERTY_PARAM_WORK_ROUTE,
|
||||
(void *)&pdata, sizeof(pdata));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR,
|
||||
" Failed to configure work route %pK\n", inst);
|
||||
s_vpr_e(inst->sid, "Failed to configure work route\n");
|
||||
else
|
||||
inst->clk_data.work_route = pdata.video_work_route;
|
||||
|
||||
|
|
@ -1273,8 +1257,7 @@ static int msm_vidc_decide_work_mode_ar50(struct msm_vidc_inst *inst)
|
|||
struct v4l2_format *f;
|
||||
|
||||
if (!inst || !inst->core || !inst->core->device) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s Invalid args: Inst = %pK\n",
|
||||
d_vpr_e("%s: Invalid args: Inst = %pK\n",
|
||||
__func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1312,8 +1295,7 @@ decision_done:
|
|||
(void *)inst->session, HFI_PROPERTY_PARAM_WORK_MODE,
|
||||
(void *)&pdata, sizeof(pdata));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR,
|
||||
" Failed to configure Work Mode %pK\n", inst);
|
||||
s_vpr_e(inst->sid, "Failed to configure Work Mode\n");
|
||||
|
||||
/* For WORK_MODE_1, set Low Latency mode by default to HW. */
|
||||
|
||||
|
|
@ -1342,8 +1324,7 @@ int msm_vidc_decide_work_mode_iris1(struct msm_vidc_inst *inst)
|
|||
u32 codec;
|
||||
|
||||
if (!inst || !inst->core || !inst->core->device) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s Invalid args: Inst = %pK\n",
|
||||
d_vpr_e("%s: Invalid args: Inst = %pK\n",
|
||||
__func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1352,7 +1333,7 @@ int msm_vidc_decide_work_mode_iris1(struct msm_vidc_inst *inst)
|
|||
|
||||
if (inst->clk_data.low_latency_mode) {
|
||||
pdata.video_work_mode = HFI_WORKMODE_1;
|
||||
dprintk(VIDC_HIGH, "Configured work mode = 1");
|
||||
s_vpr_h(inst->sid, "Configured work mode = 1");
|
||||
goto decision_done;
|
||||
}
|
||||
|
||||
|
|
@ -1396,8 +1377,8 @@ decision_done:
|
|||
(void *)inst->session, HFI_PROPERTY_PARAM_WORK_MODE,
|
||||
(void *)&pdata, sizeof(pdata));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR,
|
||||
" Failed to configure Work Mode %pK\n", inst);
|
||||
s_vpr_e(inst->sid, "Failed to configure Work Mode %u\n",
|
||||
pdata.video_work_mode);
|
||||
|
||||
/* For WORK_MODE_1, set Low Latency mode by default to HW. */
|
||||
|
||||
|
|
@ -1425,8 +1406,7 @@ int msm_vidc_decide_work_mode_iris2(struct msm_vidc_inst *inst)
|
|||
struct v4l2_format *inp_f;
|
||||
|
||||
if (!inst || !inst->core || !inst->core->device) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s Invalid args: Inst = %pK\n",
|
||||
d_vpr_e("%s: Invalid args: Inst = %pK\n",
|
||||
__func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1464,7 +1444,7 @@ int msm_vidc_decide_work_mode_iris2(struct msm_vidc_inst *inst)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
dprintk(VIDC_HIGH, "Configuring work mode = %u low latency = %u",
|
||||
s_vpr_h(inst->sid, "Configuring work mode = %u low latency = %u",
|
||||
pdata.video_work_mode,
|
||||
latency.enable);
|
||||
|
||||
|
|
@ -1474,8 +1454,7 @@ int msm_vidc_decide_work_mode_iris2(struct msm_vidc_inst *inst)
|
|||
HFI_PROPERTY_PARAM_VENC_LOW_LATENCY_MODE,
|
||||
(void *)&latency, sizeof(latency));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR,
|
||||
" Failed to configure low latency %pK\n", inst);
|
||||
s_vpr_e(inst->sid, "Failed to configure low latency\n");
|
||||
else
|
||||
inst->clk_data.low_latency_mode = latency.enable;
|
||||
}
|
||||
|
|
@ -1484,8 +1463,7 @@ int msm_vidc_decide_work_mode_iris2(struct msm_vidc_inst *inst)
|
|||
(void *)inst->session, HFI_PROPERTY_PARAM_WORK_MODE,
|
||||
(void *)&pdata, sizeof(pdata));
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR,
|
||||
" Failed to configure Work Mode %pK\n", inst);
|
||||
s_vpr_e(inst->sid, "Failed to configure Work Mode\n");
|
||||
else
|
||||
inst->clk_data.work_mode = pdata.video_work_mode;
|
||||
|
||||
|
|
@ -1503,9 +1481,9 @@ static inline int msm_vidc_power_save_mode_enable(struct msm_vidc_inst *inst,
|
|||
|
||||
hdev = inst->core->device;
|
||||
if (inst->session_type != MSM_VIDC_ENCODER) {
|
||||
dprintk(VIDC_LOW,
|
||||
"%s : Not an encoder session. Nothing to do\n",
|
||||
__func__);
|
||||
s_vpr_l(inst->sid,
|
||||
"%s: Not an encoder session. Nothing to do\n",
|
||||
__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1517,8 +1495,7 @@ static inline int msm_vidc_power_save_mode_enable(struct msm_vidc_inst *inst,
|
|||
(void *)inst->session, prop_id, pdata,
|
||||
sizeof(hfi_perf_mode));
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: Failed to set power save mode for inst: %pK\n",
|
||||
s_vpr_e(inst->sid, "%s: Failed to set power save mode\n",
|
||||
__func__, inst);
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1526,18 +1503,18 @@ static inline int msm_vidc_power_save_mode_enable(struct msm_vidc_inst *inst,
|
|||
inst->flags | VIDC_LOW_POWER :
|
||||
inst->flags & ~VIDC_LOW_POWER;
|
||||
|
||||
dprintk(VIDC_HIGH,
|
||||
s_vpr_h(inst->sid,
|
||||
"Power Save Mode for inst: %pK Enable = %d\n", inst, enable);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int msm_vidc_move_core_to_power_save_mode(struct msm_vidc_core *core,
|
||||
u32 core_id)
|
||||
u32 core_id, u32 sid)
|
||||
{
|
||||
struct msm_vidc_inst *inst = NULL;
|
||||
|
||||
dprintk(VIDC_HIGH, "Core %d : Moving all inst to LP mode\n", core_id);
|
||||
s_vpr_h(sid, "Core %d : Moving all inst to LP mode\n", core_id);
|
||||
mutex_lock(&core->lock);
|
||||
list_for_each_entry(inst, &core->instances, list) {
|
||||
if (inst->clk_data.core_id == core_id &&
|
||||
|
|
@ -1599,14 +1576,13 @@ int msm_vidc_decide_core_and_power_mode_iris1(struct msm_vidc_inst *inst)
|
|||
struct msm_vidc_core *core;
|
||||
|
||||
if (!inst || !inst->core || !inst->core->device) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s Invalid args: Inst = %pK\n",
|
||||
d_vpr_e("%s: Invalid args: Inst = %pK\n",
|
||||
__func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
core = inst->core;
|
||||
max_freq = msm_vidc_max_freq(inst->core);
|
||||
max_freq = msm_vidc_max_freq(inst->core, inst->sid);
|
||||
inst->clk_data.core_id = 0;
|
||||
|
||||
core_load = get_core_load(core, VIDC_CORE_ID_1, false, true);
|
||||
|
|
@ -1627,15 +1603,15 @@ int msm_vidc_decide_core_and_power_mode_iris1(struct msm_vidc_inst *inst)
|
|||
max_hq_mbpf = core->resources.max_hq_mbs_per_frame;
|
||||
max_hq_mbps = core->resources.max_hq_mbs_per_sec;
|
||||
|
||||
dprintk(VIDC_HIGH, "Core RT Load = %d LP Load = %d\n",
|
||||
s_vpr_h(inst->sid, "Core RT Load = %d LP Load = %d\n",
|
||||
core_load, core_lp_load);
|
||||
dprintk(VIDC_HIGH, "Max Load = %lu\n", max_freq);
|
||||
dprintk(VIDC_HIGH, "Current Load = %d Current LP Load = %d\n",
|
||||
s_vpr_h(inst->sid, "Max Load = %lu\n", max_freq);
|
||||
s_vpr_h(inst->sid, "Current Load = %d Current LP Load = %d\n",
|
||||
cur_inst_load, cur_inst_lp_load);
|
||||
|
||||
if (inst->rc_type == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ &&
|
||||
(core_load > max_freq || core_lp_load > max_freq)) {
|
||||
dprintk(VIDC_ERR,
|
||||
s_vpr_e(inst->sid,
|
||||
"CQ session - Core cannot support this load\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1647,16 +1623,17 @@ int msm_vidc_decide_core_and_power_mode_iris1(struct msm_vidc_inst *inst)
|
|||
} else if (cur_inst_lp_load + core_load <= max_freq) {
|
||||
msm_vidc_power_save_mode_enable(inst, true);
|
||||
} else if (cur_inst_lp_load + core_lp_load <= max_freq) {
|
||||
dprintk(VIDC_HIGH, "Moved all inst's to LP");
|
||||
msm_vidc_move_core_to_power_save_mode(core, VIDC_CORE_ID_1);
|
||||
s_vpr_h(inst->sid, "Moved all inst's to LP");
|
||||
msm_vidc_move_core_to_power_save_mode(core,
|
||||
VIDC_CORE_ID_1, inst->sid);
|
||||
} else {
|
||||
dprintk(VIDC_ERR, "Core cannot support this load\n");
|
||||
s_vpr_e(inst->sid, "Core cannot support this load\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
inst->clk_data.core_id = VIDC_CORE_ID_1;
|
||||
rc = msm_comm_scale_clocks_and_bus(inst, 1);
|
||||
msm_print_core_status(core, VIDC_CORE_ID_1);
|
||||
msm_print_core_status(core, VIDC_CORE_ID_1, inst->sid);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -1666,7 +1643,7 @@ int msm_vidc_decide_core_and_power_mode_iris2(struct msm_vidc_inst *inst)
|
|||
bool enable = true;
|
||||
|
||||
inst->clk_data.core_id = VIDC_CORE_ID_1;
|
||||
msm_print_core_status(inst->core, VIDC_CORE_ID_1);
|
||||
msm_print_core_status(inst->core, VIDC_CORE_ID_1, inst->sid);
|
||||
|
||||
/* Power saving always disabled for CQ and LOSSLESS RC modes. */
|
||||
mbpf = msm_vidc_get_mbs_per_frame(inst);
|
||||
|
|
@ -1696,22 +1673,21 @@ void msm_vidc_init_core_clk_ops(struct msm_vidc_core *core)
|
|||
core->core_ops = &core_ops_iris2;
|
||||
}
|
||||
|
||||
void msm_print_core_status(struct msm_vidc_core *core, u32 core_id)
|
||||
void msm_print_core_status(struct msm_vidc_core *core, u32 core_id, u32 sid)
|
||||
{
|
||||
struct msm_vidc_inst *inst = NULL;
|
||||
struct v4l2_format *out_f;
|
||||
struct v4l2_format *inp_f;
|
||||
|
||||
dprintk(VIDC_PERF, "Instances running on core %u", core_id);
|
||||
s_vpr_p(sid, "Instances running on core %u", core_id);
|
||||
mutex_lock(&core->lock);
|
||||
list_for_each_entry(inst, &core->instances, list) {
|
||||
|
||||
if ((inst->clk_data.core_id != core_id) &&
|
||||
(inst->clk_data.core_id != VIDC_CORE_ID_3))
|
||||
continue;
|
||||
out_f = &inst->fmts[OUTPUT_PORT].v4l2_fmt;
|
||||
inp_f = &inst->fmts[INPUT_PORT].v4l2_fmt;
|
||||
dprintk(VIDC_PERF,
|
||||
s_vpr_p(sid,
|
||||
"inst %pK (%4ux%4u) to (%4ux%4u) %3u %s %s %u %s %s %lu\n",
|
||||
inst,
|
||||
inp_f->fmt.pix_mp.width,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "msm_vidc_internal.h"
|
||||
|
||||
void msm_clock_data_reset(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_set_clocks(struct msm_vidc_core *core);
|
||||
int msm_vidc_set_clocks(struct msm_vidc_core *core, u32 sid);
|
||||
int msm_comm_vote_bus(struct msm_vidc_inst *inst);
|
||||
int msm_dcvs_try_enable(struct msm_vidc_inst *inst);
|
||||
bool res_is_less_than(u32 width, u32 height, u32 ref_width, u32 ref_height);
|
||||
|
|
@ -27,7 +27,7 @@ int msm_vidc_decide_work_route_iris2(struct msm_vidc_inst *inst);
|
|||
int msm_vidc_decide_work_mode_iris2(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_decide_core_and_power_mode_iris1(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_decide_core_and_power_mode_iris2(struct msm_vidc_inst *inst);
|
||||
void msm_print_core_status(struct msm_vidc_core *core, u32 core_id);
|
||||
void msm_print_core_status(struct msm_vidc_core *core, u32 core_id, u32 sid);
|
||||
void msm_comm_free_input_cr_table(struct msm_vidc_inst *inst);
|
||||
void msm_comm_update_input_cr(struct msm_vidc_inst *inst, u32 index,
|
||||
u32 cr);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -69,12 +69,12 @@ static inline struct v4l2_ctrl *get_ctrl(struct msm_vidc_inst *inst,
|
|||
if (inst->ctrls[i]->id == id)
|
||||
return inst->ctrls[i];
|
||||
}
|
||||
dprintk(VIDC_ERR, "%s: control id (%#x) not found\n", __func__, id);
|
||||
s_vpr_e(inst->sid, "%s: control id (%#x) not found\n", __func__, id);
|
||||
MSM_VIDC_ERROR(true);
|
||||
return inst->ctrls[0];
|
||||
}
|
||||
|
||||
static inline void update_ctrl(struct v4l2_ctrl *ctrl, s32 val)
|
||||
static inline void update_ctrl(struct v4l2_ctrl *ctrl, s32 val, u32 sid)
|
||||
{
|
||||
switch (ctrl->type) {
|
||||
case V4L2_CTRL_TYPE_INTEGER:
|
||||
|
|
@ -83,7 +83,7 @@ static inline void update_ctrl(struct v4l2_ctrl *ctrl, s32 val)
|
|||
ctrl->elems * ctrl->elem_size);
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR, "unhandled control type");
|
||||
s_vpr_e(sid, "unhandled control type");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -172,15 +172,15 @@ enum hal_buffer get_hal_buffer_type(unsigned int type,
|
|||
unsigned int plane_num);
|
||||
void put_inst(struct msm_vidc_inst *inst);
|
||||
struct msm_vidc_inst *get_inst(struct msm_vidc_core *core,
|
||||
void *session_id);
|
||||
void *inst_id);
|
||||
void change_inst_state(struct msm_vidc_inst *inst, enum instance_state state);
|
||||
struct msm_vidc_core *get_vidc_core(int core_id);
|
||||
const struct msm_vidc_format_desc *msm_comm_get_pixel_fmt_index(
|
||||
const struct msm_vidc_format_desc fmt[], int size, int index);
|
||||
const struct msm_vidc_format_desc fmt[], int size, int index, u32 sid);
|
||||
struct msm_vidc_format_desc *msm_comm_get_pixel_fmt_fourcc(
|
||||
struct msm_vidc_format_desc fmt[], int size, int fourcc);
|
||||
struct msm_vidc_format_desc fmt[], int size, int fourcc, u32 sid);
|
||||
struct msm_vidc_format_constraint *msm_comm_get_pixel_fmt_constraints(
|
||||
struct msm_vidc_format_constraint fmt[], int size, int fourcc);
|
||||
struct msm_vidc_format_constraint fmt[], int size, int fourcc, u32 sid);
|
||||
int msm_comm_set_color_format_constraints(struct msm_vidc_inst *inst,
|
||||
enum hal_buffer buffer_type,
|
||||
struct msm_vidc_format_constraint *pix_constraint);
|
||||
|
|
@ -232,9 +232,9 @@ int msm_comm_smem_alloc(struct msm_vidc_inst *inst, size_t size, u32 align,
|
|||
void msm_comm_smem_free(struct msm_vidc_inst *inst, struct msm_smem *smem);
|
||||
int msm_comm_smem_cache_operations(struct msm_vidc_inst *inst,
|
||||
struct msm_smem *mem, enum smem_cache_ops cache_ops);
|
||||
enum hal_video_codec get_hal_codec(int fourcc);
|
||||
enum hal_domain get_hal_domain(int session_type);
|
||||
int msm_comm_check_core_init(struct msm_vidc_core *core);
|
||||
enum hal_video_codec get_hal_codec(int fourcc, u32 sid);
|
||||
enum hal_domain get_hal_domain(int session_type, u32 sid);
|
||||
int msm_comm_check_core_init(struct msm_vidc_core *core, u32 sid);
|
||||
int msm_comm_get_inst_load(struct msm_vidc_inst *inst,
|
||||
enum load_calc_quirks quirks);
|
||||
int msm_comm_get_inst_load_per_core(struct msm_vidc_inst *inst,
|
||||
|
|
@ -253,15 +253,15 @@ int msm_comm_ctrl_deinit(struct msm_vidc_inst *inst);
|
|||
void msm_comm_cleanup_internal_buffers(struct msm_vidc_inst *inst);
|
||||
bool msm_comm_turbo_session(struct msm_vidc_inst *inst);
|
||||
void msm_comm_print_inst_info(struct msm_vidc_inst *inst);
|
||||
int msm_comm_v4l2_to_hfi(int id, int value);
|
||||
int msm_comm_hfi_to_v4l2(int id, int value);
|
||||
int msm_comm_get_v4l2_profile(int fourcc, int profile);
|
||||
int msm_comm_get_v4l2_level(int fourcc, int level);
|
||||
int msm_comm_v4l2_to_hfi(int id, int value, u32 sid);
|
||||
int msm_comm_hfi_to_v4l2(int id, int value, u32 sid);
|
||||
int msm_comm_get_v4l2_profile(int fourcc, int profile, u32 sid);
|
||||
int msm_comm_get_v4l2_level(int fourcc, int level, u32 sid);
|
||||
int msm_comm_session_continue(void *instance);
|
||||
int msm_vidc_send_pending_eos_buffers(struct msm_vidc_inst *inst);
|
||||
enum hal_uncompressed_format msm_comm_get_hal_uncompressed(int fourcc);
|
||||
u32 msm_comm_get_hfi_uncompressed(int fourcc);
|
||||
u32 msm_comm_convert_color_fmt(u32 v4l2_fmt);
|
||||
u32 msm_comm_get_hfi_uncompressed(int fourcc, u32 sid);
|
||||
u32 msm_comm_convert_color_fmt(u32 v4l2_fmt, u32 sid);
|
||||
struct vb2_buffer *msm_comm_get_vb_using_vidc_buffer(
|
||||
struct msm_vidc_inst *inst, struct msm_vidc_buffer *mbuf);
|
||||
struct msm_vidc_buffer *msm_comm_get_buffer_using_device_planes(
|
||||
|
|
@ -286,9 +286,9 @@ bool msm_comm_compare_vb2_plane(struct msm_vidc_inst *inst,
|
|||
struct msm_vidc_buffer *mbuf, struct vb2_buffer *vb2, u32 i);
|
||||
bool msm_comm_compare_vb2_planes(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_buffer *mbuf, struct vb2_buffer *vb2);
|
||||
bool msm_comm_compare_device_plane(struct msm_vidc_buffer *mbuf,
|
||||
bool msm_comm_compare_device_plane(u32 sid, struct msm_vidc_buffer *mbuf,
|
||||
u32 type, u32 *planes, u32 i);
|
||||
bool msm_comm_compare_device_planes(struct msm_vidc_buffer *mbuf,
|
||||
bool msm_comm_compare_device_planes(u32 sid, struct msm_vidc_buffer *mbuf,
|
||||
u32 type, u32 *planes);
|
||||
int msm_comm_qbuf_cache_operations(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_buffer *mbuf);
|
||||
|
|
@ -296,16 +296,14 @@ int msm_comm_dqbuf_cache_operations(struct msm_vidc_inst *inst,
|
|||
struct msm_vidc_buffer *mbuf);
|
||||
void print_vidc_buffer(u32 tag, const char *str, struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_buffer *mbuf);
|
||||
void print_vb2_buffer(u32 tag, const char *str, struct msm_vidc_inst *inst,
|
||||
void print_vb2_buffer(const char *str, struct msm_vidc_inst *inst,
|
||||
struct vb2_buffer *vb2);
|
||||
void print_v4l2_buffer(u32 tag, const char *str, struct msm_vidc_inst *inst,
|
||||
struct v4l2_buffer *v4l2);
|
||||
void kref_put_mbuf(struct msm_vidc_buffer *mbuf);
|
||||
bool kref_get_mbuf(struct msm_vidc_inst *inst, struct msm_vidc_buffer *mbuf);
|
||||
void msm_comm_store_input_tag(struct msm_vidc_list *data_list,
|
||||
u32 index, u32 itag, u32 itag2);
|
||||
u32 index, u32 itag, u32 itag2, u32 sid);
|
||||
int msm_comm_fetch_input_tag(struct msm_vidc_list *data_list,
|
||||
u32 index, u32 *itag, u32 *itag2);
|
||||
u32 index, u32 *itag, u32 *itag2, u32 sid);
|
||||
int msm_comm_release_input_tag(struct msm_vidc_inst *inst);
|
||||
struct msm_vidc_client_data *msm_comm_store_client_data(
|
||||
struct msm_vidc_inst *inst, u32 itag);
|
||||
|
|
|
|||
|
|
@ -58,13 +58,13 @@ static ssize_t core_info_read(struct file *file, char __user *buf,
|
|||
ssize_t len = 0;
|
||||
|
||||
if (!core || !core->device) {
|
||||
dprintk(VIDC_ERR, "Invalid params, core: %pK\n", core);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, core);
|
||||
return 0;
|
||||
}
|
||||
|
||||
dbuf = kzalloc(MAX_DBG_BUF_SIZE, GFP_KERNEL);
|
||||
if (!dbuf) {
|
||||
dprintk(VIDC_ERR, "%s: Allocation failed!\n", __func__);
|
||||
d_vpr_e("%s: Allocation failed!\n", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
cur = dbuf;
|
||||
|
|
@ -77,7 +77,7 @@ static ssize_t core_info_read(struct file *file, char __user *buf,
|
|||
cur += write_str(cur, end - cur, "Core state: %d\n", core->state);
|
||||
rc = call_hfi_op(hdev, get_fw_info, hdev->hfi_device_data, &fw_info);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to read FW info\n");
|
||||
d_vpr_e("Failed to read FW info\n");
|
||||
goto err_fw_info;
|
||||
}
|
||||
|
||||
|
|
@ -130,14 +130,14 @@ static ssize_t trigger_ssr_write(struct file *filp, const char __user *buf,
|
|||
size = count;
|
||||
|
||||
if (copy_from_user(kbuf, buf, size)) {
|
||||
dprintk(VIDC_ERR, "%s User memory fault\n", __func__);
|
||||
d_vpr_e("%s: User memory fault\n", __func__);
|
||||
rc = -EFAULT;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
rc = kstrtoul(kbuf, 0, &ssr_trigger_val);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "returning error err %d\n", rc);
|
||||
d_vpr_e("returning error err %d\n", rc);
|
||||
rc = -EINVAL;
|
||||
} else {
|
||||
msm_vidc_trigger_ssr(core, ssr_trigger_val);
|
||||
|
|
@ -161,28 +161,27 @@ static ssize_t debug_level_write(struct file *filp, const char __user *buf,
|
|||
|
||||
/* filter partial writes and invalid commands */
|
||||
if (*ppos != 0 || count >= sizeof(kbuf) || count == 0) {
|
||||
dprintk(VIDC_ERR, "returning error - pos %d, count %d\n",
|
||||
*ppos, count);
|
||||
d_vpr_e("returning error - pos %d, count %d\n", *ppos, count);
|
||||
rc = -EINVAL;
|
||||
}
|
||||
|
||||
rc = simple_write_to_buffer(kbuf, sizeof(kbuf) - 1, ppos, buf, count);
|
||||
if (rc < 0) {
|
||||
dprintk(VIDC_ERR, "%s User memory fault\n", __func__);
|
||||
d_vpr_e("%s: User memory fault\n", __func__);
|
||||
rc = -EFAULT;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
rc = kstrtoint(kbuf, 0, &msm_vidc_debug);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "returning error err %d\n", rc);
|
||||
d_vpr_e("returning error err %d\n", rc);
|
||||
rc = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
core->resources.msm_vidc_hw_rsp_timeout =
|
||||
((msm_vidc_debug & 0xFF) > (VIDC_ERR | VIDC_HIGH)) ? 1500 : 1000;
|
||||
rc = count;
|
||||
dprintk(VIDC_HIGH, "debug timeout updated to - %d\n",
|
||||
d_vpr_h("debug timeout updated to - %d\n",
|
||||
core->resources.msm_vidc_hw_rsp_timeout);
|
||||
|
||||
exit:
|
||||
|
|
@ -220,7 +219,7 @@ struct dentry *msm_vidc_debugfs_init_drv(void)
|
|||
struct dentry *f = debugfs_create_##__type(__name, 0644, \
|
||||
dir, __value); \
|
||||
if (IS_ERR_OR_NULL(f)) { \
|
||||
dprintk(VIDC_ERR, "Failed creating debugfs file '%pd/%s'\n", \
|
||||
d_vpr_e("Failed creating debugfs file '%pd/%s'\n", \
|
||||
dir, __name); \
|
||||
f = NULL; \
|
||||
} \
|
||||
|
|
@ -261,28 +260,28 @@ struct dentry *msm_vidc_debugfs_init_core(struct msm_vidc_core *core,
|
|||
char debugfs_name[MAX_DEBUGFS_NAME];
|
||||
|
||||
if (!core) {
|
||||
dprintk(VIDC_ERR, "Invalid params, core: %pK\n", core);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
goto failed_create_dir;
|
||||
}
|
||||
|
||||
snprintf(debugfs_name, MAX_DEBUGFS_NAME, "core%d", core->id);
|
||||
dir = debugfs_create_dir(debugfs_name, parent);
|
||||
if (!dir) {
|
||||
dprintk(VIDC_ERR, "Failed to create debugfs for msm_vidc\n");
|
||||
d_vpr_e("Failed to create debugfs for msm_vidc\n");
|
||||
goto failed_create_dir;
|
||||
}
|
||||
if (!debugfs_create_file("info", 0444, dir, core, &core_info_fops)) {
|
||||
dprintk(VIDC_ERR, "debugfs_create_file: fail\n");
|
||||
d_vpr_e("debugfs_create_file: fail\n");
|
||||
goto failed_create_dir;
|
||||
}
|
||||
if (!debugfs_create_file("trigger_ssr", 0200,
|
||||
dir, core, &ssr_fops)) {
|
||||
dprintk(VIDC_ERR, "debugfs_create_file: fail\n");
|
||||
d_vpr_e("debugfs_create_file: fail\n");
|
||||
goto failed_create_dir;
|
||||
}
|
||||
if (!debugfs_create_file("debug_level", 0644,
|
||||
parent, core, &debug_level_fops)) {
|
||||
dprintk(VIDC_ERR, "debugfs_create_file: fail\n");
|
||||
d_vpr_e("debugfs_create_file: fail\n");
|
||||
goto failed_create_dir;
|
||||
}
|
||||
failed_create_dir:
|
||||
|
|
@ -291,7 +290,7 @@ failed_create_dir:
|
|||
|
||||
static int inst_info_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
dprintk(VIDC_LOW, "Open inode ptr: %pK\n", inode->i_private);
|
||||
d_vpr_l("Open inode ptr: %pK\n", inode->i_private);
|
||||
file->private_data = inode->i_private;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -303,7 +302,7 @@ static int publish_unreleased_reference(struct msm_vidc_inst *inst,
|
|||
char *cur = *dbuf;
|
||||
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "%s: invalid param\n", __func__);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -350,7 +349,7 @@ static ssize_t inst_info_read(struct file *file, char __user *buf,
|
|||
struct v4l2_format *f;
|
||||
|
||||
if (!idata || !idata->core || !idata->inst) {
|
||||
dprintk(VIDC_ERR, "%s: Invalid params\n", __func__);
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, idata);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -367,13 +366,13 @@ static ssize_t inst_info_read(struct file *file, char __user *buf,
|
|||
mutex_unlock(&core->lock);
|
||||
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "%s: Instance has become obsolete", __func__);
|
||||
d_vpr_e("%s: Instance has become obsolete", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
dbuf = kzalloc(MAX_DBG_BUF_SIZE, GFP_KERNEL);
|
||||
if (!dbuf) {
|
||||
dprintk(VIDC_ERR, "%s: Allocation failed!\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: Allocation failed!\n", __func__);
|
||||
len = -ENOMEM;
|
||||
goto failed_alloc;
|
||||
}
|
||||
|
|
@ -453,7 +452,7 @@ failed_alloc:
|
|||
|
||||
static int inst_info_release(struct inode *inode, struct file *file)
|
||||
{
|
||||
dprintk(VIDC_LOW, "Release inode ptr: %pK\n", inode->i_private);
|
||||
d_vpr_l("Release inode ptr: %pK\n", inode->i_private);
|
||||
file->private_data = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -472,14 +471,14 @@ struct dentry *msm_vidc_debugfs_init_inst(struct msm_vidc_inst *inst,
|
|||
struct core_inst_pair *idata = NULL;
|
||||
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "Invalid params, inst: %pK\n", inst);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
snprintf(debugfs_name, MAX_DEBUGFS_NAME, "inst_%p", inst);
|
||||
|
||||
idata = kzalloc(sizeof(struct core_inst_pair), GFP_KERNEL);
|
||||
if (!idata) {
|
||||
dprintk(VIDC_ERR, "%s: Allocation failed!\n", __func__);
|
||||
s_vpr_e(inst->sid, "%s: Allocation failed!\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
|
@ -488,14 +487,14 @@ struct dentry *msm_vidc_debugfs_init_inst(struct msm_vidc_inst *inst,
|
|||
|
||||
dir = debugfs_create_dir(debugfs_name, parent);
|
||||
if (!dir) {
|
||||
dprintk(VIDC_ERR, "Failed to create debugfs for msm_vidc\n");
|
||||
s_vpr_e(inst->sid, "Failed to create debugfs for msm_vidc\n");
|
||||
goto failed_create_dir;
|
||||
}
|
||||
|
||||
info = debugfs_create_file("info", 0444, dir,
|
||||
idata, &inst_info_fops);
|
||||
if (!info) {
|
||||
dprintk(VIDC_ERR, "debugfs_create_file: fail\n");
|
||||
s_vpr_e(inst->sid, "debugfs_create_file: fail\n");
|
||||
goto failed_create_file;
|
||||
}
|
||||
|
||||
|
|
@ -521,7 +520,7 @@ void msm_vidc_debugfs_deinit_inst(struct msm_vidc_inst *inst)
|
|||
|
||||
dentry = inst->debugfs_root;
|
||||
if (dentry->d_inode) {
|
||||
dprintk(VIDC_LOW, "Destroy %pK\n", dentry->d_inode->i_private);
|
||||
s_vpr_l(inst->sid, "Destroy %pK\n", dentry->d_inode->i_private);
|
||||
kfree(dentry->d_inode->i_private);
|
||||
dentry->d_inode->i_private = NULL;
|
||||
}
|
||||
|
|
@ -553,10 +552,10 @@ void msm_vidc_debugfs_update(struct msm_vidc_inst *inst,
|
|||
inst->count.ftb, inst->count.fbd);
|
||||
if (inst->count.ebd && inst->count.ebd == inst->count.etb) {
|
||||
toc(inst, FRAME_PROCESSING);
|
||||
dprintk(VIDC_PERF, "EBD: FW needs input buffers\n");
|
||||
s_vpr_p(inst->sid, "EBD: FW needs input buffers\n");
|
||||
}
|
||||
if (inst->count.ftb == inst->count.fbd)
|
||||
dprintk(VIDC_PERF, "EBD: FW needs output buffers\n");
|
||||
s_vpr_p(inst->sid, "EBD: FW needs output buffers\n");
|
||||
break;
|
||||
case MSM_VIDC_DEBUGFS_EVENT_FTB: {
|
||||
inst->count.ftb++;
|
||||
|
|
@ -578,13 +577,13 @@ void msm_vidc_debugfs_update(struct msm_vidc_inst *inst,
|
|||
if (inst->count.fbd &&
|
||||
inst->count.fbd == inst->count.ftb) {
|
||||
toc(inst, FRAME_PROCESSING);
|
||||
dprintk(VIDC_PERF, "FBD: FW needs output buffers\n");
|
||||
s_vpr_p(inst->sid, "FBD: FW needs output buffers\n");
|
||||
}
|
||||
if (inst->count.etb == inst->count.ebd)
|
||||
dprintk(VIDC_PERF, "FBD: FW needs input buffers\n");
|
||||
s_vpr_p(inst->sid, "FBD: FW needs input buffers\n");
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR, "Invalid state in debugfs: %d\n", e);
|
||||
s_vpr_e(inst->sid, "Invalid state in debugfs: %d\n", e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@
|
|||
#define VIDC_DBG_SESSION_RATELIMIT_INTERVAL (1 * HZ)
|
||||
#define VIDC_DBG_SESSION_RATELIMIT_BURST 6
|
||||
|
||||
#define VIDC_DBG_TAG VIDC_DBG_LABEL ": %4s: "
|
||||
#define VIDC_DBG_TAG VIDC_DBG_LABEL ": %6s: %8x: "
|
||||
#define DEFAULT_SID ((u32)-1)
|
||||
|
||||
/* To enable messages OR these values and
|
||||
* echo the result to debugfs file.
|
||||
|
|
@ -68,7 +69,7 @@ extern bool msm_vidc_syscache_disable;
|
|||
extern bool msm_vidc_lossless_encode;
|
||||
extern bool msm_vidc_cvp_usage;
|
||||
|
||||
#define dprintk(__level, __fmt, ...) \
|
||||
#define dprintk(__level, sid, __fmt, ...) \
|
||||
do { \
|
||||
if (msm_vidc_debug & __level) { \
|
||||
if (msm_vidc_debug & VIDC_FTRACE) { \
|
||||
|
|
@ -77,6 +78,7 @@ extern bool msm_vidc_cvp_usage;
|
|||
MAX_TRACER_LOG_LENGTH, \
|
||||
VIDC_DBG_TAG __fmt, \
|
||||
get_debug_level_str(__level), \
|
||||
sid, \
|
||||
##__VA_ARGS__); \
|
||||
trace_msm_vidc_printf(trace_logbuf, \
|
||||
log_length); \
|
||||
|
|
@ -84,11 +86,34 @@ extern bool msm_vidc_cvp_usage;
|
|||
if (msm_vidc_debug & VIDC_PRINTK) { \
|
||||
pr_info(VIDC_DBG_TAG __fmt, \
|
||||
get_debug_level_str(__level), \
|
||||
sid, \
|
||||
##__VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define s_vpr_e(sid, __fmt, ...) dprintk(VIDC_ERR, sid, __fmt, ##__VA_ARGS__)
|
||||
#define s_vpr_h(sid, __fmt, ...) dprintk(VIDC_HIGH, sid, __fmt, ##__VA_ARGS__)
|
||||
#define s_vpr_l(sid, __fmt, ...) dprintk(VIDC_LOW, sid, __fmt, ##__VA_ARGS__)
|
||||
#define s_vpr_p(sid, __fmt, ...) dprintk(VIDC_PERF, sid, __fmt, ##__VA_ARGS__)
|
||||
#define s_vpr_t(sid, __fmt, ...) dprintk(VIDC_PKT, sid, __fmt, ##__VA_ARGS__)
|
||||
#define s_vpr_b(sid, __fmt, ...) dprintk(VIDC_BUS, sid, __fmt, ##__VA_ARGS__)
|
||||
#define s_vpr_hp(sid, __fmt, ...) \
|
||||
dprintk(VIDC_HIGH|VIDC_PERF, sid, __fmt, ##__VA_ARGS__)
|
||||
|
||||
#define d_vpr_e(__fmt, ...) \
|
||||
dprintk(VIDC_ERR, DEFAULT_SID, __fmt, ##__VA_ARGS__)
|
||||
#define d_vpr_h(__fmt, ...) \
|
||||
dprintk(VIDC_HIGH, DEFAULT_SID, __fmt, ##__VA_ARGS__)
|
||||
#define d_vpr_l(__fmt, ...) \
|
||||
dprintk(VIDC_LOW, DEFAULT_SID, __fmt, ##__VA_ARGS__)
|
||||
#define d_vpr_p(__fmt, ...) \
|
||||
dprintk(VIDC_PERF, DEFAULT_SID, __fmt, ##__VA_ARGS__)
|
||||
#define d_vpr_t(__fmt, ...) \
|
||||
dprintk(VIDC_PKT, DEFAULT_SID, __fmt, ##__VA_ARGS__)
|
||||
#define d_vpr_b(__fmt, ...) \
|
||||
dprintk(VIDC_BUS, DEFAULT_SID, __fmt, ##__VA_ARGS__)
|
||||
|
||||
#define dprintk_firmware(__level, __fmt, ...) \
|
||||
do { \
|
||||
if (__level & FW_FTRACE) { \
|
||||
|
|
@ -111,13 +136,13 @@ extern bool msm_vidc_cvp_usage;
|
|||
#define dprintk_ratelimit(__level, __fmt, arg...) \
|
||||
do { \
|
||||
if (msm_vidc_check_ratelimit()) { \
|
||||
dprintk(__level, __fmt, arg); \
|
||||
dprintk(__level, DEFAULT_SID, __fmt, arg); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define MSM_VIDC_ERROR(value) \
|
||||
do { if (value) \
|
||||
dprintk(VIDC_ERR, "BugOn"); \
|
||||
d_vpr_e("BugOn"); \
|
||||
BUG_ON(value); \
|
||||
} while (0)
|
||||
|
||||
|
|
@ -136,20 +161,20 @@ static inline char *get_debug_level_str(int level)
|
|||
{
|
||||
switch (level) {
|
||||
case VIDC_ERR:
|
||||
return "err";
|
||||
return "err ";
|
||||
case VIDC_HIGH|VIDC_PERF:
|
||||
case VIDC_HIGH:
|
||||
return "high";
|
||||
case VIDC_LOW:
|
||||
return "low";
|
||||
return "low ";
|
||||
case VIDC_PERF:
|
||||
return "perf";
|
||||
case VIDC_PKT:
|
||||
return "pkt";
|
||||
return "pkt ";
|
||||
case VIDC_BUS:
|
||||
return "bus";
|
||||
return "bus ";
|
||||
default:
|
||||
return "???";
|
||||
return "????";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -192,15 +217,14 @@ static inline void show_stats(struct msm_vidc_inst *i)
|
|||
if (i->debug.pdata[x].name[0] &&
|
||||
(msm_vidc_debug & VIDC_PERF)) {
|
||||
if (i->debug.samples) {
|
||||
dprintk(VIDC_PERF, "%s averaged %d ms/sample\n",
|
||||
s_vpr_p(i->sid, "%s averaged %d ms/sample\n",
|
||||
i->debug.pdata[x].name,
|
||||
i->debug.pdata[x].cumulative /
|
||||
i->debug.samples);
|
||||
}
|
||||
|
||||
dprintk(VIDC_PERF, "%s Samples: %d\n",
|
||||
i->debug.pdata[x].name,
|
||||
i->debug.samples);
|
||||
s_vpr_p(i->sid, "%s Samples: %d\n",
|
||||
i->debug.pdata[x].name, i->debug.samples);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -419,6 +419,7 @@ struct clock_data {
|
|||
};
|
||||
|
||||
struct vidc_bus_vote_data {
|
||||
u32 sid;
|
||||
enum hal_domain domain;
|
||||
enum hal_video_codec codec;
|
||||
enum hal_uncompressed_format color_formats[2];
|
||||
|
|
@ -509,6 +510,7 @@ struct msm_vidc_inst {
|
|||
struct msm_vidc_core *core;
|
||||
enum session_type session_type;
|
||||
void *session;
|
||||
u32 sid;
|
||||
struct msm_cvp_external *cvp;
|
||||
struct session_prop prop;
|
||||
enum instance_state state;
|
||||
|
|
@ -620,18 +622,19 @@ struct msm_vidc_cvp_buffer {
|
|||
void msm_comm_handle_thermal_event(void);
|
||||
int msm_smem_alloc(size_t size, u32 align, u32 flags,
|
||||
enum hal_buffer buffer_type, int map_kernel,
|
||||
void *res, u32 session_type, struct msm_smem *smem);
|
||||
int msm_smem_free(struct msm_smem *smem);
|
||||
void *res, u32 session_type, struct msm_smem *smem, u32 sid);
|
||||
int msm_smem_free(struct msm_smem *smem, u32 sid);
|
||||
|
||||
struct context_bank_info *msm_smem_get_context_bank(u32 session_type,
|
||||
bool is_secure, struct msm_vidc_platform_resources *res,
|
||||
enum hal_buffer buffer_type);
|
||||
enum hal_buffer buffer_type, u32 sid);
|
||||
int msm_smem_map_dma_buf(struct msm_vidc_inst *inst, struct msm_smem *smem);
|
||||
int msm_smem_unmap_dma_buf(struct msm_vidc_inst *inst, struct msm_smem *smem);
|
||||
struct dma_buf *msm_smem_get_dma_buf(int fd);
|
||||
void msm_smem_put_dma_buf(void *dma_buf);
|
||||
struct dma_buf *msm_smem_get_dma_buf(int fd, u32 sid);
|
||||
void msm_smem_put_dma_buf(void *dma_buf, u32 sid);
|
||||
int msm_smem_cache_operations(struct dma_buf *dbuf,
|
||||
enum smem_cache_ops cache_op, unsigned long offset, unsigned long size);
|
||||
enum smem_cache_ops cache_op, unsigned long offset,
|
||||
unsigned long size, u32 sid);
|
||||
void msm_vidc_fw_unload_handler(struct work_struct *work);
|
||||
void msm_vidc_ssr_handler(struct work_struct *work);
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1126,8 +1126,7 @@ static int msm_vidc_read_efuse(
|
|||
base = devm_ioremap(dev, (efuse_data[i]).start_address,
|
||||
(efuse_data[i]).size);
|
||||
if (!base) {
|
||||
dprintk(VIDC_ERR,
|
||||
"failed efuse ioremap: res->start %#x, size %d\n",
|
||||
d_vpr_e("failed efuse: start %#x, size %d\n",
|
||||
(efuse_data[i]).start_address,
|
||||
(efuse_data[i]).size);
|
||||
return -EINVAL;
|
||||
|
|
@ -1138,8 +1137,7 @@ static int msm_vidc_read_efuse(
|
|||
data->sku_version =
|
||||
(efuse & (efuse_data[i]).mask) >>
|
||||
(efuse_data[i]).shift;
|
||||
dprintk(VIDC_HIGH,
|
||||
"efuse 0x%x, platform version 0x%x\n",
|
||||
d_vpr_h("efuse 0x%x, platform version 0x%x\n",
|
||||
efuse, data->sku_version);
|
||||
|
||||
devm_iounmap(dev, base);
|
||||
|
|
@ -1186,10 +1184,9 @@ void *vidc_get_drv_data(struct device *dev)
|
|||
} else if (!strcmp(match->compatible, "qcom,kona-vidc")) {
|
||||
ddr_type = of_fdt_get_ddrtype();
|
||||
if (ddr_type == -ENOENT) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to get ddr type, use LPDDR5\n");
|
||||
d_vpr_e("Failed to get ddr type, use LPDDR5\n");
|
||||
}
|
||||
dprintk(VIDC_HIGH, "DDR Type %x\n", ddr_type);
|
||||
d_vpr_h("DDR Type %x\n", ddr_type);
|
||||
|
||||
if (driver_data->ubwc_config &&
|
||||
(ddr_type == DDR_TYPE_LPDDR4 ||
|
||||
|
|
|
|||
|
|
@ -33,15 +33,13 @@ static size_t get_u32_array_num_elements(struct device_node *np,
|
|||
size_t num_elements = 0;
|
||||
|
||||
if (!of_get_property(np, name, &len)) {
|
||||
dprintk(VIDC_ERR, "Failed to read %s from device tree\n",
|
||||
name);
|
||||
d_vpr_e("Failed to read %s from device tree\n", name);
|
||||
goto fail_read;
|
||||
}
|
||||
|
||||
num_elements = len / sizeof(u32);
|
||||
if (num_elements <= 0) {
|
||||
dprintk(VIDC_ERR, "%s not specified in device tree\n",
|
||||
name);
|
||||
d_vpr_e("%s not specified in device tree\n", name);
|
||||
goto fail_read;
|
||||
}
|
||||
return num_elements;
|
||||
|
|
@ -143,7 +141,7 @@ static int msm_vidc_load_reg_table(struct msm_vidc_platform_resources *res)
|
|||
* qcom,reg-presets is an optional property. It likely won't be
|
||||
* present if we don't have any register settings to program
|
||||
*/
|
||||
dprintk(VIDC_HIGH, "qcom,reg-presets not found\n");
|
||||
d_vpr_h("reg-presets not found\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -153,29 +151,26 @@ static int msm_vidc_load_reg_table(struct msm_vidc_platform_resources *res)
|
|||
reg_set->count /= sizeof(*reg_set->reg_tbl) / sizeof(u32);
|
||||
|
||||
if (!reg_set->count) {
|
||||
dprintk(VIDC_HIGH, "no elements in reg set\n");
|
||||
d_vpr_h("no elements in reg set\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
reg_set->reg_tbl = devm_kzalloc(&pdev->dev, reg_set->count *
|
||||
sizeof(*(reg_set->reg_tbl)), GFP_KERNEL);
|
||||
if (!reg_set->reg_tbl) {
|
||||
dprintk(VIDC_ERR, "%s Failed to alloc register table\n",
|
||||
__func__);
|
||||
d_vpr_e("%s: Failed to alloc register table\n", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (of_property_read_u32_array(pdev->dev.of_node, "qcom,reg-presets",
|
||||
(u32 *)reg_set->reg_tbl, reg_set->count * 2)) {
|
||||
dprintk(VIDC_ERR, "Failed to read register table\n");
|
||||
d_vpr_e("Failed to read register table\n");
|
||||
msm_vidc_free_reg_table(res);
|
||||
return -EINVAL;
|
||||
}
|
||||
for (i = 0; i < reg_set->count; i++) {
|
||||
dprintk(VIDC_HIGH,
|
||||
"reg = %x, value = %x\n",
|
||||
reg_set->reg_tbl[i].reg,
|
||||
reg_set->reg_tbl[i].value
|
||||
d_vpr_h("reg = %x, value = %x\n",
|
||||
reg_set->reg_tbl[i].reg, reg_set->reg_tbl[i].value
|
||||
);
|
||||
}
|
||||
return rc;
|
||||
|
|
@ -192,7 +187,7 @@ static int msm_vidc_load_qdss_table(struct msm_vidc_platform_resources *res)
|
|||
* qcom,qdss-presets is an optional property. It likely won't be
|
||||
* present if we don't have any register settings to program
|
||||
*/
|
||||
dprintk(VIDC_HIGH, "qcom,qdss-presets not found\n");
|
||||
d_vpr_h("qdss-presets not found\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -202,7 +197,7 @@ static int msm_vidc_load_qdss_table(struct msm_vidc_platform_resources *res)
|
|||
qdss_addr_set->count /= sizeof(*qdss_addr_set->addr_tbl) / sizeof(u32);
|
||||
|
||||
if (!qdss_addr_set->count) {
|
||||
dprintk(VIDC_HIGH, "no elements in qdss reg set\n");
|
||||
d_vpr_h("no elements in qdss reg set\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -210,8 +205,7 @@ static int msm_vidc_load_qdss_table(struct msm_vidc_platform_resources *res)
|
|||
qdss_addr_set->count * sizeof(*qdss_addr_set->addr_tbl),
|
||||
GFP_KERNEL);
|
||||
if (!qdss_addr_set->addr_tbl) {
|
||||
dprintk(VIDC_ERR, "%s Failed to alloc register table\n",
|
||||
__func__);
|
||||
d_vpr_e("%s: Failed to alloc register table\n", __func__);
|
||||
rc = -ENOMEM;
|
||||
goto err_qdss_addr_tbl;
|
||||
}
|
||||
|
|
@ -219,14 +213,14 @@ static int msm_vidc_load_qdss_table(struct msm_vidc_platform_resources *res)
|
|||
rc = of_property_read_u32_array(pdev->dev.of_node, "qcom,qdss-presets",
|
||||
(u32 *)qdss_addr_set->addr_tbl, qdss_addr_set->count * 2);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to read qdss address table\n");
|
||||
d_vpr_e("Failed to read qdss address table\n");
|
||||
msm_vidc_free_qdss_addr_table(res);
|
||||
rc = -EINVAL;
|
||||
goto err_qdss_addr_tbl;
|
||||
}
|
||||
|
||||
for (i = 0; i < qdss_addr_set->count; i++) {
|
||||
dprintk(VIDC_HIGH, "qdss addr = %x, value = %x\n",
|
||||
d_vpr_h("qdss addr = %x, value = %x\n",
|
||||
qdss_addr_set->addr_tbl[i].start,
|
||||
qdss_addr_set->addr_tbl[i].size);
|
||||
}
|
||||
|
|
@ -243,21 +237,20 @@ static int msm_vidc_load_subcache_info(struct msm_vidc_platform_resources *res)
|
|||
num_subcaches = of_property_count_strings(pdev->dev.of_node,
|
||||
"cache-slice-names");
|
||||
if (num_subcaches <= 0) {
|
||||
dprintk(VIDC_HIGH, "No subcaches found\n");
|
||||
d_vpr_h("No subcaches found\n");
|
||||
goto err_load_subcache_table_fail;
|
||||
}
|
||||
|
||||
subcaches->subcache_tbl = devm_kzalloc(&pdev->dev,
|
||||
sizeof(*subcaches->subcache_tbl) * num_subcaches, GFP_KERNEL);
|
||||
if (!subcaches->subcache_tbl) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to allocate memory for subcache tbl\n");
|
||||
d_vpr_e("Failed to allocate memory for subcache tbl\n");
|
||||
rc = -ENOMEM;
|
||||
goto err_load_subcache_table_fail;
|
||||
}
|
||||
|
||||
subcaches->count = num_subcaches;
|
||||
dprintk(VIDC_HIGH, "Found %d subcaches\n", num_subcaches);
|
||||
d_vpr_h("Found %d subcaches\n", num_subcaches);
|
||||
|
||||
for (c = 0; c < num_subcaches; ++c) {
|
||||
struct subcache_info *vsc = &res->subcache_set.subcache_tbl[c];
|
||||
|
|
@ -303,26 +296,26 @@ int msm_vidc_load_u32_table(struct platform_device *pdev,
|
|||
u32 *ptbl = NULL;
|
||||
|
||||
if (!of_find_property(of_node, table_name, NULL)) {
|
||||
dprintk(VIDC_HIGH, "%s not found\n", table_name);
|
||||
d_vpr_h("%s not found\n", table_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
num_elemts = get_u32_array_num_elements(of_node, table_name);
|
||||
if (!num_elemts) {
|
||||
dprintk(VIDC_ERR, "no elements in %s\n", table_name);
|
||||
d_vpr_e("no elements in %s\n", table_name);
|
||||
return 0;
|
||||
}
|
||||
num_elemts /= struct_size / sizeof(u32);
|
||||
|
||||
ptbl = devm_kzalloc(&pdev->dev, num_elemts * struct_size, GFP_KERNEL);
|
||||
if (!ptbl) {
|
||||
dprintk(VIDC_ERR, "Failed to alloc table %s\n", table_name);
|
||||
d_vpr_e("Failed to alloc table %s\n", table_name);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (of_property_read_u32_array(of_node, table_name, ptbl,
|
||||
num_elemts * struct_size / sizeof(u32))) {
|
||||
dprintk(VIDC_ERR, "Failed to read %s\n", table_name);
|
||||
d_vpr_e("Failed to read %s\n", table_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -350,7 +343,7 @@ static int msm_vidc_load_allowed_clocks_table(
|
|||
|
||||
if (!of_find_property(pdev->dev.of_node,
|
||||
"qcom,allowed-clock-rates", NULL)) {
|
||||
dprintk(VIDC_HIGH, "qcom,allowed-clock-rates not found\n");
|
||||
d_vpr_h("allowed-clock-rates not found\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -360,8 +353,7 @@ static int msm_vidc_load_allowed_clocks_table(
|
|||
(u32 **)&res->allowed_clks_tbl,
|
||||
&res->allowed_clks_tbl_size);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: failed to read allowed clocks table\n", __func__);
|
||||
d_vpr_e("%s: failed to read allowed clocks table\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -391,7 +383,7 @@ static int msm_vidc_populate_bus(struct device *dev,
|
|||
temp_table = krealloc(buses->bus_tbl, sizeof(*temp_table) *
|
||||
(buses->count + 1), GFP_KERNEL);
|
||||
if (!temp_table) {
|
||||
dprintk(VIDC_ERR, "%s: Failed to allocate memory", __func__);
|
||||
d_vpr_e("%s: Failed to allocate memory", __func__);
|
||||
rc = -ENOMEM;
|
||||
goto err_bus;
|
||||
}
|
||||
|
|
@ -403,7 +395,7 @@ static int msm_vidc_populate_bus(struct device *dev,
|
|||
|
||||
rc = of_property_read_string(dev->of_node, "label", &temp_name);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "'label' not found in node\n");
|
||||
d_vpr_e("'label' not found in node\n");
|
||||
goto err_bus;
|
||||
}
|
||||
/* need a non-const version of name, hence copying it over */
|
||||
|
|
@ -416,13 +408,13 @@ static int msm_vidc_populate_bus(struct device *dev,
|
|||
rc = of_property_read_u32(dev->of_node, "qcom,bus-master",
|
||||
&bus->master);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "'qcom,bus-master' not found in node\n");
|
||||
d_vpr_e("'bus-master' not found in node\n");
|
||||
goto err_bus;
|
||||
}
|
||||
|
||||
rc = of_property_read_u32(dev->of_node, "qcom,bus-slave", &bus->slave);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "'qcom,bus-slave' not found in node\n");
|
||||
d_vpr_e("'bus-slave' not found in node\n");
|
||||
goto err_bus;
|
||||
}
|
||||
|
||||
|
|
@ -436,8 +428,7 @@ static int msm_vidc_populate_bus(struct device *dev,
|
|||
range, ARRAY_SIZE(range));
|
||||
if (rc) {
|
||||
rc = 0;
|
||||
dprintk(VIDC_HIGH,
|
||||
"'qcom,range' not found defaulting to <0 INT_MAX>\n");
|
||||
d_vpr_h("'bus-range' not found defaulting to <0 INT_MAX>\n");
|
||||
range[0] = 0;
|
||||
range[1] = INT_MAX;
|
||||
}
|
||||
|
|
@ -447,7 +438,7 @@ static int msm_vidc_populate_bus(struct device *dev,
|
|||
|
||||
buses->count++;
|
||||
bus->dev = dev;
|
||||
dprintk(VIDC_HIGH, "Found bus %s [%d->%d] with mode %s\n",
|
||||
d_vpr_h("Found bus %s [%d->%d] with mode %s\n",
|
||||
bus->name, bus->master, bus->slave, bus->mode);
|
||||
err_bus:
|
||||
return rc;
|
||||
|
|
@ -467,7 +458,7 @@ static int msm_vidc_load_buffer_usage_table(
|
|||
* likely won't be present if the core doesn't support content
|
||||
* protection
|
||||
*/
|
||||
dprintk(VIDC_HIGH, "buffer-type-tz-usage-table not found\n");
|
||||
d_vpr_h("buffer-type-tz-usage-table not found\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -476,7 +467,7 @@ static int msm_vidc_load_buffer_usage_table(
|
|||
buffer_usage_set->count /=
|
||||
sizeof(*buffer_usage_set->buffer_usage_tbl) / sizeof(u32);
|
||||
if (!buffer_usage_set->count) {
|
||||
dprintk(VIDC_HIGH, "no elements in buffer usage set\n");
|
||||
d_vpr_h("no elements in buffer usage set\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -485,7 +476,7 @@ static int msm_vidc_load_buffer_usage_table(
|
|||
sizeof(*buffer_usage_set->buffer_usage_tbl),
|
||||
GFP_KERNEL);
|
||||
if (!buffer_usage_set->buffer_usage_tbl) {
|
||||
dprintk(VIDC_ERR, "%s Failed to alloc buffer usage table\n",
|
||||
d_vpr_e("%s: Failed to alloc buffer usage table\n",
|
||||
__func__);
|
||||
rc = -ENOMEM;
|
||||
goto err_load_buf_usage;
|
||||
|
|
@ -497,7 +488,7 @@ static int msm_vidc_load_buffer_usage_table(
|
|||
buffer_usage_set->count *
|
||||
sizeof(*buffer_usage_set->buffer_usage_tbl) / sizeof(u32));
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to read buffer usage table\n");
|
||||
d_vpr_e("Failed to read buffer usage table\n");
|
||||
goto err_load_buf_usage;
|
||||
}
|
||||
|
||||
|
|
@ -542,8 +533,7 @@ static int msm_vidc_load_regulator_table(
|
|||
|
||||
if (!regulators->regulator_tbl) {
|
||||
rc = -ENOMEM;
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to alloc memory for regulator table\n");
|
||||
d_vpr_e("Failed to alloc memory for regulator table\n");
|
||||
goto err_reg_tbl_alloc;
|
||||
}
|
||||
|
||||
|
|
@ -565,8 +555,8 @@ static int msm_vidc_load_regulator_table(
|
|||
regulator_node = of_parse_phandle(domains_parent_node,
|
||||
domains_property->name, 0);
|
||||
if (IS_ERR(regulator_node)) {
|
||||
dprintk(VIDC_ERR, "%s is not a phandle\n",
|
||||
domains_property->name);
|
||||
d_vpr_e("%s is not a phandle\n",
|
||||
domains_property->name);
|
||||
continue;
|
||||
}
|
||||
regulators->count++;
|
||||
|
|
@ -577,8 +567,7 @@ static int msm_vidc_load_regulator_table(
|
|||
(supply - domains_property->name) + 1, GFP_KERNEL);
|
||||
if (!rinfo->name) {
|
||||
rc = -ENOMEM;
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to alloc memory for regulator name\n");
|
||||
d_vpr_e("Failed to alloc memory for regulator name\n");
|
||||
goto err_reg_name_alloc;
|
||||
}
|
||||
strlcpy(rinfo->name, domains_property->name,
|
||||
|
|
@ -587,13 +576,13 @@ static int msm_vidc_load_regulator_table(
|
|||
rinfo->has_hw_power_collapse = of_property_read_bool(
|
||||
regulator_node, "qcom,support-hw-trigger");
|
||||
|
||||
dprintk(VIDC_HIGH, "Found regulator %s: h/w collapse = %s\n",
|
||||
d_vpr_h("Found regulator %s: h/w collapse = %s\n",
|
||||
rinfo->name,
|
||||
rinfo->has_hw_power_collapse ? "yes" : "no");
|
||||
}
|
||||
|
||||
if (!regulators->count)
|
||||
dprintk(VIDC_HIGH, "No regulators found");
|
||||
d_vpr_h("No regulators found");
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
@ -614,7 +603,7 @@ static int msm_vidc_load_clock_table(
|
|||
num_clocks = of_property_count_strings(pdev->dev.of_node,
|
||||
"clock-names");
|
||||
if (num_clocks <= 0) {
|
||||
dprintk(VIDC_HIGH, "No clocks found\n");
|
||||
d_vpr_h("No clocks found\n");
|
||||
clocks->count = 0;
|
||||
rc = 0;
|
||||
goto err_load_clk_table_fail;
|
||||
|
|
@ -623,7 +612,7 @@ static int msm_vidc_load_clock_table(
|
|||
clock_props = devm_kzalloc(&pdev->dev, num_clocks *
|
||||
sizeof(*clock_props), GFP_KERNEL);
|
||||
if (!clock_props) {
|
||||
dprintk(VIDC_ERR, "No memory to read clock properties\n");
|
||||
d_vpr_e("No memory to read clock properties\n");
|
||||
rc = -ENOMEM;
|
||||
goto err_load_clk_table_fail;
|
||||
}
|
||||
|
|
@ -632,20 +621,20 @@ static int msm_vidc_load_clock_table(
|
|||
"qcom,clock-configs", clock_props,
|
||||
num_clocks);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to read clock properties: %d\n", rc);
|
||||
d_vpr_e("Failed to read clock properties: %d\n", rc);
|
||||
goto err_load_clk_prop_fail;
|
||||
}
|
||||
|
||||
clocks->clock_tbl = devm_kzalloc(&pdev->dev, sizeof(*clocks->clock_tbl)
|
||||
* num_clocks, GFP_KERNEL);
|
||||
if (!clocks->clock_tbl) {
|
||||
dprintk(VIDC_ERR, "Failed to allocate memory for clock tbl\n");
|
||||
d_vpr_e("Failed to allocate memory for clock tbl\n");
|
||||
rc = -ENOMEM;
|
||||
goto err_load_clk_prop_fail;
|
||||
}
|
||||
|
||||
clocks->count = num_clocks;
|
||||
dprintk(VIDC_HIGH, "Found %d clocks\n", num_clocks);
|
||||
d_vpr_h("Found %d clocks\n", num_clocks);
|
||||
|
||||
for (c = 0; c < num_clocks; ++c) {
|
||||
struct clock_info *vc = &res->clock_set.clock_tbl[c];
|
||||
|
|
@ -664,7 +653,7 @@ static int msm_vidc_load_clock_table(
|
|||
else
|
||||
vc->has_mem_retention = false;
|
||||
|
||||
dprintk(VIDC_HIGH, "Found clock %s: scale-able = %s\n", vc->name,
|
||||
d_vpr_h("Found clock %s: scale-able = %s\n", vc->name,
|
||||
vc->has_scaling ? "yes" : "no");
|
||||
}
|
||||
|
||||
|
|
@ -686,7 +675,7 @@ static int msm_vidc_load_reset_table(
|
|||
num_clocks = of_property_count_strings(pdev->dev.of_node,
|
||||
"reset-names");
|
||||
if (num_clocks <= 0) {
|
||||
dprintk(VIDC_HIGH, "No reset clocks found\n");
|
||||
d_vpr_h("No reset clocks found\n");
|
||||
rst->count = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -697,7 +686,7 @@ static int msm_vidc_load_reset_table(
|
|||
return -ENOMEM;
|
||||
|
||||
rst->count = num_clocks;
|
||||
dprintk(VIDC_HIGH, "Found %d reset clocks\n", num_clocks);
|
||||
d_vpr_h("Found %d reset clocks\n", num_clocks);
|
||||
|
||||
for (c = 0; c < num_clocks; ++c) {
|
||||
struct reset_info *rc = &res->reset_set.reset_tbl[c];
|
||||
|
|
@ -719,13 +708,12 @@ static int msm_decide_dt_node(
|
|||
rc = of_property_read_u32(pdev->dev.of_node, "sku-index",
|
||||
&sku_index);
|
||||
if (rc) {
|
||||
dprintk(VIDC_HIGH, "'sku_index' not found in node\n");
|
||||
d_vpr_h("'sku_index' not found in node\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sku_index != res->sku_version) {
|
||||
dprintk(VIDC_HIGH,
|
||||
"Failed to parser dt: sku_index %d res->sku_version - %d\n",
|
||||
d_vpr_h("Failed to parse dt: sku_index %d sku_version %d\n",
|
||||
sku_index, res->sku_version);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -755,7 +743,7 @@ int read_platform_resources_from_drv_data(
|
|||
int rc = 0;
|
||||
|
||||
if (!core || !core->platform_data) {
|
||||
dprintk(VIDC_ERR, "%s Invalid data\n", __func__);
|
||||
d_vpr_e("%s: Invalid data\n", __func__);
|
||||
return -ENOENT;
|
||||
}
|
||||
platform_data = core->platform_data;
|
||||
|
|
@ -772,7 +760,7 @@ int read_platform_resources_from_drv_data(
|
|||
|
||||
res->fw_name = "venus";
|
||||
|
||||
dprintk(VIDC_HIGH, "Firmware filename: %s\n", res->fw_name);
|
||||
d_vpr_h("Firmware filename: %s\n", res->fw_name);
|
||||
|
||||
res->max_load = find_key_value(platform_data,
|
||||
"qcom,max-hw-load");
|
||||
|
|
@ -863,25 +851,23 @@ static int msm_vidc_populate_cx_ipeak_context(
|
|||
if (IS_ERR(res->cx_ipeak_context)) {
|
||||
rc = PTR_ERR(res->cx_ipeak_context);
|
||||
if (rc == -EPROBE_DEFER)
|
||||
dprintk(VIDC_HIGH,
|
||||
"cx-ipeak register failed. Deferring probe!");
|
||||
d_vpr_h("cx-ipeak register failed. Deferring probe!");
|
||||
else
|
||||
dprintk(VIDC_ERR,
|
||||
"cx-ipeak register failed. rc: %d", rc);
|
||||
d_vpr_e("cx-ipeak register failed. rc: %d", rc);
|
||||
|
||||
res->cx_ipeak_context = NULL;
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (res->cx_ipeak_context)
|
||||
dprintk(VIDC_HIGH, "cx-ipeak register successful");
|
||||
d_vpr_h("cx-ipeak register successful");
|
||||
else
|
||||
dprintk(VIDC_HIGH, "cx-ipeak register not implemented");
|
||||
d_vpr_h("cx-ipeak register not implemented");
|
||||
|
||||
of_property_read_u32(pdev->dev.of_node,
|
||||
"qcom,clock-freq-threshold",
|
||||
&res->clk_freq_threshold);
|
||||
dprintk(VIDC_HIGH, "cx ipeak threshold frequency = %u\n",
|
||||
d_vpr_h("cx ipeak threshold frequency = %u\n",
|
||||
res->clk_freq_threshold);
|
||||
|
||||
return rc;
|
||||
|
|
@ -896,7 +882,7 @@ int read_platform_resources_from_dt(
|
|||
uint32_t firmware_base = 0;
|
||||
|
||||
if (!pdev->dev.of_node) {
|
||||
dprintk(VIDC_ERR, "DT node not found\n");
|
||||
d_vpr_e("DT node not found\n");
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
|
|
@ -918,63 +904,57 @@ int read_platform_resources_from_dt(
|
|||
|
||||
rc = msm_vidc_load_subcache_info(res);
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "Failed to load subcache info: %d\n", rc);
|
||||
d_vpr_e("Failed to load subcache info: %d\n", rc);
|
||||
|
||||
rc = msm_vidc_load_qdss_table(res);
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "Failed to load qdss reg table: %d\n", rc);
|
||||
d_vpr_e("Failed to load qdss reg table: %d\n", rc);
|
||||
|
||||
rc = msm_vidc_load_reg_table(res);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to load reg table: %d\n", rc);
|
||||
d_vpr_e("Failed to load reg table: %d\n", rc);
|
||||
goto err_load_reg_table;
|
||||
}
|
||||
|
||||
rc = msm_vidc_load_buffer_usage_table(res);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to load buffer usage table: %d\n", rc);
|
||||
d_vpr_e("Failed to load buffer usage table: %d\n", rc);
|
||||
goto err_load_buffer_usage_table;
|
||||
}
|
||||
|
||||
rc = msm_vidc_load_regulator_table(res);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Failed to load list of regulators %d\n", rc);
|
||||
d_vpr_e("Failed to load list of regulators %d\n", rc);
|
||||
goto err_load_regulator_table;
|
||||
}
|
||||
|
||||
rc = msm_vidc_load_clock_table(res);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to load clock table: %d\n", rc);
|
||||
d_vpr_e("Failed to load clock table: %d\n", rc);
|
||||
goto err_load_clock_table;
|
||||
}
|
||||
|
||||
rc = msm_vidc_load_allowed_clocks_table(res);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to load allowed clocks table: %d\n", rc);
|
||||
d_vpr_e("Failed to load allowed clocks table: %d\n", rc);
|
||||
goto err_load_allowed_clocks_table;
|
||||
}
|
||||
|
||||
rc = msm_vidc_load_reset_table(res);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to load reset table: %d\n", rc);
|
||||
d_vpr_e("Failed to load reset table: %d\n", rc);
|
||||
goto err_load_reset_table;
|
||||
}
|
||||
|
||||
rc = msm_vidc_populate_legacy_context_bank(res);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to setup context banks %d\n", rc);
|
||||
d_vpr_e("Failed to setup context banks %d\n", rc);
|
||||
goto err_setup_legacy_cb;
|
||||
}
|
||||
|
||||
rc = msm_vidc_populate_cx_ipeak_context(res);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Failed to setup cx-ipeak %d\n", rc);
|
||||
d_vpr_e("Failed to setup cx-ipeak %d\n", rc);
|
||||
goto err_register_cx_ipeak;
|
||||
}
|
||||
|
||||
|
|
@ -1004,15 +984,14 @@ static int msm_vidc_setup_context_bank(struct msm_vidc_platform_resources *res,
|
|||
struct bus_type *bus;
|
||||
|
||||
if (!dev || !cb || !res) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: Invalid Input params\n", __func__);
|
||||
d_vpr_e("%s: Invalid Input params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
cb->dev = dev;
|
||||
|
||||
bus = cb->dev->bus;
|
||||
if (IS_ERR_OR_NULL(bus)) {
|
||||
dprintk(VIDC_ERR, "%s - failed to get bus type\n", __func__);
|
||||
d_vpr_e("%s: failed to get bus type\n", __func__);
|
||||
rc = PTR_ERR(bus) ? PTR_ERR(bus) : -ENODEV;
|
||||
goto remove_cb;
|
||||
}
|
||||
|
|
@ -1030,9 +1009,9 @@ static int msm_vidc_setup_context_bank(struct msm_vidc_platform_resources *res,
|
|||
dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
|
||||
dma_set_seg_boundary(dev, DMA_BIT_MASK(64));
|
||||
|
||||
dprintk(VIDC_HIGH, "Attached %s and created mapping\n", dev_name(dev));
|
||||
dprintk(VIDC_HIGH,
|
||||
"Context bank name:%s, buffer_type: %#x, is_secure: %d, address range start: %#x, size: %#x, dev: %pK, domain: %pK",
|
||||
d_vpr_h("Attached %s and created mapping\n", dev_name(dev));
|
||||
d_vpr_h(
|
||||
"Context bank: %s, buffer_type: %#x, is_secure: %d, address range start: %#x, size: %#x, dev: %pK, domain: %pK",
|
||||
cb->name, cb->buffer_type, cb->is_secure, cb->addr_range.start,
|
||||
cb->addr_range.size, cb->dev, cb->domain);
|
||||
|
||||
|
|
@ -1047,7 +1026,7 @@ int msm_vidc_smmu_fault_handler(struct iommu_domain *domain,
|
|||
struct msm_vidc_inst *inst;
|
||||
|
||||
if (!domain || !core) {
|
||||
dprintk(VIDC_ERR, "%s - invalid param %pK %pK\n",
|
||||
d_vpr_e("%s: invalid params %pK %pK\n",
|
||||
__func__, domain, core);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1061,7 +1040,7 @@ int msm_vidc_smmu_fault_handler(struct iommu_domain *domain,
|
|||
}
|
||||
}
|
||||
|
||||
dprintk(VIDC_ERR, "%s - faulting address: %lx\n", __func__, iova);
|
||||
d_vpr_e("%s: faulting address: %lx\n", __func__, iova);
|
||||
|
||||
mutex_lock(&core->lock);
|
||||
list_for_each_entry(inst, &core->instances, list) {
|
||||
|
|
@ -1086,14 +1065,14 @@ static int msm_vidc_populate_context_bank(struct device *dev,
|
|||
struct device_node *np = NULL;
|
||||
|
||||
if (!dev || !core) {
|
||||
dprintk(VIDC_ERR, "%s - invalid inputs\n", __func__);
|
||||
d_vpr_e("%s: invalid inputs\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
np = dev->of_node;
|
||||
cb = devm_kzalloc(dev, sizeof(*cb), GFP_KERNEL);
|
||||
if (!cb) {
|
||||
dprintk(VIDC_ERR, "%s - Failed to allocate cb\n", __func__);
|
||||
d_vpr_e("%s: Failed to allocate cb\n", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
|
@ -1102,40 +1081,37 @@ static int msm_vidc_populate_context_bank(struct device *dev,
|
|||
|
||||
rc = of_property_read_string(np, "label", &cb->name);
|
||||
if (rc) {
|
||||
dprintk(VIDC_HIGH,
|
||||
"Failed to read cb label from device tree\n");
|
||||
d_vpr_h("Failed to read cb label from device tree\n");
|
||||
rc = 0;
|
||||
}
|
||||
|
||||
dprintk(VIDC_HIGH, "%s: context bank has name %s\n", __func__, cb->name);
|
||||
d_vpr_h("%s: context bank has name %s\n", __func__, cb->name);
|
||||
rc = of_property_read_u32_array(np, "virtual-addr-pool",
|
||||
(u32 *)&cb->addr_range, 2);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"Could not read addr pool for context bank : %s %d\n",
|
||||
d_vpr_e("Could not read addr pool: context bank: %s %d\n",
|
||||
cb->name, rc);
|
||||
goto err_setup_cb;
|
||||
}
|
||||
|
||||
cb->is_secure = of_property_read_bool(np, "qcom,secure-context-bank");
|
||||
dprintk(VIDC_HIGH, "context bank %s : secure = %d\n",
|
||||
d_vpr_h("context bank %s: secure = %d\n",
|
||||
cb->name, cb->is_secure);
|
||||
|
||||
/* setup buffer type for each sub device*/
|
||||
rc = of_property_read_u32(np, "buffer-types", &cb->buffer_type);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "failed to load buffer_type info %d\n", rc);
|
||||
d_vpr_e("failed to load buffer_type info %d\n", rc);
|
||||
rc = -ENOENT;
|
||||
goto err_setup_cb;
|
||||
}
|
||||
dprintk(VIDC_HIGH,
|
||||
"context bank %s address start = %x address size = %x buffer_type = %x\n",
|
||||
d_vpr_h("context bank %s address start %x size %x buffer_type %x\n",
|
||||
cb->name, cb->addr_range.start,
|
||||
cb->addr_range.size, cb->buffer_type);
|
||||
|
||||
rc = msm_vidc_setup_context_bank(&core->resources, cb, dev);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Cannot setup context bank %d\n", rc);
|
||||
d_vpr_e("Cannot setup context bank %d\n", rc);
|
||||
goto err_setup_cb;
|
||||
}
|
||||
|
||||
|
|
@ -1160,7 +1136,7 @@ static int msm_vidc_populate_legacy_context_bank(
|
|||
struct context_bank_info *cb;
|
||||
|
||||
if (!res || !res->pdev) {
|
||||
dprintk(VIDC_ERR, "%s - invalid inputs\n", __func__);
|
||||
d_vpr_e("%s: invalid inputs\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
pdev = res->pdev;
|
||||
|
|
@ -1168,8 +1144,7 @@ static int msm_vidc_populate_legacy_context_bank(
|
|||
domains_parent_node = of_find_node_by_name(pdev->dev.of_node,
|
||||
"qcom,vidc-iommu-domains");
|
||||
if (!domains_parent_node) {
|
||||
dprintk(VIDC_HIGH,
|
||||
"%s legacy iommu domains not present\n", __func__);
|
||||
d_vpr_h("%s: legacy iommu domains not present\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1178,8 +1153,7 @@ static int msm_vidc_populate_legacy_context_bank(
|
|||
domains_child_node) {
|
||||
cb = devm_kzalloc(&pdev->dev, sizeof(*cb), GFP_KERNEL);
|
||||
if (!cb) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s - Failed to allocate cb\n", __func__);
|
||||
d_vpr_e("%s: Failed to allocate cb\n", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
INIT_LIST_HEAD(&cb->list);
|
||||
|
|
@ -1188,24 +1162,21 @@ static int msm_vidc_populate_legacy_context_bank(
|
|||
ctx_node = of_parse_phandle(domains_child_node,
|
||||
"qcom,vidc-domain-phandle", 0);
|
||||
if (!ctx_node) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s Unable to parse pHandle\n", __func__);
|
||||
d_vpr_e("%s: Unable to parse pHandle\n", __func__);
|
||||
rc = -EBADHANDLE;
|
||||
goto err_setup_cb;
|
||||
}
|
||||
|
||||
rc = of_property_read_string(ctx_node, "label", &(cb->name));
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s Could not find label\n", __func__);
|
||||
d_vpr_e("%s: Could not find label\n", __func__);
|
||||
goto err_setup_cb;
|
||||
}
|
||||
|
||||
rc = of_property_read_u32_array(ctx_node,
|
||||
"qcom,virtual-addr-pool", (u32 *)&cb->addr_range, 2);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s Could not read addr pool for group : %s (%d)\n",
|
||||
d_vpr_e("%s: Could not read addr pool: %s (%d)\n",
|
||||
__func__, cb->name, rc);
|
||||
goto err_setup_cb;
|
||||
}
|
||||
|
|
@ -1216,28 +1187,27 @@ static int msm_vidc_populate_legacy_context_bank(
|
|||
rc = of_property_read_u32(domains_child_node,
|
||||
"qcom,vidc-buffer-types", &cb->buffer_type);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s Could not read buffer type (%d)\n",
|
||||
d_vpr_e("%s: Could not read buffer type (%d)\n",
|
||||
__func__, rc);
|
||||
goto err_setup_cb;
|
||||
}
|
||||
|
||||
cb->dev = msm_iommu_get_ctx(cb->name);
|
||||
if (IS_ERR_OR_NULL(cb->dev)) {
|
||||
dprintk(VIDC_ERR, "%s could not get device for cb %s\n",
|
||||
__func__, cb->name);
|
||||
d_vpr_e("%s: could not get device for cb %s\n",
|
||||
__func__, cb->name);
|
||||
rc = -ENOENT;
|
||||
goto err_setup_cb;
|
||||
}
|
||||
|
||||
rc = msm_vidc_setup_context_bank(res, cb, cb->dev);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "Cannot setup context bank %d\n", rc);
|
||||
d_vpr_e("Cannot setup context bank %d\n", rc);
|
||||
goto err_setup_cb;
|
||||
}
|
||||
dprintk(VIDC_HIGH,
|
||||
"%s: context bank %s secure %d addr start = %#x addr size = %#x buffer_type = %#x\n",
|
||||
__func__, cb->name, cb->is_secure, cb->addr_range.start,
|
||||
d_vpr_h(
|
||||
"context bank %s secure %d addr start = %#x size = %#x buffer_type = %#x\n",
|
||||
cb->name, cb->is_secure, cb->addr_range.start,
|
||||
cb->addr_range.size, cb->buffer_type);
|
||||
}
|
||||
return rc;
|
||||
|
|
@ -1253,26 +1223,26 @@ int read_context_bank_resources_from_dt(struct platform_device *pdev)
|
|||
int rc = 0;
|
||||
|
||||
if (!pdev) {
|
||||
dprintk(VIDC_ERR, "Invalid platform device\n");
|
||||
d_vpr_e("Invalid platform device\n");
|
||||
return -EINVAL;
|
||||
} else if (!pdev->dev.parent) {
|
||||
dprintk(VIDC_ERR, "Failed to find a parent for %s\n",
|
||||
dev_name(&pdev->dev));
|
||||
d_vpr_e("Failed to find a parent for %s\n",
|
||||
dev_name(&pdev->dev));
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
core = dev_get_drvdata(pdev->dev.parent);
|
||||
if (!core) {
|
||||
dprintk(VIDC_ERR, "Failed to find cookie in parent device %s",
|
||||
d_vpr_e("Failed to find cookie in parent device %s",
|
||||
dev_name(pdev->dev.parent));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = msm_vidc_populate_context_bank(&pdev->dev, core);
|
||||
if (rc)
|
||||
dprintk(VIDC_ERR, "Failed to probe context bank\n");
|
||||
d_vpr_e("Failed to probe context bank\n");
|
||||
else
|
||||
dprintk(VIDC_HIGH, "Successfully probed context bank\n");
|
||||
d_vpr_h("Successfully probed context bank\n");
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1282,18 +1252,18 @@ int read_bus_resources_from_dt(struct platform_device *pdev)
|
|||
struct msm_vidc_core *core;
|
||||
|
||||
if (!pdev) {
|
||||
dprintk(VIDC_ERR, "Invalid platform device\n");
|
||||
d_vpr_e("Invalid platform device\n");
|
||||
return -EINVAL;
|
||||
} else if (!pdev->dev.parent) {
|
||||
dprintk(VIDC_ERR, "Failed to find a parent for %s\n",
|
||||
dev_name(&pdev->dev));
|
||||
d_vpr_e("Failed to find a parent for %s\n",
|
||||
dev_name(&pdev->dev));
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
core = dev_get_drvdata(pdev->dev.parent);
|
||||
if (!core) {
|
||||
dprintk(VIDC_ERR, "Failed to find cookie in parent device %s",
|
||||
dev_name(pdev->dev.parent));
|
||||
d_vpr_e("Failed to find cookie in parent device %s",
|
||||
dev_name(pdev->dev.parent));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -1305,17 +1275,17 @@ int read_mem_cdsp_resources_from_dt(struct platform_device *pdev)
|
|||
struct msm_vidc_core *core;
|
||||
|
||||
if (!pdev) {
|
||||
dprintk(VIDC_ERR, "%s: invalid platform device\n", __func__);
|
||||
d_vpr_e("%s: invalid platform device\n", __func__);
|
||||
return -EINVAL;
|
||||
} else if (!pdev->dev.parent) {
|
||||
dprintk(VIDC_ERR, "Failed to find a parent for %s\n",
|
||||
d_vpr_e("Failed to find a parent for %s\n",
|
||||
dev_name(&pdev->dev));
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
core = dev_get_drvdata(pdev->dev.parent);
|
||||
if (!core) {
|
||||
dprintk(VIDC_ERR, "Failed to find cookie in parent device %s",
|
||||
d_vpr_e("Failed to find cookie in parent device %s",
|
||||
dev_name(pdev->dev.parent));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ struct hfi_device *vidc_hfi_initialize(enum msm_vidc_hfi_type hfi_type,
|
|||
|
||||
hdev = kzalloc(sizeof(struct hfi_device), GFP_KERNEL);
|
||||
if (!hdev) {
|
||||
dprintk(VIDC_ERR, "%s: failed to allocate hdev\n", __func__);
|
||||
d_vpr_e("%s: failed to allocate hdev\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -25,13 +25,13 @@ struct hfi_device *vidc_hfi_initialize(enum msm_vidc_hfi_type hfi_type,
|
|||
rc = venus_hfi_initialize(hdev, device_id, res, callback);
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR, "Unsupported host-firmware interface\n");
|
||||
d_vpr_e("Unsupported host-firmware interface\n");
|
||||
goto err_hfi_init;
|
||||
}
|
||||
|
||||
if (rc) {
|
||||
if (rc != -EPROBE_DEFER)
|
||||
dprintk(VIDC_ERR, "%s device init failed rc = %d",
|
||||
d_vpr_e("%s: device init failed rc = %d",
|
||||
__func__, rc);
|
||||
goto err_hfi_init;
|
||||
}
|
||||
|
|
@ -47,7 +47,7 @@ void vidc_hfi_deinitialize(enum msm_vidc_hfi_type hfi_type,
|
|||
struct hfi_device *hdev)
|
||||
{
|
||||
if (!hdev) {
|
||||
dprintk(VIDC_ERR, "%s invalid device %pK", __func__, hdev);
|
||||
d_vpr_e("%s: invalid device %pK", __func__, hdev);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ void vidc_hfi_deinitialize(enum msm_vidc_hfi_type hfi_type,
|
|||
venus_hfi_delete_device(hdev->hfi_device_data);
|
||||
break;
|
||||
default:
|
||||
dprintk(VIDC_ERR, "Unsupported host-firmware interface\n");
|
||||
d_vpr_e("Unsupported host-firmware interface\n");
|
||||
}
|
||||
|
||||
kfree(hdev);
|
||||
|
|
|
|||
|
|
@ -370,31 +370,31 @@ struct hfi_uncompressed_plane_actual_constraints_info {
|
|||
struct hfi_cmd_sys_session_abort_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
};
|
||||
|
||||
struct hfi_cmd_session_load_resources_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
};
|
||||
|
||||
struct hfi_cmd_session_start_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
};
|
||||
|
||||
struct hfi_cmd_session_stop_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
};
|
||||
|
||||
struct hfi_cmd_session_empty_buffer_compressed_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 time_stamp_hi;
|
||||
u32 time_stamp_lo;
|
||||
u32 flags;
|
||||
|
|
@ -412,7 +412,7 @@ struct hfi_cmd_session_empty_buffer_compressed_packet {
|
|||
struct hfi_cmd_session_empty_buffer_uncompressed_plane0_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 view_id;
|
||||
u32 time_stamp_hi;
|
||||
u32 time_stamp_lo;
|
||||
|
|
@ -449,7 +449,7 @@ struct hfi_cmd_session_empty_buffer_uncompressed_plane2_packet {
|
|||
struct hfi_cmd_session_fill_buffer_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 stream_id;
|
||||
u32 offset;
|
||||
u32 alloc_len;
|
||||
|
|
@ -463,26 +463,26 @@ struct hfi_cmd_session_fill_buffer_packet {
|
|||
struct hfi_cmd_session_flush_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 flush_type;
|
||||
};
|
||||
|
||||
struct hfi_cmd_session_suspend_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
};
|
||||
|
||||
struct hfi_cmd_session_resume_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
};
|
||||
|
||||
struct hfi_cmd_session_get_property_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 num_properties;
|
||||
u32 rg_property_data[1];
|
||||
};
|
||||
|
|
@ -490,7 +490,7 @@ struct hfi_cmd_session_get_property_packet {
|
|||
struct hfi_cmd_session_release_buffer_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 buffer_type;
|
||||
u32 buffer_size;
|
||||
u32 extra_data_size;
|
||||
|
|
@ -502,13 +502,13 @@ struct hfi_cmd_session_release_buffer_packet {
|
|||
struct hfi_cmd_session_release_resources_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
};
|
||||
|
||||
struct hfi_msg_sys_session_abort_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 error_type;
|
||||
};
|
||||
|
||||
|
|
@ -522,42 +522,42 @@ struct hfi_msg_sys_property_info_packet {
|
|||
struct hfi_msg_session_load_resources_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 error_type;
|
||||
};
|
||||
|
||||
struct hfi_msg_session_start_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 error_type;
|
||||
};
|
||||
|
||||
struct hfi_msg_session_stop_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 error_type;
|
||||
};
|
||||
|
||||
struct hfi_msg_session_suspend_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 error_type;
|
||||
};
|
||||
|
||||
struct hfi_msg_session_resume_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 error_type;
|
||||
};
|
||||
|
||||
struct hfi_msg_session_flush_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 error_type;
|
||||
u32 flush_type;
|
||||
};
|
||||
|
|
@ -581,7 +581,7 @@ struct hfi_frame_cr_stats_type {
|
|||
struct hfi_msg_session_empty_buffer_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 error_type;
|
||||
u32 offset;
|
||||
u32 filled_len;
|
||||
|
|
@ -597,7 +597,7 @@ struct hfi_msg_session_empty_buffer_done_packet {
|
|||
struct hfi_msg_session_fill_buffer_done_compressed_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 time_stamp_hi;
|
||||
u32 time_stamp_lo;
|
||||
u32 error_type;
|
||||
|
|
@ -619,7 +619,7 @@ struct hfi_msg_session_fill_buffer_done_compressed_packet {
|
|||
struct hfi_msg_session_fbd_uncompressed_plane0_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 stream_id;
|
||||
u32 view_id;
|
||||
u32 error_type;
|
||||
|
|
@ -666,7 +666,7 @@ struct hfi_msg_session_fill_buffer_done_uncompressed_plane2_packet {
|
|||
struct hfi_msg_session_property_info_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 num_properties;
|
||||
u32 rg_property_data[1];
|
||||
};
|
||||
|
|
@ -674,14 +674,14 @@ struct hfi_msg_session_property_info_packet {
|
|||
struct hfi_msg_session_release_resources_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 error_type;
|
||||
};
|
||||
|
||||
struct hfi_msg_session_release_buffers_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 error_type;
|
||||
u32 num_buffers;
|
||||
u32 rg_buffer_info[1];
|
||||
|
|
@ -690,7 +690,7 @@ struct hfi_msg_session_release_buffers_done_packet {
|
|||
struct hfi_msg_session_register_buffers_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 client_data;
|
||||
u32 error_type;
|
||||
};
|
||||
|
|
@ -698,7 +698,7 @@ struct hfi_msg_session_register_buffers_done_packet {
|
|||
struct hfi_msg_session_unregister_buffers_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 client_data;
|
||||
u32 error_type;
|
||||
};
|
||||
|
|
@ -806,7 +806,7 @@ struct hfi_extradata_recovery_point_sei_payload {
|
|||
struct hfi_cmd_session_continue_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
};
|
||||
|
||||
enum session_flags {
|
||||
|
|
@ -815,11 +815,12 @@ enum session_flags {
|
|||
|
||||
struct hal_session {
|
||||
struct list_head list;
|
||||
void *session_id;
|
||||
void *inst_id;
|
||||
bool is_decoder;
|
||||
enum hal_video_codec codec;
|
||||
enum hal_domain domain;
|
||||
u32 flags;
|
||||
u32 sid;
|
||||
};
|
||||
|
||||
struct hal_device_data {
|
||||
|
|
|
|||
|
|
@ -577,7 +577,7 @@ struct vidc_hal_sys_init_done {
|
|||
|
||||
struct msm_vidc_cb_cmd_done {
|
||||
u32 device_id;
|
||||
void *session_id;
|
||||
void *inst_id;
|
||||
enum vidc_status status;
|
||||
u32 size;
|
||||
union {
|
||||
|
|
@ -609,7 +609,7 @@ struct hal_index_extradata_input_crop_payload {
|
|||
|
||||
struct msm_vidc_cb_event {
|
||||
u32 device_id;
|
||||
void *session_id;
|
||||
void *inst_id;
|
||||
enum vidc_status status;
|
||||
u32 height;
|
||||
u32 width;
|
||||
|
|
@ -628,7 +628,7 @@ struct msm_vidc_cb_event {
|
|||
|
||||
struct msm_vidc_cb_data_done {
|
||||
u32 device_id;
|
||||
void *session_id;
|
||||
void *inst_id;
|
||||
enum vidc_status status;
|
||||
u32 size;
|
||||
union {
|
||||
|
|
@ -689,9 +689,9 @@ struct hfi_device {
|
|||
int (*core_init)(void *device);
|
||||
int (*core_release)(void *device);
|
||||
int (*core_trigger_ssr)(void *device, enum hal_ssr_trigger_type);
|
||||
int (*session_init)(void *device, void *session_id,
|
||||
int (*session_init)(void *device, void *inst_id,
|
||||
enum hal_domain session_type, enum hal_video_codec codec_type,
|
||||
void **new_session);
|
||||
void **new_session, u32 sid);
|
||||
int (*session_end)(void *session);
|
||||
int (*session_abort)(void *session);
|
||||
int (*session_set_buffers)(void *sess,
|
||||
|
|
@ -718,9 +718,9 @@ struct hfi_device {
|
|||
void *pdata, u32 size);
|
||||
int (*session_pause)(void *sess);
|
||||
int (*session_resume)(void *sess);
|
||||
int (*scale_clocks)(void *dev, u32 freq);
|
||||
int (*scale_clocks)(void *dev, u32 freq, u32 sid);
|
||||
int (*vote_bus)(void *dev, unsigned long bw_ddr,
|
||||
unsigned long bw_llcc);
|
||||
unsigned long bw_llcc, u32 sid);
|
||||
int (*get_fw_info)(void *dev, struct hal_fw_info *fw_info);
|
||||
int (*session_clean)(void *sess);
|
||||
int (*get_core_capabilities)(void *dev);
|
||||
|
|
@ -739,9 +739,6 @@ struct hfi_device *vidc_hfi_initialize(enum msm_vidc_hfi_type hfi_type,
|
|||
hfi_cmd_response_callback callback);
|
||||
void vidc_hfi_deinitialize(enum msm_vidc_hfi_type hfi_type,
|
||||
struct hfi_device *hdev);
|
||||
u32 vidc_get_hfi_domain(enum hal_domain hal_domain);
|
||||
u32 vidc_get_hfi_codec(enum hal_video_codec hal_codec);
|
||||
enum hal_domain vidc_get_hal_domain(u32 hfi_domain);
|
||||
enum hal_video_codec vidc_get_hal_codec(u32 hfi_codec);
|
||||
|
||||
u32 vidc_get_hfi_domain(enum hal_domain hal_domain, u32 sid);
|
||||
u32 vidc_get_hfi_codec(enum hal_video_codec hal_codec, u32 sid);
|
||||
#endif /*__VIDC_HFI_API_H__ */
|
||||
|
|
|
|||
|
|
@ -834,7 +834,7 @@ struct vidc_hal_msg_pkt_hdr {
|
|||
struct vidc_hal_session_cmd_pkt {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
};
|
||||
|
||||
struct hfi_packet_header {
|
||||
|
|
@ -885,7 +885,7 @@ struct hfi_cmd_sys_get_property_packet {
|
|||
struct hfi_cmd_sys_session_init_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 session_domain;
|
||||
u32 session_codec;
|
||||
};
|
||||
|
|
@ -893,7 +893,7 @@ struct hfi_cmd_sys_session_init_packet {
|
|||
struct hfi_cmd_sys_session_end_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
};
|
||||
|
||||
struct hfi_cmd_sys_set_buffers_packet {
|
||||
|
|
@ -927,7 +927,7 @@ struct hfi_cmd_sys_set_ubwc_config_packet_type {
|
|||
struct hfi_cmd_session_set_property_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 num_properties;
|
||||
u32 rg_property_data[1];
|
||||
};
|
||||
|
|
@ -935,7 +935,7 @@ struct hfi_cmd_session_set_property_packet {
|
|||
struct hfi_cmd_session_set_buffers_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 buffer_type;
|
||||
u32 buffer_size;
|
||||
u32 extra_data_size;
|
||||
|
|
@ -953,7 +953,7 @@ struct hfi_buffer_mapping_type {
|
|||
struct hfi_cmd_session_register_buffers_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 client_data;
|
||||
u32 response_req;
|
||||
u32 num_buffers;
|
||||
|
|
@ -963,7 +963,7 @@ struct hfi_cmd_session_register_buffers_packet {
|
|||
struct hfi_cmd_session_unregister_buffers_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 client_data;
|
||||
u32 response_req;
|
||||
u32 num_buffers;
|
||||
|
|
@ -973,7 +973,7 @@ struct hfi_cmd_session_unregister_buffers_packet {
|
|||
struct hfi_cmd_session_sync_process_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 sync_id;
|
||||
u32 rg_data[1];
|
||||
};
|
||||
|
|
@ -981,7 +981,7 @@ struct hfi_cmd_session_sync_process_packet {
|
|||
struct hfi_msg_event_notify_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 event_id;
|
||||
u32 event_data1;
|
||||
u32 event_data2;
|
||||
|
|
@ -1018,7 +1018,7 @@ struct hfi_msg_sys_release_resource_done_packet {
|
|||
struct hfi_msg_sys_session_init_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 error_type;
|
||||
u32 num_properties;
|
||||
u32 rg_property_data[1];
|
||||
|
|
@ -1027,7 +1027,7 @@ struct hfi_msg_sys_session_init_done_packet {
|
|||
struct hfi_msg_sys_session_end_done_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
u32 sid;
|
||||
u32 error_type;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue