sna: Take advantage of the needs_flush tracking on the front buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
0be47f459b
commit
d180c5f5f7
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue