Blob Blame History Raw
From 8ca090a954e26f5c24479951e22c8638346a4fd8 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 16 Jun 2016 15:21:03 +0200
Subject: [PATCH xserver 7/8] modesetting: Fix swapping of provider sink /
 source capabilities

When a card has import capability it can be an offload _sink_, not
a source and vice versa for export capability.

This commit fixes the modesetting driver to properly set these
capabilities, this went unnoticed sofar because most gpus have both
import and export capability.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
 hw/xfree86/drivers/modesetting/driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 35d3fd5..50cb880 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -884,11 +884,11 @@ PreInit(ScrnInfoPtr pScrn, int flags)
         if (value & DRM_PRIME_CAP_IMPORT) {
             pScrn->capabilities |= RR_Capability_SinkOutput;
             if (ms->drmmode.glamor)
-                pScrn->capabilities |= RR_Capability_SourceOffload;
+                pScrn->capabilities |= RR_Capability_SinkOffload;
         }
 #if GLAMOR_HAS_GBM_LINEAR
         if (value & DRM_PRIME_CAP_EXPORT && ms->drmmode.glamor)
-            pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SinkOffload;
+            pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SourceOffload;
 #endif
     }
 #endif
-- 
2.7.4