From 607c70763c34daf68283b1bd938ced8fc0ebe74a Mon Sep 17 00:00:00 2001 From: chenli Date: Sat, 27 Aug 2011 11:08:21 +0800 Subject: [PATCH] rk29-ipp:check whether support deinterlacing 1.Mobile phone dose not support deinterlacing 2.SF will check whether IPP support deinterlacing first --- arch/arm/configs/rk29_phonesdk_defconfig | 1 + arch/arm/mach-rk29/include/mach/rk29-ipp.h | 2 +- drivers/staging/rk29/ipp/Kconfig | 10 ++++++++- drivers/staging/rk29/ipp/rk29-ipp.c | 24 +++++++++++++++++----- 4 files changed, 30 insertions(+), 7 deletions(-) mode change 100644 => 100755 drivers/staging/rk29/ipp/Kconfig diff --git a/arch/arm/configs/rk29_phonesdk_defconfig b/arch/arm/configs/rk29_phonesdk_defconfig index 67b6e12677a7..5d4b17a0e189 100755 --- a/arch/arm/configs/rk29_phonesdk_defconfig +++ b/arch/arm/configs/rk29_phonesdk_defconfig @@ -1825,6 +1825,7 @@ CONFIG_VIVANTE=y # IPP # CONFIG_RK29_IPP=y +CONFIG_DEINTERLACE=n # # CMMB diff --git a/arch/arm/mach-rk29/include/mach/rk29-ipp.h b/arch/arm/mach-rk29/include/mach/rk29-ipp.h index 36027c802451..488f6e8787e2 100755 --- a/arch/arm/mach-rk29/include/mach/rk29-ipp.h +++ b/arch/arm/mach-rk29/include/mach/rk29-ipp.h @@ -34,7 +34,7 @@ struct rk29_ipp_req { */ uint8_t store_clip_mode; - //deinterlace_enable 1:enable 0:disable + //deinterlace_enable 0:disable 1:enable 2:query uint8_t deinterlace_enable; //the sum of three paras should be 32,and single para should be less than 32 uint8_t deinterlace_para0; diff --git a/drivers/staging/rk29/ipp/Kconfig b/drivers/staging/rk29/ipp/Kconfig old mode 100644 new mode 100755 index f7599165d96c..81a951f3178d --- a/drivers/staging/rk29/ipp/Kconfig +++ b/drivers/staging/rk29/ipp/Kconfig @@ -3,6 +3,14 @@ config RK29_IPP tristate "ROCKCHIP RK29 IPP" default y help - rk29 ipp module. + rk29 ipp module. + +config DEINTERLACE + bool "Deinterlacing support" + depends on RK29_IPP + default y + help + Mobile phone dose not support deinterlacing + endmenu diff --git a/drivers/staging/rk29/ipp/rk29-ipp.c b/drivers/staging/rk29/ipp/rk29-ipp.c index 8d9862bd5629..05e8c652e863 100755 --- a/drivers/staging/rk29/ipp/rk29-ipp.c +++ b/drivers/staging/rk29/ipp/rk29-ipp.c @@ -308,7 +308,7 @@ int ipp_blit(const struct rk29_ipp_req *req) uint32_t dst0_YrgbMst=0,dst0_CbrMst=0; uint32_t ret = 0; uint32_t deinterlace_config = 0; - + //printk("ipp_blit\n"); if (drvdata == NULL) { /* ddl@rock-chips.com : check driver is normal or not */ printk("%s drvdata is NULL, IPP driver probe is fail!!\n", __FUNCTION__); @@ -846,8 +846,12 @@ int ipp_blit(const struct rk29_ipp_req *req) { deinterlace_config = (req->deinterlace_enable<<24) | (req->deinterlace_para0<<19) | (req->deinterlace_para1<<14) | (req->deinterlace_para2<<9); DBG("para0 %d, para1 %d, para2 %d,deinterlace_config %x\n",req->deinterlace_para0,req->deinterlace_para1,req->deinterlace_para2,deinterlace_config); - ipp_write((ipp_read(IPP_CONFIG)&0xFE0001FF)|deinterlace_config, IPP_CONFIG); - //printk("IPP_CONFIG2 = 0x%x\n",ipp_read(IPP_CONFIG)); + #ifdef CONFIG_DEINTERLACE + ipp_write((ipp_read(IPP_CONFIG)&0xFE0001FF)|deinterlace_config, IPP_CONFIG); + #else + printk("does not support deinterlacing!\n"); + ipp_write(ipp_read(IPP_CONFIG)&(~DEINTERLACE_ENABLE), IPP_CONFIG); //disable deinterlace + #endif } else { @@ -878,6 +882,7 @@ int ipp_blit(const struct rk29_ipp_req *req) ipp_write(ipp_read(IPP_CONFIG)&(~STORE_CLIP_MODE), IPP_CONFIG); } + /* Start the operation */ ipp_write(8, IPP_INT);// dsb(); @@ -932,7 +937,6 @@ int ipp_blit_sync(const struct rk29_ipp_req *req) //printk("ipp_blit_sync -------------------\n"); - ////If IPP is busy now,wait until it becomes idle mutex_lock(&drvdata->mutex); { @@ -1026,7 +1030,17 @@ static int stretch_blit(/*struct ipp_context *ctx,*/ unsigned long arg ,unsigne goto err_noput; } - + if(req.deinterlace_enable==2) + { + #ifdef CONFIG_DEINTERLACE + printk("ipp support deinterlacing\n"); + return 0; + #else + printk("ipp dose not support deinterlacing\n"); + return -EPERM; + #endif + } + if(cmd == IPP_BLIT_SYNC) { ret = ipp_blit_sync(&req); -- 2.34.1