mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
video: rockchip: rga3: fix the wrong check of resolution in RGA3 rotating
Change-Id: If135f3cbb80f30e0a7de18ce293b188318603fde Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
This commit is contained in:
@@ -1755,10 +1755,50 @@ static int rga3_scale_check(const struct rga3_req *req)
|
|||||||
u32 win0_saw, win0_sah, win0_daw, win0_dah;
|
u32 win0_saw, win0_sah, win0_daw, win0_dah;
|
||||||
u32 win1_saw, win1_sah, win1_daw, win1_dah;
|
u32 win1_saw, win1_sah, win1_daw, win1_dah;
|
||||||
|
|
||||||
win0_saw = req->win0.src_act_w;
|
if (req->rotate_mode & RGA3_ROT_BIT_ROT_90) {
|
||||||
win0_sah = req->win0.src_act_h;
|
if (req->win1.yrgb_addr != 0) {
|
||||||
win0_daw = req->win0.dst_act_w;
|
/* ABB */
|
||||||
win0_dah = req->win0.dst_act_h;
|
if (req->win0.yrgb_addr == req->wr.yrgb_addr) {
|
||||||
|
/* win0 do not need rotate, but net equal to wr */
|
||||||
|
win0_saw = req->win0.src_act_h;
|
||||||
|
win0_sah = req->win0.src_act_w;
|
||||||
|
win0_daw = req->win0.dst_act_h;
|
||||||
|
win0_dah = req->win0.dst_act_w;
|
||||||
|
|
||||||
|
win1_saw = req->win1.dst_act_w;
|
||||||
|
win1_sah = req->win1.dst_act_h;
|
||||||
|
win1_daw = req->win1.dst_act_h;
|
||||||
|
win1_dah = req->win1.dst_act_w;
|
||||||
|
} else {
|
||||||
|
win0_saw = req->win0.src_act_w;
|
||||||
|
win0_sah = req->win0.src_act_h;
|
||||||
|
win0_daw = req->win0.dst_act_w;
|
||||||
|
win0_dah = req->win0.dst_act_h;
|
||||||
|
|
||||||
|
win1_saw = req->win1.src_act_w;
|
||||||
|
win1_sah = req->win1.src_act_h;
|
||||||
|
win1_daw = req->win1.dst_act_w;
|
||||||
|
win1_dah = req->win1.dst_act_h;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
win0_saw = req->win0.src_act_w;
|
||||||
|
win0_sah = req->win0.src_act_h;
|
||||||
|
win0_daw = req->win0.dst_act_h;
|
||||||
|
win0_dah = req->win0.dst_act_w;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
win0_saw = req->win0.src_act_w;
|
||||||
|
win0_sah = req->win0.src_act_h;
|
||||||
|
win0_daw = req->win0.dst_act_w;
|
||||||
|
win0_dah = req->win0.dst_act_h;
|
||||||
|
|
||||||
|
if (req->win1.yrgb_addr != 0) {
|
||||||
|
win1_saw = req->win1.src_act_w;
|
||||||
|
win1_sah = req->win1.src_act_h;
|
||||||
|
win1_daw = req->win1.dst_act_w;
|
||||||
|
win1_dah = req->win1.dst_act_h;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (((win0_saw >> 3) > win0_daw) || ((win0_sah >> 3) > win0_dah)) {
|
if (((win0_saw >> 3) > win0_daw) || ((win0_sah >> 3) > win0_dah)) {
|
||||||
pr_info("win0 unsupported to scaling less than 1/8 times. src[%d, %d], dst[%d, %d]\n",
|
pr_info("win0 unsupported to scaling less than 1/8 times. src[%d, %d], dst[%d, %d]\n",
|
||||||
@@ -1772,11 +1812,6 @@ static int rga3_scale_check(const struct rga3_req *req)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (req->win1.yrgb_addr != 0) {
|
if (req->win1.yrgb_addr != 0) {
|
||||||
win1_saw = req->win1.src_act_w;
|
|
||||||
win1_sah = req->win1.src_act_h;
|
|
||||||
win1_daw = req->win1.dst_act_w;
|
|
||||||
win1_dah = req->win1.dst_act_h;
|
|
||||||
|
|
||||||
if (((win1_saw >> 3) > win1_daw) || ((win1_sah >> 3) > win1_dah)) {
|
if (((win1_saw >> 3) > win1_daw) || ((win1_sah >> 3) > win1_dah)) {
|
||||||
pr_info("win1 unsupported to scaling less than 1/8 times. src[%d, %d], dst[%d, %d]\n",
|
pr_info("win1 unsupported to scaling less than 1/8 times. src[%d, %d], dst[%d, %d]\n",
|
||||||
win1_saw, win1_sah, win1_daw, win1_dah);
|
win1_saw, win1_sah, win1_daw, win1_dah);
|
||||||
|
|||||||
@@ -225,15 +225,8 @@ static bool rga_check_scale(const struct rga_hw_data *data,
|
|||||||
|
|
||||||
sw = src0->act_w;
|
sw = src0->act_w;
|
||||||
sh = src0->act_h;
|
sh = src0->act_h;
|
||||||
|
dw = dst->act_w;
|
||||||
if ((rga_base->sina == 65536 && rga_base->cosa == 0)
|
dh = dst->act_h;
|
||||||
|| (rga_base->sina == -65536 && rga_base->cosa == 0)) {
|
|
||||||
dw = dst->act_h;
|
|
||||||
dh = dst->act_w;
|
|
||||||
} else {
|
|
||||||
dw = dst->act_w;
|
|
||||||
dh = dst->act_h;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sw > dw) {
|
if (sw > dw) {
|
||||||
if ((sw >> data->max_downscale_factor) > dw)
|
if ((sw >> data->max_downscale_factor) > dw)
|
||||||
|
|||||||
Reference in New Issue
Block a user