a8cc9f9c28
Signed-off-by: Andy Hu <andy.hu@starfivetech.com> (cherry picked from commit f475d9a3bceeefd19bebf3d3471cedf12a46b8fa)
22 lines
845 B
Diff
22 lines
845 B
Diff
--- a/sys/kms/gstkmssink.c 2020-10-26 19:14:46.656235000 +0800
|
|
+++ b/sys/kms/gstkmssink.c 2021-12-16 15:35:15.590755066 +0800
|
|
@@ -450,6 +450,18 @@
|
|
goto bo_failed;
|
|
fb_id = kmsmem->fb_id;
|
|
|
|
+ GST_INFO_OBJECT (self, "size = %lu, width = %d, height = %d.", vinfo->size, vinfo->width, vinfo->height);
|
|
+ if (vinfo->size == vinfo->width * vinfo->height * 3 / 2) {
|
|
+ GstMapInfo mapInfo;
|
|
+ if (gst_memory_map((GstMemory *)kmsmem, &mapInfo, GST_MAP_WRITE)) {
|
|
+ guint8 *start = mapInfo.data + vinfo->width * vinfo->height;
|
|
+ guint32 size = vinfo->width * vinfo->height / 2;
|
|
+ GST_INFO_OBJECT (self, "Set buffer to blank.");
|
|
+ memset(start, 128, size);
|
|
+ gst_memory_unmap((GstMemory *)kmsmem, &mapInfo);
|
|
+ }
|
|
+ }
|
|
+
|
|
conn = drmModeGetConnector (self->fd, self->conn_id);
|
|
if (!conn)
|
|
goto connector_failed;
|