[Intel-gfx] [PATCH 05/14] unifdef I830_USE_UXA.
Eric Anholt
eric at anholt.net
Wed Apr 22 01:13:27 CEST 2009
We only have on acceleration architecture now, and you can always build it
if you're building the driver.
---
src/Makefile.am | 2 +-
src/i830.h | 8 --------
src/i830_accel.c | 6 +-----
src/i830_batchbuffer.h | 4 ----
src/i830_driver.c | 33 ++++++---------------------------
src/i830_exa.c | 16 +++-------------
6 files changed, 11 insertions(+), 58 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index d4b9c8a..c4b9ab0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -32,7 +32,7 @@ SUBDIRS = xvmc bios_reader ch7017 ch7xxx ivch sil164 tfp410 $(REGDUMPER)
AM_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \
@PCIACCESS_CFLAGS@ -I$(top_srcdir)/uxa \
- -DI830_XV -DI830_USE_UXA
+ -DI830_XV
intel_drv_la_LTLIBRARIES = intel_drv.la
intel_drv_la_LDFLAGS = -module -avoid-version
diff --git a/src/i830.h b/src/i830.h
index 20b039f..e8975cc 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -73,19 +73,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "intel_bufmgr.h"
#include "i915_drm.h"
-#ifdef I830_USE_UXA
#include "uxa.h"
Bool i830_uxa_init(ScreenPtr pScreen);
void i830_uxa_create_screen_resources(ScreenPtr pScreen);
void i830_uxa_block_handler (ScreenPtr pScreen);
Bool i830_get_aperture_space(ScrnInfoPtr pScrn, drm_intel_bo **bo_table,
int num_bos);
-#endif
-#if defined(I830_USE_UXA)
dri_bo *i830_get_pixmap_bo (PixmapPtr pixmap);
void i830_set_pixmap_bo(PixmapPtr pixmap, dri_bo *bo);
-#endif
typedef struct _I830OutputRec I830OutputRec, *I830OutputPtr;
@@ -443,14 +439,10 @@ typedef struct _I830Rec {
void (*batch_flush_notify)(ScrnInfoPtr pScrn);
-#ifdef I830_USE_UXA
uxa_driver_t *uxa_driver;
Bool need_flush;
-#endif
Bool need_sync;
-#if defined(I830_USE_UXA)
PixmapPtr pSrcPixmap;
-#endif
int accel_pixmap_pitch_alignment;
int accel_pixmap_offset_alignment;
int accel_max_x;
diff --git a/src/i830_accel.c b/src/i830_accel.c
index 5af02c9..b975e6d 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -124,9 +124,7 @@ I830WaitLpRing(ScrnInfoPtr pScrn, int n, int timeout_millis)
else
i830_dump_error_state(pScrn);
ErrorF("space: %d wanted %d\n", ring->space, n);
-#ifdef I830_USE_UXA
- pI830->uxa_driver = NULL;
-#endif
+ pI830->uxa_driver = NULL;
FatalError("lockup\n");
}
@@ -283,9 +281,7 @@ I830AccelInit(ScreenPtr pScreen)
switch (pI830->accel) {
case ACCEL_UXA:
-#ifdef I830_USE_UXA
return i830_uxa_init(pScreen);
-#endif
case ACCEL_UNINIT:
case ACCEL_NONE:
break;
diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h
index f16023d..d011417 100644
--- a/src/i830_batchbuffer.h
+++ b/src/i830_batchbuffer.h
@@ -100,18 +100,14 @@ intel_batch_emit_reloc_pixmap(I830Ptr pI830, PixmapPtr pPixmap,
uint32_t read_domains, uint32_t write_domain,
uint32_t delta)
{
-#if I830_USE_UXA
dri_bo *bo = i830_get_pixmap_bo(pPixmap);
-#endif
uint32_t offset;
assert(pI830->batch_ptr != NULL);
assert(intel_batch_space(pI830) >= 4);
-#if I830_USE_UXA
if (bo) {
intel_batch_emit_reloc(pI830, bo, read_domains, write_domain, delta);
return;
}
-#endif
offset = intel_get_pixmap_offset(pPixmap);
*(uint32_t *)(pI830->batch_ptr + pI830->batch_used) = offset + delta;
pI830->batch_used += 4;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index aad04ab..44d7d75 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -843,10 +843,9 @@ i830CreateScreenResources(ScreenPtr pScreen)
i830_update_front_offset(pScrn);
-#ifdef I830_USE_UXA
if (pI830->accel == ACCEL_UXA)
i830_uxa_create_screen_resources(pScreen);
-#endif
+
return TRUE;
}
@@ -2459,10 +2458,8 @@ I830BlockHandler(int i,
pI830->need_mi_flush = FALSE;
}
-#ifdef I830_USE_UXA
if (pI830->accel == ACCEL_UXA)
i830_uxa_block_handler (pScreen);
-#endif
I830VideoBlockHandler(i, blockData, pTimeout, pReadmask);
}
@@ -3324,13 +3321,11 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
vgaHWUnmapMem(pScrn);
}
-#ifdef I830_USE_UXA
if (pI830->uxa_driver) {
uxa_driver_fini (pScreen);
xfree (pI830->uxa_driver);
pI830->uxa_driver = NULL;
}
-#endif
xf86_cursors_fini (pScreen);
i830_allocator_fini(pScrn);
@@ -3460,17 +3455,9 @@ i830WaitSync(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
- switch (pI830->accel) {
-#ifdef I830_USE_UXA
- case ACCEL_UXA:
- if (pI830->uxa_driver && pI830->need_sync) {
- pI830->need_sync = FALSE;
- I830Sync(pScrn);
- }
- break;
-#endif
- default:
- break;
+ if (pI830->uxa_driver && pI830->need_sync) {
+ pI830->need_sync = FALSE;
+ I830Sync(pScrn);
}
}
@@ -3479,16 +3466,8 @@ i830MarkSync(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
- switch (pI830->accel) {
-#ifdef I830_USE_UXA
- case ACCEL_UXA:
- if (pI830->uxa_driver)
- pI830->need_sync = TRUE;
- break;
-#endif
- default:
- break;
- }
+ if (pI830->uxa_driver)
+ pI830->need_sync = TRUE;
}
void
diff --git a/src/i830_exa.c b/src/i830_exa.c
index f04d58e..d24b52d 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -79,9 +79,7 @@ const int I830PatternROP[16] =
ROP_1
};
-#ifdef I830_USE_UXA
static int uxa_pixmap_index;
-#endif
/**
* Returns whether a given pixmap is tiled or not.
@@ -455,13 +453,10 @@ i830_get_pixmap_bo(PixmapPtr pixmap)
ScrnInfoPtr scrn = xf86Screens[screen->myNum];
I830Ptr i830 = I830PTR(scrn);
-#ifdef I830_USE_UXA
- if (i830->accel == ACCEL_UXA) {
+ if (i830->accel == ACCEL_UXA)
return dixLookupPrivate(&pixmap->devPrivates, &uxa_pixmap_index);
- }
-#endif
-
- return NULL;
+ else
+ return NULL;
}
void
@@ -473,16 +468,12 @@ i830_set_pixmap_bo(PixmapPtr pixmap, dri_bo *bo)
if (old_bo)
dri_bo_unreference (old_bo);
-#if I830_USE_UXA
if (i830->accel == ACCEL_UXA) {
dri_bo_reference(bo);
dixSetPrivate(&pixmap->devPrivates, &uxa_pixmap_index, bo);
}
-#endif
}
-#if defined(I830_USE_UXA)
-
static void
i830_uxa_set_pixmap_bo (PixmapPtr pixmap, dri_bo *bo)
{
@@ -735,4 +726,3 @@ i830_uxa_init (ScreenPtr pScreen)
return TRUE;
}
-#endif /* I830_USE_UXA */
--
1.6.2.2
More information about the Intel-gfx
mailing list