18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Xilinx Video IP Core 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2013-2015 Ideas on Board 68c2ecf20Sopenharmony_ci * Copyright (C) 2013-2015 Xilinx, Inc. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Contacts: Hyun Kwon <hyun.kwon@xilinx.com> 98c2ecf20Sopenharmony_ci * Laurent Pinchart <laurent.pinchart@ideasonboard.com> 108c2ecf20Sopenharmony_ci */ 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include <linux/clk.h> 138c2ecf20Sopenharmony_ci#include <linux/export.h> 148c2ecf20Sopenharmony_ci#include <linux/kernel.h> 158c2ecf20Sopenharmony_ci#include <linux/of.h> 168c2ecf20Sopenharmony_ci#include <linux/platform_device.h> 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#include <dt-bindings/media/xilinx-vip.h> 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#include "xilinx-vip.h" 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci/* ----------------------------------------------------------------------------- 238c2ecf20Sopenharmony_ci * Helper functions 248c2ecf20Sopenharmony_ci */ 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_cistatic const struct xvip_video_format xvip_video_formats[] = { 278c2ecf20Sopenharmony_ci { XVIP_VF_YUV_422, 8, NULL, MEDIA_BUS_FMT_UYVY8_1X16, 288c2ecf20Sopenharmony_ci 2, V4L2_PIX_FMT_YUYV }, 298c2ecf20Sopenharmony_ci { XVIP_VF_YUV_444, 8, NULL, MEDIA_BUS_FMT_VUY8_1X24, 308c2ecf20Sopenharmony_ci 3, V4L2_PIX_FMT_YUV444 }, 318c2ecf20Sopenharmony_ci { XVIP_VF_RBG, 8, NULL, MEDIA_BUS_FMT_RBG888_1X24, 328c2ecf20Sopenharmony_ci 3, 0 }, 338c2ecf20Sopenharmony_ci { XVIP_VF_MONO_SENSOR, 8, "mono", MEDIA_BUS_FMT_Y8_1X8, 348c2ecf20Sopenharmony_ci 1, V4L2_PIX_FMT_GREY }, 358c2ecf20Sopenharmony_ci { XVIP_VF_MONO_SENSOR, 8, "rggb", MEDIA_BUS_FMT_SRGGB8_1X8, 368c2ecf20Sopenharmony_ci 1, V4L2_PIX_FMT_SRGGB8 }, 378c2ecf20Sopenharmony_ci { XVIP_VF_MONO_SENSOR, 8, "grbg", MEDIA_BUS_FMT_SGRBG8_1X8, 388c2ecf20Sopenharmony_ci 1, V4L2_PIX_FMT_SGRBG8 }, 398c2ecf20Sopenharmony_ci { XVIP_VF_MONO_SENSOR, 8, "gbrg", MEDIA_BUS_FMT_SGBRG8_1X8, 408c2ecf20Sopenharmony_ci 1, V4L2_PIX_FMT_SGBRG8 }, 418c2ecf20Sopenharmony_ci { XVIP_VF_MONO_SENSOR, 8, "bggr", MEDIA_BUS_FMT_SBGGR8_1X8, 428c2ecf20Sopenharmony_ci 1, V4L2_PIX_FMT_SBGGR8 }, 438c2ecf20Sopenharmony_ci}; 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci/** 468c2ecf20Sopenharmony_ci * xvip_get_format_by_code - Retrieve format information for a media bus code 478c2ecf20Sopenharmony_ci * @code: the format media bus code 488c2ecf20Sopenharmony_ci * 498c2ecf20Sopenharmony_ci * Return: a pointer to the format information structure corresponding to the 508c2ecf20Sopenharmony_ci * given V4L2 media bus format @code, or ERR_PTR if no corresponding format can 518c2ecf20Sopenharmony_ci * be found. 528c2ecf20Sopenharmony_ci */ 538c2ecf20Sopenharmony_ciconst struct xvip_video_format *xvip_get_format_by_code(unsigned int code) 548c2ecf20Sopenharmony_ci{ 558c2ecf20Sopenharmony_ci unsigned int i; 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci for (i = 0; i < ARRAY_SIZE(xvip_video_formats); ++i) { 588c2ecf20Sopenharmony_ci const struct xvip_video_format *format = &xvip_video_formats[i]; 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci if (format->code == code) 618c2ecf20Sopenharmony_ci return format; 628c2ecf20Sopenharmony_ci } 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci return ERR_PTR(-EINVAL); 658c2ecf20Sopenharmony_ci} 668c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(xvip_get_format_by_code); 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ci/** 698c2ecf20Sopenharmony_ci * xvip_get_format_by_fourcc - Retrieve format information for a 4CC 708c2ecf20Sopenharmony_ci * @fourcc: the format 4CC 718c2ecf20Sopenharmony_ci * 728c2ecf20Sopenharmony_ci * Return: a pointer to the format information structure corresponding to the 738c2ecf20Sopenharmony_ci * given V4L2 format @fourcc, or ERR_PTR if no corresponding format can be 748c2ecf20Sopenharmony_ci * found. 758c2ecf20Sopenharmony_ci */ 768c2ecf20Sopenharmony_ciconst struct xvip_video_format *xvip_get_format_by_fourcc(u32 fourcc) 778c2ecf20Sopenharmony_ci{ 788c2ecf20Sopenharmony_ci unsigned int i; 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci for (i = 0; i < ARRAY_SIZE(xvip_video_formats); ++i) { 818c2ecf20Sopenharmony_ci const struct xvip_video_format *format = &xvip_video_formats[i]; 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci if (format->fourcc == fourcc) 848c2ecf20Sopenharmony_ci return format; 858c2ecf20Sopenharmony_ci } 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci return ERR_PTR(-EINVAL); 888c2ecf20Sopenharmony_ci} 898c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(xvip_get_format_by_fourcc); 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci/** 928c2ecf20Sopenharmony_ci * xvip_of_get_format - Parse a device tree node and return format information 938c2ecf20Sopenharmony_ci * @node: the device tree node 948c2ecf20Sopenharmony_ci * 958c2ecf20Sopenharmony_ci * Read the xlnx,video-format, xlnx,video-width and xlnx,cfa-pattern properties 968c2ecf20Sopenharmony_ci * from the device tree @node passed as an argument and return the corresponding 978c2ecf20Sopenharmony_ci * format information. 988c2ecf20Sopenharmony_ci * 998c2ecf20Sopenharmony_ci * Return: a pointer to the format information structure corresponding to the 1008c2ecf20Sopenharmony_ci * format name and width, or ERR_PTR if no corresponding format can be found. 1018c2ecf20Sopenharmony_ci */ 1028c2ecf20Sopenharmony_ciconst struct xvip_video_format *xvip_of_get_format(struct device_node *node) 1038c2ecf20Sopenharmony_ci{ 1048c2ecf20Sopenharmony_ci const char *pattern = "mono"; 1058c2ecf20Sopenharmony_ci unsigned int vf_code; 1068c2ecf20Sopenharmony_ci unsigned int i; 1078c2ecf20Sopenharmony_ci u32 width; 1088c2ecf20Sopenharmony_ci int ret; 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ci ret = of_property_read_u32(node, "xlnx,video-format", &vf_code); 1118c2ecf20Sopenharmony_ci if (ret < 0) 1128c2ecf20Sopenharmony_ci return ERR_PTR(ret); 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci ret = of_property_read_u32(node, "xlnx,video-width", &width); 1158c2ecf20Sopenharmony_ci if (ret < 0) 1168c2ecf20Sopenharmony_ci return ERR_PTR(ret); 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ci if (vf_code == XVIP_VF_MONO_SENSOR) 1198c2ecf20Sopenharmony_ci of_property_read_string(node, "xlnx,cfa-pattern", &pattern); 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci for (i = 0; i < ARRAY_SIZE(xvip_video_formats); ++i) { 1228c2ecf20Sopenharmony_ci const struct xvip_video_format *format = &xvip_video_formats[i]; 1238c2ecf20Sopenharmony_ci 1248c2ecf20Sopenharmony_ci if (format->vf_code != vf_code || format->width != width) 1258c2ecf20Sopenharmony_ci continue; 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_ci if (vf_code == XVIP_VF_MONO_SENSOR && 1288c2ecf20Sopenharmony_ci strcmp(pattern, format->pattern)) 1298c2ecf20Sopenharmony_ci continue; 1308c2ecf20Sopenharmony_ci 1318c2ecf20Sopenharmony_ci return format; 1328c2ecf20Sopenharmony_ci } 1338c2ecf20Sopenharmony_ci 1348c2ecf20Sopenharmony_ci return ERR_PTR(-EINVAL); 1358c2ecf20Sopenharmony_ci} 1368c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(xvip_of_get_format); 1378c2ecf20Sopenharmony_ci 1388c2ecf20Sopenharmony_ci/** 1398c2ecf20Sopenharmony_ci * xvip_set_format_size - Set the media bus frame format size 1408c2ecf20Sopenharmony_ci * @format: V4L2 frame format on media bus 1418c2ecf20Sopenharmony_ci * @fmt: media bus format 1428c2ecf20Sopenharmony_ci * 1438c2ecf20Sopenharmony_ci * Set the media bus frame format size. The width / height from the subdevice 1448c2ecf20Sopenharmony_ci * format are set to the given media bus format. The new format size is stored 1458c2ecf20Sopenharmony_ci * in @format. The width and height are clamped using default min / max values. 1468c2ecf20Sopenharmony_ci */ 1478c2ecf20Sopenharmony_civoid xvip_set_format_size(struct v4l2_mbus_framefmt *format, 1488c2ecf20Sopenharmony_ci const struct v4l2_subdev_format *fmt) 1498c2ecf20Sopenharmony_ci{ 1508c2ecf20Sopenharmony_ci format->width = clamp_t(unsigned int, fmt->format.width, 1518c2ecf20Sopenharmony_ci XVIP_MIN_WIDTH, XVIP_MAX_WIDTH); 1528c2ecf20Sopenharmony_ci format->height = clamp_t(unsigned int, fmt->format.height, 1538c2ecf20Sopenharmony_ci XVIP_MIN_HEIGHT, XVIP_MAX_HEIGHT); 1548c2ecf20Sopenharmony_ci} 1558c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(xvip_set_format_size); 1568c2ecf20Sopenharmony_ci 1578c2ecf20Sopenharmony_ci/** 1588c2ecf20Sopenharmony_ci * xvip_clr_or_set - Clear or set the register with a bitmask 1598c2ecf20Sopenharmony_ci * @xvip: Xilinx Video IP device 1608c2ecf20Sopenharmony_ci * @addr: address of register 1618c2ecf20Sopenharmony_ci * @mask: bitmask to be set or cleared 1628c2ecf20Sopenharmony_ci * @set: boolean flag indicating whether to set or clear 1638c2ecf20Sopenharmony_ci * 1648c2ecf20Sopenharmony_ci * Clear or set the register at address @addr with a bitmask @mask depending on 1658c2ecf20Sopenharmony_ci * the boolean flag @set. When the flag @set is true, the bitmask is set in 1668c2ecf20Sopenharmony_ci * the register, otherwise the bitmask is cleared from the register 1678c2ecf20Sopenharmony_ci * when the flag @set is false. 1688c2ecf20Sopenharmony_ci * 1698c2ecf20Sopenharmony_ci * Fox example, this function can be used to set a control with a boolean value 1708c2ecf20Sopenharmony_ci * requested by users. If the caller knows whether to set or clear in the first 1718c2ecf20Sopenharmony_ci * place, the caller should call xvip_clr() or xvip_set() directly instead of 1728c2ecf20Sopenharmony_ci * using this function. 1738c2ecf20Sopenharmony_ci */ 1748c2ecf20Sopenharmony_civoid xvip_clr_or_set(struct xvip_device *xvip, u32 addr, u32 mask, bool set) 1758c2ecf20Sopenharmony_ci{ 1768c2ecf20Sopenharmony_ci u32 reg; 1778c2ecf20Sopenharmony_ci 1788c2ecf20Sopenharmony_ci reg = xvip_read(xvip, addr); 1798c2ecf20Sopenharmony_ci reg = set ? reg | mask : reg & ~mask; 1808c2ecf20Sopenharmony_ci xvip_write(xvip, addr, reg); 1818c2ecf20Sopenharmony_ci} 1828c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(xvip_clr_or_set); 1838c2ecf20Sopenharmony_ci 1848c2ecf20Sopenharmony_ci/** 1858c2ecf20Sopenharmony_ci * xvip_clr_and_set - Clear and set the register with a bitmask 1868c2ecf20Sopenharmony_ci * @xvip: Xilinx Video IP device 1878c2ecf20Sopenharmony_ci * @addr: address of register 1888c2ecf20Sopenharmony_ci * @clr: bitmask to be cleared 1898c2ecf20Sopenharmony_ci * @set: bitmask to be set 1908c2ecf20Sopenharmony_ci * 1918c2ecf20Sopenharmony_ci * Clear a bit(s) of mask @clr in the register at address @addr, then set 1928c2ecf20Sopenharmony_ci * a bit(s) of mask @set in the register after. 1938c2ecf20Sopenharmony_ci */ 1948c2ecf20Sopenharmony_civoid xvip_clr_and_set(struct xvip_device *xvip, u32 addr, u32 clr, u32 set) 1958c2ecf20Sopenharmony_ci{ 1968c2ecf20Sopenharmony_ci u32 reg; 1978c2ecf20Sopenharmony_ci 1988c2ecf20Sopenharmony_ci reg = xvip_read(xvip, addr); 1998c2ecf20Sopenharmony_ci reg &= ~clr; 2008c2ecf20Sopenharmony_ci reg |= set; 2018c2ecf20Sopenharmony_ci xvip_write(xvip, addr, reg); 2028c2ecf20Sopenharmony_ci} 2038c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(xvip_clr_and_set); 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ciint xvip_init_resources(struct xvip_device *xvip) 2068c2ecf20Sopenharmony_ci{ 2078c2ecf20Sopenharmony_ci struct platform_device *pdev = to_platform_device(xvip->dev); 2088c2ecf20Sopenharmony_ci struct resource *res; 2098c2ecf20Sopenharmony_ci 2108c2ecf20Sopenharmony_ci res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2118c2ecf20Sopenharmony_ci xvip->iomem = devm_ioremap_resource(xvip->dev, res); 2128c2ecf20Sopenharmony_ci if (IS_ERR(xvip->iomem)) 2138c2ecf20Sopenharmony_ci return PTR_ERR(xvip->iomem); 2148c2ecf20Sopenharmony_ci 2158c2ecf20Sopenharmony_ci xvip->clk = devm_clk_get(xvip->dev, NULL); 2168c2ecf20Sopenharmony_ci if (IS_ERR(xvip->clk)) 2178c2ecf20Sopenharmony_ci return PTR_ERR(xvip->clk); 2188c2ecf20Sopenharmony_ci 2198c2ecf20Sopenharmony_ci clk_prepare_enable(xvip->clk); 2208c2ecf20Sopenharmony_ci return 0; 2218c2ecf20Sopenharmony_ci} 2228c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(xvip_init_resources); 2238c2ecf20Sopenharmony_ci 2248c2ecf20Sopenharmony_civoid xvip_cleanup_resources(struct xvip_device *xvip) 2258c2ecf20Sopenharmony_ci{ 2268c2ecf20Sopenharmony_ci clk_disable_unprepare(xvip->clk); 2278c2ecf20Sopenharmony_ci} 2288c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(xvip_cleanup_resources); 2298c2ecf20Sopenharmony_ci 2308c2ecf20Sopenharmony_ci/* ----------------------------------------------------------------------------- 2318c2ecf20Sopenharmony_ci * Subdev operations handlers 2328c2ecf20Sopenharmony_ci */ 2338c2ecf20Sopenharmony_ci 2348c2ecf20Sopenharmony_ci/** 2358c2ecf20Sopenharmony_ci * xvip_enum_mbus_code - Enumerate the media format code 2368c2ecf20Sopenharmony_ci * @subdev: V4L2 subdevice 2378c2ecf20Sopenharmony_ci * @cfg: V4L2 subdev pad configuration 2388c2ecf20Sopenharmony_ci * @code: returning media bus code 2398c2ecf20Sopenharmony_ci * 2408c2ecf20Sopenharmony_ci * Enumerate the media bus code of the subdevice. Return the corresponding 2418c2ecf20Sopenharmony_ci * pad format code. This function only works for subdevices with fixed format 2428c2ecf20Sopenharmony_ci * on all pads. Subdevices with multiple format should have their own 2438c2ecf20Sopenharmony_ci * function to enumerate mbus codes. 2448c2ecf20Sopenharmony_ci * 2458c2ecf20Sopenharmony_ci * Return: 0 if the media bus code is found, or -EINVAL if the format index 2468c2ecf20Sopenharmony_ci * is not valid. 2478c2ecf20Sopenharmony_ci */ 2488c2ecf20Sopenharmony_ciint xvip_enum_mbus_code(struct v4l2_subdev *subdev, 2498c2ecf20Sopenharmony_ci struct v4l2_subdev_pad_config *cfg, 2508c2ecf20Sopenharmony_ci struct v4l2_subdev_mbus_code_enum *code) 2518c2ecf20Sopenharmony_ci{ 2528c2ecf20Sopenharmony_ci struct v4l2_mbus_framefmt *format; 2538c2ecf20Sopenharmony_ci 2548c2ecf20Sopenharmony_ci /* Enumerating frame sizes based on the active configuration isn't 2558c2ecf20Sopenharmony_ci * supported yet. 2568c2ecf20Sopenharmony_ci */ 2578c2ecf20Sopenharmony_ci if (code->which == V4L2_SUBDEV_FORMAT_ACTIVE) 2588c2ecf20Sopenharmony_ci return -EINVAL; 2598c2ecf20Sopenharmony_ci 2608c2ecf20Sopenharmony_ci if (code->index) 2618c2ecf20Sopenharmony_ci return -EINVAL; 2628c2ecf20Sopenharmony_ci 2638c2ecf20Sopenharmony_ci format = v4l2_subdev_get_try_format(subdev, cfg, code->pad); 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_ci code->code = format->code; 2668c2ecf20Sopenharmony_ci 2678c2ecf20Sopenharmony_ci return 0; 2688c2ecf20Sopenharmony_ci} 2698c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(xvip_enum_mbus_code); 2708c2ecf20Sopenharmony_ci 2718c2ecf20Sopenharmony_ci/** 2728c2ecf20Sopenharmony_ci * xvip_enum_frame_size - Enumerate the media bus frame size 2738c2ecf20Sopenharmony_ci * @subdev: V4L2 subdevice 2748c2ecf20Sopenharmony_ci * @cfg: V4L2 subdev pad configuration 2758c2ecf20Sopenharmony_ci * @fse: returning media bus frame size 2768c2ecf20Sopenharmony_ci * 2778c2ecf20Sopenharmony_ci * This function is a drop-in implementation of the subdev enum_frame_size pad 2788c2ecf20Sopenharmony_ci * operation. It assumes that the subdevice has one sink pad and one source 2798c2ecf20Sopenharmony_ci * pad, and that the format on the source pad is always identical to the 2808c2ecf20Sopenharmony_ci * format on the sink pad. Entities with different requirements need to 2818c2ecf20Sopenharmony_ci * implement their own enum_frame_size handlers. 2828c2ecf20Sopenharmony_ci * 2838c2ecf20Sopenharmony_ci * Return: 0 if the media bus frame size is found, or -EINVAL 2848c2ecf20Sopenharmony_ci * if the index or the code is not valid. 2858c2ecf20Sopenharmony_ci */ 2868c2ecf20Sopenharmony_ciint xvip_enum_frame_size(struct v4l2_subdev *subdev, 2878c2ecf20Sopenharmony_ci struct v4l2_subdev_pad_config *cfg, 2888c2ecf20Sopenharmony_ci struct v4l2_subdev_frame_size_enum *fse) 2898c2ecf20Sopenharmony_ci{ 2908c2ecf20Sopenharmony_ci struct v4l2_mbus_framefmt *format; 2918c2ecf20Sopenharmony_ci 2928c2ecf20Sopenharmony_ci /* Enumerating frame sizes based on the active configuration isn't 2938c2ecf20Sopenharmony_ci * supported yet. 2948c2ecf20Sopenharmony_ci */ 2958c2ecf20Sopenharmony_ci if (fse->which == V4L2_SUBDEV_FORMAT_ACTIVE) 2968c2ecf20Sopenharmony_ci return -EINVAL; 2978c2ecf20Sopenharmony_ci 2988c2ecf20Sopenharmony_ci format = v4l2_subdev_get_try_format(subdev, cfg, fse->pad); 2998c2ecf20Sopenharmony_ci 3008c2ecf20Sopenharmony_ci if (fse->index || fse->code != format->code) 3018c2ecf20Sopenharmony_ci return -EINVAL; 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_ci if (fse->pad == XVIP_PAD_SINK) { 3048c2ecf20Sopenharmony_ci fse->min_width = XVIP_MIN_WIDTH; 3058c2ecf20Sopenharmony_ci fse->max_width = XVIP_MAX_WIDTH; 3068c2ecf20Sopenharmony_ci fse->min_height = XVIP_MIN_HEIGHT; 3078c2ecf20Sopenharmony_ci fse->max_height = XVIP_MAX_HEIGHT; 3088c2ecf20Sopenharmony_ci } else { 3098c2ecf20Sopenharmony_ci /* The size on the source pad is fixed and always identical to 3108c2ecf20Sopenharmony_ci * the size on the sink pad. 3118c2ecf20Sopenharmony_ci */ 3128c2ecf20Sopenharmony_ci fse->min_width = format->width; 3138c2ecf20Sopenharmony_ci fse->max_width = format->width; 3148c2ecf20Sopenharmony_ci fse->min_height = format->height; 3158c2ecf20Sopenharmony_ci fse->max_height = format->height; 3168c2ecf20Sopenharmony_ci } 3178c2ecf20Sopenharmony_ci 3188c2ecf20Sopenharmony_ci return 0; 3198c2ecf20Sopenharmony_ci} 3208c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(xvip_enum_frame_size); 321