Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156780
b: refs/heads/master
c: 2dd54a5
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Aug 13, 2009
1 parent d309ec7 commit c3135dd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d2e2e35fb50f381c9398e481aac1e1729765ae3
refs/heads/master: 2dd54a54c19d0e5b50f4e1c591653772ead9d4a1
6 changes: 1 addition & 5 deletions trunk/drivers/media/video/mx1_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,20 +234,18 @@ static int mx1_camera_setup_dma(struct mx1_camera_dev *pcdev)
return ret;
}

/* Called under spinlock_irqsave(&pcdev->lock, ...) */
static void mx1_videobuf_queue(struct videobuf_queue *vq,
struct videobuf_buffer *vb)
{
struct soc_camera_device *icd = vq->priv_data;
struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
struct mx1_camera_dev *pcdev = ici->priv;
struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
unsigned long flags;

dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
vb, vb->baddr, vb->bsize);

spin_lock_irqsave(&pcdev->lock, flags);

list_add_tail(&vb->queue, &pcdev->capture);

vb->state = VIDEOBUF_ACTIVE;
Expand All @@ -264,8 +262,6 @@ static void mx1_videobuf_queue(struct videobuf_queue *vq,
__raw_writel(temp, pcdev->base + CSICR1);
}
}

spin_unlock_irqrestore(&pcdev->lock, flags);
}

static void mx1_videobuf_release(struct videobuf_queue *vq,
Expand Down
19 changes: 10 additions & 9 deletions trunk/drivers/media/video/mx3_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,10 @@ static enum pixel_fmt fourcc_to_ipu_pix(__u32 fourcc)
}
}

/* Called with .vb_lock held */
/*
* Called with .vb_lock mutex held and
* under spinlock_irqsave(&mx3_cam->lock, ...)
*/
static void mx3_videobuf_queue(struct videobuf_queue *vq,
struct videobuf_buffer *vb)
{
Expand All @@ -346,7 +349,8 @@ static void mx3_videobuf_queue(struct videobuf_queue *vq,
struct idmac_video_param *video = &ichan->params.video;
const struct soc_camera_data_format *data_fmt = icd->current_fmt;
dma_cookie_t cookie;
unsigned long flags;

BUG_ON(!irqs_disabled());

/* This is the configuration of one sg-element */
video->out_pixel_fmt = fourcc_to_ipu_pix(data_fmt->fourcc);
Expand All @@ -359,8 +363,6 @@ static void mx3_videobuf_queue(struct videobuf_queue *vq,
memset((void *)vb->baddr, 0xaa, vb->bsize);
#endif

spin_lock_irqsave(&mx3_cam->lock, flags);

list_add_tail(&vb->queue, &mx3_cam->capture);

if (!mx3_cam->active) {
Expand All @@ -370,24 +372,23 @@ static void mx3_videobuf_queue(struct videobuf_queue *vq,
vb->state = VIDEOBUF_QUEUED;
}

spin_unlock_irqrestore(&mx3_cam->lock, flags);
spin_unlock_irq(&mx3_cam->lock);

cookie = txd->tx_submit(txd);
dev_dbg(&icd->dev, "Submitted cookie %d DMA 0x%08x\n", cookie, sg_dma_address(&buf->sg));

spin_lock_irq(&mx3_cam->lock);

if (cookie >= 0)
return;

/* Submit error */
vb->state = VIDEOBUF_PREPARED;

spin_lock_irqsave(&mx3_cam->lock, flags);

list_del_init(&vb->queue);

if (mx3_cam->active == buf)
mx3_cam->active = NULL;

spin_unlock_irqrestore(&mx3_cam->lock, flags);
}

/* Called with .vb_lock held */
Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/media/video/pxa_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,29 +612,25 @@ static void pxa_camera_stop_capture(struct pxa_camera_dev *pcdev)
dev_dbg(pcdev->soc_host.dev, "%s\n", __func__);
}

/* Called under spinlock_irqsave(&pcdev->lock, ...) */
static void pxa_videobuf_queue(struct videobuf_queue *vq,
struct videobuf_buffer *vb)
{
struct soc_camera_device *icd = vq->priv_data;
struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
struct pxa_camera_dev *pcdev = ici->priv;
struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb);
unsigned long flags;

dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d active=%p\n", __func__,
vb, vb->baddr, vb->bsize, pcdev->active);

spin_lock_irqsave(&pcdev->lock, flags);

list_add_tail(&vb->queue, &pcdev->capture);

vb->state = VIDEOBUF_ACTIVE;
pxa_dma_add_tail_buf(pcdev, buf);

if (!pcdev->active)
pxa_camera_start_capture(pcdev);

spin_unlock_irqrestore(&pcdev->lock, flags);
}

static void pxa_videobuf_release(struct videobuf_queue *vq,
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/media/video/sh_mobile_ceu_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,27 +282,24 @@ static int sh_mobile_ceu_videobuf_prepare(struct videobuf_queue *vq,
return ret;
}

/* Called under spinlock_irqsave(&pcdev->lock, ...) */
static void sh_mobile_ceu_videobuf_queue(struct videobuf_queue *vq,
struct videobuf_buffer *vb)
{
struct soc_camera_device *icd = vq->priv_data;
struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
struct sh_mobile_ceu_dev *pcdev = ici->priv;
unsigned long flags;

dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__,
vb, vb->baddr, vb->bsize);

vb->state = VIDEOBUF_QUEUED;
spin_lock_irqsave(&pcdev->lock, flags);
list_add_tail(&vb->queue, &pcdev->capture);

if (!pcdev->active) {
pcdev->active = vb;
sh_mobile_ceu_capture(pcdev);
}

spin_unlock_irqrestore(&pcdev->lock, flags);
}

static void sh_mobile_ceu_videobuf_release(struct videobuf_queue *vq,
Expand Down

0 comments on commit c3135dd

Please sign in to comment.