fbdev: don't clear more than needed
authornotaz <notasas@gmail.com>
Sun, 13 Mar 2022 23:15:51 +0000 (01:15 +0200)
committernotaz <notasas@gmail.com>
Sun, 13 Mar 2022 23:21:53 +0000 (01:21 +0200)
it wastes time for something like psx that may change modes ingame

linux/fbdev.c

index 0718861..d8d78eb 100644 (file)
@@ -155,7 +155,8 @@ out:
 
 void vout_fbdev_clear(struct vout_fbdev *fbdev)
 {
-       memset(fbdev->mem, 0, fbdev->mem_size);
+       if (fbdev->mem)
+               memset(fbdev->mem, 0, fbdev->fb_size * fbdev->buffer_count);
 }
 
 void vout_fbdev_clear_lines(struct vout_fbdev *fbdev, int y, int count)