linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode.
@ 2015-08-31  9:13 Malcolm Priestley
  2015-08-31 17:03 ` Johann Klammer
  0 siblings, 1 reply; 5+ messages in thread
From: Malcolm Priestley @ 2015-08-31  9:13 UTC (permalink / raw)
  To: linux-media; +Cc: Malcolm Priestley, klammerj, stable

When in FE_TUNE_MODE_ONESHOT the frontend must report
the actual capabilities so user can take appropriate
action.

With frontends that can't do auto inversion this is done
by dvb-core automatically so CAN_INVERSION_AUTO is valid.

However, when in FE_TUNE_MODE_ONESHOT this is not true.

So only set FE_CAN_INVERSION_AUTO in modes other than
FE_TUNE_MODE_ONESHOT

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: <stable@vger.kernel.org>
---
 drivers/media/dvb-core/dvb_frontend.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index c38ef1a..e2a3833 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -2313,9 +2313,9 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 		dev_dbg(fe->dvb->device, "%s: current delivery system on cache: %d, V3 type: %d\n",
 				 __func__, c->delivery_system, fe->ops.info.type);
 
-		/* Force the CAN_INVERSION_AUTO bit on. If the frontend doesn't
-		 * do it, it is done for it. */
-		info->caps |= FE_CAN_INVERSION_AUTO;
+		/* Set CAN_INVERSION_AUTO bit on in other than oneshot mode */
+		if (!(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT))
+			info->caps |= FE_CAN_INVERSION_AUTO;
 		err = 0;
 		break;
 	}
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode.
  2015-08-31  9:13 [PATCH] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode Malcolm Priestley
@ 2015-08-31 17:03 ` Johann Klammer
  2015-08-31 17:45   ` Malcolm Priestley
  0 siblings, 1 reply; 5+ messages in thread
From: Johann Klammer @ 2015-08-31 17:03 UTC (permalink / raw)
  To: Malcolm Priestley, linux-media; +Cc: stable


Why not just remove the line?
	info->caps |= FE_CAN_INVERSION_AUTO;

The capabilities call interacting with the oneshot setting is rather weird and maybe unexpected.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode.
  2015-08-31 17:03 ` Johann Klammer
@ 2015-08-31 17:45   ` Malcolm Priestley
  2015-08-31 18:07     ` Devin Heitmueller
  0 siblings, 1 reply; 5+ messages in thread
From: Malcolm Priestley @ 2015-08-31 17:45 UTC (permalink / raw)
  To: Johann Klammer, linux-media; +Cc: stable



On 31/08/15 18:03, Johann Klammer wrote:
>
> Why not just remove the line?
> 	info->caps |= FE_CAN_INVERSION_AUTO;
>
> The capabilities call interacting with the oneshot setting is rather weird and maybe unexpected.
>
>

No, because in normal mode it can do auto inversion.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode.
  2015-08-31 17:45   ` Malcolm Priestley
@ 2015-08-31 18:07     ` Devin Heitmueller
  2015-08-31 19:12       ` Malcolm Priestley
  0 siblings, 1 reply; 5+ messages in thread
From: Devin Heitmueller @ 2015-08-31 18:07 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: Johann Klammer, Linux Media Mailing List, stable

Hi Malcolm,

>> The capabilities call interacting with the oneshot setting is rather weird
>> and maybe unexpected.
>>
>>
>
> No, because in normal mode it can do auto inversion.

This isn't my area of expertise, but I suspect this is going to cause
some pretty confusing behavior.  Generally speaking device
capabilities are queried right after the frontend is opened, and the
frontend capabilities typically don't ever change.  In this case, an
application would have to know to check the capabilities a second time
after calling FE_SET_FRONTEND_TUNE_MODE in order to determine whether
auto inversion *really* is available.

If the goal was for the software-emulated auto inversion to be
transparent to userland, perhaps it makes more sense for the oneshot
mode to toggle the inversion if needed.  The oneshot mode would
continue to disable zigzag and the stats monitoring.  I realize that
this is a bit messy since it won't really be "oneshot", but I don't
know what else can be done without breaking the ABI.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode.
  2015-08-31 18:07     ` Devin Heitmueller
@ 2015-08-31 19:12       ` Malcolm Priestley
  0 siblings, 0 replies; 5+ messages in thread
From: Malcolm Priestley @ 2015-08-31 19:12 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: Johann Klammer, Linux Media Mailing List, stable

Hi Devin

On 31/08/15 19:07, Devin Heitmueller wrote:
> Hi Malcolm,
>
>>> The capabilities call interacting with the oneshot setting is rather weird
>>> and maybe unexpected.
>>>
>>>
>>
>> No, because in normal mode it can do auto inversion.
...
>
> If the goal was for the software-emulated auto inversion to be
> transparent to userland, perhaps it makes more sense for the oneshot
> mode to toggle the inversion if needed.  The oneshot mode would
> continue to disable zigzag and the stats monitoring.  I realize that
> this is a bit messy since it won't really be "oneshot", but I don't
> know what else can be done without breaking the ABI.
>
I did think flagging INVERSION_AUTO to INVERSION_OFF on frontends
not supporting inversion in oneshot mode.

But it's still messy, as INVERSION_AUTO is need for emulation to work.

Regards


Malcolm

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-31 19:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-31  9:13 [PATCH] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode Malcolm Priestley
2015-08-31 17:03 ` Johann Klammer
2015-08-31 17:45   ` Malcolm Priestley
2015-08-31 18:07     ` Devin Heitmueller
2015-08-31 19:12       ` Malcolm Priestley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).