Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'media/v4.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:
- vb2: fix a vb2_thread regression and DVB read() breakages
- vsp1: fix compilation and links creation
- s5k6a3: Fix VIDIOC_SUBDEV_G_FMT ioctl for TRY format
- exynos4-is: fix a build issue, format negotiation and sensor detection
- Fix a regression with pvrusb2 and ir-kbd-i2c
- atmel-isi: fix debug message which only show the first format
- tda1004x: fix a tuning bug if G_PROPERTY is called too early
- saa7134-alsa: fix a bug at device unbinding/driver removal
- Fix build of one driver if !HAS_DMA
- soc_camera: cleanup control device on async_unbind

* tag 'media/v4.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
[media] saa7134-alsa: Only frees registered sound cards
[media] vb2-core: call threadio->fnc() if !VB2_BUF_STATE_ERROR
[media] vb2: fix nasty vb2_thread regression
[media] tda1004x: only update the frontend properties if locked
[media] media: i2c: Don't export ir-kbd-i2c module alias
[media] exynos4-is: make VIDEO_SAMSUNG_EXYNOS4_IS tristate
[media] media: Kconfig: add dependency of HAS_DMA
[media] exynos4-is: Wait for 100us before opening sensor
[media] exynos4-is: Open shouldn't fail when sensor entity is not linked
[media] s5k6a3: Fix VIDIOC_SUBDEV_G_FMT ioctl for TRY format
[media] exynos4-is: fix a format string bug
[media] drivers/media: vsp1_video: fix compile error
[media] atmel-isi: fix debug message which only show the first format
[media] soc_camera: cleanup control device on async_unbind
[media] v4l: vsp1: Fix wrong entities links creation

+157 -86
+9
drivers/media/dvb-frontends/tda1004x.c
··· 903 903 { 904 904 struct dtv_frontend_properties *fe_params = &fe->dtv_property_cache; 905 905 struct tda1004x_state* state = fe->demodulator_priv; 906 + int status; 906 907 907 908 dprintk("%s\n", __func__); 909 + 910 + status = tda1004x_read_byte(state, TDA1004X_STATUS_CD); 911 + if (status == -1) 912 + return -EIO; 913 + 914 + /* Only update the properties cache if device is locked */ 915 + if (!(status & 8)) 916 + return 0; 908 917 909 918 // inversion status 910 919 fe_params->inversion = INVERSION_OFF;
-1
drivers/media/i2c/ir-kbd-i2c.c
··· 478 478 { "ir_rx_z8f0811_hdpvr", 0 }, 479 479 { } 480 480 }; 481 - MODULE_DEVICE_TABLE(i2c, ir_kbd_id); 482 481 483 482 static struct i2c_driver ir_kbd_driver = { 484 483 .driver = {
+1 -2
drivers/media/i2c/s5k6a3.c
··· 144 144 mf = __s5k6a3_get_format(sensor, cfg, fmt->pad, fmt->which); 145 145 if (mf) { 146 146 mutex_lock(&sensor->lock); 147 - if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) 148 - *mf = fmt->format; 147 + *mf = fmt->format; 149 148 mutex_unlock(&sensor->lock); 150 149 } 151 150 return 0;
+4 -1
drivers/media/pci/saa7134/saa7134-alsa.c
··· 1211 1211 1212 1212 static int alsa_device_exit(struct saa7134_dev *dev) 1213 1213 { 1214 + if (!snd_saa7134_cards[dev->nr]) 1215 + return 1; 1214 1216 1215 1217 snd_card_free(snd_saa7134_cards[dev->nr]); 1216 1218 snd_saa7134_cards[dev->nr] = NULL; ··· 1262 1260 int idx; 1263 1261 1264 1262 for (idx = 0; idx < SNDRV_CARDS; idx++) { 1265 - snd_card_free(snd_saa7134_cards[idx]); 1263 + if (snd_saa7134_cards[idx]) 1264 + snd_card_free(snd_saa7134_cards[idx]); 1266 1265 } 1267 1266 1268 1267 saa7134_dmasound_init = NULL;
+1
drivers/media/platform/Kconfig
··· 215 215 config VIDEO_STI_BDISP 216 216 tristate "STMicroelectronics BDISP 2D blitter driver" 217 217 depends on VIDEO_DEV && VIDEO_V4L2 218 + depends on HAS_DMA 218 219 depends on ARCH_STI || COMPILE_TEST 219 220 select VIDEOBUF2_DMA_CONTIG 220 221 select V4L2_MEM2MEM_DEV
+1 -1
drivers/media/platform/exynos4-is/Kconfig
··· 1 1 2 2 config VIDEO_SAMSUNG_EXYNOS4_IS 3 - bool "Samsung S5P/EXYNOS4 SoC series Camera Subsystem driver" 3 + tristate "Samsung S5P/EXYNOS4 SoC series Camera Subsystem driver" 4 4 depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API 5 5 depends on ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST 6 6 depends on OF && COMMON_CLK
+6
drivers/media/platform/exynos4-is/fimc-is.c
··· 631 631 632 632 fimc_is_mem_barrier(); 633 633 634 + /* 635 + * Some user space use cases hang up here without this 636 + * empirically chosen delay. 637 + */ 638 + udelay(100); 639 + 634 640 mcuctl_write(HIC_OPEN_SENSOR, is, MCUCTL_REG_ISSR(0)); 635 641 mcuctl_write(is->sensor_index, is, MCUCTL_REG_ISSR(1)); 636 642 mcuctl_write(sensor->drvdata->id, is, MCUCTL_REG_ISSR(2));
+2 -2
drivers/media/platform/exynos4-is/fimc-isp-video.c
··· 218 218 ivb->dma_addr[i]; 219 219 220 220 isp_dbg(2, &video->ve.vdev, 221 - "dma_buf %pad (%d/%d/%d) addr: %pad\n", 222 - &buf_index, ivb->index, i, vb->index, 221 + "dma_buf %d (%d/%d/%d) addr: %pad\n", 222 + buf_index, ivb->index, i, vb->index, 223 223 &ivb->dma_addr[i]); 224 224 } 225 225
+78 -21
drivers/media/platform/exynos4-is/media-dev.c
··· 186 186 } 187 187 188 188 /** 189 - * __fimc_pipeline_open - update the pipeline information, enable power 190 - * of all pipeline subdevs and the sensor clock 191 - * @me: media entity to start graph walk with 192 - * @prepare: true to walk the current pipeline and acquire all subdevs 189 + * __fimc_pipeline_enable - enable power of all pipeline subdevs 190 + * and the sensor clock 191 + * @ep: video pipeline structure 192 + * @fmd: fimc media device 193 193 * 194 194 * Called with the graph mutex held. 195 195 */ 196 - static int __fimc_pipeline_open(struct exynos_media_pipeline *ep, 197 - struct media_entity *me, bool prepare) 196 + static int __fimc_pipeline_enable(struct exynos_media_pipeline *ep, 197 + struct fimc_md *fmd) 198 198 { 199 - struct fimc_md *fmd = entity_to_fimc_mdev(me); 200 199 struct fimc_pipeline *p = to_fimc_pipeline(ep); 201 - struct v4l2_subdev *sd; 202 200 int ret; 203 201 204 - if (WARN_ON(p == NULL || me == NULL)) 205 - return -EINVAL; 206 - 207 - if (prepare) 208 - fimc_pipeline_prepare(p, me); 209 - 210 - sd = p->subdevs[IDX_SENSOR]; 211 - if (sd == NULL) 212 - return -EINVAL; 213 - 214 - /* Disable PXLASYNC clock if this pipeline includes FIMC-IS */ 202 + /* Enable PXLASYNC clock if this pipeline includes FIMC-IS */ 215 203 if (!IS_ERR(fmd->wbclk[CLK_IDX_WB_B]) && p->subdevs[IDX_IS_ISP]) { 216 204 ret = clk_prepare_enable(fmd->wbclk[CLK_IDX_WB_B]); 217 205 if (ret < 0) ··· 214 226 clk_disable_unprepare(fmd->wbclk[CLK_IDX_WB_B]); 215 227 216 228 return ret; 229 + } 230 + 231 + /** 232 + * __fimc_pipeline_open - update the pipeline information, enable power 233 + * of all pipeline subdevs and the sensor clock 234 + * @me: media entity to start graph walk with 235 + * @prepare: true to walk the current pipeline and acquire all subdevs 236 + * 237 + * Called with the graph mutex held. 238 + */ 239 + static int __fimc_pipeline_open(struct exynos_media_pipeline *ep, 240 + struct media_entity *me, bool prepare) 241 + { 242 + struct fimc_md *fmd = entity_to_fimc_mdev(me); 243 + struct fimc_pipeline *p = to_fimc_pipeline(ep); 244 + struct v4l2_subdev *sd; 245 + 246 + if (WARN_ON(p == NULL || me == NULL)) 247 + return -EINVAL; 248 + 249 + if (prepare) 250 + fimc_pipeline_prepare(p, me); 251 + 252 + sd = p->subdevs[IDX_SENSOR]; 253 + if (sd == NULL) { 254 + pr_warn("%s(): No sensor subdev\n", __func__); 255 + /* 256 + * Pipeline open cannot fail so as to make it possible 257 + * for the user space to configure the pipeline. 258 + */ 259 + return 0; 260 + } 261 + 262 + return __fimc_pipeline_enable(ep, fmd); 217 263 } 218 264 219 265 /** ··· 291 269 { IDX_CSIS, IDX_FLITE, IDX_FIMC, IDX_SENSOR, IDX_IS_ISP }, 292 270 }; 293 271 struct fimc_pipeline *p = to_fimc_pipeline(ep); 272 + struct fimc_md *fmd = entity_to_fimc_mdev(&p->subdevs[IDX_CSIS]->entity); 273 + enum fimc_subdev_index sd_id; 294 274 int i, ret = 0; 295 275 296 - if (p->subdevs[IDX_SENSOR] == NULL) 297 - return -ENODEV; 276 + if (p->subdevs[IDX_SENSOR] == NULL) { 277 + if (!fmd->user_subdev_api) { 278 + /* 279 + * Sensor must be already discovered if we 280 + * aren't in the user_subdev_api mode 281 + */ 282 + return -ENODEV; 283 + } 284 + 285 + /* Get pipeline sink entity */ 286 + if (p->subdevs[IDX_FIMC]) 287 + sd_id = IDX_FIMC; 288 + else if (p->subdevs[IDX_IS_ISP]) 289 + sd_id = IDX_IS_ISP; 290 + else if (p->subdevs[IDX_FLITE]) 291 + sd_id = IDX_FLITE; 292 + else 293 + return -ENODEV; 294 + 295 + /* 296 + * Sensor could have been linked between open and STREAMON - 297 + * check if this is the case. 298 + */ 299 + fimc_pipeline_prepare(p, &p->subdevs[sd_id]->entity); 300 + 301 + if (p->subdevs[IDX_SENSOR] == NULL) 302 + return -ENODEV; 303 + 304 + ret = __fimc_pipeline_enable(ep, fmd); 305 + if (ret < 0) 306 + return ret; 307 + 308 + } 298 309 299 310 for (i = 0; i < IDX_MAX; i++) { 300 311 unsigned int idx = seq[on][i]; ··· 337 282 if (ret < 0 && ret != -ENOIOCTLCMD && ret != -ENODEV) 338 283 goto error; 339 284 } 285 + 340 286 return 0; 341 287 error: 288 + fimc_pipeline_s_power(p, !on); 342 289 for (; i >= 0; i--) { 343 290 unsigned int idx = seq[on][i]; 344 291 v4l2_subdev_call(p->subdevs[idx], video, s_stream, !on);
+1 -1
drivers/media/platform/soc_camera/atmel-isi.c
··· 795 795 xlate->host_fmt = &isi_camera_formats[i]; 796 796 xlate->code = code.code; 797 797 dev_dbg(icd->parent, "Providing format %s using code %d\n", 798 - isi_camera_formats[0].name, code.code); 798 + xlate->host_fmt->name, xlate->code); 799 799 } 800 800 break; 801 801 default:
+2
drivers/media/platform/soc_camera/soc_camera.c
··· 1493 1493 struct soc_camera_async_client, notifier); 1494 1494 struct soc_camera_device *icd = platform_get_drvdata(sasc->pdev); 1495 1495 1496 + icd->control = NULL; 1497 + 1496 1498 if (icd->clk) { 1497 1499 v4l2_clk_unregister(icd->clk); 1498 1500 icd->clk = NULL;
+5 -2
drivers/media/platform/vsp1/vsp1_drv.c
··· 256 256 257 257 /* Create links. */ 258 258 list_for_each_entry(entity, &vsp1->entities, list_dev) { 259 - if (entity->type == VSP1_ENTITY_LIF) { 259 + if (entity->type == VSP1_ENTITY_WPF) { 260 260 ret = vsp1_wpf_create_links(vsp1, entity); 261 261 if (ret < 0) 262 262 goto done; ··· 264 264 ret = vsp1_rpf_create_links(vsp1, entity); 265 265 if (ret < 0) 266 266 goto done; 267 - } else { 267 + } 268 + 269 + if (entity->type != VSP1_ENTITY_LIF && 270 + entity->type != VSP1_ENTITY_RPF) { 268 271 ret = vsp1_create_links(vsp1, entity); 269 272 if (ret < 0) 270 273 goto done;
+1 -1
drivers/media/platform/vsp1/vsp1_video.c
··· 515 515 bool stopped; 516 516 517 517 spin_lock_irqsave(&pipe->irqlock, flags); 518 - stopped = pipe->state == VSP1_PIPELINE_STOPPED, 518 + stopped = pipe->state == VSP1_PIPELINE_STOPPED; 519 519 spin_unlock_irqrestore(&pipe->irqlock, flags); 520 520 521 521 return stopped;
+43 -52
drivers/media/v4l2-core/videobuf2-core.c
··· 1063 1063 */ 1064 1064 static int __qbuf_mmap(struct vb2_buffer *vb, const void *pb) 1065 1065 { 1066 - int ret = call_bufop(vb->vb2_queue, fill_vb2_buffer, 1067 - vb, pb, vb->planes); 1066 + int ret = 0; 1067 + 1068 + if (pb) 1069 + ret = call_bufop(vb->vb2_queue, fill_vb2_buffer, 1070 + vb, pb, vb->planes); 1068 1071 return ret ? ret : call_vb_qop(vb, buf_prepare, vb); 1069 1072 } 1070 1073 ··· 1080 1077 struct vb2_queue *q = vb->vb2_queue; 1081 1078 void *mem_priv; 1082 1079 unsigned int plane; 1083 - int ret; 1080 + int ret = 0; 1084 1081 enum dma_data_direction dma_dir = 1085 1082 q->is_output ? DMA_TO_DEVICE : DMA_FROM_DEVICE; 1086 1083 bool reacquired = vb->planes[0].mem_priv == NULL; 1087 1084 1088 1085 memset(planes, 0, sizeof(planes[0]) * vb->num_planes); 1089 1086 /* Copy relevant information provided by the userspace */ 1090 - ret = call_bufop(vb->vb2_queue, fill_vb2_buffer, vb, pb, planes); 1087 + if (pb) 1088 + ret = call_bufop(vb->vb2_queue, fill_vb2_buffer, 1089 + vb, pb, planes); 1091 1090 if (ret) 1092 1091 return ret; 1093 1092 ··· 1197 1192 struct vb2_queue *q = vb->vb2_queue; 1198 1193 void *mem_priv; 1199 1194 unsigned int plane; 1200 - int ret; 1195 + int ret = 0; 1201 1196 enum dma_data_direction dma_dir = 1202 1197 q->is_output ? DMA_TO_DEVICE : DMA_FROM_DEVICE; 1203 1198 bool reacquired = vb->planes[0].mem_priv == NULL; 1204 1199 1205 1200 memset(planes, 0, sizeof(planes[0]) * vb->num_planes); 1206 1201 /* Copy relevant information provided by the userspace */ 1207 - ret = call_bufop(vb->vb2_queue, fill_vb2_buffer, vb, pb, planes); 1202 + if (pb) 1203 + ret = call_bufop(vb->vb2_queue, fill_vb2_buffer, 1204 + vb, pb, planes); 1208 1205 if (ret) 1209 1206 return ret; 1210 1207 ··· 1527 1520 q->waiting_for_buffers = false; 1528 1521 vb->state = VB2_BUF_STATE_QUEUED; 1529 1522 1530 - call_void_bufop(q, copy_timestamp, vb, pb); 1523 + if (pb) 1524 + call_void_bufop(q, copy_timestamp, vb, pb); 1531 1525 1532 1526 trace_vb2_qbuf(q, vb); 1533 1527 ··· 1540 1532 __enqueue_in_driver(vb); 1541 1533 1542 1534 /* Fill buffer information for the userspace */ 1543 - call_void_bufop(q, fill_user_buffer, vb, pb); 1535 + if (pb) 1536 + call_void_bufop(q, fill_user_buffer, vb, pb); 1544 1537 1545 1538 /* 1546 1539 * If streamon has been called, and we haven't yet called ··· 1740 1731 * The return values from this function are intended to be directly returned 1741 1732 * from vidioc_dqbuf handler in driver. 1742 1733 */ 1743 - int vb2_core_dqbuf(struct vb2_queue *q, void *pb, bool nonblocking) 1734 + int vb2_core_dqbuf(struct vb2_queue *q, unsigned int *pindex, void *pb, 1735 + bool nonblocking) 1744 1736 { 1745 1737 struct vb2_buffer *vb = NULL; 1746 1738 int ret; ··· 1764 1754 1765 1755 call_void_vb_qop(vb, buf_finish, vb); 1766 1756 1757 + if (pindex) 1758 + *pindex = vb->index; 1759 + 1767 1760 /* Fill buffer information for the userspace */ 1768 - call_void_bufop(q, fill_user_buffer, vb, pb); 1761 + if (pb) 1762 + call_void_bufop(q, fill_user_buffer, vb, pb); 1769 1763 1770 1764 /* Remove from videobuf queue */ 1771 1765 list_del(&vb->queued_entry); ··· 1842 1828 * that's done in dqbuf, but that's not going to happen when we 1843 1829 * cancel the whole queue. Note: this code belongs here, not in 1844 1830 * __vb2_dqbuf() since in vb2_internal_dqbuf() there is a critical 1845 - * call to __fill_v4l2_buffer() after buf_finish(). That order can't 1831 + * call to __fill_user_buffer() after buf_finish(). That order can't 1846 1832 * be changed, so we can't move the buf_finish() to __vb2_dqbuf(). 1847 1833 */ 1848 1834 for (i = 0; i < q->num_buffers; ++i) { ··· 2371 2357 unsigned int count; 2372 2358 unsigned int type; 2373 2359 unsigned int memory; 2374 - struct vb2_buffer *b; 2375 2360 struct vb2_fileio_buf bufs[VB2_MAX_FRAME]; 2376 2361 unsigned int cur_index; 2377 2362 unsigned int initial_index; ··· 2423 2410 if (fileio == NULL) 2424 2411 return -ENOMEM; 2425 2412 2426 - fileio->b = kzalloc(q->buf_struct_size, GFP_KERNEL); 2427 - if (fileio->b == NULL) { 2428 - kfree(fileio); 2429 - return -ENOMEM; 2430 - } 2431 - 2432 2413 fileio->read_once = q->fileio_read_once; 2433 2414 fileio->write_immediately = q->fileio_write_immediately; 2434 2415 ··· 2467 2460 * Queue all buffers. 2468 2461 */ 2469 2462 for (i = 0; i < q->num_buffers; i++) { 2470 - struct vb2_buffer *b = fileio->b; 2471 - 2472 - memset(b, 0, q->buf_struct_size); 2473 - b->type = q->type; 2474 - b->memory = q->memory; 2475 - b->index = i; 2476 - ret = vb2_core_qbuf(q, i, b); 2463 + ret = vb2_core_qbuf(q, i, NULL); 2477 2464 if (ret) 2478 2465 goto err_reqbufs; 2479 2466 fileio->bufs[i].queued = 1; ··· 2512 2511 q->fileio = NULL; 2513 2512 fileio->count = 0; 2514 2513 vb2_core_reqbufs(q, fileio->memory, &fileio->count); 2515 - kfree(fileio->b); 2516 2514 kfree(fileio); 2517 2515 dprintk(3, "file io emulator closed\n"); 2518 2516 } ··· 2539 2539 * else is able to provide this information with the write() operation. 2540 2540 */ 2541 2541 bool copy_timestamp = !read && q->copy_timestamp; 2542 - int ret, index; 2542 + unsigned index; 2543 + int ret; 2543 2544 2544 2545 dprintk(3, "mode %s, offset %ld, count %zd, %sblocking\n", 2545 2546 read ? "read" : "write", (long)*ppos, count, ··· 2565 2564 */ 2566 2565 index = fileio->cur_index; 2567 2566 if (index >= q->num_buffers) { 2568 - struct vb2_buffer *b = fileio->b; 2567 + struct vb2_buffer *b; 2569 2568 2570 2569 /* 2571 2570 * Call vb2_dqbuf to get buffer back. 2572 2571 */ 2573 - memset(b, 0, q->buf_struct_size); 2574 - b->type = q->type; 2575 - b->memory = q->memory; 2576 - ret = vb2_core_dqbuf(q, b, nonblock); 2572 + ret = vb2_core_dqbuf(q, &index, NULL, nonblock); 2577 2573 dprintk(5, "vb2_dqbuf result: %d\n", ret); 2578 2574 if (ret) 2579 2575 return ret; 2580 2576 fileio->dq_count += 1; 2581 2577 2582 - fileio->cur_index = index = b->index; 2578 + fileio->cur_index = index; 2583 2579 buf = &fileio->bufs[index]; 2580 + b = q->bufs[index]; 2584 2581 2585 2582 /* 2586 2583 * Get number of bytes filled by the driver ··· 2629 2630 * Queue next buffer if required. 2630 2631 */ 2631 2632 if (buf->pos == buf->size || (!read && fileio->write_immediately)) { 2632 - struct vb2_buffer *b = fileio->b; 2633 + struct vb2_buffer *b = q->bufs[index]; 2633 2634 2634 2635 /* 2635 2636 * Check if this is the last buffer to read. ··· 2642 2643 /* 2643 2644 * Call vb2_qbuf and give buffer to the driver. 2644 2645 */ 2645 - memset(b, 0, q->buf_struct_size); 2646 - b->type = q->type; 2647 - b->memory = q->memory; 2648 - b->index = index; 2649 2646 b->planes[0].bytesused = buf->pos; 2650 2647 2651 2648 if (copy_timestamp) 2652 2649 b->timestamp = ktime_get_ns(); 2653 - ret = vb2_core_qbuf(q, index, b); 2650 + ret = vb2_core_qbuf(q, index, NULL); 2654 2651 dprintk(5, "vb2_dbuf result: %d\n", ret); 2655 2652 if (ret) 2656 2653 return ret; ··· 2708 2713 { 2709 2714 struct vb2_queue *q = data; 2710 2715 struct vb2_threadio_data *threadio = q->threadio; 2711 - struct vb2_fileio_data *fileio = q->fileio; 2712 2716 bool copy_timestamp = false; 2713 - int prequeue = 0; 2714 - int index = 0; 2717 + unsigned prequeue = 0; 2718 + unsigned index = 0; 2715 2719 int ret = 0; 2716 2720 2717 2721 if (q->is_output) { ··· 2722 2728 2723 2729 for (;;) { 2724 2730 struct vb2_buffer *vb; 2725 - struct vb2_buffer *b = fileio->b; 2726 2731 2727 2732 /* 2728 2733 * Call vb2_dqbuf to get buffer back. 2729 2734 */ 2730 - memset(b, 0, q->buf_struct_size); 2731 - b->type = q->type; 2732 - b->memory = q->memory; 2733 2735 if (prequeue) { 2734 - b->index = index++; 2736 + vb = q->bufs[index++]; 2735 2737 prequeue--; 2736 2738 } else { 2737 2739 call_void_qop(q, wait_finish, q); 2738 2740 if (!threadio->stop) 2739 - ret = vb2_core_dqbuf(q, b, 0); 2741 + ret = vb2_core_dqbuf(q, &index, NULL, 0); 2740 2742 call_void_qop(q, wait_prepare, q); 2741 2743 dprintk(5, "file io: vb2_dqbuf result: %d\n", ret); 2744 + if (!ret) 2745 + vb = q->bufs[index]; 2742 2746 } 2743 2747 if (ret || threadio->stop) 2744 2748 break; 2745 2749 try_to_freeze(); 2746 2750 2747 - vb = q->bufs[b->index]; 2748 - if (b->state == VB2_BUF_STATE_DONE) 2751 + if (vb->state != VB2_BUF_STATE_ERROR) 2749 2752 if (threadio->fnc(vb, threadio->priv)) 2750 2753 break; 2751 2754 call_void_qop(q, wait_finish, q); 2752 2755 if (copy_timestamp) 2753 - b->timestamp = ktime_get_ns();; 2756 + vb->timestamp = ktime_get_ns();; 2754 2757 if (!threadio->stop) 2755 - ret = vb2_core_qbuf(q, b->index, b); 2758 + ret = vb2_core_qbuf(q, vb->index, NULL); 2756 2759 call_void_qop(q, wait_prepare, q); 2757 2760 if (ret || threadio->stop) 2758 2761 break;
+1 -1
drivers/media/v4l2-core/videobuf2-v4l2.c
··· 625 625 return -EINVAL; 626 626 } 627 627 628 - ret = vb2_core_dqbuf(q, b, nonblocking); 628 + ret = vb2_core_dqbuf(q, NULL, b, nonblocking); 629 629 630 630 return ret; 631 631 }
+2 -1
include/media/videobuf2-core.h
··· 533 533 const unsigned int requested_sizes[]); 534 534 int vb2_core_prepare_buf(struct vb2_queue *q, unsigned int index, void *pb); 535 535 int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb); 536 - int vb2_core_dqbuf(struct vb2_queue *q, void *pb, bool nonblocking); 536 + int vb2_core_dqbuf(struct vb2_queue *q, unsigned int *pindex, void *pb, 537 + bool nonblocking); 537 538 538 539 int vb2_core_streamon(struct vb2_queue *q, unsigned int type); 539 540 int vb2_core_streamoff(struct vb2_queue *q, unsigned int type);