MLK-20350 VPU: Reduce RPC size and remove decoder_str in dts
Reduce RPC size and remove decoder_str in dts for vpu decoder Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>pull/10/head
parent
60709c8ae9
commit
18580d12be
|
@ -121,20 +121,16 @@
|
|||
};
|
||||
decoder_rpc: decoder_rpc@0x90400000 {
|
||||
no-map;
|
||||
reg = <0 0x90400000 0 0x1000000>;
|
||||
reg = <0 0x90400000 0 0x200000>;
|
||||
};
|
||||
encoder_rpc: encoder_rpc@0x91400000 {
|
||||
encoder_rpc: encoder_rpc@0x90600000 {
|
||||
no-map;
|
||||
reg = <0 0x91400000 0 0x100000>;
|
||||
reg = <0 0x90600000 0 0x100000>;
|
||||
};
|
||||
dsp_reserved: dsp@0x92400000 {
|
||||
no-map;
|
||||
reg = <0 0x92400000 0 0x2000000>;
|
||||
};
|
||||
decoder_str: str@0x94400000 {
|
||||
no-map;
|
||||
reg = <0 0x94400000 0 0x1800000>;
|
||||
};
|
||||
/* global autoconfigured region for contiguous allocations */
|
||||
linux,cma {
|
||||
compatible = "shared-dma-pool";
|
||||
|
@ -3335,7 +3331,6 @@
|
|||
compatible = "nxp,imx8qm-b0-vpudec", "nxp,imx8qxp-b0-vpudec";
|
||||
boot-region = <&decoder_boot>;
|
||||
rpc-region = <&decoder_rpc>;
|
||||
str-region = <&decoder_str>;
|
||||
reg = <0x0 0x2c000000 0x0 0x1000000>;
|
||||
reg-names = "vpu_regs";
|
||||
power-domains = <&pd_vpu_dec>;
|
||||
|
|
|
@ -99,23 +99,17 @@
|
|||
|
||||
decoder_rpc: decoder_rpc@0x90400000 {
|
||||
no-map;
|
||||
reg = <0 0x90400000 0 0x1000000>;
|
||||
reg = <0 0x90400000 0 0x200000>;
|
||||
};
|
||||
encoder_rpc: encoder_rpc@0x91400000 {
|
||||
encoder_rpc: encoder_rpc@0x90600000 {
|
||||
no-map;
|
||||
reg = <0 0x91400000 0 0x200000>;
|
||||
reg = <0 0x90600000 0 0x200000>;
|
||||
};
|
||||
dsp_reserved: dsp@0x92400000 {
|
||||
no-map;
|
||||
reg = <0 0x92400000 0 0x2000000>;
|
||||
};
|
||||
|
||||
decoder_str: str@0x94400000 {
|
||||
no-map;
|
||||
reg = <0 0x94400000 0 0x1800000>;
|
||||
};
|
||||
|
||||
|
||||
/* global autoconfigured region for contiguous allocations */
|
||||
linux,cma {
|
||||
compatible = "shared-dma-pool";
|
||||
|
@ -185,7 +179,6 @@
|
|||
compatible = "nxp,imx8qm-b0-vpudec", "nxp,imx8qxp-b0-vpudec";
|
||||
boot-region = <&decoder_boot>;
|
||||
rpc-region = <&decoder_rpc>;
|
||||
str-region = <&decoder_str>;
|
||||
reg = <0x0 0x2c000000 0x0 0x1000000>;
|
||||
reg-names = "vpu_regs";
|
||||
reg-csr = <0x2d080000>;
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
## Makefile for the VPU and M0 driver
|
||||
##
|
||||
DEFINES += -D REBOOT=1 \
|
||||
-D BOOT_ARCH=1 \
|
||||
-D DYNAMIC_MEM
|
||||
-D BOOT_ARCH=1
|
||||
|
||||
EXTRA_CFLAGS += $(DEFINES)
|
||||
|
||||
|
|
|
@ -2848,7 +2848,7 @@ static int v4l2_open(struct file *filp)
|
|||
ctx->mbi_count = 0;
|
||||
ctx->mbi_num = 0;
|
||||
ctx->mbi_size = 0;
|
||||
#ifdef DYNAMIC_MEM
|
||||
|
||||
ctx->stream_buffer_size = MAX_BUFFER_SIZE;
|
||||
ctx->stream_buffer_virt = dma_alloc_coherent(&ctx->dev->plat_dev->dev,
|
||||
ctx->stream_buffer_size,
|
||||
|
@ -2863,11 +2863,6 @@ static int v4l2_open(struct file *filp)
|
|||
else
|
||||
vpu_dbg(LVL_INFO, "%s() stream_buffer_size(%d) stream_buffer_virt(%p) stream_buffer_phy(%p), index(%d)\n",
|
||||
__func__, ctx->stream_buffer_size, ctx->stream_buffer_virt, (void *)ctx->stream_buffer_phy, ctx->str_index);
|
||||
#else
|
||||
ctx->stream_buffer_size = dev->str_size/VPU_MAX_NUM_STREAMS;
|
||||
ctx->stream_buffer_phy = dev->str_base_phy + ctx->str_index * ctx->stream_buffer_size;
|
||||
ctx->stream_buffer_virt = dev->str_base_vir + ctx->str_index * ctx->stream_buffer_size;
|
||||
#endif
|
||||
ctx->udata_buffer_size = UDATA_BUFFER_SIZE;
|
||||
ctx->udata_buffer_virt = dma_alloc_coherent(&ctx->dev->plat_dev->dev,
|
||||
ctx->udata_buffer_size,
|
||||
|
@ -2887,14 +2882,12 @@ static int v4l2_open(struct file *filp)
|
|||
return 0;
|
||||
|
||||
err_alloc_udata:
|
||||
#ifdef DYNAMIC_MEM
|
||||
if (ctx->stream_buffer_virt)
|
||||
dma_free_coherent(&ctx->dev->plat_dev->dev,
|
||||
ctx->stream_buffer_size,
|
||||
ctx->stream_buffer_virt,
|
||||
ctx->stream_buffer_phy
|
||||
);
|
||||
#endif
|
||||
err_firmware_load:
|
||||
kfree(ctx->pSeqinfo);
|
||||
ctx->pSeqinfo = NULL;
|
||||
|
@ -2957,14 +2950,12 @@ static int v4l2_release(struct file *filp)
|
|||
ctx->mbi_dma_virt[i],
|
||||
ctx->mbi_dma_phy[i]
|
||||
);
|
||||
#ifdef DYNAMIC_MEM
|
||||
if (ctx->stream_buffer_virt)
|
||||
dma_free_coherent(&ctx->dev->plat_dev->dev,
|
||||
ctx->stream_buffer_size,
|
||||
ctx->stream_buffer_virt,
|
||||
ctx->stream_buffer_phy
|
||||
);
|
||||
#endif
|
||||
if (ctx->udata_buffer_virt)
|
||||
dma_free_coherent(&ctx->dev->plat_dev->dev,
|
||||
ctx->udata_buffer_size,
|
||||
|
@ -3177,20 +3168,6 @@ static int parse_dt_info(struct vpu_dev *dev, struct device_node *np)
|
|||
return -EINVAL;
|
||||
}
|
||||
dev->m0_rpc_phy = reserved_res.start;
|
||||
#ifndef DYNAMIC_MEM
|
||||
reserved_node = of_parse_phandle(np, "str-region", 0);
|
||||
if (!reserved_node) {
|
||||
vpu_dbg(LVL_ERR, "error: str-region of_parse_phandle error\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (of_address_to_resource(reserved_node, 0, &reserved_res)) {
|
||||
vpu_dbg(LVL_ERR, "error: str-region of_address_to_resource error\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
dev->str_base_phy = reserved_res.start;
|
||||
dev->str_size = resource_size(&reserved_res);
|
||||
#endif
|
||||
|
||||
ret = of_property_read_u32(np, "reg-csr", &csr_base);
|
||||
if (ret) {
|
||||
|
@ -3281,17 +3258,6 @@ static int init_vpudev_parameters(struct vpu_dev *dev)
|
|||
}
|
||||
|
||||
memset_io(dev->m0_rpc_virt, 0, SHARED_SIZE);
|
||||
#ifndef DYNAMIC_MEM
|
||||
dev->str_base_vir = ioremap_wc(dev->str_base_phy,
|
||||
dev->str_size
|
||||
);
|
||||
if (!dev->str_base_vir) {
|
||||
vpu_dbg(LVL_ERR, "error: failed to remap space for stream memory\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset_io(dev->str_base_vir, 0, dev->str_size);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -194,11 +194,6 @@ struct vpu_dev {
|
|||
u_int32 m0_p_fw_space_phy;
|
||||
void *m0_rpc_virt;
|
||||
u_int32 m0_rpc_phy;
|
||||
#ifndef DYNAMIC_MEM
|
||||
void *str_base_vir;
|
||||
u_int32 str_base_phy;
|
||||
u_int32 str_size;
|
||||
#endif
|
||||
struct mutex dev_mutex;
|
||||
struct mutex cmd_mutex;
|
||||
bool fw_is_ready;
|
||||
|
|
|
@ -65,10 +65,10 @@
|
|||
#define GOP_SIZE 0x1000
|
||||
#define PIC_SIZE 0x1000
|
||||
#define QMETER_SIZE 0x1000
|
||||
#define DEBUG_SIZE 0x200000
|
||||
#define DEBUG_SIZE 0x80000
|
||||
#define ENG_SIZE 0x1000
|
||||
#define LOCAL_MSG_NUM VID_API_MESSAGE_LIMIT
|
||||
#define M0_PRINT_OFFSET 0x500000
|
||||
#define M0_PRINT_OFFSET 0x180000
|
||||
|
||||
struct shared_addr {
|
||||
pDEC_RPC_HOST_IFACE pSharedInterface;
|
||||
|
|
Loading…
Reference in New Issue