Skip to contentSkip to conversation

media: aspeed: add a workaround to fix a silicon bug (Jae Hyun Yoo)

PATCH xiuzhi 1 participant 1 message May 31, 2019

Subsystems (2)
lore
Share & tools
lore

xiuzhi

author
#0 lore raw

Hi Jae,
I tested this patch ,it works on 1680*1050,but I found an issue:

The ikvm webpage will be black screen when you reboot the host after switching solution between 1680*1050 and 800*600 on chrome browser (my chrome version is 65). you can reproduce it:
1, Set host screen solution to 1680*1050 and save it . ikvm webpage works
2,Set host screen solution to 800*600 and 56Hz and save it. ikvm webpage works
3,Reset host screen solution to 1680*1050 and save it,
4,reboot the host,
5, the ikvm webpage is black screen when boot to Centos GUI
Best,
xiuzhi

AST2500 silicon revision A1 and A2 have a silicon bug which causes extremly long capturing time on specific resolutions (1680 width). To fix the bug, this commit adjusts the capturing window register setting to 1728 if detected width is 1680. The compression window register setting will be kept as the original width so output result will be the same.

---
 drivers/media/platform/aspeed-video.c | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)
drivers/media/platform/aspeed-video.c +19 -7
index da20e93f58d3..c2d4a2e6f20f 100644
@@ -826,8 +826,27 @@ static void aspeed_video_set_resolution(struct aspeed_video *video)
 	struct v4l2_bt_timings *act = &video->active_timings;
 	unsigned int size = act->width * act->height;
 
+	/* Set capture/compression frame sizes */
 	aspeed_video_calc_compressed_size(video, size);
 
+	if (video->active_timings.width == 1680) {
+		/*
+		 * This is a workaround to fix a silicon bug on A1 and A2
+		 * revisions. Since it doesn't break capturing operation on A0
+		 * revision, use it for all revisions without checking the
+		 * revision ID.
+		 */
+		aspeed_video_write(video, VE_CAP_WINDOW,
+				   1728 << 16 | act->height);
+		size += (1728 - 1680) * video->active_timings.height;
+	} else {
+		aspeed_video_write(video, VE_CAP_WINDOW,
+				   act->width << 16 | act->height);
+	}
+	aspeed_video_write(video, VE_COMP_WINDOW,
+			   act->width << 16 | act->height);
+	aspeed_video_write(video, VE_SRC_SCANLINE_OFFSET, act->width * 4);
+
 	/* Don't use direct mode below 1024 x 768 (irqs don't fire) */
 	if (size < DIRECT_FETCH_THRESHOLD) {
 		aspeed_video_write(video, VE_TGS_0,
@@ -844,13 +863,6 @@ static void aspeed_video_set_resolution(struct aspeed_video *video)
 		aspeed_video_update(video, VE_CTRL, 0, VE_CTRL_DIRECT_FETCH);
 	}
 
-	/* Set capture/compression frame sizes */
-	aspeed_video_write(video, VE_CAP_WINDOW,
-			   act->width << 16 | act->height);
-	aspeed_video_write(video, VE_COMP_WINDOW,
-			   act->width << 16 | act->height);
-	aspeed_video_write(video, VE_SRC_SCANLINE_OFFSET, act->width * 4);
-
 	size *= 4;
 
 	if (size == video->srcs[0].size / 2) {
Signature · 1 line
2.21.0