Commit 8eb1fdff authored by Leonid V. Fedorenchik's avatar Leonid V. Fedorenchik Committed by Mauro Carvalho Chehab

[media] cx25821-video-upstream.c: Change line endings

Change obscure line endings to less obscure ones. (improve readability)
Signed-off-by: default avatarLeonid V. Fedorenchik <leonidsbox@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2c68e933
...@@ -194,15 +194,12 @@ int cx25821_risc_buffer_upstream(struct cx25821_dev *dev, ...@@ -194,15 +194,12 @@ int cx25821_risc_buffer_upstream(struct cx25821_dev *dev,
if (dev->_isNTSC) { if (dev->_isNTSC) {
odd_num_lines = singlefield_lines + 1; odd_num_lines = singlefield_lines + 1;
risc_program_size = FRAME1_VID_PROG_SIZE; risc_program_size = FRAME1_VID_PROG_SIZE;
frame_size = frame_size = (bpl == Y411_LINE_SZ) ?
(bpl == FRAME_SIZE_NTSC_Y411 : FRAME_SIZE_NTSC_Y422;
Y411_LINE_SZ) ? FRAME_SIZE_NTSC_Y411 :
FRAME_SIZE_NTSC_Y422;
} else { } else {
risc_program_size = PAL_VID_PROG_SIZE; risc_program_size = PAL_VID_PROG_SIZE;
frame_size = frame_size = (bpl == Y411_LINE_SZ) ?
(bpl == FRAME_SIZE_PAL_Y411 : FRAME_SIZE_PAL_Y422;
Y411_LINE_SZ) ? FRAME_SIZE_PAL_Y411 : FRAME_SIZE_PAL_Y422;
} }
/* Virtual address of Risc buffer program */ /* Virtual address of Risc buffer program */
...@@ -230,8 +227,8 @@ int cx25821_risc_buffer_upstream(struct cx25821_dev *dev, ...@@ -230,8 +227,8 @@ int cx25821_risc_buffer_upstream(struct cx25821_dev *dev,
if (frame == 0) { if (frame == 0) {
risc_flag = RISC_CNT_RESET; risc_flag = RISC_CNT_RESET;
risc_phys_jump_addr = risc_phys_jump_addr = dev->_dma_phys_start_addr +
dev->_dma_phys_start_addr + risc_program_size; risc_program_size;
} else { } else {
risc_phys_jump_addr = dev->_dma_phys_start_addr; risc_phys_jump_addr = dev->_dma_phys_start_addr;
risc_flag = RISC_CNT_INC; risc_flag = RISC_CNT_INC;
...@@ -308,9 +305,8 @@ int cx25821_get_frame(struct cx25821_dev *dev, struct sram_channel *sram_ch) ...@@ -308,9 +305,8 @@ int cx25821_get_frame(struct cx25821_dev *dev, struct sram_channel *sram_ch)
struct file *myfile; struct file *myfile;
int frame_index_temp = dev->_frame_index; int frame_index_temp = dev->_frame_index;
int i = 0; int i = 0;
int line_size = int line_size = (dev->_pixel_format == PIXEL_FRMT_411) ?
(dev->_pixel_format == Y411_LINE_SZ : Y422_LINE_SZ;
PIXEL_FRMT_411) ? Y411_LINE_SZ : Y422_LINE_SZ;
int frame_size = 0; int frame_size = 0;
int frame_offset = 0; int frame_offset = 0;
ssize_t vfs_read_retval = 0; ssize_t vfs_read_retval = 0;
...@@ -361,8 +357,8 @@ int cx25821_get_frame(struct cx25821_dev *dev, struct sram_channel *sram_ch) ...@@ -361,8 +357,8 @@ int cx25821_get_frame(struct cx25821_dev *dev, struct sram_channel *sram_ch)
for (i = 0; i < dev->_lines_count; i++) { for (i = 0; i < dev->_lines_count; i++) {
pos = file_offset; pos = file_offset;
vfs_read_retval = vfs_read_retval = vfs_read(myfile, mybuf, line_size,
vfs_read(myfile, mybuf, line_size, &pos); &pos);
if (vfs_read_retval > 0 && vfs_read_retval == line_size if (vfs_read_retval > 0 && vfs_read_retval == line_size
&& dev->_data_buf_virt_addr != NULL) { && dev->_data_buf_virt_addr != NULL) {
...@@ -384,8 +380,8 @@ int cx25821_get_frame(struct cx25821_dev *dev, struct sram_channel *sram_ch) ...@@ -384,8 +380,8 @@ int cx25821_get_frame(struct cx25821_dev *dev, struct sram_channel *sram_ch)
if (i > 0) if (i > 0)
dev->_frame_count++; dev->_frame_count++;
dev->_file_status = dev->_file_status = (vfs_read_retval == line_size) ?
(vfs_read_retval == line_size) ? IN_PROGRESS : END_OF_FILE; IN_PROGRESS : END_OF_FILE;
set_fs(old_fs); set_fs(old_fs);
filp_close(myfile, NULL); filp_close(myfile, NULL);
...@@ -396,8 +392,8 @@ int cx25821_get_frame(struct cx25821_dev *dev, struct sram_channel *sram_ch) ...@@ -396,8 +392,8 @@ int cx25821_get_frame(struct cx25821_dev *dev, struct sram_channel *sram_ch)
static void cx25821_vidups_handler(struct work_struct *work) static void cx25821_vidups_handler(struct work_struct *work)
{ {
struct cx25821_dev *dev = struct cx25821_dev *dev = container_of(work, struct cx25821_dev,
container_of(work, struct cx25821_dev, _irq_work_entry); _irq_work_entry);
if (!dev) { if (!dev) {
pr_err("ERROR %s(): since container_of(work_struct) FAILED!\n", pr_err("ERROR %s(): since container_of(work_struct) FAILED!\n",
...@@ -405,18 +401,16 @@ static void cx25821_vidups_handler(struct work_struct *work) ...@@ -405,18 +401,16 @@ static void cx25821_vidups_handler(struct work_struct *work)
return; return;
} }
cx25821_get_frame(dev, cx25821_get_frame(dev, dev->channels[dev->_channel_upstream_select].
dev->channels[dev->_channel_upstream_select]. sram_channels);
sram_channels);
} }
int cx25821_openfile(struct cx25821_dev *dev, struct sram_channel *sram_ch) int cx25821_openfile(struct cx25821_dev *dev, struct sram_channel *sram_ch)
{ {
struct file *myfile; struct file *myfile;
int i = 0, j = 0; int i = 0, j = 0;
int line_size = int line_size = (dev->_pixel_format == PIXEL_FRMT_411) ?
(dev->_pixel_format == Y411_LINE_SZ : Y422_LINE_SZ;
PIXEL_FRMT_411) ? Y411_LINE_SZ : Y422_LINE_SZ;
ssize_t vfs_read_retval = 0; ssize_t vfs_read_retval = 0;
char mybuf[line_size]; char mybuf[line_size];
loff_t pos; loff_t pos;
...@@ -453,8 +447,8 @@ int cx25821_openfile(struct cx25821_dev *dev, struct sram_channel *sram_ch) ...@@ -453,8 +447,8 @@ int cx25821_openfile(struct cx25821_dev *dev, struct sram_channel *sram_ch)
for (i = 0; i < dev->_lines_count; i++) { for (i = 0; i < dev->_lines_count; i++) {
pos = offset; pos = offset;
vfs_read_retval = vfs_read_retval = vfs_read(myfile, mybuf,
vfs_read(myfile, mybuf, line_size, &pos); line_size, &pos);
if (vfs_read_retval > 0 if (vfs_read_retval > 0
&& vfs_read_retval == line_size && vfs_read_retval == line_size
...@@ -481,8 +475,8 @@ int cx25821_openfile(struct cx25821_dev *dev, struct sram_channel *sram_ch) ...@@ -481,8 +475,8 @@ int cx25821_openfile(struct cx25821_dev *dev, struct sram_channel *sram_ch)
break; break;
} }
dev->_file_status = dev->_file_status = (vfs_read_retval == line_size) ?
(vfs_read_retval == line_size) ? IN_PROGRESS : END_OF_FILE; IN_PROGRESS : END_OF_FILE;
set_fs(old_fs); set_fs(old_fs);
myfile->f_pos = 0; myfile->f_pos = 0;
...@@ -503,9 +497,8 @@ int cx25821_upstream_buffer_prepare(struct cx25821_dev *dev, ...@@ -503,9 +497,8 @@ int cx25821_upstream_buffer_prepare(struct cx25821_dev *dev,
pci_free_consistent(dev->pci, dev->upstream_riscbuf_size, pci_free_consistent(dev->pci, dev->upstream_riscbuf_size,
dev->_dma_virt_addr, dev->_dma_phys_addr); dev->_dma_virt_addr, dev->_dma_phys_addr);
dev->_dma_virt_addr = dev->_dma_virt_addr = pci_alloc_consistent(dev->pci,
pci_alloc_consistent(dev->pci, dev->upstream_riscbuf_size, dev->upstream_riscbuf_size, &dma_addr);
&dma_addr);
dev->_dma_virt_start_addr = dev->_dma_virt_addr; dev->_dma_virt_start_addr = dev->_dma_virt_addr;
dev->_dma_phys_start_addr = dma_addr; dev->_dma_phys_start_addr = dma_addr;
dev->_dma_phys_addr = dma_addr; dev->_dma_phys_addr = dma_addr;
...@@ -524,9 +517,8 @@ int cx25821_upstream_buffer_prepare(struct cx25821_dev *dev, ...@@ -524,9 +517,8 @@ int cx25821_upstream_buffer_prepare(struct cx25821_dev *dev,
dev->_data_buf_virt_addr, dev->_data_buf_virt_addr,
dev->_data_buf_phys_addr); dev->_data_buf_phys_addr);
/* For Video Data buffer allocation */ /* For Video Data buffer allocation */
dev->_data_buf_virt_addr = dev->_data_buf_virt_addr = pci_alloc_consistent(dev->pci,
pci_alloc_consistent(dev->pci, dev->upstream_databuf_size, dev->upstream_databuf_size, &data_dma_addr);
&data_dma_addr);
dev->_data_buf_phys_addr = data_dma_addr; dev->_data_buf_phys_addr = data_dma_addr;
dev->_data_buf_size = dev->upstream_databuf_size; dev->_data_buf_size = dev->upstream_databuf_size;
...@@ -543,9 +535,8 @@ int cx25821_upstream_buffer_prepare(struct cx25821_dev *dev, ...@@ -543,9 +535,8 @@ int cx25821_upstream_buffer_prepare(struct cx25821_dev *dev,
return ret; return ret;
/* Create RISC programs */ /* Create RISC programs */
ret = ret = cx25821_risc_buffer_upstream(dev, dev->pci, 0, bpl,
cx25821_risc_buffer_upstream(dev, dev->pci, 0, bpl, dev->_lines_count);
dev->_lines_count);
if (ret < 0) { if (ret < 0) {
pr_info("Failed creating Video Upstream Risc programs!\n"); pr_info("Failed creating Video Upstream Risc programs!\n");
goto error; goto error;
...@@ -736,8 +727,7 @@ int cx25821_start_video_dma_upstream(struct cx25821_dev *dev, ...@@ -736,8 +727,7 @@ int cx25821_start_video_dma_upstream(struct cx25821_dev *dev,
tmp = cx_read(sram_ch->int_msk); tmp = cx_read(sram_ch->int_msk);
cx_write(sram_ch->int_msk, tmp |= _intr_msk); cx_write(sram_ch->int_msk, tmp |= _intr_msk);
err = err = request_irq(dev->pci->irq, cx25821_upstream_irq,
request_irq(dev->pci->irq, cx25821_upstream_irq,
IRQF_SHARED, dev->name, dev); IRQF_SHARED, dev->name, dev);
if (err < 0) { if (err < 0) {
pr_err("%s: can't get upstream IRQ %d\n", pr_err("%s: can't get upstream IRQ %d\n",
...@@ -796,12 +786,11 @@ int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select, ...@@ -796,12 +786,11 @@ int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select,
dev->_file_status = RESET_STATUS; dev->_file_status = RESET_STATUS;
dev->_lines_count = dev->_isNTSC ? 480 : 576; dev->_lines_count = dev->_isNTSC ? 480 : 576;
dev->_pixel_format = pixel_format; dev->_pixel_format = pixel_format;
dev->_line_size = dev->_line_size = (dev->_pixel_format == PIXEL_FRMT_422) ?
(dev->_pixel_format == (WIDTH_D1 * 2) : (WIDTH_D1 * 3) / 2;
PIXEL_FRMT_422) ? (WIDTH_D1 * 2) : (WIDTH_D1 * 3) / 2;
data_frame_size = dev->_isNTSC ? NTSC_DATA_BUF_SZ : PAL_DATA_BUF_SZ; data_frame_size = dev->_isNTSC ? NTSC_DATA_BUF_SZ : PAL_DATA_BUF_SZ;
risc_buffer_size = risc_buffer_size = dev->_isNTSC ?
dev->_isNTSC ? NTSC_RISC_BUF_SIZE : PAL_RISC_BUF_SIZE; NTSC_RISC_BUF_SIZE : PAL_RISC_BUF_SIZE;
if (dev->input_filename) { if (dev->input_filename) {
str_length = strlen(dev->input_filename); str_length = strlen(dev->input_filename);
...@@ -839,13 +828,11 @@ int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select, ...@@ -839,13 +828,11 @@ int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select,
dev->_file_status = RESET_STATUS; dev->_file_status = RESET_STATUS;
dev->_lines_count = dev->_isNTSC ? 480 : 576; dev->_lines_count = dev->_isNTSC ? 480 : 576;
dev->_pixel_format = pixel_format; dev->_pixel_format = pixel_format;
dev->_line_size = dev->_line_size = (dev->_pixel_format == PIXEL_FRMT_422) ?
(dev->_pixel_format == (WIDTH_D1 * 2) : (WIDTH_D1 * 3) / 2;
PIXEL_FRMT_422) ? (WIDTH_D1 * 2) : (WIDTH_D1 * 3) / 2;
retval = retval = cx25821_sram_channel_setup_upstream(dev, sram_ch,
cx25821_sram_channel_setup_upstream(dev, sram_ch, dev->_line_size, dev->_line_size, 0);
0);
/* setup fifo + format */ /* setup fifo + format */
cx25821_set_pixelengine(dev, sram_ch, dev->_pixel_format); cx25821_set_pixelengine(dev, sram_ch, dev->_pixel_format);
......
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