hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/platform/rockchip/isp/regs_v2x.h
....@@ -302,31 +302,7 @@
302302 #define ISP_GAMMA_OUT_Y39 (ISP_GAMMA_OUT_BASE + 0x000ac)
303303 #define ISP_GAMMA_OUT_Y40 (ISP_GAMMA_OUT_BASE + 0x000b0)
304304
305
-#define SELF_RESIZE_BASE 0x00000C00
306
-#define SELF_RESIZE_CTRL (SELF_RESIZE_BASE + 0x00000)
307
-#define SELF_RESIZE_SCALE_HY (SELF_RESIZE_BASE + 0x00004)
308
-#define SELF_RESIZE_SCALE_HCB (SELF_RESIZE_BASE + 0x00008)
309
-#define SELF_RESIZE_SCALE_HCR (SELF_RESIZE_BASE + 0x0000c)
310
-#define SELF_RESIZE_SCALE_VY (SELF_RESIZE_BASE + 0x00010)
311
-#define SELF_RESIZE_SCALE_VC (SELF_RESIZE_BASE + 0x00014)
312
-#define SELF_RESIZE_PHASE_HY (SELF_RESIZE_BASE + 0x00018)
313
-#define SELF_RESIZE_PHASE_HC (SELF_RESIZE_BASE + 0x0001c)
314
-#define SELF_RESIZE_PHASE_VY (SELF_RESIZE_BASE + 0x00020)
315
-#define SELF_RESIZE_PHASE_VC (SELF_RESIZE_BASE + 0x00024)
316
-#define SELF_RESIZE_SCALE_LUT_ADDR (SELF_RESIZE_BASE + 0x00028)
317
-#define SELF_RESIZE_SCALE_LUT (SELF_RESIZE_BASE + 0x0002c)
318
-#define SELF_RESIZE_CTRL_SHD (SELF_RESIZE_BASE + 0x00030)
319
-#define SELF_RESIZE_SCALE_HY_SHD (SELF_RESIZE_BASE + 0x00034)
320
-#define SELF_RESIZE_SCALE_HCB_SHD (SELF_RESIZE_BASE + 0x00038)
321
-#define SELF_RESIZE_SCALE_HCR_SHD (SELF_RESIZE_BASE + 0x0003c)
322
-#define SELF_RESIZE_SCALE_VY_SHD (SELF_RESIZE_BASE + 0x00040)
323
-#define SELF_RESIZE_SCALE_VC_SHD (SELF_RESIZE_BASE + 0x00044)
324
-#define SELF_RESIZE_PHASE_HY_SHD (SELF_RESIZE_BASE + 0x00048)
325
-#define SELF_RESIZE_PHASE_HC_SHD (SELF_RESIZE_BASE + 0x0004c)
326
-#define SELF_RESIZE_PHASE_VY_SHD (SELF_RESIZE_BASE + 0x00050)
327
-#define SELF_RESIZE_PHASE_VC_SHD (SELF_RESIZE_BASE + 0x00054)
328
-
329
-#define MAIN_RESIZE_BASE 0x00001000
305
+#define MAIN_RESIZE_BASE 0x00000C00
330306 #define MAIN_RESIZE_CTRL (MAIN_RESIZE_BASE + 0x00000)
331307 #define MAIN_RESIZE_SCALE_HY (MAIN_RESIZE_BASE + 0x00004)
332308 #define MAIN_RESIZE_SCALE_HCB (MAIN_RESIZE_BASE + 0x00008)
....@@ -349,6 +325,30 @@
349325 #define MAIN_RESIZE_PHASE_HC_SHD (MAIN_RESIZE_BASE + 0x0004c)
350326 #define MAIN_RESIZE_PHASE_VY_SHD (MAIN_RESIZE_BASE + 0x00050)
351327 #define MAIN_RESIZE_PHASE_VC_SHD (MAIN_RESIZE_BASE + 0x00054)
328
+
329
+#define SELF_RESIZE_BASE 0x00001000
330
+#define SELF_RESIZE_CTRL (SELF_RESIZE_BASE + 0x00000)
331
+#define SELF_RESIZE_SCALE_HY (SELF_RESIZE_BASE + 0x00004)
332
+#define SELF_RESIZE_SCALE_HCB (SELF_RESIZE_BASE + 0x00008)
333
+#define SELF_RESIZE_SCALE_HCR (SELF_RESIZE_BASE + 0x0000c)
334
+#define SELF_RESIZE_SCALE_VY (SELF_RESIZE_BASE + 0x00010)
335
+#define SELF_RESIZE_SCALE_VC (SELF_RESIZE_BASE + 0x00014)
336
+#define SELF_RESIZE_PHASE_HY (SELF_RESIZE_BASE + 0x00018)
337
+#define SELF_RESIZE_PHASE_HC (SELF_RESIZE_BASE + 0x0001c)
338
+#define SELF_RESIZE_PHASE_VY (SELF_RESIZE_BASE + 0x00020)
339
+#define SELF_RESIZE_PHASE_VC (SELF_RESIZE_BASE + 0x00024)
340
+#define SELF_RESIZE_SCALE_LUT_ADDR (SELF_RESIZE_BASE + 0x00028)
341
+#define SELF_RESIZE_SCALE_LUT (SELF_RESIZE_BASE + 0x0002c)
342
+#define SELF_RESIZE_CTRL_SHD (SELF_RESIZE_BASE + 0x00030)
343
+#define SELF_RESIZE_SCALE_HY_SHD (SELF_RESIZE_BASE + 0x00034)
344
+#define SELF_RESIZE_SCALE_HCB_SHD (SELF_RESIZE_BASE + 0x00038)
345
+#define SELF_RESIZE_SCALE_HCR_SHD (SELF_RESIZE_BASE + 0x0003c)
346
+#define SELF_RESIZE_SCALE_VY_SHD (SELF_RESIZE_BASE + 0x00040)
347
+#define SELF_RESIZE_SCALE_VC_SHD (SELF_RESIZE_BASE + 0x00044)
348
+#define SELF_RESIZE_PHASE_HY_SHD (SELF_RESIZE_BASE + 0x00048)
349
+#define SELF_RESIZE_PHASE_HC_SHD (SELF_RESIZE_BASE + 0x0004c)
350
+#define SELF_RESIZE_PHASE_VY_SHD (SELF_RESIZE_BASE + 0x00050)
351
+#define SELF_RESIZE_PHASE_VC_SHD (SELF_RESIZE_BASE + 0x00054)
352352
353353 #define MI_BASE 0x00001400
354354 #define MI_WR_CTRL (MI_BASE + 0x00000)
....@@ -2492,6 +2492,7 @@
24922492
24932493 /* HDRMGE */
24942494 /* ISP_HDRMGE_CTRL */
2495
+#define ISP_HDRMGE_MODE_MASK GENMASK(3, 2)
24952496 #define ISP_HDRMGE_EN BIT(0)
24962497
24972498 /* RAWNR */
....@@ -2577,30 +2578,30 @@
25772578 /* ISP21 DHAZ/DRC/BAY3D */
25782579 #define ISP21_SELF_FORCE_UPD BIT(31)
25792580
2580
-static inline bool dmatx0_is_stream_stopped(void __iomem *base)
2581
+static inline bool dmatx0_is_stream_stopped(struct rkisp_stream *stream)
25812582 {
2582
- u32 ret = readl(base + CSI2RX_RAW0_WR_CTRL);
2583
+ u32 ret = rkisp_read(stream->ispdev, CSI2RX_RAW0_WR_CTRL, true);
25832584
25842585 return !(ret & SW_CSI_RAW_WR_EN_SHD);
25852586 }
25862587
2587
-static inline bool dmatx1_is_stream_stopped(void __iomem *base)
2588
+static inline bool dmatx1_is_stream_stopped(struct rkisp_stream *stream)
25882589 {
2589
- u32 ret = readl(base + CSI2RX_RAW1_WR_CTRL);
2590
+ u32 ret = rkisp_read(stream->ispdev, CSI2RX_RAW1_WR_CTRL, true);
25902591
25912592 return !(ret & SW_CSI_RAW_WR_EN_SHD);
25922593 }
25932594
2594
-static inline bool dmatx2_is_stream_stopped(void __iomem *base)
2595
+static inline bool dmatx2_is_stream_stopped(struct rkisp_stream *stream)
25952596 {
2596
- u32 ret = readl(base + CSI2RX_RAW2_WR_CTRL);
2597
+ u32 ret = rkisp_read(stream->ispdev, CSI2RX_RAW2_WR_CTRL, true);
25972598
25982599 return !(ret & SW_CSI_RAW_WR_EN_SHD);
25992600 }
26002601
2601
-static inline bool dmatx3_is_stream_stopped(void __iomem *base)
2602
+static inline bool dmatx3_is_stream_stopped(struct rkisp_stream *stream)
26022603 {
2603
- u32 ret = readl(base + CSI2RX_RAW3_WR_CTRL);
2604
+ u32 ret = rkisp_read(stream->ispdev, CSI2RX_RAW3_WR_CTRL, true);
26042605
26052606 return !(ret & SW_CSI_RAW_WR_EN_SHD);
26062607 }
....@@ -2697,8 +2698,13 @@
26972698 is_direct = false;
26982699 rkisp_write(stream->ispdev, stream->config->mi.length,
26992700 stream->out_fmt.plane_fmt[0].bytesperline, is_direct);
2700
- if (stream->ispdev->isp_ver == ISP_V21)
2701
+ if (stream->ispdev->isp_ver == ISP_V21 || stream->ispdev->isp_ver == ISP_V30)
27012702 rkisp_set_bits(stream->ispdev, MI_RD_CTRL2, 0, BIT(30), false);
2703
+ if (stream->ispdev->hw_dev->is_unite) {
2704
+ rkisp_next_write(stream->ispdev, stream->config->mi.length,
2705
+ stream->out_fmt.plane_fmt[0].bytesperline, is_direct);
2706
+ rkisp_next_set_bits(stream->ispdev, MI_RD_CTRL2, 0, BIT(30), false);
2707
+ }
27022708 }
27032709
27042710 static inline void rx_force_upd(void __iomem *base)