Commit 7729b29b authored by Michel Dänzer's avatar Michel Dänzer Committed by Michel Dänzer
Browse files

Don't advertise any PRIME offloading capabilities without acceleration



Acceleration is required even for display offloading. Trying to enable
display offloading without acceleration resulted in a crash.

(ported from radeon commit b19417e2fddf4df725951aea5ad5e9558338f59e)
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>

(cherry picked from commit 59c0a680)
parent 65ee496c
......@@ -663,25 +663,23 @@ static Bool amdgpu_get_tile_config(ScrnInfoPtr pScrn)
static void AMDGPUSetupCapabilities(ScrnInfoPtr pScrn)
{
#ifdef AMDGPU_PIXMAP_SHARING
AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
uint64_t value;
int ret;
pScrn->capabilities = 0;
/* PRIME offloading requires acceleration */
if (!info->use_glamor)
return;
ret = drmGetCap(pAMDGPUEnt->fd, DRM_CAP_PRIME, &value);
if (ret == 0) {
AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
if (value & DRM_PRIME_CAP_EXPORT) {
pScrn->capabilities |= RR_Capability_SourceOutput;
if (info->use_glamor && info->dri2.available)
pScrn->capabilities |= RR_Capability_SinkOffload;
}
if (value & DRM_PRIME_CAP_IMPORT) {
pScrn->capabilities |= RR_Capability_SinkOutput;
if (info->use_glamor && info->dri2.available)
pScrn->capabilities |= RR_Capability_SourceOffload;
}
if (value & DRM_PRIME_CAP_EXPORT)
pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SinkOffload;
if (value & DRM_PRIME_CAP_IMPORT)
pScrn->capabilities |= RR_Capability_SinkOutput | RR_Capability_SourceOffload;
}
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment