summaryrefslogtreecommitdiff
path: root/src/radeon_kms.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-10-04 12:36:56 -0400
committerAlex Deucher <alexdeucher@gmail.com>2010-10-04 12:36:56 -0400
commitbe8f45cbd313b68ad663f303c64edb4525b8f981 (patch)
tree04dab71ec915508e6bd89f3f556fd0bb32b074e5 /src/radeon_kms.c
parente843faf355c864beab81e74f0e39f8ad53d4c2bf (diff)
parentff5f466e6ca0ee541a255facff6c9198976dfd52 (diff)
Merge branch 'evergreen_accel' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-ati
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r--src/radeon_kms.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 0d6055dd..b94544e8 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -83,9 +83,15 @@ void radeon_cs_flush_indirect(ScrnInfoPtr pScrn)
return;
/* release the current VBO so we don't block on mapping it later */
- if (info->accel_state->vb_offset && info->accel_state->vb_bo) {
- radeon_vbo_put(pScrn);
- info->accel_state->vb_start_op = -1;
+ if (info->accel_state->vbo.vb_offset && info->accel_state->vbo.vb_bo) {
+ radeon_vbo_put(pScrn, &info->accel_state->vbo);
+ info->accel_state->vbo.vb_start_op = -1;
+ }
+
+ /* release the current VBO so we don't block on mapping it later */
+ if (info->accel_state->cbuf.vb_offset && info->accel_state->cbuf.vb_bo) {
+ radeon_vbo_put(pScrn, &info->accel_state->cbuf);
+ info->accel_state->cbuf.vb_start_op = -1;
}
radeon_cs_emit(info->cs);
@@ -95,11 +101,19 @@ void radeon_cs_flush_indirect(ScrnInfoPtr pScrn)
radeon_vbo_flush_bos(pScrn);
ret = radeon_cs_space_check_with_bo(info->cs,
- accel_state->vb_bo,
+ accel_state->vbo.vb_bo,
RADEON_GEM_DOMAIN_GTT, 0);
if (ret)
ErrorF("space check failed in flush\n");
+ if (accel_state->cbuf.vb_bo) {
+ ret = radeon_cs_space_check_with_bo(info->cs,
+ accel_state->cbuf.vb_bo,
+ RADEON_GEM_DOMAIN_GTT, 0);
+ if (ret)
+ ErrorF("space check failed in flush\n");
+ }
+
if (info->reemit_current2d && info->state_2d.op)
info->reemit_current2d(pScrn, info->state_2d.op);
@@ -211,8 +225,18 @@ static Bool RADEONIsAccelWorking(ScrnInfoPtr pScrn)
int r;
uint32_t tmp;
+#ifndef RADEON_INFO_ACCEL_WORKING
+#define RADEON_INFO_ACCEL_WORKING 0x03
+#endif
+#ifndef RADEON_INFO_ACCEL_WORKING2
+#define RADEON_INFO_ACCEL_WORKING2 0x05
+#endif
+
memset(&ginfo, 0, sizeof(ginfo));
- ginfo.request = 0x3;
+ if (info->dri->pKernelDRMVersion->version_minor >= 5)
+ ginfo.request = RADEON_INFO_ACCEL_WORKING2;
+ else
+ ginfo.request = RADEON_INFO_ACCEL_WORKING;
ginfo.value = (uintptr_t)&tmp;
r = drmCommandWriteRead(info->dri->drmFD, DRM_RADEON_INFO, &ginfo, sizeof(ginfo));
if (r) {
@@ -239,7 +263,6 @@ static Bool RADEONPreInitAccel_KMS(ScrnInfoPtr pScrn)
}
if (xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE) ||
- (info->ChipFamily >= CHIP_FAMILY_CEDAR) ||
(!RADEONIsAccelWorking(pScrn))) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"GPU accel disabled or not working, using shadowfb for KMS\n");