Skip to content

Commit a7b436d

Browse files
committed
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab: "For a some fixes for Kernel 3.9: - subsystem build fix when VIDEO_DEV=y, VIDEO_V4L2=m and I2C=m - compilation fix for arm multiarch preventing IR_RX51 to be selected - regression fix at bttv crop logic - s5p-mfc/m5mols/exynos: a few fixes for cameras on exynos hardware" * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: [media] [REGRESSION] bt8xx: Fix too large height in cropcap [media] fix compilation with both V4L2 and I2C as 'm' [media] m5mols: Fix bug in stream on handler [media] s5p-fimc: Do not attempt to disable not enabled media pipeline [media] s5p-mfc: Fix encoder control 15 issue [media] s5p-mfc: Fix frame skip bug [media] s5p-fimc: send valid m2m ctx to fimc_m2m_job_finish [media] exynos-gsc: send valid m2m ctx to gsc_m2m_job_finish [media] fimc-lite: Fix the variable type to avoid possible crash [media] fimc-lite: Initialize 'step' field in fimc_lite_ctrl structure [media] ir: IR_RX51 only works on OMAP2
2 parents d299c29 + 35ccece commit a7b436d

File tree

11 files changed

+53
-38
lines changed

11 files changed

+53
-38
lines changed

drivers/media/i2c/m5mols/m5mols_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ static int m5mols_s_stream(struct v4l2_subdev *sd, int enable)
724724
if (enable) {
725725
if (is_code(code, M5MOLS_RESTYPE_MONITOR))
726726
ret = m5mols_start_monitor(info);
727-
if (is_code(code, M5MOLS_RESTYPE_CAPTURE))
727+
else if (is_code(code, M5MOLS_RESTYPE_CAPTURE))
728728
ret = m5mols_start_capture(info);
729729
else
730730
ret = -EINVAL;

drivers/media/pci/bt8xx/bttv-driver.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,19 @@ static u8 SRAM_Table[][60] =
250250
vdelay start of active video in 2 * field lines relative to
251251
trailing edge of /VRESET pulse (VDELAY register).
252252
sheight height of active video in 2 * field lines.
253+
extraheight Added to sheight for cropcap.bounds.height only
253254
videostart0 ITU-R frame line number of the line corresponding
254255
to vdelay in the first field. */
255256
#define CROPCAP(minhdelayx1, hdelayx1, swidth, totalwidth, sqwidth, \
256-
vdelay, sheight, videostart0) \
257+
vdelay, sheight, extraheight, videostart0) \
257258
.cropcap.bounds.left = minhdelayx1, \
258259
/* * 2 because vertically we count field lines times two, */ \
259260
/* e.g. 23 * 2 to 23 * 2 + 576 in PAL-BGHI defrect. */ \
260261
.cropcap.bounds.top = (videostart0) * 2 - (vdelay) + MIN_VDELAY, \
261262
/* 4 is a safety margin at the end of the line. */ \
262263
.cropcap.bounds.width = (totalwidth) - (minhdelayx1) - 4, \
263-
.cropcap.bounds.height = (sheight) + (vdelay) - MIN_VDELAY, \
264+
.cropcap.bounds.height = (sheight) + (extraheight) + (vdelay) - \
265+
MIN_VDELAY, \
264266
.cropcap.defrect.left = hdelayx1, \
265267
.cropcap.defrect.top = (videostart0) * 2, \
266268
.cropcap.defrect.width = swidth, \
@@ -301,9 +303,10 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
301303
/* totalwidth */ 1135,
302304
/* sqwidth */ 944,
303305
/* vdelay */ 0x20,
304-
/* bt878 (and bt848?) can capture another
305-
line below active video. */
306-
/* sheight */ (576 + 2) + 0x20 - 2,
306+
/* sheight */ 576,
307+
/* bt878 (and bt848?) can capture another
308+
line below active video. */
309+
/* extraheight */ 2,
307310
/* videostart0 */ 23)
308311
},{
309312
.v4l2_id = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR,
@@ -330,6 +333,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
330333
/* sqwidth */ 780,
331334
/* vdelay */ 0x1a,
332335
/* sheight */ 480,
336+
/* extraheight */ 0,
333337
/* videostart0 */ 23)
334338
},{
335339
.v4l2_id = V4L2_STD_SECAM,
@@ -355,6 +359,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
355359
/* sqwidth */ 944,
356360
/* vdelay */ 0x20,
357361
/* sheight */ 576,
362+
/* extraheight */ 0,
358363
/* videostart0 */ 23)
359364
},{
360365
.v4l2_id = V4L2_STD_PAL_Nc,
@@ -380,6 +385,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
380385
/* sqwidth */ 780,
381386
/* vdelay */ 0x1a,
382387
/* sheight */ 576,
388+
/* extraheight */ 0,
383389
/* videostart0 */ 23)
384390
},{
385391
.v4l2_id = V4L2_STD_PAL_M,
@@ -405,6 +411,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
405411
/* sqwidth */ 780,
406412
/* vdelay */ 0x1a,
407413
/* sheight */ 480,
414+
/* extraheight */ 0,
408415
/* videostart0 */ 23)
409416
},{
410417
.v4l2_id = V4L2_STD_PAL_N,
@@ -430,6 +437,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
430437
/* sqwidth */ 944,
431438
/* vdelay */ 0x20,
432439
/* sheight */ 576,
440+
/* extraheight */ 0,
433441
/* videostart0 */ 23)
434442
},{
435443
.v4l2_id = V4L2_STD_NTSC_M_JP,
@@ -455,6 +463,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
455463
/* sqwidth */ 780,
456464
/* vdelay */ 0x16,
457465
/* sheight */ 480,
466+
/* extraheight */ 0,
458467
/* videostart0 */ 23)
459468
},{
460469
/* that one hopefully works with the strange timing
@@ -484,6 +493,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
484493
/* sqwidth */ 944,
485494
/* vdelay */ 0x1a,
486495
/* sheight */ 480,
496+
/* extraheight */ 0,
487497
/* videostart0 */ 23)
488498
}
489499
};

drivers/media/platform/exynos-gsc/gsc-core.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,16 +1054,18 @@ static int gsc_m2m_suspend(struct gsc_dev *gsc)
10541054

10551055
static int gsc_m2m_resume(struct gsc_dev *gsc)
10561056
{
1057+
struct gsc_ctx *ctx;
10571058
unsigned long flags;
10581059

10591060
spin_lock_irqsave(&gsc->slock, flags);
10601061
/* Clear for full H/W setup in first run after resume */
1062+
ctx = gsc->m2m.ctx;
10611063
gsc->m2m.ctx = NULL;
10621064
spin_unlock_irqrestore(&gsc->slock, flags);
10631065

10641066
if (test_and_clear_bit(ST_M2M_SUSPENDED, &gsc->state))
1065-
gsc_m2m_job_finish(gsc->m2m.ctx,
1066-
VB2_BUF_STATE_ERROR);
1067+
gsc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
1068+
10671069
return 0;
10681070
}
10691071

@@ -1204,7 +1206,7 @@ static int gsc_resume(struct device *dev)
12041206
/* Do not resume if the device was idle before system suspend */
12051207
spin_lock_irqsave(&gsc->slock, flags);
12061208
if (!test_and_clear_bit(ST_SUSPEND, &gsc->state) ||
1207-
!gsc_m2m_active(gsc)) {
1209+
!gsc_m2m_opened(gsc)) {
12081210
spin_unlock_irqrestore(&gsc->slock, flags);
12091211
return 0;
12101212
}

drivers/media/platform/s5p-fimc/fimc-core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,16 +850,18 @@ static int fimc_m2m_suspend(struct fimc_dev *fimc)
850850

851851
static int fimc_m2m_resume(struct fimc_dev *fimc)
852852
{
853+
struct fimc_ctx *ctx;
853854
unsigned long flags;
854855

855856
spin_lock_irqsave(&fimc->slock, flags);
856857
/* Clear for full H/W setup in first run after resume */
858+
ctx = fimc->m2m.ctx;
857859
fimc->m2m.ctx = NULL;
858860
spin_unlock_irqrestore(&fimc->slock, flags);
859861

860862
if (test_and_clear_bit(ST_M2M_SUSPENDED, &fimc->state))
861-
fimc_m2m_job_finish(fimc->m2m.ctx,
862-
VB2_BUF_STATE_ERROR);
863+
fimc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
864+
863865
return 0;
864866
}
865867

drivers/media/platform/s5p-fimc/fimc-lite-reg.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ static const u32 src_pixfmt_map[8][3] = {
128128
void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f)
129129
{
130130
enum v4l2_mbus_pixelcode pixelcode = dev->fmt->mbus_code;
131-
unsigned int i = ARRAY_SIZE(src_pixfmt_map);
131+
int i = ARRAY_SIZE(src_pixfmt_map);
132132
u32 cfg;
133133

134-
while (i-- >= 0) {
134+
while (--i >= 0) {
135135
if (src_pixfmt_map[i][0] == pixelcode)
136136
break;
137137
}
@@ -224,9 +224,9 @@ static void flite_hw_set_out_order(struct fimc_lite *dev, struct flite_frame *f)
224224
{ V4L2_MBUS_FMT_VYUY8_2X8, FLITE_REG_CIODMAFMT_CRYCBY },
225225
};
226226
u32 cfg = readl(dev->regs + FLITE_REG_CIODMAFMT);
227-
unsigned int i = ARRAY_SIZE(pixcode);
227+
int i = ARRAY_SIZE(pixcode);
228228

229-
while (i-- >= 0)
229+
while (--i >= 0)
230230
if (pixcode[i][0] == dev->fmt->mbus_code)
231231
break;
232232
cfg &= ~FLITE_REG_CIODMAFMT_YCBCR_ORDER_MASK;

drivers/media/platform/s5p-fimc/fimc-lite.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,6 +1408,7 @@ static const struct v4l2_ctrl_config fimc_lite_ctrl = {
14081408
.id = V4L2_CTRL_CLASS_USER | 0x1001,
14091409
.type = V4L2_CTRL_TYPE_BOOLEAN,
14101410
.name = "Test Pattern 640x480",
1411+
.step = 1,
14111412
};
14121413

14131414
static int fimc_lite_create_capture_subdev(struct fimc_lite *fimc)

drivers/media/platform/s5p-fimc/fimc-mdevice.c

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ static int fimc_md_link_notify(struct media_pad *source,
827827
struct fimc_pipeline *pipeline;
828828
struct v4l2_subdev *sd;
829829
struct mutex *lock;
830-
int ret = 0;
830+
int i, ret = 0;
831831
int ref_count;
832832

833833
if (media_entity_type(sink->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
@@ -854,29 +854,28 @@ static int fimc_md_link_notify(struct media_pad *source,
854854
return 0;
855855
}
856856

857+
mutex_lock(lock);
858+
ref_count = fimc ? fimc->vid_cap.refcnt : fimc_lite->ref_count;
859+
857860
if (!(flags & MEDIA_LNK_FL_ENABLED)) {
858-
int i;
859-
mutex_lock(lock);
860-
ret = __fimc_pipeline_close(pipeline);
861+
if (ref_count > 0) {
862+
ret = __fimc_pipeline_close(pipeline);
863+
if (!ret && fimc)
864+
fimc_ctrls_delete(fimc->vid_cap.ctx);
865+
}
861866
for (i = 0; i < IDX_MAX; i++)
862867
pipeline->subdevs[i] = NULL;
863-
if (fimc)
864-
fimc_ctrls_delete(fimc->vid_cap.ctx);
865-
mutex_unlock(lock);
866-
return ret;
868+
} else if (ref_count > 0) {
869+
/*
870+
* Link activation. Enable power of pipeline elements only if
871+
* the pipeline is already in use, i.e. its video node is open.
872+
* Recreate the controls destroyed during the link deactivation.
873+
*/
874+
ret = __fimc_pipeline_open(pipeline,
875+
source->entity, true);
876+
if (!ret && fimc)
877+
ret = fimc_capture_ctrls_create(fimc);
867878
}
868-
/*
869-
* Link activation. Enable power of pipeline elements only if the
870-
* pipeline is already in use, i.e. its video node is opened.
871-
* Recreate the controls destroyed during the link deactivation.
872-
*/
873-
mutex_lock(lock);
874-
875-
ref_count = fimc ? fimc->vid_cap.refcnt : fimc_lite->ref_count;
876-
if (ref_count > 0)
877-
ret = __fimc_pipeline_open(pipeline, source->entity, true);
878-
if (!ret && fimc)
879-
ret = fimc_capture_ctrls_create(fimc);
880879

881880
mutex_unlock(lock);
882881
return ret ? -EPIPE : ret;

drivers/media/platform/s5p-mfc/s5p_mfc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static void s5p_mfc_handle_frame_new(struct s5p_mfc_ctx *ctx, unsigned int err)
276276
unsigned int frame_type;
277277

278278
dspl_y_addr = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_y_adr, dev);
279-
frame_type = s5p_mfc_hw_call(dev->mfc_ops, get_dec_frame_type, dev);
279+
frame_type = s5p_mfc_hw_call(dev->mfc_ops, get_disp_frame_type, ctx);
280280

281281
/* If frame is same as previous then skip and do not dequeue */
282282
if (frame_type == S5P_FIMV_DECODE_FRAME_SKIPPED) {

drivers/media/platform/s5p-mfc/s5p_mfc_enc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ static struct mfc_control controls[] = {
232232
.minimum = 0,
233233
.maximum = 1,
234234
.default_value = 0,
235+
.step = 1,
235236
.menu_skip_mask = 0,
236237
},
237238
{

drivers/media/rc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ config IR_TTUSBIR
291291

292292
config IR_RX51
293293
tristate "Nokia N900 IR transmitter diode"
294-
depends on OMAP_DM_TIMER && LIRC && !ARCH_MULTIPLATFORM
294+
depends on OMAP_DM_TIMER && ARCH_OMAP2PLUS && LIRC && !ARCH_MULTIPLATFORM
295295
---help---
296296
Say Y or M here if you want to enable support for the IR
297297
transmitter diode built in the Nokia N900 (RX51) device.

0 commit comments

Comments
 (0)