Staging: fbtft: Fix bug in fbtft-core
authorKsenija Stanojevic <ksenija.stanojevic@gmail.com>
Sun, 2 Oct 2016 15:42:35 +0000 (17:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:03:20 +0000 (15:03 +0200)
commit fc1e2c8ea85e109acf09e74789e9b852f6eed251 upstream.

Commit 367e8560e8d7a62d96e9b1d644028a3816e04206 introduced a bug
in fbtft-core where fps is always 0, this is because variable
update_time is not assigned correctly.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Fixes: 367e8560e8d7 ("Staging: fbtbt: Replace timespec with ktime_t")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fbtft-core.c

index 0c1a77cafe14191a397f6a4be43201da2f92dd75..4c281df168166bdf98b3e5afa8fd85241e0db08f 100644 (file)
@@ -391,11 +391,11 @@ static void fbtft_update_display(struct fbtft_par *par, unsigned start_line,
 
        if (unlikely(timeit)) {
                ts_end = ktime_get();
-               if (ktime_to_ns(par->update_time))
+               if (!ktime_to_ns(par->update_time))
                        par->update_time = ts_start;
 
-               par->update_time = ts_start;
                fps = ktime_us_delta(ts_start, par->update_time);
+               par->update_time = ts_start;
                fps = fps ? 1000000 / fps : 0;
 
                throughput = ktime_us_delta(ts_end, ts_start);
This page took 0.03326 seconds and 5 git commands to generate.