Skip to contentSkip to conversation

sna: Eliminate sna_mode_wants_tear_free()

PATCH New Ville Syrjala 2 participants 2 messages Apr 14, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 sna: Eliminate sna_mode_wants_tear_free()

From: Ville Syrjälä <[email protected]>

The modparam checks performed by sna_mode_wants_tear_free() don't generally work when the server is running as a regular user. Hence we can't rely on them to indicate whether FBC/PSR/etc is enabled. A lso the "Panel Self-Refresh" connector property doesn't actually exist so we can nuke that part as well. Let's just nuke the whole thing and assume we want dirtyfb always when tearfree is not enabled.

I'll anyway want to enable FBC by default across the board soonish so the check wouldn't really buy us much (would just exclude i830 and a few old desktop chipsets which don't have FBC hardware).

Additionally if we don't have working dirtyfb we really should enable tearfree by default because otherwise we're going to get horrible lag due to missing frontbuffer flushes.

Without WC mmaps we could in theory rely on the hw gtt tracking except the kernel no longer differentiates between GTT/WC/CPU access in its software frontbuffer tracking code so it'll just deactivate FBC even for a GTT mmap and potentially never re-enable it due to the missing frontbuffer flush from dirtyfb. So dirtyfb is always needed.

v2: Rebase due to ppgtt->tear free logic

---
 src/sna/sna.h         |  1 -
 src/sna/sna_display.c | 59 -------------------------------------------
 src/sna/sna_driver.c  |  9 ++-----
 3 files changed, 2 insertions(+), 67 deletions(-)
src/sna/sna.h +0 -1
index f2bc189624a5..5c92f649d054 100644
@@ -458,7 +458,6 @@ struct sna {
 
 bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna);
 bool sna_mode_fake_init(struct sna *sna, int num_fake);
-bool sna_mode_wants_tear_free(struct sna *sna);
 void sna_mode_adjust_frame(struct sna *sna, int x, int y);
 extern void sna_mode_discover(struct sna *sna, bool tell);
 extern void sna_mode_check(struct sna *sna);
src/sna/sna_display.c +0 -59

65 lines not on this page · raw message

src/sna/sna_driver.c +2 -7
index d810b262b452..15c133cfdc02 100644
@@ -469,12 +469,7 @@ static bool enable_tear_free(struct sna *sna)
 	if (sna->kgem.has_full_ppgtt)
 		return true;
 
-	/*
-	 * Under certain conditions, we should enable TearFree by default,
-	 * for example when the hardware requires pageflipping to run within
-	 * its power/performance budget.
-	 */
-	if (sna_mode_wants_tear_free(sna))
+	if (!sna->kgem.has_dirtyfb)
 		return true;
 
 	return ENABLE_TEAR_FREE;
@@ -674,7 +669,7 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int probe)
 	}
 	scrn->currentMode = scrn->modes;
 
-	if (!setup_tear_free(sna) && sna_mode_wants_tear_free(sna))
+	if (!setup_tear_free(sna))
 		sna->kgem.needs_dirtyfb = sna->kgem.has_dirtyfb;
 
 	xf86SetGamma(scrn, zeros);
Signature · 6 lines
2.26.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

[Intel-gfx] ✗ Fi.CI.BUILD: failure for sna: Eliminate sna_mode_wants_tear_free()

== Series Details ==

== Series Details ==

Series: sna: Eliminate sna_mode_wants_tear_free()
URL : https://patchwork.freedesktop.org/series/89038/
State : failure

== Summary ==

Applying: sna: Eliminate sna_mode_wants_tear_free()
error: sha1 information is lacking or useless (src/sna/sna.h).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 sna: Eliminate sna_mode_wants_tear_free() When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx