Commit 1a0c10ed authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Mauro Carvalho Chehab

media: dvb-usb-v2: stop using coherent memory for URBs

There's no need to use coherent buffers there. So, let the
DVB core do the allocation. That should give some performance
gain outside x86.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 14f4eaed
...@@ -155,8 +155,7 @@ static int usb_urb_alloc_bulk_urbs(struct usb_data_stream *stream) ...@@ -155,8 +155,7 @@ static int usb_urb_alloc_bulk_urbs(struct usb_data_stream *stream)
stream->props.u.bulk.buffersize, stream->props.u.bulk.buffersize,
usb_urb_complete, stream); usb_urb_complete, stream);
stream->urb_list[i]->transfer_flags = URB_NO_TRANSFER_DMA_MAP; stream->urb_list[i]->transfer_flags = URB_FREE_BUFFER;
stream->urb_list[i]->transfer_dma = stream->dma_addr[i];
stream->urbs_initialized++; stream->urbs_initialized++;
} }
return 0; return 0;
...@@ -187,13 +186,12 @@ static int usb_urb_alloc_isoc_urbs(struct usb_data_stream *stream) ...@@ -187,13 +186,12 @@ static int usb_urb_alloc_isoc_urbs(struct usb_data_stream *stream)
urb->complete = usb_urb_complete; urb->complete = usb_urb_complete;
urb->pipe = usb_rcvisocpipe(stream->udev, urb->pipe = usb_rcvisocpipe(stream->udev,
stream->props.endpoint); stream->props.endpoint);
urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; urb->transfer_flags = URB_ISO_ASAP | URB_FREE_BUFFER;
urb->interval = stream->props.u.isoc.interval; urb->interval = stream->props.u.isoc.interval;
urb->number_of_packets = stream->props.u.isoc.framesperurb; urb->number_of_packets = stream->props.u.isoc.framesperurb;
urb->transfer_buffer_length = stream->props.u.isoc.framesize * urb->transfer_buffer_length = stream->props.u.isoc.framesize *
stream->props.u.isoc.framesperurb; stream->props.u.isoc.framesperurb;
urb->transfer_buffer = stream->buf_list[i]; urb->transfer_buffer = stream->buf_list[i];
urb->transfer_dma = stream->dma_addr[i];
for (j = 0; j < stream->props.u.isoc.framesperurb; j++) { for (j = 0; j < stream->props.u.isoc.framesperurb; j++) {
urb->iso_frame_desc[j].offset = frame_offset; urb->iso_frame_desc[j].offset = frame_offset;
...@@ -212,11 +210,7 @@ static int usb_free_stream_buffers(struct usb_data_stream *stream) ...@@ -212,11 +210,7 @@ static int usb_free_stream_buffers(struct usb_data_stream *stream)
if (stream->state & USB_STATE_URB_BUF) { if (stream->state & USB_STATE_URB_BUF) {
while (stream->buf_num) { while (stream->buf_num) {
stream->buf_num--; stream->buf_num--;
dev_dbg(&stream->udev->dev, "%s: free buf=%d\n", stream->buf_list[stream->buf_num] = NULL;
__func__, stream->buf_num);
usb_free_coherent(stream->udev, stream->buf_size,
stream->buf_list[stream->buf_num],
stream->dma_addr[stream->buf_num]);
} }
} }
...@@ -236,9 +230,7 @@ static int usb_alloc_stream_buffers(struct usb_data_stream *stream, int num, ...@@ -236,9 +230,7 @@ static int usb_alloc_stream_buffers(struct usb_data_stream *stream, int num,
__func__, num * size); __func__, num * size);
for (stream->buf_num = 0; stream->buf_num < num; stream->buf_num++) { for (stream->buf_num = 0; stream->buf_num < num; stream->buf_num++) {
stream->buf_list[stream->buf_num] = usb_alloc_coherent( stream->buf_list[stream->buf_num] = kzalloc(size, GFP_ATOMIC);
stream->udev, size, GFP_ATOMIC,
&stream->dma_addr[stream->buf_num]);
if (!stream->buf_list[stream->buf_num]) { if (!stream->buf_list[stream->buf_num]) {
dev_dbg(&stream->udev->dev, "%s: alloc buf=%d failed\n", dev_dbg(&stream->udev->dev, "%s: alloc buf=%d failed\n",
__func__, stream->buf_num); __func__, stream->buf_num);
...@@ -250,7 +242,6 @@ static int usb_alloc_stream_buffers(struct usb_data_stream *stream, int num, ...@@ -250,7 +242,6 @@ static int usb_alloc_stream_buffers(struct usb_data_stream *stream, int num,
__func__, stream->buf_num, __func__, stream->buf_num,
stream->buf_list[stream->buf_num], stream->buf_list[stream->buf_num],
(long long)stream->dma_addr[stream->buf_num]); (long long)stream->dma_addr[stream->buf_num]);
memset(stream->buf_list[stream->buf_num], 0, size);
stream->state |= USB_STATE_URB_BUF; stream->state |= USB_STATE_URB_BUF;
} }
......
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