From ade66719aa7661f537914072f96e5182b35548d2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 28 Sep 2021 12:52:01 +0100 Subject: [PATCH] tvservice: Add check to warn when running with kms --- host_applications/linux/apps/tvservice/CMakeLists.txt | 3 ++- host_applications/linux/apps/tvservice/tvservice.c | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/host_applications/linux/apps/tvservice/CMakeLists.txt b/host_applications/linux/apps/tvservice/CMakeLists.txt index 6506842..0190774 100644 --- a/host_applications/linux/apps/tvservice/CMakeLists.txt +++ b/host_applications/linux/apps/tvservice/CMakeLists.txt @@ -1,5 +1,6 @@ +include_directories(${PROJECT_SOURCE_DIR}/host_applications/linux/libs/bcm_host/include) add_executable(tvservice tvservice.c) -target_link_libraries(tvservice vchostif) +target_link_libraries(tvservice vchostif bcm_host) install(TARGETS tvservice RUNTIME DESTINATION bin) diff --git a/host_applications/linux/apps/tvservice/tvservice.c b/host_applications/linux/apps/tvservice/tvservice.c index 451d56d..b5e7dc6 100644 --- a/host_applications/linux/apps/tvservice/tvservice.c +++ b/host_applications/linux/apps/tvservice/tvservice.c @@ -37,6 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include "bcm_host.h" #include "interface/vmcs_host/vc_tvservice.h" #define TV_SUPPORTED_MODE_T TV_SUPPORTED_MODE_NEW_T @@ -806,6 +807,14 @@ int main( int argc, char **argv ) int sdtvon_progressive = 0; TV_ATTACHED_DEVICES_T devices; + if (bcm_host_is_kms_active()) + { + fprintf(stderr, "%s is not supported when using the vc4-kms-v3d driver.\n" + "Similar features are available with standard linux tools\n" + "such as modetest from libdrm-tests.\n", argv[0]); + exit(1); + } + // Initialize VCOS vcos_init();