diff options
Diffstat (limited to 'drivers/media/pci/saa7134/saa7134-video.c')
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-video.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c index 3abf52711e13..7c503fb68526 100644 --- a/drivers/media/pci/saa7134/saa7134-video.c +++ b/drivers/media/pci/saa7134/saa7134-video.c | |||
@@ -2248,6 +2248,17 @@ static int saa7134_streamon(struct file *file, void *priv, | |||
2248 | if (!res_get(dev, fh, res)) | 2248 | if (!res_get(dev, fh, res)) |
2249 | return -EBUSY; | 2249 | return -EBUSY; |
2250 | 2250 | ||
2251 | /* The SAA7134 has a 1K FIFO; the datasheet suggests that when | ||
2252 | * configured conservatively, there's 22 usec of buffering for video. | ||
2253 | * We therefore request a DMA latency of 20 usec, giving us 2 usec of | ||
2254 | * margin in case the FIFO is configured differently to the datasheet. | ||
2255 | * Unfortunately, I lack register-level documentation to check the | ||
2256 | * Linux FIFO setup and confirm the perfect value. | ||
2257 | */ | ||
2258 | pm_qos_add_request(&fh->qos_request, | ||
2259 | PM_QOS_CPU_DMA_LATENCY, | ||
2260 | 20); | ||
2261 | |||
2251 | return videobuf_streamon(saa7134_queue(fh)); | 2262 | return videobuf_streamon(saa7134_queue(fh)); |
2252 | } | 2263 | } |
2253 | 2264 | ||
@@ -2259,6 +2270,8 @@ static int saa7134_streamoff(struct file *file, void *priv, | |||
2259 | struct saa7134_dev *dev = fh->dev; | 2270 | struct saa7134_dev *dev = fh->dev; |
2260 | int res = saa7134_resource(fh); | 2271 | int res = saa7134_resource(fh); |
2261 | 2272 | ||
2273 | pm_qos_remove_request(&fh->qos_request); | ||
2274 | |||
2262 | err = videobuf_streamoff(saa7134_queue(fh)); | 2275 | err = videobuf_streamoff(saa7134_queue(fh)); |
2263 | if (err < 0) | 2276 | if (err < 0) |
2264 | return err; | 2277 | return err; |