diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-02-18 13:54:11 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-02-18 13:54:54 +0000 |
commit | 05320318fb940247d8749da8330215d19f41d84e (patch) | |
tree | 8f041a5cc21dd644e4727a47f7b38f5b9a0caa4e | |
parent | b99e8b022c4aaf586ae49e0eb597f0c34bc0e165 (diff) |
sna: Prefer to avoid direct rendering with FBC
If FBC is enabled, avoid the overhead of tracking rendering into the
frontbuffer by rendering into a backbuffer and flipping. Again, we have
no actual flag to indicate when FBC is enabled, so take a guess from the
module parameter.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_display.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index f2fca7c1..a1e1ffbc 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -7105,6 +7105,22 @@ sna_mode_wants_tear_free(struct sna *sna) FILE *file; int i; + file = fopen("/sys/module/i915/parameters/enable_fbc", "r"); + if (file) { + int fbc_enabled = 0; + int value; + + if (fscanf(file, "%d", &value) == 1) + fbc_enabled = value > 0; + fclose(file); + + DBG(("%s: module parameter 'enable_fbc' enabled? %d\n", + __FUNCTION__, fbc_enabled)); + + if (fbc_enabled) + return true; + } + for (i = 0; i < sna->mode.num_real_output; i++) { struct sna_output *output = to_sna_output(config->output[i]); int id = find_property(sna, output, "Panel Self-Refresh"); |