diff options
-rw-r--r-- | v4l/ChangeLog | 13 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-hdw.c | 11 |
2 files changed, 21 insertions, 3 deletions
diff --git a/v4l/ChangeLog b/v4l/ChangeLog index 5907ae4ad..2626d66cb 100644 --- a/v4l/ChangeLog +++ b/v4l/ChangeLog @@ -1,3 +1,16 @@ +2006-01-09 06:42 mcisely + + * v4l_experimental/pvrusb2/pvrusb2-hdw.c: + (pvr2_hdw_set_ctl_value_internal): + + - Implement a module option that enables an optimization where + control changes which don't actually change anything are + eliminated. This slightly improves up tuning latency for apps + that like to spit out redundant commands during a frequency + change. (The change to implement this was almost trivial.) + + Signed-off-by: Mike Isely <isely@pobox.com> + 2006-01-09 06:33 mcisely * v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h: diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw.c b/v4l_experimental/pvrusb2/pvrusb2-hdw.c index 396c25c78..15969ac46 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-hdw.c +++ b/v4l_experimental/pvrusb2/pvrusb2-hdw.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-hdw.c,v 1.8 2006/01/09 06:37:48 mcisely Exp $ + * $Id: pvrusb2-hdw.c,v 1.9 2006/01/09 06:45:51 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -40,10 +40,13 @@ DECLARE_MUTEX(pvr2_unit_sem); static int hfull = 1; static int width = 720; +static int ctlchg = 0; static int initusbreset = 1; static int procreload = 0; static int tuner[PVR_NUM] = { [0 ... PVR_NUM-1] = -1 }; +module_param(ctlchg, int, S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(ctlchg, "0=optimize ctl change 1=always accept new ctl value"); module_param(initusbreset, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(initusbreset, "Do USB reset device on probe"); module_param(procreload, int, S_IRUGO|S_IWUSR); @@ -1337,8 +1340,10 @@ int pvr2_hdw_set_ctl_value_internal(struct pvr2_hdw *hdw, function, then treat this as a read-only value. */ return -EINVAL; } - hdw->controls[ctl_id].value = value; - hdw->controls[ctl_id].dirty = !0; + if ((hdw->controls[ctl_id].value != value) || (ctlchg != 0)) { + hdw->controls[ctl_id].value = value; + hdw->controls[ctl_id].dirty = !0; + } return 0; } |