hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/platform/vsp1/vsp1_lif.c
....@@ -84,18 +84,40 @@
8484
8585 static void lif_configure_stream(struct vsp1_entity *entity,
8686 struct vsp1_pipeline *pipe,
87
+ struct vsp1_dl_list *dl,
8788 struct vsp1_dl_body *dlb)
8889 {
8990 const struct v4l2_mbus_framefmt *format;
9091 struct vsp1_lif *lif = to_lif(&entity->subdev);
91
- unsigned int hbth = 1300;
92
- unsigned int obth = 400;
93
- unsigned int lbth = 200;
92
+ unsigned int hbth;
93
+ unsigned int obth;
94
+ unsigned int lbth;
9495
9596 format = vsp1_entity_get_pad_format(&lif->entity, lif->entity.config,
9697 LIF_PAD_SOURCE);
9798
98
- obth = min(obth, (format->width + 1) / 2 * format->height - 4);
99
+ switch (entity->vsp1->version & VI6_IP_VERSION_MODEL_MASK) {
100
+ case VI6_IP_VERSION_MODEL_VSPD_GEN2:
101
+ case VI6_IP_VERSION_MODEL_VSPD_V2H:
102
+ hbth = 1536;
103
+ obth = min(128U, (format->width + 1) / 2 * format->height - 4);
104
+ lbth = 1520;
105
+ break;
106
+
107
+ case VI6_IP_VERSION_MODEL_VSPDL_GEN3:
108
+ case VI6_IP_VERSION_MODEL_VSPD_V3:
109
+ hbth = 0;
110
+ obth = 1500;
111
+ lbth = 0;
112
+ break;
113
+
114
+ case VI6_IP_VERSION_MODEL_VSPD_GEN3:
115
+ default:
116
+ hbth = 0;
117
+ obth = 3000;
118
+ lbth = 0;
119
+ break;
120
+ }
99121
100122 vsp1_lif_write(lif, dlb, VI6_LIF_CSBTH,
101123 (hbth << VI6_LIF_CSBTH_HBTH_SHIFT) |