summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-09-03 13:09:02 +1000
committerDave Airlie <airlied@redhat.com>2012-09-03 13:09:02 +1000
commit75c1f62f44d7b3709c1fa103d59733866967b841 (patch)
tree18910443fc22c26a36547b8a97233718faf810e2 /src
parentca8b61e916998458203dfa4b9d0c997fa7d90ba9 (diff)
radeon: add capability and provider support
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src')
-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) {