summaryrefslogtreecommitdiff
path: root/src/i830_driver.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-07-08 18:06:40 -0700
committerKeith Packard <keithp@keithp.com>2009-07-10 18:26:58 -0700
commitd655a3ff423e69c19a5dc07140cbf3caaa32cb86 (patch)
tree94cc299ade3915048399c2fbc1dc05fe3210fdac /src/i830_driver.c
parent4e4b947f0b13f4a62606ccfd5729d5eb26ca0e92 (diff)
Remove NoAccel support
This removes yet another 'debugging' option that hasn't seen real use in a long time, and wasn't supported under KMS in any case. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r--src/i830_driver.c142
1 files changed, 21 insertions, 121 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 257bd6ca..cc0a1f65 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -598,49 +598,6 @@ I830LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
}
}
-static void
-i830_update_front_offset(ScrnInfoPtr pScrn)
-{
- ScreenPtr pScreen = pScrn->pScreen;
- I830Ptr pI830 = I830PTR(pScrn);
- int pitch = pScrn->displayWidth * pI830->cpp;
- pointer data = NULL;
-
- /* Update buffer locations, which may have changed as a result of
- * i830_bind_all_memory().
- */
- pScrn->fbOffset = pI830->front_buffer->offset;
-
- if (pI830->starting || pI830->accel == ACCEL_UXA)
- return;
-
- /* If we are still in ScreenInit, there is no screen pixmap to be updated
- * yet. We'll fix it up at CreateScreenResources.
- */
- if (!pI830->have_gem) {
- data = pI830->FbBase + pScrn->fbOffset; /* default to legacy */
- } else {
- dri_bo *bo = pI830->front_buffer->bo;
-
- if (bo) {
- if (pI830->kernel_exec_fencing) {
- if (drm_intel_gem_bo_map_gtt(bo))
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s: bo map failed\n",
- __FUNCTION__);
- data = bo->virtual;
- } else {
- /* Will already be pinned by bind_all_memory in this case */
- drm_intel_gem_bo_start_gtt_access(bo, 1);
- data = pI830->FbBase + bo->offset;
- }
- }
- }
- if (!pScreen->ModifyPixmapHeader(pScreen->GetScreenPixmap(pScreen),
- pScrn->virtualX, pScrn->virtualY, -1, -1,
- pitch, data))
- FatalError("Couldn't adjust screen pixmap\n");
-}
-
/**
* Adjust the screen pixmap for the current location of the front buffer.
* This is done at EnterVT when buffers are bound as long as the resources
@@ -657,10 +614,7 @@ i830CreateScreenResources(ScreenPtr pScreen)
if (!(*pScreen->CreateScreenResources)(pScreen))
return FALSE;
- i830_update_front_offset(pScrn);
-
- if (pI830->accel == ACCEL_UXA)
- i830_uxa_create_screen_resources(pScreen);
+ i830_uxa_create_screen_resources(pScreen);
return TRUE;
}
@@ -1265,13 +1219,6 @@ i830_detect_chipset(ScrnInfoPtr pScrn)
return TRUE;
}
-static const char *accel_name[] =
-{
- "unspecified",
- "no",
- "UXA",
-};
-
static Bool
I830LoadSyms(ScrnInfoPtr pScrn)
{
@@ -1358,26 +1305,13 @@ static Bool
I830AccelMethodInit(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
- MessageType from = X_PROBED;
int i, num_pipe;
- if (xf86ReturnOptValBool(pI830->Options, OPTION_NOACCEL, FALSE)) {
- pI830->accel = ACCEL_NONE;
- } else {
- pI830->accel = ACCEL_UXA;
- xf86DrvMsg(pScrn->scrnIndex, from, "Using %s for acceleration\n",
- accel_name[pI830->accel]);
- }
-
pI830->directRenderingType = DRI_NONE;
if (!xf86ReturnOptValBool(pI830->Options, OPTION_DRI, TRUE))
pI830->directRenderingType = DRI_DISABLED;
- if (pI830->accel == ACCEL_NONE) {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "DRI is disabled because it "
- "needs 2D acceleration.\n");
- pI830->directRenderingType = DRI_DISABLED;
- } else if (pScrn->depth != 16 && pScrn->depth != 24) {
+ if (pScrn->depth != 16 && pScrn->depth != 24) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "DRI is disabled because it "
"runs only at depths 16 and 24.\n");
pI830->directRenderingType = DRI_DISABLED;
@@ -1501,8 +1435,6 @@ I830DrmModeInit(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
- pI830->accel = ACCEL_UXA;
-
if (drmmode_pre_init(pScrn, pI830->drmSubFD, pI830->cpp) == FALSE) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Kernel modesetting setup failed\n");
@@ -1681,11 +1613,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
}
pScrn->currentMode = pScrn->modes;
- if (!IS_I965G(pI830) && pScrn->virtualY > 2048) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot support > 2048 vertical lines. disabling acceleration.\n");
- pI830->accel = ACCEL_NONE;
- }
-
/* Set display resolution */
xf86SetDpi(pScrn, 0, 0);
@@ -1731,19 +1658,17 @@ i830_stop_ring(ScrnInfoPtr pScrn, Bool flush)
DPRINTF(PFX, "ResetState: flush is %s\n", BOOLTOSTRING(flush));
- /* Flush the ring buffer (if enabled), then disable it. */
- if (pI830->accel != ACCEL_NONE) {
- temp = INREG(LP_RING + RING_LEN);
- if (temp & RING_VALID) {
- i830_refresh_ring(pScrn);
- i830_wait_ring_idle(pScrn);
- }
-
- OUTREG(LP_RING + RING_LEN, 0);
- OUTREG(LP_RING + RING_HEAD, 0);
- OUTREG(LP_RING + RING_TAIL, 0);
- OUTREG(LP_RING + RING_START, 0);
+ /* Flush the ring buffer, then disable it. */
+ temp = INREG(LP_RING + RING_LEN);
+ if (temp & RING_VALID) {
+ i830_refresh_ring(pScrn);
+ i830_wait_ring_idle(pScrn);
}
+
+ OUTREG(LP_RING + RING_LEN, 0);
+ OUTREG(LP_RING + RING_HEAD, 0);
+ OUTREG(LP_RING + RING_TAIL, 0);
+ OUTREG(LP_RING + RING_START, 0);
}
static void
@@ -1754,9 +1679,6 @@ i830_start_ring(ScrnInfoPtr pScrn)
DPRINTF(PFX, "SetRingRegs\n");
- if (pI830->accel == ACCEL_NONE)
- return;
-
OUTREG(LP_RING + RING_LEN, 0);
OUTREG(LP_RING + RING_TAIL, 0);
OUTREG(LP_RING + RING_HEAD, 0);
@@ -2253,9 +2175,6 @@ IntelEmitInvarientState(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
- if (pI830->accel == ACCEL_NONE)
- return;
-
/* If we've emitted our state since the last clobber by another client,
* skip it.
*/
@@ -2286,13 +2205,13 @@ I830BlockHandler(int i,
pI830->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = I830BlockHandler;
- if (pScrn->vtSema && pI830->accel != ACCEL_NONE) {
+ if (pScrn->vtSema) {
Bool flushed = FALSE;
/* Emit a flush of the rendering cache, or on the 965 and beyond
* rendering results may not hit the framebuffer until significantly
* later.
*/
- if (pI830->accel != ACCEL_NONE && (pI830->need_mi_flush || pI830->batch_used))
+ if (pI830->need_mi_flush || pI830->batch_used)
{
flushed = TRUE;
I830EmitFlush(pScrn);
@@ -2308,8 +2227,7 @@ I830BlockHandler(int i,
pI830->need_mi_flush = FALSE;
}
- if (pI830->accel == ACCEL_UXA)
- i830_uxa_block_handler (pScreen);
+ i830_uxa_block_handler (pScreen);
I830VideoBlockHandler(i, blockData, pTimeout, pReadmask);
}
@@ -2778,20 +2696,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!miSetPixmapDepths())
return FALSE;
- if (pI830->accel == ACCEL_NONE) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Xv is disabled because it "
- "needs 2D acceleration.\n");
- pI830->XvEnabled = FALSE;
- }
-
- if (pI830->accel != ACCEL_NONE && !pI830->use_drm_mode) {
- if (!pI830->have_gem && pI830->ring.mem->size == 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Disabling acceleration because the ring buffer "
- "allocation failed.\n");
- pI830->accel = ACCEL_NONE;
- }
- }
i830_init_bufmgr(pScrn);
pScrn->fbOffset = pI830->front_buffer->offset;
@@ -2837,11 +2741,10 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86DiDGAInit (pScreen, pI830->LinearAddr + pScrn->fbOffset);
- if (pI830->accel != ACCEL_NONE) {
- if (!I830AccelInit(pScreen)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Hardware acceleration initialization failed\n");
- }
+ if (!I830AccelInit(pScreen)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Hardware acceleration initialization failed\n");
+ return FALSE;
}
if (IS_I965G(pI830))
@@ -3036,7 +2939,7 @@ I830LeaveVT(int scrnIndex, int flags)
FatalError("DRM_I915_LEAVEVT failed: %s\n", strerror(ret));
}
- if (pI830->accel == ACCEL_UXA && IS_I965G(pI830))
+ if (IS_I965G(pI830))
gen4_render_state_cleanup(pScrn);
ret = drmDropMaster(pI830->drmSubFD);
@@ -3121,12 +3024,9 @@ I830EnterVT(int scrnIndex, int flags)
i830_describe_allocations(pScrn, 1, "");
- /* Update the screen pixmap in case the buffer moved */
- i830_update_front_offset(pScrn);
-
intel_batch_init(pScrn);
- if (pI830->accel == ACCEL_UXA && IS_I965G(pI830))
+ if (IS_I965G(pI830))
gen4_render_state_init(pScrn);
if (!pI830->use_drm_mode) {