Merge commit 'main-ics-2012.06.04-A5' into HEAD
Tom Cherry [Tue, 5 Jun 2012 18:41:56 +0000 (11:41 -0700)]
Conflicts:
drivers/media/video/tegra/nvavp/nvavp_dev.c

Change-Id: I7779b0ce58004f80cccf6193148ac49551ce5da5

1  2 
arch/arm/mach-tegra/Makefile
drivers/media/video/tegra/nvavp/nvavp_dev.c
drivers/usb/otg/tegra-otg.c
drivers/video/tegra/dc/dc.c

Simple merge
@@@ -101,15 -131,7 +131,9 @@@ struct nvavp_info 
        /* client for driver allocations, persistent */
        struct nvmap_client             *nvmap;
  
-       struct mutex                    pushbuffer_lock;
-       struct nvmap_handle_ref         *pushbuf_handle;
-       unsigned long                   pushbuf_phys;
-       u8                              *pushbuf_data;
-       u32                             pushbuf_index;
-       u32                             pushbuf_fence;
 +      bool                            pending;
 +
-       struct nv_e276_control          *os_control;
+       struct nvavp_channel            channel_info[NVAVP_NUM_CHANNELS];
  
        struct nvhost_syncpt            *nvhost_syncpt;
        u32                             syncpt_id;
@@@ -186,15 -279,11 +284,16 @@@ static void clock_disable_handler(struc
  
        nvavp = container_of(work, struct nvavp_info,
                            clock_disable_work);
 -
+       channel_info = nvavp_get_channel_info(nvavp, NVAVP_VIDEO_CHANNEL);
 +
-       mutex_lock(&nvavp->pushbuffer_lock);
+       mutex_lock(&channel_info->pushbuffer_lock);
 -      nvavp_clk_ctrl(nvavp, !nvavp_check_idle(nvavp));
 +      mutex_lock(&nvavp->open_lock);
 +      if (nvavp_check_idle(nvavp) && nvavp->pending) {
 +              nvavp->pending = false;
 +              nvavp_clks_disable(nvavp);
 +      }
 +      mutex_unlock(&nvavp->open_lock);
-       mutex_unlock(&nvavp->pushbuffer_lock);
+       mutex_unlock(&channel_info->pushbuffer_lock);
  }
  
  static int nvavp_service(struct nvavp_info *nvavp)
@@@ -500,17 -592,14 +605,20 @@@ static int nvavp_pushbuffer_update(stru
        }
  
        /* enable clocks to VDE/BSEV */
-       mutex_lock(&nvavp->open_lock);
-       if (!nvavp->pending) {
-               nvavp_clks_enable(nvavp);
-               nvavp->pending = true;
 -      if (IS_VIDEO_CHANNEL_ID(channel_id))
 -              nvavp_clk_ctrl(nvavp, 1);
++      if (IS_VIDEO_CHANNEL_ID(channel_id)) {
++              mutex_lock(&nvavp->open_lock);
++              if (!nvavp->pending) {
++                      nvavp_clks_enable(nvavp);
++                      nvavp->pending = true;
++              }
++              mutex_unlock(&nvavp->open_lock);
 +      }
-       mutex_unlock(&nvavp->open_lock);
  
        /* update put pointer */
-       nvavp->pushbuf_index = (nvavp->pushbuf_index + wordcount) &
+       channel_info->pushbuf_index = (channel_info->pushbuf_index + wordcount)&
                                        (NVAVP_PUSHBUFFER_SIZE - 1);
-       writel(nvavp->pushbuf_index, &control->put);
+       writel(channel_info->pushbuf_index, &control->put);
        wmb();
  
        /* wake up avp */
Simple merge
Simple merge