This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] DVB: stb0899: speed up getting BER values
Author:  Klaus Schmidinger <[email protected]>
Date:    Sat Jun 2 11:04:17 2012 -0300

stb0899_read_ber() takes 500ms (half a second!) to deliver the current
BER value. Apparently it takes 5 subsequent readings, with a 100ms pause
between them (and even before the first one). This is a real performance
brake if an application freqeuently reads the BER of several devices.
The attached patch reduces this to a single reading, with no more pausing.
I didn't observe any negative side effects of this change.

Signed-off-by: Klaus Schmidinger <[email protected]>
Cc: Manu Abraham <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/dvb/frontends/stb0899_drv.c |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=fdaaee6c4a63e364b7f9c8bfdb218e6aaa65f1cf

diff --git a/drivers/media/dvb/frontends/stb0899_drv.c 
b/drivers/media/dvb/frontends/stb0899_drv.c
index 8b0dc74..5d7f8a9 100644
--- a/drivers/media/dvb/frontends/stb0899_drv.c
+++ b/drivers/media/dvb/frontends/stb0899_drv.c
@@ -1129,7 +1129,6 @@ static int stb0899_read_ber(struct dvb_frontend *fe, u32 
*ber)
        struct stb0899_internal *internal       = &state->internal;
 
        u8  lsb, msb;
-       u32 i;
 
        *ber = 0;
 
@@ -1137,14 +1136,9 @@ static int stb0899_read_ber(struct dvb_frontend *fe, u32 
*ber)
        case SYS_DVBS:
        case SYS_DSS:
                if (internal->lock) {
-                       /* average 5 BER values */
-                       for (i = 0; i < 5; i++) {
-                               msleep(100);
-                               lsb = stb0899_read_reg(state, STB0899_ECNT1L);
-                               msb = stb0899_read_reg(state, STB0899_ECNT1M);
-                               *ber += MAKEWORD16(msb, lsb);
-                       }
-                       *ber /= 5;
+                       lsb = stb0899_read_reg(state, STB0899_ECNT1L);
+                       msb = stb0899_read_reg(state, STB0899_ECNT1M);
+                       *ber = MAKEWORD16(msb, lsb);
                        /* Viterbi Check        */
                        if (STB0899_GETFIELD(VSTATUS_PRFVIT, 
internal->v_status)) {
                                /* Error Rate           */
@@ -1157,13 +1151,9 @@ static int stb0899_read_ber(struct dvb_frontend *fe, u32 
*ber)
                break;
        case SYS_DVBS2:
                if (internal->lock) {
-                       /* Average 5 PER values */
-                       for (i = 0; i < 5; i++) {
-                               msleep(100);
-                               lsb = stb0899_read_reg(state, STB0899_ECNT1L);
-                               msb = stb0899_read_reg(state, STB0899_ECNT1M);
-                               *ber += MAKEWORD16(msb, lsb);
-                       }
+                       lsb = stb0899_read_reg(state, STB0899_ECNT1L);
+                       msb = stb0899_read_reg(state, STB0899_ECNT1M);
+                       *ber = MAKEWORD16(msb, lsb);
                        /* ber = ber * 10 ^ 7   */
                        *ber *= 10000000;
                        *ber /= (-1 + (1 << (4 + 2 * STB0899_GETFIELD(NOE, 
internal->err_ctrl))));

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to