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 branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:
- gspca: add needed delay for I2C traffic for sonixb/sonixj cameras
- gspca: add one missing Kinect USB ID
- usbvideo: some regression fixes
- omap3isp: fix some build issues
- videobuf2: fix video output handling
- exynos s5p/m5mols: a few regression fixes.

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
[media] uvcvideo: Set error_idx properly for S_EXT_CTRLS failures
[media] uvcvideo: Cleanup leftovers of partial revert
[media] uvcvideo: Return -EACCES when trying to set a read-only control
[media] omap3isp: Don't include <plat/cpu.h>
[media] s5p-mfc: Fix interrupt error handling routine
[media] s5p-fimc: Fix return value of __fimc_md_create_flite_source_links()
[media] m5mols: Fix typo in get_fmt callback
[media] v4l: vb2: Set data_offset to 0 for single-plane output buffers
[media] [FOR,v3.8] omap3isp: Don't include deleted OMAP plat/ header files
[media] gspca_sonixj: Add a small delay after i2c_w1
[media] gspca_sonixb: Properly wait between i2c writes
[media] gspca_kinect: add Kinect for Windows USB id

+57 -67
+1 -1
drivers/media/i2c/m5mols/m5mols_core.c
··· 556 556 mutex_lock(&info->lock); 557 557 558 558 format = __find_format(info, fh, fmt->which, info->res_type); 559 - if (!format) 559 + if (format) 560 560 fmt->format = *format; 561 561 else 562 562 ret = -EINVAL;
-3
drivers/media/platform/omap3isp/ispvideo.c
··· 35 35 #include <linux/vmalloc.h> 36 36 #include <media/v4l2-dev.h> 37 37 #include <media/v4l2-ioctl.h> 38 - #include <plat/iommu.h> 39 - #include <plat/iovmm.h> 40 - #include <plat/omap-pm.h> 41 38 42 39 #include "ispvideo.h" 43 40 #include "isp.h"
+1 -1
drivers/media/platform/s5p-fimc/fimc-mdevice.c
··· 593 593 { 594 594 struct media_entity *source, *sink; 595 595 unsigned int flags = MEDIA_LNK_FL_ENABLED; 596 - int i, ret; 596 + int i, ret = 0; 597 597 598 598 for (i = 0; i < FIMC_LITE_MAX_DEVS; i++) { 599 599 struct fimc_lite *fimc = fmd->fimc_lite[i];
+37 -51
drivers/media/platform/s5p-mfc/s5p_mfc.c
··· 412 412 } 413 413 414 414 /* Error handling for interrupt */ 415 - static void s5p_mfc_handle_error(struct s5p_mfc_ctx *ctx, 416 - unsigned int reason, unsigned int err) 415 + static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev, 416 + struct s5p_mfc_ctx *ctx, unsigned int reason, unsigned int err) 417 417 { 418 - struct s5p_mfc_dev *dev; 419 418 unsigned long flags; 420 419 421 - /* If no context is available then all necessary 422 - * processing has been done. */ 423 - if (ctx == NULL) 424 - return; 425 - 426 - dev = ctx->dev; 427 420 mfc_err("Interrupt Error: %08x\n", err); 428 - s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev); 429 - wake_up_dev(dev, reason, err); 430 421 431 - /* Error recovery is dependent on the state of context */ 432 - switch (ctx->state) { 433 - case MFCINST_INIT: 434 - /* This error had to happen while acquireing instance */ 435 - case MFCINST_GOT_INST: 436 - /* This error had to happen while parsing the header */ 437 - case MFCINST_HEAD_PARSED: 438 - /* This error had to happen while setting dst buffers */ 439 - case MFCINST_RETURN_INST: 440 - /* This error had to happen while releasing instance */ 441 - clear_work_bit(ctx); 442 - wake_up_ctx(ctx, reason, err); 443 - if (test_and_clear_bit(0, &dev->hw_lock) == 0) 444 - BUG(); 445 - s5p_mfc_clock_off(); 446 - ctx->state = MFCINST_ERROR; 447 - break; 448 - case MFCINST_FINISHING: 449 - case MFCINST_FINISHED: 450 - case MFCINST_RUNNING: 451 - /* It is higly probable that an error occured 452 - * while decoding a frame */ 453 - clear_work_bit(ctx); 454 - ctx->state = MFCINST_ERROR; 455 - /* Mark all dst buffers as having an error */ 456 - spin_lock_irqsave(&dev->irqlock, flags); 457 - s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue, &ctx->dst_queue, 458 - &ctx->vq_dst); 459 - /* Mark all src buffers as having an error */ 460 - s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue, &ctx->src_queue, 461 - &ctx->vq_src); 462 - spin_unlock_irqrestore(&dev->irqlock, flags); 463 - if (test_and_clear_bit(0, &dev->hw_lock) == 0) 464 - BUG(); 465 - s5p_mfc_clock_off(); 466 - break; 467 - default: 468 - mfc_err("Encountered an error interrupt which had not been handled\n"); 469 - break; 422 + if (ctx != NULL) { 423 + /* Error recovery is dependent on the state of context */ 424 + switch (ctx->state) { 425 + case MFCINST_RES_CHANGE_INIT: 426 + case MFCINST_RES_CHANGE_FLUSH: 427 + case MFCINST_RES_CHANGE_END: 428 + case MFCINST_FINISHING: 429 + case MFCINST_FINISHED: 430 + case MFCINST_RUNNING: 431 + /* It is higly probable that an error occured 432 + * while decoding a frame */ 433 + clear_work_bit(ctx); 434 + ctx->state = MFCINST_ERROR; 435 + /* Mark all dst buffers as having an error */ 436 + spin_lock_irqsave(&dev->irqlock, flags); 437 + s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue, 438 + &ctx->dst_queue, &ctx->vq_dst); 439 + /* Mark all src buffers as having an error */ 440 + s5p_mfc_hw_call(dev->mfc_ops, cleanup_queue, 441 + &ctx->src_queue, &ctx->vq_src); 442 + spin_unlock_irqrestore(&dev->irqlock, flags); 443 + wake_up_ctx(ctx, reason, err); 444 + break; 445 + default: 446 + clear_work_bit(ctx); 447 + ctx->state = MFCINST_ERROR; 448 + wake_up_ctx(ctx, reason, err); 449 + break; 450 + } 470 451 } 452 + if (test_and_clear_bit(0, &dev->hw_lock) == 0) 453 + BUG(); 454 + s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev); 455 + s5p_mfc_clock_off(); 456 + wake_up_dev(dev, reason, err); 471 457 return; 472 458 } 473 459 ··· 618 632 dev->warn_start) 619 633 s5p_mfc_handle_frame(ctx, reason, err); 620 634 else 621 - s5p_mfc_handle_error(ctx, reason, err); 635 + s5p_mfc_handle_error(dev, ctx, reason, err); 622 636 clear_bit(0, &dev->enter_suspend); 623 637 break; 624 638
+1
drivers/media/usb/gspca/kinect.c
··· 381 381 /* -- module initialisation -- */ 382 382 static const struct usb_device_id device_table[] = { 383 383 {USB_DEVICE(0x045e, 0x02ae)}, 384 + {USB_DEVICE(0x045e, 0x02bf)}, 384 385 {} 385 386 }; 386 387
+8 -5
drivers/media/usb/gspca/sonixb.c
··· 496 496 } 497 497 } 498 498 499 - static void i2c_w(struct gspca_dev *gspca_dev, const __u8 *buffer) 499 + static void i2c_w(struct gspca_dev *gspca_dev, const u8 *buf) 500 500 { 501 501 int retry = 60; 502 502 ··· 504 504 return; 505 505 506 506 /* is i2c ready */ 507 - reg_w(gspca_dev, 0x08, buffer, 8); 507 + reg_w(gspca_dev, 0x08, buf, 8); 508 508 while (retry--) { 509 509 if (gspca_dev->usb_err < 0) 510 510 return; 511 - msleep(10); 511 + msleep(1); 512 512 reg_r(gspca_dev, 0x08); 513 513 if (gspca_dev->usb_buf[0] & 0x04) { 514 514 if (gspca_dev->usb_buf[0] & 0x08) { 515 515 dev_err(gspca_dev->v4l2_dev.dev, 516 - "i2c write error\n"); 516 + "i2c error writing %02x %02x %02x %02x" 517 + " %02x %02x %02x %02x\n", 518 + buf[0], buf[1], buf[2], buf[3], 519 + buf[4], buf[5], buf[6], buf[7]); 517 520 gspca_dev->usb_err = -EIO; 518 521 } 519 522 return; ··· 533 530 for (;;) { 534 531 if (gspca_dev->usb_err < 0) 535 532 return; 536 - reg_w(gspca_dev, 0x08, *buffer, 8); 533 + i2c_w(gspca_dev, *buffer); 537 534 len -= 8; 538 535 if (len <= 0) 539 536 break;
+1
drivers/media/usb/gspca/sonixj.c
··· 1550 1550 0, 1551 1551 gspca_dev->usb_buf, 8, 1552 1552 500); 1553 + msleep(2); 1553 1554 if (ret < 0) { 1554 1555 pr_err("i2c_w1 err %d\n", ret); 1555 1556 gspca_dev->usb_err = ret;
+3 -1
drivers/media/usb/uvc/uvc_ctrl.c
··· 1431 1431 int ret; 1432 1432 1433 1433 ctrl = uvc_find_control(chain, xctrl->id, &mapping); 1434 - if (ctrl == NULL || (ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR) == 0) 1434 + if (ctrl == NULL) 1435 1435 return -EINVAL; 1436 + if (!(ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR)) 1437 + return -EACCES; 1436 1438 1437 1439 /* Clamp out of range values. */ 1438 1440 switch (mapping->v4l2_type) {
+2 -4
drivers/media/usb/uvc/uvc_v4l2.c
··· 657 657 ret = uvc_ctrl_get(chain, ctrl); 658 658 if (ret < 0) { 659 659 uvc_ctrl_rollback(handle); 660 - ctrls->error_idx = ret == -ENOENT 661 - ? ctrls->count : i; 660 + ctrls->error_idx = i; 662 661 return ret; 663 662 } 664 663 } ··· 685 686 ret = uvc_ctrl_set(chain, ctrl); 686 687 if (ret < 0) { 687 688 uvc_ctrl_rollback(handle); 688 - ctrls->error_idx = (ret == -ENOENT && 689 - cmd == VIDIOC_S_EXT_CTRLS) 689 + ctrls->error_idx = cmd == VIDIOC_S_EXT_CTRLS 690 690 ? ctrls->count : i; 691 691 return ret; 692 692 }
+3 -1
drivers/media/v4l2-core/videobuf2-core.c
··· 921 921 * In videobuf we use our internal V4l2_planes struct for 922 922 * single-planar buffers as well, for simplicity. 923 923 */ 924 - if (V4L2_TYPE_IS_OUTPUT(b->type)) 924 + if (V4L2_TYPE_IS_OUTPUT(b->type)) { 925 925 v4l2_planes[0].bytesused = b->bytesused; 926 + v4l2_planes[0].data_offset = 0; 927 + } 926 928 927 929 if (b->memory == V4L2_MEMORY_USERPTR) { 928 930 v4l2_planes[0].m.userptr = b->m.userptr;