Skip to content

Commit d57f300

Browse files
Martijn VersteeghMartijn Versteegh
authored andcommitted
Don't write to tft registers from sysfs store handler.
Writing to registers of the device directly from the sysfs store handler leads to race conditions with updating the screen. Just set the variable and update the scroll pos from the next update_display call. This means the scrolling might not actually happen until you draw something to the screen. But as scrolling without drawing a new scanline is not very useful anyway this is a minor annoyance.
1 parent 4a6fd8d commit d57f300

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

drivers/staging/fbtft/fbtft-core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,11 @@ static void fbtft_update_display(struct fbtft_par *par, unsigned int start_line,
358358
}
359359
}
360360

361+
if (par->fbtftops.set_scroll)
362+
{
363+
par->fbtftops.set_scroll(par);
364+
}
365+
361366
/* Sanity checks */
362367
if (start_line > end_line) {
363368
dev_warn(par->info->device,

drivers/staging/fbtft/fbtft-sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ static ssize_t store_scroll(struct device *device,
219219
if (ret)
220220
return ret;
221221

222-
if (par->fbtftops.set_scroll)
223-
par->fbtftops.set_scroll(par);
222+
// if (par->fbtftops.set_scroll)
223+
// par->fbtftops.set_scroll(par);
224224

225225

226226
return count;

0 commit comments

Comments
 (0)