Commit 933fd6e5 authored by Lad, Prabhakar's avatar Lad, Prabhakar Committed by Mauro Carvalho Chehab

[media] staging: media: davinci: vpfe: use v4l2_fh for priority handling

Signed-off-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 07002c05
...@@ -87,8 +87,6 @@ struct vpfe_fh { ...@@ -87,8 +87,6 @@ struct vpfe_fh {
struct vpfe_video_device *video; struct vpfe_video_device *video;
/* Indicates whether this file handle is doing IO */ /* Indicates whether this file handle is doing IO */
u8 io_allowed; u8 io_allowed;
/* Used to keep track priority of this instance */
enum v4l2_priority prio;
}; };
void mbus_to_pix(const struct v4l2_mbus_framefmt *mbus, void mbus_to_pix(const struct v4l2_mbus_framefmt *mbus,
......
...@@ -415,7 +415,6 @@ static int vpfe_open(struct file *file) ...@@ -415,7 +415,6 @@ static int vpfe_open(struct file *file)
video->usrs++; video->usrs++;
/* Set io_allowed member to false */ /* Set io_allowed member to false */
handle->io_allowed = 0; handle->io_allowed = 0;
v4l2_prio_open(&video->prio, &handle->prio);
handle->video = video; handle->video = video;
file->private_data = &handle->vfh; file->private_data = &handle->vfh;
mutex_unlock(&video->lock); mutex_unlock(&video->lock);
...@@ -532,8 +531,8 @@ static int vpfe_release(struct file *file) ...@@ -532,8 +531,8 @@ static int vpfe_release(struct file *file)
} }
/* Decrement device users counter */ /* Decrement device users counter */
video->usrs--; video->usrs--;
/* Close the priority */ v4l2_fh_del(&fh->vfh);
v4l2_prio_close(&video->prio, fh->prio); v4l2_fh_exit(&fh->vfh);
/* If this is the last file handle */ /* If this is the last file handle */
if (!video->usrs) if (!video->usrs)
video->initialized = 0; video->initialized = 0;
...@@ -1590,8 +1589,6 @@ int vpfe_video_init(struct vpfe_video_device *video, const char *name) ...@@ -1590,8 +1589,6 @@ int vpfe_video_init(struct vpfe_video_device *video, const char *name)
snprintf(video->video_dev.name, sizeof(video->video_dev.name), snprintf(video->video_dev.name, sizeof(video->video_dev.name),
"DAVINCI VIDEO %s %s", name, direction); "DAVINCI VIDEO %s %s", name, direction);
/* Initialize prio member of device object */
v4l2_prio_init(&video->prio);
spin_lock_init(&video->irqlock); spin_lock_init(&video->irqlock);
spin_lock_init(&video->dma_queue_lock); spin_lock_init(&video->dma_queue_lock);
mutex_init(&video->lock); mutex_init(&video->lock);
...@@ -1600,6 +1597,7 @@ int vpfe_video_init(struct vpfe_video_device *video, const char *name) ...@@ -1600,6 +1597,7 @@ int vpfe_video_init(struct vpfe_video_device *video, const char *name)
if (ret < 0) if (ret < 0)
return ret; return ret;
set_bit(V4L2_FL_USE_FH_PRIO, &video->video_dev.flags);
video_set_drvdata(&video->video_dev, video); video_set_drvdata(&video->video_dev, video);
return 0; return 0;
......
...@@ -102,8 +102,6 @@ struct vpfe_video_device { ...@@ -102,8 +102,6 @@ struct vpfe_video_device {
* user has selected * user has selected
*/ */
enum v4l2_memory memory; enum v4l2_memory memory;
/* Used to keep track of state of the priority */
struct v4l2_prio_state prio;
/* number of open instances of the channel */ /* number of open instances of the channel */
u32 usrs; u32 usrs;
/* flag to indicate whether decoder is initialized */ /* flag to indicate whether decoder is initialized */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment