From patchwork Thu Jul 29 11:16:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Tucker X-Patchwork-Id: 488659 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp2063690jas; Thu, 29 Jul 2021 04:16:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzl2+khPTiI26JW0nma8Ildo6QcCRKGNhKrffv04RTOajyge3L3UCo9a8Pi7k8JaGHx3zXg X-Received: by 2002:a17:906:648f:: with SMTP id e15mr4165632ejm.451.1627557406382; Thu, 29 Jul 2021 04:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627557406; cv=none; d=google.com; s=arc-20160816; b=EljY4cGy3kFhK0dbG/X/+YqVbzlx1THhCi7G4ztbAnxU3pzhh0GqCsL7/8OazflEaR DjPlkYH8o1er5KwAFi3W6W/oJXlT4OQDAECM04n6ABnCedgWkMUEOLExi4NuQdQG86G5 QUx372O6iCz4z2xdjYZFzD43HT01Hia937H2fNgkHnZ/YXYBzbcLQDFBruq4fmllc9PW YG5GnKfW+xh25rqcc8SLBvMJBvKThZovSxx9aDlJTuk3dT7MeN+t8jpWGSQt1Wh1MFIW thtYKyhc72wcuQA1LInILl5szuhuQqev+UPX1sSYXVg+kOzm2foGnmhO0qDB33GXcpbd CmHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=shia8FO+jjP8IhLGQC99HTSkCg/wbrrEp7bEbOHgFi0=; b=RAbtuzRa4rGaHYl/9LVwMxdvSLGnxqXZRUaDiJBJ309x6/58boTx0sCYQt3isDv5dL wMrHfNvZeNK9A7n75xWOjDPnoKI6TKg+QbbC8Frg4qbOk0aGkyPa8SkX+SZQBxxkiFbS JfYjerayX1R2I44X9dCLl6x7vs92XiimwQOpNvztkJ3iwdqsK6rZE2n03uoFEjWlsDzn kDGU1E48Q6t/RxuJ5TUv08adDmUC6btyTOBbCC2crU1qImWSIzyVfI7ux906/SDSJD7X /A4LMofoif9rJL6ggZq4MakU9mznGSo7ju5ZqcBisNJXezgHrfwPBDBKKGwxK0qvv0+J auQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id re14si2597054ejb.640.2021.07.29.04.16.46; Thu, 29 Jul 2021 04:16:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236577AbhG2LQi (ORCPT + 4 others); Thu, 29 Jul 2021 07:16:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236312AbhG2LQg (ORCPT ); Thu, 29 Jul 2021 07:16:36 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 547A0C061765; Thu, 29 Jul 2021 04:16:33 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gtucker) with ESMTPSA id EFFE71F43E00 From: Guillaume Tucker To: Hans Verkuil , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: [PATCH] media: vivid: drop CONFIG_FB dependency Date: Thu, 29 Jul 2021 12:16:15 +0100 Message-Id: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Drop the vivid dependency on CONFIG_FB by compiling out parts of the code that make use of the framebuffer API when not enabled. This is particularly useful as CONFIG_FB is not selected any more by DRM_FBDEV_EMULATION. Suggested-by: Hans Verkuil Signed-off-by: Guillaume Tucker --- drivers/media/test-drivers/vivid/Kconfig | 5 +---- drivers/media/test-drivers/vivid/Makefile | 5 ++++- drivers/media/test-drivers/vivid/vivid-core.c | 7 +++++++ drivers/media/test-drivers/vivid/vivid-ctrls.c | 4 ++++ 4 files changed, 16 insertions(+), 5 deletions(-) -- 2.20.1 Tested-by: "kernelci.org bot" Reported-by: kernel test robot diff --git a/drivers/media/test-drivers/vivid/Kconfig b/drivers/media/test-drivers/vivid/Kconfig index c3abde2986b2..06ad350f1903 100644 --- a/drivers/media/test-drivers/vivid/Kconfig +++ b/drivers/media/test-drivers/vivid/Kconfig @@ -1,13 +1,10 @@ # SPDX-License-Identifier: GPL-2.0-only config VIDEO_VIVID tristate "Virtual Video Test Driver" - depends on VIDEO_DEV && VIDEO_V4L2 && !SPARC32 && !SPARC64 && FB + depends on VIDEO_DEV && VIDEO_V4L2 && !SPARC32 && !SPARC64 depends on HAS_DMA select FONT_SUPPORT select FONT_8x16 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT select VIDEOBUF2_VMALLOC select VIDEOBUF2_DMA_CONTIG select VIDEO_V4L2_TPG diff --git a/drivers/media/test-drivers/vivid/Makefile b/drivers/media/test-drivers/vivid/Makefile index b12ad0152a3e..a9e4bc8dc599 100644 --- a/drivers/media/test-drivers/vivid/Makefile +++ b/drivers/media/test-drivers/vivid/Makefile @@ -3,10 +3,13 @@ vivid-objs := vivid-core.o vivid-ctrls.o vivid-vid-common.o vivid-vbi-gen.o \ vivid-vid-cap.o vivid-vid-out.o vivid-kthread-cap.o vivid-kthread-out.o \ vivid-radio-rx.o vivid-radio-tx.o vivid-radio-common.o \ vivid-rds-gen.o vivid-sdr-cap.o vivid-vbi-cap.o vivid-vbi-out.o \ - vivid-osd.o vivid-meta-cap.o vivid-meta-out.o \ + vivid-meta-cap.o vivid-meta-out.o \ vivid-kthread-touch.o vivid-touch-cap.o ifeq ($(CONFIG_VIDEO_VIVID_CEC),y) vivid-objs += vivid-cec.o endif +ifeq ($(CONFIG_FB),y) + vivid-objs += vivid-osd.o +endif obj-$(CONFIG_VIDEO_VIVID) += vivid.o diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c index d2bd2653cf54..71f3b9af4ffc 100644 --- a/drivers/media/test-drivers/vivid/vivid-core.c +++ b/drivers/media/test-drivers/vivid/vivid-core.c @@ -1021,9 +1021,11 @@ static int vivid_detect_feature_set(struct vivid_dev *dev, int inst, /* do we have a modulator? */ *has_modulator = dev->has_radio_tx; +#if IS_ENABLED(CONFIG_FB) if (dev->has_vid_cap) /* do we have a framebuffer for overlay testing? */ dev->has_fb = node_type & 0x10000; +#endif /* can we do crop/compose/scaling while capturing? */ if (no_error_inj && *ccs_cap == -1) @@ -1355,6 +1357,7 @@ static int vivid_create_queues(struct vivid_dev *dev) return ret; } +#if IS_ENABLED(CONFIG_FB) if (dev->has_fb) { /* Create framebuffer for testing capture/output overlay */ ret = vivid_fb_init(dev); @@ -1363,6 +1366,8 @@ static int vivid_create_queues(struct vivid_dev *dev) v4l2_info(&dev->v4l2_dev, "Framebuffer device registered as fb%d\n", dev->fb_info.node); } +#endif + return 0; } @@ -2069,12 +2074,14 @@ static int vivid_remove(struct platform_device *pdev) video_device_node_name(&dev->radio_tx_dev)); video_unregister_device(&dev->radio_tx_dev); } +#if IS_ENABLED(CONFIG_FB) if (dev->has_fb) { v4l2_info(&dev->v4l2_dev, "unregistering fb%d\n", dev->fb_info.node); unregister_framebuffer(&dev->fb_info); vivid_fb_release_buffers(dev); } +#endif if (dev->has_meta_cap) { v4l2_info(&dev->v4l2_dev, "unregistering %s\n", video_device_node_name(&dev->meta_cap_dev)); diff --git a/drivers/media/test-drivers/vivid/vivid-ctrls.c b/drivers/media/test-drivers/vivid/vivid-ctrls.c index 8dc50fe22972..081470a1d88a 100644 --- a/drivers/media/test-drivers/vivid/vivid-ctrls.c +++ b/drivers/media/test-drivers/vivid/vivid-ctrls.c @@ -305,6 +305,7 @@ static const struct v4l2_ctrl_config vivid_ctrl_ro_int32 = { /* Framebuffer Controls */ +#if IS_ENABLED(CONFIG_FB) static int vivid_fb_s_ctrl(struct v4l2_ctrl *ctrl) { struct vivid_dev *dev = container_of(ctrl->handler, @@ -328,6 +329,7 @@ static const struct v4l2_ctrl_config vivid_ctrl_clear_fb = { .name = "Clear Framebuffer", .type = V4L2_CTRL_TYPE_BUTTON, }; +#endif /* IS_ENABLED(CONFIG_FB) */ /* Video User Controls */ @@ -1761,8 +1763,10 @@ int vivid_create_controls(struct vivid_dev *dev, bool show_ccs_cap, (dev->has_vbi_cap && dev->has_vbi_out)) v4l2_ctrl_new_custom(hdl_loop_cap, &vivid_ctrl_loop_video, NULL); +#if IS_ENABLED(CONFIG_FB) if (dev->has_fb) v4l2_ctrl_new_custom(hdl_fb, &vivid_ctrl_clear_fb, NULL); +#endif if (dev->has_radio_rx) { v4l2_ctrl_new_custom(hdl_radio_rx, &vivid_ctrl_radio_hw_seek_mode, NULL);