]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[media] s5p-mfc: Rename IS_MFCV6 macro
authorArun Kumar K <arun.kk@samsung.com>
Tue, 9 Jul 2013 04:24:36 +0000 (01:24 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 18 Aug 2013 10:08:34 +0000 (07:08 -0300)
The MFC v6 specific code holds good for MFC v7 also as
the v7 version is a superset of v6 and the HW interface
remains more or less similar. This patch renames the macro
IS_MFCV6() to IS_MFCV6_PLUS() so that it can be used
for v7 also.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/platform/s5p-mfc/s5p_mfc_cmd.c
drivers/media/platform/s5p-mfc/s5p_mfc_common.h
drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
drivers/media/platform/s5p-mfc/s5p_mfc_opr.c

index f0a41c95df84722b89b485e371668e5ba9a40743..242c033cf8bb8256551c573f494ee766c7ee9277 100644 (file)
@@ -20,7 +20,7 @@ static struct s5p_mfc_hw_cmds *s5p_mfc_cmds;
 
 void s5p_mfc_init_hw_cmds(struct s5p_mfc_dev *dev)
 {
-       if (IS_MFCV6(dev))
+       if (IS_MFCV6_PLUS(dev))
                s5p_mfc_cmds = s5p_mfc_init_hw_cmds_v6();
        else
                s5p_mfc_cmds = s5p_mfc_init_hw_cmds_v5();
index ef4074cd53163faa1f9c8776ccae59d49d97d201..d47016d5249ab48ed8e4acc732d0dcbb93fb65f0 100644 (file)
@@ -683,6 +683,6 @@ void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
 #define HAS_PORTNUM(dev)       (dev ? (dev->variant ? \
                                (dev->variant->port_num ? 1 : 0) : 0) : 0)
 #define IS_TWOPORT(dev)                (dev->variant->port_num == 2 ? 1 : 0)
-#define IS_MFCV6(dev)          (dev->variant->version >= 0x60 ? 1 : 0)
+#define IS_MFCV6_PLUS(dev)     (dev->variant->version >= 0x60 ? 1 : 0)
 
 #endif /* S5P_MFC_COMMON_H_ */
index dc1fc94a488d06c781a5fb83ee4dcecfa74687e6..7cab6849fb5b73d9463c591b4b24eaffcae48bae 100644 (file)
@@ -164,7 +164,7 @@ int s5p_mfc_reset(struct s5p_mfc_dev *dev)
 
        mfc_debug_enter();
 
-       if (IS_MFCV6(dev)) {
+       if (IS_MFCV6_PLUS(dev)) {
                /* Reset IP */
                /*  except RISC, reset */
                mfc_write(dev, 0xFEE, S5P_FIMV_MFC_RESET_V6);
@@ -213,7 +213,7 @@ int s5p_mfc_reset(struct s5p_mfc_dev *dev)
 
 static inline void s5p_mfc_init_memctrl(struct s5p_mfc_dev *dev)
 {
-       if (IS_MFCV6(dev)) {
+       if (IS_MFCV6_PLUS(dev)) {
                mfc_write(dev, dev->bank1, S5P_FIMV_RISC_BASE_ADDRESS_V6);
                mfc_debug(2, "Base Address : %08x\n", dev->bank1);
        } else {
@@ -226,7 +226,7 @@ static inline void s5p_mfc_init_memctrl(struct s5p_mfc_dev *dev)
 
 static inline void s5p_mfc_clear_cmds(struct s5p_mfc_dev *dev)
 {
-       if (IS_MFCV6(dev)) {
+       if (IS_MFCV6_PLUS(dev)) {
                /* Zero initialization should be done before RESET.
                 * Nothing to do here. */
        } else {
@@ -264,7 +264,7 @@ int s5p_mfc_init_hw(struct s5p_mfc_dev *dev)
        s5p_mfc_clear_cmds(dev);
        /* 3. Release reset signal to the RISC */
        s5p_mfc_clean_dev_int_flags(dev);
-       if (IS_MFCV6(dev))
+       if (IS_MFCV6_PLUS(dev))
                mfc_write(dev, 0x1, S5P_FIMV_RISC_ON_V6);
        else
                mfc_write(dev, 0x3ff, S5P_FIMV_SW_RESET);
@@ -301,7 +301,7 @@ int s5p_mfc_init_hw(struct s5p_mfc_dev *dev)
                s5p_mfc_clock_off();
                return -EIO;
        }
-       if (IS_MFCV6(dev))
+       if (IS_MFCV6_PLUS(dev))
                ver = mfc_read(dev, S5P_FIMV_FW_VERSION_V6);
        else
                ver = mfc_read(dev, S5P_FIMV_FW_VERSION);
@@ -380,7 +380,7 @@ int s5p_mfc_wakeup(struct s5p_mfc_dev *dev)
                return ret;
        }
        /* 4. Release reset signal to the RISC */
-       if (IS_MFCV6(dev))
+       if (IS_MFCV6_PLUS(dev))
                mfc_write(dev, 0x1, S5P_FIMV_RISC_ON_V6);
        else
                mfc_write(dev, 0x3ff, S5P_FIMV_SW_RESET);
index 5296385153d5d17ce0a3c3d6f6bf0d8513bb10f4..e2f221254bd0c885fc27fc2b78776aaeeaaef385 100644 (file)
@@ -382,7 +382,7 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f)
                        mfc_err("Unsupported format for source.\n");
                        return -EINVAL;
                }
-               if (!IS_MFCV6(dev) && (fmt->fourcc == V4L2_PIX_FMT_VP8)) {
+               if (!IS_MFCV6_PLUS(dev) && (fmt->fourcc == V4L2_PIX_FMT_VP8)) {
                        mfc_err("Not supported format.\n");
                        return -EINVAL;
                }
@@ -392,10 +392,11 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f)
                        mfc_err("Unsupported format for destination.\n");
                        return -EINVAL;
                }
-               if (IS_MFCV6(dev) && (fmt->fourcc == V4L2_PIX_FMT_NV12MT)) {
+               if (IS_MFCV6_PLUS(dev) &&
+                               (fmt->fourcc == V4L2_PIX_FMT_NV12MT)) {
                        mfc_err("Not supported format.\n");
                        return -EINVAL;
-               } else if (!IS_MFCV6(dev) &&
+               } else if (!IS_MFCV6_PLUS(dev) &&
                                (fmt->fourcc != V4L2_PIX_FMT_NV12MT)) {
                        mfc_err("Not supported format.\n");
                        return -EINVAL;
@@ -430,10 +431,11 @@ static int vidioc_s_fmt(struct file *file, void *priv, struct v4l2_format *f)
                        mfc_err("Unsupported format for source.\n");
                        return -EINVAL;
                }
-               if (!IS_MFCV6(dev) && (fmt->fourcc != V4L2_PIX_FMT_NV12MT)) {
+               if (!IS_MFCV6_PLUS(dev) &&
+                               (fmt->fourcc != V4L2_PIX_FMT_NV12MT)) {
                        mfc_err("Not supported format.\n");
                        return -EINVAL;
-               } else if (IS_MFCV6(dev) &&
+               } else if (IS_MFCV6_PLUS(dev) &&
                                (fmt->fourcc == V4L2_PIX_FMT_NV12MT)) {
                        mfc_err("Not supported format.\n");
                        return -EINVAL;
@@ -457,7 +459,7 @@ static int vidioc_s_fmt(struct file *file, void *priv, struct v4l2_format *f)
                ret = -EINVAL;
                goto out;
        }
-       if (!IS_MFCV6(dev) && (fmt->fourcc == V4L2_PIX_FMT_VP8)) {
+       if (!IS_MFCV6_PLUS(dev) && (fmt->fourcc == V4L2_PIX_FMT_VP8)) {
                mfc_err("Not supported format.\n");
                return -EINVAL;
        }
@@ -942,7 +944,7 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq,
                psize[0] = ctx->luma_size;
                psize[1] = ctx->chroma_size;
 
-               if (IS_MFCV6(dev))
+               if (IS_MFCV6_PLUS(dev))
                        allocators[0] =
                                ctx->dev->alloc_ctx[MFC_BANK1_ALLOC_CTX];
                else
@@ -1067,7 +1069,7 @@ static int s5p_mfc_stop_streaming(struct vb2_queue *q)
                ctx->dpb_flush_flag = 1;
                ctx->dec_dst_flag = 0;
                spin_unlock_irqrestore(&dev->irqlock, flags);
-               if (IS_MFCV6(dev) && (ctx->state == MFCINST_RUNNING)) {
+               if (IS_MFCV6_PLUS(dev) && (ctx->state == MFCINST_RUNNING)) {
                        ctx->state = MFCINST_FLUSH;
                        set_work_bit_irqsave(ctx);
                        s5p_mfc_clean_ctx_int_flags(ctx);
index 2549967b2f8589bb46007b8282520250392287b7..f734ccc27deb484d4a03268a8708adc233638bfc 100644 (file)
@@ -663,7 +663,7 @@ static int enc_post_seq_start(struct s5p_mfc_ctx *ctx)
                spin_unlock_irqrestore(&dev->irqlock, flags);
        }
 
-       if (!IS_MFCV6(dev)) {
+       if (!IS_MFCV6_PLUS(dev)) {
                ctx->state = MFCINST_RUNNING;
                if (s5p_mfc_ctx_ready(ctx))
                        set_work_bit_irqsave(ctx);
@@ -993,11 +993,11 @@ static int vidioc_s_fmt(struct file *file, void *priv, struct v4l2_format *f)
                        return -EINVAL;
                }
 
-               if (!IS_MFCV6(dev) &&
+               if (!IS_MFCV6_PLUS(dev) &&
                                (fmt->fourcc == V4L2_PIX_FMT_NV12MT_16X16)) {
                        mfc_err("Not supported format.\n");
                        return -EINVAL;
-               } else if (IS_MFCV6(dev) &&
+               } else if (IS_MFCV6_PLUS(dev) &&
                                (fmt->fourcc == V4L2_PIX_FMT_NV12MT)) {
                        mfc_err("Not supported format.\n");
                        return -EINVAL;
@@ -1072,7 +1072,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
                        return -EINVAL;
                }
 
-               if (IS_MFCV6(dev)) {
+               if (IS_MFCV6_PLUS(dev)) {
                        /* Check for min encoder buffers */
                        if (ctx->pb_count &&
                                (reqbufs->count < ctx->pb_count)) {
@@ -1353,7 +1353,7 @@ static int s5p_mfc_enc_s_ctrl(struct v4l2_ctrl *ctrl)
                                S5P_FIMV_ENC_PROFILE_H264_BASELINE;
                        break;
                case V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE:
-                       if (IS_MFCV6(dev))
+                       if (IS_MFCV6_PLUS(dev))
                                p->codec.h264.profile =
                                S5P_FIMV_ENC_PROFILE_H264_CONSTRAINED_BASELINE;
                        else
@@ -1662,9 +1662,10 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq,
                        *buf_count = 1;
                if (*buf_count > MFC_MAX_BUFFERS)
                        *buf_count = MFC_MAX_BUFFERS;
+
                psize[0] = ctx->luma_size;
                psize[1] = ctx->chroma_size;
-               if (IS_MFCV6(dev)) {
+               if (IS_MFCV6_PLUS(dev)) {
                        allocators[0] =
                                ctx->dev->alloc_ctx[MFC_BANK1_ALLOC_CTX];
                        allocators[1] =
@@ -1773,7 +1774,8 @@ static int s5p_mfc_start_streaming(struct vb2_queue *q, unsigned int count)
        struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv);
        struct s5p_mfc_dev *dev = ctx->dev;
 
-       if (IS_MFCV6(dev) && (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)) {
+       if (IS_MFCV6_PLUS(dev) &&
+                       (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)) {
 
                if ((ctx->state == MFCINST_GOT_INST) &&
                        (dev->curr_ctx == ctx->num) && dev->hw_lock) {
index 10f8ac37cecd595ffd2cc8e67608653d74a5c863..3c01c339d69612c448baef99cd1649e2a7256807 100644 (file)
@@ -21,7 +21,7 @@ static struct s5p_mfc_hw_ops *s5p_mfc_ops;
 
 void s5p_mfc_init_hw_ops(struct s5p_mfc_dev *dev)
 {
-       if (IS_MFCV6(dev)) {
+       if (IS_MFCV6_PLUS(dev)) {
                s5p_mfc_ops = s5p_mfc_init_hw_ops_v6();
                dev->warn_start = S5P_FIMV_ERR_WARNINGS_START_V6;
        } else {