]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Jun 2013 16:25:08 +0000 (06:25 -1000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Jun 2013 16:25:08 +0000 (06:25 -1000)
Pull media fixes from Mauro Carvalho Chehab:
 "Series of fixes for 3.10.  There are some usual driver fixes (mostly
  on s5p/exynos playform drivers), plus some fixes at V4L2 core"

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (40 commits)
  [media] soc_camera: error dev remove and v4l2 call
  [media] sh_veu: fix the buffer size calculation
  [media] sh_veu: keep power supply until the m2m context is released
  [media] sh_veu: invoke v4l2_m2m_job_finish() even if a job has been aborted
  [media] v4l2-ioctl: don't print the clips list
  [media] v4l2-ctrls: V4L2_CTRL_CLASS_FM_RX controls are also valid radio controls
  [media] cx88: fix NULL pointer dereference
  [media] DocBook/media/v4l: update version number
  [media] exynos4-is: Remove "sysreg" clock handling
  [media] exynos4-is: Fix reported colorspace at FIMC-IS-ISP subdev
  [media] exynos4-is: Ensure fimc-is clocks are not enabled until properly configured
  [media] exynos4-is: Prevent NULL pointer dereference when firmware isn't loaded
  [media] s5p-mfc: Add NULL check for allocated buffer
  [media] s5p-mfc: added missing end-of-lines in debug messages
  [media] s5p-mfc: v4l2 controls setup routine moved to initialization code
  [media] s5p-mfc: separate encoder parameters for h264 and mpeg4
  [media] s5p-mfc: Remove special clock usage in driver
  [media] s5p-mfc: Remove unused s5p_mfc_get_decoded_status_v6() function
  [media] v4l2: mem2mem: save irq flags correctly
  [media] coda: v4l2-compliance fix: add VIDIOC_CREATE_BUFS support
  ...

1  2 
drivers/media/platform/coda.c
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
drivers/staging/media/solo6x10/Kconfig

index 48b8d7af386d5538bdc8b28219dd168cd540fcbd,f82e1c668179527dba7b8ca55102e452bd3f858c..9d1481a60bd97d5ce60e8387365a7e22cbc50016
@@@ -14,7 -14,6 +14,7 @@@
  #include <linux/clk.h>
  #include <linux/delay.h>
  #include <linux/firmware.h>
 +#include <linux/genalloc.h>
  #include <linux/interrupt.h>
  #include <linux/io.h>
  #include <linux/irq.h>
@@@ -24,7 -23,7 +24,7 @@@
  #include <linux/slab.h>
  #include <linux/videodev2.h>
  #include <linux/of.h>
 -#include <linux/platform_data/imx-iram.h>
 +#include <linux/platform_data/coda.h>
  
  #include <media/v4l2-ctrls.h>
  #include <media/v4l2-device.h>
@@@ -44,7 -43,6 +44,7 @@@
  #define CODA7_WORK_BUF_SIZE   (512 * 1024 + CODA_FMO_BUF_SIZE * 8 * 1024)
  #define CODA_PARA_BUF_SIZE    (10 * 1024)
  #define CODA_ISRAM_SIZE       (2048 * 2)
 +#define CODADX6_IRAM_SIZE     0xb000
  #define CODA7_IRAM_SIZE               0x14000 /* 81920 bytes */
  
  #define CODA_MAX_FRAMEBUFFERS 2
@@@ -130,10 -128,7 +130,10 @@@ struct coda_dev 
  
        struct coda_aux_buf     codebuf;
        struct coda_aux_buf     workbuf;
 +      struct gen_pool         *iram_pool;
 +      long unsigned int       iram_vaddr;
        long unsigned int       iram_paddr;
 +      unsigned long           iram_size;
  
        spinlock_t              irqlock;
        struct mutex            dev_mutex;
@@@ -576,6 -571,14 +576,14 @@@ static int vidioc_dqbuf(struct file *fi
        return v4l2_m2m_dqbuf(file, ctx->m2m_ctx, buf);
  }
  
+ static int vidioc_create_bufs(struct file *file, void *priv,
+                             struct v4l2_create_buffers *create)
+ {
+       struct coda_ctx *ctx = fh_to_ctx(priv);
+       return v4l2_m2m_create_bufs(file, ctx->m2m_ctx, create);
+ }
  static int vidioc_streamon(struct file *file, void *priv,
                           enum v4l2_buf_type type)
  {
@@@ -610,6 -613,7 +618,7 @@@ static const struct v4l2_ioctl_ops coda
  
        .vidioc_qbuf            = vidioc_qbuf,
        .vidioc_dqbuf           = vidioc_dqbuf,
+       .vidioc_create_bufs     = vidioc_create_bufs,
  
        .vidioc_streamon        = vidioc_streamon,
        .vidioc_streamoff       = vidioc_streamoff,
@@@ -1936,9 -1940,6 +1945,9 @@@ static int coda_probe(struct platform_d
        const struct of_device_id *of_id =
                        of_match_device(of_match_ptr(coda_dt_ids), &pdev->dev);
        const struct platform_device_id *pdev_id;
 +      struct coda_platform_data *pdata = pdev->dev.platform_data;
 +      struct device_node *np = pdev->dev.of_node;
 +      struct gen_pool *pool;
        struct coda_dev *dev;
        struct resource *res;
        int ret, irq;
                return -ENOENT;
        }
  
 +      /* Get IRAM pool from device tree or platform data */
 +      pool = of_get_named_gen_pool(np, "iram", 0);
 +      if (!pool && pdata)
 +              pool = dev_get_gen_pool(pdata->iram_dev);
 +      if (!pool) {
 +              dev_err(&pdev->dev, "iram pool not available\n");
 +              return -ENOMEM;
 +      }
 +      dev->iram_pool = pool;
 +
        ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev);
        if (ret)
                return ret;
                return -ENOMEM;
        }
  
 -      if (dev->devtype->product == CODA_DX6) {
 -              dev->iram_paddr = 0xffff4c00;
 -      } else {
 -              void __iomem *iram_vaddr;
 -
 -              iram_vaddr = iram_alloc(CODA7_IRAM_SIZE,
 -                                      &dev->iram_paddr);
 -              if (!iram_vaddr) {
 -                      dev_err(&pdev->dev, "unable to alloc iram\n");
 -                      return -ENOMEM;
 -              }
 +      if (dev->devtype->product == CODA_DX6)
 +              dev->iram_size = CODADX6_IRAM_SIZE;
 +      else
 +              dev->iram_size = CODA7_IRAM_SIZE;
 +      dev->iram_vaddr = gen_pool_alloc(dev->iram_pool, dev->iram_size);
 +      if (!dev->iram_vaddr) {
 +              dev_err(&pdev->dev, "unable to alloc iram\n");
 +              return -ENOMEM;
        }
 +      dev->iram_paddr = gen_pool_virt_to_phys(dev->iram_pool,
 +                                              dev->iram_vaddr);
  
        platform_set_drvdata(pdev, dev);
  
@@@ -2072,8 -2064,8 +2081,8 @@@ static int coda_remove(struct platform_
        if (dev->alloc_ctx)
                vb2_dma_contig_cleanup_ctx(dev->alloc_ctx);
        v4l2_device_unregister(&dev->v4l2_dev);
 -      if (dev->iram_paddr)
 -              iram_free(dev->iram_paddr, CODA7_IRAM_SIZE);
 +      if (dev->iram_vaddr)
 +              gen_pool_free(dev->iram_pool, dev->iram_vaddr, dev->iram_size);
        if (dev->codebuf.vaddr)
                dma_free_coherent(&pdev->dev, dev->codebuf.size,
                                  &dev->codebuf.vaddr, dev->codebuf.paddr);
index 7e76fce2e524435f301955c286d5932cbf76adb2,7d4c5e170ba80de040d26c822df768ca5ebdbe90..66f0d042357fd32465fddd19a34a4ac201633163
@@@ -62,12 -62,6 +62,6 @@@ static void s5p_mfc_release_dec_desc_bu
        /* NOP */
  }
  
- static int s5p_mfc_get_dec_status_v6(struct s5p_mfc_dev *dev)
- {
-       /* NOP */
-       return -1;
- }
  /* Allocate codec buffers */
  static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
  {
                                S5P_FIMV_SCRATCH_BUFFER_ALIGN_V6);
                ctx->bank1.size =
                        ctx->scratch_buf_size + ctx->tmv_buffer_size +
-                       (ctx->dpb_count * (ctx->luma_dpb_size +
+                       (ctx->pb_count * (ctx->luma_dpb_size +
                        ctx->chroma_dpb_size + ctx->me_buffer_size));
                ctx->bank2.size = 0;
                break;
                                S5P_FIMV_SCRATCH_BUFFER_ALIGN_V6);
                ctx->bank1.size =
                        ctx->scratch_buf_size + ctx->tmv_buffer_size +
-                       (ctx->dpb_count * (ctx->luma_dpb_size +
+                       (ctx->pb_count * (ctx->luma_dpb_size +
                        ctx->chroma_dpb_size + ctx->me_buffer_size));
                ctx->bank2.size = 0;
                break;
                }
                BUG_ON(ctx->bank1.dma & ((1 << MFC_BANK1_ALIGN_ORDER) - 1));
        }
        return 0;
  }
  
@@@ -449,8 -442,8 +442,8 @@@ static int s5p_mfc_set_enc_stream_buffe
        WRITEL(addr, S5P_FIMV_E_STREAM_BUFFER_ADDR_V6); /* 16B align */
        WRITEL(size, S5P_FIMV_E_STREAM_BUFFER_SIZE_V6);
  
-       mfc_debug(2, "stream buf addr: 0x%08lx, size: 0x%d",
-               addr, size);
+       mfc_debug(2, "stream buf addr: 0x%08lx, size: 0x%d\n",
+                 addr, size);
  
        return 0;
  }
@@@ -463,8 -456,8 +456,8 @@@ static void s5p_mfc_set_enc_frame_buffe
        WRITEL(y_addr, S5P_FIMV_E_SOURCE_LUMA_ADDR_V6); /* 256B align */
        WRITEL(c_addr, S5P_FIMV_E_SOURCE_CHROMA_ADDR_V6);
  
-       mfc_debug(2, "enc src y buf addr: 0x%08lx", y_addr);
-       mfc_debug(2, "enc src c buf addr: 0x%08lx", c_addr);
+       mfc_debug(2, "enc src y buf addr: 0x%08lx\n", y_addr);
+       mfc_debug(2, "enc src c buf addr: 0x%08lx\n", c_addr);
  }
  
  static void s5p_mfc_get_enc_frame_buffer_v6(struct s5p_mfc_ctx *ctx,
        enc_recon_y_addr = READL(S5P_FIMV_E_RECON_LUMA_DPB_ADDR_V6);
        enc_recon_c_addr = READL(S5P_FIMV_E_RECON_CHROMA_DPB_ADDR_V6);
  
-       mfc_debug(2, "recon y addr: 0x%08lx", enc_recon_y_addr);
-       mfc_debug(2, "recon c addr: 0x%08lx", enc_recon_c_addr);
+       mfc_debug(2, "recon y addr: 0x%08lx\n", enc_recon_y_addr);
+       mfc_debug(2, "recon c addr: 0x%08lx\n", enc_recon_c_addr);
  }
  
  /* Set encoding ref & codec buffer */
@@@ -497,7 -490,7 +490,7 @@@ static int s5p_mfc_set_enc_ref_buffer_v
  
        mfc_debug(2, "Buf1: %p (%d)\n", (void *)buf_addr1, buf_size1);
  
-       for (i = 0; i < ctx->dpb_count; i++) {
+       for (i = 0; i < ctx->pb_count; i++) {
                WRITEL(buf_addr1, S5P_FIMV_E_LUMA_DPB_V6 + (4 * i));
                buf_addr1 += ctx->luma_dpb_size;
                WRITEL(buf_addr1, S5P_FIMV_E_CHROMA_DPB_V6 + (4 * i));
        buf_size1 -= ctx->tmv_buffer_size;
  
        mfc_debug(2, "Buf1: %u, buf_size1: %d (ref frames %d)\n",
-                       buf_addr1, buf_size1, ctx->dpb_count);
+                       buf_addr1, buf_size1, ctx->pb_count);
        if (buf_size1 < 0) {
                mfc_debug(2, "Not enough memory has been allocated.\n");
                return -ENOMEM;
@@@ -1313,7 -1306,7 +1306,7 @@@ static inline int s5p_mfc_get_new_ctx(s
        int cnt;
  
        spin_lock_irqsave(&dev->condlock, flags);
 -      mfc_debug(2, "Previos context: %d (bits %08lx)\n", dev->curr_ctx,
 +      mfc_debug(2, "Previous context: %d (bits %08lx)\n", dev->curr_ctx,
                                                        dev->ctx_work_bits);
        new_ctx = (dev->curr_ctx + 1) % MFC_NUM_CONTEXTS;
        cnt = 0;
@@@ -1431,8 -1424,8 +1424,8 @@@ static inline int s5p_mfc_run_enc_frame
        src_y_addr = vb2_dma_contig_plane_dma_addr(src_mb->b, 0);
        src_c_addr = vb2_dma_contig_plane_dma_addr(src_mb->b, 1);
  
-       mfc_debug(2, "enc src y addr: 0x%08lx", src_y_addr);
-       mfc_debug(2, "enc src c addr: 0x%08lx", src_c_addr);
+       mfc_debug(2, "enc src y addr: 0x%08lx\n", src_y_addr);
+       mfc_debug(2, "enc src c addr: 0x%08lx\n", src_c_addr);
  
        s5p_mfc_set_enc_frame_buffer_v6(ctx, src_y_addr, src_c_addr);
  
@@@ -1522,22 -1515,6 +1515,6 @@@ static inline int s5p_mfc_run_init_enc_
        struct s5p_mfc_dev *dev = ctx->dev;
        int ret;
  
-       ret = s5p_mfc_alloc_codec_buffers_v6(ctx);
-       if (ret) {
-               mfc_err("Failed to allocate encoding buffers.\n");
-               return -ENOMEM;
-       }
-       /* Header was generated now starting processing
-        * First set the reference frame buffers
-        */
-       if (ctx->capture_state != QUEUE_BUFS_REQUESTED) {
-               mfc_err("It seems that destionation buffers were not\n"
-                       "requested.MFC requires that header should be generated\n"
-                       "before allocating codec buffer.\n");
-               return -EAGAIN;
-       }
        dev->curr_ctx = ctx->num;
        s5p_mfc_clean_ctx_int_flags(ctx);
        ret = s5p_mfc_set_enc_ref_buffer_v6(ctx);
@@@ -1582,7 -1559,7 +1559,7 @@@ static void s5p_mfc_try_run_v6(struct s
        mfc_debug(1, "Seting new context to %p\n", ctx);
        /* Got context to run in ctx */
        mfc_debug(1, "ctx->dst_queue_cnt=%d ctx->dpb_count=%d ctx->src_queue_cnt=%d\n",
-               ctx->dst_queue_cnt, ctx->dpb_count, ctx->src_queue_cnt);
+               ctx->dst_queue_cnt, ctx->pb_count, ctx->src_queue_cnt);
        mfc_debug(1, "ctx->state=%d\n", ctx->state);
        /* Last frame has already been sent to MFC
         * Now obtaining frames from MFC buffer */
                case MFCINST_GOT_INST:
                        s5p_mfc_run_init_enc(ctx);
                        break;
-               case MFCINST_HEAD_PARSED: /* Only for MFC6.x */
+               case MFCINST_HEAD_PRODUCED:
                        ret = s5p_mfc_run_init_enc_buffers(ctx);
                        break;
                default:
@@@ -1730,7 -1707,7 +1707,7 @@@ static int s5p_mfc_get_dspl_status_v6(s
        return mfc_read(dev, S5P_FIMV_D_DISPLAY_STATUS_V6);
  }
  
- static int s5p_mfc_get_decoded_status_v6(struct s5p_mfc_dev *dev)
+ static int s5p_mfc_get_dec_status_v6(struct s5p_mfc_dev *dev)
  {
        return mfc_read(dev, S5P_FIMV_D_DECODED_STATUS_V6);
  }
index df6569b997b88269bfdb48fd17dc410a0da50c0a,0bc743b3d98e5ae2901619b358f0a1b64d8e8662..34f3b6d02d2a4075b423d1adcca0c62b5f949c96
@@@ -1,10 -1,10 +1,11 @@@
  config SOLO6X10
        tristate "Softlogic 6x10 MPEG codec cards"
        depends on PCI && VIDEO_DEV && SND && I2C
 +      depends on FONTS
        select VIDEOBUF2_DMA_SG
        select VIDEOBUF2_DMA_CONTIG
        select SND_PCM
+       select FONT_8x16
        ---help---
          This driver supports the Softlogic based MPEG-4 and h.264 codec
          cards.