From 75c1f62f44d7b3709c1fa103d59733866967b841 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 3 Sep 2012 13:09:02 +1000 Subject: radeon: add capability and provider support Signed-off-by: Dave Airlie --- src/radeon_kms.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/radeon_kms.c') 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) { -- cgit v1.2.3