1342
- 收藏
- 点赞
- 分享
- 举报
himix200编译器编译驱动,浮点数问题
平台:hi3531dv200
编译器:aarch64-himix200-linux
驱动部分代码:
void txdrv_aublc_factory_set(AUBLC_T *pAublc)
{
uint32_t i;
int16_t r_vhl, b_vhl;
float f_val;
txcra_iostream_mask((__CONST uint8_t *)&TXREG_AUBLC_INIT_TBL);
for (i = 0; i < MAX_AUBLC_BUF_SIZE; i ++)
{
txcra_iostream_mask((__CONST uint8_t *)&TXREG_AUBLC_RGB_DIS_TBL);
txcra_iostream_mask((__CONST uint8_t *)&TXREG_AUBLC_RGB_EN_TBL);
g_aublc_rl_buf[i] = txcra_readrange(REG_AUBLC_R_VL, 0, 0x0A);
g_aublc_rh_buf[i] = txcra_readrange(REG_AUBLC_R_VH, 0, 0x0A);
g_aublc_gl_buf[i] = txcra_readrange(REG_AUBLC_G_VL, 0, 0x0A);
g_aublc_gh_buf[i] = txcra_readrange(REG_AUBLC_G_VH, 0, 0x0A);
g_aublc_bl_buf[i] = txcra_readrange(REG_AUBLC_B_VL, 0, 0x0A);
g_aublc_bh_buf[i] = txcra_readrange(REG_AUBLC_B_VH, 0, 0x0A);
}
g_aublc_rl_buf[0] = txfunc_find_median_value((uint16_t *)g_aublc_rl_buf, MAX_AUBLC_BUF_SIZE, 16);
g_aublc_rh_buf[0] = txfunc_find_median_value((uint16_t *)g_aublc_rh_buf, MAX_AUBLC_BUF_SIZE, 16);
g_aublc_gl_buf[0] = txfunc_find_median_value((uint16_t *)g_aublc_gl_buf, MAX_AUBLC_BUF_SIZE, 16);
g_aublc_gh_buf[0] = txfunc_find_median_value((uint16_t *)g_aublc_gh_buf, MAX_AUBLC_BUF_SIZE, 16);
g_aublc_bl_buf[0] = txfunc_find_median_value((uint16_t *)g_aublc_bl_buf, MAX_AUBLC_BUF_SIZE, 16);
g_aublc_bh_buf[0] = txfunc_find_median_value((uint16_t *)g_aublc_bh_buf, MAX_AUBLC_BUF_SIZE, 16);
r_vhl = (g_aublc_gh_buf[0] - g_aublc_gl_buf[0]) - (g_aublc_rh_buf[0] - g_aublc_rl_buf[0]);
b_vhl = (g_aublc_gh_buf[0] - g_aublc_gl_buf[0]) - (g_aublc_bh_buf[0] - g_aublc_bl_buf[0]);
f_val = abs(r_vhl);
if (r_vhl >= 0)
{
pAublc->r_gain = 0x80 - f_val / 1.600;
}
else
{
pAublc->r_gain = 0x80 + f_val / 1.478;
}
f_val = abs(b_vhl);
if (b_vhl >= 0)
{
pAublc->b_gain = 0x80 - f_val / 1.600;
}
else
{
pAublc->b_gain = 0x80 + f_val / 1.478;
}
txcra_write(REG_RGBADC_GAINB, pAublc->b_gain);
txcra_write(REG_RGBADC_GAINR, pAublc->r_gain);
for (i = 0; i < MAX_AUBLC_BUF_SIZE; i ++)
{
txcra_iostream_mask((__CONST uint8_t *)&TXREG_AUBLC_RGB_DIS_TBL);
txcra_iostream_mask((__CONST uint8_t *)&TXREG_AUBLC_RGB_EN_TBL);
g_aublc_rm_buf[i] = txcra_readrange(REG_AUBLC_R_VM, 0, 0x0A);
g_aublc_gm_buf[i] = txcra_readrange(REG_AUBLC_G_VM, 0, 0x0A);
g_aublc_bm_buf[i] = txcra_readrange(REG_AUBLC_B_VM, 0, 0x0A);
}
g_aublc_rm_buf[0] = txfunc_find_median_value((uint16_t *)g_aublc_rm_buf, MAX_AUBLC_BUF_SIZE, 16);
g_aublc_gm_buf[0] = txfunc_find_median_value((uint16_t *)g_aublc_gm_buf, MAX_AUBLC_BUF_SIZE, 16);
g_aublc_bm_buf[0] = txfunc_find_median_value((uint16_t *)g_aublc_bm_buf, MAX_AUBLC_BUF_SIZE, 16);
r_vhl = g_aublc_gm_buf[0] - g_aublc_rm_buf[0];
b_vhl = g_aublc_gm_buf[0] - g_aublc_bm_buf[0];
f_val = abs(r_vhl);
if (r_vhl > 0)
{
pAublc->r_offset = 0x40 - f_val / 2.5;
}
else
{
pAublc->r_offset = 0x40 + f_val / 2.5;
}
f_val = abs(b_vhl);
if (b_vhl > 0)
{
pAublc->b_offset = 0x40 - f_val / 2.5;
}
else
{
pAublc->b_offset = 0x40 + f_val / 2.5;
}
}
Makefile文件:
export ARCH=arm64
export CROSS_COMPILE=aarch64-himix200-linux-
PWD := $(shell pwd)
KERNDIR := /home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/osdrv/opensource/kernel/linux-4.19.y
CONFIG_CV8988 := m
#ccflags-y += -mfloat-softfp -mfpu=neon
ifneq ($(KERNELRELEASE),)
cv8988-objs += cv8988.o
cv8988-objs += mtx_drv_aublc.o
cv8988-objs += mtx_drv_comm.o
cv8988-objs += mtx_drv_cra.o
cv8988-objs += mtx_drv_mdt.o
cv8988-objs += mtx_drv_modules.o
cv8988-objs += mtx_lib_api.o
cv8988-objs += TX_VESA_TIMING_TBL.o
obj-$(CONFIG_CV8988) += cv8988.o
else
all:
$(Q)$(MAKE) $(S) -C $(KERNDIR) M=$(PWD) modules
clean:
$(Q)$(MAKE) $(S) -C $(KERNDIR) M=$(PWD) clean
endif
.PHONY: all clean
编译报错:
make -C /home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/osdrv/opensource/kernel/linux-4.19.y M=/home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/drv/extdrv/cv8988/cv8988_vga_decoder_sdk_v1.0_20211013 modules
make[1]: 进入目录“/home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/osdrv/opensource/kernel/linux-4.19.y”
make[2]: 放弃循环依赖 /home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/drv/extdrv/cv8988/cv8988_vga_decoder_sdk_v1.0_20211013/cv8988.o <- /home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/drv/extdrv/cv8988/cv8988_vga_decoder_sdk_v1.0_20211013/cv8988.o 。
CC [M] /home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/drv/extdrv/cv8988/cv8988_vga_decoder_sdk_v1.0_20211013/mtx_drv_aublc.o
/home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/drv/extdrv/cv8988/cv8988_vga_decoder_sdk_v1.0_20211013/mtx_drv_aublc.c: In function 'txdrv_aublc_factory_set':
/home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/drv/extdrv/cv8988/cv8988_vga_decoder_sdk_v1.0_20211013/mtx_drv_aublc.c:141:24: error: '-mgeneral-regs-only' is incompatible with floating-point code
pAublc->r_gain = 0x80 - f_val/1.600 ;
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/drv/extdrv/cv8988/cv8988_vga_decoder_sdk_v1.0_20211013/mtx_drv_aublc.c:141:24: error: '-mgeneral-regs-only' is incompatible with floating-point argument
/home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/drv/extdrv/cv8988/cv8988_vga_decoder_sdk_v1.0_20211013/mtx_drv_aublc.c:141:24: error: '-mgeneral-regs-only' is incompatible with floating-point argument
/home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/drv/extdrv/cv8988/cv8988_vga_decoder_sdk_v1.0_20211013/mtx_drv_aublc.c:141:24: error: '-mgeneral-regs-only' is incompatible with floating-point code
/home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/drv/extdrv/cv8988/cv8988_vga_decoder_sdk_v1.0_20211013/mtx_drv_aublc.c:141:24: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
make[2]: *** [scripts/Makefile.build:304:/home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/drv/extdrv/cv8988/cv8988_vga_decoder_sdk_v1.0_20211013/mtx_drv_aublc.o] 错误 1
make[1]: *** [Makefile:1524:_module_/home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/drv/extdrv/cv8988/cv8988_vga_decoder_sdk_v1.0_20211013] 错误 2
make[1]: 离开目录“/home/linux/nvr/Hi3531DV200_SDK_V2.0.0.3/osdrv/opensource/kernel/linux-4.19.y”
make: *** [Makefile:22:all] 错误 2
我尝试添加以下编译选项,去解决问题,又提示我没有识别到这两个编译选项
ccflags-y += -mfloat-softfp -mfpu=neon
请问是否是编译器的问题,如何解决呢?
我来回答
回答4个
时间排序
认可量排序
认可0
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2020-10-26 14:01:00
-
22020-03-02 15:29:13
-
2015-06-03 09:54:19
-
2016-01-30 17:05:43
-
2018-10-30 10:53:48
-
22024-02-20 20:46:07
-
72015-01-26 14:09:34
-
2020-03-17 10:22:56
-
2012-12-04 13:50:20
-
2020-04-04 14:37:50
-
2021-01-11 16:30:01
-
2019-01-10 16:52:34
-
2015-11-10 10:04:38
-
2023-07-03 10:58:15
-
2019-12-02 18:03:24
-
2015-11-10 10:40:56
-
2018-11-27 17:10:38
-
2013-12-02 15:58:08
-
2016-10-11 16:41:50
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
-
10求HI3519DV500_SDK_V2.0.1.1
-
5有偿求HI3516DV500 + OV5647驱动
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认