sna: flush gtt when psr_active
PATCH 1/1 sna: flush gtt when psr_active
Signed-off-by Rodrigo Vivi <[email protected]>
--- src/sna/sna_accel.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
src/sna/sna_accel.c +15 -2
@@ -14174,6 +14174,19 @@ static bool has_shadow(struct sna *sna) __FUNCTION__, sna->mode.shadow_flip));return !sna->mode.shadow_flip; } +static bool psr_active (struct sna *sna) +{ +drm_i915_getparam_t gp; +int psr_active =0 ; +int ret; + +VG_CLEAR (gp); + gp.param =27 ; + gp.value = &psr_active; + + ret =drmIoctl (sna->kgem.fd,DRM_IOCTL_I915_GETPARAM , &gp); +return ret ==0 && psr_active; +}static bool start_flush (struct sna *sna,struct sna_pixmap *scanout) {
@@ -14193,7 +14206,7 @@ static bool start_flush(struct sna *sna, struct sna_pixmap *scanout)if (!scanout)return false; -if (sna->flags &SNA_FLUSH_GTT && scanout->gpu_bo->gtt_dirty) { +if (psr_active (sna) && scanout->gpu_bo->gtt_dirty) { scanout->gpu_bo->needs_flush = true;return true; }
@@ -14219,7 +14232,7 @@ static bool stop_flush(struct sna *sna, struct sna_pixmap *scanout)if (!scanout)return false; -if (sna->flags &SNA_FLUSH_GTT && scanout->gpu_bo->gtt_dirty) { +if (psr_active (sna) && scanout->gpu_bo->gtt_dirty) { scanout->gpu_bo->needs_flush = true;return true; }
Signature · 1 line
1.7.11.7