Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (42 commits)
[media] media: vb2: correct queue initialization order
[media] media: vb2: fix incorrect v4l2_buffer->flags handling
[media] s5p-fimc: Add support for the buffer timestamps and sequence
[media] s5p-fimc: Fix bytesperline and plane payload setup
[media] s5p-fimc: Do not allow changing format after REQBUFS
[media] s5p-fimc: Fix FIMC3 pixel limits on Exynos4
[media] tda18271: update tda18271c2_rf_cal as per NXP's rev.04 datasheet
[media] tda18271: update tda18271_rf_band as per NXP's rev.04 datasheet
[media] tda18271: fix bad calculation of main post divider byte
[media] tda18271: prog_cal and prog_tab variables should be s32, not u8
[media] tda18271: fix calculation bug in tda18271_rf_tracking_filters_init
[media] omap3isp: queue: Don't corrupt buf->npages when get_user_pages() fails
[media] v4l: Don't register media entities for subdev device nodes
[media] omap3isp: Don't increment node entity use count when poweron fails
[media] omap3isp: lane shifter support
[media] omap3isp: ccdc: support Y10/12, 8-bit bayer fmts
[media] media: add missing 8-bit bayer formats and Y12
[media] v4l: add V4L2_PIX_FMT_Y12 format
cx23885: Fix stv0367 Kconfig dependency
[media] omap3isp: Use isp xclk defines
...

Fix up trivial conflict (spelink errurs) in drivers/media/video/omap3isp/isp.c

+512 -152
+1
Documentation/DocBook/media-entities.tmpl
··· 294 294 <!ENTITY sub-srggb10 SYSTEM "v4l/pixfmt-srggb10.xml"> 295 295 <!ENTITY sub-srggb8 SYSTEM "v4l/pixfmt-srggb8.xml"> 296 296 <!ENTITY sub-y10 SYSTEM "v4l/pixfmt-y10.xml"> 297 + <!ENTITY sub-y12 SYSTEM "v4l/pixfmt-y12.xml"> 297 298 <!ENTITY sub-pixfmt SYSTEM "v4l/pixfmt.xml"> 298 299 <!ENTITY sub-cropcap SYSTEM "v4l/vidioc-cropcap.xml"> 299 300 <!ENTITY sub-dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml">
+1 -1
Documentation/DocBook/v4l/media-ioc-setup-link.xml
··· 34 34 <varlistentry> 35 35 <term><parameter>request</parameter></term> 36 36 <listitem> 37 - <para>MEDIA_IOC_ENUM_LINKS</para> 37 + <para>MEDIA_IOC_SETUP_LINK</para> 38 38 </listitem> 39 39 </varlistentry> 40 40 <varlistentry>
+79
Documentation/DocBook/v4l/pixfmt-y12.xml
··· 1 + <refentry id="V4L2-PIX-FMT-Y12"> 2 + <refmeta> 3 + <refentrytitle>V4L2_PIX_FMT_Y12 ('Y12 ')</refentrytitle> 4 + &manvol; 5 + </refmeta> 6 + <refnamediv> 7 + <refname><constant>V4L2_PIX_FMT_Y12</constant></refname> 8 + <refpurpose>Grey-scale image</refpurpose> 9 + </refnamediv> 10 + <refsect1> 11 + <title>Description</title> 12 + 13 + <para>This is a grey-scale image with a depth of 12 bits per pixel. Pixels 14 + are stored in 16-bit words with unused high bits padded with 0. The least 15 + significant byte is stored at lower memory addresses (little-endian).</para> 16 + 17 + <example> 18 + <title><constant>V4L2_PIX_FMT_Y12</constant> 4 &times; 4 19 + pixel image</title> 20 + 21 + <formalpara> 22 + <title>Byte Order.</title> 23 + <para>Each cell is one byte. 24 + <informaltable frame="none"> 25 + <tgroup cols="9" align="center"> 26 + <colspec align="left" colwidth="2*" /> 27 + <tbody valign="top"> 28 + <row> 29 + <entry>start&nbsp;+&nbsp;0:</entry> 30 + <entry>Y'<subscript>00low</subscript></entry> 31 + <entry>Y'<subscript>00high</subscript></entry> 32 + <entry>Y'<subscript>01low</subscript></entry> 33 + <entry>Y'<subscript>01high</subscript></entry> 34 + <entry>Y'<subscript>02low</subscript></entry> 35 + <entry>Y'<subscript>02high</subscript></entry> 36 + <entry>Y'<subscript>03low</subscript></entry> 37 + <entry>Y'<subscript>03high</subscript></entry> 38 + </row> 39 + <row> 40 + <entry>start&nbsp;+&nbsp;8:</entry> 41 + <entry>Y'<subscript>10low</subscript></entry> 42 + <entry>Y'<subscript>10high</subscript></entry> 43 + <entry>Y'<subscript>11low</subscript></entry> 44 + <entry>Y'<subscript>11high</subscript></entry> 45 + <entry>Y'<subscript>12low</subscript></entry> 46 + <entry>Y'<subscript>12high</subscript></entry> 47 + <entry>Y'<subscript>13low</subscript></entry> 48 + <entry>Y'<subscript>13high</subscript></entry> 49 + </row> 50 + <row> 51 + <entry>start&nbsp;+&nbsp;16:</entry> 52 + <entry>Y'<subscript>20low</subscript></entry> 53 + <entry>Y'<subscript>20high</subscript></entry> 54 + <entry>Y'<subscript>21low</subscript></entry> 55 + <entry>Y'<subscript>21high</subscript></entry> 56 + <entry>Y'<subscript>22low</subscript></entry> 57 + <entry>Y'<subscript>22high</subscript></entry> 58 + <entry>Y'<subscript>23low</subscript></entry> 59 + <entry>Y'<subscript>23high</subscript></entry> 60 + </row> 61 + <row> 62 + <entry>start&nbsp;+&nbsp;24:</entry> 63 + <entry>Y'<subscript>30low</subscript></entry> 64 + <entry>Y'<subscript>30high</subscript></entry> 65 + <entry>Y'<subscript>31low</subscript></entry> 66 + <entry>Y'<subscript>31high</subscript></entry> 67 + <entry>Y'<subscript>32low</subscript></entry> 68 + <entry>Y'<subscript>32high</subscript></entry> 69 + <entry>Y'<subscript>33low</subscript></entry> 70 + <entry>Y'<subscript>33high</subscript></entry> 71 + </row> 72 + </tbody> 73 + </tgroup> 74 + </informaltable> 75 + </para> 76 + </formalpara> 77 + </example> 78 + </refsect1> 79 + </refentry>
+1
Documentation/DocBook/v4l/pixfmt.xml
··· 696 696 &sub-packed-yuv; 697 697 &sub-grey; 698 698 &sub-y10; 699 + &sub-y12; 699 700 &sub-y16; 700 701 &sub-yuyv; 701 702 &sub-uyvy;
+59
Documentation/DocBook/v4l/subdev-formats.xml
··· 456 456 <entry>b<subscript>1</subscript></entry> 457 457 <entry>b<subscript>0</subscript></entry> 458 458 </row> 459 + <row id="V4L2-MBUS-FMT-SGBRG8-1X8"> 460 + <entry>V4L2_MBUS_FMT_SGBRG8_1X8</entry> 461 + <entry>0x3013</entry> 462 + <entry></entry> 463 + <entry>-</entry> 464 + <entry>-</entry> 465 + <entry>-</entry> 466 + <entry>-</entry> 467 + <entry>g<subscript>7</subscript></entry> 468 + <entry>g<subscript>6</subscript></entry> 469 + <entry>g<subscript>5</subscript></entry> 470 + <entry>g<subscript>4</subscript></entry> 471 + <entry>g<subscript>3</subscript></entry> 472 + <entry>g<subscript>2</subscript></entry> 473 + <entry>g<subscript>1</subscript></entry> 474 + <entry>g<subscript>0</subscript></entry> 475 + </row> 459 476 <row id="V4L2-MBUS-FMT-SGRBG8-1X8"> 460 477 <entry>V4L2_MBUS_FMT_SGRBG8_1X8</entry> 461 478 <entry>0x3002</entry> ··· 489 472 <entry>g<subscript>2</subscript></entry> 490 473 <entry>g<subscript>1</subscript></entry> 491 474 <entry>g<subscript>0</subscript></entry> 475 + </row> 476 + <row id="V4L2-MBUS-FMT-SRGGB8-1X8"> 477 + <entry>V4L2_MBUS_FMT_SRGGB8_1X8</entry> 478 + <entry>0x3014</entry> 479 + <entry></entry> 480 + <entry>-</entry> 481 + <entry>-</entry> 482 + <entry>-</entry> 483 + <entry>-</entry> 484 + <entry>r<subscript>7</subscript></entry> 485 + <entry>r<subscript>6</subscript></entry> 486 + <entry>r<subscript>5</subscript></entry> 487 + <entry>r<subscript>4</subscript></entry> 488 + <entry>r<subscript>3</subscript></entry> 489 + <entry>r<subscript>2</subscript></entry> 490 + <entry>r<subscript>1</subscript></entry> 491 + <entry>r<subscript>0</subscript></entry> 492 492 </row> 493 493 <row id="V4L2-MBUS-FMT-SBGGR10-DPCM8-1X8"> 494 494 <entry>V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8</entry> ··· 2192 2158 <entry>u<subscript>2</subscript></entry> 2193 2159 <entry>u<subscript>1</subscript></entry> 2194 2160 <entry>u<subscript>0</subscript></entry> 2161 + </row> 2162 + <row id="V4L2-MBUS-FMT-Y12-1X12"> 2163 + <entry>V4L2_MBUS_FMT_Y12_1X12</entry> 2164 + <entry>0x2013</entry> 2165 + <entry></entry> 2166 + <entry>-</entry> 2167 + <entry>-</entry> 2168 + <entry>-</entry> 2169 + <entry>-</entry> 2170 + <entry>-</entry> 2171 + <entry>-</entry> 2172 + <entry>-</entry> 2173 + <entry>-</entry> 2174 + <entry>y<subscript>11</subscript></entry> 2175 + <entry>y<subscript>10</subscript></entry> 2176 + <entry>y<subscript>9</subscript></entry> 2177 + <entry>y<subscript>8</subscript></entry> 2178 + <entry>y<subscript>7</subscript></entry> 2179 + <entry>y<subscript>6</subscript></entry> 2180 + <entry>y<subscript>5</subscript></entry> 2181 + <entry>y<subscript>4</subscript></entry> 2182 + <entry>y<subscript>3</subscript></entry> 2183 + <entry>y<subscript>2</subscript></entry> 2184 + <entry>y<subscript>1</subscript></entry> 2185 + <entry>y<subscript>0</subscript></entry> 2195 2186 </row> 2196 2187 <row id="V4L2-MBUS-FMT-UYVY8-1X16"> 2197 2188 <entry>V4L2_MBUS_FMT_UYVY8_1X16</entry>
+3 -3
Documentation/video4linux/sh_mobile_ceu_camera.txt
··· 37 37 -1'- 38 38 39 39 In the above chart minuses and slashes represent "real" data amounts, points and 40 - accents represent "useful" data, basically, CEU scaled amd cropped output, 40 + accents represent "useful" data, basically, CEU scaled and cropped output, 41 41 mapped back onto the client's source plane. 42 42 43 43 Such a configuration can be produced by user requests: ··· 65 65 66 66 1. Calculate current sensor scales: 67 67 68 - scale_s = ((3') - (3)) / ((2') - (2)) 68 + scale_s = ((2') - (2)) / ((3') - (3)) 69 69 70 70 2. Calculate "effective" input crop (sensor subwindow) - CEU crop scaled back at 71 71 current sensor scales onto input window - this is user S_CROP: ··· 80 80 4. Calculate sensor output window by applying combined scales to real input 81 81 window: 82 82 83 - width_s_out = ((2') - (2)) / scale_comb 83 + width_s_out = ((7') - (7)) = ((2') - (2)) / scale_comb 84 84 85 85 5. Apply iterative sensor S_FMT for sensor output window. 86 86
+1 -10
drivers/media/common/tuners/tda18271-common.c
··· 533 533 if (tda_fail(ret)) 534 534 goto fail; 535 535 536 - regs[R_MPD] = (0x77 & pd); 537 - 538 - switch (priv->mode) { 539 - case TDA18271_ANALOG: 540 - regs[R_MPD] &= ~0x08; 541 - break; 542 - case TDA18271_DIGITAL: 543 - regs[R_MPD] |= 0x08; 544 - break; 545 - } 536 + regs[R_MPD] = (0x7f & pd); 546 537 547 538 div = ((d * (freq / 1000)) << 7) / 125; 548 539
+11 -10
drivers/media/common/tuners/tda18271-fe.c
··· 579 579 #define RF3 2 580 580 u32 rf_default[3]; 581 581 u32 rf_freq[3]; 582 - u8 prog_cal[3]; 583 - u8 prog_tab[3]; 582 + s32 prog_cal[3]; 583 + s32 prog_tab[3]; 584 584 585 585 i = tda18271_lookup_rf_band(fe, &freq, NULL); 586 586 ··· 602 602 return bcal; 603 603 604 604 tda18271_calc_rf_cal(fe, &rf_freq[rf]); 605 - prog_tab[rf] = regs[R_EB14]; 605 + prog_tab[rf] = (s32)regs[R_EB14]; 606 606 607 607 if (1 == bcal) 608 - prog_cal[rf] = tda18271_calibrate_rf(fe, rf_freq[rf]); 608 + prog_cal[rf] = 609 + (s32)tda18271_calibrate_rf(fe, rf_freq[rf]); 609 610 else 610 611 prog_cal[rf] = prog_tab[rf]; 611 612 612 613 switch (rf) { 613 614 case RF1: 614 615 map[i].rf_a1 = 0; 615 - map[i].rf_b1 = (s32)(prog_cal[RF1] - prog_tab[RF1]); 616 + map[i].rf_b1 = (prog_cal[RF1] - prog_tab[RF1]); 616 617 map[i].rf1 = rf_freq[RF1] / 1000; 617 618 break; 618 619 case RF2: 619 - dividend = (s32)(prog_cal[RF2] - prog_tab[RF2]) - 620 - (s32)(prog_cal[RF1] + prog_tab[RF1]); 620 + dividend = (prog_cal[RF2] - prog_tab[RF2] - 621 + prog_cal[RF1] + prog_tab[RF1]); 621 622 divisor = (s32)(rf_freq[RF2] - rf_freq[RF1]) / 1000; 622 623 map[i].rf_a1 = (dividend / divisor); 623 624 map[i].rf2 = rf_freq[RF2] / 1000; 624 625 break; 625 626 case RF3: 626 - dividend = (s32)(prog_cal[RF3] - prog_tab[RF3]) - 627 - (s32)(prog_cal[RF2] + prog_tab[RF2]); 627 + dividend = (prog_cal[RF3] - prog_tab[RF3] - 628 + prog_cal[RF2] + prog_tab[RF2]); 628 629 divisor = (s32)(rf_freq[RF3] - rf_freq[RF2]) / 1000; 629 630 map[i].rf_a2 = (dividend / divisor); 630 - map[i].rf_b2 = (s32)(prog_cal[RF2] - prog_tab[RF2]); 631 + map[i].rf_b2 = (prog_cal[RF2] - prog_tab[RF2]); 631 632 map[i].rf3 = rf_freq[RF3] / 1000; 632 633 break; 633 634 default:
+6 -6
drivers/media/common/tuners/tda18271-maps.c
··· 229 229 static struct tda18271_map tda18271_rf_band[] = { 230 230 { .rfmax = 47900, .val = 0x00 }, 231 231 { .rfmax = 61100, .val = 0x01 }, 232 - /* { .rfmax = 152600, .val = 0x02 }, */ 233 - { .rfmax = 121200, .val = 0x02 }, 232 + { .rfmax = 152600, .val = 0x02 }, 234 233 { .rfmax = 164700, .val = 0x03 }, 235 234 { .rfmax = 203500, .val = 0x04 }, 236 235 { .rfmax = 457800, .val = 0x05 }, ··· 447 448 { .rfmax = 150000, .val = 0xb0 }, 448 449 { .rfmax = 151000, .val = 0xb1 }, 449 450 { .rfmax = 152000, .val = 0xb7 }, 450 - { .rfmax = 153000, .val = 0xbd }, 451 + { .rfmax = 152600, .val = 0xbd }, 451 452 { .rfmax = 154000, .val = 0x20 }, 452 453 { .rfmax = 155000, .val = 0x22 }, 453 454 { .rfmax = 156000, .val = 0x24 }, ··· 458 459 { .rfmax = 161000, .val = 0x2d }, 459 460 { .rfmax = 163000, .val = 0x2e }, 460 461 { .rfmax = 164000, .val = 0x2f }, 461 - { .rfmax = 165000, .val = 0x30 }, 462 + { .rfmax = 164700, .val = 0x30 }, 462 463 { .rfmax = 166000, .val = 0x11 }, 463 464 { .rfmax = 167000, .val = 0x12 }, 464 465 { .rfmax = 168000, .val = 0x13 }, ··· 509 510 { .rfmax = 236000, .val = 0x1b }, 510 511 { .rfmax = 237000, .val = 0x1c }, 511 512 { .rfmax = 240000, .val = 0x1d }, 512 - { .rfmax = 242000, .val = 0x1f }, 513 + { .rfmax = 242000, .val = 0x1e }, 514 + { .rfmax = 244000, .val = 0x1f }, 513 515 { .rfmax = 247000, .val = 0x20 }, 514 516 { .rfmax = 249000, .val = 0x21 }, 515 517 { .rfmax = 252000, .val = 0x22 }, ··· 624 624 { .rfmax = 453000, .val = 0x93 }, 625 625 { .rfmax = 454000, .val = 0x94 }, 626 626 { .rfmax = 456000, .val = 0x96 }, 627 - { .rfmax = 457000, .val = 0x98 }, 627 + { .rfmax = 457800, .val = 0x98 }, 628 628 { .rfmax = 461000, .val = 0x11 }, 629 629 { .rfmax = 468000, .val = 0x12 }, 630 630 { .rfmax = 472000, .val = 0x13 },
+1 -1
drivers/media/dvb/b2c2/flexcop-pci.c
··· 38 38 DEBSTATUS); 39 39 40 40 #define DRIVER_VERSION "0.1" 41 - #define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver" 41 + #define DRIVER_NAME "flexcop-pci" 42 42 #define DRIVER_AUTHOR "Patrick Boettcher <patrick.boettcher@desy.de>" 43 43 44 44 struct flexcop_pci {
+2 -2
drivers/media/dvb/dvb-usb/Kconfig
··· 362 362 config DVB_USB_TECHNISAT_USB2 363 363 tristate "Technisat DVB-S/S2 USB2.0 support" 364 364 depends on DVB_USB 365 - select DVB_STB0899 if !DVB_FE_CUSTOMISE 366 - select DVB_STB6100 if !DVB_FE_CUSTOMISE 365 + select DVB_STV090x if !DVB_FE_CUSTOMISE 366 + select DVB_STV6110x if !DVB_FE_CUSTOMISE 367 367 help 368 368 Say Y here to support the Technisat USB2 DVB-S/S2 device
+3 -3
drivers/media/dvb/dvb-usb/dib0700_devices.c
··· 2162 2162 .agc1_pt3 = 98, 2163 2163 .agc1_slope1 = 0, 2164 2164 .agc1_slope2 = 167, 2165 - .agc1_pt1 = 98, 2165 + .agc2_pt1 = 98, 2166 2166 .agc2_pt2 = 255, 2167 2167 .agc2_slope1 = 104, 2168 2168 .agc2_slope2 = 0, ··· 2440 2440 dib0700_set_i2c_speed(adap->dev, 340); 2441 2441 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x90, &tfe7090pvr_dib7000p_config[0]); 2442 2442 2443 - dib7090_slave_reset(adap->fe); 2444 - 2445 2443 if (adap->fe == NULL) 2446 2444 return -ENODEV; 2445 + 2446 + dib7090_slave_reset(adap->fe); 2447 2447 2448 2448 return 0; 2449 2449 }
+6 -2
drivers/media/media-entity.c
··· 378 378 379 379 static int __media_entity_setup_link_notify(struct media_link *link, u32 flags) 380 380 { 381 - const u32 mask = MEDIA_LNK_FL_ENABLED; 382 381 int ret; 383 382 384 383 /* Notify both entities. */ ··· 394 395 return ret; 395 396 } 396 397 397 - link->flags = (link->flags & ~mask) | (flags & mask); 398 + link->flags = flags; 398 399 link->reverse->flags = link->flags; 399 400 400 401 return 0; ··· 416 417 */ 417 418 int __media_entity_setup_link(struct media_link *link, u32 flags) 418 419 { 420 + const u32 mask = MEDIA_LNK_FL_ENABLED; 419 421 struct media_device *mdev; 420 422 struct media_entity *source, *sink; 421 423 int ret = -EBUSY; 422 424 423 425 if (link == NULL) 426 + return -EINVAL; 427 + 428 + /* The non-modifiable link flags must not be modified. */ 429 + if ((link->flags & ~mask) != (flags & ~mask)) 424 430 return -EINVAL; 425 431 426 432 if (link->flags & MEDIA_LNK_FL_IMMUTABLE)
+1 -1
drivers/media/video/Kconfig
··· 875 875 config VIDEO_MX3 876 876 tristate "i.MX3x Camera Sensor Interface driver" 877 877 depends on VIDEO_DEV && MX3_IPU && SOC_CAMERA 878 - select VIDEOBUF_DMA_CONTIG 878 + select VIDEOBUF2_DMA_CONTIG 879 879 select MX3_VIDEO 880 880 ---help--- 881 881 This is a v4l2 driver for the i.MX3x Camera Sensor Interface
+9 -1
drivers/media/video/cx18/cx18-streams.c
··· 350 350 351 351 /* No struct video_device, but can have buffers allocated */ 352 352 if (type == CX18_ENC_STREAM_TYPE_IDX) { 353 + /* If the module params didn't inhibit IDX ... */ 353 354 if (cx->stream_buffers[type] != 0) { 354 355 cx->stream_buffers[type] = 0; 355 - cx18_stream_free(&cx->streams[type]); 356 + /* 357 + * Before calling cx18_stream_free(), 358 + * check if the IDX stream was actually set up. 359 + * Needed, since the cx18_probe() error path 360 + * exits through here as well as normal clean up 361 + */ 362 + if (cx->streams[type].buffers != 0) 363 + cx18_stream_free(&cx->streams[type]); 356 364 } 357 365 continue; 358 366 }
+1
drivers/media/video/cx23885/Kconfig
··· 22 22 select DVB_CX24116 if !DVB_FE_CUSTOMISE 23 23 select DVB_STV0900 if !DVB_FE_CUSTOMISE 24 24 select DVB_DS3000 if !DVB_FE_CUSTOMISE 25 + select DVB_STV0367 if !DVB_FE_CUSTOMISE 25 26 select MEDIA_TUNER_MT2131 if !MEDIA_TUNER_CUSTOMISE 26 27 select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE 27 28 select MEDIA_TUNER_TDA8290 if !MEDIA_TUNER_CUSTOMISE
+1 -1
drivers/media/video/imx074.c
··· 298 298 static int imx074_set_bus_param(struct soc_camera_device *icd, 299 299 unsigned long flags) 300 300 { 301 - return -1; 301 + return -EINVAL; 302 302 } 303 303 304 304 static struct soc_camera_ops imx074_ops = {
+25 -9
drivers/media/video/omap3isp/isp.c
··· 215 215 } 216 216 217 217 switch (xclksel) { 218 - case 0: 218 + case ISP_XCLK_A: 219 219 isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL, 220 220 ISPTCTRL_CTRL_DIVA_MASK, 221 221 divisor << ISPTCTRL_CTRL_DIVA_SHIFT); 222 222 dev_dbg(isp->dev, "isp_set_xclk(): cam_xclka set to %d Hz\n", 223 223 currentxclk); 224 224 break; 225 - case 1: 225 + case ISP_XCLK_B: 226 226 isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL, 227 227 ISPTCTRL_CTRL_DIVB_MASK, 228 228 divisor << ISPTCTRL_CTRL_DIVB_SHIFT); 229 229 dev_dbg(isp->dev, "isp_set_xclk(): cam_xclkb set to %d Hz\n", 230 230 currentxclk); 231 231 break; 232 + case ISP_XCLK_NONE: 232 233 default: 233 234 omap3isp_put(isp); 234 235 dev_dbg(isp->dev, "ISP_ERR: isp_set_xclk(): Invalid requested " ··· 238 237 } 239 238 240 239 /* Do we go from stable whatever to clock? */ 241 - if (divisor >= 2 && isp->xclk_divisor[xclksel] < 2) 240 + if (divisor >= 2 && isp->xclk_divisor[xclksel - 1] < 2) 242 241 omap3isp_get(isp); 243 242 /* Stopping the clock. */ 244 - else if (divisor < 2 && isp->xclk_divisor[xclksel] >= 2) 243 + else if (divisor < 2 && isp->xclk_divisor[xclksel - 1] >= 2) 245 244 omap3isp_put(isp); 246 245 247 - isp->xclk_divisor[xclksel] = divisor; 246 + isp->xclk_divisor[xclksel - 1] = divisor; 248 247 249 248 omap3isp_put(isp); 250 249 ··· 286 285 */ 287 286 void omap3isp_configure_bridge(struct isp_device *isp, 288 287 enum ccdc_input_entity input, 289 - const struct isp_parallel_platform_data *pdata) 288 + const struct isp_parallel_platform_data *pdata, 289 + unsigned int shift) 290 290 { 291 291 u32 ispctrl_val; 292 292 ··· 300 298 switch (input) { 301 299 case CCDC_INPUT_PARALLEL: 302 300 ispctrl_val |= ISPCTRL_PAR_SER_CLK_SEL_PARALLEL; 303 - ispctrl_val |= pdata->data_lane_shift << ISPCTRL_SHIFT_SHIFT; 304 301 ispctrl_val |= pdata->clk_pol << ISPCTRL_PAR_CLK_POL_SHIFT; 305 302 ispctrl_val |= pdata->bridge << ISPCTRL_PAR_BRIDGE_SHIFT; 303 + shift += pdata->data_lane_shift * 2; 306 304 break; 307 305 308 306 case CCDC_INPUT_CSI2A: ··· 320 318 default: 321 319 return; 322 320 } 321 + 322 + ispctrl_val |= ((shift/2) << ISPCTRL_SHIFT_SHIFT) & ISPCTRL_SHIFT_MASK; 323 323 324 324 ispctrl_val &= ~ISPCTRL_SYNC_DETECT_MASK; 325 325 ispctrl_val |= ISPCTRL_SYNC_DETECT_VSRISE; ··· 662 658 663 659 /* Apply power change to connected non-nodes. */ 664 660 ret = isp_pipeline_pm_power(entity, change); 661 + if (ret < 0) 662 + entity->use_count -= change; 665 663 666 664 mutex_unlock(&entity->parent->graph_mutex); 667 665 ··· 878 872 } 879 873 } 880 874 875 + if (failure < 0) 876 + isp->needs_reset = true; 877 + 881 878 return failure; 882 879 } 883 880 ··· 893 884 * single-shot or continuous mode. 894 885 * 895 886 * Return 0 if successful, or the return value of the failed video::s_stream 896 - * operation otherwise. 887 + * operation otherwise. The pipeline state is not updated when the operation 888 + * fails, except when stopping the pipeline. 897 889 */ 898 890 int omap3isp_pipeline_set_stream(struct isp_pipeline *pipe, 899 891 enum isp_pipeline_stream_state state) ··· 905 895 ret = isp_pipeline_disable(pipe); 906 896 else 907 897 ret = isp_pipeline_enable(pipe, state); 908 - pipe->stream_state = state; 898 + 899 + if (ret == 0 || state == ISP_PIPELINE_STREAM_STOPPED) 900 + pipe->stream_state = state; 909 901 910 902 return ret; 911 903 } ··· 1493 1481 if (--isp->ref_count == 0) { 1494 1482 isp_disable_interrupts(isp); 1495 1483 isp_save_ctx(isp); 1484 + if (isp->needs_reset) { 1485 + isp_reset(isp); 1486 + isp->needs_reset = false; 1487 + } 1496 1488 isp_disable_clocks(isp); 1497 1489 } 1498 1490 mutex_unlock(&isp->isp_mutex);
+6 -6
drivers/media/video/omap3isp/isp.h
··· 132 132 133 133 /** 134 134 * struct isp_parallel_platform_data - Parallel interface platform data 135 - * @width: Parallel bus width in bits (8, 10, 11 or 12) 136 135 * @data_lane_shift: Data lane shifter 137 136 * 0 - CAMEXT[13:0] -> CAM[13:0] 138 137 * 1 - CAMEXT[13:2] -> CAM[11:0] ··· 145 146 * ISPCTRL_PAR_BRIDGE_BENDIAN - Big endian 146 147 */ 147 148 struct isp_parallel_platform_data { 148 - unsigned int width; 149 149 unsigned int data_lane_shift:2; 150 150 unsigned int clk_pol:1; 151 151 unsigned int bridge:4; ··· 260 262 /* ISP Obj */ 261 263 spinlock_t stat_lock; /* common lock for statistic drivers */ 262 264 struct mutex isp_mutex; /* For handling ref_count field */ 265 + bool needs_reset; 263 266 int has_context; 264 267 int ref_count; 265 268 unsigned int autoidle; ··· 310 311 enum isp_pipeline_stream_state state); 311 312 void omap3isp_configure_bridge(struct isp_device *isp, 312 313 enum ccdc_input_entity input, 313 - const struct isp_parallel_platform_data *pdata); 314 + const struct isp_parallel_platform_data *pdata, 315 + unsigned int shift); 314 316 315 - #define ISP_XCLK_NONE -1 316 - #define ISP_XCLK_A 0 317 - #define ISP_XCLK_B 1 317 + #define ISP_XCLK_NONE 0 318 + #define ISP_XCLK_A 1 319 + #define ISP_XCLK_B 2 318 320 319 321 struct isp_device *omap3isp_get(struct isp_device *isp); 320 322 void omap3isp_put(struct isp_device *isp);
+30 -7
drivers/media/video/omap3isp/ispccdc.c
··· 43 43 44 44 static const unsigned int ccdc_fmts[] = { 45 45 V4L2_MBUS_FMT_Y8_1X8, 46 + V4L2_MBUS_FMT_Y10_1X10, 47 + V4L2_MBUS_FMT_Y12_1X12, 48 + V4L2_MBUS_FMT_SGRBG8_1X8, 49 + V4L2_MBUS_FMT_SRGGB8_1X8, 50 + V4L2_MBUS_FMT_SBGGR8_1X8, 51 + V4L2_MBUS_FMT_SGBRG8_1X8, 46 52 V4L2_MBUS_FMT_SGRBG10_1X10, 47 53 V4L2_MBUS_FMT_SRGGB10_1X10, 48 54 V4L2_MBUS_FMT_SBGGR10_1X10, ··· 1116 1110 struct isp_parallel_platform_data *pdata = NULL; 1117 1111 struct v4l2_subdev *sensor; 1118 1112 struct v4l2_mbus_framefmt *format; 1113 + const struct isp_format_info *fmt_info; 1114 + struct v4l2_subdev_format fmt_src; 1115 + unsigned int depth_out; 1116 + unsigned int depth_in = 0; 1119 1117 struct media_pad *pad; 1120 1118 unsigned long flags; 1119 + unsigned int shift; 1121 1120 u32 syn_mode; 1122 1121 u32 ccdc_pattern; 1123 1122 1124 - if (ccdc->input == CCDC_INPUT_PARALLEL) { 1125 - pad = media_entity_remote_source(&ccdc->pads[CCDC_PAD_SINK]); 1126 - sensor = media_entity_to_v4l2_subdev(pad->entity); 1123 + pad = media_entity_remote_source(&ccdc->pads[CCDC_PAD_SINK]); 1124 + sensor = media_entity_to_v4l2_subdev(pad->entity); 1125 + if (ccdc->input == CCDC_INPUT_PARALLEL) 1127 1126 pdata = &((struct isp_v4l2_subdevs_group *)sensor->host_priv) 1128 1127 ->bus.parallel; 1128 + 1129 + /* Compute shift value for lane shifter to configure the bridge. */ 1130 + fmt_src.pad = pad->index; 1131 + fmt_src.which = V4L2_SUBDEV_FORMAT_ACTIVE; 1132 + if (!v4l2_subdev_call(sensor, pad, get_fmt, NULL, &fmt_src)) { 1133 + fmt_info = omap3isp_video_format_info(fmt_src.format.code); 1134 + depth_in = fmt_info->bpp; 1129 1135 } 1130 1136 1131 - omap3isp_configure_bridge(isp, ccdc->input, pdata); 1137 + fmt_info = omap3isp_video_format_info 1138 + (isp->isp_ccdc.formats[CCDC_PAD_SINK].code); 1139 + depth_out = fmt_info->bpp; 1132 1140 1133 - ccdc->syncif.datsz = pdata ? pdata->width : 10; 1141 + shift = depth_in - depth_out; 1142 + omap3isp_configure_bridge(isp, ccdc->input, pdata, shift); 1143 + 1144 + ccdc->syncif.datsz = depth_out; 1134 1145 ccdc_config_sync_if(ccdc, &ccdc->syncif); 1135 1146 1136 1147 /* CCDC_PAD_SINK */ ··· 1361 1338 * @ccdc: Pointer to ISP CCDC device. 1362 1339 * @event: Pointing which event trigger handler 1363 1340 * 1364 - * Return 1 when the event and stopping request combination is satisfyied, 1341 + * Return 1 when the event and stopping request combination is satisfied, 1365 1342 * zero otherwise. 1366 1343 */ 1367 1344 static int __ccdc_handle_stopping(struct isp_ccdc_device *ccdc, u32 event) ··· 1641 1618 1642 1619 ccdc_set_outaddr(ccdc, buffer->isp_addr); 1643 1620 1644 - /* We now have a buffer queued on the output, restart the pipeline in 1621 + /* We now have a buffer queued on the output, restart the pipeline 1645 1622 * on the next CCDC interrupt if running in continuous mode (or when 1646 1623 * starting the stream). 1647 1624 */
+1 -1
drivers/media/video/omap3isp/isppreview.c
··· 755 755 * @configs - pointer to update config structure. 756 756 * @config - return pointer to appropriate structure field. 757 757 * @bit - for which feature to return pointers. 758 - * Return size of coresponding prev_params member 758 + * Return size of corresponding prev_params member 759 759 */ 760 760 static u32 761 761 __preview_get_ptrs(struct prev_params *params, void **param,
+3 -3
drivers/media/video/omap3isp/ispqueue.c
··· 339 339 up_read(&current->mm->mmap_sem); 340 340 341 341 if (ret != buf->npages) { 342 - buf->npages = ret; 342 + buf->npages = ret < 0 ? 0 : ret; 343 343 isp_video_buffer_cleanup(buf); 344 344 return -EFAULT; 345 345 } ··· 408 408 * isp_video_buffer_prepare_vm_flags - Get VMA flags for a userspace address 409 409 * 410 410 * This function locates the VMAs for the buffer's userspace address and checks 411 - * that their flags match. The onlflag that we need to care for at the moment is 412 - * VM_PFNMAP. 411 + * that their flags match. The only flag that we need to care for at the moment 412 + * is VM_PFNMAP. 413 413 * 414 414 * The buffer vm_flags field is set to the first VMA flags. 415 415 *
+60 -15
drivers/media/video/omap3isp/ispresizer.c
··· 714 714 * iw and ih are the input width and height after cropping. Those equations need 715 715 * to be satisfied exactly for the resizer to work correctly. 716 716 * 717 - * Reverting the equations, we can compute the resizing ratios with 717 + * The equations can't be easily reverted, as the >> 8 operation is not linear. 718 + * In addition, not all input sizes can be achieved for a given output size. To 719 + * get the highest input size lower than or equal to the requested input size, 720 + * we need to compute the highest resizing ratio that satisfies the following 721 + * inequality (taking the 4-tap mode width equation as an example) 722 + * 723 + * iw >= (32 * sph + (ow - 1) * hrsz + 16) >> 8 - 7 724 + * 725 + * (where iw is the requested input width) which can be rewritten as 726 + * 727 + * iw - 7 >= (32 * sph + (ow - 1) * hrsz + 16) >> 8 728 + * (iw - 7) << 8 >= 32 * sph + (ow - 1) * hrsz + 16 - b 729 + * ((iw - 7) << 8) + b >= 32 * sph + (ow - 1) * hrsz + 16 730 + * 731 + * where b is the value of the 8 least significant bits of the right hand side 732 + * expression of the last inequality. The highest resizing ratio value will be 733 + * achieved when b is equal to its maximum value of 255. That resizing ratio 734 + * value will still satisfy the original inequality, as b will disappear when 735 + * the expression will be shifted right by 8. 736 + * 737 + * The reverted the equations thus become 718 738 * 719 739 * - 8-phase, 4-tap mode 720 - * hrsz = ((iw - 7) * 256 - 16 - 32 * sph) / (ow - 1) 721 - * vrsz = ((ih - 4) * 256 - 16 - 32 * spv) / (oh - 1) 740 + * hrsz = ((iw - 7) * 256 + 255 - 16 - 32 * sph) / (ow - 1) 741 + * vrsz = ((ih - 4) * 256 + 255 - 16 - 32 * spv) / (oh - 1) 722 742 * - 4-phase, 7-tap mode 723 - * hrsz = ((iw - 7) * 256 - 32 - 64 * sph) / (ow - 1) 724 - * vrsz = ((ih - 7) * 256 - 32 - 64 * spv) / (oh - 1) 743 + * hrsz = ((iw - 7) * 256 + 255 - 32 - 64 * sph) / (ow - 1) 744 + * vrsz = ((ih - 7) * 256 + 255 - 32 - 64 * spv) / (oh - 1) 725 745 * 726 - * The ratios are integer values, and must be rounded down to ensure that the 727 - * cropped input size is not bigger than the uncropped input size. As the ratio 728 - * in 7-tap mode is always smaller than the ratio in 4-tap mode, we can use the 729 - * 7-tap mode equations to compute a ratio approximation. 746 + * The ratios are integer values, and are rounded down to ensure that the 747 + * cropped input size is not bigger than the uncropped input size. 748 + * 749 + * As the number of phases/taps, used to select the correct equations to compute 750 + * the ratio, depends on the ratio, we start with the 4-tap mode equations to 751 + * compute an approximation of the ratio, and switch to the 7-tap mode equations 752 + * if the approximation is higher than the ratio threshold. 753 + * 754 + * As the 7-tap mode equations will return a ratio smaller than or equal to the 755 + * 4-tap mode equations, the resulting ratio could become lower than or equal to 756 + * the ratio threshold. This 'equations loop' isn't an issue as long as the 757 + * correct equations are used to compute the final input size. Starting with the 758 + * 4-tap mode equations ensure that, in case of values resulting in a 'ratio 759 + * loop', the smallest of the ratio values will be used, never exceeding the 760 + * requested input size. 730 761 * 731 762 * We first clamp the output size according to the hardware capabilitie to avoid 732 763 * auto-cropping the input more than required to satisfy the TRM equations. The ··· 806 775 unsigned int max_width; 807 776 unsigned int max_height; 808 777 unsigned int width_alignment; 778 + unsigned int width; 779 + unsigned int height; 809 780 810 781 /* 811 782 * Clamp the output height based on the hardware capabilities and ··· 819 786 max_height = min_t(unsigned int, max_height, MAX_OUT_HEIGHT); 820 787 output->height = clamp(output->height, min_height, max_height); 821 788 822 - ratio->vert = ((input->height - 7) * 256 - 32 - 64 * spv) 789 + ratio->vert = ((input->height - 4) * 256 + 255 - 16 - 32 * spv) 823 790 / (output->height - 1); 791 + if (ratio->vert > MID_RESIZE_VALUE) 792 + ratio->vert = ((input->height - 7) * 256 + 255 - 32 - 64 * spv) 793 + / (output->height - 1); 824 794 ratio->vert = clamp_t(unsigned int, ratio->vert, 825 795 MIN_RESIZE_VALUE, MAX_RESIZE_VALUE); 826 796 827 797 if (ratio->vert <= MID_RESIZE_VALUE) { 828 798 upscaled_height = (output->height - 1) * ratio->vert 829 799 + 32 * spv + 16; 830 - input->height = (upscaled_height >> 8) + 4; 800 + height = (upscaled_height >> 8) + 4; 831 801 } else { 832 802 upscaled_height = (output->height - 1) * ratio->vert 833 803 + 64 * spv + 32; 834 - input->height = (upscaled_height >> 8) + 7; 804 + height = (upscaled_height >> 8) + 7; 835 805 } 836 806 837 807 /* ··· 890 854 max_width & ~(width_alignment - 1)); 891 855 output->width = ALIGN(output->width, width_alignment); 892 856 893 - ratio->horz = ((input->width - 7) * 256 - 32 - 64 * sph) 857 + ratio->horz = ((input->width - 7) * 256 + 255 - 16 - 32 * sph) 894 858 / (output->width - 1); 859 + if (ratio->horz > MID_RESIZE_VALUE) 860 + ratio->horz = ((input->width - 7) * 256 + 255 - 32 - 64 * sph) 861 + / (output->width - 1); 895 862 ratio->horz = clamp_t(unsigned int, ratio->horz, 896 863 MIN_RESIZE_VALUE, MAX_RESIZE_VALUE); 897 864 898 865 if (ratio->horz <= MID_RESIZE_VALUE) { 899 866 upscaled_width = (output->width - 1) * ratio->horz 900 867 + 32 * sph + 16; 901 - input->width = (upscaled_width >> 8) + 7; 868 + width = (upscaled_width >> 8) + 7; 902 869 } else { 903 870 upscaled_width = (output->width - 1) * ratio->horz 904 871 + 64 * sph + 32; 905 - input->width = (upscaled_width >> 8) + 7; 872 + width = (upscaled_width >> 8) + 7; 906 873 } 874 + 875 + /* Center the new crop rectangle. */ 876 + input->left += (input->width - width) / 2; 877 + input->top += (input->height - height) / 2; 878 + input->width = width; 879 + input->height = height; 907 880 } 908 881 909 882 /*
+3 -3
drivers/media/video/omap3isp/ispstat.h
··· 131 131 struct ispstat_generic_config { 132 132 /* 133 133 * Fields must be in the same order as in: 134 - * - isph3a_aewb_config 135 - * - isph3a_af_config 136 - * - isphist_config 134 + * - omap3isp_h3a_aewb_config 135 + * - omap3isp_h3a_af_config 136 + * - omap3isp_hist_config 137 137 */ 138 138 u32 buf_size; 139 139 u16 config_counter;
+94 -14
drivers/media/video/omap3isp/ispvideo.c
··· 47 47 48 48 static struct isp_format_info formats[] = { 49 49 { V4L2_MBUS_FMT_Y8_1X8, V4L2_MBUS_FMT_Y8_1X8, 50 - V4L2_MBUS_FMT_Y8_1X8, V4L2_PIX_FMT_GREY, 8, }, 50 + V4L2_MBUS_FMT_Y8_1X8, V4L2_MBUS_FMT_Y8_1X8, 51 + V4L2_PIX_FMT_GREY, 8, }, 52 + { V4L2_MBUS_FMT_Y10_1X10, V4L2_MBUS_FMT_Y10_1X10, 53 + V4L2_MBUS_FMT_Y10_1X10, V4L2_MBUS_FMT_Y8_1X8, 54 + V4L2_PIX_FMT_Y10, 10, }, 55 + { V4L2_MBUS_FMT_Y12_1X12, V4L2_MBUS_FMT_Y10_1X10, 56 + V4L2_MBUS_FMT_Y12_1X12, V4L2_MBUS_FMT_Y8_1X8, 57 + V4L2_PIX_FMT_Y12, 12, }, 58 + { V4L2_MBUS_FMT_SBGGR8_1X8, V4L2_MBUS_FMT_SBGGR8_1X8, 59 + V4L2_MBUS_FMT_SBGGR8_1X8, V4L2_MBUS_FMT_SBGGR8_1X8, 60 + V4L2_PIX_FMT_SBGGR8, 8, }, 61 + { V4L2_MBUS_FMT_SGBRG8_1X8, V4L2_MBUS_FMT_SGBRG8_1X8, 62 + V4L2_MBUS_FMT_SGBRG8_1X8, V4L2_MBUS_FMT_SGBRG8_1X8, 63 + V4L2_PIX_FMT_SGBRG8, 8, }, 64 + { V4L2_MBUS_FMT_SGRBG8_1X8, V4L2_MBUS_FMT_SGRBG8_1X8, 65 + V4L2_MBUS_FMT_SGRBG8_1X8, V4L2_MBUS_FMT_SGRBG8_1X8, 66 + V4L2_PIX_FMT_SGRBG8, 8, }, 67 + { V4L2_MBUS_FMT_SRGGB8_1X8, V4L2_MBUS_FMT_SRGGB8_1X8, 68 + V4L2_MBUS_FMT_SRGGB8_1X8, V4L2_MBUS_FMT_SRGGB8_1X8, 69 + V4L2_PIX_FMT_SRGGB8, 8, }, 51 70 { V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, 52 - V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_PIX_FMT_SGRBG10DPCM8, 8, }, 71 + V4L2_MBUS_FMT_SGRBG10_1X10, 0, 72 + V4L2_PIX_FMT_SGRBG10DPCM8, 8, }, 53 73 { V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SBGGR10_1X10, 54 - V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_PIX_FMT_SBGGR10, 10, }, 74 + V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SBGGR8_1X8, 75 + V4L2_PIX_FMT_SBGGR10, 10, }, 55 76 { V4L2_MBUS_FMT_SGBRG10_1X10, V4L2_MBUS_FMT_SGBRG10_1X10, 56 - V4L2_MBUS_FMT_SGBRG10_1X10, V4L2_PIX_FMT_SGBRG10, 10, }, 77 + V4L2_MBUS_FMT_SGBRG10_1X10, V4L2_MBUS_FMT_SGBRG8_1X8, 78 + V4L2_PIX_FMT_SGBRG10, 10, }, 57 79 { V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_MBUS_FMT_SGRBG10_1X10, 58 - V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_PIX_FMT_SGRBG10, 10, }, 80 + V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_MBUS_FMT_SGRBG8_1X8, 81 + V4L2_PIX_FMT_SGRBG10, 10, }, 59 82 { V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SRGGB10_1X10, 60 - V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_PIX_FMT_SRGGB10, 10, }, 83 + V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SRGGB8_1X8, 84 + V4L2_PIX_FMT_SRGGB10, 10, }, 61 85 { V4L2_MBUS_FMT_SBGGR12_1X12, V4L2_MBUS_FMT_SBGGR10_1X10, 62 - V4L2_MBUS_FMT_SBGGR12_1X12, V4L2_PIX_FMT_SBGGR12, 12, }, 86 + V4L2_MBUS_FMT_SBGGR12_1X12, V4L2_MBUS_FMT_SBGGR8_1X8, 87 + V4L2_PIX_FMT_SBGGR12, 12, }, 63 88 { V4L2_MBUS_FMT_SGBRG12_1X12, V4L2_MBUS_FMT_SGBRG10_1X10, 64 - V4L2_MBUS_FMT_SGBRG12_1X12, V4L2_PIX_FMT_SGBRG12, 12, }, 89 + V4L2_MBUS_FMT_SGBRG12_1X12, V4L2_MBUS_FMT_SGBRG8_1X8, 90 + V4L2_PIX_FMT_SGBRG12, 12, }, 65 91 { V4L2_MBUS_FMT_SGRBG12_1X12, V4L2_MBUS_FMT_SGRBG10_1X10, 66 - V4L2_MBUS_FMT_SGRBG12_1X12, V4L2_PIX_FMT_SGRBG12, 12, }, 92 + V4L2_MBUS_FMT_SGRBG12_1X12, V4L2_MBUS_FMT_SGRBG8_1X8, 93 + V4L2_PIX_FMT_SGRBG12, 12, }, 67 94 { V4L2_MBUS_FMT_SRGGB12_1X12, V4L2_MBUS_FMT_SRGGB10_1X10, 68 - V4L2_MBUS_FMT_SRGGB12_1X12, V4L2_PIX_FMT_SRGGB12, 12, }, 95 + V4L2_MBUS_FMT_SRGGB12_1X12, V4L2_MBUS_FMT_SRGGB8_1X8, 96 + V4L2_PIX_FMT_SRGGB12, 12, }, 69 97 { V4L2_MBUS_FMT_UYVY8_1X16, V4L2_MBUS_FMT_UYVY8_1X16, 70 - V4L2_MBUS_FMT_UYVY8_1X16, V4L2_PIX_FMT_UYVY, 16, }, 98 + V4L2_MBUS_FMT_UYVY8_1X16, 0, 99 + V4L2_PIX_FMT_UYVY, 16, }, 71 100 { V4L2_MBUS_FMT_YUYV8_1X16, V4L2_MBUS_FMT_YUYV8_1X16, 72 - V4L2_MBUS_FMT_YUYV8_1X16, V4L2_PIX_FMT_YUYV, 16, }, 101 + V4L2_MBUS_FMT_YUYV8_1X16, 0, 102 + V4L2_PIX_FMT_YUYV, 16, }, 73 103 }; 74 104 75 105 const struct isp_format_info * ··· 113 83 } 114 84 115 85 return NULL; 86 + } 87 + 88 + /* 89 + * Decide whether desired output pixel code can be obtained with 90 + * the lane shifter by shifting the input pixel code. 91 + * @in: input pixelcode to shifter 92 + * @out: output pixelcode from shifter 93 + * @additional_shift: # of bits the sensor's LSB is offset from CAMEXT[0] 94 + * 95 + * return true if the combination is possible 96 + * return false otherwise 97 + */ 98 + static bool isp_video_is_shiftable(enum v4l2_mbus_pixelcode in, 99 + enum v4l2_mbus_pixelcode out, 100 + unsigned int additional_shift) 101 + { 102 + const struct isp_format_info *in_info, *out_info; 103 + 104 + if (in == out) 105 + return true; 106 + 107 + in_info = omap3isp_video_format_info(in); 108 + out_info = omap3isp_video_format_info(out); 109 + 110 + if ((in_info->flavor == 0) || (out_info->flavor == 0)) 111 + return false; 112 + 113 + if (in_info->flavor != out_info->flavor) 114 + return false; 115 + 116 + return in_info->bpp - out_info->bpp + additional_shift <= 6; 116 117 } 117 118 118 119 /* ··· 296 235 return -EPIPE; 297 236 298 237 while (1) { 238 + unsigned int shifter_link; 299 239 /* Retrieve the sink format */ 300 240 pad = &subdev->entity.pads[0]; 301 241 if (!(pad->flags & MEDIA_PAD_FL_SINK)) ··· 325 263 return -ENOSPC; 326 264 } 327 265 266 + /* If sink pad is on CCDC, the link has the lane shifter 267 + * in the middle of it. */ 268 + shifter_link = subdev == &isp->isp_ccdc.subdev; 269 + 328 270 /* Retrieve the source format */ 329 271 pad = media_entity_remote_source(pad); 330 272 if (pad == NULL || ··· 344 278 return -EPIPE; 345 279 346 280 /* Check if the two ends match */ 347 - if (fmt_source.format.code != fmt_sink.format.code || 348 - fmt_source.format.width != fmt_sink.format.width || 281 + if (fmt_source.format.width != fmt_sink.format.width || 349 282 fmt_source.format.height != fmt_sink.format.height) 283 + return -EPIPE; 284 + 285 + if (shifter_link) { 286 + unsigned int parallel_shift = 0; 287 + if (isp->isp_ccdc.input == CCDC_INPUT_PARALLEL) { 288 + struct isp_parallel_platform_data *pdata = 289 + &((struct isp_v4l2_subdevs_group *) 290 + subdev->host_priv)->bus.parallel; 291 + parallel_shift = pdata->data_lane_shift * 2; 292 + } 293 + if (!isp_video_is_shiftable(fmt_source.format.code, 294 + fmt_sink.format.code, 295 + parallel_shift)) 296 + return -EPIPE; 297 + } else if (fmt_source.format.code != fmt_sink.format.code) 350 298 return -EPIPE; 351 299 } 352 300
+3
drivers/media/video/omap3isp/ispvideo.h
··· 49 49 * bits. Identical to @code if the format is 10 bits wide or less. 50 50 * @uncompressed: V4L2 media bus format code for the corresponding uncompressed 51 51 * format. Identical to @code if the format is not DPCM compressed. 52 + * @flavor: V4L2 media bus format code for the same pixel layout but 53 + * shifted to be 8 bits per pixel. =0 if format is not shiftable. 52 54 * @pixelformat: V4L2 pixel format FCC identifier 53 55 * @bpp: Bits per pixel 54 56 */ ··· 58 56 enum v4l2_mbus_pixelcode code; 59 57 enum v4l2_mbus_pixelcode truncated; 60 58 enum v4l2_mbus_pixelcode uncompressed; 59 + enum v4l2_mbus_pixelcode flavor; 61 60 u32 pixelformat; 62 61 unsigned int bpp; 63 62 };
+5 -3
drivers/media/video/s5p-fimc/fimc-capture.c
··· 527 527 if (ret) 528 528 return ret; 529 529 530 - if (vb2_is_streaming(&fimc->vid_cap.vbq) || fimc_capture_active(fimc)) 530 + if (vb2_is_busy(&fimc->vid_cap.vbq) || fimc_capture_active(fimc)) 531 531 return -EBUSY; 532 532 533 533 frame = &ctx->d_frame; ··· 539 539 return -EINVAL; 540 540 } 541 541 542 - for (i = 0; i < frame->fmt->colplanes; i++) 543 - frame->payload[i] = pix->plane_fmt[i].bytesperline * pix->height; 542 + for (i = 0; i < frame->fmt->colplanes; i++) { 543 + frame->payload[i] = 544 + (pix->width * pix->height * frame->fmt->depth[i]) >> 3; 545 + } 544 546 545 547 /* Output DMA frame pixel size and offsets. */ 546 548 frame->f_width = pix->plane_fmt[0].bytesperline * 8
+47 -27
drivers/media/video/s5p-fimc/fimc-core.c
··· 361 361 { 362 362 struct fimc_vid_cap *cap = &fimc->vid_cap; 363 363 struct fimc_vid_buffer *v_buf; 364 + struct timeval *tv; 365 + struct timespec ts; 364 366 365 367 if (!list_empty(&cap->active_buf_q) && 366 368 test_bit(ST_CAPT_RUN, &fimc->state)) { 369 + ktime_get_real_ts(&ts); 370 + 367 371 v_buf = active_queue_pop(cap); 372 + 373 + tv = &v_buf->vb.v4l2_buf.timestamp; 374 + tv->tv_sec = ts.tv_sec; 375 + tv->tv_usec = ts.tv_nsec / NSEC_PER_USEC; 376 + v_buf->vb.v4l2_buf.sequence = cap->frame_count++; 377 + 368 378 vb2_buffer_done(&v_buf->vb, VB2_BUF_STATE_DONE); 369 379 } 370 380 ··· 768 758 mutex_unlock(&ctx->fimc_dev->lock); 769 759 } 770 760 771 - struct vb2_ops fimc_qops = { 761 + static struct vb2_ops fimc_qops = { 772 762 .queue_setup = fimc_queue_setup, 773 763 .buf_prepare = fimc_buf_prepare, 774 764 .buf_queue = fimc_buf_queue, ··· 937 927 pix->num_planes = fmt->memplanes; 938 928 pix->colorspace = V4L2_COLORSPACE_JPEG; 939 929 930 + 940 931 for (i = 0; i < pix->num_planes; ++i) { 941 - int bpl = pix->plane_fmt[i].bytesperline; 932 + u32 bpl = pix->plane_fmt[i].bytesperline; 933 + u32 *sizeimage = &pix->plane_fmt[i].sizeimage; 942 934 943 - dbg("[%d] bpl: %d, depth: %d, w: %d, h: %d", 944 - i, bpl, fmt->depth[i], pix->width, pix->height); 935 + if (fmt->colplanes > 1 && (bpl == 0 || bpl < pix->width)) 936 + bpl = pix->width; /* Planar */ 945 937 946 - if (!bpl || (bpl * 8 / fmt->depth[i]) > pix->width) 947 - bpl = (pix->width * fmt->depth[0]) >> 3; 938 + if (fmt->colplanes == 1 && /* Packed */ 939 + (bpl == 0 || ((bpl * 8) / fmt->depth[i]) < pix->width)) 940 + bpl = (pix->width * fmt->depth[0]) / 8; 948 941 949 - if (!pix->plane_fmt[i].sizeimage) 950 - pix->plane_fmt[i].sizeimage = pix->height * bpl; 942 + if (i == 0) /* Same bytesperline for each plane. */ 943 + mod_x = bpl; 951 944 952 - pix->plane_fmt[i].bytesperline = bpl; 953 - 954 - dbg("[%d]: bpl: %d, sizeimage: %d", 955 - i, pix->plane_fmt[i].bytesperline, 956 - pix->plane_fmt[i].sizeimage); 945 + pix->plane_fmt[i].bytesperline = mod_x; 946 + *sizeimage = (pix->width * pix->height * fmt->depth[i]) / 8; 957 947 } 958 948 959 949 return 0; ··· 975 965 976 966 vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type); 977 967 978 - if (vb2_is_streaming(vq)) { 968 + if (vb2_is_busy(vq)) { 979 969 v4l2_err(&fimc->m2m.v4l2_dev, "queue (%d) busy\n", f->type); 980 970 return -EBUSY; 981 971 } ··· 995 985 if (!frame->fmt) 996 986 return -EINVAL; 997 987 998 - for (i = 0; i < frame->fmt->colplanes; i++) 999 - frame->payload[i] = pix->plane_fmt[i].bytesperline * pix->height; 988 + for (i = 0; i < frame->fmt->colplanes; i++) { 989 + frame->payload[i] = 990 + (pix->width * pix->height * frame->fmt->depth[i]) / 8; 991 + } 1000 992 1001 993 frame->f_width = pix->plane_fmt[0].bytesperline * 8 / 1002 994 frame->fmt->depth[0]; ··· 1762 1750 } 1763 1751 1764 1752 /* Image pixel limits, similar across several FIMC HW revisions. */ 1765 - static struct fimc_pix_limit s5p_pix_limit[3] = { 1753 + static struct fimc_pix_limit s5p_pix_limit[4] = { 1766 1754 [0] = { 1767 1755 .scaler_en_w = 3264, 1768 1756 .scaler_dis_w = 8192, ··· 1785 1773 .in_rot_en_h = 1280, 1786 1774 .in_rot_dis_w = 8192, 1787 1775 .out_rot_en_w = 1280, 1776 + .out_rot_dis_w = 1920, 1777 + }, 1778 + [3] = { 1779 + .scaler_en_w = 1920, 1780 + .scaler_dis_w = 8192, 1781 + .in_rot_en_h = 1366, 1782 + .in_rot_dis_w = 8192, 1783 + .out_rot_en_w = 1366, 1788 1784 .out_rot_dis_w = 1920, 1789 1785 }, 1790 1786 }; ··· 1847 1827 .pix_limit = &s5p_pix_limit[2], 1848 1828 }; 1849 1829 1850 - static struct samsung_fimc_variant fimc0_variant_s5pv310 = { 1830 + static struct samsung_fimc_variant fimc0_variant_exynos4 = { 1851 1831 .pix_hoff = 1, 1852 1832 .has_inp_rot = 1, 1853 1833 .has_out_rot = 1, ··· 1860 1840 .pix_limit = &s5p_pix_limit[1], 1861 1841 }; 1862 1842 1863 - static struct samsung_fimc_variant fimc2_variant_s5pv310 = { 1843 + static struct samsung_fimc_variant fimc2_variant_exynos4 = { 1864 1844 .pix_hoff = 1, 1865 1845 .has_cistatus2 = 1, 1866 1846 .has_mainscaler_ext = 1, ··· 1868 1848 .min_out_pixsize = 16, 1869 1849 .hor_offs_align = 1, 1870 1850 .out_buf_count = 32, 1871 - .pix_limit = &s5p_pix_limit[2], 1851 + .pix_limit = &s5p_pix_limit[3], 1872 1852 }; 1873 1853 1874 1854 /* S5PC100 */ ··· 1894 1874 }; 1895 1875 1896 1876 /* S5PV310, S5PC210 */ 1897 - static struct samsung_fimc_driverdata fimc_drvdata_s5pv310 = { 1877 + static struct samsung_fimc_driverdata fimc_drvdata_exynos4 = { 1898 1878 .variant = { 1899 - [0] = &fimc0_variant_s5pv310, 1900 - [1] = &fimc0_variant_s5pv310, 1901 - [2] = &fimc0_variant_s5pv310, 1902 - [3] = &fimc2_variant_s5pv310, 1879 + [0] = &fimc0_variant_exynos4, 1880 + [1] = &fimc0_variant_exynos4, 1881 + [2] = &fimc0_variant_exynos4, 1882 + [3] = &fimc2_variant_exynos4, 1903 1883 }, 1904 1884 .num_entities = 4, 1905 1885 .lclk_frequency = 166000000UL, ··· 1913 1893 .name = "s5pv210-fimc", 1914 1894 .driver_data = (unsigned long)&fimc_drvdata_s5pv210, 1915 1895 }, { 1916 - .name = "s5pv310-fimc", 1917 - .driver_data = (unsigned long)&fimc_drvdata_s5pv310, 1896 + .name = "exynos4-fimc", 1897 + .driver_data = (unsigned long)&fimc_drvdata_exynos4, 1918 1898 }, 1919 1899 {}, 1920 1900 };
+5 -5
drivers/media/video/sh_mobile_ceu_camera.c
··· 922 922 /* Try 2560x1920, 1280x960, 640x480, 320x240 */ 923 923 mf.width = 2560 >> shift; 924 924 mf.height = 1920 >> shift; 925 - ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, video, 925 + ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, 926 926 s_mbus_fmt, &mf); 927 927 if (ret < 0) 928 928 return ret; ··· 1224 1224 struct v4l2_cropcap cap; 1225 1225 int ret; 1226 1226 1227 - ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, video, 1227 + ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, 1228 1228 s_mbus_fmt, mf); 1229 1229 if (ret < 0) 1230 1230 return ret; ··· 1254 1254 tmp_h = min(2 * tmp_h, max_height); 1255 1255 mf->width = tmp_w; 1256 1256 mf->height = tmp_h; 1257 - ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, video, 1257 + ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, 1258 1258 s_mbus_fmt, mf); 1259 1259 dev_geo(dev, "Camera scaled to %ux%u\n", 1260 1260 mf->width, mf->height); ··· 1658 1658 mf.code = xlate->code; 1659 1659 mf.colorspace = pix->colorspace; 1660 1660 1661 - ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, video, try_mbus_fmt, &mf); 1661 + ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, try_mbus_fmt, &mf); 1662 1662 if (ret < 0) 1663 1663 return ret; 1664 1664 ··· 1682 1682 */ 1683 1683 mf.width = 2560; 1684 1684 mf.height = 1920; 1685 - ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, video, 1685 + ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, 1686 1686 try_mbus_fmt, &mf); 1687 1687 if (ret < 0) { 1688 1688 /* Shouldn't actually happen... */
+9 -2
drivers/media/video/sh_mobile_csi2.c
··· 38 38 void __iomem *base; 39 39 struct platform_device *pdev; 40 40 struct sh_csi2_client_config *client; 41 + unsigned long (*query_bus_param)(struct soc_camera_device *); 42 + int (*set_bus_param)(struct soc_camera_device *, unsigned long); 41 43 }; 42 44 43 45 static int sh_csi2_try_fmt(struct v4l2_subdev *sd, ··· 210 208 case BUS_NOTIFY_BOUND_DRIVER: 211 209 snprintf(priv->subdev.name, V4L2_SUBDEV_NAME_SIZE, "%s%s", 212 210 dev_name(v4l2_dev->dev), ".mipi-csi"); 211 + priv->subdev.grp_id = (long)icd; 213 212 ret = v4l2_device_register_subdev(v4l2_dev, &priv->subdev); 214 213 dev_dbg(dev, "%s(%p): ret(register_subdev) = %d\n", __func__, priv, ret); 215 214 if (ret < 0) ··· 218 215 219 216 priv->client = pdata->clients + i; 220 217 218 + priv->set_bus_param = icd->ops->set_bus_param; 219 + priv->query_bus_param = icd->ops->query_bus_param; 221 220 icd->ops->set_bus_param = sh_csi2_set_bus_param; 222 221 icd->ops->query_bus_param = sh_csi2_query_bus_param; 223 222 ··· 231 226 priv->client = NULL; 232 227 233 228 /* Driver is about to be unbound */ 234 - icd->ops->set_bus_param = NULL; 235 - icd->ops->query_bus_param = NULL; 229 + icd->ops->set_bus_param = priv->set_bus_param; 230 + icd->ops->query_bus_param = priv->query_bus_param; 231 + priv->set_bus_param = NULL; 232 + priv->query_bus_param = NULL; 236 233 237 234 v4l2_device_unregister_subdev(&priv->subdev); 238 235
+5 -2
drivers/media/video/soc_camera.c
··· 996 996 { 997 997 struct i2c_client *client = 998 998 to_i2c_client(to_soc_camera_control(icd)); 999 + struct i2c_adapter *adap = client->adapter; 999 1000 dev_set_drvdata(&icd->dev, NULL); 1000 1001 v4l2_device_unregister_subdev(i2c_get_clientdata(client)); 1001 1002 i2c_unregister_device(client); 1002 - i2c_put_adapter(client->adapter); 1003 + i2c_put_adapter(adap); 1003 1004 } 1004 1005 #else 1005 1006 #define soc_camera_init_i2c(icd, icl) (-ENODEV) ··· 1072 1071 } 1073 1072 } 1074 1073 1074 + sd = soc_camera_to_subdev(icd); 1075 + sd->grp_id = (long)icd; 1076 + 1075 1077 /* At this point client .probe() should have run already */ 1076 1078 ret = soc_camera_init_user_formats(icd); 1077 1079 if (ret < 0) ··· 1096 1092 goto evidstart; 1097 1093 1098 1094 /* Try to improve our guess of a reasonable window format */ 1099 - sd = soc_camera_to_subdev(icd); 1100 1095 if (!v4l2_subdev_call(sd, video, g_mbus_fmt, &mf)) { 1101 1096 icd->user_width = mf.width; 1102 1097 icd->user_height = mf.height;
+10 -5
drivers/media/video/v4l2-dev.c
··· 389 389 video_get(vdev); 390 390 mutex_unlock(&videodev_lock); 391 391 #if defined(CONFIG_MEDIA_CONTROLLER) 392 - if (vdev->v4l2_dev && vdev->v4l2_dev->mdev) { 392 + if (vdev->v4l2_dev && vdev->v4l2_dev->mdev && 393 + vdev->vfl_type != VFL_TYPE_SUBDEV) { 393 394 entity = media_entity_get(&vdev->entity); 394 395 if (!entity) { 395 396 ret = -EBUSY; ··· 416 415 /* decrease the refcount in case of an error */ 417 416 if (ret) { 418 417 #if defined(CONFIG_MEDIA_CONTROLLER) 419 - if (vdev->v4l2_dev && vdev->v4l2_dev->mdev) 418 + if (vdev->v4l2_dev && vdev->v4l2_dev->mdev && 419 + vdev->vfl_type != VFL_TYPE_SUBDEV) 420 420 media_entity_put(entity); 421 421 #endif 422 422 video_put(vdev); ··· 439 437 mutex_unlock(vdev->lock); 440 438 } 441 439 #if defined(CONFIG_MEDIA_CONTROLLER) 442 - if (vdev->v4l2_dev && vdev->v4l2_dev->mdev) 440 + if (vdev->v4l2_dev && vdev->v4l2_dev->mdev && 441 + vdev->vfl_type != VFL_TYPE_SUBDEV) 443 442 media_entity_put(&vdev->entity); 444 443 #endif 445 444 /* decrease the refcount unconditionally since the release() ··· 689 686 690 687 #if defined(CONFIG_MEDIA_CONTROLLER) 691 688 /* Part 5: Register the entity. */ 692 - if (vdev->v4l2_dev && vdev->v4l2_dev->mdev) { 689 + if (vdev->v4l2_dev && vdev->v4l2_dev->mdev && 690 + vdev->vfl_type != VFL_TYPE_SUBDEV) { 693 691 vdev->entity.type = MEDIA_ENT_T_DEVNODE_V4L; 694 692 vdev->entity.name = vdev->name; 695 693 vdev->entity.v4l.major = VIDEO_MAJOR; ··· 737 733 return; 738 734 739 735 #if defined(CONFIG_MEDIA_CONTROLLER) 740 - if (vdev->v4l2_dev && vdev->v4l2_dev->mdev) 736 + if (vdev->v4l2_dev && vdev->v4l2_dev->mdev && 737 + vdev->vfl_type != VFL_TYPE_SUBDEV) 741 738 media_device_unregister_entity(&vdev->entity); 742 739 #endif 743 740
+12 -5
drivers/media/video/videobuf2-core.c
··· 37 37 #define call_qop(q, op, args...) \ 38 38 (((q)->ops->op) ? ((q)->ops->op(args)) : 0) 39 39 40 + #define V4L2_BUFFER_STATE_FLAGS (V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_QUEUED | \ 41 + V4L2_BUF_FLAG_DONE | V4L2_BUF_FLAG_ERROR) 42 + 40 43 /** 41 44 * __vb2_buf_mem_alloc() - allocate video memory for the given buffer 42 45 */ ··· 54 51 for (plane = 0; plane < vb->num_planes; ++plane) { 55 52 mem_priv = call_memop(q, plane, alloc, q->alloc_ctx[plane], 56 53 plane_sizes[plane]); 57 - if (!mem_priv) 54 + if (IS_ERR_OR_NULL(mem_priv)) 58 55 goto free; 59 56 60 57 /* Associate allocator private data with this plane */ ··· 287 284 struct vb2_queue *q = vb->vb2_queue; 288 285 int ret = 0; 289 286 290 - /* Copy back data such as timestamp, input, etc. */ 287 + /* Copy back data such as timestamp, flags, input, etc. */ 291 288 memcpy(b, &vb->v4l2_buf, offsetof(struct v4l2_buffer, m)); 292 289 b->input = vb->v4l2_buf.input; 293 290 b->reserved = vb->v4l2_buf.reserved; ··· 316 313 b->m.userptr = vb->v4l2_planes[0].m.userptr; 317 314 } 318 315 319 - b->flags = 0; 316 + /* 317 + * Clear any buffer state related flags. 318 + */ 319 + b->flags &= ~V4L2_BUFFER_STATE_FLAGS; 320 320 321 321 switch (vb->state) { 322 322 case VB2_BUF_STATE_QUEUED: ··· 525 519 num_buffers = min_t(unsigned int, req->count, VIDEO_MAX_FRAME); 526 520 memset(plane_sizes, 0, sizeof(plane_sizes)); 527 521 memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx)); 522 + q->memory = req->memory; 528 523 529 524 /* 530 525 * Ask the driver how many buffers and planes per buffer it requires. ··· 566 559 */ 567 560 ret = num_buffers; 568 561 } 569 - 570 - q->memory = req->memory; 571 562 572 563 /* 573 564 * Return the number of successfully allocated buffers ··· 720 715 721 716 vb->v4l2_buf.field = b->field; 722 717 vb->v4l2_buf.timestamp = b->timestamp; 718 + vb->v4l2_buf.input = b->input; 719 + vb->v4l2_buf.flags = b->flags & ~V4L2_BUFFER_STATE_FLAGS; 723 720 724 721 return 0; 725 722 }
+1 -1
drivers/media/video/videobuf2-dma-contig.c
··· 46 46 GFP_KERNEL); 47 47 if (!buf->vaddr) { 48 48 dev_err(conf->dev, "dma_alloc_coherent of size %ld failed\n", 49 - buf->size); 49 + size); 50 50 kfree(buf); 51 51 return ERR_PTR(-ENOMEM); 52 52 }
+5 -2
include/linux/v4l2-mediabus.h
··· 47 47 V4L2_MBUS_FMT_RGB565_2X8_BE = 0x1007, 48 48 V4L2_MBUS_FMT_RGB565_2X8_LE = 0x1008, 49 49 50 - /* YUV (including grey) - next is 0x2013 */ 50 + /* YUV (including grey) - next is 0x2014 */ 51 51 V4L2_MBUS_FMT_Y8_1X8 = 0x2001, 52 52 V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002, 53 53 V4L2_MBUS_FMT_VYUY8_1_5X8 = 0x2003, ··· 60 60 V4L2_MBUS_FMT_Y10_1X10 = 0x200a, 61 61 V4L2_MBUS_FMT_YUYV10_2X10 = 0x200b, 62 62 V4L2_MBUS_FMT_YVYU10_2X10 = 0x200c, 63 + V4L2_MBUS_FMT_Y12_1X12 = 0x2013, 63 64 V4L2_MBUS_FMT_UYVY8_1X16 = 0x200f, 64 65 V4L2_MBUS_FMT_VYUY8_1X16 = 0x2010, 65 66 V4L2_MBUS_FMT_YUYV8_1X16 = 0x2011, ··· 68 67 V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d, 69 68 V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e, 70 69 71 - /* Bayer - next is 0x3013 */ 70 + /* Bayer - next is 0x3015 */ 72 71 V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001, 72 + V4L2_MBUS_FMT_SGBRG8_1X8 = 0x3013, 73 73 V4L2_MBUS_FMT_SGRBG8_1X8 = 0x3002, 74 + V4L2_MBUS_FMT_SRGGB8_1X8 = 0x3014, 74 75 V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 = 0x300b, 75 76 V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 = 0x300c, 76 77 V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 = 0x3009,
+1
include/linux/videodev2.h
··· 308 308 #define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */ 309 309 #define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */ 310 310 #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ 311 + #define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */ 311 312 #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ 312 313 313 314 /* Palette formats */
+1 -1
include/media/v4l2-device.h
··· 163 163 ({ \ 164 164 struct v4l2_subdev *__sd; \ 165 165 __v4l2_device_call_subdevs_until_err_p(v4l2_dev, __sd, cond, o, \ 166 - f, args...); \ 166 + f , ##args); \ 167 167 }) 168 168 169 169 /* Call the specified callback for all subdevs matching grp_id (if 0, then