diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-07-06 20:19:00 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-07-07 11:50:12 +0100 |
commit | d180c5f5f781f4fa7f747dd7bb8073a20771cd79 (patch) | |
tree | 47929b8e69e35b302477b4c2895097a17a4bf111 | |
parent | 0be47f459ba576ed3f93367de18732fb2367357a (diff) |
sna: Take advantage of the needs_flush tracking on the front buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.h | 5 | ||||
-rw-r--r-- | src/sna/sna_display.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/sna/kgem.h b/src/sna/kgem.h index 6c1f6567..2ad975ae 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -181,8 +181,13 @@ static inline void kgem_bo_submit(struct kgem *kgem, struct kgem_bo *bo) void __kgem_flush(struct kgem *kgem, struct kgem_bo *bo); static inline void kgem_bo_flush(struct kgem *kgem, struct kgem_bo *bo) { + if (!bo->needs_flush) + return; + kgem_bo_submit(kgem, bo); __kgem_flush(kgem, bo); + + bo->needs_flush = false; } static inline struct kgem_bo *kgem_bo_reference(struct kgem_bo *bo) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 1586884b..b3b3185e 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -1787,6 +1787,12 @@ sna_do_pageflip(struct sna *sna, sna->mode.fb_pixmap = pixmap->drawable.serialNumber; bo->cpu_read = bo->cpu_write = false; bo->gpu = true; + + /* Although the kernel performs an implicit flush upon + * page-flipping, marking the bo as requiring a flush + * here ensures that the buffer goes into the active cache + * upon release. + */ bo->needs_flush = true; } else { drmModeRmFB(sna->kgem.fd, mode->fb_id); |