summaryrefslogtreecommitdiff
path: root/src/sna/sna_display.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-13 21:41:36 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-14 06:53:02 +0100
commit981aafe797f25aca4977a22f271d387b7fb4ae63 (patch)
treed3d8296aef53a10db3ed7f78fe80fd0ef737b3b7 /src/sna/sna_display.c
parentb27837d5372facde0f9f69eb8df664d2798f0911 (diff)
sna: Enable TearFree by default for systems with PSR
Panel Self-Refresh requires us to avoid frontbuffer rendering in order to be power efficient. This is a job for TearFree! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_display.c')
-rw-r--r--src/sna/sna_display.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index eeab3498..e1839fcc 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5200,6 +5200,25 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
return scrn->modes != NULL;
}
+bool
+sna_mode_wants_tear_free(struct sna *sna)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+ int i;
+
+ 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");
+ if (id !=-1 && output->prop_values[id] != -1) {
+ DBG(("%s: Panel Self-Refresh detected on %s\n",
+ __FUNCTION__, config->output[i]->name));
+ return true;
+ }
+ }
+
+ return false;
+}
+
void
sna_mode_close(struct sna *sna)
{