static Bool RADEONIsAccelWorking(ScrnInfoPtr pScrn)
{
RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
RADEONInfoPtr info = RADEONPTR(pScrn);
struct drm_radeon_info ginfo;
int r;
uint32_t tmp;
memset(&ginfo, 0, sizeof(ginfo));
if (info->dri2.pKernelDRMVersion->version_minor >= 5)
ginfo.request = RADEON_INFO_ACCEL_WORKING2;
else
ginfo.request = RADEON_INFO_ACCEL_WORKING;
ginfo.value = (uintptr_t)&tmp;
r = drmCommandWriteRead(pRADEONEnt->fd, DRM_RADEON_INFO, &ginfo, sizeof(ginfo));
if (r) {
/* If kernel is too old before 2.6.32 than assume accel is working */
if (r == -EINVAL) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Kernel too old missing accel "
"information, assuming accel is working\n");
return TRUE;
}
return FALSE;
}
if (info->ChipFamily == CHIP_FAMILY_HAWAII) {
if (tmp == 2 || tmp == 3)
return TRUE;
} else if (tmp) {
return TRUE;
}
return FALSE;
}