From ab0546fdd01a8a8df0f15d0c648fa73aba76d173 Mon Sep 17 00:00:00 2001 From: William Wu Date: Wed, 8 Nov 2023 09:49:48 +0800 Subject: [PATCH] media: uvcvideo: set system status to performance when stream on For rockchip platforms, set performance frequency for the memory controller when uvc stream on, and clear it after uvc stream off. It can improve uvc streaming stability. Signed-off-by: William Wu Change-Id: I1dc0cf10c552bba2c3a0f8a1bb37d90f546eb4a3 --- drivers/media/usb/uvc/uvc_video.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index 03dfe96bceba..79ffe93b19ae 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -20,6 +20,8 @@ #include #include "uvcvideo.h" +#include +#include /* ------------------------------------------------------------------------ * UVC Controls @@ -2139,6 +2141,8 @@ int uvc_video_start_streaming(struct uvc_streaming *stream) if (ret < 0) goto error_commit; + rockchip_set_system_status(SYS_STATUS_PERFORMANCE); + ret = uvc_video_start_transfer(stream, GFP_KERNEL); if (ret < 0) goto error_video; @@ -2146,6 +2150,7 @@ int uvc_video_start_streaming(struct uvc_streaming *stream) return 0; error_video: + rockchip_clear_system_status(SYS_STATUS_PERFORMANCE); usb_set_interface(stream->dev->udev, stream->intfnum, 0); error_commit: uvc_video_clock_cleanup(stream); @@ -2176,4 +2181,5 @@ void uvc_video_stop_streaming(struct uvc_streaming *stream) } uvc_video_clock_cleanup(stream); + rockchip_clear_system_status(SYS_STATUS_PERFORMANCE); }