vdin: add bin info to vdin1 histogram dump [1/1]
authorXihai Zhu <xihai.zhu@amlogic.com>
Wed, 10 Jul 2019 01:50:40 +0000 (21:50 -0400)
committerTao Zeng <tao.zeng@amlogic.com>
Mon, 5 Aug 2019 08:14:56 +0000 (01:14 -0700)
PD#SWPL-11289

Problem:
bin data is missing from vdin1 histogram

Solution:
have histogram bin data copied

Verify:
TL1

Change-Id: I080448b2278e265d7a1649fb57fd6aacc0e6e576
Signed-off-by: Xihai Zhu <xihai.zhu@amlogic.com>
drivers/amlogic/media/vin/tvin/vdin/vdin_drv.c
drivers/amlogic/media/vin/tvin/vdin/vdin_drv.h

index 260ff6a..31712d2 100644 (file)
@@ -1328,6 +1328,7 @@ static void vdin_hist_tgt(struct vdin_dev_s *devp, struct vframe_s *vf)
        int ave_luma;
        int pix_sum;
        ulong flags;
+       unsigned int i = 0;
 
        spin_lock_irqsave(&devp->hist_lock, flags);
        vdin1_hist.sum    = vf->prop.hist.luma_sum;
@@ -1349,6 +1350,9 @@ static void vdin_hist_tgt(struct vdin_dev_s *devp, struct vframe_s *vf)
        if (vdin1_hist.ave > 255)
                vdin1_hist.ave = 255;
 
+       for (i = 0; i < 64; i++)
+               vdin1_hist.hist[i] = vf->prop.hist.gamma[i];
+
        spin_unlock_irqrestore(&devp->hist_lock, flags);
 }
 
@@ -2716,6 +2720,8 @@ static long vdin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                vdin1_hist_temp.width = vdin1_hist.width;
                vdin1_hist_temp.height = vdin1_hist.height;
                vdin1_hist_temp.ave = vdin1_hist.ave;
+               for (i = 0; i < 64; i++)
+                       vdin1_hist_temp.hist[i] = vdin1_hist.hist[i];
                spin_unlock_irqrestore(&devp->hist_lock, flags);
                if (vdin_dbg_en) {
                        if (pr_times++ > 10) {
@@ -2724,6 +2730,9 @@ static long vdin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                                        vdin1_hist_temp.height,
                                        vdin1_hist_temp.width,
                                        vdin1_hist_temp.ave);
+                               for (i = 0; i < 64; i++)
+                                       pr_info("-:vdin1 hist[%d]=%d\n",
+                                       i, vdin1_hist_temp.hist[i]);
                        }
                }
 
index d699694..4b2cf72 100644 (file)
@@ -425,6 +425,7 @@ struct vdin_hist_s {
        int width;
        int height;
        int ave;
+       unsigned short hist[64];
 };
 
 struct vdin_v4l2_param_s {