mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-30 13:03:01 +00:00
media: vivid: Introduce VIDEO_VIVID_OSD
vivid-osd depends on CONFIG_FB, which can be a large dependency. Introduce CONFIG_VIDEO_VIVID_OSD to control enabling support for testing output overlay. Suggested-by: Slawomir Rosek <srosek@google.com> Co-developed-by: Slawomir Rosek <srosek@google.com> Signed-off-by: Slawomir Rosek <srosek@google.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> [hverkuil: add newline to squash checkpatch warning]
This commit is contained in:
parent
ff71ef9478
commit
20889ddede
@ -1,9 +1,8 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
config VIDEO_VIVID
|
||||
tristate "Virtual Video Test Driver"
|
||||
depends on VIDEO_DEV && !SPARC32 && !SPARC64 && FB
|
||||
depends on VIDEO_DEV && !SPARC32 && !SPARC64
|
||||
depends on HAS_DMA
|
||||
select FB_IOMEM_HELPERS
|
||||
select FONT_SUPPORT
|
||||
select FONT_8x16
|
||||
select VIDEOBUF2_VMALLOC
|
||||
@ -31,6 +30,15 @@ config VIDEO_VIVID_CEC
|
||||
When selected the vivid module will emulate the optional
|
||||
HDMI CEC feature.
|
||||
|
||||
config VIDEO_VIVID_OSD
|
||||
bool "Enable Framebuffer for testing Output Overlay"
|
||||
depends on VIDEO_VIVID && FB
|
||||
default y
|
||||
select FB_IOMEM_HELPERS
|
||||
help
|
||||
When selected the vivid module will emulate a Framebuffer for
|
||||
testing Output Overlay.
|
||||
|
||||
config VIDEO_VIVID_MAX_DEVS
|
||||
int "Maximum number of devices"
|
||||
depends on VIDEO_VIVID
|
||||
|
@ -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_VIDEO_VIVID_OSD),y)
|
||||
vivid-objs += vivid-osd.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_VIDEO_VIVID) += vivid.o
|
||||
|
@ -125,7 +125,9 @@ MODULE_PARM_DESC(node_types, " node types, default is 0xe1d3d. Bitmask with the
|
||||
"\t\t bit 8: Video Output node\n"
|
||||
"\t\t bit 10-11: VBI Output node: 0 = none, 1 = raw vbi, 2 = sliced vbi, 3 = both\n"
|
||||
"\t\t bit 12: Radio Transmitter node\n"
|
||||
#ifdef CONFIG_VIDEO_VIVID_OSD
|
||||
"\t\t bit 16: Framebuffer for testing output overlays\n"
|
||||
#endif
|
||||
"\t\t bit 17: Metadata Capture node\n"
|
||||
"\t\t bit 18: Metadata Output node\n"
|
||||
"\t\t bit 19: Touch Capture node\n");
|
||||
@ -1071,9 +1073,11 @@ static int vivid_detect_feature_set(struct vivid_dev *dev, int inst,
|
||||
/* do we have a modulator? */
|
||||
*has_modulator = dev->has_radio_tx;
|
||||
|
||||
#ifdef CONFIG_VIDEO_VIVID_OSD
|
||||
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)
|
||||
|
@ -403,9 +403,11 @@ struct vivid_dev {
|
||||
int display_byte_stride;
|
||||
int bits_per_pixel;
|
||||
int bytes_per_pixel;
|
||||
#ifdef CONFIG_VIDEO_VIVID_OSD
|
||||
struct fb_info fb_info;
|
||||
struct fb_var_screeninfo fb_defined;
|
||||
struct fb_fix_screeninfo fb_fix;
|
||||
#endif
|
||||
|
||||
/* Error injection */
|
||||
bool disconnect_error;
|
||||
|
@ -8,9 +8,23 @@
|
||||
#ifndef _VIVID_OSD_H_
|
||||
#define _VIVID_OSD_H_
|
||||
|
||||
#ifdef CONFIG_VIDEO_VIVID_OSD
|
||||
int vivid_fb_init(struct vivid_dev *dev);
|
||||
void vivid_fb_deinit(struct vivid_dev *dev);
|
||||
void vivid_fb_clear(struct vivid_dev *dev);
|
||||
unsigned int vivid_fb_green_bits(struct vivid_dev *dev);
|
||||
#else
|
||||
static inline int vivid_fb_init(struct vivid_dev *dev)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline void vivid_fb_deinit(struct vivid_dev *dev) {}
|
||||
static inline void vivid_fb_clear(struct vivid_dev *dev) {}
|
||||
static inline unsigned int vivid_fb_green_bits(struct vivid_dev *dev)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user