diff options
author | Dave Airlie <airlied@redhat.com> | 2012-09-03 13:09:02 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-09-03 13:09:02 +1000 |
commit | 75c1f62f44d7b3709c1fa103d59733866967b841 (patch) | |
tree | 18910443fc22c26a36547b8a97233718faf810e2 /src/radeon_kms.c | |
parent | ca8b61e916998458203dfa4b9d0c997fa7d90ba9 (diff) |
radeon: add capability and provider support
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r-- | src/radeon_kms.c | 19 |
1 files changed, 19 insertions, 0 deletions
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) { |