DMABUF doesn't work when frame size not equal to the size of GPU bo
Hi all, (My environment is intel platform, HD4000 GPU, kernel 3.10.19, logitech 270 webcam) As title said, I discover this issue when I run the program shown by Laurent Pinchart: http://www.mail-archive.com/linux-media@vger.kernel.org/msg54806.html If the frame is (width, height) = (640, 480), DMABUF works well. If the frame is (width, height) = (160, 120), v4lfd receives no event. And I dig into drm kernel code, find that: i915_gem_create will create a GPU buffer object on intel platform. The size of GPU bo will be bigger than frame size, for the reason that i915_gem_create will roundup the bo size to multiple of PAGE_SIZE when the frame is (width, height) = (160, 120). For (width, height) = (640, 480), the frame size is already multiple of PAGE_SIZE, so GPU bo is exactly equal to frame size. I also dump the uvc driver infomation, there is some infomation i think maybe important: uvcvideo: Stream 1 error event 07 01 len 4 Looking forward to the discussion! Thanks, Chuanbo Weng -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
cron job: media_tree daily build: ERRORS
This message is generated daily by a cron job that builds media_tree for the kernels and architectures in the list below. Results of the daily build of media_tree: date: Wed Dec 25 04:00:29 CET 2013 git branch: test git hash: 7d459937dc09bb8e448d9985ec4623779427d8a5 gcc version:i686-linux-gcc (GCC) 4.8.2 sparse version: 0.4.5-rc1 host hardware: x86_64 host os:3.12-0.slh.2-amd64 linux-git-arm-at91: OK linux-git-arm-davinci: ERRORS linux-git-arm-exynos: OK linux-git-arm-mx: OK linux-git-arm-omap: OK linux-git-arm-omap1: OK linux-git-arm-pxa: OK linux-git-blackfin: OK linux-git-i686: OK linux-git-m32r: OK linux-git-mips: OK linux-git-powerpc64: OK linux-git-sh: OK linux-git-x86_64: OK linux-2.6.31.14-i686: WARNINGS linux-2.6.32.27-i686: WARNINGS linux-2.6.33.7-i686: WARNINGS linux-2.6.34.7-i686: WARNINGS linux-2.6.35.9-i686: WARNINGS linux-2.6.36.4-i686: WARNINGS linux-2.6.37.6-i686: WARNINGS linux-2.6.38.8-i686: WARNINGS linux-2.6.39.4-i686: WARNINGS linux-3.0.60-i686: WARNINGS linux-3.1.10-i686: WARNINGS linux-3.2.37-i686: OK linux-3.3.8-i686: OK linux-3.4.27-i686: WARNINGS linux-3.5.7-i686: WARNINGS linux-3.6.11-i686: WARNINGS linux-3.7.4-i686: WARNINGS linux-3.8-i686: WARNINGS linux-3.9.2-i686: WARNINGS linux-3.10.1-i686: OK linux-3.11.1-i686: OK linux-3.12-i686: OK linux-3.13-rc1-i686: OK linux-2.6.31.14-x86_64: WARNINGS linux-2.6.32.27-x86_64: WARNINGS linux-2.6.33.7-x86_64: WARNINGS linux-2.6.34.7-x86_64: WARNINGS linux-2.6.35.9-x86_64: WARNINGS linux-2.6.36.4-x86_64: WARNINGS linux-2.6.37.6-x86_64: WARNINGS linux-2.6.38.8-x86_64: WARNINGS linux-2.6.39.4-x86_64: WARNINGS linux-3.0.60-x86_64: WARNINGS linux-3.1.10-x86_64: WARNINGS linux-3.2.37-x86_64: OK linux-3.3.8-x86_64: OK linux-3.4.27-x86_64: WARNINGS linux-3.5.7-x86_64: WARNINGS linux-3.6.11-x86_64: WARNINGS linux-3.7.4-x86_64: WARNINGS linux-3.8-x86_64: WARNINGS linux-3.9.2-x86_64: WARNINGS linux-3.10.1-x86_64: WARNINGS linux-3.11.1-x86_64: WARNINGS linux-3.12-x86_64: WARNINGS linux-3.13-rc1-x86_64: WARNINGS apps: OK spec-git: OK sparse version: 0.4.5-rc1 sparse: ERRORS Detailed results are available here: http://www.xs4all.nl/~hverkuil/logs/Wednesday.log Full logs are available here: http://www.xs4all.nl/~hverkuil/logs/Wednesday.tar.bz2 The Media Infrastructure API from this daily build is here: http://www.xs4all.nl/~hverkuil/spec/media.html -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 13/19] media: dvb_core: slight optimization of addr compare
Use possibly more efficient ether_addr_equal instead of memcmp. Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Yang Yingliang Signed-off-by: Ding Tianhong --- drivers/media/dvb-core/dvb_net.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c index f91c80c..3dfc33b 100644 --- a/drivers/media/dvb-core/dvb_net.c +++ b/drivers/media/dvb-core/dvb_net.c @@ -179,7 +179,7 @@ static __be16 dvb_net_eth_type_trans(struct sk_buff *skb, eth = eth_hdr(skb); if (*eth->h_dest & 1) { - if(memcmp(eth->h_dest,dev->broadcast, ETH_ALEN)==0) + if(ether_addr_equal(eth->h_dest,dev->broadcast)) skb->pkt_type=PACKET_BROADCAST; else skb->pkt_type=PACKET_MULTICAST; @@ -674,11 +674,11 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) if (priv->rx_mode != RX_MODE_PROMISC) { if (priv->ule_skb->data[0] & 0x01) { /* multicast or broadcast */ - if (memcmp(priv->ule_skb->data, bc_addr, ETH_ALEN)) { + if (!ether_addr_equal(priv->ule_skb->data, bc_addr)) { /* multicast */ if (priv->rx_mode == RX_MODE_MULTI) { int i; - for(i = 0; i < priv->multi_num && memcmp(priv->ule_skb->data, priv->multi_macs[i], ETH_ALEN); i++) + for(i = 0; i < priv->multi_num && !ether_addr_equal(priv->ule_skb->data, priv->multi_macs[i]); i++) ; if (i == priv->multi_num) drop = 1; @@ -688,7 +688,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) } /* else: broadcast */ } - else if (memcmp(priv->ule_skb->data, dev->dev_addr, ETH_ALEN)) + else if (!ether_addr_equal(priv->ule_skb->data, dev->dev_addr)) drop = 1; /* else: destination address matches the MAC address of our receiver device */ } -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC PATCH 2/3] si2165: Add first driver version
Moi Matthias On 13.12.2013 09:02, Matthias Schwarzott wrote: DVB-T: works with 8MHz BW channels in germany DVB-C: works with QAM256 I didn't tested with a modulator, but only live signals. DVB-T seems to work. DVB-C didn't find any channels. Symbol rate is 6875000 and both QAM128 and QAM256 modulations. I suspect symbol rate... Symbol rate is like a bandwidth in case of DVB-T (bw could be calculated easily from sr just adding rolloff factor). TODO: - Extract firmware into file Check from windows driver how it is there. There is many tricks to do that, but I prefer hexdump. hexdump -C WinDriver.sys | grep "AA BB CC" hexdump -s 0x27588 -n 2 -e '63/1 "%02x "' -e '"\n"' WinDriver.sys After that implement extractor to get_dvb_firmware script. - Verify lock is correctly detected - Strength and Noise reporting Statistics are not mandatory, you could implement later. Signal strength is difficult task for demod. That could be done using RF and IF AGC feedbacks, but it is still very rough estimate. AGC feedbacks are also very much RF tuner dependent. - Set correct bandwidth / qam parameters That was likely reason DVB-C didn't worked :) - what dvb-c standard is to be announced Annex A is normal DVB-C, with 8 MHz BW. There is also Annex B and C, another was 6 MHz BW and the other has a little bit different rolloff factor. IIRC B is 6MHz and C is like A, but different rolloff. - Compiler warnings yeah, tons of those. Kernel has also tool for checking style etc. issues scripts/checkpatch.pl. You must use it too. You have put all logic to single file. It looks like that chips has integrated two physically rather separately demods, one for DVB-T and one for DVB-C. If there is not much registers that are programmed just similarly in both cases, please consider splitting DVB-C and DVB-T to own files (and maybe one file for general stuff and select weather to call T or C). Driver is even now quite big, almost 3000 LOC in that single file. regards Antti -- http://palosaari.fi/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
DS3000/TS2020 diseqc problem
Hello, I have a geniatech hdstar device with ubuntu gnome 13.10x64 kernel 3.11 My setup is two sats on disecq switch turksat s42e : lnb1 hellassat s39e : lnb2 I can't scan channels with scan-s2,dvbscan,w_scan,dvbv5-scan sometimes device can lock on transporder but can't get channel information only kaffeine can scan both satellites and can tune channels if I try to scan with scaning tools after that device will be unavailable for tuning need to re-connect I tried three different firmware and tried lastest linux-media source but no lock here is some debug log working log [ 741.740143] ds3000_readreg: read reg 0xd1, value 0x0f [ 741.740361] ds3000_read_status: status = 0x0f [ 714.654175] ds3000_writereg: write reg 0xc4, value 0x05 [ 714.654606] ds3000_writereg: write reg 0xc7, value 0x24 not working log [ 1460.754905] ds3000_readreg: read reg 0xd1, value 0x00 [ 1460.755156] ds3000_read_status: status = 0x00 [ 1460.905801] ds3000_readreg: read reg 0xd1, value 0x00 [ 1460.906047] ds3000_read_status: status = 0x00 [ 1460.954073] ds3000_readreg: read reg 0xd1, value 0x00 [ 1460.954287] ds3000_read_status: status = 0x00 [ 1484.681581] ds3000_writereg: write reg 0x03, value 0x12 [ 1484.682452] ds3000_writereg: write reg 0x03, value 0x02 [ 1484.682658] ds3000_writereg: write reg 0x03, value 0x12 [ 1484.683563] ds3000_writereg: write reg 0x03, value 0x02 [ 1802.083839] ds3000_readreg: read reg 0xa2, value 0x86 [ 1802.083839] ds3000_writereg: write reg 0xa2, value 0x84 [ 1802.099360] ds3000_send_diseqc_msg(0xe0, 0x10, 0x38, 0xf2ds3000_readreg: read reg 0xa2, value 0x84 [ 1802.099937] ds3000_writereg: write reg 0xa2, value 0x04 [ 1802.100375] ds3000_writereg: write reg 0xa3, value 0xe0 thanks -- Olcay K. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] m88rs2000: set symbol rate accurately.
Current setting of symbol rate is not very actuate causing loss of lock. Covert temp to u64 and use mclk to calculate from big number. Calculate symbol rate by dividing symbol rate by 1000 times 1 << 24 and dividing sum by mclk. Add other symbol rate settings to function registers 0xa0-0xa3. In set_frontend add changes to register 0xf1 this must be done prior call to fe_reset. Register 0x00 doesn't need a second write of 0x1 Applied after patch m88rs2000: add m88rs2000_set_carrieroffset Signed-off-by: Malcolm Priestley Cc: sta...@vger.kernel.org # v3.9+ --- drivers/media/dvb-frontends/m88rs2000.c | 42 - 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/drivers/media/dvb-frontends/m88rs2000.c b/drivers/media/dvb-frontends/m88rs2000.c index 8091653..02699c1 100644 --- a/drivers/media/dvb-frontends/m88rs2000.c +++ b/drivers/media/dvb-frontends/m88rs2000.c @@ -160,24 +160,44 @@ static int m88rs2000_set_symbolrate(struct dvb_frontend *fe, u32 srate) { struct m88rs2000_state *state = fe->demodulator_priv; int ret; - u32 temp; + u64 temp; + u32 mclk; u8 b[3]; if ((srate < 100) || (srate > 4500)) return -EINVAL; + mclk = m88rs2000_get_mclk(fe); + if (!mclk) + return -EINVAL; + temp = srate / 1000; - temp *= 11831; - temp /= 68; - temp -= 3; + temp *= 1 << 24; + + do_div(temp, mclk); b[0] = (u8) (temp >> 16) & 0xff; b[1] = (u8) (temp >> 8) & 0xff; b[2] = (u8) temp & 0xff; + ret = m88rs2000_writereg(state, 0x93, b[2]); ret |= m88rs2000_writereg(state, 0x94, b[1]); ret |= m88rs2000_writereg(state, 0x95, b[0]); + if (srate > 1000) + ret |= m88rs2000_writereg(state, 0xa0, 0x20); + else + ret |= m88rs2000_writereg(state, 0xa0, 0x60); + + ret |= m88rs2000_writereg(state, 0xa1, 0xe0); + + if (srate > 1200) + ret |= m88rs2000_writereg(state, 0xa3, 0x20); + else if (srate > 280) + ret |= m88rs2000_writereg(state, 0xa3, 0x98); + else + ret |= m88rs2000_writereg(state, 0xa3, 0x90); + deb_info("m88rs2000: m88rs2000_set_symbolrate\n"); return ret; } @@ -307,8 +327,6 @@ struct inittab m88rs2000_shutdown[] = { struct inittab fe_reset[] = { {DEMOD_WRITE, 0x00, 0x01}, - {DEMOD_WRITE, 0xf1, 0xbf}, - {DEMOD_WRITE, 0x00, 0x01}, {DEMOD_WRITE, 0x20, 0x81}, {DEMOD_WRITE, 0x21, 0x80}, {DEMOD_WRITE, 0x10, 0x33}, @@ -351,9 +369,6 @@ struct inittab fe_trigger[] = { {DEMOD_WRITE, 0x9b, 0x64}, {DEMOD_WRITE, 0x9e, 0x00}, {DEMOD_WRITE, 0x9f, 0xf8}, - {DEMOD_WRITE, 0xa0, 0x20}, - {DEMOD_WRITE, 0xa1, 0xe0}, - {DEMOD_WRITE, 0xa3, 0x38}, {DEMOD_WRITE, 0x98, 0xff}, {DEMOD_WRITE, 0xc0, 0x0f}, {DEMOD_WRITE, 0x89, 0x01}, @@ -625,8 +640,13 @@ static int m88rs2000_set_frontend(struct dvb_frontend *fe) if (ret < 0) return -ENODEV; - /* Reset Demod */ - ret = m88rs2000_tab_set(state, fe_reset); + /* Reset demod by symbol rate */ + if (c->symbol_rate > 2750) + ret = m88rs2000_writereg(state, 0xf1, 0xa4); + else + ret = m88rs2000_writereg(state, 0xf1, 0xbf); + + ret |= m88rs2000_tab_set(state, fe_reset); if (ret < 0) return -ENODEV; -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/2] m88rs2000: add m88rs2000_set_carrieroffset
Set the carrier offset correctly using the default mclk values. Add function m88rs2000_get_mclk to calculate the mclk value against crystal frequency which will later be used for other functions. Add function m88rs2000_set_carrieroffset to calculate and set the offset value. variable offset becomes a signed value. Register 0x86 is set the appropriate value according to remainder value of frequency % 192857 calculation as shown. Signed-off-by: Malcolm Priestley Cc: sta...@vger.kernel.org # v3.9+ --- drivers/media/dvb-frontends/m88rs2000.c | 77 - drivers/media/dvb-frontends/m88rs2000.h | 2 + 2 files changed, 59 insertions(+), 20 deletions(-) diff --git a/drivers/media/dvb-frontends/m88rs2000.c b/drivers/media/dvb-frontends/m88rs2000.c index 4da5272..8091653 100644 --- a/drivers/media/dvb-frontends/m88rs2000.c +++ b/drivers/media/dvb-frontends/m88rs2000.c @@ -110,6 +110,52 @@ static u8 m88rs2000_readreg(struct m88rs2000_state *state, u8 reg) return b1[0]; } +static u32 m88rs2000_get_mclk(struct dvb_frontend *fe) +{ + struct m88rs2000_state *state = fe->demodulator_priv; + u32 mclk; + u8 reg; + /* Must not be 0x00 or 0xff */ + reg = m88rs2000_readreg(state, 0x86); + if (!reg || reg == 0xff) + return 0; + + reg /= 2; + reg += 1; + + mclk = (u32)(reg * RS2000_FE_CRYSTAL_KHZ + 28 / 2) / 28; + + return mclk; +} + +static int m88rs2000_set_carrieroffset(struct dvb_frontend *fe, s16 offset) +{ + struct m88rs2000_state *state = fe->demodulator_priv; + u32 mclk; + s32 tmp; + u8 reg; + int ret; + + mclk = m88rs2000_get_mclk(fe); + if (!mclk) + return -EINVAL; + + tmp = (offset * 4096 + (s32)mclk / 2) / (s32)mclk; + if (tmp < 0) + tmp += 4096; + + /* Carrier Offset */ + ret = m88rs2000_writereg(state, 0x9c, (u8)(tmp >> 4)); + + reg = m88rs2000_readreg(state, 0x9d); + reg &= 0xf; + reg |= (u8)(tmp & 0xf) << 4; + + ret |= m88rs2000_writereg(state, 0x9d, reg); + + return ret; +} + static int m88rs2000_set_symbolrate(struct dvb_frontend *fe, u32 srate) { struct m88rs2000_state *state = fe->demodulator_priv; @@ -540,9 +586,8 @@ static int m88rs2000_set_frontend(struct dvb_frontend *fe) struct dtv_frontend_properties *c = &fe->dtv_property_cache; fe_status_t status; int i, ret = 0; - s32 tmp; u32 tuner_freq; - u16 offset = 0; + s16 offset = 0; u8 reg; state->no_lock_count = 0; @@ -567,26 +612,18 @@ static int m88rs2000_set_frontend(struct dvb_frontend *fe) if (ret < 0) return -ENODEV; - offset = tuner_freq - c->frequency; + offset = (s16)((s32)tuner_freq - c->frequency); - /* calculate offset assuming 96000kHz*/ - tmp = offset; - tmp *= 65536; - - tmp = (2 * tmp + 96000) / (2 * 96000); - if (tmp < 0) - tmp += 65536; - - offset = tmp & 0x; - - ret = m88rs2000_writereg(state, 0x9a, 0x30); - /* Unknown usually 0xc6 sometimes 0xc1 */ - reg = m88rs2000_readreg(state, 0x86); - ret |= m88rs2000_writereg(state, 0x86, reg); - /* Offset lower nibble always 0 */ - ret |= m88rs2000_writereg(state, 0x9c, (offset >> 8)); - ret |= m88rs2000_writereg(state, 0x9d, offset & 0xf0); + /* default mclk value 96.4285 * 2 * 1000 = 192857 */ + if (((c->frequency % 192857) >= (192857 - 3000)) || + (c->frequency % 192857) <= 3000) + ret = m88rs2000_writereg(state, 0x86, 0xc2); + else + ret = m88rs2000_writereg(state, 0x86, 0xc6); + ret |= m88rs2000_set_carrieroffset(fe, offset); + if (ret < 0) + return -ENODEV; /* Reset Demod */ ret = m88rs2000_tab_set(state, fe_reset); diff --git a/drivers/media/dvb-frontends/m88rs2000.h b/drivers/media/dvb-frontends/m88rs2000.h index 14ce31e..0a50ea9 100644 --- a/drivers/media/dvb-frontends/m88rs2000.h +++ b/drivers/media/dvb-frontends/m88rs2000.h @@ -53,6 +53,8 @@ static inline struct dvb_frontend *m88rs2000_attach( } #endif /* CONFIG_DVB_M88RS2000 */ +#define RS2000_FE_CRYSTAL_KHZ 27000 + enum { DEMOD_WRITE = 0x1, WRITE_DELAY = 0x10, -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH for v3.14] sn9c102: fix build dependency
This driver should only build if MEDIA_USB_SUPPORT is set. Signed-off-by: Hans Verkuil Reported-by: Jim Davis Reported-by: kbuild test robot --- drivers/staging/media/sn9c102/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/sn9c102/Kconfig b/drivers/staging/media/sn9c102/Kconfig index d8ae235..c9aba59 100644 --- a/drivers/staging/media/sn9c102/Kconfig +++ b/drivers/staging/media/sn9c102/Kconfig @@ -1,6 +1,6 @@ config USB_SN9C102 tristate "USB SN9C1xx PC Camera Controller support (DEPRECATED)" - depends on VIDEO_V4L2 + depends on VIDEO_V4L2 && MEDIA_USB_SUPPORT ---help--- This driver is DEPRECATED, please use the gspca sonixb and sonixj modules instead. -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/3] omap3isp: Refactor modules stop failure handling
Modules failing to stop are fatal errors for the preview engine only. Flag that condition separately from the other stop failures to prepare support for more fatal errors. Signed-off-by: Laurent Pinchart --- drivers/media/platform/omap3isp/isp.c | 36 +-- drivers/media/platform/omap3isp/isp.h | 2 ++ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index 7e09c1d..5807185 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -873,15 +873,12 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe, unsigned long flags; int ret; - /* If the preview engine crashed it might not respond to read/write -* operations on the L4 bus. This would result in a bus fault and a -* kernel oops. Refuse to start streaming in that case. This check must -* be performed before the loop below to avoid starting entities if the -* pipeline won't start anyway (those entities would then likely fail to -* stop, making the problem worse). + /* Refuse to start streaming if an entity included in the pipeline has +* crashed. This check must be performed before the loop below to avoid +* starting entities if the pipeline won't start anyway (those entities +* would then likely fail to stop, making the problem worse). */ - if ((pipe->entities & isp->crashed) & - (1U << isp->isp_prev.subdev.entity.id)) + if (pipe->entities & isp->crashed) return -EIO; spin_lock_irqsave(&pipe->lock, flags); @@ -1014,13 +1011,23 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe) else ret = 0; + /* Handle stop failures. An entity that fails to stop can +* usually just be restarted. Flag the stop failure nonetheless +* to trigger an ISP reset the next time the device is released, +* just in case. +* +* The preview engine is a special case. A failure to stop can +* mean a hardware crash. When that happens the preview engine +* won't respond to read/write operations on the L4 bus anymore, +* resulting in a bus fault and a kernel oops next time it gets +* accessed. Mark it as crashed to prevent pipelines including +* it from being started. +*/ if (ret) { dev_info(isp->dev, "Unable to stop %s\n", subdev->name); - /* If the entity failed to stopped, assume it has -* crashed. Mark it as such, the ISP will be reset when -* applications will release it. -*/ - isp->crashed |= 1U << subdev->entity.id; + isp->stop_failure = true; + if (subdev == &isp->isp_prev.subdev) + isp->crashed |= 1U << subdev->entity.id; failure = -ETIMEDOUT; } } @@ -1225,6 +1232,7 @@ static int isp_reset(struct isp_device *isp) udelay(1); } + isp->stop_failure = false; isp->crashed = 0; return 0; } @@ -1636,7 +1644,7 @@ void omap3isp_put(struct isp_device *isp) /* Reset the ISP if an entity has failed to stop. This is the * only way to recover from such conditions. */ - if (isp->crashed) + if (isp->crashed || isp->stop_failure) isp_reset(isp); isp_disable_clocks(isp); } diff --git a/drivers/media/platform/omap3isp/isp.h b/drivers/media/platform/omap3isp/isp.h index 5b91f86..081f5ec 100644 --- a/drivers/media/platform/omap3isp/isp.h +++ b/drivers/media/platform/omap3isp/isp.h @@ -154,6 +154,7 @@ struct isp_xclk { * regions. * @stat_lock: Spinlock for handling statistics * @isp_mutex: Mutex for serializing requests to ISP. + * @stop_failure: Indicates that an entity failed to stop. * @crashed: Bitmask of crashed entities (indexed by entity ID) * @has_context: Context has been saved at least once and can be restored. * @ref_count: Reference count for handling multiple ISP requests. @@ -191,6 +192,7 @@ struct isp_device { /* ISP Obj */ spinlock_t stat_lock; /* common lock for statistic drivers */ struct mutex isp_mutex; /* For handling ref_count field */ + bool stop_failure; u32 crashed; int has_context; int ref_count; -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-
[PATCH 3/3] omap3isp: ccdc: Don't hang when the SBL fails to become idle
Under abnormal conditions (such as glitches on the HSYNC/VSYNC signals) the CCDC output SBL can fail to become idle. The driver currently logs this condition to the kernel log and doesn't restart the CCDC. This results in CCDC video capture hanging without any notification to userspace. Cancel the pipeline and mark the CCDC as crashed instead of hanging. Userspace will be notified of the problem and will then be able to close and reopen the device to trigger a reset of the ISP. Signed-off-by: Laurent Pinchart --- drivers/media/platform/omap3isp/ispccdc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c index 561c991..5db2c88 100644 --- a/drivers/media/platform/omap3isp/ispccdc.c +++ b/drivers/media/platform/omap3isp/ispccdc.c @@ -1516,6 +1516,8 @@ static int ccdc_isr_buffer(struct isp_ccdc_device *ccdc) if (ccdc_sbl_wait_idle(ccdc, 1000)) { dev_info(isp->dev, "CCDC won't become idle!\n"); + isp->crashed |= 1U << ccdc->subdev.entity.id; + omap3isp_pipeline_cancel_stream(pipe); goto done; } -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] omap3isp: Cancel streaming when a fatal error occurs
When a fatal error that prevents any further video streaming occurs in a pipeline, all queued buffers must be marked as erroneous and new buffers must be prevented from being queued. Implement this behaviour with a new omap3isp_pipeline_cancel_stream() function that can be used by submodules to cancel streaming. Signed-off-by: Laurent Pinchart --- drivers/media/platform/omap3isp/isp.c | 17 +++ drivers/media/platform/omap3isp/isp.h | 1 + drivers/media/platform/omap3isp/ispvideo.c | 46 ++ drivers/media/platform/omap3isp/ispvideo.h | 2 ++ 4 files changed, 66 insertions(+) diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index bb4e0a7..7e09c1d 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -1057,6 +1057,23 @@ int omap3isp_pipeline_set_stream(struct isp_pipeline *pipe, } /* + * omap3isp_pipeline_cancel_stream - Cancel stream on a pipeline + * @pipe: ISP pipeline + * + * Cancelling a stream mark all buffers on all video nodes in the pipeline as + * erroneous and makes sure no new buffer can be queued. This function is called + * when a fatal error that prevents any further operation on the pipeline + * occurs. + */ +void omap3isp_pipeline_cancel_stream(struct isp_pipeline *pipe) +{ + if (pipe->input) + omap3isp_video_cancel_stream(pipe->input); + if (pipe->output) + omap3isp_video_cancel_stream(pipe->output); +} + +/* * isp_pipeline_resume - Resume streaming on a pipeline * @pipe: ISP pipeline * diff --git a/drivers/media/platform/omap3isp/isp.h b/drivers/media/platform/omap3isp/isp.h index 72685ad..5b91f86 100644 --- a/drivers/media/platform/omap3isp/isp.h +++ b/drivers/media/platform/omap3isp/isp.h @@ -236,6 +236,7 @@ int omap3isp_module_sync_is_stopping(wait_queue_head_t *wait, int omap3isp_pipeline_set_stream(struct isp_pipeline *pipe, enum isp_pipeline_stream_state state); +void omap3isp_pipeline_cancel_stream(struct isp_pipeline *pipe); void omap3isp_configure_bridge(struct isp_device *isp, enum ccdc_input_entity input, const struct isp_parallel_platform_data *pdata, diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c index 3953aec..856fdf5 100644 --- a/drivers/media/platform/omap3isp/ispvideo.c +++ b/drivers/media/platform/omap3isp/ispvideo.c @@ -411,6 +411,15 @@ static int isp_video_buffer_prepare(struct isp_video_buffer *buf) struct isp_video *video = vfh->video; unsigned long addr; + /* Refuse to prepare the buffer is the video node has registered an +* error. We don't need to take any lock here as the operation is +* inherently racy. The authoritative check will be performed in the +* queue handler, which can't return an error, this check is just a best +* effort to notify userspace as early as possible. +*/ + if (unlikely(video->error)) + return -EIO; + addr = ispmmu_vmap(video->isp, buf->sglist, buf->sglen); if (IS_ERR_VALUE(addr)) return -EIO; @@ -447,6 +456,12 @@ static void isp_video_buffer_queue(struct isp_video_buffer *buf) unsigned int empty; unsigned int start; + if (unlikely(video->error)) { + buf->state = ISP_BUF_STATE_ERROR; + wake_up(&buf->wait); + return; + } + empty = list_empty(&video->dmaqueue); list_add_tail(&buffer->buffer.irqlist, &video->dmaqueue); @@ -569,6 +584,36 @@ struct isp_buffer *omap3isp_video_buffer_next(struct isp_video *video) } /* + * omap3isp_video_cancel_stream - Cancel stream on a video node + * @video: ISP video object + * + * Cancelling a stream mark all buffers on the video node as erroneous and makes + * sure no new buffer can be queued. + */ +void omap3isp_video_cancel_stream(struct isp_video *video) +{ + struct isp_video_queue *queue = video->queue; + unsigned long flags; + + spin_lock_irqsave(&queue->irqlock, flags); + + while (!list_empty(&video->dmaqueue)) { + struct isp_video_buffer *buf; + + buf = list_first_entry(&video->dmaqueue, + struct isp_video_buffer, irqlist); + list_del(&buf->irqlist); + + buf->state = ISP_BUF_STATE_ERROR; + wake_up(&buf->wait); + } + + video->error = true; + + spin_unlock_irqrestore(&queue->irqlock, flags); +} + +/* * omap3isp_video_resume - Perform resume operation on the buffers * @video: ISP video object * @continuous: Pipeline is in single shot mode if 0 or continuous mode otherwise @@ -1105,6 +1150,7 @@ isp_video_streamoff(struct file *file, void *fh, enum v4l2_buf_type type) omap3isp_video_queue_streamof
[PATCH 0/3] OMAP3 ISP: Handle CCDC SBL idle failures gracefully
Hello, This patch set lets the driver recover from a CCDC SBL idle failure. When such a condition is detected all subsequent buffers will be marked as erroneous and the ISP will be reset the next time it gets released by userspace. Pipelines containing the CCDC will fail to start in the meantime. SBL idle failures should not occur during normal operation but have been noticed with noisy sensor sync signals. Laurent Pinchart (3): omap3isp: Cancel streaming when a fatal error occurs omap3isp: Refactor modules stop failure handling omap3isp: ccdc: Don't hang when the SBL fails to become idle drivers/media/platform/omap3isp/isp.c | 53 ++ drivers/media/platform/omap3isp/isp.h | 3 ++ drivers/media/platform/omap3isp/ispccdc.c | 2 ++ drivers/media/platform/omap3isp/ispvideo.c | 46 ++ drivers/media/platform/omap3isp/ispvideo.h | 2 ++ 5 files changed, 92 insertions(+), 14 deletions(-) -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[GIT PULL FOR v3.14] OMAP4 ISS fixes
Hi Mauro, The following changes since commit 7d459937dc09bb8e448d9985ec4623779427d8a5: [media] Add driver for Samsung S5K5BAF camera sensor (2013-12-21 07:01:36 -0200) are available in the git repository at: git://linuxtv.org/pinchartl/media.git omap4iss/next for you to fetch changes up to 7b5084c8f99aea161ab53cce828357912ec80891: v4l: omap4iss: Restore irq flags correctly in omap4iss_video_buffer_next() (2013-12-24 13:23:09 +0100) Dan Carpenter (2): v4l: omap4iss: use snprintf() to make smatch happy v4l: omap4iss: Restore irq flags correctly in omap4iss_video_buffer_next() drivers/staging/media/omap4iss/iss_csi2.c | 3 +-- drivers/staging/media/omap4iss/iss_video.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/3] [media] s5k5baf: Fix checkpatch error
Fixes the following error: ERROR: return is not a function, parentheses are not required FILE: drivers/media/i2c/s5k5baf.c:1353: Signed-off-by: Sachin Kamat --- drivers/media/i2c/s5k5baf.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c index 139bdd4f5dde..974b865c2ee1 100644 --- a/drivers/media/i2c/s5k5baf.c +++ b/drivers/media/i2c/s5k5baf.c @@ -1350,8 +1350,8 @@ static enum selection_rect s5k5baf_get_sel_rect(u32 pad, u32 target) static int s5k5baf_is_bound_target(u32 target) { - return (target == V4L2_SEL_TGT_CROP_BOUNDS || - target == V4L2_SEL_TGT_COMPOSE_BOUNDS); + return target == V4L2_SEL_TGT_CROP_BOUNDS || + target == V4L2_SEL_TGT_COMPOSE_BOUNDS; } static int s5k5baf_get_selection(struct v4l2_subdev *sd, -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/3] [media] s5k5baf: Fix potential NULL pointer dereferencing
Dereference 'fw' after the NULL check. Signed-off-by: Sachin Kamat --- drivers/media/i2c/s5k5baf.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c index 974b865c2ee1..4b838cbd 100644 --- a/drivers/media/i2c/s5k5baf.c +++ b/drivers/media/i2c/s5k5baf.c @@ -548,12 +548,14 @@ static void s5k5baf_synchronize(struct s5k5baf *state, int timeout, u16 addr) static u16 *s5k5baf_fw_get_seq(struct s5k5baf *state, u16 seq_id) { struct s5k5baf_fw *fw = state->fw; - u16 *data = fw->data + 2 * fw->count; + u16 *data; int i; if (fw == NULL) return NULL; + data = fw->data + 2 * fw->count; + for (i = 0; i < fw->count; ++i) { if (fw->seq[i].id == seq_id) return data + fw->seq[i].offset; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] [media] s5k5baf: Fix build warning
Fixes the following warnings: drivers/media/i2c/s5k5baf.c: In function 's5k5baf_fw_parse': drivers/media/i2c/s5k5baf.c:362:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=] drivers/media/i2c/s5k5baf.c:383:4: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' [-Wformat=] Signed-off-by: Sachin Kamat Reported-by: kbuild test robot --- drivers/media/i2c/s5k5baf.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c index e3b44a87460b..139bdd4f5dde 100644 --- a/drivers/media/i2c/s5k5baf.c +++ b/drivers/media/i2c/s5k5baf.c @@ -359,7 +359,7 @@ static int s5k5baf_fw_parse(struct device *dev, struct s5k5baf_fw **fw, int ret; if (count < S5K5BAG_FW_TAG_LEN + 1) { - dev_err(dev, "firmware file too short (%d)\n", count); + dev_err(dev, "firmware file too short (%zu)\n", count); return -EINVAL; } @@ -379,7 +379,7 @@ static int s5k5baf_fw_parse(struct device *dev, struct s5k5baf_fw **fw, f = (struct s5k5baf_fw *)d; if (count < 1 + 2 * f->count) { - dev_err(dev, "invalid firmware header (count=%d size=%d)\n", + dev_err(dev, "invalid firmware header (count=%d size=%zu)\n", f->count, 2 * (count + S5K5BAG_FW_TAG_LEN)); return -EINVAL; } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 14/20] media: dvb_core: slight optimization of addr compare
Use possibly more efficient ether_addr_equal instead of memcmp. Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Yang Yingliang Signed-off-by: Ding Tianhong --- drivers/media/dvb-core/dvb_net.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c index f91c80c..3dfc33b 100644 --- a/drivers/media/dvb-core/dvb_net.c +++ b/drivers/media/dvb-core/dvb_net.c @@ -179,7 +179,7 @@ static __be16 dvb_net_eth_type_trans(struct sk_buff *skb, eth = eth_hdr(skb); if (*eth->h_dest & 1) { - if(memcmp(eth->h_dest,dev->broadcast, ETH_ALEN)==0) + if(ether_addr_equal(eth->h_dest,dev->broadcast)) skb->pkt_type=PACKET_BROADCAST; else skb->pkt_type=PACKET_MULTICAST; @@ -674,11 +674,11 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) if (priv->rx_mode != RX_MODE_PROMISC) { if (priv->ule_skb->data[0] & 0x01) { /* multicast or broadcast */ - if (memcmp(priv->ule_skb->data, bc_addr, ETH_ALEN)) { + if (!ether_addr_equal(priv->ule_skb->data, bc_addr)) { /* multicast */ if (priv->rx_mode == RX_MODE_MULTI) { int i; - for(i = 0; i < priv->multi_num && memcmp(priv->ule_skb->data, priv->multi_macs[i], ETH_ALEN); i++) + for(i = 0; i < priv->multi_num && !ether_addr_equal(priv->ule_skb->data, priv->multi_macs[i]); i++) ; if (i == priv->multi_num) drop = 1; @@ -688,7 +688,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) } /* else: broadcast */ } - else if (memcmp(priv->ule_skb->data, dev->dev_addr, ETH_ALEN)) + else if (!ether_addr_equal(priv->ule_skb->data, dev->dev_addr)) drop = 1; /* else: destination address matches the MAC address of our receiver device */ } -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[GIT PULL for v3.14] mem2mem patches
The following changes since commit 7d459937dc09bb8e448d9985ec4623779427d8a5: [media] Add driver for Samsung S5K5BAF camera sensor (2013-12-21 07:01:36 -0200) are available in the git repository at: git://linuxtv.org/kdebski/media.git master for you to fetch changes up to 0f6616ebb7a04219ad7aa84dd9ff9c7ac9323529: s5p-mfc: Add controls to set vp8 enc profile (2013-12-24 10:37:27 +0100) Arun Kumar K (1): s5p-mfc: Add QP setting support for vp8 encoder Kiran AVND (1): s5p-mfc: Add controls to set vp8 enc profile Marek Szyprowski (1): media: s5p_mfc: remove s5p_mfc_get_node_type() function Shaik Ameer Basha (4): exynos-scaler: Add new driver for Exynos5 SCALER exynos-scaler: Add core functionality for the SCALER driver exynos-scaler: Add m2m functionality for the SCALER driver exynos-scaler: Add DT bindings for SCALER driver Documentation/DocBook/media/v4l/controls.xml | 41 + .../devicetree/bindings/media/exynos5-scaler.txt | 22 + drivers/media/platform/Kconfig |8 + drivers/media/platform/Makefile|1 + drivers/media/platform/exynos-scaler/Makefile |3 + drivers/media/platform/exynos-scaler/scaler-m2m.c | 787 + drivers/media/platform/exynos-scaler/scaler-regs.c | 336 ++ drivers/media/platform/exynos-scaler/scaler-regs.h | 331 ++ drivers/media/platform/exynos-scaler/scaler.c | 1238 drivers/media/platform/exynos-scaler/scaler.h | 375 ++ drivers/media/platform/s5p-mfc/s5p_mfc.c | 28 +- drivers/media/platform/s5p-mfc/s5p_mfc_common.h| 14 +- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 55 + drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c| 26 +- drivers/media/v4l2-core/v4l2-ctrls.c |5 + include/uapi/linux/v4l2-controls.h |5 + 16 files changed, 3241 insertions(+), 34 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/exynos5-scaler.txt create mode 100644 drivers/media/platform/exynos-scaler/Makefile create mode 100644 drivers/media/platform/exynos-scaler/scaler-m2m.c create mode 100644 drivers/media/platform/exynos-scaler/scaler-regs.c create mode 100644 drivers/media/platform/exynos-scaler/scaler-regs.h create mode 100644 drivers/media/platform/exynos-scaler/scaler.c create mode 100644 drivers/media/platform/exynos-scaler/scaler.h -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
cx24116.h
Is there anywhere a datasheet for cx24116 conexant chip? Thanks -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html