summaryrefslogtreecommitdiff
path: root/src/radeon_kms.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-05-04 10:44:43 +1000
committerDave Airlie <airlied@redhat.com>2011-05-04 10:45:53 +1000
commita6d2dba6573a3512d550d7e442bf42ea03012bbc (patch)
tree910707eaa013be8ccfe5d267f41113a2b98ba9be /src/radeon_kms.c
parent859e052af49e68a826b77a9135c7f067dc331a06 (diff)
radeon: add add hw DFS support for fusion
Fusion had a bug setting up the VM on earlier kernels so we need to work around that and only enable accel on a new enough kernel. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r--src/radeon_kms.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 07601708..b8fcb99b 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -213,6 +213,28 @@ radeon_flush_callback(CallbackListPtr *list,
}
}
+static Bool RADEONIsFusionGARTWorking(ScrnInfoPtr pScrn)
+{
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ struct drm_radeon_info ginfo;
+ int r;
+ uint32_t tmp;
+
+#ifndef RADEON_INFO_FUSION_GART_WORKING
+#define RADEON_INFO_FUSION_GART_WORKING 0x0c
+#endif
+ memset(&ginfo, 0, sizeof(ginfo));
+ ginfo.request = RADEON_INFO_FUSION_GART_WORKING;
+ ginfo.value = (uintptr_t)&tmp;
+ r = drmCommandWriteRead(info->dri->drmFD, DRM_RADEON_INFO, &ginfo, sizeof(ginfo));
+ if (r) {
+ return FALSE;
+ }
+ if (tmp == 1)
+ return TRUE;
+ return FALSE;
+}
+
static Bool RADEONIsAccelWorking(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
@@ -268,6 +290,11 @@ static Bool RADEONPreInitAccel_KMS(ScrnInfoPtr pScrn)
return TRUE;
}
+ if (info->ChipFamily == CHIP_FAMILY_PALM) {
+ info->accel_state->allowHWDFS = RADEONIsFusionGARTWorking(pScrn);
+ } else
+ info->accel_state->allowHWDFS = TRUE;
+
if ((info->ChipFamily == CHIP_FAMILY_RS100) ||
(info->ChipFamily == CHIP_FAMILY_RS200) ||
(info->ChipFamily == CHIP_FAMILY_RS300) ||