mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
rk29-ipp:add store_clip_mode in struct rk29_ipp_req
store_clip_mode: 0: when src width is not 64-bits aligned,use dummy data make it 64-bits aligned 1:packed
This commit is contained in:
@@ -20,12 +20,19 @@ struct rk29_ipp_image
|
||||
struct rk29_ipp_req {
|
||||
struct rk29_ipp_image src0; // source0 image
|
||||
struct rk29_ipp_image dst0; // destination0 image
|
||||
struct rk29_ipp_image src1; // source1 image
|
||||
struct rk29_ipp_image dst1; // destination1 image
|
||||
//struct rk29_ipp_image src1; // source1 image
|
||||
//struct rk29_ipp_image dst1; // destination1 image
|
||||
uint32_t src_vir_w;
|
||||
uint32_t dst_vir_w;
|
||||
uint32_t timeout;
|
||||
|
||||
uint32_t flag; //rotate
|
||||
|
||||
/*store_clip_mode
|
||||
0:when src width is not 64-bits aligned,use dummy data make it 64-bits aligned 1:packed
|
||||
we usually set to 0
|
||||
*/
|
||||
uint8_t store_clip_mode;
|
||||
|
||||
//deinterlace_enable 1:enable 0:disable
|
||||
uint8_t deinterlace_enable;
|
||||
@@ -105,6 +112,7 @@ typedef enum
|
||||
#define IPP_PROCESS_ST (0x50)
|
||||
|
||||
/*ipp config*/
|
||||
#define STORE_CLIP_MODE (1<<26)
|
||||
#define DEINTERLACE_ENABLE (1<<24)
|
||||
#define ROT_ENABLE (1<<8)
|
||||
#define PRE_SCALE (1<<4)
|
||||
|
||||
@@ -249,25 +249,25 @@ int ipp_check_param(const struct rk29_ipp_req *req)
|
||||
/*IPP can support up to 8191*8191 resolution in RGB format,but we limit the image size to 8190*8190 here*/
|
||||
//check src width and height
|
||||
if (unlikely((req->src0.w <16) || (req->src0.w > 8190) || (req->src0.h < 16) || (req->src0.h > 8190))) {
|
||||
ERR("invalid source resolution\n");
|
||||
printk("ipp invalid source resolution\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
//check dst width and height
|
||||
if (unlikely((req->dst0.w <16) || (req->dst0.w > 2047) || (req->dst0.h < 16) || (req->dst0.h > 2047))) {
|
||||
ERR("invalid destination resolution\n");
|
||||
printk("ipp invalid destination resolution\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
//check src_vir_w
|
||||
if(unlikely(req->src_vir_w < req->src0.w)){
|
||||
ERR("invalid src_vir_w\n");
|
||||
printk("ipp invalid src_vir_w\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
//check dst_vir_w
|
||||
if(unlikely(req->dst_vir_w < req->dst0.w)){
|
||||
ERR("invalid dst_vir_w\n");
|
||||
printk("ipp invalid dst_vir_w\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ int ipp_check_param(const struct rk29_ipp_req *req)
|
||||
//check rotate degree
|
||||
if(req->flag >= IPP_ROT_LIMIT)
|
||||
{
|
||||
ERR("rk29_ipp is not surpport rot degree!!!!\n");
|
||||
printk("rk29_ipp does not surpport rot degree!!!!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
@@ -862,12 +862,18 @@ int ipp_blit(const struct rk29_ipp_req *req)
|
||||
/*Configure other*/
|
||||
ipp_write((req->dst_vir_w<<16)|req->src_vir_w, IPP_IMG_VIR);
|
||||
|
||||
//store clip mode always set to 1 now
|
||||
ipp_write(ipp_read(IPP_CONFIG)|(1<<26), IPP_CONFIG);//store clip mode
|
||||
|
||||
//store clip mode
|
||||
if(req->store_clip_mode == 1)
|
||||
{
|
||||
ipp_write(ipp_read(IPP_CONFIG)|STORE_CLIP_MODE, IPP_CONFIG);
|
||||
}
|
||||
else
|
||||
{
|
||||
ipp_write(ipp_read(IPP_CONFIG)&(~STORE_CLIP_MODE), IPP_CONFIG);
|
||||
}
|
||||
|
||||
/* Start the operation */
|
||||
ipp_write(8, IPP_INT);//
|
||||
|
||||
ipp_write(8, IPP_INT);//
|
||||
dsb();
|
||||
ipp_write(1, IPP_PROCESS_ST);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user