All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: e9hack <e9hack@googlemail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH RFC 00/91] Only use DVBv5 internally on frontend drivers
Date: Fri, 30 Dec 2011 11:19:51 -0200	[thread overview]
Message-ID: <4EFDBA77.2030006@redhat.com> (raw)
In-Reply-To: <4EFB3AB8.1090608@googlemail.com>

On 28-12-2011 13:50, e9hack wrote:
> Hi Mauro,
> 
> your changset breaks the auto-inversion capability of dvb_frontend.c for frontends which
> doesn't implement auto-inversion. Currently tda10021.c, tda10023.c and drxk_hard.c are not
> working. They fail at the following check:
> 
> 
>  231 static int tda10021_set_parameters (struct dvb_frontend *fe)
> ....
>  232 {
>  279         if (c->inversion != INVERSION_ON && c->inversion != INVERSION_OFF)
>  280                 return -EINVAL;
> 
> The given inversion is INVERSION_AUTO.
> 
> Regards,
> Hartmut
> 

Hi Hartmut,

Thanks for testing!

The issue here is that the dvb_frontend sometimes update only the DVBv3 parameters. 

This is probably affecting DVBv5 drivers that may be lacking some features,
like zigzag support and DVB core emulation for INVERSION_AUTO.

The enclosed patch should fix it.

I'll latter dig into dvb_frontend, in order to replace the tests for info.type
there to c->delivery_system, as it might still have some bugs there due to
that.

From: Mauro Carvalho Chehab <mchehab@redhat.com>
Date: Fri, 30 Dec 2011 10:30:25 -0200
Subject: [PATCH] dvb_frontend: Fix inversion breakage due to DVBv5 conversion

On several places inside dvb_frontend, only the DVBv3 parameters
were updated. Change it to be sure that, on all places, the DVBv5
parameters will be changed instead.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 9dd30be..9d092a6 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -288,12 +288,13 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
 	int ready = 0;
 	int fe_set_err = 0;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
-	int original_inversion = fepriv->parameters_in.inversion;
-	u32 original_frequency = fepriv->parameters_in.frequency;
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
+	int original_inversion = c->inversion;
+	u32 original_frequency = c->frequency;
 
 	/* are we using autoinversion? */
 	autoinversion = ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) &&
-			 (fepriv->parameters_in.inversion == INVERSION_AUTO));
+			 (c->inversion == INVERSION_AUTO));
 
 	/* setup parameters correctly */
 	while(!ready) {
@@ -359,19 +360,20 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
 		fepriv->auto_step, fepriv->auto_sub_step, fepriv->started_auto_step);
 
 	/* set the frontend itself */
-	fepriv->parameters_in.frequency += fepriv->lnb_drift;
+	c->frequency += fepriv->lnb_drift;
 	if (autoinversion)
-		fepriv->parameters_in.inversion = fepriv->inversion;
+		c->inversion = fepriv->inversion;
+	tmp = *c;
 	if (fe->ops.set_frontend)
 		fe_set_err = fe->ops.set_frontend(fe);
-	fepriv->parameters_out = fepriv->parameters_in;
+	*c = tmp;
 	if (fe_set_err < 0) {
 		fepriv->state = FESTATE_ERROR;
 		return fe_set_err;
 	}
 
-	fepriv->parameters_in.frequency = original_frequency;
-	fepriv->parameters_in.inversion = original_inversion;
+	c->frequency = original_frequency;
+	c->inversion = original_inversion;
 
 	fepriv->auto_sub_step++;
 	return 0;
@@ -382,6 +384,7 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 	fe_status_t s = 0;
 	int retval = 0;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
+	struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
 
 	/* if we've got no parameters, just keep idling */
 	if (fepriv->state & FESTATE_IDLE) {
@@ -393,9 +396,10 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 	/* in SCAN mode, we just set the frontend when asked and leave it alone */
 	if (fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT) {
 		if (fepriv->state & FESTATE_RETUNE) {
+			tmp = *c;
 			if (fe->ops.set_frontend)
 				retval = fe->ops.set_frontend(fe);
-			fepriv->parameters_out = fepriv->parameters_in;
+			*c = tmp;
 			if (retval < 0)
 				fepriv->state = FESTATE_ERROR;
 			else
@@ -425,8 +429,8 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 
 		/* if we're tuned, then we have determined the correct inversion */
 		if ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) &&
-		    (fepriv->parameters_in.inversion == INVERSION_AUTO)) {
-			fepriv->parameters_in.inversion = fepriv->inversion;
+		    (c->inversion == INVERSION_AUTO)) {
+			c->inversion = fepriv->inversion;
 		}
 		return;
 	}
@@ -1976,14 +1980,14 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 
 		/* force auto frequency inversion if requested */
 		if (dvb_force_auto_inversion) {
-			fepriv->parameters_in.inversion = INVERSION_AUTO;
+			c->inversion = INVERSION_AUTO;
 		}
 		if (fe->ops.info.type == FE_OFDM) {
 			/* without hierarchical coding code_rate_LP is irrelevant,
 			 * so we tolerate the otherwise invalid FEC_NONE setting */
-			if (fepriv->parameters_in.u.ofdm.hierarchy_information == HIERARCHY_NONE &&
-			    fepriv->parameters_in.u.ofdm.code_rate_LP == FEC_NONE)
-				fepriv->parameters_in.u.ofdm.code_rate_LP = FEC_AUTO;
+			if (c->hierarchy == HIERARCHY_NONE &&
+			    c->code_rate_LP == FEC_NONE)
+				c->code_rate_LP = FEC_AUTO;
 		}
 
 		/* get frontend-specific tuning settings */
@@ -1996,8 +2000,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 			switch(fe->ops.info.type) {
 			case FE_QPSK:
 				fepriv->min_delay = HZ/20;
-				fepriv->step_size = fepriv->parameters_in.u.qpsk.symbol_rate / 16000;
-				fepriv->max_drift = fepriv->parameters_in.u.qpsk.symbol_rate / 2000;
+				fepriv->step_size = c->symbol_rate / 16000;
+				fepriv->max_drift = c->symbol_rate / 2000;
 				break;
 
 			case FE_QAM:

  reply	other threads:[~2011-12-30 13:19 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-27  1:07 [PATCH RFC 00/91] Only use DVBv5 internally on frontend drivers Mauro Carvalho Chehab
2011-12-27  1:07 ` [PATCH RFC 01/91] [media] dvb-core: allow demods to specify the supported delivery systems supported standards Mauro Carvalho Chehab
2011-12-27  1:07   ` [PATCH RFC 02/91] [media] Rename set_frontend fops to set_frontend_legacy Mauro Carvalho Chehab
2011-12-27  1:07     ` [PATCH RFC 03/91] [media] dvb-core: add support for a DVBv5 get_frontend() callback Mauro Carvalho Chehab
2011-12-27  1:07       ` [PATCH RFC 04/91] [media] af9013: convert set_fontend to use DVBv5 parameters Mauro Carvalho Chehab
2011-12-27  1:07         ` [PATCH RFC 05/91] [media] atbm8830: convert set_fontend to new way and fix delivery system Mauro Carvalho Chehab
2011-12-27  1:07           ` [PATCH RFC 06/91] [media] au8522_dig: convert set_fontend to use DVBv5 parameters Mauro Carvalho Chehab
2011-12-27  1:07             ` [PATCH RFC 07/91] [media] bcm3510: " Mauro Carvalho Chehab
2011-12-27  1:07               ` [PATCH RFC 08/91] [media] cx22700: " Mauro Carvalho Chehab
2011-12-27  1:07                 ` [PATCH RFC 09/91] [media] cx22702: " Mauro Carvalho Chehab
2011-12-27  1:07                   ` [PATCH RFC 10/91] [media] cx24110: " Mauro Carvalho Chehab
2011-12-27  1:07                     ` [PATCH RFC 11/91] [media] cx24116: report delivery system and cleanups Mauro Carvalho Chehab
2011-12-27  1:08                       ` [PATCH RFC 12/91] [media] cx23123: remove an unused argument from cx24123_pll_writereg() Mauro Carvalho Chehab
2011-12-27  1:08                         ` [PATCH RFC 13/91] [media] av7110: convert set_fontend to use DVBv5 parameters Mauro Carvalho Chehab
2011-12-27  1:08                           ` [PATCH RFC 14/91] [media] cx23123: " Mauro Carvalho Chehab
2011-12-27  1:08                             ` [PATCH RFC 15/91] [media] cxd2820r: report delivery system and cleanups Mauro Carvalho Chehab
2011-12-27  1:08                               ` [PATCH RFC 16/91] [media] dibx000: convert set_fontend to use DVBv5 parameters Mauro Carvalho Chehab
2011-12-27  1:08                                 ` [PATCH RFC 17/91] [media] dib9000: remove unused parameters Mauro Carvalho Chehab
2011-12-27  1:08                                   ` [PATCH RFC 18/91] [media] cx24113: cleanup: remove unused init Mauro Carvalho Chehab
2011-12-27  1:08                                     ` [PATCH RFC 19/91] [media] dib9000: Get rid of the remaining DVBv3 legacy stuff Mauro Carvalho Chehab
2011-12-27  1:08                                       ` [PATCH RFC 20/91] [media] dib3000mb: convert set_fontend to use DVBv5 parameters Mauro Carvalho Chehab
2011-12-27  1:08                                         ` [PATCH RFC 21/91] [media] dib8000: Remove the old DVBv3 struct from it and add delsys Mauro Carvalho Chehab
2011-12-27  1:08                                           ` [PATCH RFC 22/91] [media] dib9000: get rid of unused dvb_frontend_parameters Mauro Carvalho Chehab
2011-12-27  1:08                                             ` [PATCH RFC 23/91] [media] zl10353: convert set_fontend to use DVBv5 parameters Mauro Carvalho Chehab
2011-12-27  1:08                                               ` [PATCH RFC 24/91] [media] em28xx-dvb: don't initialize drx-d non-used fields with zero Mauro Carvalho Chehab
2011-12-27  1:08                                                 ` [PATCH RFC 25/91] [media] drxd: convert set_fontend to use DVBv5 parameters Mauro Carvalho Chehab
2011-12-27  1:08                                                   ` [PATCH RFC 26/91] [media] drxk: " Mauro Carvalho Chehab
2011-12-27  1:08                                                     ` [PATCH RFC 27/91] [media] ds3000: " Mauro Carvalho Chehab
2011-12-27  1:08                                                       ` [PATCH RFC 28/91] [media] dvb_dummy_fe: " Mauro Carvalho Chehab
2011-12-27  1:08                                                         ` [PATCH RFC 29/91] [media] ec100: " Mauro Carvalho Chehab
2011-12-27  1:08                                                           ` [PATCH RFC 30/91] [media] it913x-fe: " Mauro Carvalho Chehab
2011-12-27  1:08                                                             ` [PATCH RFC 31/91] [media] l64781: " Mauro Carvalho Chehab
2011-12-27  1:08                                                               ` [PATCH RFC 32/91] [media] lgs8gl5: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                 ` [PATCH RFC 33/91] [media] lgdt330x: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                   ` [PATCH RFC 34/91] [media] lgdt3305: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                     ` [PATCH RFC 35/91] [media] lgs8gxx: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                       ` [PATCH RFC 36/91] [media] vez1x93: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                         ` [PATCH RFC 37/91] [media] mb86a16: Add delivery system type at fe struct Mauro Carvalho Chehab
2011-12-27  1:08                                                                           ` [PATCH RFC 38/91] [media] mb86a20s: convert set_fontend to use DVBv5 parameters Mauro Carvalho Chehab
2011-12-27  1:08                                                                             ` [PATCH RFC 39/91] [media] mt352: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                               ` [PATCH RFC 40/91] [media] nxt6000: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                 ` [PATCH RFC 41/91] [media] s5h1432: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                   ` [PATCH RFC 42/91] [media] sp8870: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                     ` [PATCH RFC 43/91] [media] sp887x: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                       ` [PATCH RFC 44/91] [media] stv0367: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                         ` [PATCH RFC 45/91] [media] tda10048: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                           ` [PATCH RFC 46/91] [media] tda1004x: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                             ` [PATCH RFC 47/91] [media] s921: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                               ` [PATCH RFC 48/91] [media] mt312: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                 ` [PATCH RFC 49/91] [media] s5h1420: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                   ` [PATCH RFC 50/91] [media] si21xx: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                     ` [PATCH RFC 51/91] [media] stb0899: convert get_frontend to the new struct Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                       ` [PATCH RFC 52/91] [media] stb6100: use get_frontend, instead of get_frontend_legacy() Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                         ` [PATCH RFC 53/91] [media] stv0288: convert set_fontend to use DVBv5 parameters Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                           ` [PATCH RFC 54/91] [media] stv0297: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                             ` [PATCH RFC 55/91] [media] stv0299: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                               ` [PATCH RFC 56/91] [media] stv900: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                 ` [PATCH RFC 57/91] [media] stv090x: use .delsys property, instead of get_property() Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                   ` [PATCH RFC 58/91] [media] tda10021: convert set_fontend to use DVBv5 parameters Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                     ` [PATCH RFC 59/91] [media] tda10023: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                       ` [PATCH RFC 60/91] [media] tda10071: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                         ` [PATCH RFC 61/91] [media] tda10086: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                           ` [PATCH RFC 62/91] [media] nxt200x: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                             ` [PATCH RFC 63/91] [media] or51132: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                               ` [PATCH RFC 64/91] [media] or51211: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                                 ` [PATCH RFC 65/91] [media] s5h1409: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                                   ` [PATCH RFC 66/91] [media] s55h1411: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                                     ` [PATCH RFC 67/91] [media] tda8083: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                                       ` [PATCH RFC 68/91] [media] vez1820: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                                         ` [PATCH RFC 69/91] [media] staging/as102: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                                           ` [PATCH RFC 70/91] [media] dst: " Mauro Carvalho Chehab
2011-12-27  1:08                                                                                                                                             ` [PATCH RFC 71/91] [media] af9005-fe: " Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                               ` [PATCH RFC 72/91] [media] cinergyT2-fe: " Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                 ` [PATCH RFC 73/91] [media] dtt200u-fe: " Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                   ` [PATCH RFC 74/91] [media] friio-fe: " Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                     ` [PATCH RFC 75/91] [media] gp8psk-fe: " Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                       ` [PATCH RFC 76/91] [media] mxl111sf-demod: " Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                         ` [PATCH RFC 77/91] [media] vp702x-fe: " Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                           ` [PATCH RFC 78/91] [media] vp7045-fe: " Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                             ` [PATCH RFC 79/91] [media] firedtv: " Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                               ` [PATCH RFC 80/91] [media] siano: " Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                                 ` [PATCH RFC 81/91] [media] ttusb-dec: " Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                                   ` [PATCH RFC 82/91] [media] tlg2300: " Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                                     ` [PATCH RFC 83/91] [media] dvb-core: remove get|set_frontend_legacy Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                                       ` [PATCH RFC 84/91] [media] dvb: simplify get_tune_settings() struct Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                                         ` [PATCH RFC 85/91] [media] dvb-core: Don't pass DVBv3 parameters on tune() fops Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                                           ` [PATCH RFC 86/91] [media] dvb: don't pass a DVBv3 parameter for search() fops Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                                             ` [PATCH RFC 87/91] [media] dvb: remove the track() fops Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                                               ` [PATCH RFC 88/91] [media] dvb-core: don't use fe_bandwidth_t on driver Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                                                 ` [PATCH RFC 89/91] [media] dvb: don't use DVBv3 bandwidth macros Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                                                   ` [PATCH RFC 90/91] cx23885-dvb: Remove a dirty hack that would require DVBv3 Mauro Carvalho Chehab
2011-12-27  1:09                                                                                                                                                                                     ` [PATCH RFC 91/91] [media] dvb-core: be sure that drivers won't use DVBv3 internally Mauro Carvalho Chehab
2011-12-27 12:25                                                 ` [PATCH RFC 24/91] [media] em28xx-dvb: don't initialize drx-d non-used fields with zero Andreas Oberritter
2011-12-27 10:28         ` [PATCH RFC 04/91] [media] af9013: convert set_fontend to use DVBv5 parameters Antti Palosaari
2011-12-27 11:58           ` Mauro Carvalho Chehab
2011-12-27 12:21       ` [PATCH RFC 03/91] [media] dvb-core: add support for a DVBv5 get_frontend() callback Andreas Oberritter
2011-12-27 13:49         ` Mauro Carvalho Chehab
2011-12-27 14:47           ` Andreas Oberritter
2011-12-27 17:26             ` Mauro Carvalho Chehab
2011-12-27 20:44               ` Andreas Oberritter
2011-12-27 22:33                 ` Mauro Carvalho Chehab
2011-12-27 20:47               ` Andreas Oberritter
2011-12-27 22:36                 ` Mauro Carvalho Chehab
2011-12-30 14:41                   ` Mauro Carvalho Chehab
2011-12-27 22:43                 ` Mauro Carvalho Chehab
2011-12-27 12:11   ` [PATCH RFC 01/91] [media] dvb-core: allow demods to specify the supported delivery systems supported standards Andreas Oberritter
2011-12-27 13:28     ` Mauro Carvalho Chehab
2011-12-27 14:33       ` Andreas Oberritter
2011-12-27 17:06         ` Mauro Carvalho Chehab
2011-12-27 17:33           ` Antti Palosaari
2011-12-27 17:46             ` Mauro Carvalho Chehab
2011-12-27 20:37           ` Andreas Oberritter
2011-12-27 22:07             ` Mauro Carvalho Chehab
2012-01-02  6:20           ` Manu Abraham
2011-12-27 12:31 ` [PATCH RFC 00/91] Only use DVBv5 internally on frontend drivers Andreas Oberritter
2011-12-27 13:19   ` Mauro Carvalho Chehab
2011-12-27 13:55     ` Mauro Carvalho Chehab
2011-12-28 15:50 ` e9hack
2011-12-30 13:19   ` Mauro Carvalho Chehab [this message]
2011-12-30 17:16     ` e9hack
2011-12-30 17:36       ` Mauro Carvalho Chehab
2011-12-30 17:37       ` [PATCH] [media] tda18271c2dd: fix support for DVB-C Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EFDBA77.2030006@redhat.com \
    --to=mchehab@redhat.com \
    --cc=e9hack@googlemail.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.