]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'patchwork' into to_next
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 18 Aug 2013 13:24:41 +0000 (10:24 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 18 Aug 2013 13:24:41 +0000 (10:24 -0300)
* patchwork: (58 commits)
  v4l2-common: warning fix (W=1): add a missed function prototype
  sh_mobile_ceu_camera: Fix a compilation warning
  [media] exynos-gsc: fix s2r functionality
  [media] exynos4-is: Staticize local symbol
  [media] exynos4-is: Fix potential NULL pointer dereference
  [media] V4L: s5c73m3: Add format propagation for TRY formats
  [media] v4l2-async: Use proper list head for iteration over registered subdevs
  [media] V4L2: mt9m111: switch to asynchronous subdevice probing
  [media] V4L2: mt9t031: don't Oops if asynchronous probing is attempted
  [media] V4L2: mx3_camera: add support for asynchronous subdevice registration
  [media] V4L2: mx3_camera: print V4L2_MBUS_FMT_* codes in hexadecimal format
  [media] V4L2: mx3_camera: convert to managed resource allocation
  [media] V4L2: soc-camera: fix requesting regulators in synchronous case
  [media] soc_camera: fix compiler warning
  [media] V4L2: soc_camera: Renesas R-Car VIN driver
  [media] v4l: async: Make it safe to unregister unregistered notifier
  [media] v4l: Fix colorspace conversion error in sample code
  [media] v4l: of: Drop acquired reference to node when getting next endpoint
  [media] v4l: of: Use of_get_child_by_name()
  [media] videobuf2-core: Verify planes lengths for output buffers
  ...

Conflicts:
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c

1  2 
Documentation/DocBook/media_api.tmpl
drivers/media/platform/exynos-gsc/gsc-core.c
drivers/media/platform/exynos4-is/fimc-lite.c
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c

Simple merge
index 4f6dd42c9adb06755eebbc520ba57124f77a5e35,e2f221254bd0c885fc27fc2b78776aaeeaaef385..c46d12ca32fcc0f0c2f56c37d43d7e06d03329e9
@@@ -382,16 -382,10 +382,20 @@@ static int vidioc_try_fmt(struct file *
                        mfc_err("Unsupported format for source.\n");
                        return -EINVAL;
                }
 +              if (fmt->codec_mode == S5P_FIMV_CODEC_NONE) {
 +                      mfc_err("Unknown codec\n");
 +                      return -EINVAL;
 +              }
+               if (!IS_MFCV6_PLUS(dev) && (fmt->fourcc == V4L2_PIX_FMT_VP8)) {
+                       mfc_err("Not supported format.\n");
+                       return -EINVAL;
+               }
 +              if (!IS_MFCV6(dev)) {
 +                      if (fmt->fourcc == V4L2_PIX_FMT_VP8) {
 +                              mfc_err("Not supported format.\n");
 +                              return -EINVAL;
 +                      }
 +              }
        } else if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
                fmt = find_format(f, MFC_FMT_RAW);
                if (!fmt) {
@@@ -430,28 -426,36 +435,50 @@@ static int vidioc_s_fmt(struct file *fi
                goto out;
        }
        if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
-               /* dst_fmt is validated by call to vidioc_try_fmt */
-               ctx->dst_fmt = find_format(f, MFC_FMT_RAW);
-               ret = 0;
+               fmt = find_format(f, MFC_FMT_RAW);
+               if (!fmt) {
+                       mfc_err("Unsupported format for source.\n");
+                       return -EINVAL;
+               }
+               if (!IS_MFCV6_PLUS(dev) &&
+                               (fmt->fourcc != V4L2_PIX_FMT_NV12MT)) {
+                       mfc_err("Not supported format.\n");
+                       return -EINVAL;
+               } else if (IS_MFCV6_PLUS(dev) &&
+                               (fmt->fourcc == V4L2_PIX_FMT_NV12MT)) {
+                       mfc_err("Not supported format.\n");
+                       return -EINVAL;
+               }
+               ctx->dst_fmt = fmt;
+               mfc_debug_leave();
+               return ret;
+       } else if (f->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
+               mfc_err("Wrong type error for S_FMT : %d", f->type);
+               return -EINVAL;
+       }
+       fmt = find_format(f, MFC_FMT_DEC);
+       if (!fmt || fmt->codec_mode == S5P_MFC_CODEC_NONE) {
+               mfc_err("Unknown codec\n");
+               ret = -EINVAL;
                goto out;
 -      }
 -      if (fmt->type != MFC_FMT_DEC) {
 -              mfc_err("Wrong format selected, you should choose "
 -                                      "format for decoding\n");
 +      } else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
 +              /* src_fmt is validated by call to vidioc_try_fmt */
 +              ctx->src_fmt = find_format(f, MFC_FMT_DEC);
 +              ctx->codec_mode = ctx->src_fmt->codec_mode;
 +              mfc_debug(2, "The codec number is: %d\n", ctx->codec_mode);
 +              pix_mp->height = 0;
 +              pix_mp->width = 0;
 +              if (pix_mp->plane_fmt[0].sizeimage)
 +                      ctx->dec_src_buf_size = pix_mp->plane_fmt[0].sizeimage;
 +              else
 +                      pix_mp->plane_fmt[0].sizeimage = ctx->dec_src_buf_size =
 +                                                              DEF_CPB_SIZE;
 +              pix_mp->plane_fmt[0].bytesperline = 0;
 +              ctx->state = MFCINST_INIT;
 +              ret = 0;
 +              goto out;
 +      } else {
 +              mfc_err("Wrong type error for S_FMT : %d", f->type);
                ret = -EINVAL;
                goto out;
        }
index 59e56f4c8ce34ded878308537b5de1a57595acf1,fb077b32975d9cf2ae0860706d7d6d9717325254..306c72bf56b48a256ed7447bea1852911b7102bd
@@@ -972,9 -1021,17 +1033,16 @@@ static int vidioc_s_fmt(struct file *fi
                goto out;
        }
        if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
-               /* dst_fmt is validated by call to vidioc_try_fmt */
-               ctx->dst_fmt = find_format(f, MFC_FMT_ENC);
+               fmt = find_format(f, MFC_FMT_ENC);
+               if (!fmt) {
+                       mfc_err("failed to set capture format\n");
+                       return -EINVAL;
+               }
+               if (!IS_MFCV7(dev) && (fmt->fourcc == V4L2_PIX_FMT_VP8)) {
+                       mfc_err("VP8 is supported only in MFC v7\n");
+                       return -EINVAL;
+               }
                ctx->state = MFCINST_INIT;
 -              ctx->dst_fmt = fmt;
                ctx->codec_mode = ctx->dst_fmt->codec_mode;
                ctx->enc_dst_buf_size = pix_fmt_mp->plane_fmt[0].sizeimage;
                pix_fmt_mp->plane_fmt[0].bytesperline = 0;