[PATCH v2] PRIME: Don't advertise offload capabilities when acceleration is disabled
Alex Deucher
alexdeucher at gmail.com
Wed Oct 22 20:43:54 PDT 2014
On Wed, Oct 22, 2014 at 9:08 PM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Xorg tends to crash if the user tries to actually use the offload
> capabilities with acceleration disabled.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57200
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>
> v2: Add bugzilla tag
>
> src/radeon_kms.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index 4666988..b6d11e8 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -778,10 +778,16 @@ static void RADEONSetupCapabilities(ScrnInfoPtr pScrn)
> 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 | RR_Capability_SinkOutput;
> + if (value & DRM_PRIME_CAP_EXPORT) {
> + pScrn->capabilities |= RR_Capability_SourceOutput;
> + if (!info->r600_shadow_fb && info->dri2.available)
> + pScrn->capabilities |= RR_Capability_SinkOffload;
> + }
> + if (value & DRM_PRIME_CAP_IMPORT) {
> + pScrn->capabilities |= RR_Capability_SinkOutput;
> + if (!info->r600_shadow_fb && info->dri2.available)
> + pScrn->capabilities |= RR_Capability_SourceOffload;
> + }
> }
> #endif
> }
> --
> 2.1.1
>
> _______________________________________________
> xorg-driver-ati mailing list
> xorg-driver-ati at lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati
More information about the xorg-driver-ati
mailing list