diff options
Diffstat (limited to 'src/nv_driver.c')
-rw-r--r-- | src/nv_driver.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nv_driver.c b/src/nv_driver.c index a02cef3..271f641 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -640,12 +640,31 @@ NVDRIGetVersion(ScrnInfoPtr pScrn) return FALSE; } return TRUE; } +static void +nouveau_setup_capabilities(ScrnInfoPtr pScrn) +{ +#ifdef NOUVEAU_PIXMAP_SHARING + NVPtr pNv = NVPTR(pScrn); + uint64_t value; + int ret; + + pScrn->capabilities = 0; + ret = drmGetCap(pNv->dev->fd, DRM_CAP_PRIME, &value); + if (ret == 0) { + if (value & DRM_PRIME_CAP_EXPORT) + pScrn->capabilities |= RR_Capability_SourceOutput; + if (value & DRM_PRIME_CAP_IMPORT) + pScrn->capabilities |= RR_Capability_SourceOffload; + } +#endif +} + static Bool NVPreInitDRM(ScrnInfoPtr pScrn) { NVPtr pNv = NVPTR(pScrn); char *bus_id; int ret; @@ -748,12 +767,14 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) /* Initialise the kernel module */ if (!NVPreInitDRM(pScrn)) NVPreInitFail("\n"); dev = pNv->dev; + nouveau_setup_capabilities(pScrn); + pScrn->chipset = malloc(sizeof(char) * 25); sprintf(pScrn->chipset, "NVIDIA NV%02x", dev->chipset); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Chipset: \"%s\"\n", pScrn->chipset); switch (dev->chipset & 0xf0) { case 0x00: |