aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuoniu.Zhou <guoniu.zhou@nxp.com>2018-04-02 22:59:15 +0800
committerTerry (Woncheol) Heo <terryheo@google.com>2018-04-02 08:28:42 +0000
commit9eb325e98d6171f76aa012799db9425648ffa6c5 (patch)
tree8105dcefcc5e583a1ad191c2599a3f5b35a9e97a
parent4d0812be7dc713228a4fc07b6f744ec44074a8c9 (diff)
downloadimx-v4.9-o-mr1-iot-preview-8.tar.gz
Fix PXP stuck issue on some casesandroid-o-mr1-iot-preview-8o-mr1-iot-preview-8
When output height is eight, yscale of ps engine will be over two, it is not support by pxp. According to pxp doc, a factor greater than 2 is not supported with the bilinear filter. so correct it when this case happens in order to ensure that pxp will not hang up. Bug: 65864256, Bug: 74214035 Test: android.view.cts.SurfaceViewSyncTest#testSurfaceViewSmallScale Change-Id: I36b954f4d34c539a807b2cc40f146218ffbaed38 Signed-off-by: fang hui <hui.fang@nxp.com>
-rw-r--r--drivers/dma/pxp/pxp_dma_v3.c22
-rw-r--r--drivers/dma/pxp/regs-pxp_v3.h5
2 files changed, 26 insertions, 1 deletions
diff --git a/drivers/dma/pxp/pxp_dma_v3.c b/drivers/dma/pxp/pxp_dma_v3.c
index c23201dee2c3..4fbd437a365e 100644
--- a/drivers/dma/pxp/pxp_dma_v3.c
+++ b/drivers/dma/pxp/pxp_dma_v3.c
@@ -2123,6 +2123,17 @@ static uint32_t ps_calc_scaling(struct pxp_pixmap *input,
}
scale.xscale = input->crop.width * 0x1000 /
(output->crop.width * decx);
+
+ /* A factor greater than 2 is not supported
+ * with the bilinear filter, so correct it in
+ * driver
+ */
+ if (((scale.xscale >> BP_PXP_PS_SCALE_OFFSET) & 0x3) > 2) {
+ scale.xscale &= (~(0x3 << BP_PXP_PS_SCALE_OFFSET));
+ scale.xscale |= (0x2 << BP_PXP_PS_SCALE_OFFSET);
+ pr_warn("%s not support scale width: %d\n",
+ __func__, output->crop.width);
+ }
} else {
if (!is_yuv(input->format) ||
(is_yuv(input->format) == is_yuv(output->format)) ||
@@ -2160,6 +2171,17 @@ static uint32_t ps_calc_scaling(struct pxp_pixmap *input,
}
scale.yscale = input->crop.height * 0x1000 /
(output->crop.height * decy);
+
+ /* A factor greater than 2 is not supported
+ * with the bilinear filter, so correct it in
+ * driver
+ */
+ if (((scale.yscale >> BP_PXP_PS_SCALE_OFFSET) & 0x3) > 2) {
+ scale.yscale &= (~(0x3 << BP_PXP_PS_SCALE_OFFSET));
+ scale.yscale |= (0x2 << BP_PXP_PS_SCALE_OFFSET);
+ pr_warn("%s not support scale height: %d\n",
+ __func__, output->crop.height);
+ }
} else {
if ((input->crop.height > 1) && (output->crop.height > 1))
scale.yscale = (input->crop.height - 1) * 0x1000 /
diff --git a/drivers/dma/pxp/regs-pxp_v3.h b/drivers/dma/pxp/regs-pxp_v3.h
index 15a481151a13..401527a01653 100644
--- a/drivers/dma/pxp/regs-pxp_v3.h
+++ b/drivers/dma/pxp/regs-pxp_v3.h
@@ -1,7 +1,8 @@
/*
* Freescale PXP Register Definitions
*
- * Copyright 2014-2015 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2014-2016 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2017-2018 NXP
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -456,6 +457,8 @@
#define BF_PXP_PS_SCALE_XSCALE(v) \
(((v) << 0) & BM_PXP_PS_SCALE_XSCALE)
+#define BP_PXP_PS_SCALE_OFFSET 12
+
#define HW_PXP_PS_OFFSET (0x00000120)
#define BP_PXP_PS_OFFSET_RSVD2 28