mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
media_module: solve 32bit compile error
PD#169652: media_modules: solve 32bit compile error Change-Id: Id12608913df7372a303606dbf39b1f349eaaf08d Signed-off-by: Ao Xu <ao.xu@amlogic.com>
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
ifeq ($(KERNEL_A32_SUPPORT), true)
|
||||
KERNEL_ARCH := arm
|
||||
else
|
||||
KERNEL_ARCH := arm64
|
||||
endif
|
||||
|
||||
CONFIGS := CONFIG_AMLOGIC_MEDIA_VDEC_MPEG12=m \
|
||||
CONFIG_AMLOGIC_MEDIA_VDEC_MPEG4=m \
|
||||
CONFIG_AMLOGIC_MEDIA_VDEC_MPEG4_MULTI=m \
|
||||
@@ -82,7 +87,11 @@ ifeq (,$(wildcard $(MODS_OUT)))
|
||||
$(shell mkdir $(MODS_OUT) -p)
|
||||
endif
|
||||
|
||||
ifeq ($(KERNEL_A32_SUPPORT), true)
|
||||
TOOLS := /opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
else
|
||||
TOOLS := /opt/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
endif
|
||||
|
||||
modules:
|
||||
@$(MAKE) -C $(KDIR) M=$(MEDIA_DRIVERS) ARCH=$(KERNEL_ARCH) \
|
||||
|
||||
@@ -253,9 +253,9 @@ void trans_vframe_to_user(struct aml_vcodec_ctx *ctx, struct vdec_fb *fb)
|
||||
if (!dstbuf->used)
|
||||
return;
|
||||
|
||||
aml_v4l2_debug(4,"%s() [%d], base_y: %lu, idx: %u\n",
|
||||
aml_v4l2_debug(4,"%s() [%d], base_y: %zu, idx: %u\n",
|
||||
__FUNCTION__, __LINE__, fb->base_y.size, dstbuf->vb.vb2_buf.index);
|
||||
aml_v4l2_debug(4,"%s() [%d], base_c: %lu, idx: %u\n",
|
||||
aml_v4l2_debug(4,"%s() [%d], base_c: %zu, idx: %u\n",
|
||||
__FUNCTION__, __LINE__, fb->base_c.size, dstbuf->vb.vb2_buf.index);
|
||||
|
||||
dstbuf->vb.vb2_buf.timestamp = vf->timestamp;
|
||||
|
||||
@@ -517,10 +517,10 @@ static void vdec_h264_get_vf(struct vdec_h264_inst *inst, struct vdec_fb **out)
|
||||
//dump_write(fb->base_y.va, fb->base_y.bytes_used);
|
||||
//dump_write(fb->base_c.va, fb->base_c.bytes_used);
|
||||
|
||||
aml_vcodec_debug(inst, "%s() [%d], va: %p, phy: %x, size: %lu\n",
|
||||
aml_vcodec_debug(inst, "%s() [%d], va: %p, phy: %x, size: %zu\n",
|
||||
__FUNCTION__, __LINE__, fb->base_y.va,
|
||||
(unsigned int)virt_to_phys(fb->base_y.va), fb->base_y.size);
|
||||
aml_vcodec_debug(inst, "%s() [%d], va: %p, phy: %x, size: %lu\n",
|
||||
aml_vcodec_debug(inst, "%s() [%d], va: %p, phy: %x, size: %zu\n",
|
||||
__FUNCTION__, __LINE__, fb->base_c.va,
|
||||
(unsigned int)virt_to_phys(fb->base_c.va), fb->base_c.size);
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ static inline int div_r32(int64_t m, int n)
|
||||
return (int)(m/n)
|
||||
*/
|
||||
#ifndef CONFIG_ARM64
|
||||
do_div(m, n);
|
||||
div_s64(m, n);
|
||||
return (int)m;
|
||||
#else
|
||||
return (int)(m/n);
|
||||
|
||||
@@ -6082,11 +6082,13 @@ static int vmh264_user_data_read(struct vdec_s *vdec,
|
||||
struct mh264_userdata_record_t *p_userdata_rec;
|
||||
u32 data_size;
|
||||
u32 res;
|
||||
unsigned long addr;
|
||||
int copy_ok = 1;
|
||||
|
||||
hw = (struct vdec_h264_hw_s *)vdec->private;
|
||||
|
||||
pdest_buf = (void *)(puserdata_para->pbuf_addr);
|
||||
addr = puserdata_para->pbuf_addr;
|
||||
pdest_buf = (void *)addr;
|
||||
mutex_lock(&hw->userdata_mutex);
|
||||
|
||||
/*
|
||||
|
||||
@@ -1478,13 +1478,15 @@ static int vmpeg12_user_data_read(struct vdec_s *vdec,
|
||||
u8 *rec_data_start;
|
||||
u8 *pdest_buf;
|
||||
struct mpeg12_userdata_recored_t *p_userdata_rec;
|
||||
unsigned long addr;
|
||||
|
||||
|
||||
u32 data_size;
|
||||
u32 res;
|
||||
int copy_ok = 1;
|
||||
|
||||
pdest_buf = (void *)(puserdata_para->pbuf_addr);
|
||||
addr = puserdata_para->pbuf_addr;
|
||||
pdest_buf = (void *)addr;
|
||||
mutex_lock(&userdata_mutex);
|
||||
|
||||
if (!p_userdata_mgr) {
|
||||
|
||||
@@ -15,7 +15,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <asm/compiler.h>
|
||||
#include "secprot.h"
|
||||
#ifndef CONFIG_ARM64
|
||||
#include <asm/opcodes-sec.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARM64
|
||||
|
||||
int tee_config_device_secure(int dev_id, int secure)
|
||||
{
|
||||
@@ -40,4 +47,29 @@ int tee_config_device_secure(int dev_id, int secure)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
int tee_config_device_secure(int dev_id, int secure)
|
||||
{
|
||||
int ret = 0;
|
||||
register unsigned int r0 asm("r0");
|
||||
register unsigned int r1 asm("r1");
|
||||
register unsigned int r2 asm("r2");
|
||||
|
||||
r0 = OPTEE_SMC_CONFIG_DEVICE_SECURE;
|
||||
r1 = dev_id;
|
||||
r2 = secure;
|
||||
|
||||
asm volatile(
|
||||
__asmeq("%0", "r0")
|
||||
__asmeq("%1", "r0")
|
||||
__asmeq("%2", "r1")
|
||||
__asmeq("%3", "r2")
|
||||
__SMC(0)
|
||||
: "=r"(r0)
|
||||
: "r"(r0), "r"(r1), "r"(r2));
|
||||
ret = r0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#define OPTEE_SMC_CONFIG_DEVICE_SECURE 0xb200000e
|
||||
|
||||
#define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t"
|
||||
/*#define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t"*/
|
||||
|
||||
extern int tee_config_device_secure(int dev_id, int secure);
|
||||
|
||||
|
||||
@@ -3168,6 +3168,7 @@ static ssize_t show_debug(struct class *class,
|
||||
struct vdec_s *vdec;
|
||||
struct vdec_core_s *core = vdec_core;
|
||||
unsigned long flags = vdec_core_lock(vdec_core);
|
||||
u64 tmp;
|
||||
|
||||
pbuf += sprintf(pbuf,
|
||||
"============== help:\n");
|
||||
@@ -3207,11 +3208,12 @@ static ssize_t show_debug(struct class *class,
|
||||
vdec->input_underrun_count[type]);
|
||||
pbuf += sprintf(pbuf, "\t%d",
|
||||
vdec->not_run_ready_count[type]);
|
||||
tmp = vdec->run_clk[type] * 100;
|
||||
do_div(tmp, vdec->total_clk[type]);
|
||||
pbuf += sprintf(pbuf,
|
||||
"\t%d%%\n",
|
||||
vdec->total_clk[type] == 0 ? 0 :
|
||||
(u32)((vdec->run_clk[type] * 100)
|
||||
/ vdec->total_clk[type]));
|
||||
(u32)tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ static inline int div_r32(int64_t m, int n)
|
||||
*return (int)(m/n)
|
||||
*/
|
||||
#ifndef CONFIG_ARM64
|
||||
do_div(m, n);
|
||||
div_s64(m, n);
|
||||
return (int)m;
|
||||
#else
|
||||
return (int)(m/n);
|
||||
|
||||
@@ -476,7 +476,7 @@ s32 vmem_init(struct video_mm_t *mm, ulong addr, ulong size)
|
||||
(struct page_t *)VMEM_P_ALLOC(
|
||||
mm->num_pages * sizeof(struct page_t));
|
||||
if (mm->page_list == NULL) {
|
||||
pr_err("%s:%d failed to kmalloc(%ld)\n",
|
||||
pr_err("%s:%d failed to kmalloc(%zu)\n",
|
||||
__func__, __LINE__,
|
||||
mm->num_pages * sizeof(struct page_t));
|
||||
return -1;
|
||||
|
||||
@@ -491,6 +491,7 @@ static long vpu_ioctl(struct file *filp, u32 cmd, ulong arg)
|
||||
"[-]VDI_IOCTL_ALLOCATE_PHYSICAL_MEMORY\n");
|
||||
}
|
||||
break;
|
||||
#ifdef CONFIG_COMPAT
|
||||
case VDI_IOCTL_ALLOCATE_PHYSICAL_MEMORY32:
|
||||
{
|
||||
struct vpudrv_buffer_pool_t *vbp;
|
||||
@@ -560,6 +561,7 @@ static long vpu_ioctl(struct file *filp, u32 cmd, ulong arg)
|
||||
"[-]VDI_IOCTL_ALLOCATE_PHYSICAL_MEMORY32\n");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case VDI_IOCTL_FREE_PHYSICALMEMORY:
|
||||
{
|
||||
struct vpudrv_buffer_pool_t *vbp, *n;
|
||||
@@ -596,6 +598,7 @@ static long vpu_ioctl(struct file *filp, u32 cmd, ulong arg)
|
||||
"[-]VDI_IOCTL_FREE_PHYSICALMEMORY\n");
|
||||
}
|
||||
break;
|
||||
#ifdef CONFIG_COMPAT
|
||||
case VDI_IOCTL_FREE_PHYSICALMEMORY32:
|
||||
{
|
||||
struct vpudrv_buffer_pool_t *vbp, *n;
|
||||
@@ -642,6 +645,7 @@ static long vpu_ioctl(struct file *filp, u32 cmd, ulong arg)
|
||||
"[-]VDI_IOCTL_FREE_PHYSICALMEMORY32\n");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case VDI_IOCTL_GET_RESERVED_VIDEO_MEMORY_INFO:
|
||||
{
|
||||
enc_pr(LOG_ALL,
|
||||
@@ -659,6 +663,7 @@ static long vpu_ioctl(struct file *filp, u32 cmd, ulong arg)
|
||||
"[-]VDI_IOCTL_GET_RESERVED_VIDEO_MEMORY_INFO\n");
|
||||
}
|
||||
break;
|
||||
#ifdef CONFIG_COMPAT
|
||||
case VDI_IOCTL_GET_RESERVED_VIDEO_MEMORY_INFO32:
|
||||
{
|
||||
struct compat_vpudrv_buffer_t buf32;
|
||||
@@ -686,6 +691,7 @@ static long vpu_ioctl(struct file *filp, u32 cmd, ulong arg)
|
||||
"[-]VDI_IOCTL_GET_RESERVED_VIDEO_MEMORY_INFO32\n");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case VDI_IOCTL_WAIT_INTERRUPT:
|
||||
{
|
||||
struct vpudrv_intr_info_t info;
|
||||
@@ -804,6 +810,7 @@ static long vpu_ioctl(struct file *filp, u32 cmd, ulong arg)
|
||||
"[-]VDI_IOCTL_GET_INSTANCE_POOL\n");
|
||||
}
|
||||
break;
|
||||
#ifdef CONFIG_COMPAT
|
||||
case VDI_IOCTL_GET_INSTANCE_POOL32:
|
||||
{
|
||||
struct compat_vpudrv_buffer_t buf32;
|
||||
@@ -875,6 +882,7 @@ static long vpu_ioctl(struct file *filp, u32 cmd, ulong arg)
|
||||
"[-]VDI_IOCTL_GET_INSTANCE_POOL32\n");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case VDI_IOCTL_GET_COMMON_MEMORY:
|
||||
{
|
||||
enc_pr(LOG_ALL,
|
||||
@@ -907,6 +915,7 @@ static long vpu_ioctl(struct file *filp, u32 cmd, ulong arg)
|
||||
"[-]VDI_IOCTL_GET_COMMON_MEMORY\n");
|
||||
}
|
||||
break;
|
||||
#ifdef CONFIG_COMPAT
|
||||
case VDI_IOCTL_GET_COMMON_MEMORY32:
|
||||
{
|
||||
struct compat_vpudrv_buffer_t buf32;
|
||||
@@ -965,6 +974,7 @@ static long vpu_ioctl(struct file *filp, u32 cmd, ulong arg)
|
||||
"[-]VDI_IOCTL_GET_COMMON_MEMORY32\n");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case VDI_IOCTL_OPEN_INSTANCE:
|
||||
{
|
||||
struct vpudrv_inst_info_t inst_info;
|
||||
@@ -1133,6 +1143,7 @@ static long vpu_ioctl(struct file *filp, u32 cmd, ulong arg)
|
||||
s_vpu_register.size);
|
||||
}
|
||||
break;
|
||||
#ifdef CONFIG_COMPAT
|
||||
case VDI_IOCTL_GET_REGISTER_INFO32:
|
||||
{
|
||||
struct compat_vpudrv_buffer_t buf32;
|
||||
@@ -1207,6 +1218,7 @@ static long vpu_ioctl(struct file *filp, u32 cmd, ulong arg)
|
||||
"[-]VDI_IOCTL_FLUSH_BUFFER32\n");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case VDI_IOCTL_FLUSH_BUFFER:
|
||||
{
|
||||
struct vpudrv_buffer_pool_t *pool, *n;
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
READ_HHI_REG(HHI_WAVE420L_CLK_CNTL2) \
|
||||
& (~(1 << 8)))
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
struct compat_vpudrv_buffer_t {
|
||||
u32 size;
|
||||
u32 cached;
|
||||
@@ -108,6 +109,7 @@ struct compat_vpudrv_buffer_t {
|
||||
compat_ulong_t base; /* kernel logical address in use kernel */
|
||||
compat_ulong_t virt_addr; /* virtual user space address */
|
||||
};
|
||||
#endif
|
||||
|
||||
struct vpudrv_buffer_t {
|
||||
u32 size;
|
||||
@@ -204,6 +206,7 @@ struct vpudrv_instance_pool_t {
|
||||
#define VDI_IOCTL_FLUSH_BUFFER \
|
||||
_IOW(VDI_MAGIC, 13, VPUDRV_BUF_LEN)
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
#define VDI_IOCTL_ALLOCATE_PHYSICAL_MEMORY32 \
|
||||
_IOW(VDI_MAGIC, 0, VPUDRV_BUF_LEN32)
|
||||
|
||||
@@ -224,6 +227,7 @@ struct vpudrv_instance_pool_t {
|
||||
|
||||
#define VDI_IOCTL_FLUSH_BUFFER32 \
|
||||
_IOW(VDI_MAGIC, 13, VPUDRV_BUF_LEN32)
|
||||
#endif
|
||||
|
||||
enum {
|
||||
W4_INT_INIT_VPU = 0,
|
||||
|
||||
Reference in New Issue
Block a user