Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366963
b: refs/heads/master
c: 9ea89e2
h: refs/heads/master
i:
  366961: ebfe82e
  366959: 94fe044
v: v3
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Apr 4, 2013
1 parent f4992fa commit c9d9f08
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 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: 439797980af4bddfc2b86a44ddb573c5e48a1fcc
refs/heads/master: 9ea89e2b62c70f3986c89363818a89c8c11c96c4
18 changes: 13 additions & 5 deletions trunk/drivers/media/platform/exynos4-is/fimc-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,18 @@ static int fimc_capture_open(struct file *file)
static int fimc_capture_release(struct file *file)
{
struct fimc_dev *fimc = video_drvdata(file);
struct fimc_vid_cap *vc = &fimc->vid_cap;
int ret;

dbg("pid: %d, state: 0x%lx", task_pid_nr(current), fimc->state);

mutex_lock(&fimc->lock);

if (v4l2_fh_is_singular_file(file)) {
if (vc->streaming) {
media_entity_pipeline_stop(&vc->vfd.entity);
vc->streaming = false;
}
clear_bit(ST_CAPT_BUSY, &fimc->state);
fimc_stop_capture(fimc, false);
fimc_pipeline_call(fimc, close, &fimc->pipeline);
Expand Down Expand Up @@ -1243,8 +1248,10 @@ static int fimc_cap_streamon(struct file *file, void *priv,
}

ret = vb2_ioctl_streamon(file, priv, type);
if (!ret)
if (!ret) {
vc->streaming = true;
return ret;
}

err_p_stop:
media_entity_pipeline_stop(entity);
Expand All @@ -1258,11 +1265,12 @@ static int fimc_cap_streamoff(struct file *file, void *priv,
int ret;

ret = vb2_ioctl_streamoff(file, priv, type);
if (ret < 0)
return ret;

if (ret == 0)
media_entity_pipeline_stop(&fimc->vid_cap.vfd.entity);

return ret;
media_entity_pipeline_stop(&fimc->vid_cap.vfd.entity);
fimc->vid_cap.streaming = false;
return 0;
}

static int fimc_cap_reqbufs(struct file *file, void *priv,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/platform/exynos4-is/fimc-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ struct fimc_vid_cap {
int buf_index;
unsigned int frame_count;
unsigned int reqbufs_count;
bool streaming;
int input_index;
int refcnt;
u32 input;
Expand Down
18 changes: 14 additions & 4 deletions trunk/drivers/media/platform/exynos4-is/fimc-lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ static int fimc_lite_release(struct file *file)

if (v4l2_fh_is_singular_file(file) &&
atomic_read(&fimc->out_path) == FIMC_IO_DMA) {
if (fimc->streaming) {
media_entity_pipeline_stop(&fimc->vfd.entity);
fimc->streaming = false;
}
clear_bit(ST_FLITE_IN_USE, &fimc->state);
fimc_lite_stop_capture(fimc, false);
fimc_pipeline_call(fimc, close, &fimc->pipeline);
Expand Down Expand Up @@ -798,8 +802,11 @@ static int fimc_lite_streamon(struct file *file, void *priv,
goto err_p_stop;

ret = vb2_ioctl_streamon(file, priv, type);
if (!ret)
if (!ret) {
fimc->streaming = true;
return ret;
}

err_p_stop:
media_entity_pipeline_stop(entity);
return 0;
Expand All @@ -812,9 +819,12 @@ static int fimc_lite_streamoff(struct file *file, void *priv,
int ret;

ret = vb2_ioctl_streamoff(file, priv, type);
if (ret == 0)
media_entity_pipeline_stop(&fimc->vfd.entity);
return ret;
if (ret < 0)
return ret;

media_entity_pipeline_stop(&fimc->vfd.entity);
fimc->streaming = false;
return 0;
}

static int fimc_lite_reqbufs(struct file *file, void *priv,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/platform/exynos4-is/fimc-lite.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ struct fimc_lite {
int ref_count;

struct fimc_lite_events events;
bool streaming;
};

static inline bool fimc_lite_active(struct fimc_lite *fimc)
Expand Down

0 comments on commit c9d9f08

Please sign in to comment.