summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/drmmode_display.c4
-rw-r--r--src/radeon_kms.c19
2 files changed, 23 insertions, 0 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 6a357283..9b9fc831 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1549,6 +1549,10 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
/* workout clones */
drmmode_clones_init(pScrn, drmmode);
+#ifdef RADEON_PIXMAP_SHARING
+ xf86ProviderSetup(pScrn, NULL, "radeon");
+#endif
+
xf86InitialConfiguration(pScrn, TRUE);
drmmode->event_context.version = DRM_EVENT_CONTEXT_VERSION;
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 09aea7e4..81cb5ba1 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -715,6 +715,24 @@ static Bool r600_get_tile_config(ScrnInfoPtr pScrn)
#endif /* EXA_MIXED_PIXMAPS */
+static void RADEONSetupCapabilities(ScrnInfoPtr pScrn)
+{
+#ifdef RADEON_PIXMAP_SHARING
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ uint64_t value;
+ int ret;
+
+ pScrn->capabilities = 0;
+ ret = drmGetCap(info->dri2.drm_fd, DRM_CAP_PRIME, &value);
+ if (ret == 0) {
+ if (value & DRM_PRIME_CAP_EXPORT)
+ pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SinkOffload;
+ if (value & DRM_PRIME_CAP_IMPORT)
+ pScrn->capabilities |= RR_Capability_SourceOffload;
+ }
+#endif
+}
+
Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
{
RADEONInfoPtr info;
@@ -797,6 +815,7 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
info->allowColorTiling2D = FALSE;
+ RADEONSetupCapabilities(pScrn);
#ifdef EXA_MIXED_PIXMAPS
/* don't enable tiling if accel is not enabled */
if (!info->r600_shadow_fb) {