Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7b436d3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents d299c290 35ccecef
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -724,7 +724,7 @@ static int m5mols_s_stream(struct v4l2_subdev *sd, int enable)
	if (enable) {
	if (enable) {
		if (is_code(code, M5MOLS_RESTYPE_MONITOR))
		if (is_code(code, M5MOLS_RESTYPE_MONITOR))
			ret = m5mols_start_monitor(info);
			ret = m5mols_start_monitor(info);
		if (is_code(code, M5MOLS_RESTYPE_CAPTURE))
		else if (is_code(code, M5MOLS_RESTYPE_CAPTURE))
			ret = m5mols_start_capture(info);
			ret = m5mols_start_capture(info);
		else
		else
			ret = -EINVAL;
			ret = -EINVAL;
+15 −5
Original line number Original line Diff line number Diff line
@@ -250,17 +250,19 @@ static u8 SRAM_Table[][60] =
   vdelay	start of active video in 2 * field lines relative to
   vdelay	start of active video in 2 * field lines relative to
		trailing edge of /VRESET pulse (VDELAY register).
		trailing edge of /VRESET pulse (VDELAY register).
   sheight	height of active video in 2 * field lines.
   sheight	height of active video in 2 * field lines.
   extraheight	Added to sheight for cropcap.bounds.height only
   videostart0	ITU-R frame line number of the line corresponding
   videostart0	ITU-R frame line number of the line corresponding
		to vdelay in the first field. */
		to vdelay in the first field. */
#define CROPCAP(minhdelayx1, hdelayx1, swidth, totalwidth, sqwidth,	 \
#define CROPCAP(minhdelayx1, hdelayx1, swidth, totalwidth, sqwidth,	 \
		vdelay, sheight, videostart0)				 \
		vdelay, sheight, extraheight, videostart0)		 \
	.cropcap.bounds.left = minhdelayx1,				 \
	.cropcap.bounds.left = minhdelayx1,				 \
	/* * 2 because vertically we count field lines times two, */	 \
	/* * 2 because vertically we count field lines times two, */	 \
	/* e.g. 23 * 2 to 23 * 2 + 576 in PAL-BGHI defrect. */		 \
	/* e.g. 23 * 2 to 23 * 2 + 576 in PAL-BGHI defrect. */		 \
	.cropcap.bounds.top = (videostart0) * 2 - (vdelay) + MIN_VDELAY, \
	.cropcap.bounds.top = (videostart0) * 2 - (vdelay) + MIN_VDELAY, \
	/* 4 is a safety margin at the end of the line. */		 \
	/* 4 is a safety margin at the end of the line. */		 \
	.cropcap.bounds.width = (totalwidth) - (minhdelayx1) - 4,	 \
	.cropcap.bounds.width = (totalwidth) - (minhdelayx1) - 4,	 \
	.cropcap.bounds.height = (sheight) + (vdelay) - MIN_VDELAY,	 \
	.cropcap.bounds.height = (sheight) + (extraheight) + (vdelay) -	 \
				 MIN_VDELAY,				 \
	.cropcap.defrect.left = hdelayx1,				 \
	.cropcap.defrect.left = hdelayx1,				 \
	.cropcap.defrect.top = (videostart0) * 2,			 \
	.cropcap.defrect.top = (videostart0) * 2,			 \
	.cropcap.defrect.width = swidth,				 \
	.cropcap.defrect.width = swidth,				 \
@@ -301,9 +303,10 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
			/* totalwidth */ 1135,
			/* totalwidth */ 1135,
			/* sqwidth */ 944,
			/* sqwidth */ 944,
			/* vdelay */ 0x20,
			/* vdelay */ 0x20,
			/* sheight */ 576,
			/* bt878 (and bt848?) can capture another
			/* bt878 (and bt848?) can capture another
			   line below active video. */
			   line below active video. */
			/* sheight */ (576 + 2) + 0x20 - 2,
			/* extraheight */ 2,
			/* videostart0 */ 23)
			/* videostart0 */ 23)
	},{
	},{
		.v4l2_id        = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR,
		.v4l2_id        = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR,
@@ -330,6 +333,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
			/* sqwidth */ 780,
			/* sqwidth */ 780,
			/* vdelay */ 0x1a,
			/* vdelay */ 0x1a,
			/* sheight */ 480,
			/* sheight */ 480,
			/* extraheight */ 0,
			/* videostart0 */ 23)
			/* videostart0 */ 23)
	},{
	},{
		.v4l2_id        = V4L2_STD_SECAM,
		.v4l2_id        = V4L2_STD_SECAM,
@@ -355,6 +359,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
			/* sqwidth */ 944,
			/* sqwidth */ 944,
			/* vdelay */ 0x20,
			/* vdelay */ 0x20,
			/* sheight */ 576,
			/* sheight */ 576,
			/* extraheight */ 0,
			/* videostart0 */ 23)
			/* videostart0 */ 23)
	},{
	},{
		.v4l2_id        = V4L2_STD_PAL_Nc,
		.v4l2_id        = V4L2_STD_PAL_Nc,
@@ -380,6 +385,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
			/* sqwidth */ 780,
			/* sqwidth */ 780,
			/* vdelay */ 0x1a,
			/* vdelay */ 0x1a,
			/* sheight */ 576,
			/* sheight */ 576,
			/* extraheight */ 0,
			/* videostart0 */ 23)
			/* videostart0 */ 23)
	},{
	},{
		.v4l2_id        = V4L2_STD_PAL_M,
		.v4l2_id        = V4L2_STD_PAL_M,
@@ -405,6 +411,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
			/* sqwidth */ 780,
			/* sqwidth */ 780,
			/* vdelay */ 0x1a,
			/* vdelay */ 0x1a,
			/* sheight */ 480,
			/* sheight */ 480,
			/* extraheight */ 0,
			/* videostart0 */ 23)
			/* videostart0 */ 23)
	},{
	},{
		.v4l2_id        = V4L2_STD_PAL_N,
		.v4l2_id        = V4L2_STD_PAL_N,
@@ -430,6 +437,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
			/* sqwidth */ 944,
			/* sqwidth */ 944,
			/* vdelay */ 0x20,
			/* vdelay */ 0x20,
			/* sheight */ 576,
			/* sheight */ 576,
			/* extraheight */ 0,
			/* videostart0 */ 23)
			/* videostart0 */ 23)
	},{
	},{
		.v4l2_id        = V4L2_STD_NTSC_M_JP,
		.v4l2_id        = V4L2_STD_NTSC_M_JP,
@@ -455,6 +463,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
			/* sqwidth */ 780,
			/* sqwidth */ 780,
			/* vdelay */ 0x16,
			/* vdelay */ 0x16,
			/* sheight */ 480,
			/* sheight */ 480,
			/* extraheight */ 0,
			/* videostart0 */ 23)
			/* videostart0 */ 23)
	},{
	},{
		/* that one hopefully works with the strange timing
		/* that one hopefully works with the strange timing
@@ -484,6 +493,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
			/* sqwidth */ 944,
			/* sqwidth */ 944,
			/* vdelay */ 0x1a,
			/* vdelay */ 0x1a,
			/* sheight */ 480,
			/* sheight */ 480,
			/* extraheight */ 0,
			/* videostart0 */ 23)
			/* videostart0 */ 23)
	}
	}
};
};
+5 −3
Original line number Original line Diff line number Diff line
@@ -1054,16 +1054,18 @@ static int gsc_m2m_suspend(struct gsc_dev *gsc)


static int gsc_m2m_resume(struct gsc_dev *gsc)
static int gsc_m2m_resume(struct gsc_dev *gsc)
{
{
	struct gsc_ctx *ctx;
	unsigned long flags;
	unsigned long flags;


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


	if (test_and_clear_bit(ST_M2M_SUSPENDED, &gsc->state))
	if (test_and_clear_bit(ST_M2M_SUSPENDED, &gsc->state))
		gsc_m2m_job_finish(gsc->m2m.ctx,
		gsc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
				    VB2_BUF_STATE_ERROR);

	return 0;
	return 0;
}
}


@@ -1204,7 +1206,7 @@ static int gsc_resume(struct device *dev)
	/* Do not resume if the device was idle before system suspend */
	/* Do not resume if the device was idle before system suspend */
	spin_lock_irqsave(&gsc->slock, flags);
	spin_lock_irqsave(&gsc->slock, flags);
	if (!test_and_clear_bit(ST_SUSPEND, &gsc->state) ||
	if (!test_and_clear_bit(ST_SUSPEND, &gsc->state) ||
	    !gsc_m2m_active(gsc)) {
	    !gsc_m2m_opened(gsc)) {
		spin_unlock_irqrestore(&gsc->slock, flags);
		spin_unlock_irqrestore(&gsc->slock, flags);
		return 0;
		return 0;
	}
	}
+4 −2
Original line number Original line Diff line number Diff line
@@ -850,16 +850,18 @@ static int fimc_m2m_suspend(struct fimc_dev *fimc)


static int fimc_m2m_resume(struct fimc_dev *fimc)
static int fimc_m2m_resume(struct fimc_dev *fimc)
{
{
	struct fimc_ctx *ctx;
	unsigned long flags;
	unsigned long flags;


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


	if (test_and_clear_bit(ST_M2M_SUSPENDED, &fimc->state))
	if (test_and_clear_bit(ST_M2M_SUSPENDED, &fimc->state))
		fimc_m2m_job_finish(fimc->m2m.ctx,
		fimc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
				    VB2_BUF_STATE_ERROR);

	return 0;
	return 0;
}
}


+4 −4
Original line number Original line Diff line number Diff line
@@ -128,10 +128,10 @@ static const u32 src_pixfmt_map[8][3] = {
void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f)
void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f)
{
{
	enum v4l2_mbus_pixelcode pixelcode = dev->fmt->mbus_code;
	enum v4l2_mbus_pixelcode pixelcode = dev->fmt->mbus_code;
	unsigned int i = ARRAY_SIZE(src_pixfmt_map);
	int i = ARRAY_SIZE(src_pixfmt_map);
	u32 cfg;
	u32 cfg;


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


	while (i-- >= 0)
	while (--i >= 0)
		if (pixcode[i][0] == dev->fmt->mbus_code)
		if (pixcode[i][0] == dev->fmt->mbus_code)
			break;
			break;
	cfg &= ~FLITE_REG_CIODMAFMT_YCBCR_ORDER_MASK;
	cfg &= ~FLITE_REG_CIODMAFMT_YCBCR_ORDER_MASK;
Loading