Re: [PATCH v2 3/9] clk: sunxi: Add prcm mod0 clock driver
Hi, On 11/25/2014 05:57 PM, Lee Jones wrote: On Sun, 23 Nov 2014, Hans de Goede wrote: Add a driver for mod0 clocks found in the prcm. Currently there is only one mod0 clocks in the prcm, the ir clock. Signed-off-by: Hans de Goede hdego...@redhat.com --- Documentation/devicetree/bindings/clock/sunxi.txt | 1 + drivers/clk/sunxi/Makefile| 2 +- drivers/clk/sunxi/clk-sun6i-prcm-mod0.c | 63 +++ drivers/mfd/sun6i-prcm.c | 14 + 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/sunxi/clk-sun6i-prcm-mod0.c [...] diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c index 283ab8d..ff1254f 100644 --- a/drivers/mfd/sun6i-prcm.c +++ b/drivers/mfd/sun6i-prcm.c @@ -41,6 +41,14 @@ static const struct resource sun6i_a31_apb0_gates_clk_res[] = { }, }; +static const struct resource sun6i_a31_ir_clk_res[] = { + { + .start = 0x54, + .end = 0x57, + .flags = IORESOURCE_MEM, + }, +}; I'm not overly keen on these magic numbers (and yes, I'm well aware that I SoB'ed the patch which started them off). It's not a show stopper, although I'd prefer if they were fixed with a subsequent patch. These are offsets of the relevant registers inside the prcm register block, if not done this way, then how should they be done ? Regards, Hans -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] v4l: vsp1: Reset VSP1 RPF source address
Hi Hayama-san, On Wed, Nov 26, 2014 at 7:19 AM, Takanari Hayama t...@igel.co.jp wrote: @@ -179,6 +190,10 @@ static void rpf_vdev_queue(struct vsp1_video *video, struct vsp1_video_buffer *buf) { struct vsp1_rwpf *rpf = container_of(video, struct vsp1_rwpf, video); + int i; + + for (i = 0; i 3; i++) + rpf-buf_addr[i] = buf-addr[i]; vsp1_video_buffer.addr is dma_addr_t addr[3];... BTW, you can use memcpy() instead of an explicit loop. vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_Y, buf-addr[0] + rpf-offsets[0]); diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.h b/drivers/media/platform/vsp1/vsp1_rwpf.h index 28dd9e7..1f98fe3 100644 --- a/drivers/media/platform/vsp1/vsp1_rwpf.h +++ b/drivers/media/platform/vsp1/vsp1_rwpf.h @@ -39,6 +39,8 @@ struct vsp1_rwpf { struct v4l2_rect crop; unsigned int offsets[2]; + + unsigned int buf_addr[3]; ... hence the above should use dma_addr_t, too. If CONFIG_ARM_LPAE is enabled, CONFIG_ARCH_DMA_ADDR_T_64BIT will be enabled, too, and dma_addr_t will be u64. }; Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say programmer or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Compiling STK1160 driver for Android
Hi, guys! I have: 1. 05e1:0408 USB ID STK1160 chip GM7113 (SAA7113 clone) video processor device. 2. Google Nexus 5 LG D821 Hammerhead smartphone. I need compile STK1160 driver for Android. EasyCap driver can be found in CyanogenMod (Android based OS) git (https://github.com/CyanogenMod/android_kernel_lge_hammerhead/search?q=easycap) Looks like Ezequiel Garcia commited it (it is signed-off-by: Ezequiel Garcia elezegar...@gmail.com and Mauro Carvalho Chehab mche...@redhat.com). But it is the old driver by Mike Thomas. I successfully compiled this old driver by Mike Thomas as kernel module (easycap.ko) for my smartphone. It is working, but very very bad. It don't work without bars=0 key and I have only 12 fps (instead of 25 fps as expected). Any ideas why? I think the problem is in driver. What about new STK1160 driver by Ezequiel Garcia? Can I extract it from latest Linux kernel (stable 3.17.3 or mainline 3.18-rc5 or linux-next) and compile it for Android/CyanogenMod (without or with small changes in source code)? The new driver by Ezequiel Garcia can be found in AOSP git (https://google.com/search?q=stk1160+site%3Aandroid.googlesource.com), but, unfortunately, only for kernel versions 3.10+. But I need compile the new driver for kernel version 3.4 (for my Nexus 5). Hope for your help. Thanks in advance! Please anybody answer my questions. -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH/RFC v4 01/11] mediactl: Introduce v4l2_subdev structure
Hi Jacek, On Tue, Nov 25, 2014 at 01:22:50PM +0100, Jacek Anaszewski wrote: Hi Sakari, On 11/25/2014 12:36 PM, Sakari Ailus wrote: Hi Jacek, Thank you for the updated patchset. On Fri, Nov 21, 2014 at 05:14:30PM +0100, Jacek Anaszewski wrote: Add struct v4l2_subdev as a representation of the v4l2 sub-device related to a media entity. Add sd property, the pointer to the newly introduced structure, to the struct media_entity and move fd property to it. Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com Acked-by: Kyungmin Park kyungmin.p...@samsung.com --- utils/media-ctl/libmediactl.c | 30 +- utils/media-ctl/libv4l2subdev.c | 34 +- utils/media-ctl/mediactl-priv.h |5 + utils/media-ctl/mediactl.h | 22 ++ 4 files changed, 69 insertions(+), 22 deletions(-) diff --git a/utils/media-ctl/libmediactl.c b/utils/media-ctl/libmediactl.c index ec360bd..53921f5 100644 --- a/utils/media-ctl/libmediactl.c +++ b/utils/media-ctl/libmediactl.c @@ -511,7 +511,6 @@ static int media_enum_entities(struct media_device *media) entity = media-entities[media-entities_count]; memset(entity, 0, sizeof(*entity)); - entity-fd = -1; I think I'd definitely leave the fd to the media_entity itself. Not all the entities are sub-devices, even right now. I am aware of it, I even came across this issue while implementing the function v4l2_subdev_apply_pipeline_fmt. I added suitable comment explaining why the entity not being a sub-device has its representation. I moved the fd out of media_entity by following Laurent's message [1], where he mentioned this, however I think that it would be indeed best if it remained intact. I read Laurent's reply again, and I can see why he suggested that. I wouldn't mind, but then we should avoid touching it from libmediactl, and only access it from libv4l2subdev. entity-info.id = id | MEDIA_ENT_ID_FLAG_NEXT; entity-media = media; @@ -529,11 +528,13 @@ static int media_enum_entities(struct media_device *media) entity-pads = malloc(entity-info.pads * sizeof(*entity-pads)); entity-links = malloc(entity-max_links * sizeof(*entity-links)); - if (entity-pads == NULL || entity-links == NULL) { + entity-sd = calloc(1, sizeof(*entity-sd)); + if (entity-pads == NULL || entity-links == NULL || entity-sd == NULL) { ret = -ENOMEM; break; } + entity-sd-fd = -1; media-entities_count++; if (entity-info.flags MEDIA_ENT_FL_DEFAULT) { @@ -704,8 +705,9 @@ void media_device_unref(struct media_device *media) free(entity-pads); free(entity-links); - if (entity-fd != -1) - close(entity-fd); + if (entity-sd-fd != -1) + close(entity-sd-fd); + free(entity-sd); } free(media-entities); @@ -726,13 +728,17 @@ int media_device_add_entity(struct media_device *media, if (entity == NULL) return -ENOMEM; + entity-sd = calloc(1, sizeof(*entity-sd)); + if (entity-sd == NULL) + return -ENOMEM; + media-entities = entity; media-entities_count++; entity = media-entities[media-entities_count - 1]; memset(entity, 0, sizeof *entity); - entity-fd = -1; + entity-sd-fd = -1; entity-media = media; strncpy(entity-devname, devnode, sizeof entity-devname); entity-devname[sizeof entity-devname - 1] = '\0'; @@ -955,3 +961,17 @@ int media_parse_setup_links(struct media_device *media, const char *p) return *end ? -EINVAL : 0; } + +/* - + * Media entity access + */ + +int media_entity_get_fd(struct media_entity *entity) +{ + return entity-sd-fd; +} + +void media_entity_set_fd(struct media_entity *entity, int fd) +{ + entity-sd-fd = fd; +} You access the fd directly now inside the library. I don't think there should be a need to set it. struct media_entity is defined in mediactl-priv.h, whose name implies that it shouldn't be made public. Thats way I implemented the setter. I use it in the libv4l-exynos4-camera.c. Ah, I now understand why you wnat to do this. You should also close the file handle --- this is used internally by the library, and simply setting the value will lead the loss of the existing handle. -- Kind regards, Sakari Ailus e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Compiling STK1160 driver for Android
Em Wed, 26 Nov 2014 13:21:29 +0300 Барт Гопник bart.gop...@gmail.com escreveu: Hi, guys! I have: 1. 05e1:0408 USB ID STK1160 chip GM7113 (SAA7113 clone) video processor device. 2. Google Nexus 5 LG D821 Hammerhead smartphone. I need compile STK1160 driver for Android. EasyCap driver can be found in CyanogenMod (Android based OS) git (https://github.com/CyanogenMod/android_kernel_lge_hammerhead/search?q=easycap) Looks like Ezequiel Garcia commited it (it is signed-off-by: Ezequiel Garcia elezegar...@gmail.com and Mauro Carvalho Chehab mche...@redhat.com). But it is the old driver by Mike Thomas. I successfully compiled this old driver by Mike Thomas as kernel module (easycap.ko) for my smartphone. It is working, but very very bad. It don't work without bars=0 key and I have only 12 fps (instead of 25 fps as expected). Any ideas why? I think the problem is in driver. Hard to tell about a driver that is not upstream. With regards to the low frame rate, this is likely due to cache coherency differences between x86 and arm. There are some tricks to properly allocate memory for it to work fine on ARM. Those tricks depend on the Kernel version. On modern Kernels, this is a way easier than on 3.4, as newer Kernels got a new DMA core code with makes easier to make the same driver to work fine on both x86 and arm. What about new STK1160 driver by Ezequiel Garcia? Can I extract it from latest Linux kernel (stable 3.17.3 or mainline 3.18-rc5 or linux-next) and compile it for Android/CyanogenMod (without or with small changes in source code)? It is possible. Not sure what changes will be required. The linux-backport and media_build trees may help you to identify what's needed. The new driver by Ezequiel Garcia can be found in AOSP git (https://google.com/search?q=stk1160+site%3Aandroid.googlesource.com), but, unfortunately, only for kernel versions 3.10+. But I need compile the new driver for kernel version 3.4 (for my Nexus 5). 3.4 is too old. The older the Kernel, the bigger will be the changes. Hope for your help. Thanks in advance! Please anybody answer my questions. -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [linuxtv-media:master 7661/7664] ERROR: omapdss_compat_init [drivers/media/platform/omap/omap-vout.ko] undefined!
Em Wed, 26 Nov 2014 08:50:41 +0100 Paul Bolle pebo...@tiscali.nl escreveu: Hi Fengguang, On Wed, 2014-11-26 at 09:34 +0800, kbuild test robot wrote: tree: git://linuxtv.org/media_tree.git master head: 504febc3f98c87a8bebd8f2f274f32c0724131e4 commit: 6b213e81ddf8b265383c9a1a1884432df88f701e [7661/7664] [media] omap: Fix typo HAS_MMU config: m68k-allmodconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 6b213e81ddf8b265383c9a1a1884432df88f701e # save the attached .config to linux build tree make.cross ARCH=m68k This is the first time I've made the kbuild test robot trip. So I'm not sure how to interpret this. I did some tests yesterday, and compilation of this driver also broke on other archs. So, I removed COMPILE_TEST: http://git.linuxtv.org/cgit.cgi/mchehab/media-next.git/commit/ We may be able to re-enable if someone do some work on this driver for it to use the standard DMA API, instead of an omap-specific one. Btw, I had to do a similar patch also for OMAP1 driver sometime ago: commit 4228cd5682f07b6cf5dfd3eb5e003766f5640ee2 Author: Mauro Carvalho Chehab m.che...@samsung.com Date: Tue Sep 9 14:55:15 2014 -0300 [media] disable COMPILE_TEST for omap1_camera This driver depends on a legacy OMAP DMA API. So, it won't compile-test on other archs. While we might add stubs to the functions, this is not a good idea, as the hole API should be replaced. So, for now, let's just remove COMPILE_TEST and wait for some time for people to fix. If not fixed, then we'll end by removing this driver as a hole. Is ARCH=m68k the only build that failed through this commit? Or is it the first build that failed? If so, how can I determine which arches build correctly? All error/warnings: ERROR: omapdss_compat_init [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_get_overlay_manager [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_get_num_overlay_managers [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_get_overlay [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omapdss_is_initialized [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dispc_register_isr [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omapdss_get_version [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_put_device [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_get_next_device [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dispc_unregister_isr [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omapdss_compat_uninit [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_get_device [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_get_num_overlays [drivers/media/platform/omap/omap-vout.ko] undefined! --- 0-DAY kernel test infrastructureOpen Source Technology Center http://lists.01.org/mailman/listinfo/kbuild Intel Corporation Thanks, Paul Bolle -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] dvb-usb-dvbsky: add T330 dvb-t2/t/c usb stick support
DVBSky T330 dvb-t2/t/c usb stick: 1dvb frontend: SI2157A30(tuner), SI2168B40(demod) 2usb controller: CY7C68013A Signed-off-by: Nibble Max nibble@gmail.com --- drivers/media/usb/dvb-usb-v2/dvbsky.c | 88 +++ 1 file changed, 88 insertions(+) diff --git a/drivers/media/usb/dvb-usb-v2/dvbsky.c b/drivers/media/usb/dvb-usb-v2/dvbsky.c index b6326c6..86db800 100644 --- a/drivers/media/usb/dvb-usb-v2/dvbsky.c +++ b/drivers/media/usb/dvb-usb-v2/dvbsky.c @@ -604,6 +604,65 @@ fail_demod_device: return ret; } +static int dvbsky_t330_attach(struct dvb_usb_adapter *adap) +{ + struct dvbsky_state *state = adap_to_priv(adap); + struct dvb_usb_device *d = adap_to_d(adap); + int ret = 0; + struct i2c_adapter *i2c_adapter; + struct i2c_client *client_demod, *client_tuner; + struct i2c_board_info info; + struct si2168_config si2168_config; + struct si2157_config si2157_config; + + /* attach demod */ + memset(si2168_config, 0, sizeof(si2168_config)); + si2168_config.i2c_adapter = i2c_adapter; + si2168_config.fe = adap-fe[0]; + si2168_config.ts_mode = SI2168_TS_PARALLEL | 0x40; + memset(info, 0, sizeof(struct i2c_board_info)); + strlcpy(info.type, si2168, I2C_NAME_SIZE); + info.addr = 0x64; + info.platform_data = si2168_config; + + request_module(info.type); + client_demod = i2c_new_device(d-i2c_adap, info); + if (client_demod == NULL || + client_demod-dev.driver == NULL) + goto fail_demod_device; + if (!try_module_get(client_demod-dev.driver-owner)) + goto fail_demod_module; + + /* attach tuner */ + memset(si2157_config, 0, sizeof(si2157_config)); + si2157_config.fe = adap-fe[0]; + memset(info, 0, sizeof(struct i2c_board_info)); + strlcpy(info.type, si2157, I2C_NAME_SIZE); + info.addr = 0x60; + info.platform_data = si2157_config; + + request_module(info.type); + client_tuner = i2c_new_device(i2c_adapter, info); + if (client_tuner == NULL || + client_tuner-dev.driver == NULL) + goto fail_tuner_device; + if (!try_module_get(client_tuner-dev.driver-owner)) + goto fail_tuner_module; + + state-i2c_client_demod = client_demod; + state-i2c_client_tuner = client_tuner; + return ret; +fail_tuner_module: + i2c_unregister_device(client_tuner); +fail_tuner_device: + module_put(client_demod-dev.driver-owner); +fail_demod_module: + i2c_unregister_device(client_demod); +fail_demod_device: + ret = -ENODEV; + return ret; +} + static int dvbsky_identify_state(struct dvb_usb_device *d, const char **name) { dvbsky_gpio_ctrl(d, 0x04, 1); @@ -742,6 +801,33 @@ static struct dvb_usb_device_properties dvbsky_t680c_props = { } }; +static struct dvb_usb_device_properties dvbsky_t330_props = { + .driver_name = KBUILD_MODNAME, + .owner = THIS_MODULE, + .adapter_nr = adapter_nr, + .size_of_priv = sizeof(struct dvbsky_state), + + .generic_bulk_ctrl_endpoint = 0x01, + .generic_bulk_ctrl_endpoint_response = 0x81, + .generic_bulk_ctrl_delay = DVBSKY_MSG_DELAY, + + .i2c_algo = dvbsky_i2c_algo, + .frontend_attach = dvbsky_t330_attach, + .init = dvbsky_init, + .get_rc_config= dvbsky_get_rc_config, + .streaming_ctrl = dvbsky_streaming_ctrl, + .identify_state = dvbsky_identify_state, + .exit = dvbsky_exit, + .read_mac_address = dvbsky_read_mac_addr, + + .num_adapters = 1, + .adapter = { + { + .stream = DVB_USB_STREAM_BULK(0x82, 8, 4096), + } + } +}; + static const struct usb_device_id dvbsky_id_table[] = { { DVB_USB_DEVICE(0x0572, 0x6831, dvbsky_s960_props, DVBSky S960/S860, RC_MAP_DVBSKY) }, @@ -749,6 +835,8 @@ static const struct usb_device_id dvbsky_id_table[] = { dvbsky_s960c_props, DVBSky S960CI, RC_MAP_DVBSKY) }, { DVB_USB_DEVICE(0x0572, 0x680c, dvbsky_t680c_props, DVBSky T680CI, RC_MAP_DVBSKY) }, + { DVB_USB_DEVICE(0x0572, 0x0320, + dvbsky_t330_props, DVBSky T330, RC_MAP_DVBSKY) }, { } }; MODULE_DEVICE_TABLE(usb, dvbsky_id_table); -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/3] cxusb: remove TechnoTrend CT2-4400 and CT2-4650 devices
Remove TechnoTrend CT2-4400 and CT2-4650 devices from cxusb. They are supported by dvb-usb-dvbsky driver in PATCH 3/3. Signed-off-by: Nibble Max nibble@gmail.com --- drivers/media/usb/dvb-usb/Kconfig | 1 - drivers/media/usb/dvb-usb/cxusb.c | 298 -- drivers/media/usb/dvb-usb/cxusb.h | 4 - 3 files changed, 303 deletions(-) diff --git a/drivers/media/usb/dvb-usb/Kconfig b/drivers/media/usb/dvb-usb/Kconfig index 41d3eb9..3364200 100644 --- a/drivers/media/usb/dvb-usb/Kconfig +++ b/drivers/media/usb/dvb-usb/Kconfig @@ -130,7 +130,6 @@ config DVB_USB_CXUSB Medion MD95700 hybrid USB2.0 device. DViCO FusionHDTV (Bluebird) USB2.0 devices - TechnoTrend TVStick CT2-4400 and CT2-4650 CI devices config DVB_USB_M920X tristate Uli m920x DVB-T USB2.0 support diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c index 643d88f..0f345b1 100644 --- a/drivers/media/usb/dvb-usb/cxusb.c +++ b/drivers/media/usb/dvb-usb/cxusb.c @@ -44,7 +44,6 @@ #include atbm8830.h #include si2168.h #include si2157.h -#include sp2.h /* Max transfer size done by I2C transfer functions */ #define MAX_XFER_SIZE 80 @@ -147,22 +146,6 @@ static int cxusb_d680_dmb_gpio_tuner(struct dvb_usb_device *d, } } -static int cxusb_tt_ct2_4400_gpio_tuner(struct dvb_usb_device *d, int onoff) -{ - u8 o[2], i; - int rc; - - o[0] = 0x83; - o[1] = onoff; - rc = cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, i, 1); - - if (rc) { - deb_info(gpio_write failed.\n); - return -EIO; - } - return 0; -} - /* I2C */ static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) @@ -524,30 +507,6 @@ static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event, return 0; } -static int cxusb_tt_ct2_4400_rc_query(struct dvb_usb_device *d) -{ - u8 i[2]; - int ret; - u32 cmd, keycode; - u8 rc5_cmd, rc5_addr, rc5_toggle; - - ret = cxusb_ctrl_msg(d, 0x10, NULL, 0, i, 2); - if (ret) - return ret; - - cmd = (i[0] 8) | i[1]; - - if (cmd != 0x) { - rc5_cmd = cmd 0x3F; /* bits 1-6 for command */ - rc5_addr = (cmd 0x07C0) 6; /* bits 7-11 for address */ - rc5_toggle = (cmd 0x0800) 11; /* bit 12 for toggle */ - keycode = (rc5_addr 8) | rc5_cmd; - rc_keydown(d-rc_dev, RC_BIT_RC5, keycode, rc5_toggle); - } - - return 0; -} - static struct rc_map_table rc_map_dvico_mce_table[] = { { 0xfe02, KEY_TV }, { 0xfe0e, KEY_MP3 }, @@ -673,70 +632,6 @@ static struct rc_map_table rc_map_d680_dmb_table[] = { { 0x0025, KEY_POWER }, }; -static int cxusb_tt_ct2_4400_read_mac_address(struct dvb_usb_device *d, u8 mac[6]) -{ - u8 wbuf[2]; - u8 rbuf[6]; - int ret; - struct i2c_msg msg[] = { - { - .addr = 0x51, - .flags = 0, - .buf = wbuf, - .len = 2, - }, { - .addr = 0x51, - .flags = I2C_M_RD, - .buf = rbuf, - .len = 6, - } - }; - - wbuf[0] = 0x1e; - wbuf[1] = 0x00; - ret = cxusb_i2c_xfer(d-i2c_adap, msg, 2); - - if (ret == 2) { - memcpy(mac, rbuf, 6); - return 0; - } else { - if (ret 0) - return ret; - return -EIO; - } -} - -static int cxusb_tt_ct2_4650_ci_ctrl(void *priv, u8 read, int addr, - u8 data, int *mem) -{ - struct dvb_usb_device *d = priv; - u8 wbuf[3]; - u8 rbuf[2]; - int ret; - - wbuf[0] = (addr 8) 0xff; - wbuf[1] = addr 0xff; - - if (read) { - ret = cxusb_ctrl_msg(d, CMD_SP2_CI_READ, wbuf, 2, rbuf, 2); - } else { - wbuf[2] = data; - ret = cxusb_ctrl_msg(d, CMD_SP2_CI_WRITE, wbuf, 3, rbuf, 1); - } - - if (ret) - goto err; - - if (read) - *mem = rbuf[1]; - - return 0; -err: - deb_info(%s: ci usb write returned %d\n, __func__, ret); - return ret; - -} - static int cxusb_dee1601_demod_init(struct dvb_frontend* fe) { static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x28 }; @@ -1478,127 +1373,6 @@ static int cxusb_mygica_t230_frontend_attach(struct dvb_usb_adapter *adap) return 0; } -static int cxusb_tt_ct2_4400_attach(struct dvb_usb_adapter *adap) -{ - struct dvb_usb_device *d = adap-dev; - struct cxusb_state *st = d-priv; - struct i2c_adapter *adapter; - struct i2c_client *client_demod; - struct i2c_client *client_tuner; - struct i2c_client
[PATCH 3/3] dvb-usb-dvbsky: add TechnoTrend CT2-4400 and CT2-4650 devices support
Signed-off-by: Nibble Max nibble@gmail.com --- drivers/media/usb/dvb-usb-v2/dvbsky.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/media/usb/dvb-usb-v2/dvbsky.c b/drivers/media/usb/dvb-usb-v2/dvbsky.c index 86db800..9b5add4 100644 --- a/drivers/media/usb/dvb-usb-v2/dvbsky.c +++ b/drivers/media/usb/dvb-usb-v2/dvbsky.c @@ -837,6 +837,14 @@ static const struct usb_device_id dvbsky_id_table[] = { dvbsky_t680c_props, DVBSky T680CI, RC_MAP_DVBSKY) }, { DVB_USB_DEVICE(0x0572, 0x0320, dvbsky_t330_props, DVBSky T330, RC_MAP_DVBSKY) }, + { DVB_USB_DEVICE(USB_VID_TECHNOTREND, + USB_PID_TECHNOTREND_TVSTICK_CT2_4400, + dvbsky_t330_props, TechnoTrend TVStick CT2-4400, + RC_MAP_TT_1500) }, + { DVB_USB_DEVICE(USB_VID_TECHNOTREND, + USB_PID_TECHNOTREND_CONNECT_CT2_4650_CI, + dvbsky_t680c_props, TechnoTrend TT-connect CT2-4650 CI, + RC_MAP_TT_1500) }, { } }; MODULE_DEVICE_TABLE(usb, dvbsky_id_table); -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] v4l: vsp1: Always enable virtual RPF when BRU is in use
Hello. On 11/26/2014 9:19 AM, Takanari Hayama wrote: Regardless of a number of inputs, we should always enable virtual RPF when BRU is used. This allows the case when there's only one input to BRU, and a size of the input is smaller than a size of an output of BRU. Signed-off-by: Takanari Hayama t...@igel.co.jp --- drivers/media/platform/vsp1/vsp1_wpf.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c index 6e05776..29ea28b 100644 --- a/drivers/media/platform/vsp1/vsp1_wpf.c +++ b/drivers/media/platform/vsp1/vsp1_wpf.c @@ -92,19 +92,20 @@ static int wpf_s_stream(struct v4l2_subdev *subdev, int enable) return 0; } - /* Sources. If the pipeline has a single input configure it as the -* master layer. Otherwise configure all inputs as sub-layers and -* select the virtual RPF as the master layer. + /* Sources. If the pipeline has a single input and BRU is not used, +* configure it as the master layer. Otherwise configure all +* inputs as sub-layers and select the virtual RPF as the master +* layer. */ for (i = 0; i pipe-num_inputs; ++i) { struct vsp1_rwpf *input = pipe-inputs[i]; - srcrpf |= pipe-num_inputs == 1 + srcrpf |= ((!pipe-bru) (pipe-num_inputs == 1)) Inner parens not needed, especially in the first case. ? VI6_WPF_SRCRPF_RPF_ACT_MST(input-entity.index) : VI6_WPF_SRCRPF_RPF_ACT_SUB(input-entity.index); } - if (pipe-num_inputs 1) + if ((pipe-bru) || (pipe-num_inputs 1)) Likewise. [...] WBR, Sergei -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] [media] stv090x: remove export symbol for stv090x_set_gpio()
Drivers that use dvb_attach can have just one exported symbol, or they will cause compilation breakages depending on the selected frontends. As Jim reported: drivers/built-in.o: In function `technisat_usb2_set_voltage': technisat-usb2.c:(.text+0x3b4919): undefined reference to `stv090x_set_gpio' make: *** [vmlinux] Error 1 That happens because, on his configuration, the configuration is: CONFIG_DVB_USB=y CONFIG_DVB_STV090x=m Luis proposed ar way to fix, but that would just force the STV090x to be selected, even if one wants to use a device with a different frontend. Instead, let's do the right thing: move set_gpio to the configuration structure and fill it during dvb_attach(). This way, the driver can still call it, and dvb_attach() will load stv090x module only if the device really needs it. Reported by: Jim Davis jim.ep...@gmail.com Cc: Luis Rodriguez mcg...@suse.com Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com diff --git a/drivers/media/dvb-frontends/stv090x.c b/drivers/media/dvb-frontends/stv090x.c index f8050b984a8f..3489400bb08a 100644 --- a/drivers/media/dvb-frontends/stv090x.c +++ b/drivers/media/dvb-frontends/stv090x.c @@ -4870,8 +4870,8 @@ err: return -1; } -int stv090x_set_gpio(struct dvb_frontend *fe, u8 gpio, u8 dir, u8 value, - u8 xor_value) +static int stv090x_set_gpio(struct dvb_frontend *fe, u8 gpio, u8 dir, + u8 value, u8 xor_value) { struct stv090x_state *state = fe-demodulator_priv; u8 reg = 0; @@ -4882,7 +4882,6 @@ int stv090x_set_gpio(struct dvb_frontend *fe, u8 gpio, u8 dir, u8 value, return stv090x_write_reg(state, STV090x_GPIOxCFG(gpio), reg); } -EXPORT_SYMBOL(stv090x_set_gpio); static struct dvb_frontend_ops stv090x_ops = { .delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS }, @@ -4919,7 +4918,7 @@ static struct dvb_frontend_ops stv090x_ops = { }; -struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, +struct dvb_frontend *stv090x_attach(struct stv090x_config *config, struct i2c_adapter *i2c, enum stv090x_demodulator demod) { @@ -4980,6 +4979,8 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, if (config-diseqc_envelope_mode) stv090x_send_diseqc_burst(state-frontend, SEC_MINI_A); + config-set_gpio = stv090x_set_gpio; + dprintk(FE_ERROR, 1, Attaching %s demodulator(%d) Cut=0x%02x, state-device == STV0900 ? STV0900 : STV0903, demod, diff --git a/drivers/media/dvb-frontends/stv090x.h b/drivers/media/dvb-frontends/stv090x.h index 0bd6adcfee8a..ba20edc3b5c6 100644 --- a/drivers/media/dvb-frontends/stv090x.h +++ b/drivers/media/dvb-frontends/stv090x.h @@ -101,18 +101,18 @@ struct stv090x_config { int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk); int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status); void (*tuner_i2c_lock) (struct dvb_frontend *fe, int lock); + + /* dir = 0 - output, dir = 1 - input/open-drain */ + int (*set_gpio) (struct dvb_frontend *fe, u8 gpio, u8 dir, u8 value, +u8 xor_value); }; #if IS_ENABLED(CONFIG_DVB_STV090x) -extern struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, +extern struct dvb_frontend *stv090x_attach(struct stv090x_config *config, struct i2c_adapter *i2c, enum stv090x_demodulator demod); -/* dir = 0 - output, dir = 1 - input/open-drain */ -extern int stv090x_set_gpio(struct dvb_frontend *fe, u8 gpio, - u8 dir, u8 value, u8 xor_value); - #else static inline struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, @@ -123,12 +123,6 @@ static inline struct dvb_frontend *stv090x_attach(const struct stv090x_config *c return NULL; } -static inline int stv090x_set_gpio(struct dvb_frontend *fe, u8 gpio, - u8 opd, u8 value, u8 xor_value) -{ - printk(KERN_WARNING %s: driver disabled by Kconfig\n, __func__); - return -ENODEV; -} #endif /* CONFIG_DVB_STV090x */ #endif /* __STV090x_H */ diff --git a/drivers/media/usb/dvb-usb/technisat-usb2.c b/drivers/media/usb/dvb-usb/technisat-usb2.c index 6b0b8b6b9e2a..58ba02c93d29 100644 --- a/drivers/media/usb/dvb-usb/technisat-usb2.c +++ b/drivers/media/usb/dvb-usb/technisat-usb2.c @@ -449,6 +449,8 @@ static int technisat_usb2_read_mac_address(struct dvb_usb_device *d, return 0; } +static struct stv090x_config technisat_usb2_stv090x_config; + /* frontend attach */ static int technisat_usb2_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) @@ -472,7 +474,7 @@ static int technisat_usb2_set_voltage(struct dvb_frontend *fe, }
i.MX6 CODA960 encoder
Hi, We are writing a gstreamer plugin to support CODA960 encoder on i.MX6, and it is not working so now trying to use v4l2-ctl for the moment. As I am asking about encoder, is there a way to make it support YUYV as input or is the firmware not able to do it ? I could not find a reference manual about that... So back to the issue. $ cat /sys/class/video4linux/video0/name coda-encoder $ v4l2-ctl -d0 --list-formats ioctl: VIDIOC_ENUM_FMT Index : 0 Type: Video Capture Pixel Format: 'H264' (compressed) Name: H264 Encoded Stream Index : 1 Type: Video Capture Pixel Format: 'MPG4' (compressed) Name: MPEG4 Encoded Stream $ v4l2-ctl -d0 --list-formats-out ioctl: VIDIOC_ENUM_FMT Index : 0 Type: Video Output Pixel Format: 'YU12' Name: YUV 4:2:0 Planar, YCbCr Index : 1 Type: Video Output Pixel Format: 'YV12' Name: YUV 4:2:0 Planar, YCrCb == First question, vid-cap should be related to the capture format, so YUV format in the encoder case, no ? $ v4l2-ctl -d0 --set-fmt-video-out=width=1280,height=720,pixelformat=YU12 $ v4l2-ctl -d0 --stream-mmap --stream-out-mmap --stream-to x.raw unsupported pixelformat VIDIOC_STREAMON: failed: Invalid argument And here is the dmesg : [ 444.470057] coda 204.vpu: s_ctrl: id = 9963796, val = 0 [ 444.470093] coda 204.vpu: s_ctrl: id = 9963797, val = 0 [ 444.470118] coda 204.vpu: s_ctrl: id = 10029519, val = 0 [ 444.470140] coda 204.vpu: s_ctrl: id = 10029515, val = 16 [ 444.470162] coda 204.vpu: s_ctrl: id = 10029662, val = 25 [ 444.470183] coda 204.vpu: s_ctrl: id = 10029663, val = 25 [ 444.470205] coda 204.vpu: s_ctrl: id = 10029666, val = 51 [ 444.470226] coda 204.vpu: s_ctrl: id = 10029672, val = 0 [ 444.470248] coda 204.vpu: s_ctrl: id = 10029673, val = 0 [ 444.470268] coda 204.vpu: s_ctrl: id = 10029674, val = 0 [ 444.470289] coda 204.vpu: s_ctrl: id = 10029712, val = 2 [ 444.470310] coda 204.vpu: s_ctrl: id = 10029713, val = 2 [ 444.470330] coda 204.vpu: s_ctrl: id = 10029533, val = 0 [ 444.470351] coda 204.vpu: s_ctrl: id = 10029532, val = 1 [ 444.470372] coda 204.vpu: s_ctrl: id = 10029531, val = 500 [ 444.470393] coda 204.vpu: s_ctrl: id = 10029528, val = 1 [ 444.470414] coda 204.vpu: s_ctrl: id = 10029526, val = 0 [ 444.484473] coda 204.vpu: Created instance 0 (bdade800) [ 444.484503] video0: open (0) [ 444.484586] video0: VIDIOC_QUERYCAP: driver=coda, card=CODA960, bus=platform:coda, version=0x00031200, capabilities=0x84208000, device_caps=0x04208000 [ 444.484685] video0: VIDIOC_QUERYCTRL: id=0x980001, type=6, name=User Controls, min/max=0/0, step=0, default=0, flags=0x0044 [ 444.484768] video0: VIDIOC_QUERYCTRL: id=0x980914, type=2, name=Horizontal Flip, min/max=0/1, step=1, default=0, flags=0x [ 444.487570] video0: VIDIOC_QUERYCTRL: id=0x980915, type=2, name=Vertical Flip, min/max=0/1, step=1, default=0, flags=0x [ 444.487741] video0: VIDIOC_QUERYCTRL: id=0x990001, type=6, name=Codec Controls, min/max=0/0, step=0, default=0, flags=0x0044 [ 444.487818] video0: VIDIOC_QUERYCTRL: id=0x9909cb, type=1, name=Video GOP Size, min/max=1/60, step=1, default=16, flags=0x [ 444.487954] video0: VIDIOC_QUERYCTRL: id=0x9909cf, type=1, name=Video Bitrate, min/max=0/32767000, step=1, default=0, flags=0x [ 444.488109] video0: VIDIOC_QUERYCTRL: id=0x9909d6, type=1, name=Number of Intra Refresh MBs, min/max=0/8160, step=1, default=0, flags=0x [ 444.488280] video0: VIDIOC_QUERYCTRL: id=0x9909d8, type=3, name=Sequence Header Mode, min/max=0/1, step=1, default=1, flags=0x [ 444.488434] video0: VIDIOC_QUERYCTRL: id=0x9909db, type=1, name=Maximum Bytes in a Slice, min/max=1/1073741823, step=1, default=500, flags=0x [ 444.488599] video0: VIDIOC_QUERYCTRL: id=0x9909dc, type=1, name=Number of MBs in a Slice, min/max=1/1073741823, step=1, default=1, flags=0x [ 444.488760] video0: VIDIOC_QUERYCTRL: id=0x9909dd, type=3, name=Slice Partitioning Method, min/max=0/2, step=1, default=0, flags=0x [ 444.488928] video0: VIDIOC_QUERYCTRL: id=0x990a5e, type=1, name=H264 I-Frame QP Value, min/max=0/51, step=1, default=25, flags=0x [ 444.489080] video0: VIDIOC_QUERYCTRL: id=0x990a5f, type=1, name=H264 P-Frame QP Value, min/max=0/51, step=1, default=25, flags=0x [ 444.489234] video0: VIDIOC_QUERYCTRL: id=0x990a62, type=1, name=H264 Maximum QP Value, min/max=0/51, step=1, default=51, flags=0x [ 444.489390] video0: VIDIOC_QUERYCTRL: id=0x990a68, type=1, name=H264 Loop Filter Alpha Offset, min/max=0/15, step=1, default=0, flags=0x [ 444.489565] video0: VIDIOC_QUERYCTRL: id=0x990a69, type=1, name=H264 Loop Filter Beta Offset, min/max=0/15, step=1, default=0, flags=0x [ 444.489737] video0: VIDIOC_QUERYCTRL: id=0x990a6a, type=3, name=H264
Re: [PATCH v3 2/3] media: rc: add driver for Amlogic Meson IR remote receiver
Em Tue, 18 Nov 2014 21:22:34 +0100 Beniamino Galvani b.galv...@gmail.com escreveu: Amlogic Meson SoCs include a infrared remote control receiver that can operate in two modes: NEC mode in which the hardware decodes frames using the NEC IR protocol, and general mode in which the receiver simply reports the duration of pulses and spaces for software decoding. This is a driver for the IR receiver that implements software decoding of received frames. Signed-off-by: Beniamino Galvani b.galv...@gmail.com --- MAINTAINERS | 1 + drivers/media/rc/Kconfig| 11 +++ drivers/media/rc/Makefile | 1 + drivers/media/rc/meson-ir.c | 216 4 files changed, 229 insertions(+) create mode 100644 drivers/media/rc/meson-ir.c diff --git a/MAINTAINERS b/MAINTAINERS index 0662378..f1bc045 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -850,6 +850,7 @@ ARM/Amlogic MesonX SoC support M: Carlo Caione ca...@caione.org L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers) S: Maintained +F: drivers/media/rc/meson-ir.c N: meson[x68] Hmm... you're putting this driver at Carlo's maintenance shoulders. I need his ack in order to apply this patch. Regards, Mauro ARM/ATMEL AT91RM9200 AND AT91SAM ARM ARCHITECTURES diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig index 1aea732..ddfab25 100644 --- a/drivers/media/rc/Kconfig +++ b/drivers/media/rc/Kconfig @@ -223,6 +223,17 @@ config IR_FINTEK To compile this driver as a module, choose M here: the module will be called fintek-cir. +config IR_MESON + tristate Amlogic Meson IR remote receiver + depends on RC_CORE + depends on ARCH_MESON || COMPILE_TEST + ---help--- +Say Y if you want to use the IR remote receiver available +on Amlogic Meson SoCs. + +To compile this driver as a module, choose M here: the +module will be called meson-ir. + config IR_NUVOTON tristate Nuvoton w836x7hg Consumer Infrared Transceiver depends on PNP diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile index 8f509e0..379a5c0 100644 --- a/drivers/media/rc/Makefile +++ b/drivers/media/rc/Makefile @@ -22,6 +22,7 @@ obj-$(CONFIG_IR_IMON) += imon.o obj-$(CONFIG_IR_ITE_CIR) += ite-cir.o obj-$(CONFIG_IR_MCEUSB) += mceusb.o obj-$(CONFIG_IR_FINTEK) += fintek-cir.o +obj-$(CONFIG_IR_MESON) += meson-ir.o obj-$(CONFIG_IR_NUVOTON) += nuvoton-cir.o obj-$(CONFIG_IR_ENE) += ene_ir.o obj-$(CONFIG_IR_REDRAT3) += redrat3.o diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c new file mode 100644 index 000..fcc3b82 --- /dev/null +++ b/drivers/media/rc/meson-ir.c @@ -0,0 +1,216 @@ +/* + * Driver for Amlogic Meson IR remote receiver + * + * Copyright (C) 2014 Beniamino Galvani b.galv...@gmail.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +#include linux/device.h +#include linux/err.h +#include linux/interrupt.h +#include linux/io.h +#include linux/module.h +#include linux/of_platform.h +#include linux/platform_device.h +#include linux/spinlock.h + +#include media/rc-core.h + +#define DRIVER_NAME meson-ir + +#define IR_DEC_LDR_ACTIVE0x00 +#define IR_DEC_LDR_IDLE 0x04 +#define IR_DEC_LDR_REPEAT0x08 +#define IR_DEC_BIT_0 0x0c +#define IR_DEC_REG0 0x10 +#define IR_DEC_FRAME 0x14 +#define IR_DEC_STATUS0x18 +#define IR_DEC_REG1 0x1c + +#define REG0_RATE_MASK (BIT(11) - 1) + +#define REG1_MODE_MASK (BIT(7) | BIT(8)) +#define REG1_MODE_NEC(0 7) +#define REG1_MODE_GENERAL(2 7) + +#define REG1_TIME_IV_SHIFT 16 +#define REG1_TIME_IV_MASK((BIT(13) - 1) REG1_TIME_IV_SHIFT) + +#define REG1_IRQSEL_MASK (BIT(2) | BIT(3)) +#define REG1_IRQSEL_NEC_MODE (0 2) +#define REG1_IRQSEL_RISE_FALL(1 2) +#define REG1_IRQSEL_FALL (2 2) +#define REG1_IRQSEL_RISE (3 2) + +#define REG1_RESET BIT(0) +#define REG1_ENABLE BIT(15) + +#define STATUS_IR_DEC_IN BIT(8) + +#define MESON_TRATE 10 /* us */ + +struct meson_ir { + void __iomem*reg; + struct rc_dev *rc; + int irq; + spinlock_t lock; +}; + +static void meson_ir_set_mask(struct meson_ir *ir, unsigned int reg, + u32 mask, u32 value) +{ + u32 data; + + data = readl(ir-reg + reg); + data = ~mask; + data |= (value mask); + writel(data, ir-reg + reg); +} +
Re: [PATCH v3 2/3] media: rc: add driver for Amlogic Meson IR remote receiver
On Wed, Nov 26, 2014 at 4:04 PM, Mauro Carvalho Chehab mche...@osg.samsung.com wrote: Em Tue, 18 Nov 2014 21:22:34 +0100 Beniamino Galvani b.galv...@gmail.com escreveu: Amlogic Meson SoCs include a infrared remote control receiver that can operate in two modes: NEC mode in which the hardware decodes frames using the NEC IR protocol, and general mode in which the receiver simply reports the duration of pulses and spaces for software decoding. This is a driver for the IR receiver that implements software decoding of received frames. Signed-off-by: Beniamino Galvani b.galv...@gmail.com --- MAINTAINERS | 1 + drivers/media/rc/Kconfig| 11 +++ drivers/media/rc/Makefile | 1 + drivers/media/rc/meson-ir.c | 216 4 files changed, 229 insertions(+) create mode 100644 drivers/media/rc/meson-ir.c diff --git a/MAINTAINERS b/MAINTAINERS index 0662378..f1bc045 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -850,6 +850,7 @@ ARM/Amlogic MesonX SoC support M: Carlo Caione ca...@caione.org L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers) S: Maintained +F: drivers/media/rc/meson-ir.c N: meson[x68] Hmm... you're putting this driver at Carlo's maintenance shoulders. I need his ack in order to apply this patch. Acked-by: Carlo Caione ca...@caione.org -- Carlo Caione -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] [media] tda18271: Fix identation
As reported by smatch: drivers/media/tuners/tda18271-common.c:176 tda18271_read_extended() warn: if statement not indented Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com diff --git a/drivers/media/tuners/tda18271-common.c b/drivers/media/tuners/tda18271-common.c index 86e5e3110118..6118203543ea 100644 --- a/drivers/media/tuners/tda18271-common.c +++ b/drivers/media/tuners/tda18271-common.c @@ -173,12 +173,9 @@ int tda18271_read_extended(struct dvb_frontend *fe) for (i = 0; i TDA18271_NUM_REGS; i++) { /* don't update write-only registers */ - if ((i != R_EB9) - (i != R_EB16) - (i != R_EB17) - (i != R_EB19) - (i != R_EB20)) - regs[i] = regdump[i]; + if ((i != R_EB9) (i != R_EB16) (i != R_EB17) + (i != R_EB19) (i != R_EB20)) + regs[i] = regdump[i]; } if (tda18271_debug DBG_REG) -- 1.9.3 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] staging: media: lirc: lirc_zilog.c: fix quoted strings split across lines
On Wed, 2014-11-26 at 15:42 +, Luis de Bethencourt wrote: On 26 November 2014 at 01:49, Joe Perches j...@perches.com wrote: [] There is a script I posted a while back that groups various checkpatch types together and makes it a bit easier to do cleanup style patches. https://lkml.org/lkml/2014/7/11/794 That is useful! I just run it on staging/octeon/ and it wrote two patches. Will submit them in a minute. Please make sure and write better commit messages than the script produces. Using checkpatch to get familiar with kernel development is fine and all, but fixing actual defects and submitting new code is way more useful. [] I agree. I was just using checkpatch to learn about the development process. How to create patches, submit patches, follow review, and such. Better to do it with small changes like this first. That's a good way to start. Which makes me wonder. Is my patch accepted? Will it be merged? I can do the proposed logging macro additions in a few days. Not sure yet how the final step of the process when patches get accepted and merged works. You will generally get an email from a maintainer when patches are accepted/rejected or you get feedback asking for various changes. Greg KH does that for drivers/staging but not for drivers/staging/media. Mauro Carvalho Chehab does. These emails are not immediate. It can take 2 or 3 weeks for a response. Sometimes longer, sometimes shorter, sometimes no response ever comes. After a month or so, if you get no response, maybe the maintainer never saw it. You should maybe expand the cc: list for the email. When the patch is more than a trivial style cleanup, Andrew Morton generally picks up orphan patches. For some subsystems, there are tracking mechanisms like patchwork: For instance, netdev (net/ and drivers/net/) uses: http://patchwork.ozlabs.org/project/netdev/list/ and David Miller, the primary networking maintainer is very prompt about updating it. There's this list of patchwork entries, but maintainer activity of these lists vary: https://patchwork.kernel.org/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[linuxtv-media:master 7661/7664] ERROR: omapdss_compat_init undefined!
tree: git://linuxtv.org/media_tree.git master head: 504febc3f98c87a8bebd8f2f274f32c0724131e4 commit: 6b213e81ddf8b265383c9a1a1884432df88f701e [7661/7664] [media] omap: Fix typo HAS_MMU config: mips-allmodconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 6b213e81ddf8b265383c9a1a1884432df88f701e # save the attached .config to linux build tree make.cross ARCH=mips All error/warnings: ERROR: omapdss_compat_init undefined! ERROR: omap_dss_get_overlay_manager undefined! ERROR: omap_dss_get_num_overlay_managers undefined! ERROR: omap_dss_get_overlay undefined! ERROR: omapdss_is_initialized undefined! ERROR: omap_dispc_register_isr undefined! ERROR: omapdss_get_version undefined! ERROR: omap_dss_put_device undefined! ERROR: omap_dss_get_next_device undefined! ERROR: omap_dispc_unregister_isr undefined! ERROR: omapdss_compat_uninit undefined! ERROR: omap_dss_get_device undefined! ERROR: omap_dss_get_num_overlays undefined! --- 0-DAY kernel test infrastructureOpen Source Technology Center http://lists.01.org/mailman/listinfo/kbuild Intel Corporation # # Automatically generated file; DO NOT EDIT. # Linux/mips 3.18.0-rc4 Kernel Configuration # CONFIG_MIPS=y # # Machine selection # # CONFIG_MIPS_ALCHEMY is not set # CONFIG_AR7 is not set # CONFIG_ATH79 is not set # CONFIG_BCM47XX is not set # CONFIG_BCM63XX is not set # CONFIG_MIPS_COBALT is not set # CONFIG_MACH_DECSTATION is not set # CONFIG_MACH_JAZZ is not set # CONFIG_MACH_JZ4740 is not set # CONFIG_LANTIQ is not set # CONFIG_LASAT is not set # CONFIG_MACH_LOONGSON is not set # CONFIG_MACH_LOONGSON1 is not set # CONFIG_MIPS_MALTA is not set # CONFIG_MIPS_SEAD3 is not set # CONFIG_NEC_MARKEINS is not set # CONFIG_MACH_VR41XX is not set # CONFIG_NXP_STB220 is not set # CONFIG_NXP_STB225 is not set # CONFIG_PMC_MSP is not set # CONFIG_RALINK is not set CONFIG_SGI_IP22=y # CONFIG_SGI_IP27 is not set # CONFIG_SGI_IP28 is not set # CONFIG_SGI_IP32 is not set # CONFIG_SIBYTE_CRHINE is not set # CONFIG_SIBYTE_CARMEL is not set # CONFIG_SIBYTE_CRHONE is not set # CONFIG_SIBYTE_RHONE is not set # CONFIG_SIBYTE_SWARM is not set # CONFIG_SIBYTE_LITTLESUR is not set # CONFIG_SIBYTE_SENTOSA is not set # CONFIG_SIBYTE_BIGSUR is not set # CONFIG_SNI_RM is not set # CONFIG_MACH_TX39XX is not set # CONFIG_MACH_TX49XX is not set # CONFIG_MIKROTIK_RB532 is not set # CONFIG_CAVIUM_OCTEON_SOC is not set # CONFIG_NLM_XLR_BOARD is not set # CONFIG_NLM_XLP_BOARD is not set # CONFIG_MIPS_PARAVIRT is not set # CONFIG_ALCHEMY_GPIO_INDIRECT is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_SCHED_OMIT_FRAME_POINTER=y CONFIG_FW_ARC=y CONFIG_CEVT_R4K=y CONFIG_CSRC_R4K=y # CONFIG_ARCH_DMA_ADDR_T_64BIT is not set CONFIG_DMA_NONCOHERENT=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_I8259=y # CONFIG_MIPS_MACHINE is not set # CONFIG_NO_IOPORT_MAP is not set CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_ISA_DMA_SUPPORT_BROKEN=y CONFIG_ISA_DMA_API=y CONFIG_CPU_BIG_ENDIAN=y CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_IRQ_CPU=y CONFIG_SWAP_IO_SPACE=y CONFIG_SGI_HAS_INDYDOG=y CONFIG_SGI_HAS_HAL2=y CONFIG_SGI_HAS_SEEQ=y CONFIG_SGI_HAS_WD93=y CONFIG_SGI_HAS_ZILOG=y CONFIG_SGI_HAS_I8042=y CONFIG_DEFAULT_SGI_PARTITION=y CONFIG_FW_ARC32=y CONFIG_BOOT_ELF32=y CONFIG_MIPS_L1_CACHE_SHIFT_7=y CONFIG_MIPS_L1_CACHE_SHIFT=7 CONFIG_ARC_CONSOLE=y CONFIG_ARC_PROMLIB=y # # CPU selection # CONFIG_CPU_R4X00=y # CONFIG_CPU_R5000 is not set CONFIG_SYS_HAS_CPU_R4X00=y CONFIG_SYS_HAS_CPU_R5000=y CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HUGEPAGES=y # # Kernel type # CONFIG_32BIT=y # CONFIG_64BIT is not set CONFIG_KVM_GUEST=y CONFIG_KVM_GUEST_TIMER_FREQ=100 CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_16KB is not set # CONFIG_PAGE_SIZE_64KB is not set CONFIG_FORCE_MAX_ZONEORDER=11 CONFIG_BOARD_SCACHE=y CONFIG_IP22_CPU_SCACHE=y CONFIG_CPU_GENERIC_DUMP_TLB=y CONFIG_CPU_R4K_FPU=y CONFIG_CPU_R4K_CACHE_TLB=y # CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set CONFIG_CPU_HAS_SYNC=y CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y CONFIG_HAVE_MEMBLOCK=y CONFIG_HAVE_MEMBLOCK_NODE_MAP=y CONFIG_ARCH_DISCARD_MEMBLOCK=y CONFIG_MEMORY_ISOLATION=y # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set CONFIG_PAGEFLAGS_EXTENDED=y CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_MEMORY_BALLOON=y CONFIG_BALLOON_COMPACTION=y CONFIG_COMPACTION=y CONFIG_MIGRATION=y # CONFIG_PHYS_ADDR_T_64BIT is not set CONFIG_ZONE_DMA_FLAG=0 CONFIG_NEED_BOUNCE_POOL=y CONFIG_VIRT_TO_BUS=y CONFIG_KSM=y CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 CONFIG_NEED_PER_CPU_KM=y CONFIG_CLEANCACHE=y CONFIG_FRONTSWAP=y
Re: i.MX6 CODA960 encoder
Hi Jean-Michel, Am Mittwoch, den 26.11.2014, 14:33 +0100 schrieb Jean-Michel Hautbois: Hi, We are writing a gstreamer plugin to support CODA960 encoder on i.MX6, and it is not working so now trying to use v4l2-ctl for the moment. As I am asking about encoder, is there a way to make it support YUYV as input or is the firmware not able to do it ? I could not find a reference manual about that... The H.264 and MPEG-4 encoders support planar 4:2:0 subsampled formats only: YU12, YV12, and chroma-interleaved NV12. The JPEG encoder can also handle planar 4:2:2 subsampled frames, but none of the interleaved (YUYV, UYVY, ...) variants. So back to the issue. $ cat /sys/class/video4linux/video0/name coda-encoder $ v4l2-ctl -d0 --list-formats ioctl: VIDIOC_ENUM_FMT Index : 0 Type: Video Capture Pixel Format: 'H264' (compressed) Name: H264 Encoded Stream Index : 1 Type: Video Capture Pixel Format: 'MPG4' (compressed) Name: MPEG4 Encoded Stream $ v4l2-ctl -d0 --list-formats-out ioctl: VIDIOC_ENUM_FMT Index : 0 Type: Video Output Pixel Format: 'YU12' Name: YUV 4:2:0 Planar, YCbCr Index : 1 Type: Video Output Pixel Format: 'YV12' Name: YUV 4:2:0 Planar, YCrCb Please apply all coda patches in the media-tree master branch first. The output format list should include NV12 then. == First question, vid-cap should be related to the capture format, so YUV format in the encoder case, no ? $ v4l2-ctl -d0 --set-fmt-video-out=width=1280,height=720,pixelformat=YU12 $ v4l2-ctl -d0 --stream-mmap --stream-out-mmap --stream-to x.raw unsupported pixelformat VIDIOC_STREAMON: failed: Invalid argument On v3.18-rc6 with the coda patches currently in the pipeline applied, I get this: $ v4l2-ctl -d0 --set-fmt-video-out=width=1280,height=720,pixelformat=YU12 $ v4l2-ctl -d0 --stream-mmap --stream-out-mmap --stream-to x.raw KPPPKPPPKPP 38 fps 38 fps [...] And here is the dmesg : [ 444.470057] coda 204.vpu: s_ctrl: id = 9963796, val = 0 [ 444.470093] coda 204.vpu: s_ctrl: id = 9963797, val = 0 [ 444.470118] coda 204.vpu: s_ctrl: id = 10029519, val = 0 [ 444.470140] coda 204.vpu: s_ctrl: id = 10029515, val = 16 [ 444.470162] coda 204.vpu: s_ctrl: id = 10029662, val = 25 [ 444.470183] coda 204.vpu: s_ctrl: id = 10029663, val = 25 [ 444.470205] coda 204.vpu: s_ctrl: id = 10029666, val = 51 [ 444.470226] coda 204.vpu: s_ctrl: id = 10029672, val = 0 [ 444.470248] coda 204.vpu: s_ctrl: id = 10029673, val = 0 [ 444.470268] coda 204.vpu: s_ctrl: id = 10029674, val = 0 [ 444.470289] coda 204.vpu: s_ctrl: id = 10029712, val = 2 [ 444.470310] coda 204.vpu: s_ctrl: id = 10029713, val = 2 [ 444.470330] coda 204.vpu: s_ctrl: id = 10029533, val = 0 [ 444.470351] coda 204.vpu: s_ctrl: id = 10029532, val = 1 [ 444.470372] coda 204.vpu: s_ctrl: id = 10029531, val = 500 [ 444.470393] coda 204.vpu: s_ctrl: id = 10029528, val = 1 [ 444.470414] coda 204.vpu: s_ctrl: id = 10029526, val = 0 [ 444.484473] coda 204.vpu: Created instance 0 (bdade800) [ 444.484503] video0: open (0) [ 444.484586] video0: VIDIOC_QUERYCAP: driver=coda, card=CODA960, bus=platform:coda, version=0x00031200, capabilities=0x84208000, device_caps=0x04208000 [ 444.484685] video0: VIDIOC_QUERYCTRL: id=0x980001, type=6, name=User Controls, min/max=0/0, step=0, default=0, flags=0x0044 [ 444.484768] video0: VIDIOC_QUERYCTRL: id=0x980914, type=2, name=Horizontal Flip, min/max=0/1, step=1, default=0, flags=0x [ 444.487570] video0: VIDIOC_QUERYCTRL: id=0x980915, type=2, name=Vertical Flip, min/max=0/1, step=1, default=0, flags=0x [ 444.487741] video0: VIDIOC_QUERYCTRL: id=0x990001, type=6, name=Codec Controls, min/max=0/0, step=0, default=0, flags=0x0044 [ 444.487818] video0: VIDIOC_QUERYCTRL: id=0x9909cb, type=1, name=Video GOP Size, min/max=1/60, step=1, default=16, flags=0x [ 444.487954] video0: VIDIOC_QUERYCTRL: id=0x9909cf, type=1, name=Video Bitrate, min/max=0/32767000, step=1, default=0, flags=0x [ 444.488109] video0: VIDIOC_QUERYCTRL: id=0x9909d6, type=1, name=Number of Intra Refresh MBs, min/max=0/8160, step=1, default=0, flags=0x [ 444.488280] video0: VIDIOC_QUERYCTRL: id=0x9909d8, type=3, name=Sequence Header Mode, min/max=0/1, step=1, default=1, flags=0x [ 444.488434] video0: VIDIOC_QUERYCTRL: id=0x9909db, type=1, name=Maximum Bytes in a Slice, min/max=1/1073741823, step=1, default=500, flags=0x [ 444.488599] video0: VIDIOC_QUERYCTRL: id=0x9909dc, type=1, name=Number of MBs in a Slice, min/max=1/1073741823, step=1, default=1, flags=0x [ 444.488760] video0: VIDIOC_QUERYCTRL: id=0x9909dd, type=3, name=Slice Partitioning Method, min/max=0/2,
Fix Penguin Penalty 17th October2014 ( mail-archive.com )
Dear Sir Did your website get hit by Google Penguin update on October 17th 2014? What basically is Google Penguin Update? It is actually a code name for Google algorithm which aims at decreasing your websites search engine rankings that violate Googles guidelines by using black hat SEO techniques to rank your webpage by giving number of spammy links to the page. We are one of those few SEO companies that can help you avoid penalties from Google Updates like Penguin and Panda. Our clients have survived all the previous and present updates with ease. They have never been hit because we use 100% white hat SEO techniques to rank Webpages. Simple thing that we do to keep websites away from any Penguin or Panda penalties is follow Google guidelines and we give Google users the best answers to their queries. If you are looking to increase the quality of your websites and to get more targeted traffic or save your websites from these Google penalties email us back with your interest. We will be glad to serve you and help you grow your business. Regards Roshni Patel SEO Manager ( TOB ) B7 Green Avenue, Amritsar 143001 Punjab NO CLICK in the subject to STOP EMAILS -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] dvb-usb-dvbsky: add T330 dvb-t2/t/c usb stick support
Reviewed-by: Olli Salonen olli.salo...@iki.fi On Wed, 26 Nov 2014, Nibble Max wrote: DVBSky T330 dvb-t2/t/c usb stick: 1dvb frontend: SI2157A30(tuner), SI2168B40(demod) 2usb controller: CY7C68013A Signed-off-by: Nibble Max nibble@gmail.com --- drivers/media/usb/dvb-usb-v2/dvbsky.c | 88 +++ 1 file changed, 88 insertions(+) diff --git a/drivers/media/usb/dvb-usb-v2/dvbsky.c b/drivers/media/usb/dvb-usb-v2/dvbsky.c index b6326c6..86db800 100644 --- a/drivers/media/usb/dvb-usb-v2/dvbsky.c +++ b/drivers/media/usb/dvb-usb-v2/dvbsky.c @@ -604,6 +604,65 @@ fail_demod_device: return ret; } +static int dvbsky_t330_attach(struct dvb_usb_adapter *adap) +{ + struct dvbsky_state *state = adap_to_priv(adap); + struct dvb_usb_device *d = adap_to_d(adap); + int ret = 0; + struct i2c_adapter *i2c_adapter; + struct i2c_client *client_demod, *client_tuner; + struct i2c_board_info info; + struct si2168_config si2168_config; + struct si2157_config si2157_config; + + /* attach demod */ + memset(si2168_config, 0, sizeof(si2168_config)); + si2168_config.i2c_adapter = i2c_adapter; + si2168_config.fe = adap-fe[0]; + si2168_config.ts_mode = SI2168_TS_PARALLEL | 0x40; + memset(info, 0, sizeof(struct i2c_board_info)); + strlcpy(info.type, si2168, I2C_NAME_SIZE); + info.addr = 0x64; + info.platform_data = si2168_config; + + request_module(info.type); + client_demod = i2c_new_device(d-i2c_adap, info); + if (client_demod == NULL || + client_demod-dev.driver == NULL) + goto fail_demod_device; + if (!try_module_get(client_demod-dev.driver-owner)) + goto fail_demod_module; + + /* attach tuner */ + memset(si2157_config, 0, sizeof(si2157_config)); + si2157_config.fe = adap-fe[0]; + memset(info, 0, sizeof(struct i2c_board_info)); + strlcpy(info.type, si2157, I2C_NAME_SIZE); + info.addr = 0x60; + info.platform_data = si2157_config; + + request_module(info.type); + client_tuner = i2c_new_device(i2c_adapter, info); + if (client_tuner == NULL || + client_tuner-dev.driver == NULL) + goto fail_tuner_device; + if (!try_module_get(client_tuner-dev.driver-owner)) + goto fail_tuner_module; + + state-i2c_client_demod = client_demod; + state-i2c_client_tuner = client_tuner; + return ret; +fail_tuner_module: + i2c_unregister_device(client_tuner); +fail_tuner_device: + module_put(client_demod-dev.driver-owner); +fail_demod_module: + i2c_unregister_device(client_demod); +fail_demod_device: + ret = -ENODEV; + return ret; +} + static int dvbsky_identify_state(struct dvb_usb_device *d, const char **name) { dvbsky_gpio_ctrl(d, 0x04, 1); @@ -742,6 +801,33 @@ static struct dvb_usb_device_properties dvbsky_t680c_props = { } }; +static struct dvb_usb_device_properties dvbsky_t330_props = { + .driver_name = KBUILD_MODNAME, + .owner = THIS_MODULE, + .adapter_nr = adapter_nr, + .size_of_priv = sizeof(struct dvbsky_state), + + .generic_bulk_ctrl_endpoint = 0x01, + .generic_bulk_ctrl_endpoint_response = 0x81, + .generic_bulk_ctrl_delay = DVBSKY_MSG_DELAY, + + .i2c_algo = dvbsky_i2c_algo, + .frontend_attach = dvbsky_t330_attach, + .init = dvbsky_init, + .get_rc_config= dvbsky_get_rc_config, + .streaming_ctrl = dvbsky_streaming_ctrl, + .identify_state = dvbsky_identify_state, + .exit = dvbsky_exit, + .read_mac_address = dvbsky_read_mac_addr, + + .num_adapters = 1, + .adapter = { + { + .stream = DVB_USB_STREAM_BULK(0x82, 8, 4096), + } + } +}; + static const struct usb_device_id dvbsky_id_table[] = { { DVB_USB_DEVICE(0x0572, 0x6831, dvbsky_s960_props, DVBSky S960/S860, RC_MAP_DVBSKY) }, @@ -749,6 +835,8 @@ static const struct usb_device_id dvbsky_id_table[] = { dvbsky_s960c_props, DVBSky S960CI, RC_MAP_DVBSKY) }, { DVB_USB_DEVICE(0x0572, 0x680c, dvbsky_t680c_props, DVBSky T680CI, RC_MAP_DVBSKY) }, + { DVB_USB_DEVICE(0x0572, 0x0320, + dvbsky_t330_props, DVBSky T330, RC_MAP_DVBSKY) }, { } }; MODULE_DEVICE_TABLE(usb, dvbsky_id_table); -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] cxusb: remove TechnoTrend CT2-4400 and CT2-4650 devices
Reviewed-by: Olli Salonen olli.salo...@iki.fi On Wed, 26 Nov 2014, Nibble Max wrote: Remove TechnoTrend CT2-4400 and CT2-4650 devices from cxusb. They are supported by dvb-usb-dvbsky driver in PATCH 3/3. Signed-off-by: Nibble Max nibble@gmail.com --- drivers/media/usb/dvb-usb/Kconfig | 1 - drivers/media/usb/dvb-usb/cxusb.c | 298 -- drivers/media/usb/dvb-usb/cxusb.h | 4 - 3 files changed, 303 deletions(-) diff --git a/drivers/media/usb/dvb-usb/Kconfig b/drivers/media/usb/dvb-usb/Kconfig index 41d3eb9..3364200 100644 --- a/drivers/media/usb/dvb-usb/Kconfig +++ b/drivers/media/usb/dvb-usb/Kconfig @@ -130,7 +130,6 @@ config DVB_USB_CXUSB Medion MD95700 hybrid USB2.0 device. DViCO FusionHDTV (Bluebird) USB2.0 devices - TechnoTrend TVStick CT2-4400 and CT2-4650 CI devices config DVB_USB_M920X tristate Uli m920x DVB-T USB2.0 support diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c index 643d88f..0f345b1 100644 --- a/drivers/media/usb/dvb-usb/cxusb.c +++ b/drivers/media/usb/dvb-usb/cxusb.c @@ -44,7 +44,6 @@ #include atbm8830.h #include si2168.h #include si2157.h -#include sp2.h /* Max transfer size done by I2C transfer functions */ #define MAX_XFER_SIZE 80 @@ -147,22 +146,6 @@ static int cxusb_d680_dmb_gpio_tuner(struct dvb_usb_device *d, } } -static int cxusb_tt_ct2_4400_gpio_tuner(struct dvb_usb_device *d, int onoff) -{ - u8 o[2], i; - int rc; - - o[0] = 0x83; - o[1] = onoff; - rc = cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, i, 1); - - if (rc) { - deb_info(gpio_write failed.\n); - return -EIO; - } - return 0; -} - /* I2C */ static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) @@ -524,30 +507,6 @@ static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event, return 0; } -static int cxusb_tt_ct2_4400_rc_query(struct dvb_usb_device *d) -{ - u8 i[2]; - int ret; - u32 cmd, keycode; - u8 rc5_cmd, rc5_addr, rc5_toggle; - - ret = cxusb_ctrl_msg(d, 0x10, NULL, 0, i, 2); - if (ret) - return ret; - - cmd = (i[0] 8) | i[1]; - - if (cmd != 0x) { - rc5_cmd = cmd 0x3F; /* bits 1-6 for command */ - rc5_addr = (cmd 0x07C0) 6; /* bits 7-11 for address */ - rc5_toggle = (cmd 0x0800) 11; /* bit 12 for toggle */ - keycode = (rc5_addr 8) | rc5_cmd; - rc_keydown(d-rc_dev, RC_BIT_RC5, keycode, rc5_toggle); - } - - return 0; -} - static struct rc_map_table rc_map_dvico_mce_table[] = { { 0xfe02, KEY_TV }, { 0xfe0e, KEY_MP3 }, @@ -673,70 +632,6 @@ static struct rc_map_table rc_map_d680_dmb_table[] = { { 0x0025, KEY_POWER }, }; -static int cxusb_tt_ct2_4400_read_mac_address(struct dvb_usb_device *d, u8 mac[6]) -{ - u8 wbuf[2]; - u8 rbuf[6]; - int ret; - struct i2c_msg msg[] = { - { - .addr = 0x51, - .flags = 0, - .buf = wbuf, - .len = 2, - }, { - .addr = 0x51, - .flags = I2C_M_RD, - .buf = rbuf, - .len = 6, - } - }; - - wbuf[0] = 0x1e; - wbuf[1] = 0x00; - ret = cxusb_i2c_xfer(d-i2c_adap, msg, 2); - - if (ret == 2) { - memcpy(mac, rbuf, 6); - return 0; - } else { - if (ret 0) - return ret; - return -EIO; - } -} - -static int cxusb_tt_ct2_4650_ci_ctrl(void *priv, u8 read, int addr, - u8 data, int *mem) -{ - struct dvb_usb_device *d = priv; - u8 wbuf[3]; - u8 rbuf[2]; - int ret; - - wbuf[0] = (addr 8) 0xff; - wbuf[1] = addr 0xff; - - if (read) { - ret = cxusb_ctrl_msg(d, CMD_SP2_CI_READ, wbuf, 2, rbuf, 2); - } else { - wbuf[2] = data; - ret = cxusb_ctrl_msg(d, CMD_SP2_CI_WRITE, wbuf, 3, rbuf, 1); - } - - if (ret) - goto err; - - if (read) - *mem = rbuf[1]; - - return 0; -err: - deb_info(%s: ci usb write returned %d\n, __func__, ret); - return ret; - -} - static int cxusb_dee1601_demod_init(struct dvb_frontend* fe) { static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x28 }; @@ -1478,127 +1373,6 @@ static int cxusb_mygica_t230_frontend_attach(struct dvb_usb_adapter *adap) return 0; } -static int cxusb_tt_ct2_4400_attach(struct dvb_usb_adapter *adap) -{ - struct dvb_usb_device *d = adap-dev; - struct cxusb_state *st = d-priv; - struct i2c_adapter *adapter; - struct i2c_client *client_demod; -
Re: [PATCH 3/3] dvb-usb-dvbsky: add TechnoTrend CT2-4400 and CT2-4650 devices support
On Wed, 26 Nov 2014, Nibble Max wrote: Signed-off-by: Nibble Max nibble@gmail.com --- drivers/media/usb/dvb-usb-v2/dvbsky.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/media/usb/dvb-usb-v2/dvbsky.c b/drivers/media/usb/dvb-usb-v2/dvbsky.c Hi Max, I tested your patch with Technotrend CT2-4400v2 and CT2-4650 CI. Seems to work ok and the code looks ok for me as well. Reviewed-by: Olli Salonen olli.salo...@iki.fi Tested-by: Olli Salonen olli.salo...@iki.fi Cheers, -olli -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: i.MX6 CODA960 encoder
Hi Philipp, Thanks for answering. 2014-11-26 17:55 GMT+01:00 Philipp Zabel p.za...@pengutronix.de: Hi Jean-Michel, Am Mittwoch, den 26.11.2014, 14:33 +0100 schrieb Jean-Michel Hautbois: Hi, We are writing a gstreamer plugin to support CODA960 encoder on i.MX6, and it is not working so now trying to use v4l2-ctl for the moment. As I am asking about encoder, is there a way to make it support YUYV as input or is the firmware not able to do it ? I could not find a reference manual about that... The H.264 and MPEG-4 encoders support planar 4:2:0 subsampled formats only: YU12, YV12, and chroma-interleaved NV12. The JPEG encoder can also handle planar 4:2:2 subsampled frames, but none of the interleaved (YUYV, UYVY, ...) variants. OK, just read this in TRM. This means that when the sensor is YUV 4:2:2 (say, a ADV76xx :)) it will have to be converted to NV12 in order to have it as input of the encoder... So back to the issue. $ cat /sys/class/video4linux/video0/name coda-encoder $ v4l2-ctl -d0 --list-formats ioctl: VIDIOC_ENUM_FMT Index : 0 Type: Video Capture Pixel Format: 'H264' (compressed) Name: H264 Encoded Stream Index : 1 Type: Video Capture Pixel Format: 'MPG4' (compressed) Name: MPEG4 Encoded Stream $ v4l2-ctl -d0 --list-formats-out ioctl: VIDIOC_ENUM_FMT Index : 0 Type: Video Output Pixel Format: 'YU12' Name: YUV 4:2:0 Planar, YCbCr Index : 1 Type: Video Output Pixel Format: 'YV12' Name: YUV 4:2:0 Planar, YCrCb Please apply all coda patches in the media-tree master branch first. The output format list should include NV12 then. OK, applying right now. == First question, vid-cap should be related to the capture format, so YUV format in the encoder case, no ? $ v4l2-ctl -d0 --set-fmt-video-out=width=1280,height=720,pixelformat=YU12 $ v4l2-ctl -d0 --stream-mmap --stream-out-mmap --stream-to x.raw unsupported pixelformat VIDIOC_STREAMON: failed: Invalid argument On v3.18-rc6 with the coda patches currently in the pipeline applied, I get this: $ v4l2-ctl -d0 --set-fmt-video-out=width=1280,height=720,pixelformat=YU12 $ v4l2-ctl -d0 --stream-mmap --stream-out-mmap --stream-to x.raw KPPPKPPPKPP 38 fps 38 fps This seems really better, yes :). Well, I come with another question : it seems to be limited in framerate throughput ? I get the same thing with the video capture, I can go up to 33 fps but no more. When I use --stream-mmap=8 I have only two buffers used. Is this the case for you in the encoder too ? JM -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] dvb-usb-dvbsky: add T330 dvb-t2/t/c usb stick support
On 11/26/2014 02:34 PM, Nibble Max wrote: DVBSky T330 dvb-t2/t/c usb stick: 1dvb frontend: SI2157A30(tuner), SI2168B40(demod) 2usb controller: CY7C68013A Signed-off-by: Nibble Max nibble@gmail.com Reviewed-by: Antti Palosaari cr...@iki.fi regards Antti -- http://palosaari.fi/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] cxusb: remove TechnoTrend CT2-4400 and CT2-4650 devices
On 11/26/2014 02:35 PM, Nibble Max wrote: Remove TechnoTrend CT2-4400 and CT2-4650 devices from cxusb. They are supported by dvb-usb-dvbsky driver in PATCH 3/3. Signed-off-by: Nibble Max nibble@gmail.com Reviewed-by: Antti Palosaari cr...@iki.fi regards Antti -- http://palosaari.fi/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] dvb-usb-dvbsky: add TechnoTrend CT2-4400 and CT2-4650 devices support
On 11/26/2014 02:35 PM, Nibble Max wrote: Signed-off-by: Nibble Max nibble@gmail.com Reviewed-by: Antti Palosaari cr...@iki.fi regards Antti -- http://palosaari.fi/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [linuxtv-media:master 7661/7664] ERROR: omapdss_compat_init [drivers/media/platform/omap/omap-vout.ko] undefined!
Hi Paul, On Wed, Nov 26, 2014 at 08:50:41AM +0100, Paul Bolle wrote: Hi Fengguang, On Wed, 2014-11-26 at 09:34 +0800, kbuild test robot wrote: tree: git://linuxtv.org/media_tree.git master head: 504febc3f98c87a8bebd8f2f274f32c0724131e4 commit: 6b213e81ddf8b265383c9a1a1884432df88f701e [7661/7664] [media] omap: Fix typo HAS_MMU config: m68k-allmodconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 6b213e81ddf8b265383c9a1a1884432df88f701e # save the attached .config to linux build tree make.cross ARCH=m68k This is the first time I've made the kbuild test robot trip. So I'm not sure how to interpret this. Is ARCH=m68k the only build that failed through this commit? Or is it the first build that failed? If so, how can I determine which arches build correctly? It's the first build that failed. I checked log and find these failures, which covers m68k, mips and i386. ERROR: omapdss_compat_init [drivers/media/platform/omap/omap-vout.ko] undefined! linuxtv-media:master:504febc3f98c87a8bebd8f2f274f32c0724131e4 m68k-allmodconfig 504febc3f98c87a8bebd8f2f274f32c0724131e4 ERROR: omapdss_compat_init undefined! linuxtv-media:master:504febc3f98c87a8bebd8f2f274f32c0724131e4 mips-allmodconfig 504febc3f98c87a8bebd8f2f274f32c0724131e4 omap_vout.c:(.init.text+0xb2706): undefined reference to `omapdss_compat_init' linuxtv-media:master:504febc3f98c87a8bebd8f2f274f32c0724131e4 i386-allyesconfig 504febc3f98c87a8bebd8f2f274f32c0724131e4 Thanks, Fengguang All error/warnings: ERROR: omapdss_compat_init [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_get_overlay_manager [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_get_num_overlay_managers [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_get_overlay [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omapdss_is_initialized [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dispc_register_isr [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omapdss_get_version [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_put_device [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_get_next_device [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dispc_unregister_isr [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omapdss_compat_uninit [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_get_device [drivers/media/platform/omap/omap-vout.ko] undefined! ERROR: omap_dss_get_num_overlays [drivers/media/platform/omap/omap-vout.ko] undefined! --- 0-DAY kernel test infrastructureOpen Source Technology Center http://lists.01.org/mailman/listinfo/kbuild Intel Corporation Thanks, Paul Bolle -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [REVIEWv7 PATCH 01/12] videobuf2-core.h: improve documentation
Hi Hans, Thank you for the patch. On Sunday 23 November 2014 20:01:22 Pawel Osciak wrote: On Tue, Nov 18, 2014 at 9:50 PM, Hans Verkuil hverk...@xs4all.nl wrote: From: Hans Verkuil hans.verk...@cisco.com Document that drivers can access/modify the buffer contents in buf_prepare and buf_finish. That was not clearly stated before. Signed-off-by: Hans Verkuil hans.verk...@cisco.com Acked-by: Pawel Osciak pa...@osciak.com Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- include/media/videobuf2-core.h | 32 +--- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index 6ef2d01..70ace7c 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -270,22 +270,24 @@ struct vb2_buffer { * queue setup from completing successfully; optional. * @buf_prepare: called every time the buffer is queued from userspace * and from the VIDIOC_PREPARE_BUF ioctl; drivers may - * perform any initialization required before each hardware - * operation in this callback; drivers that support - * VIDIOC_CREATE_BUFS must also validate the buffer size; - * if an error is returned, the buffer will not be queued - * in driver; optional. + * perform any initialization required before each + * hardware operation in this callback; drivers can + * access/modify the buffer here as it is still synced for + * the CPU; drivers that support VIDIOC_CREATE_BUFS must + * also validate the buffer size; if an error is returned, + * the buffer will not be queued in driver; optional. * @buf_finish:called before every dequeue of the buffer back to - * userspace; drivers may perform any operations required - * before userspace accesses the buffer; optional. The - * buffer state can be one of the following: DONE and - * ERROR occur while streaming is in progress, and the - * PREPARED state occurs when the queue has been canceled - * and all pending buffers are being returned to their - * default DEQUEUED state. Typically you only have to do - * something if the state is VB2_BUF_STATE_DONE, since in - * all other cases the buffer contents will be ignored - * anyway. + * userspace; the buffer is synced for the CPU, so drivers + * can access/modify the buffer contents; drivers may + * perform any operations required before userspace + * accesses the buffer; optional. The buffer state can be + * one of the following: DONE and ERROR occur while + * streaming is in progress, and the PREPARED state occurs + * when the queue has been canceled and all pending + * buffers are being returned to their default DEQUEUED + * state. Typically you only have to do something if the + * state is VB2_BUF_STATE_DONE, since in all other cases + * the buffer contents will be ignored anyway. * @buf_cleanup: called once before the buffer is freed; drivers may * perform any additional cleanup; optional. * @start_streaming: called once to enter 'streaming' state; the driver may -- 2.1.1 -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [REVIEWv7 PATCH 02/12] vb2: replace 'write' by 'dma_dir'
Hi Hans, Thank you for the patch. On Tuesday 18 November 2014 13:50:58 Hans Verkuil wrote: From: Hans Verkuil hans.verk...@cisco.com The 'write' argument is very ambiguous. I first assumed that if it is 1, then we're doing video output but instead it meant the reverse. Since it is used to setup the dma_dir value anyway it is now replaced by the correct dma_dir value which is unambiguous. Signed-off-by: Hans Verkuil hans.verk...@cisco.com Acked-by: Pawel Osciak pa...@osciak.com Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/v4l2-core/videobuf2-core.c | 10 --- drivers/media/v4l2-core/videobuf2-dma-contig.c | 40 ++ drivers/media/v4l2-core/videobuf2-dma-sg.c | 13 + drivers/media/v4l2-core/videobuf2-vmalloc.c| 16 ++- include/media/videobuf2-core.h | 6 ++-- 5 files changed, 47 insertions(+), 38 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index f2e43de..573f6fb 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -1358,7 +1358,8 @@ static int __qbuf_userptr(struct vb2_buffer *vb, const struct v4l2_buffer *b) void *mem_priv; unsigned int plane; int ret; - int write = !V4L2_TYPE_IS_OUTPUT(q-type); + enum dma_data_direction dma_dir = + V4L2_TYPE_IS_OUTPUT(q-type) ? DMA_TO_DEVICE : DMA_FROM_DEVICE; bool reacquired = vb-planes[0].mem_priv == NULL; memset(planes, 0, sizeof(planes[0]) * vb-num_planes); @@ -1400,7 +1401,7 @@ static int __qbuf_userptr(struct vb2_buffer *vb, const struct v4l2_buffer *b) /* Acquire each plane's memory */ mem_priv = call_ptr_memop(vb, get_userptr, q-alloc_ctx[plane], planes[plane].m.userptr, - planes[plane].length, write); + planes[plane].length, dma_dir); if (IS_ERR_OR_NULL(mem_priv)) { dprintk(1, failed acquiring userspace memory for plane %d\n, plane); @@ -1461,7 +1462,8 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const struct v4l2_buffer *b) void *mem_priv; unsigned int plane; int ret; - int write = !V4L2_TYPE_IS_OUTPUT(q-type); + enum dma_data_direction dma_dir = + V4L2_TYPE_IS_OUTPUT(q-type) ? DMA_TO_DEVICE : DMA_FROM_DEVICE; bool reacquired = vb-planes[0].mem_priv == NULL; memset(planes, 0, sizeof(planes[0]) * vb-num_planes); @@ -1509,7 +1511,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const struct v4l2_buffer *b) /* Acquire each plane's memory */ mem_priv = call_ptr_memop(vb, attach_dmabuf, q-alloc_ctx[plane], - dbuf, planes[plane].length, write); + dbuf, planes[plane].length, dma_dir); if (IS_ERR(mem_priv)) { dprintk(1, failed to attach dmabuf\n); ret = PTR_ERR(mem_priv); diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index 4a02ade..2bdffd3 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c @@ -229,7 +229,7 @@ static int vb2_dc_mmap(void *buf_priv, struct vm_area_struct *vma) struct vb2_dc_attachment { struct sg_table sgt; - enum dma_data_direction dir; + enum dma_data_direction dma_dir; }; static int vb2_dc_dmabuf_ops_attach(struct dma_buf *dbuf, struct device *dev, @@ -264,7 +264,7 @@ static int vb2_dc_dmabuf_ops_attach(struct dma_buf *dbuf, struct device *dev, wr = sg_next(wr); } - attach-dir = DMA_NONE; + attach-dma_dir = DMA_NONE; dbuf_attach-priv = attach; return 0; @@ -282,16 +282,16 @@ static void vb2_dc_dmabuf_ops_detach(struct dma_buf *dbuf, sgt = attach-sgt; /* release the scatterlist cache */ - if (attach-dir != DMA_NONE) + if (attach-dma_dir != DMA_NONE) dma_unmap_sg(db_attach-dev, sgt-sgl, sgt-orig_nents, - attach-dir); + attach-dma_dir); sg_free_table(sgt); kfree(attach); db_attach-priv = NULL; } static struct sg_table *vb2_dc_dmabuf_ops_map( - struct dma_buf_attachment *db_attach, enum dma_data_direction dir) + struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir) { struct vb2_dc_attachment *attach = db_attach-priv; /* stealing dmabuf mutex to serialize map/unmap operations */ @@ -303,27 +303,27 @@ static struct sg_table *vb2_dc_dmabuf_ops_map( sgt = attach-sgt; /* return previously mapped sg table */ - if (attach-dir == dir) { + if (attach-dma_dir == dma_dir) {
Re: [REVIEWv7 PATCH 03/12] vb2: add dma_dir to the alloc memop.
Hi Hans, Thank you for the patch. On Tuesday 18 November 2014 13:50:59 Hans Verkuil wrote: From: Hans Verkuil hans.verk...@cisco.com This is needed for the next patch where the dma-sg alloc memop needs to know the dma_dir. Signed-off-by: Hans Verkuil hans.verk...@cisco.com Acked-by: Pawel Osciak pa...@osciak.com Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/v4l2-core/videobuf2-core.c | 4 +++- drivers/media/v4l2-core/videobuf2-dma-contig.c | 4 +++- drivers/media/v4l2-core/videobuf2-dma-sg.c | 5 +++-- drivers/media/v4l2-core/videobuf2-vmalloc.c| 4 +++- include/media/videobuf2-core.h | 4 +++- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 573f6fb..7aed8f2 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -189,6 +189,8 @@ static void __vb2_queue_cancel(struct vb2_queue *q); static int __vb2_buf_mem_alloc(struct vb2_buffer *vb) { struct vb2_queue *q = vb-vb2_queue; + enum dma_data_direction dma_dir = + V4L2_TYPE_IS_OUTPUT(q-type) ? DMA_TO_DEVICE : DMA_FROM_DEVICE; void *mem_priv; int plane; @@ -200,7 +202,7 @@ static int __vb2_buf_mem_alloc(struct vb2_buffer *vb) unsigned long size = PAGE_ALIGN(q-plane_sizes[plane]); mem_priv = call_ptr_memop(vb, alloc, q-alloc_ctx[plane], - size, q-gfp_flags); + size, dma_dir, q-gfp_flags); if (IS_ERR_OR_NULL(mem_priv)) goto free; diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index 2bdffd3..c4305bf 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c @@ -155,7 +155,8 @@ static void vb2_dc_put(void *buf_priv) kfree(buf); } -static void *vb2_dc_alloc(void *alloc_ctx, unsigned long size, gfp_t gfp_flags) +static void *vb2_dc_alloc(void *alloc_ctx, unsigned long size, + enum dma_data_direction dma_dir, gfp_t gfp_flags) { struct vb2_dc_conf *conf = alloc_ctx; struct device *dev = conf-dev; @@ -176,6 +177,7 @@ static void *vb2_dc_alloc(void *alloc_ctx, unsigned long size, gfp_t gfp_flags) /* Prevent the device from being released while the buffer is used */ buf-dev = get_device(dev); buf-size = size; + buf-dma_dir = dma_dir; buf-handler.refcount = buf-refcount; buf-handler.put = vb2_dc_put; diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c index 6b54a14..2529b83 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c @@ -86,7 +86,8 @@ static int vb2_dma_sg_alloc_compacted(struct vb2_dma_sg_buf *buf, return 0; } -static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size, gfp_t gfp_flags) +static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size, + enum dma_data_direction dma_dir, gfp_t gfp_flags) { struct vb2_dma_sg_buf *buf; int ret; @@ -97,7 +98,7 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size, gfp_t gfp_fla return NULL; buf-vaddr = NULL; - buf-dma_dir = DMA_NONE; + buf-dma_dir = dma_dir; buf-offset = 0; buf-size = size; /* size is already page aligned */ diff --git a/drivers/media/v4l2-core/videobuf2-vmalloc.c b/drivers/media/v4l2-core/videobuf2-vmalloc.c index fc1eb45..bba2460 100644 --- a/drivers/media/v4l2-core/videobuf2-vmalloc.c +++ b/drivers/media/v4l2-core/videobuf2-vmalloc.c @@ -35,7 +35,8 @@ struct vb2_vmalloc_buf { static void vb2_vmalloc_put(void *buf_priv); -static void *vb2_vmalloc_alloc(void *alloc_ctx, unsigned long size, gfp_t gfp_flags) +static void *vb2_vmalloc_alloc(void *alloc_ctx, unsigned long size, + enum dma_data_direction dma_dir, gfp_t gfp_flags) { struct vb2_vmalloc_buf *buf; @@ -45,6 +46,7 @@ static void *vb2_vmalloc_alloc(void *alloc_ctx, unsigned long size, gfp_t gfp_fl buf-size = size; buf-vaddr = vmalloc_user(buf-size); + buf-dma_dir = dma_dir; buf-handler.refcount = buf-refcount; buf-handler.put = vb2_vmalloc_put; buf-handler.arg = buf; diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index d607871..bd2cec2 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -82,7 +82,9 @@ struct vb2_threadio_data; * unmap_dmabuf. */ struct vb2_mem_ops { - void*(*alloc)(void *alloc_ctx, unsigned long size, gfp_t gfp_flags); + void*(*alloc)(void
Re: [REVIEWv7 PATCH 04/12] vb2: don't free alloc context if it is ERR_PTR
Hi Hans, Thank you for the patch. On Tuesday 18 November 2014 13:51:00 Hans Verkuil wrote: From: Hans Verkuil hans.verk...@cisco.com Don't try to free a pointer containing an ERR_PTR(). Wouldn't it be easier to return NULL from vb2_dma_contig_alloc_ctx() instead of an ERR_PTR ? Signed-off-by: Hans Verkuil hans.verk...@cisco.com --- drivers/media/v4l2-core/videobuf2-dma-contig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index c4305bf..0bfc488 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c @@ -854,7 +854,8 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_init_ctx); void vb2_dma_contig_cleanup_ctx(void *alloc_ctx) { - kfree(alloc_ctx); + if (!IS_ERR_OR_NULL(alloc_ctx)) + kfree(alloc_ctx); } EXPORT_SYMBOL_GPL(vb2_dma_contig_cleanup_ctx); -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [REVIEWv7 PATCH 05/12] vb2-dma-sg: add allocation context to dma-sg
Hi Hans, Thank you for the patch. On Tuesday 18 November 2014 13:51:01 Hans Verkuil wrote: From: Hans Verkuil hans.verk...@cisco.com Require that dma-sg also uses an allocation context. This is in preparation for adding prepare/finish memops to sync the memory between DMA and CPU. I think this has been raised before, but given that our allocation contexts just hold a struct device pointer, wouldn't it be simpler to just pass it explicitly when creating the queue ? Do we have use cases for using different struct device instances per plane ? Signed-off-by: Hans Verkuil hans.verk...@cisco.com --- drivers/media/pci/cx23885/cx23885-417.c | 1 + drivers/media/pci/cx23885/cx23885-core.c| 10 +++- drivers/media/pci/cx23885/cx23885-dvb.c | 1 + drivers/media/pci/cx23885/cx23885-vbi.c | 1 + drivers/media/pci/cx23885/cx23885-video.c | 1 + drivers/media/pci/cx23885/cx23885.h | 1 + drivers/media/pci/saa7134/saa7134-core.c| 18 ++ drivers/media/pci/saa7134/saa7134-ts.c | 1 + drivers/media/pci/saa7134/saa7134-vbi.c | 1 + drivers/media/pci/saa7134/saa7134-video.c | 1 + drivers/media/pci/saa7134/saa7134.h | 1 + drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c | 10 drivers/media/pci/solo6x10/solo6x10.h | 1 + drivers/media/pci/tw68/tw68-core.c | 15 +--- drivers/media/pci/tw68/tw68-video.c | 1 + drivers/media/pci/tw68/tw68.h | 1 + drivers/media/platform/marvell-ccic/mcam-core.c | 13 +- drivers/media/platform/marvell-ccic/mcam-core.h | 1 + drivers/media/v4l2-core/videobuf2-dma-sg.c | 32 ++ include/media/videobuf2-dma-sg.h| 3 +++ 20 files changed, 104 insertions(+), 10 deletions(-) diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c index 3948db3..d72a3ec 100644 --- a/drivers/media/pci/cx23885/cx23885-417.c +++ b/drivers/media/pci/cx23885/cx23885-417.c @@ -1148,6 +1148,7 @@ static int queue_setup(struct vb2_queue *q, const struct v4l2_format *fmt, dev-ts1.ts_packet_count = mpeglines; *num_planes = 1; sizes[0] = mpeglinesize * mpeglines; + alloc_ctxs[0] = dev-alloc_ctx; *num_buffers = mpegbufs; return 0; } diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c index 331edda..d452b5c 100644 --- a/drivers/media/pci/cx23885/cx23885-core.c +++ b/drivers/media/pci/cx23885/cx23885-core.c @@ -1997,9 +1997,14 @@ static int cx23885_initdev(struct pci_dev *pci_dev, if (!pci_dma_supported(pci_dev, 0x)) { printk(%s/0: Oops: no 32bit PCI DMA ???\n, dev-name); err = -EIO; - goto fail_irq; + goto fail_context; } + dev-alloc_ctx = vb2_dma_sg_init_ctx(pci_dev-dev); + if (IS_ERR(dev-alloc_ctx)) { + err = PTR_ERR(dev-alloc_ctx); + goto fail_context; + } err = request_irq(pci_dev-irq, cx23885_irq, IRQF_SHARED, dev-name, dev); if (err 0) { @@ -2028,6 +2033,8 @@ static int cx23885_initdev(struct pci_dev *pci_dev, return 0; fail_irq: + vb2_dma_sg_cleanup_ctx(dev-alloc_ctx); +fail_context: cx23885_dev_unregister(dev); fail_ctrl: v4l2_ctrl_handler_free(hdl); @@ -2053,6 +2060,7 @@ static void cx23885_finidev(struct pci_dev *pci_dev) free_irq(pci_dev-irq, dev); cx23885_dev_unregister(dev); + vb2_dma_sg_cleanup_ctx(dev-alloc_ctx); v4l2_ctrl_handler_free(dev-ctrl_handler); v4l2_device_unregister(v4l2_dev); kfree(dev); diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c index 1ed92ee..44fafba 100644 --- a/drivers/media/pci/cx23885/cx23885-dvb.c +++ b/drivers/media/pci/cx23885/cx23885-dvb.c @@ -102,6 +102,7 @@ static int queue_setup(struct vb2_queue *q, const struct v4l2_format *fmt, port-ts_packet_count = 32; *num_planes = 1; sizes[0] = port-ts_packet_size * port-ts_packet_count; + alloc_ctxs[0] = port-dev-alloc_ctx; *num_buffers = 32; return 0; } diff --git a/drivers/media/pci/cx23885/cx23885-vbi.c b/drivers/media/pci/cx23885/cx23885-vbi.c index a7c6ef8..1d339a6 100644 --- a/drivers/media/pci/cx23885/cx23885-vbi.c +++ b/drivers/media/pci/cx23885/cx23885-vbi.c @@ -132,6 +132,7 @@ static int queue_setup(struct vb2_queue *q, const struct v4l2_format *fmt, lines = VBI_NTSC_LINE_COUNT; *num_planes = 1; sizes[0] = lines * VBI_LINE_LENGTH * 2; + alloc_ctxs[0] = dev-alloc_ctx; return 0; } diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 091f5db..371eecf 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++
Re: [linuxtv-media:master 7661/7664] ERROR: omapdss_compat_init [drivers/media/platform/omap/omap-vout.ko] undefined!
Hi Fengguang On Wed, 2014-11-26 at 11:30 -0800, Fengguang Wu wrote: On Wed, Nov 26, 2014 at 08:50:41AM +0100, Paul Bolle wrote: Hi Fengguang, On Wed, 2014-11-26 at 09:34 +0800, kbuild test robot wrote: tree: git://linuxtv.org/media_tree.git master head: 504febc3f98c87a8bebd8f2f274f32c0724131e4 commit: 6b213e81ddf8b265383c9a1a1884432df88f701e [7661/7664] [media] omap: Fix typo HAS_MMU config: m68k-allmodconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 6b213e81ddf8b265383c9a1a1884432df88f701e # save the attached .config to linux build tree make.cross ARCH=m68k This is the first time I've made the kbuild test robot trip. So I'm not sure how to interpret this. Is ARCH=m68k the only build that failed through this commit? Or is it the first build that failed? If so, how can I determine which arches build correctly? It's the first build that failed. I checked log and find these failures, which covers m68k, mips and i386. By now your bot sent its fanmail for those other two architectures too. So the lesson here is, apparently, to wait a few hours. By then the bots should have done their thing and I can do damage control. Luckily, for me, Mauro already has done damage control (see http://git.linuxtv.org/cgit.cgi/mchehab/media-next.git/commit/?id=7996d58f03c14c0caf9935e64bb32ed04dbe79c5 ). So all I'll have to do now is ponder how to make sure your bot leaves me alone in the future. Thanks, both of you! Paul Bolle -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] of: Add named interrupts to CODA bindings
From: Philipp Zabel p.za...@pengutronix.de This patch documents named interrupt bindings for the CODA video processing units. Signed-off-by: Philipp Zabel p.za...@pengutronix.de Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- Documentation/devicetree/bindings/media/coda.txt | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/media/coda.txt b/Documentation/devicetree/bindings/media/coda.txt index f5e4d4b..a44c4aa 100644 --- a/Documentation/devicetree/bindings/media/coda.txt +++ b/Documentation/devicetree/bindings/media/coda.txt @@ -12,19 +12,24 @@ Required properties: (d) fsl,imx6dl-vpu, cnm,coda960 for CODA960 present in i.MX6DL/S - reg: should be register base and length as documented in the SoC reference manual -- interrupts : Should contain the VPU interrupt. For CODA960, - a second interrupt is needed for the MJPEG unit. +- interrupts : Should contain the VPU (BIT processor) interrupt. + For CODA960, a second interrupt is needed for the JPEG unit. - clocks : Should contain the ahb and per clocks, in the order determined by the clock-names property. - clock-names : Should be ahb, per - iram : phandle pointing to the SRAM device node +Optional properties: +- interrupt-names: Should be bit for the BIT processor interrupt + and jpeg for the JPEG unit interrupt on CODA960. + Example: vpu: vpu@63ff4000 { compatible = fsl,imx53-vpu, cnm,coda7541; reg = 0x63ff4000 0x1000; interrupts = 9; + interrupt-names = bit; clocks = clks 63, clks 63; clock-names = ahb, per; iram = ocram; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/2] of: Add new compatibles for CODA bindings
From: Philipp Zabel p.za...@pengutronix.de This patch adds new compatibles using the new ChipsMedia vendor prefix cnm and CODA model name as well as a Freescale specific compatible value for i.MX6DL/S. The latter is because for some reason the i.MX6DL/S firmware provided by Freescale differs from the i.MX6Q/D version. Signed-off-by: Philipp Zabel p.za...@pengutronix.de Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- Documentation/devicetree/bindings/media/coda.txt | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/media/coda.txt b/Documentation/devicetree/bindings/media/coda.txt index 2865d04..f5e4d4b 100644 --- a/Documentation/devicetree/bindings/media/coda.txt +++ b/Documentation/devicetree/bindings/media/coda.txt @@ -5,10 +5,11 @@ Coda codec IPs are present in i.MX SoCs in various versions, called VPU (Video Processing Unit). Required properties: -- compatible : should be fsl,chip-src for i.MX SoCs: - (a) fsl,imx27-vpu for CodaDx6 present in i.MX27 - (b) fsl,imx53-vpu for CODA7541 present in i.MX53 - (c) fsl,imx6q-vpu for CODA960 present in i.MX6q +- compatible : should be fsl,chip-src, cnm,codamodel for i.MX SoCs: + (a) fsl,imx27-vpu, cnm,codadx6 for CodaDx6 present in i.MX27 + (b) fsl,imx53-vpu, cnm,coda7541 for CODA7541 present in i.MX53 + (c) fsl,imx6q-vpu, cnm,coda960 for CODA960 present in i.MX6Q/D + (d) fsl,imx6dl-vpu, cnm,coda960 for CODA960 present in i.MX6DL/S - reg: should be register base and length as documented in the SoC reference manual - interrupts : Should contain the VPU interrupt. For CODA960, @@ -21,7 +22,7 @@ Required properties: Example: vpu: vpu@63ff4000 { - compatible = fsl,imx53-vpu; + compatible = fsl,imx53-vpu, cnm,coda7541; reg = 0x63ff4000 0x1000; interrupts = 9; clocks = clks 63, clks 63; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 1/9] clk: sunxi: Give sunxi_factors_register a registers parameter
On Sun, Nov 23, 2014 at 02:38:07PM +0100, Hans de Goede wrote: Before this commit sunxi_factors_register uses of_iomap(node, 0) to get the clk registers. The sun6i prcm has factor clocks, for which we want to use sunxi_factors_register, but of_iomap(node, 0) does not work for the prcm factor clocks, because the prcm uses the mfd framework, so the registers are not part of the dt-node, instead they are added to the platform_device, as platform_device resources. This commit makes getting the registers the callers duty, so that sunxi_factors_register can be used with mfd instantiated platform device too. While at it also add error checking to the of_iomap calls. This commit also drops the __init function from sunxi_factors_register since platform driver probe functions are not __init. Signed-off-by: Hans de Goede hdego...@redhat.com Queued for 3.20, thanks! Maxime -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com signature.asc Description: Digital signature
Re: [REVIEWv7 PATCH 06/12] vb2-dma-sg: move dma_(un)map_sg here
Hi Hans, Thank you for the patch. On Tuesday 18 November 2014 13:51:02 Hans Verkuil wrote: From: Hans Verkuil hans.verk...@cisco.com This moves dma_(un)map_sg to the get_userptr/put_userptr and alloc/put memops of videobuf2-dma-sg.c and adds dma_sync_sg_for_device/cpu to the prepare/finish memops. Now that vb2-dma-sg will sync the buffers for you in the prepare/finish memops we can drop that from the drivers that use dma-sg. For the solo6x10 driver that was a bit more involved because it needs to copy JPEG or MPEG headers to the buffer before returning it to userspace, and that cannot be done in the old place since the buffer there is still setup for DMA access, not for CPU access. However, the buf_finish op is the ideal place to do this. By the time buf_finish is called the buffer is available for CPU access, so copying to the buffer is fine. Signed-off-by: Hans Verkuil hans.verk...@cisco.com Acked-by: Pawel Osciak pa...@osciak.com --- drivers/media/pci/cx23885/cx23885-417.c | 3 -- drivers/media/pci/cx23885/cx23885-core.c| 5 --- drivers/media/pci/cx23885/cx23885-dvb.c | 3 -- drivers/media/pci/cx23885/cx23885-vbi.c | 9 - drivers/media/pci/cx23885/cx23885-video.c | 9 - drivers/media/pci/saa7134/saa7134-empress.c | 1 - drivers/media/pci/saa7134/saa7134-ts.c | 16 drivers/media/pci/saa7134/saa7134-vbi.c | 15 drivers/media/pci/saa7134/saa7134-video.c | 15 drivers/media/pci/saa7134/saa7134.h | 1 - drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c | 50 ++ drivers/media/pci/tw68/tw68-video.c | 8 drivers/media/platform/marvell-ccic/mcam-core.c | 18 + drivers/media/v4l2-core/videobuf2-dma-sg.c | 39 +++ 14 files changed, 62 insertions(+), 130 deletions(-) [snip] diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c index 2bf13dc..f671fab 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c @@ -96,6 +96,7 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size, { struct vb2_dma_sg_conf *conf = alloc_ctx; struct vb2_dma_sg_buf *buf; + struct sg_table *sgt; int ret; int num_pages; @@ -128,6 +129,12 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size, /* Prevent the device from being released while the buffer is used */ buf-dev = get_device(conf-dev); + + sgt = buf-sg_table; + if (dma_map_sg(buf-dev, sgt-sgl, sgt-nents, buf-dma_dir) == 0) + goto fail_map; + dma_sync_sg_for_cpu(buf-dev, sgt-sgl, sgt-nents, buf-dma_dir); I can't help feeling there's a problem here if we need to sync the buffer for the CPU right before mapping it. I wonder whether we could just remove the dma_sync_sg_for_cpu() call. It depends on whether the cpu to dev sync implicitly performed by dma_map_sg is defined as only making the memory consistent for the device without making it inconsistent for the CPU, or as passing the memory ownership from the CPU to the device completely. Some comment for the similar implementation in put_userptr. buf-handler.refcount = buf-refcount; buf-handler.put = vb2_dma_sg_put; buf-handler.arg = buf; @@ -138,6 +145,9 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size, __func__, buf-num_pages); return buf; +fail_map: + put_device(buf-dev); + sg_free_table(buf-dma_sgt); That's an unrelated bug fix, it should be split to a separate patch. fail_table_alloc: num_pages = buf-num_pages; while (num_pages--) @@ -152,11 +162,13 @@ fail_pages_array_alloc: static void vb2_dma_sg_put(void *buf_priv) { struct vb2_dma_sg_buf *buf = buf_priv; + struct sg_table *sgt = buf-sg_table; int i = buf-num_pages; if (atomic_dec_and_test(buf-refcount)) { dprintk(1, %s: Freeing buffer of %d pages\n, __func__, buf-num_pages); + dma_unmap_sg(buf-dev, sgt-sgl, sgt-nents, buf-dma_dir); if (buf-vaddr) vm_unmap_ram(buf-vaddr, buf-num_pages); sg_free_table(buf-sg_table); @@ -168,6 +180,22 @@ static void vb2_dma_sg_put(void *buf_priv) } } +static void vb2_dma_sg_prepare(void *buf_priv) +{ + struct vb2_dma_sg_buf *buf = buf_priv; + struct sg_table *sgt = buf-sg_table; + + dma_sync_sg_for_device(buf-dev, sgt-sgl, sgt-nents, buf-dma_dir); +} + +static void vb2_dma_sg_finish(void *buf_priv) +{ + struct vb2_dma_sg_buf *buf = buf_priv; + struct sg_table *sgt = buf-sg_table; + + dma_sync_sg_for_cpu(buf-dev, sgt-sgl, sgt-nents, buf-dma_dir); +} + static inline int vma_is_io(struct vm_area_struct *vma) { return !!(vma-vm_flags
Re: [REVIEWv7 PATCH 11/12] vim2m: support expbuf
Hi Hans, Thank you for the patch. On Tuesday 18 November 2014 13:51:07 Hans Verkuil wrote: From: Hans Verkuil hans.verk...@cisco.com Signed-off-by: Hans Verkuil hans.verk...@cisco.com Reviewed-by: Pawel Osciak pa...@osciak.com Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/platform/vim2m.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c index 87af47a..1105c11 100644 --- a/drivers/media/platform/vim2m.c +++ b/drivers/media/platform/vim2m.c @@ -697,6 +697,7 @@ static const struct v4l2_ioctl_ops vim2m_ioctl_ops = { .vidioc_querybuf= v4l2_m2m_ioctl_querybuf, .vidioc_qbuf= v4l2_m2m_ioctl_qbuf, .vidioc_dqbuf = v4l2_m2m_ioctl_dqbuf, + .vidioc_expbuf = v4l2_m2m_ioctl_expbuf, .vidioc_streamon= v4l2_m2m_ioctl_streamon, .vidioc_streamoff = v4l2_m2m_ioctl_streamoff, -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [REVIEWv7 PATCH 10/12] vivid: enable vb2_expbuf support.
Hi Hans, Thank you for the patch. On Tuesday 18 November 2014 13:51:06 Hans Verkuil wrote: From: Hans Verkuil hans.verk...@cisco.com Now that vb2 supports DMABUF export for dma-sg and vmalloc memory modes, we can enable the vb2_expbuf support in vivid. Signed-off-by: Hans Verkuil hans.verk...@cisco.com Reviewed-by: Pawel Osciak pa...@osciak.com Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/platform/vivid/vivid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/vivid/vivid-core.c b/drivers/media/platform/vivid/vivid-core.c index 686c3c2..f80d1ca 100644 --- a/drivers/media/platform/vivid/vivid-core.c +++ b/drivers/media/platform/vivid/vivid-core.c @@ -586,7 +586,7 @@ static const struct v4l2_ioctl_ops vivid_ioctl_ops = { .vidioc_querybuf= vb2_ioctl_querybuf, .vidioc_qbuf= vb2_ioctl_qbuf, .vidioc_dqbuf = vb2_ioctl_dqbuf, -/* Not yet .vidioc_expbuf = vb2_ioctl_expbuf,*/ + .vidioc_expbuf = vb2_ioctl_expbuf, .vidioc_streamon= vb2_ioctl_streamon, .vidioc_streamoff = vb2_ioctl_streamoff, -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [REVIEWv7 PATCH 07/12] vb2-dma-sg: add dmabuf import support
Hi Hans, Thank you for the patch. On Tuesday 18 November 2014 13:51:03 Hans Verkuil wrote: From: Hans Verkuil hans.verk...@cisco.com Add support for importing dmabuf to videobuf2-dma-sg. Signed-off-by: Hans Verkuil hans.verk...@cisco.com Acked-by: Pawel Osciak pa...@osciak.com --- drivers/media/v4l2-core/videobuf2-dma-sg.c | 149 +++--- 1 file changed, 136 insertions(+), 13 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c index f671fab..ad6d5c7 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c @@ -41,11 +41,19 @@ struct vb2_dma_sg_buf { int offset; enum dma_data_direction dma_dir; struct sg_table sg_table; + /* + * This will point to sg_table when used with the MMAP or USERPTR + * memory model, and to the dma_buf sglist when used with the + * DMABUF memory model. + */ + struct sg_table *dma_sgt; size_t size; unsigned intnum_pages; atomic_trefcount; struct vb2_vmarea_handler handler; struct vm_area_struct *vma; + + struct dma_buf_attachment *db_attach; }; static void vb2_dma_sg_put(void *buf_priv); @@ -112,6 +120,7 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size, buf-size = size; /* size is already page aligned */ buf-num_pages = size PAGE_SHIFT; + buf-dma_sgt = buf-sg_table; buf-pages = kzalloc(buf-num_pages * sizeof(struct page *), GFP_KERNEL); @@ -122,7 +131,7 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size, if (ret) goto fail_pages_alloc; - ret = sg_alloc_table_from_pages(buf-sg_table, buf-pages, + ret = sg_alloc_table_from_pages(buf-dma_sgt, buf-pages, buf-num_pages, 0, size, GFP_KERNEL); if (ret) goto fail_table_alloc; @@ -171,7 +180,7 @@ static void vb2_dma_sg_put(void *buf_priv) dma_unmap_sg(buf-dev, sgt-sgl, sgt-nents, buf-dma_dir); if (buf-vaddr) vm_unmap_ram(buf-vaddr, buf-num_pages); - sg_free_table(buf-sg_table); + sg_free_table(buf-dma_sgt); while (--i = 0) __free_page(buf-pages[i]); kfree(buf-pages); @@ -183,7 +192,11 @@ static void vb2_dma_sg_put(void *buf_priv) static void vb2_dma_sg_prepare(void *buf_priv) { struct vb2_dma_sg_buf *buf = buf_priv; - struct sg_table *sgt = buf-sg_table; + struct sg_table *sgt = buf-dma_sgt; + + /* DMABUF exporter will flush the cache for us */ + if (buf-db_attach) + return; Is this actually true ? If you look at the export code in patch 08/12, I don't see where the exporter would sync the buffer for the importer device. dma_sync_sg_for_device(buf-dev, sgt-sgl, sgt-nents, buf-dma_dir); } @@ -191,7 +204,11 @@ static void vb2_dma_sg_prepare(void *buf_priv) static void vb2_dma_sg_finish(void *buf_priv) { struct vb2_dma_sg_buf *buf = buf_priv; - struct sg_table *sgt = buf-sg_table; + struct sg_table *sgt = buf-dma_sgt; + + /* DMABUF exporter will flush the cache for us */ + if (buf-db_attach) + return; dma_sync_sg_for_cpu(buf-dev, sgt-sgl, sgt-nents, buf-dma_dir); } @@ -219,6 +236,7 @@ static void *vb2_dma_sg_get_userptr(void *alloc_ctx, unsigned long vaddr, buf-dma_dir = dma_dir; buf-offset = vaddr ~PAGE_MASK; buf-size = size; + buf-dma_sgt = buf-sg_table; first = (vaddrPAGE_MASK) PAGE_SHIFT; last = ((vaddr + size - 1) PAGE_MASK) PAGE_SHIFT; @@ -271,7 +289,7 @@ static void *vb2_dma_sg_get_userptr(void *alloc_ctx, unsigned long vaddr, if (num_pages_from_user != buf-num_pages) goto userptr_fail_get_user_pages; - if (sg_alloc_table_from_pages(buf-sg_table, buf-pages, + if (sg_alloc_table_from_pages(buf-dma_sgt, buf-pages, buf-num_pages, buf-offset, size, 0)) goto userptr_fail_alloc_table_from_pages; @@ -313,7 +331,7 @@ static void vb2_dma_sg_put_userptr(void *buf_priv) dma_unmap_sg(buf-dev, sgt-sgl, sgt-nents, buf-dma_dir); if (buf-vaddr) vm_unmap_ram(buf-vaddr, buf-num_pages); - sg_free_table(buf-sg_table); + sg_free_table(buf-dma_sgt); while (--i = 0) { if (buf-dma_dir == DMA_FROM_DEVICE) set_page_dirty_lock(buf-pages[i]); @@ -331,14 +349,16 @@ static void *vb2_dma_sg_vaddr(void *buf_priv) BUG_ON(!buf); - if (!buf-vaddr) - buf-vaddr = vm_map_ram(buf-pages, -
Re: [PATCH 3/9] clk: sunxi: Add prcm mod0 clock driver
Hi, On Tue, Nov 25, 2014 at 09:29:21AM +0100, Hans de Goede wrote: Hi, On 11/24/2014 11:03 PM, Maxime Ripard wrote: On Fri, Nov 21, 2014 at 10:13:10AM +0100, Hans de Goede wrote: Hi, On 11/21/2014 09:49 AM, Maxime Ripard wrote: Hi, On Thu, Nov 20, 2014 at 04:55:22PM +0100, Hans de Goede wrote: Add a driver for mod0 clocks found in the prcm. Currently there is only one mod0 clocks in the prcm, the ir clock. Signed-off-by: Hans de Goede hdego...@redhat.com --- Documentation/devicetree/bindings/clock/sunxi.txt | 1 + drivers/clk/sunxi/Makefile| 2 +- drivers/clk/sunxi/clk-sun6i-prcm-mod0.c | 63 +++ drivers/mfd/sun6i-prcm.c | 14 + 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/sunxi/clk-sun6i-prcm-mod0.c diff --git a/Documentation/devicetree/bindings/clock/sunxi.txt b/Documentation/devicetree/bindings/clock/sunxi.txt index ed116df..342c75a 100644 --- a/Documentation/devicetree/bindings/clock/sunxi.txt +++ b/Documentation/devicetree/bindings/clock/sunxi.txt @@ -56,6 +56,7 @@ Required properties: allwinner,sun4i-a10-usb-clk - for usb gates + resets on A10 / A20 allwinner,sun5i-a13-usb-clk - for usb gates + resets on A13 allwinner,sun6i-a31-usb-clk - for usb gates + resets on A31 + allwinner,sun6i-a31-ir-clk - for the ir clock on A31 Required properties for all clocks: - reg : shall be the control register address for the clock. diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile index 7ddc2b5..daf8b1c 100644 --- a/drivers/clk/sunxi/Makefile +++ b/drivers/clk/sunxi/Makefile @@ -10,4 +10,4 @@ obj-y += clk-sun8i-mbus.o obj-$(CONFIG_MFD_SUN6I_PRCM) += \ clk-sun6i-ar100.o clk-sun6i-apb0.o clk-sun6i-apb0-gates.o \ - clk-sun8i-apb0.o + clk-sun8i-apb0.o clk-sun6i-prcm-mod0.o diff --git a/drivers/clk/sunxi/clk-sun6i-prcm-mod0.c b/drivers/clk/sunxi/clk-sun6i-prcm-mod0.c new file mode 100644 index 000..e80f18e --- /dev/null +++ b/drivers/clk/sunxi/clk-sun6i-prcm-mod0.c @@ -0,0 +1,63 @@ +/* + * Allwinner A31 PRCM mod0 clock driver + * + * Copyright (C) 2014 Hans de Goede hdego...@redhat.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include linux/clk-provider.h +#include linux/clkdev.h +#include linux/module.h +#include linux/of_address.h +#include linux/platform_device.h + +#include clk-factors.h +#include clk-mod0.h + +static const struct of_device_id sun6i_a31_prcm_mod0_clk_dt_ids[] = { + { .compatible = allwinner,sun6i-a31-ir-clk }, + { /* sentinel */ } +}; + +static DEFINE_SPINLOCK(sun6i_prcm_mod0_lock); + +static int sun6i_a31_prcm_mod0_clk_probe(struct platform_device *pdev) +{ + struct device_node *np = pdev-dev.of_node; + struct resource *r; + void __iomem *reg; + + if (!np) + return -ENODEV; + + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); + reg = devm_ioremap_resource(pdev-dev, r); + if (IS_ERR(reg)) + return PTR_ERR(reg); + + sunxi_factors_register(np, sun4i_a10_mod0_data, +sun6i_prcm_mod0_lock, reg); + return 0; +} + +static struct platform_driver sun6i_a31_prcm_mod0_clk_driver = { + .driver = { + .name = sun6i-a31-prcm-mod0-clk, + .of_match_table = sun6i_a31_prcm_mod0_clk_dt_ids, + }, + .probe = sun6i_a31_prcm_mod0_clk_probe, +}; +module_platform_driver(sun6i_a31_prcm_mod0_clk_driver); + +MODULE_DESCRIPTION(Allwinner A31 PRCM mod0 clock driver); +MODULE_AUTHOR(Hans de Goede hdego...@redhat.com); +MODULE_LICENSE(GPL); I don't think this is the right approach, mainly for two reasons: the compatible shouldn't change, and you're basically duplicating code there. I understand that you need the new compatible in order to avoid a double probing: one by CLK_OF_DECLARE, and one by the usual mechanism, and that also implies the second reason. Not only for that, we need a new compatible also because the mfd framework needs a separate compatible per sub-node as that is how it finds nodes to attach to the platform devices, so we need a new compatible anyways, with your make the mod0 clock driver a platform driver solution we could use: We have a single mod0 clock in there, so no, not really. We have a single mod0 clock there today, but who knows what tomorrow brings, arguably the 1wire clock is a mod0 clock too, so we already have 2 today. I
[PATCH 2/2] mn88472: document demod reset
Signed-off-by: Benjamin Larsson benja...@southpole.se --- drivers/staging/media/mn88472/mn88472.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c index f648b58..36ef39b 100644 --- a/drivers/staging/media/mn88472/mn88472.c +++ b/drivers/staging/media/mn88472/mn88472.c @@ -190,6 +190,8 @@ static int mn88472_set_frontend(struct dvb_frontend *fe) ret = regmap_write(dev-regmap[0], 0xae, 0x00); ret = regmap_write(dev-regmap[2], 0x08, 0x1d); ret = regmap_write(dev-regmap[0], 0xd9, 0xe3); + + /* Reset demod */ ret = regmap_write(dev-regmap[2], 0xf8, 0x9f); if (ret) goto err; -- 2.1.0 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/2] mn88472: calculate the IF register values
Add xtal as a configuration parameter so it can be used in the IF register value calculation. Signed-off-by: Benjamin Larsson benja...@southpole.se --- drivers/media/dvb-frontends/mn88472.h| 6 ++ drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 1 + drivers/staging/media/mn88472/mn88472.c | 23 --- drivers/staging/media/mn88472/mn88472_priv.h | 1 + 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/media/dvb-frontends/mn88472.h b/drivers/media/dvb-frontends/mn88472.h index da4558b..e4e0b80 100644 --- a/drivers/media/dvb-frontends/mn88472.h +++ b/drivers/media/dvb-frontends/mn88472.h @@ -33,6 +33,12 @@ struct mn88472_config { * DVB frontend. */ struct dvb_frontend **fe; + + /* +* Xtal frequency. +* Hz +*/ + u32 xtal; }; #endif diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c index 896a225..73580f8 100644 --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c @@ -852,6 +852,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) mn88472_config.fe = adap-fe[1]; mn88472_config.i2c_wr_max = 22, strlcpy(info.type, mn88472, I2C_NAME_SIZE); + mn88472_config.xtal = 2050; info.addr = 0x18; info.platform_data = mn88472_config; request_module(info.type); diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c index 52de8f8..f648b58 100644 --- a/drivers/staging/media/mn88472/mn88472.c +++ b/drivers/staging/media/mn88472/mn88472.c @@ -30,6 +30,7 @@ static int mn88472_set_frontend(struct dvb_frontend *fe) struct dtv_frontend_properties *c = fe-dtv_property_cache; int ret, i; u32 if_frequency = 0; + u64 tmp; u8 delivery_system_val, if_val[3], bw_val[7], bw_val2; dev_dbg(client-dev, @@ -62,17 +63,14 @@ static int mn88472_set_frontend(struct dvb_frontend *fe) case SYS_DVBT2: if (c-bandwidth_hz = 600) { /* IF 357 Hz, BW 600 Hz */ - memcpy(if_val, \x2c\x94\xdb, 3); memcpy(bw_val, \xbf\x55\x55\x15\x6b\x15\x6b, 7); bw_val2 = 0x02; } else if (c-bandwidth_hz = 700) { /* IF 457 Hz, BW 700 Hz */ - memcpy(if_val, \x39\x11\xbc, 3); memcpy(bw_val, \xa4\x00\x00\x0f\x2c\x0f\x2c, 7); bw_val2 = 0x01; } else if (c-bandwidth_hz = 800) { /* IF 457 Hz, BW 800 Hz */ - memcpy(if_val, \x39\x11\xbc, 3); memcpy(bw_val, \x8f\x80\x00\x08\xee\x08\xee, 7); bw_val2 = 0x00; } else { @@ -82,7 +80,6 @@ static int mn88472_set_frontend(struct dvb_frontend *fe) break; case SYS_DVBC_ANNEX_A: /* IF 507 Hz, BW 800 Hz */ - memcpy(if_val, \x3f\x50\x2c, 3); memcpy(bw_val, \x8f\x80\x00\x08\xee\x08\xee, 7); bw_val2 = 0x00; break; @@ -106,17 +103,12 @@ static int mn88472_set_frontend(struct dvb_frontend *fe) dev_dbg(client-dev, get_if_frequency=%d\n, if_frequency); } - switch (if_frequency) { - case 357: - case 457: - case 507: - break; - default: - dev_err(client-dev, IF frequency %d not supported\n, - if_frequency); - ret = -EINVAL; - goto err; - } + /* Calculate IF registers ( (124)*IF / Xtal ) */ + tmp = div_u64(if_frequency * (u64)(124) + (dev-xtal / 2), + dev-xtal); + if_val[0] = ((tmp 16) 0xff); + if_val[1] = ((tmp 8) 0xff); + if_val[2] = ((tmp 0) 0xff); ret = regmap_write(dev-regmap[2], 0xfb, 0x13); ret = regmap_write(dev-regmap[2], 0xef, 0x13); @@ -411,6 +403,7 @@ static int mn88472_probe(struct i2c_client *client, } dev-i2c_wr_max = config-i2c_wr_max; + dev-xtal = config-xtal; dev-client[0] = client; dev-regmap[0] = regmap_init_i2c(dev-client[0], regmap_config); if (IS_ERR(dev-regmap[0])) { diff --git a/drivers/staging/media/mn88472/mn88472_priv.h b/drivers/staging/media/mn88472/mn88472_priv.h index 1095949..b12b731 100644 --- a/drivers/staging/media/mn88472/mn88472_priv.h +++ b/drivers/staging/media/mn88472/mn88472_priv.h @@ -31,6 +31,7 @@ struct mn88472_dev { u16 i2c_wr_max; fe_delivery_system_t delivery_system; bool warm; /* FW running */ + u32 xtal; };
[PATCH v2 07/11] media: s5p-tv: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Cc: Kyungmin Park kyungmin.p...@samsung.com Cc: Tomasz Stanislawski t.stanisl...@samsung.com --- drivers/media/platform/s5p-tv/mixer_video.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c index b4d2696..72d4f2e 100644 --- a/drivers/media/platform/s5p-tv/mixer_video.c +++ b/drivers/media/platform/s5p-tv/mixer_video.c @@ -926,22 +926,6 @@ static void buf_queue(struct vb2_buffer *vb) mxr_dbg(mdev, queuing buffer\n); } -static void wait_lock(struct vb2_queue *vq) -{ - struct mxr_layer *layer = vb2_get_drv_priv(vq); - - mxr_dbg(layer-mdev, %s\n, __func__); - mutex_lock(layer-mutex); -} - -static void wait_unlock(struct vb2_queue *vq) -{ - struct mxr_layer *layer = vb2_get_drv_priv(vq); - - mxr_dbg(layer-mdev, %s\n, __func__); - mutex_unlock(layer-mutex); -} - static int start_streaming(struct vb2_queue *vq, unsigned int count) { struct mxr_layer *layer = vb2_get_drv_priv(vq); @@ -1040,8 +1024,8 @@ static void stop_streaming(struct vb2_queue *vq) static struct vb2_ops mxr_video_qops = { .queue_setup = queue_setup, .buf_queue = buf_queue, - .wait_prepare = wait_unlock, - .wait_finish = wait_lock, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, .start_streaming = start_streaming, .stop_streaming = stop_streaming, }; @@ -1122,6 +1106,7 @@ struct mxr_layer *mxr_base_layer_create(struct mxr_device *mdev, .ops = mxr_video_qops, .min_buffers_needed = 1, .mem_ops = vb2_dma_contig_memops, + .lock = layer-mutex, }; return layer; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 10/11] media: davinci: vpif_capture: use vb2_ops_wait_prepare/finish helper
This patch adds support in the capture driver for using vb2_ops_wait_prepare/finish() helpers provided by the vb2 core. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com --- drivers/media/platform/davinci/vpif_capture.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 3ccb26f..d8e1b98 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -311,6 +311,8 @@ static struct vb2_ops video_qops = { .start_streaming= vpif_start_streaming, .stop_streaming = vpif_stop_streaming, .buf_queue = vpif_buffer_queue, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish= vb2_ops_wait_finish, }; /** -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 11/11] media: usb: uvc: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/usb/uvc/uvc_queue.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c index cc96072..64147b5 100644 --- a/drivers/media/usb/uvc/uvc_queue.c +++ b/drivers/media/usb/uvc/uvc_queue.c @@ -143,20 +143,6 @@ static void uvc_buffer_finish(struct vb2_buffer *vb) uvc_video_clock_update(stream, vb-v4l2_buf, buf); } -static void uvc_wait_prepare(struct vb2_queue *vq) -{ - struct uvc_video_queue *queue = vb2_get_drv_priv(vq); - - mutex_unlock(queue-mutex); -} - -static void uvc_wait_finish(struct vb2_queue *vq) -{ - struct uvc_video_queue *queue = vb2_get_drv_priv(vq); - - mutex_lock(queue-mutex); -} - static int uvc_start_streaming(struct vb2_queue *vq, unsigned int count) { struct uvc_video_queue *queue = vb2_get_drv_priv(vq); @@ -195,8 +181,8 @@ static struct vb2_ops uvc_queue_qops = { .buf_prepare = uvc_buffer_prepare, .buf_queue = uvc_buffer_queue, .buf_finish = uvc_buffer_finish, - .wait_prepare = uvc_wait_prepare, - .wait_finish = uvc_wait_finish, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, .start_streaming = uvc_start_streaming, .stop_streaming = uvc_stop_streaming, }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 09/11] media: s5p-mfc: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Cc: Kyungmin Park kyungmin.p...@samsung.com Cc: Kamil Debski k.deb...@samsung.com Cc: Jeongtae Park jtp.p...@samsung.com --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 1 + drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 20 ++-- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 20 ++-- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 03204fd..52f65e9 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -810,6 +810,7 @@ static int s5p_mfc_open(struct file *file) q = ctx-vq_dst; q-type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; q-drv_priv = ctx-fh; + q-lock = dev-mfc_mutex; if (vdev == dev-vfd_dec) { q-io_modes = VB2_MMAP; q-ops = get_dec_queue_ops(); diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index 74bcec8..78b3e0e 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c @@ -946,22 +946,6 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq, return 0; } -static void s5p_mfc_unlock(struct vb2_queue *q) -{ - struct s5p_mfc_ctx *ctx = fh_to_ctx(q-drv_priv); - struct s5p_mfc_dev *dev = ctx-dev; - - mutex_unlock(dev-mfc_mutex); -} - -static void s5p_mfc_lock(struct vb2_queue *q) -{ - struct s5p_mfc_ctx *ctx = fh_to_ctx(q-drv_priv); - struct s5p_mfc_dev *dev = ctx-dev; - - mutex_lock(dev-mfc_mutex); -} - static int s5p_mfc_buf_init(struct vb2_buffer *vb) { struct vb2_queue *vq = vb-vb2_queue; @@ -1109,8 +1093,8 @@ static void s5p_mfc_buf_queue(struct vb2_buffer *vb) static struct vb2_ops s5p_mfc_dec_qops = { .queue_setup= s5p_mfc_queue_setup, - .wait_prepare = s5p_mfc_unlock, - .wait_finish= s5p_mfc_lock, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish= vb2_ops_wait_finish, .buf_init = s5p_mfc_buf_init, .start_streaming= s5p_mfc_start_streaming, .stop_streaming = s5p_mfc_stop_streaming, diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index e7240cb..ffa9c1d 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -1869,22 +1869,6 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq, return 0; } -static void s5p_mfc_unlock(struct vb2_queue *q) -{ - struct s5p_mfc_ctx *ctx = fh_to_ctx(q-drv_priv); - struct s5p_mfc_dev *dev = ctx-dev; - - mutex_unlock(dev-mfc_mutex); -} - -static void s5p_mfc_lock(struct vb2_queue *q) -{ - struct s5p_mfc_ctx *ctx = fh_to_ctx(q-drv_priv); - struct s5p_mfc_dev *dev = ctx-dev; - - mutex_lock(dev-mfc_mutex); -} - static int s5p_mfc_buf_init(struct vb2_buffer *vb) { struct vb2_queue *vq = vb-vb2_queue; @@ -2054,8 +2038,8 @@ static void s5p_mfc_buf_queue(struct vb2_buffer *vb) static struct vb2_ops s5p_mfc_enc_qops = { .queue_setup= s5p_mfc_queue_setup, - .wait_prepare = s5p_mfc_unlock, - .wait_finish= s5p_mfc_lock, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish= vb2_ops_wait_finish, .buf_init = s5p_mfc_buf_init, .buf_prepare= s5p_mfc_buf_prepare, .start_streaming= s5p_mfc_start_streaming, -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 08/11] media: blackfin: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Acked-by: Scott Jiang scott.jiang.li...@gmail.com --- drivers/media/platform/blackfin/bfin_capture.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c index b3345b3..819ec0e 100644 --- a/drivers/media/platform/blackfin/bfin_capture.c +++ b/drivers/media/platform/blackfin/bfin_capture.c @@ -349,18 +349,6 @@ static void bcap_buffer_cleanup(struct vb2_buffer *vb) spin_unlock_irqrestore(bcap_dev-lock, flags); } -static void bcap_lock(struct vb2_queue *vq) -{ - struct bcap_device *bcap_dev = vb2_get_drv_priv(vq); - mutex_lock(bcap_dev-mutex); -} - -static void bcap_unlock(struct vb2_queue *vq) -{ - struct bcap_device *bcap_dev = vb2_get_drv_priv(vq); - mutex_unlock(bcap_dev-mutex); -} - static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count) { struct bcap_device *bcap_dev = vb2_get_drv_priv(vq); @@ -457,8 +445,8 @@ static struct vb2_ops bcap_video_qops = { .buf_prepare= bcap_buffer_prepare, .buf_cleanup= bcap_buffer_cleanup, .buf_queue = bcap_buffer_queue, - .wait_prepare = bcap_unlock, - .wait_finish= bcap_lock, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish= vb2_ops_wait_finish, .start_streaming= bcap_start_streaming, .stop_streaming = bcap_stop_streaming, }; @@ -995,6 +983,7 @@ static int bcap_probe(struct platform_device *pdev) q-ops = bcap_video_qops; q-mem_ops = vb2_dma_contig_memops; q-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; + q-lock = bcap_dev-mutex; ret = vb2_queue_init(q); if (ret) -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 04/11] media: soc_camera: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Cc: Josh Wu josh...@atmel.com Cc: Guennadi Liakhovetski g.liakhovet...@gmx.de --- drivers/media/platform/soc_camera/atmel-isi.c| 7 +-- drivers/media/platform/soc_camera/mx3_camera.c | 7 +-- drivers/media/platform/soc_camera/rcar_vin.c | 7 +-- drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c | 7 +-- drivers/media/platform/soc_camera/soc_camera.c | 16 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c index ee5650f..6306ba5 100644 --- a/drivers/media/platform/soc_camera/atmel-isi.c +++ b/drivers/media/platform/soc_camera/atmel-isi.c @@ -455,8 +455,8 @@ static struct vb2_ops isi_video_qops = { .buf_queue = buffer_queue, .start_streaming= start_streaming, .stop_streaming = stop_streaming, - .wait_prepare = soc_camera_unlock, - .wait_finish= soc_camera_lock, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish= vb2_ops_wait_finish, }; /* -- @@ -465,6 +465,8 @@ static struct vb2_ops isi_video_qops = { static int isi_camera_init_videobuf(struct vb2_queue *q, struct soc_camera_device *icd) { + struct soc_camera_host *ici = to_soc_camera_host(icd-parent); + q-type = V4L2_BUF_TYPE_VIDEO_CAPTURE; q-io_modes = VB2_MMAP; q-drv_priv = icd; @@ -472,6 +474,7 @@ static int isi_camera_init_videobuf(struct vb2_queue *q, q-ops = isi_video_qops; q-mem_ops = vb2_dma_contig_memops; q-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; + q-lock = ici-host_lock; return vb2_queue_init(q); } diff --git a/drivers/media/platform/soc_camera/mx3_camera.c b/drivers/media/platform/soc_camera/mx3_camera.c index 8e52ccc..1000c2e 100644 --- a/drivers/media/platform/soc_camera/mx3_camera.c +++ b/drivers/media/platform/soc_camera/mx3_camera.c @@ -435,14 +435,16 @@ static struct vb2_ops mx3_videobuf_ops = { .buf_queue = mx3_videobuf_queue, .buf_cleanup= mx3_videobuf_release, .buf_init = mx3_videobuf_init, - .wait_prepare = soc_camera_unlock, - .wait_finish= soc_camera_lock, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish= vb2_ops_wait_finish, .stop_streaming = mx3_stop_streaming, }; static int mx3_camera_init_videobuf(struct vb2_queue *q, struct soc_camera_device *icd) { + struct soc_camera_host *ici = to_soc_camera_host(icd-parent); + q-type = V4L2_BUF_TYPE_VIDEO_CAPTURE; q-io_modes = VB2_MMAP | VB2_USERPTR; q-drv_priv = icd; @@ -450,6 +452,7 @@ static int mx3_camera_init_videobuf(struct vb2_queue *q, q-mem_ops = vb2_dma_contig_memops; q-buf_struct_size = sizeof(struct mx3_camera_buffer); q-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; + q-lock = ici-host_lock; return vb2_queue_init(q); } diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index 8d8438b..724e239 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -535,8 +535,8 @@ static struct vb2_ops rcar_vin_vb2_ops = { .buf_cleanup= rcar_vin_videobuf_release, .buf_queue = rcar_vin_videobuf_queue, .stop_streaming = rcar_vin_stop_streaming, - .wait_prepare = soc_camera_unlock, - .wait_finish= soc_camera_lock, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish= vb2_ops_wait_finish, }; static irqreturn_t rcar_vin_irq(int irq, void *data) @@ -1364,6 +1364,8 @@ static int rcar_vin_querycap(struct soc_camera_host *ici, static int rcar_vin_init_videobuf2(struct vb2_queue *vq, struct soc_camera_device *icd) { + struct soc_camera_host *ici = to_soc_camera_host(icd-parent); + vq-type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vq-io_modes = VB2_MMAP | VB2_USERPTR; vq-drv_priv = icd; @@ -1371,6 +1373,7 @@ static int rcar_vin_init_videobuf2(struct vb2_queue *vq, vq-mem_ops = vb2_dma_contig_memops; vq-buf_struct_size = sizeof(struct rcar_vin_buffer); vq-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; + vq-lock = ici-host_lock; return vb2_queue_init(vq);
[PATCH v2 06/11] media: marvell-ccic: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Cc: Jonathan Corbet cor...@lwn.net --- drivers/media/platform/marvell-ccic/mcam-core.c | 29 + 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c index ce00cba..4ec29c0 100644 --- a/drivers/media/platform/marvell-ccic/mcam-core.c +++ b/drivers/media/platform/marvell-ccic/mcam-core.c @@ -1102,26 +1102,6 @@ static void mcam_vb_buf_queue(struct vb2_buffer *vb) mcam_read_setup(cam); } - -/* - * vb2 uses these to release the mutex when waiting in dqbuf. I'm - * not actually sure we need to do this (I'm not sure that vb2_dqbuf() needs - * to be called with the mutex held), but better safe than sorry. - */ -static void mcam_vb_wait_prepare(struct vb2_queue *vq) -{ - struct mcam_camera *cam = vb2_get_drv_priv(vq); - - mutex_unlock(cam-s_mutex); -} - -static void mcam_vb_wait_finish(struct vb2_queue *vq) -{ - struct mcam_camera *cam = vb2_get_drv_priv(vq); - - mutex_lock(cam-s_mutex); -} - /* * These need to be called with the mutex held from vb2 */ @@ -1191,8 +1171,8 @@ static const struct vb2_ops mcam_vb2_ops = { .buf_queue = mcam_vb_buf_queue, .start_streaming= mcam_vb_start_streaming, .stop_streaming = mcam_vb_stop_streaming, - .wait_prepare = mcam_vb_wait_prepare, - .wait_finish= mcam_vb_wait_finish, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish= vb2_ops_wait_finish, }; @@ -1252,8 +1232,8 @@ static const struct vb2_ops mcam_vb2_sg_ops = { .buf_cleanup= mcam_vb_sg_buf_cleanup, .start_streaming= mcam_vb_start_streaming, .stop_streaming = mcam_vb_stop_streaming, - .wait_prepare = mcam_vb_wait_prepare, - .wait_finish= mcam_vb_wait_finish, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish= vb2_ops_wait_finish, }; #endif /* MCAM_MODE_DMA_SG */ @@ -1265,6 +1245,7 @@ static int mcam_setup_vb2(struct mcam_camera *cam) memset(vq, 0, sizeof(*vq)); vq-type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vq-drv_priv = cam; + vq-lock = cam-s_mutex; INIT_LIST_HEAD(cam-buffers); switch (cam-buffer_mode) { case B_DMA_contig: -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 05/11] media: sh_veu: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Cc: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/platform/sh_veu.c | 35 +++ 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c index be3b3bc..7884117 100644 --- a/drivers/media/platform/sh_veu.c +++ b/drivers/media/platform/sh_veu.c @@ -242,20 +242,6 @@ static void sh_veu_job_abort(void *priv) veu-aborting = true; } -static void sh_veu_lock(void *priv) -{ - struct sh_veu_dev *veu = priv; - - mutex_lock(veu-fop_lock); -} - -static void sh_veu_unlock(void *priv) -{ - struct sh_veu_dev *veu = priv; - - mutex_unlock(veu-fop_lock); -} - static void sh_veu_process(struct sh_veu_dev *veu, struct vb2_buffer *src_buf, struct vb2_buffer *dst_buf) @@ -950,36 +936,28 @@ static void sh_veu_buf_queue(struct vb2_buffer *vb) v4l2_m2m_buf_queue(veu-m2m_ctx, vb); } -static void sh_veu_wait_prepare(struct vb2_queue *q) -{ - sh_veu_unlock(vb2_get_drv_priv(q)); -} - -static void sh_veu_wait_finish(struct vb2_queue *q) -{ - sh_veu_lock(vb2_get_drv_priv(q)); -} - static const struct vb2_ops sh_veu_qops = { .queue_setup = sh_veu_queue_setup, .buf_prepare = sh_veu_buf_prepare, .buf_queue = sh_veu_buf_queue, - .wait_prepare= sh_veu_wait_prepare, - .wait_finish = sh_veu_wait_finish, + .wait_prepare= vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, }; static int sh_veu_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq) { + struct sh_veu_dev *veu = priv; int ret; memset(src_vq, 0, sizeof(*src_vq)); src_vq-type = V4L2_BUF_TYPE_VIDEO_OUTPUT; src_vq-io_modes = VB2_MMAP | VB2_USERPTR; - src_vq-drv_priv = priv; + src_vq-drv_priv = veu; src_vq-buf_struct_size = sizeof(struct v4l2_m2m_buffer); src_vq-ops = sh_veu_qops; src_vq-mem_ops = vb2_dma_contig_memops; + src_vq-lock = veu-fop_lock; ret = vb2_queue_init(src_vq); if (ret 0) @@ -988,10 +966,11 @@ static int sh_veu_queue_init(void *priv, struct vb2_queue *src_vq, memset(dst_vq, 0, sizeof(*dst_vq)); dst_vq-type = V4L2_BUF_TYPE_VIDEO_CAPTURE; dst_vq-io_modes = VB2_MMAP | VB2_USERPTR; - dst_vq-drv_priv = priv; + dst_vq-drv_priv = veu; dst_vq-buf_struct_size = sizeof(struct v4l2_m2m_buffer); dst_vq-ops = sh_veu_qops; dst_vq-mem_ops = vb2_dma_contig_memops; + dst_vq-lock = veu-fop_lock; return vb2_queue_init(dst_vq); } -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 02/11] media: ti-vpe: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Cc: Kukjin Kim kgene@samsung.com --- drivers/media/platform/ti-vpe/vpe.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c index 9a081c2..d5d745d 100644 --- a/drivers/media/platform/ti-vpe/vpe.c +++ b/drivers/media/platform/ti-vpe/vpe.c @@ -1913,30 +1913,19 @@ static void vpe_buf_queue(struct vb2_buffer *vb) v4l2_m2m_buf_queue(ctx-m2m_ctx, vb); } -static void vpe_wait_prepare(struct vb2_queue *q) -{ - struct vpe_ctx *ctx = vb2_get_drv_priv(q); - vpe_unlock(ctx); -} - -static void vpe_wait_finish(struct vb2_queue *q) -{ - struct vpe_ctx *ctx = vb2_get_drv_priv(q); - vpe_lock(ctx); -} - static struct vb2_ops vpe_qops = { .queue_setup = vpe_queue_setup, .buf_prepare = vpe_buf_prepare, .buf_queue = vpe_buf_queue, - .wait_prepare= vpe_wait_prepare, - .wait_finish = vpe_wait_finish, + .wait_prepare= vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, }; static int queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq) { struct vpe_ctx *ctx = priv; + struct vpe_dev *dev = ctx-dev; int ret; memset(src_vq, 0, sizeof(*src_vq)); @@ -1947,6 +1936,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, src_vq-ops = vpe_qops; src_vq-mem_ops = vb2_dma_contig_memops; src_vq-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; + src_vq-lock = dev-dev_mutex; ret = vb2_queue_init(src_vq); if (ret) @@ -1960,6 +1950,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, dst_vq-ops = vpe_qops; dst_vq-mem_ops = vb2_dma_contig_memops; dst_vq-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; + dst_vq-lock = dev-dev_mutex; return vb2_queue_init(dst_vq); } -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 01/11] media: s3c-camif: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Cc: Sylwester Nawrocki sylvester.nawro...@gmail.com --- drivers/media/platform/s3c-camif/camif-capture.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c index aa40c82..54479d6 100644 --- a/drivers/media/platform/s3c-camif/camif-capture.c +++ b/drivers/media/platform/s3c-camif/camif-capture.c @@ -536,24 +536,12 @@ static void buffer_queue(struct vb2_buffer *vb) spin_unlock_irqrestore(camif-slock, flags); } -static void camif_lock(struct vb2_queue *vq) -{ - struct camif_vp *vp = vb2_get_drv_priv(vq); - mutex_lock(vp-camif-lock); -} - -static void camif_unlock(struct vb2_queue *vq) -{ - struct camif_vp *vp = vb2_get_drv_priv(vq); - mutex_unlock(vp-camif-lock); -} - static const struct vb2_ops s3c_camif_qops = { .queue_setup = queue_setup, .buf_prepare = buffer_prepare, .buf_queue = buffer_queue, - .wait_prepare= camif_unlock, - .wait_finish = camif_lock, + .wait_prepare= vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, .start_streaming = start_streaming, .stop_streaming = stop_streaming, }; @@ -1161,6 +1149,7 @@ int s3c_camif_register_video_node(struct camif_dev *camif, int idx) q-buf_struct_size = sizeof(struct camif_buffer); q-drv_priv = vp; q-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; + q-lock = vp-camif-lock; ret = vb2_queue_init(q); if (ret) -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 00/11] media: use vb2_ops_wait_prepare/finish helper
Hi All, This patch set uses the vb2 ops helpers for wait_prepare and wait_finish callbacks for drivers which using vb2 helpers. This patchset is compile tested only. Changes for v2: a: Included proper commit message. b: included Ack. Lad, Prabhakar (11): media: s3c-camif: use vb2_ops_wait_prepare/finish helper media: ti-vpe: use vb2_ops_wait_prepare/finish helper media: exynos-gsc: use vb2_ops_wait_prepare/finish helper media: soc_camera: use vb2_ops_wait_prepare/finish helper media: sh_veu: use vb2_ops_wait_prepare/finish helper media: marvell-ccic: use vb2_ops_wait_prepare/finish helper media: s5p-tv: use vb2_ops_wait_prepare/finish helper media: blackfin: use vb2_ops_wait_prepare/finish helper media: s5p-mfc: use vb2_ops_wait_prepare/finish helper media: davinci: vpif_capture: use vb2_ops_wait_prepare/finish helper media: usb: uvc: use vb2_ops_wait_prepare/finish helper drivers/media/platform/blackfin/bfin_capture.c | 17 ++- drivers/media/platform/davinci/vpif_capture.c | 2 ++ drivers/media/platform/exynos-gsc/gsc-core.h | 12 drivers/media/platform/exynos-gsc/gsc-m2m.c| 6 ++-- drivers/media/platform/marvell-ccic/mcam-core.c| 29 -- drivers/media/platform/s3c-camif/camif-capture.c | 17 ++- drivers/media/platform/s5p-mfc/s5p_mfc.c | 1 + drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 20 ++--- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 20 ++--- drivers/media/platform/s5p-tv/mixer_video.c| 21 ++--- drivers/media/platform/sh_veu.c| 35 +- drivers/media/platform/soc_camera/atmel-isi.c | 7 +++-- drivers/media/platform/soc_camera/mx3_camera.c | 7 +++-- drivers/media/platform/soc_camera/rcar_vin.c | 7 +++-- .../platform/soc_camera/sh_mobile_ceu_camera.c | 7 +++-- drivers/media/platform/soc_camera/soc_camera.c | 16 -- drivers/media/platform/ti-vpe/vpe.c| 19 drivers/media/usb/uvc/uvc_queue.c | 18 ++- 18 files changed, 59 insertions(+), 202 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 03/11] media: exynos-gsc: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Cc: Kukjin Kim kgene@samsung.com --- drivers/media/platform/exynos-gsc/gsc-core.h | 12 drivers/media/platform/exynos-gsc/gsc-m2m.c | 6 -- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.h b/drivers/media/platform/exynos-gsc/gsc-core.h index 0abdb17..fa572aa 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.h +++ b/drivers/media/platform/exynos-gsc/gsc-core.h @@ -466,18 +466,6 @@ static inline void gsc_hw_clear_irq(struct gsc_dev *dev, int irq) writel(cfg, dev-regs + GSC_IRQ); } -static inline void gsc_lock(struct vb2_queue *vq) -{ - struct gsc_ctx *ctx = vb2_get_drv_priv(vq); - mutex_lock(ctx-gsc_dev-lock); -} - -static inline void gsc_unlock(struct vb2_queue *vq) -{ - struct gsc_ctx *ctx = vb2_get_drv_priv(vq); - mutex_unlock(ctx-gsc_dev-lock); -} - static inline bool gsc_ctx_state_is_set(u32 mask, struct gsc_ctx *ctx) { unsigned long flags; diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c index 74e1de6..d5cffef 100644 --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c @@ -267,8 +267,8 @@ static struct vb2_ops gsc_m2m_qops = { .queue_setup = gsc_m2m_queue_setup, .buf_prepare = gsc_m2m_buf_prepare, .buf_queue = gsc_m2m_buf_queue, - .wait_prepare= gsc_unlock, - .wait_finish = gsc_lock, + .wait_prepare= vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, .stop_streaming = gsc_m2m_stop_streaming, .start_streaming = gsc_m2m_start_streaming, }; @@ -590,6 +590,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, src_vq-mem_ops = vb2_dma_contig_memops; src_vq-buf_struct_size = sizeof(struct v4l2_m2m_buffer); src_vq-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; + src_vq-lock = ctx-gsc_dev-lock; ret = vb2_queue_init(src_vq); if (ret) @@ -603,6 +604,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, dst_vq-mem_ops = vb2_dma_contig_memops; dst_vq-buf_struct_size = sizeof(struct v4l2_m2m_buffer); dst_vq-timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; + dst_vq-lock = ctx-gsc_dev-lock; return vb2_queue_init(dst_vq); } -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 11/11] media: usb: uvc: use vb2_ops_wait_prepare/finish helper
Hi Prabhakar, Thank you for the patch. On Wednesday 26 November 2014 22:42:34 Lad, Prabhakar wrote: This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. The queue lock field isn't initialized by the uvcvideo driver, so you can't use vb2_ops_wait_prepare|finish(). Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/usb/uvc/uvc_queue.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c index cc96072..64147b5 100644 --- a/drivers/media/usb/uvc/uvc_queue.c +++ b/drivers/media/usb/uvc/uvc_queue.c @@ -143,20 +143,6 @@ static void uvc_buffer_finish(struct vb2_buffer *vb) uvc_video_clock_update(stream, vb-v4l2_buf, buf); } -static void uvc_wait_prepare(struct vb2_queue *vq) -{ - struct uvc_video_queue *queue = vb2_get_drv_priv(vq); - - mutex_unlock(queue-mutex); -} - -static void uvc_wait_finish(struct vb2_queue *vq) -{ - struct uvc_video_queue *queue = vb2_get_drv_priv(vq); - - mutex_lock(queue-mutex); -} - static int uvc_start_streaming(struct vb2_queue *vq, unsigned int count) { struct uvc_video_queue *queue = vb2_get_drv_priv(vq); @@ -195,8 +181,8 @@ static struct vb2_ops uvc_queue_qops = { .buf_prepare = uvc_buffer_prepare, .buf_queue = uvc_buffer_queue, .buf_finish = uvc_buffer_finish, - .wait_prepare = uvc_wait_prepare, - .wait_finish = uvc_wait_finish, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, .start_streaming = uvc_start_streaming, .stop_streaming = uvc_stop_streaming, }; -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 11/11] media: usb: uvc: use vb2_ops_wait_prepare/finish helper
Hi Laurent, Thanks for the review. On Wed, Nov 26, 2014 at 10:59 PM, Laurent Pinchart laurent.pinch...@ideasonboard.com wrote: Hi Prabhakar, Thank you for the patch. On Wednesday 26 November 2014 22:42:34 Lad, Prabhakar wrote: This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. The queue lock field isn't initialized by the uvcvideo driver, so you can't use vb2_ops_wait_prepare|finish(). Oops not sure what happened here I just took the patch from [1] and added commit message. anyway will post a single patch v3. [1] https://patchwork.kernel.org/patch/5327451/ Thanks, --Prabhakar Lad Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/usb/uvc/uvc_queue.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c index cc96072..64147b5 100644 --- a/drivers/media/usb/uvc/uvc_queue.c +++ b/drivers/media/usb/uvc/uvc_queue.c @@ -143,20 +143,6 @@ static void uvc_buffer_finish(struct vb2_buffer *vb) uvc_video_clock_update(stream, vb-v4l2_buf, buf); } -static void uvc_wait_prepare(struct vb2_queue *vq) -{ - struct uvc_video_queue *queue = vb2_get_drv_priv(vq); - - mutex_unlock(queue-mutex); -} - -static void uvc_wait_finish(struct vb2_queue *vq) -{ - struct uvc_video_queue *queue = vb2_get_drv_priv(vq); - - mutex_lock(queue-mutex); -} - static int uvc_start_streaming(struct vb2_queue *vq, unsigned int count) { struct uvc_video_queue *queue = vb2_get_drv_priv(vq); @@ -195,8 +181,8 @@ static struct vb2_ops uvc_queue_qops = { .buf_prepare = uvc_buffer_prepare, .buf_queue = uvc_buffer_queue, .buf_finish = uvc_buffer_finish, - .wait_prepare = uvc_wait_prepare, - .wait_finish = uvc_wait_finish, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, .start_streaming = uvc_start_streaming, .stop_streaming = uvc_stop_streaming, }; -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3] media: usb: uvc: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and wait_finish() callbacks from vb2_ops and instead uses the the helpers vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member of the queue needs to be initalized to a mutex so that vb2 helpers vb2_ops_wait_prepare/finish() can make use of it. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/usb/uvc/uvc_queue.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c index cc96072..10c554e 100644 --- a/drivers/media/usb/uvc/uvc_queue.c +++ b/drivers/media/usb/uvc/uvc_queue.c @@ -143,20 +143,6 @@ static void uvc_buffer_finish(struct vb2_buffer *vb) uvc_video_clock_update(stream, vb-v4l2_buf, buf); } -static void uvc_wait_prepare(struct vb2_queue *vq) -{ - struct uvc_video_queue *queue = vb2_get_drv_priv(vq); - - mutex_unlock(queue-mutex); -} - -static void uvc_wait_finish(struct vb2_queue *vq) -{ - struct uvc_video_queue *queue = vb2_get_drv_priv(vq); - - mutex_lock(queue-mutex); -} - static int uvc_start_streaming(struct vb2_queue *vq, unsigned int count) { struct uvc_video_queue *queue = vb2_get_drv_priv(vq); @@ -195,8 +181,8 @@ static struct vb2_ops uvc_queue_qops = { .buf_prepare = uvc_buffer_prepare, .buf_queue = uvc_buffer_queue, .buf_finish = uvc_buffer_finish, - .wait_prepare = uvc_wait_prepare, - .wait_finish = uvc_wait_finish, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, .start_streaming = uvc_start_streaming, .stop_streaming = uvc_stop_streaming, }; @@ -214,6 +200,7 @@ int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type, queue-queue.mem_ops = vb2_vmalloc_memops; queue-queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC | V4L2_BUF_FLAG_TSTAMP_SRC_SOE; + queue-queue.lock = queue-mutex; ret = vb2_queue_init(queue-queue); if (ret) return ret; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] staging: media: lirc: lirc_zilog.c: fix quoted strings split across lines
On Wed, Nov 26, 2014 at 08:05:55AM -0800, Joe Perches wrote: On Wed, 2014-11-26 at 15:42 +, Luis de Bethencourt wrote: On 26 November 2014 at 01:49, Joe Perches j...@perches.com wrote: [] There is a script I posted a while back that groups various checkpatch types together and makes it a bit easier to do cleanup style patches. https://lkml.org/lkml/2014/7/11/794 That is useful! I just run it on staging/octeon/ and it wrote two patches. Will submit them in a minute. Please make sure and write better commit messages than the script produces. Will do :) Using checkpatch to get familiar with kernel development is fine and all, but fixing actual defects and submitting new code is way more useful. [] I agree. I was just using checkpatch to learn about the development process. How to create patches, submit patches, follow review, and such. Better to do it with small changes like this first. That's a good way to start. Which makes me wonder. Is my patch accepted? Will it be merged? I can do the proposed logging macro additions in a few days. Not sure yet how the final step of the process when patches get accepted and merged works. You will generally get an email from a maintainer when patches are accepted/rejected or you get feedback asking for various changes. Greg KH does that for drivers/staging but not for drivers/staging/media. Mauro Carvalho Chehab does. These emails are not immediate. It can take 2 or 3 weeks for a response. Sometimes longer, sometimes shorter, sometimes no response ever comes. I understand. Busy people. After a month or so, if you get no response, maybe the maintainer never saw it. You should maybe expand the cc: list for the email. When the patch is more than a trivial style cleanup, Andrew Morton generally picks up orphan patches. For some subsystems, there are tracking mechanisms like patchwork: For instance, netdev (net/ and drivers/net/) uses: http://patchwork.ozlabs.org/project/netdev/list/ and David Miller, the primary networking maintainer is very prompt about updating it. There's this list of patchwork entries, but maintainer activity of these lists vary: https://patchwork.kernel.org/ Very interesting. I will follow the process through and learn on the way. Thanks Joe! -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] v4l: vsp1: Reset VSP1 RPF source address
Hi Geert, On 11/26/14, 5:59 PM, Geert Uytterhoeven wrote: Hi Hayama-san, On Wed, Nov 26, 2014 at 7:19 AM, Takanari Hayama t...@igel.co.jp wrote: @@ -179,6 +190,10 @@ static void rpf_vdev_queue(struct vsp1_video *video, struct vsp1_video_buffer *buf) { struct vsp1_rwpf *rpf = container_of(video, struct vsp1_rwpf, video); + int i; + + for (i = 0; i 3; i++) + rpf-buf_addr[i] = buf-addr[i]; vsp1_video_buffer.addr is dma_addr_t addr[3];... Oops. Thank you for pointing that out. BTW, you can use memcpy() instead of an explicit loop. I thought about it too. However, it might not be that straight forward. VSP1 accepts only 32-bit address. If we enable LPAE, the address should be converted and mapped to 32-bit address space via IPMMU. So, once IPMMU is supported, we should do address mapping. So, I guess we should leave this loop as is here, so that we can add some address conversion in the future. vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_Y, buf-addr[0] + rpf-offsets[0]); diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.h b/drivers/media/platform/vsp1/vsp1_rwpf.h index 28dd9e7..1f98fe3 100644 --- a/drivers/media/platform/vsp1/vsp1_rwpf.h +++ b/drivers/media/platform/vsp1/vsp1_rwpf.h @@ -39,6 +39,8 @@ struct vsp1_rwpf { struct v4l2_rect crop; unsigned int offsets[2]; + + unsigned int buf_addr[3]; ... hence the above should use dma_addr_t, too. If CONFIG_ARM_LPAE is enabled, CONFIG_ARCH_DMA_ADDR_T_64BIT will be enabled, too, and dma_addr_t will be u64. Thanks. Although we cannot support LPAE for VSP1 without IPMMU, I'll change it to dma_addr_t anyway. }; Cheers, Takanari Hayama, Ph.D. (t...@igel.co.jp) IGEL Co.,Ltd. http://www.igel.co.jp/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Huomiota haluta
-- Huomiota!!! Oletko tarvitsevat pikaisesti lainan? henkilökohtaisia lainoja, yritysten lainoja, asuntolainojen. Jos ystävällisesti täyttäkää seuraavat tiedot alla ja tarjoamme 3 prosentin vauhdilla niin, että voimme jatkaa lainan määrästä välittömästi. Koko nimi: Tarvitaan lainan määrä: Lainan kesto: Matkapuhelin: Sähköposti: first_loan_tst...@zsk.name Haluamme kuulla sinusta. Mr. Frankly Okosodo -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] v4l: vsp1: Always enable virtual RPF when BRU is in use
Hi Sergei, On 11/26/14, 9:55 PM, Sergei Shtylyov wrote: Hello. On 11/26/2014 9:19 AM, Takanari Hayama wrote: Regardless of a number of inputs, we should always enable virtual RPF when BRU is used. This allows the case when there's only one input to BRU, and a size of the input is smaller than a size of an output of BRU. Signed-off-by: Takanari Hayama t...@igel.co.jp --- drivers/media/platform/vsp1/vsp1_wpf.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c index 6e05776..29ea28b 100644 --- a/drivers/media/platform/vsp1/vsp1_wpf.c +++ b/drivers/media/platform/vsp1/vsp1_wpf.c @@ -92,19 +92,20 @@ static int wpf_s_stream(struct v4l2_subdev *subdev, int enable) return 0; } -/* Sources. If the pipeline has a single input configure it as the - * master layer. Otherwise configure all inputs as sub-layers and - * select the virtual RPF as the master layer. +/* Sources. If the pipeline has a single input and BRU is not used, + * configure it as the master layer. Otherwise configure all + * inputs as sub-layers and select the virtual RPF as the master + * layer. */ for (i = 0; i pipe-num_inputs; ++i) { struct vsp1_rwpf *input = pipe-inputs[i]; -srcrpf |= pipe-num_inputs == 1 +srcrpf |= ((!pipe-bru) (pipe-num_inputs == 1)) Inner parens not needed, especially in the first case. Ok. Will fix it. ? VI6_WPF_SRCRPF_RPF_ACT_MST(input-entity.index) : VI6_WPF_SRCRPF_RPF_ACT_SUB(input-entity.index); } -if (pipe-num_inputs 1) +if ((pipe-bru) || (pipe-num_inputs 1)) Likewise. Here too. Thanks! [...] WBR, Sergei Cheers, Takanari Hayama, Ph.D. (t...@igel.co.jp) IGEL Co.,Ltd. http://www.igel.co.jp/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 0/2] v4l: vsp1: crop and a single input issues
Hi, I've updated patches to reflect comments from Geert and Sergei. Hope this version could be given a go. Takanari Hayama (2): v4l: vsp1: Reset VSP1 RPF source address v4l: vsp1: Always enable virtual RPF when BRU is in use drivers/media/platform/vsp1/vsp1_rpf.c | 15 +++ drivers/media/platform/vsp1/vsp1_rwpf.h | 2 ++ drivers/media/platform/vsp1/vsp1_wpf.c | 11 ++- 3 files changed, 23 insertions(+), 5 deletions(-) Best Regards, Takanari Hayama -- 1.8.0 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 1/2] v4l: vsp1: Reset VSP1 RPF source address
Source address of VSP1 RPF needs to be reset whenever crop offsets are recalculated. This correctly reflects a crop setting even VIDIOC_QBUF is called before VIDIOIC_STREAMON is called. Signed-off-by: Takanari Hayama t...@igel.co.jp --- drivers/media/platform/vsp1/vsp1_rpf.c | 15 +++ drivers/media/platform/vsp1/vsp1_rwpf.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c b/drivers/media/platform/vsp1/vsp1_rpf.c index d14d26b..79c0db8 100644 --- a/drivers/media/platform/vsp1/vsp1_rpf.c +++ b/drivers/media/platform/vsp1/vsp1_rpf.c @@ -106,11 +106,22 @@ static int rpf_s_stream(struct v4l2_subdev *subdev, int enable) + crop-left * fmtinfo-bpp[0] / 8; pstride = format-plane_fmt[0].bytesperline VI6_RPF_SRCM_PSTRIDE_Y_SHIFT; + + vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_Y, + rpf-buf_addr[0] + rpf-offsets[0]); + if (format-num_planes 1) { rpf-offsets[1] = crop-top * format-plane_fmt[1].bytesperline + crop-left * fmtinfo-bpp[1] / 8; pstride |= format-plane_fmt[1].bytesperline VI6_RPF_SRCM_PSTRIDE_C_SHIFT; + + vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_C0, + rpf-buf_addr[1] + rpf-offsets[1]); + + if (format-num_planes 2) + vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_C1, + rpf-buf_addr[2] + rpf-offsets[1]); } vsp1_rpf_write(rpf, VI6_RPF_SRCM_PSTRIDE, pstride); @@ -179,6 +190,10 @@ static void rpf_vdev_queue(struct vsp1_video *video, struct vsp1_video_buffer *buf) { struct vsp1_rwpf *rpf = container_of(video, struct vsp1_rwpf, video); + int i; + + for (i = 0; i 3; i++) + rpf-buf_addr[i] = buf-addr[i]; vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_Y, buf-addr[0] + rpf-offsets[0]); diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.h b/drivers/media/platform/vsp1/vsp1_rwpf.h index 28dd9e7..1c793bc 100644 --- a/drivers/media/platform/vsp1/vsp1_rwpf.h +++ b/drivers/media/platform/vsp1/vsp1_rwpf.h @@ -39,6 +39,8 @@ struct vsp1_rwpf { struct v4l2_rect crop; unsigned int offsets[2]; + + dma_addr_t buf_addr[3]; }; static inline struct vsp1_rwpf *to_rwpf(struct v4l2_subdev *subdev) -- 1.8.0 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 2/2] v4l: vsp1: Always enable virtual RPF when BRU is in use
Regardless of a number of inputs, we should always enable virtual RPF when BRU is used. This allows the case when there's only one input to BRU, and a size of the input is smaller than a size of an output of BRU. Signed-off-by: Takanari Hayama t...@igel.co.jp --- drivers/media/platform/vsp1/vsp1_wpf.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c index 6e05776..cb17c4d 100644 --- a/drivers/media/platform/vsp1/vsp1_wpf.c +++ b/drivers/media/platform/vsp1/vsp1_wpf.c @@ -92,19 +92,20 @@ static int wpf_s_stream(struct v4l2_subdev *subdev, int enable) return 0; } - /* Sources. If the pipeline has a single input configure it as the -* master layer. Otherwise configure all inputs as sub-layers and -* select the virtual RPF as the master layer. + /* Sources. If the pipeline has a single input and BRU is not used, +* configure it as the master layer. Otherwise configure all +* inputs as sub-layers and select the virtual RPF as the master +* layer. */ for (i = 0; i pipe-num_inputs; ++i) { struct vsp1_rwpf *input = pipe-inputs[i]; - srcrpf |= pipe-num_inputs == 1 + srcrpf |= (!pipe-bru pipe-num_inputs == 1) ? VI6_WPF_SRCRPF_RPF_ACT_MST(input-entity.index) : VI6_WPF_SRCRPF_RPF_ACT_SUB(input-entity.index); } - if (pipe-num_inputs 1) + if (pipe-bru || pipe-num_inputs 1) srcrpf |= VI6_WPF_SRCRPF_VIRACT_MST; vsp1_wpf_write(wpf, VI6_WPF_SRCRPF, srcrpf); -- 1.8.0 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] media: v4l2-image-sizes.h: correct the SVGA height definition
SVGA height should be 600 not 680. Reported-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Josh Wu josh...@atmel.com --- Hi, Mauro There a typo in my previous patch, so this patch is the fix for that. Sorry for the incovenience. Best Regards, Josh Wu include/media/v4l2-image-sizes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/media/v4l2-image-sizes.h b/include/media/v4l2-image-sizes.h index c70c917..a07d7a6 100644 --- a/include/media/v4l2-image-sizes.h +++ b/include/media/v4l2-image-sizes.h @@ -26,7 +26,7 @@ #define QVGA_HEIGHT240 #define SVGA_WIDTH 800 -#define SVGA_HEIGHT680 +#define SVGA_HEIGHT600 #define SXGA_WIDTH 1280 #define SXGA_HEIGHT1024 -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] media: v4l2-image-sizes.h: add SVGA, XGA and UXGA size definitions
Hi, Guennadi On 11/26/2014 6:23 AM, Guennadi Liakhovetski wrote: Hi Josh, On Tue, 25 Nov 2014, Josh Wu wrote: Add SVGA, UXGA and XGA size definitions to v4l2-image-sizes.h. The definitions are sorted by alphabet order. Signed-off-by: Josh Wu josh...@atmel.com Thanks for your patches. I'm ok with these two, but the second of them depends on the first one, and the first one wouldn't (normally) be going via the soc-camera tree. Mauro, how would you prefer to handle this? Should I pick up and push to you both of them or postpone #2 until the next merge window? The first patch is already merged in the media_tree. If the soc-camera tree will be merged to the media_tree, then there should have no dependency issue. Am I understanding correct? Best Regards, Josh Wu Thanks Guennadi --- include/media/v4l2-image-sizes.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/media/v4l2-image-sizes.h b/include/media/v4l2-image-sizes.h index 10daf92..c70c917 100644 --- a/include/media/v4l2-image-sizes.h +++ b/include/media/v4l2-image-sizes.h @@ -25,10 +25,19 @@ #define QVGA_WIDTH320 #define QVGA_HEIGHT 240 +#define SVGA_WIDTH 800 +#define SVGA_HEIGHT680 + #define SXGA_WIDTH1280 #define SXGA_HEIGHT 1024 #define VGA_WIDTH 640 #define VGA_HEIGHT480 +#define UXGA_WIDTH 1600 +#define UXGA_HEIGHT1200 + +#define XGA_WIDTH 1024 +#define XGA_HEIGHT 768 + #endif /* _IMAGE_SIZES_H */ -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
cron job: media_tree daily build: ERRORS
This message is generated daily by a cron job that builds media_tree for the kernels and architectures in the list below. Results of the daily build of media_tree: date: Thu Nov 27 04:00:16 CET 2014 git branch: test git hash: 504febc3f98c87a8bebd8f2f274f32c0724131e4 gcc version:i686-linux-gcc (GCC) 4.9.1 sparse version: v0.5.0-35-gc1c3f96 smatch version: 0.4.1-3153-g7d56ab3 host hardware: x86_64 host os:3.17-3.slh.2-amd64 linux-git-arm-at91: OK linux-git-arm-davinci: OK linux-git-arm-exynos: OK linux-git-arm-mx: OK linux-git-arm-omap: OK linux-git-arm-omap1: OK linux-git-arm-pxa: OK linux-git-blackfin: OK linux-git-i686: OK linux-git-m32r: OK linux-git-mips: OK linux-git-powerpc64: OK linux-git-sh: OK linux-git-x86_64: WARNINGS linux-2.6.32.27-i686: ERRORS linux-2.6.33.7-i686: ERRORS linux-2.6.34.7-i686: ERRORS linux-2.6.35.9-i686: ERRORS linux-2.6.36.4-i686: ERRORS linux-2.6.37.6-i686: ERRORS linux-2.6.38.8-i686: ERRORS linux-2.6.39.4-i686: ERRORS linux-3.0.60-i686: ERRORS linux-3.1.10-i686: ERRORS linux-3.2.37-i686: OK linux-3.3.8-i686: OK linux-3.4.27-i686: ERRORS linux-3.5.7-i686: ERRORS linux-3.6.11-i686: OK linux-3.7.4-i686: OK linux-3.8-i686: OK linux-3.9.2-i686: OK linux-3.10.1-i686: OK linux-3.11.1-i686: OK linux-3.12.23-i686: OK linux-3.13.11-i686: OK linux-3.14.9-i686: OK linux-3.15.2-i686: OK linux-3.16-i686: OK linux-3.17-i686: OK linux-3.18-rc1-i686: OK linux-2.6.32.27-x86_64: ERRORS linux-2.6.33.7-x86_64: ERRORS linux-2.6.34.7-x86_64: ERRORS linux-2.6.35.9-x86_64: ERRORS linux-2.6.36.4-x86_64: ERRORS linux-2.6.37.6-x86_64: ERRORS linux-2.6.38.8-x86_64: ERRORS linux-2.6.39.4-x86_64: ERRORS linux-3.0.60-x86_64: ERRORS linux-3.1.10-x86_64: ERRORS linux-3.2.37-x86_64: OK linux-3.3.8-x86_64: OK linux-3.4.27-x86_64: ERRORS linux-3.5.7-x86_64: ERRORS linux-3.6.11-x86_64: OK linux-3.7.4-x86_64: OK linux-3.8-x86_64: OK linux-3.9.2-x86_64: OK linux-3.10.1-x86_64: OK linux-3.11.1-x86_64: OK linux-3.12.23-x86_64: OK linux-3.13.11-x86_64: OK linux-3.14.9-x86_64: OK linux-3.15.2-x86_64: OK linux-3.16-x86_64: OK linux-3.17-x86_64: OK linux-3.18-rc1-x86_64: OK apps: OK spec-git: OK sparse: WARNINGS smatch: ERRORS Detailed results are available here: http://www.xs4all.nl/~hverkuil/logs/Thursday.log Full logs are available here: http://www.xs4all.nl/~hverkuil/logs/Thursday.tar.bz2 The Media Infrastructure API from this daily build is here: http://www.xs4all.nl/~hverkuil/spec/media.html -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Update MAINTAINERS for solo6x10
On Mon, 17 Nov 2014 20:59:23 +0400 Andrey Utkin andrey.ut...@corp.bluecherry.net wrote: Signed-off-by: Andrey Utkin andrey.ut...@corp.bluecherry.net --- MAINTAINERS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index bb38f02..f5cef1b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8787,7 +8787,9 @@ S: Maintained F: drivers/leds/leds-net48xx.c SOFTLOGIC 6x10 MPEG CODEC -M: Ismael Luceno ismael.luc...@corp.bluecherry.net +M: Bluecherry Maintainers maintain...@bluecherrydvr.com +M: Andrey Utkin andrey.ut...@corp.bluecherry.net +M: Andrey Utkin andrey.krieger.ut...@gmail.com L: linux-media@vger.kernel.org S: Supported F: drivers/media/pci/solo6x10/ Please do not remove me, I'm still here, just a little tight on the schedule. Though my corp.bluecherry.net address stopped working again... pgp3EsMzuRSJ6.pgp Description: OpenPGP digital signature
Re: SOLO6x10: fix a race in IRQ handler.
On Fri, 14 Nov 2014 13:35:06 +0100 khal...@piap.pl (Krzysztof Hałasa) wrote: The IRQs have to be acknowledged before they are serviced, otherwise some events may be skipped. Also, acknowledging IRQs just before returning from the handler doesn't leave enough time for the device to deassert the INTx line, and for bridges to propagate this change. This resulted in twice the IRQ rate on ARMv6 dual core CPU. Signed-off-by: Krzysztof Hałasa khal...@piap.pl --- a/drivers/media/pci/solo6x10/solo6x10-core.c +++ b/drivers/media/pci/solo6x10/solo6x10-core.c @@ -105,11 +105,8 @@ static irqreturn_t solo_isr(int irq, void *data) if (!status) return IRQ_NONE; - if (status ~solo_dev-irq_mask) { - solo_reg_write(solo_dev, SOLO_IRQ_STAT, -status ~solo_dev-irq_mask); - status = solo_dev-irq_mask; - } + /* Acknowledge all interrupts immediately */ + solo_reg_write(solo_dev, SOLO_IRQ_STAT, status); if (status SOLO_IRQ_PCI_ERR) solo_p2m_error_isr(solo_dev); @@ -132,9 +129,6 @@ static irqreturn_t solo_isr(int irq, void *data) if (status SOLO_IRQ_G723) solo_g723_isr(solo_dev); - /* Clear all interrupts handled */ - solo_reg_write(solo_dev, SOLO_IRQ_STAT, status); - return IRQ_HANDLED; } Signed-off-by: Ismael Luceno ismael.luc...@corp.bluecherry.net pgpM1nfzSn1Y5.pgp Description: OpenPGP digital signature
Re: [RFC] solo6x10 freeze, even with Oct 31's linux-next... any ideas or help?
On Tue, 11 Nov 2014 19:05:37 +0100 Hans Verkuil hverk...@xs4all.nl wrote: On 11/11/2014 06:46 PM, Andrey Utkin wrote: At Bluecherry, we have issues with servers which have 3 solo6110 cards (and cards have up to 16 analog video cameras connected to them, and being actively read). This is a kernel which I tested with such a server last time. It is based on linux-next of October, 31, with few patches of mine (all are in review for upstream). https://github.com/krieger-od/linux/ . The HEAD commit is 949e18db86ebf45acab91d188b247abd40b6e2a1 at the moment. The problem is the following: after ~1 hour of uptime with working application reading the streams, one card (the same one every time) stops producing interrupts (counter in /proc/interrupts freezes), and all threads reading from that card hang forever in ioctl(VIDIOC_DQBUF). The application uses libavformat (ffmpeg) API to read the corresponding /dev/videoX devices of H264 encoders. Application restart doesn't help, just interrupt counter increases by 64. To help that, we need reboot or programmatic PCI device reset by echo 1 /sys/bus/pci/devices/\:03\:05.0/reset, which requires unloading app and driver and is not a solution obviously. We had this issue for a long time, even before we used libavformat for reading from such sources. A few days ago, we had standalone ffmpeg processes working stable for several days. The kernel was 3.17, the only probably-relevant change in code over the above mentioned revision is an additional bool variable set in solo_enc_v4l2_isr() and checked in solo_ring_thread() to figure out whether to do or skip solo_handle_ring(). The variable was guarded with spin_lock_irqsave(). I am not sure if it makes any difference, will try it again eventually. Any thoughts, can it be a bug in driver code causing that (please point which areas of code to review/fix)? Or is that desperate hardware issue? How to figure out for sure whether it is the former or the latter? I would first try to exclude hardware issues: since you say it is always the same card, try either replacing it or swapping it with another solo card and see if the problem follows the card or not. If it does, then it is likely a hardware problem. If it doesn't, then it suggests a race condition in the interrupt handling somewhere. Regards, Hans CC'ing Curtis, hope you don't mind. It's just coincidence. This has been a long standing issue, and only depends on having enough cards. One of the problems I had to weed out this one was that I didn't have the right hardware (only one 16-port card), and my guess is that Andrey is in the same position. pgpsd0GlIkpe9.pgp Description: OpenPGP digital signature
Re: [RFC] solo6x10 freeze, even with Oct 31's linux-next... any ideas or help?
On Sat, 15 Nov 2014 21:42:05 +0100 khal...@piap.pl (Krzysztof Hałasa) wrote: Andrey Utkin andrey.ut...@corp.bluecherry.net writes: In upstream there's no more module parameter for video standard (NTSC/PAL). But there's VIDIOC_S_STD handling procedure. But it turns out not to work correctly: the frame is offset, so that in the bottom there's black horizontal bar. The S_STD ioctl call actually makes difference, because without that the frame slides vertically all the time. But after the call the picture is not correct. Which kernel version are you using? I remember there were some problems with earlier versions, where the NTSC vs PAL wasn't consistenly a bool but rather a raw register value (or something like this), but it was fixed last time I checked. I'm personally using SOLO6110-based cards with v3.17 and PAL and it works, with minimal unrelated patches. The selection works correctly for me, tested recently after a server upgrade. pgpbQZz234aBK.pgp Description: OpenPGP digital signature
[PATCH] solo6x10: Maintainers update
Adding Andrey Utkin, and I'll be using my personal email address from now on. Signed-off-by: Ismael Luceno ismael.luc...@corp.bluecherry.net --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 0ff630d..b4ba217 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8682,7 +8682,8 @@ S:Maintained F: drivers/leds/leds-net48xx.c SOFTLOGIC 6x10 MPEG CODEC -M: Ismael Luceno ismael.luc...@corp.bluecherry.net +M: Ismael Luceno ism...@iodev.co.uk +M: Andrey Utkin andrey.ut...@corp.bluecherry.net L: linux-media@vger.kernel.org S: Supported F: drivers/media/pci/solo6x10/ -- 2.1.3 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html